From ca7e4ce97a39f1536047478388302c708d34d372 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 16 Dec 2008 15:59:06 +0100 Subject: Move shared gen_ndr files to librpc/gen_ndr in the root. At the moment these files are used just by Samba 3, but the next step will be using them from Samba 4 as well. --- librpc/gen_ndr/cli_dfs.c | 1099 ++ librpc/gen_ndr/cli_dfs.h | 138 + librpc/gen_ndr/cli_drsuapi.c | 1167 ++ librpc/gen_ndr/cli_drsuapi.h | 144 + librpc/gen_ndr/cli_dssetup.c | 465 + librpc/gen_ndr/cli_dssetup.h | 39 + librpc/gen_ndr/cli_echo.c | 410 + librpc/gen_ndr/cli_echo.h | 43 + librpc/gen_ndr/cli_epmapper.c | 347 + librpc/gen_ndr/cli_epmapper.h | 44 + librpc/gen_ndr/cli_eventlog.c | 915 ++ librpc/gen_ndr/cli_eventlog.h | 73 + librpc/gen_ndr/cli_initshutdown.c | 155 + librpc/gen_ndr/cli_initshutdown.h | 25 + librpc/gen_ndr/cli_lsa.c | 3435 +++++ librpc/gen_ndr/cli_lsa.h | 387 + librpc/gen_ndr/cli_netlogon.c | 2352 +++ librpc/gen_ndr/cli_netlogon.h | 370 + librpc/gen_ndr/cli_ntsvcs.c | 2744 ++++ librpc/gen_ndr/cli_ntsvcs.h | 229 + librpc/gen_ndr/cli_samr.c | 2962 ++++ librpc/gen_ndr/cli_samr.h | 389 + librpc/gen_ndr/cli_srvsvc.c | 2632 ++++ librpc/gen_ndr/cli_srvsvc.h | 344 + librpc/gen_ndr/cli_svcctl.c | 2245 +++ librpc/gen_ndr/cli_svcctl.h | 336 + librpc/gen_ndr/cli_winreg.c | 1726 +++ librpc/gen_ndr/cli_winreg.h | 229 + librpc/gen_ndr/cli_wkssvc.c | 1570 ++ librpc/gen_ndr/cli_wkssvc.h | 230 + librpc/gen_ndr/dfs.h | 582 + librpc/gen_ndr/drsblobs.h | 534 + librpc/gen_ndr/drsuapi.h | 1770 +++ librpc/gen_ndr/dssetup.h | 211 + librpc/gen_ndr/echo.h | 213 + librpc/gen_ndr/epmapper.h | 357 + librpc/gen_ndr/eventlog.h | 287 + librpc/gen_ndr/initshutdown.h | 54 + librpc/gen_ndr/krb5pac.h | 150 + librpc/gen_ndr/lsa.h | 1785 +++ librpc/gen_ndr/misc.h | 45 + librpc/gen_ndr/named_pipe_auth.h | 32 + librpc/gen_ndr/nbt.h | 694 + librpc/gen_ndr/ndr_dfs.c | 5795 ++++++++ librpc/gen_ndr/ndr_dfs.h | 132 + librpc/gen_ndr/ndr_drsblobs.c | 4267 ++++++ librpc/gen_ndr/ndr_drsblobs.h | 159 + librpc/gen_ndr/ndr_drsuapi.c | 14532 ++++++++++++++++++ librpc/gen_ndr/ndr_drsuapi.h | 301 + librpc/gen_ndr/ndr_dssetup.c | 1082 ++ librpc/gen_ndr/ndr_dssetup.h | 58 + librpc/gen_ndr/ndr_echo.c | 1513 ++ librpc/gen_ndr/ndr_echo.h | 60 + librpc/gen_ndr/ndr_epmapper.c | 2692 ++++ librpc/gen_ndr/ndr_epmapper.h | 76 + librpc/gen_ndr/ndr_eventlog.c | 1755 +++ librpc/gen_ndr/ndr_eventlog.h | 92 + librpc/gen_ndr/ndr_initshutdown.c | 330 + librpc/gen_ndr/ndr_initshutdown.h | 24 + librpc/gen_ndr/ndr_krb5pac.c | 984 ++ librpc/gen_ndr/ndr_krb5pac.h | 61 + librpc/gen_ndr/ndr_lsa.c | 13236 +++++++++++++++++ librpc/gen_ndr/ndr_lsa.h | 400 + librpc/gen_ndr/ndr_misc.c | 134 + librpc/gen_ndr/ndr_misc.h | 23 + librpc/gen_ndr/ndr_named_pipe_auth.c | 302 + librpc/gen_ndr/ndr_named_pipe_auth.h | 20 + librpc/gen_ndr/ndr_nbt.c | 3364 +++++ librpc/gen_ndr/ndr_nbt.h | 104 + librpc/gen_ndr/ndr_netlogon.c | 16203 ++++++++++++++++++++ librpc/gen_ndr/ndr_netlogon.h | 281 + librpc/gen_ndr/ndr_ntsvcs.c | 3890 +++++ librpc/gen_ndr/ndr_ntsvcs.h | 211 + librpc/gen_ndr/ndr_samr.c | 12856 ++++++++++++++++ librpc/gen_ndr/ndr_samr.h | 349 + librpc/gen_ndr/ndr_security.c | 1032 ++ librpc/gen_ndr/ndr_security.h | 54 + librpc/gen_ndr/ndr_srvsvc.c | 19687 +++++++++++++++++++++++++ librpc/gen_ndr/ndr_srvsvc.h | 322 + librpc/gen_ndr/ndr_svcctl.c | 6414 ++++++++ librpc/gen_ndr/ndr_svcctl.h | 160 + librpc/gen_ndr/ndr_winreg.c | 4495 ++++++ librpc/gen_ndr/ndr_winreg.h | 164 + librpc/gen_ndr/ndr_wkssvc.c | 10679 ++++++++++++++ librpc/gen_ndr/ndr_wkssvc.h | 175 + librpc/gen_ndr/ndr_xattr.c | 773 + librpc/gen_ndr/ndr_xattr.h | 34 + librpc/gen_ndr/netlogon.h | 1735 +++ librpc/gen_ndr/ntsvcs.h | 591 + librpc/gen_ndr/samr.h | 1827 +++ librpc/gen_ndr/security.h | 354 + librpc/gen_ndr/srv_dfs.c | 1754 +++ librpc/gen_ndr/srv_dfs.h | 29 + librpc/gen_ndr/srv_dssetup.c | 845 ++ librpc/gen_ndr/srv_dssetup.h | 17 + librpc/gen_ndr/srv_echo.c | 805 + librpc/gen_ndr/srv_echo.h | 16 + librpc/gen_ndr/srv_epmapper.c | 646 + librpc/gen_ndr/srv_epmapper.h | 14 + librpc/gen_ndr/srv_eventlog.c | 1842 +++ librpc/gen_ndr/srv_eventlog.h | 30 + librpc/gen_ndr/srv_initshutdown.c | 246 + librpc/gen_ndr/srv_initshutdown.h | 9 + librpc/gen_ndr/srv_lsa.c | 6389 ++++++++ librpc/gen_ndr/srv_lsa.h | 88 + librpc/gen_ndr/srv_netlogon.c | 3896 +++++ librpc/gen_ndr/srv_netlogon.h | 53 + librpc/gen_ndr/srv_ntsvcs.c | 4877 ++++++ librpc/gen_ndr/srv_ntsvcs.h | 71 + librpc/gen_ndr/srv_samr.c | 5482 +++++++ librpc/gen_ndr/srv_samr.h | 74 + librpc/gen_ndr/srv_srvsvc.c | 4196 ++++++ librpc/gen_ndr/srv_srvsvc.h | 60 + librpc/gen_ndr/srv_svcctl.c | 3615 +++++ librpc/gen_ndr/srv_svcctl.h | 50 + librpc/gen_ndr/srv_winreg.c | 2772 ++++ librpc/gen_ndr/srv_winreg.h | 41 + librpc/gen_ndr/srv_wkssvc.c | 2412 +++ librpc/gen_ndr/srv_wkssvc.h | 37 + librpc/gen_ndr/srvsvc.h | 1806 +++ librpc/gen_ndr/svcctl.h | 811 + librpc/gen_ndr/tables.c | 83 + librpc/gen_ndr/winreg.h | 623 + librpc/gen_ndr/wkssvc.h | 981 ++ librpc/gen_ndr/xattr.h | 91 + source3/Makefile.in | 108 +- source3/librpc/gen_ndr/cli_dfs.c | 1099 -- source3/librpc/gen_ndr/cli_dfs.h | 138 - source3/librpc/gen_ndr/cli_drsuapi.c | 1167 -- source3/librpc/gen_ndr/cli_drsuapi.h | 144 - source3/librpc/gen_ndr/cli_dssetup.c | 465 - source3/librpc/gen_ndr/cli_dssetup.h | 39 - source3/librpc/gen_ndr/cli_echo.c | 410 - source3/librpc/gen_ndr/cli_echo.h | 43 - source3/librpc/gen_ndr/cli_epmapper.c | 347 - source3/librpc/gen_ndr/cli_epmapper.h | 44 - source3/librpc/gen_ndr/cli_eventlog.c | 915 -- source3/librpc/gen_ndr/cli_eventlog.h | 73 - source3/librpc/gen_ndr/cli_initshutdown.c | 155 - source3/librpc/gen_ndr/cli_initshutdown.h | 25 - source3/librpc/gen_ndr/cli_lsa.c | 3435 ----- source3/librpc/gen_ndr/cli_lsa.h | 387 - source3/librpc/gen_ndr/cli_netlogon.c | 2352 --- source3/librpc/gen_ndr/cli_netlogon.h | 370 - source3/librpc/gen_ndr/cli_ntsvcs.c | 2744 ---- source3/librpc/gen_ndr/cli_ntsvcs.h | 229 - source3/librpc/gen_ndr/cli_samr.c | 2962 ---- source3/librpc/gen_ndr/cli_samr.h | 389 - source3/librpc/gen_ndr/cli_srvsvc.c | 2632 ---- source3/librpc/gen_ndr/cli_srvsvc.h | 344 - source3/librpc/gen_ndr/cli_svcctl.c | 2245 --- source3/librpc/gen_ndr/cli_svcctl.h | 336 - source3/librpc/gen_ndr/cli_winreg.c | 1726 --- source3/librpc/gen_ndr/cli_winreg.h | 229 - source3/librpc/gen_ndr/cli_wkssvc.c | 1570 -- source3/librpc/gen_ndr/cli_wkssvc.h | 230 - source3/librpc/gen_ndr/dfs.h | 582 - source3/librpc/gen_ndr/drsblobs.h | 534 - source3/librpc/gen_ndr/drsuapi.h | 1770 --- source3/librpc/gen_ndr/dssetup.h | 211 - source3/librpc/gen_ndr/echo.h | 213 - source3/librpc/gen_ndr/epmapper.h | 357 - source3/librpc/gen_ndr/eventlog.h | 287 - source3/librpc/gen_ndr/initshutdown.h | 54 - source3/librpc/gen_ndr/krb5pac.h | 150 - source3/librpc/gen_ndr/lsa.h | 1785 --- source3/librpc/gen_ndr/misc.h | 45 - source3/librpc/gen_ndr/named_pipe_auth.h | 32 - source3/librpc/gen_ndr/nbt.h | 694 - source3/librpc/gen_ndr/ndr_dfs.c | 5795 -------- source3/librpc/gen_ndr/ndr_dfs.h | 132 - source3/librpc/gen_ndr/ndr_drsblobs.c | 4267 ------ source3/librpc/gen_ndr/ndr_drsblobs.h | 159 - source3/librpc/gen_ndr/ndr_drsuapi.c | 14532 ------------------ source3/librpc/gen_ndr/ndr_drsuapi.h | 301 - source3/librpc/gen_ndr/ndr_dssetup.c | 1082 -- source3/librpc/gen_ndr/ndr_dssetup.h | 58 - source3/librpc/gen_ndr/ndr_echo.c | 1513 -- source3/librpc/gen_ndr/ndr_echo.h | 60 - source3/librpc/gen_ndr/ndr_epmapper.c | 2692 ---- source3/librpc/gen_ndr/ndr_epmapper.h | 76 - source3/librpc/gen_ndr/ndr_eventlog.c | 1755 --- source3/librpc/gen_ndr/ndr_eventlog.h | 92 - source3/librpc/gen_ndr/ndr_initshutdown.c | 330 - source3/librpc/gen_ndr/ndr_initshutdown.h | 24 - source3/librpc/gen_ndr/ndr_krb5pac.c | 984 -- source3/librpc/gen_ndr/ndr_krb5pac.h | 61 - source3/librpc/gen_ndr/ndr_lsa.c | 13236 ----------------- source3/librpc/gen_ndr/ndr_lsa.h | 400 - source3/librpc/gen_ndr/ndr_misc.c | 134 - source3/librpc/gen_ndr/ndr_misc.h | 23 - source3/librpc/gen_ndr/ndr_named_pipe_auth.c | 302 - source3/librpc/gen_ndr/ndr_named_pipe_auth.h | 20 - source3/librpc/gen_ndr/ndr_nbt.c | 3364 ----- source3/librpc/gen_ndr/ndr_nbt.h | 104 - source3/librpc/gen_ndr/ndr_netlogon.c | 16203 -------------------- source3/librpc/gen_ndr/ndr_netlogon.h | 281 - source3/librpc/gen_ndr/ndr_ntsvcs.c | 3890 ----- source3/librpc/gen_ndr/ndr_ntsvcs.h | 211 - source3/librpc/gen_ndr/ndr_samr.c | 12856 ---------------- source3/librpc/gen_ndr/ndr_samr.h | 349 - source3/librpc/gen_ndr/ndr_security.c | 1032 -- source3/librpc/gen_ndr/ndr_security.h | 54 - source3/librpc/gen_ndr/ndr_srvsvc.c | 19687 ------------------------- source3/librpc/gen_ndr/ndr_srvsvc.h | 322 - source3/librpc/gen_ndr/ndr_svcctl.c | 6414 -------- source3/librpc/gen_ndr/ndr_svcctl.h | 160 - source3/librpc/gen_ndr/ndr_winreg.c | 4495 ------ source3/librpc/gen_ndr/ndr_winreg.h | 164 - source3/librpc/gen_ndr/ndr_wkssvc.c | 10679 -------------- source3/librpc/gen_ndr/ndr_wkssvc.h | 175 - source3/librpc/gen_ndr/ndr_xattr.c | 773 - source3/librpc/gen_ndr/ndr_xattr.h | 34 - source3/librpc/gen_ndr/netlogon.h | 1735 --- source3/librpc/gen_ndr/ntsvcs.h | 591 - source3/librpc/gen_ndr/samr.h | 1827 --- source3/librpc/gen_ndr/security.h | 354 - source3/librpc/gen_ndr/srv_dfs.c | 1754 --- source3/librpc/gen_ndr/srv_dfs.h | 29 - source3/librpc/gen_ndr/srv_dssetup.c | 845 -- source3/librpc/gen_ndr/srv_dssetup.h | 17 - source3/librpc/gen_ndr/srv_echo.c | 805 - source3/librpc/gen_ndr/srv_echo.h | 16 - source3/librpc/gen_ndr/srv_epmapper.c | 646 - source3/librpc/gen_ndr/srv_epmapper.h | 14 - source3/librpc/gen_ndr/srv_eventlog.c | 1842 --- source3/librpc/gen_ndr/srv_eventlog.h | 30 - source3/librpc/gen_ndr/srv_initshutdown.c | 246 - source3/librpc/gen_ndr/srv_initshutdown.h | 9 - source3/librpc/gen_ndr/srv_lsa.c | 6389 -------- source3/librpc/gen_ndr/srv_lsa.h | 88 - source3/librpc/gen_ndr/srv_netlogon.c | 3896 ----- source3/librpc/gen_ndr/srv_netlogon.h | 53 - source3/librpc/gen_ndr/srv_ntsvcs.c | 4877 ------ source3/librpc/gen_ndr/srv_ntsvcs.h | 71 - source3/librpc/gen_ndr/srv_samr.c | 5482 ------- source3/librpc/gen_ndr/srv_samr.h | 74 - source3/librpc/gen_ndr/srv_srvsvc.c | 4196 ------ source3/librpc/gen_ndr/srv_srvsvc.h | 60 - source3/librpc/gen_ndr/srv_svcctl.c | 3615 ----- source3/librpc/gen_ndr/srv_svcctl.h | 50 - source3/librpc/gen_ndr/srv_winreg.c | 2772 ---- source3/librpc/gen_ndr/srv_winreg.h | 41 - source3/librpc/gen_ndr/srv_wkssvc.c | 2412 --- source3/librpc/gen_ndr/srv_wkssvc.h | 37 - source3/librpc/gen_ndr/srvsvc.h | 1806 --- source3/librpc/gen_ndr/svcctl.h | 811 - source3/librpc/gen_ndr/tables.c | 83 - source3/librpc/gen_ndr/winreg.h | 623 - source3/librpc/gen_ndr/wkssvc.h | 981 -- source3/librpc/gen_ndr/xattr.h | 91 - 251 files changed, 212555 insertions(+), 212555 deletions(-) create mode 100644 librpc/gen_ndr/cli_dfs.c create mode 100644 librpc/gen_ndr/cli_dfs.h create mode 100644 librpc/gen_ndr/cli_drsuapi.c create mode 100644 librpc/gen_ndr/cli_drsuapi.h create mode 100644 librpc/gen_ndr/cli_dssetup.c create mode 100644 librpc/gen_ndr/cli_dssetup.h create mode 100644 librpc/gen_ndr/cli_echo.c create mode 100644 librpc/gen_ndr/cli_echo.h create mode 100644 librpc/gen_ndr/cli_epmapper.c create mode 100644 librpc/gen_ndr/cli_epmapper.h create mode 100644 librpc/gen_ndr/cli_eventlog.c create mode 100644 librpc/gen_ndr/cli_eventlog.h create mode 100644 librpc/gen_ndr/cli_initshutdown.c create mode 100644 librpc/gen_ndr/cli_initshutdown.h create mode 100644 librpc/gen_ndr/cli_lsa.c create mode 100644 librpc/gen_ndr/cli_lsa.h create mode 100644 librpc/gen_ndr/cli_netlogon.c create mode 100644 librpc/gen_ndr/cli_netlogon.h create mode 100644 librpc/gen_ndr/cli_ntsvcs.c create mode 100644 librpc/gen_ndr/cli_ntsvcs.h create mode 100644 librpc/gen_ndr/cli_samr.c create mode 100644 librpc/gen_ndr/cli_samr.h create mode 100644 librpc/gen_ndr/cli_srvsvc.c create mode 100644 librpc/gen_ndr/cli_srvsvc.h create mode 100644 librpc/gen_ndr/cli_svcctl.c create mode 100644 librpc/gen_ndr/cli_svcctl.h create mode 100644 librpc/gen_ndr/cli_winreg.c create mode 100644 librpc/gen_ndr/cli_winreg.h create mode 100644 librpc/gen_ndr/cli_wkssvc.c create mode 100644 librpc/gen_ndr/cli_wkssvc.h create mode 100644 librpc/gen_ndr/dfs.h create mode 100644 librpc/gen_ndr/drsblobs.h create mode 100644 librpc/gen_ndr/drsuapi.h create mode 100644 librpc/gen_ndr/dssetup.h create mode 100644 librpc/gen_ndr/echo.h create mode 100644 librpc/gen_ndr/epmapper.h create mode 100644 librpc/gen_ndr/eventlog.h create mode 100644 librpc/gen_ndr/initshutdown.h create mode 100644 librpc/gen_ndr/krb5pac.h create mode 100644 librpc/gen_ndr/lsa.h create mode 100644 librpc/gen_ndr/misc.h create mode 100644 librpc/gen_ndr/named_pipe_auth.h create mode 100644 librpc/gen_ndr/nbt.h create mode 100644 librpc/gen_ndr/ndr_dfs.c create mode 100644 librpc/gen_ndr/ndr_dfs.h create mode 100644 librpc/gen_ndr/ndr_drsblobs.c create mode 100644 librpc/gen_ndr/ndr_drsblobs.h create mode 100644 librpc/gen_ndr/ndr_drsuapi.c create mode 100644 librpc/gen_ndr/ndr_drsuapi.h create mode 100644 librpc/gen_ndr/ndr_dssetup.c create mode 100644 librpc/gen_ndr/ndr_dssetup.h create mode 100644 librpc/gen_ndr/ndr_echo.c create mode 100644 librpc/gen_ndr/ndr_echo.h create mode 100644 librpc/gen_ndr/ndr_epmapper.c create mode 100644 librpc/gen_ndr/ndr_epmapper.h create mode 100644 librpc/gen_ndr/ndr_eventlog.c create mode 100644 librpc/gen_ndr/ndr_eventlog.h create mode 100644 librpc/gen_ndr/ndr_initshutdown.c create mode 100644 librpc/gen_ndr/ndr_initshutdown.h create mode 100644 librpc/gen_ndr/ndr_krb5pac.c create mode 100644 librpc/gen_ndr/ndr_krb5pac.h create mode 100644 librpc/gen_ndr/ndr_lsa.c create mode 100644 librpc/gen_ndr/ndr_lsa.h create mode 100644 librpc/gen_ndr/ndr_misc.c create mode 100644 librpc/gen_ndr/ndr_misc.h create mode 100644 librpc/gen_ndr/ndr_named_pipe_auth.c create mode 100644 librpc/gen_ndr/ndr_named_pipe_auth.h create mode 100644 librpc/gen_ndr/ndr_nbt.c create mode 100644 librpc/gen_ndr/ndr_nbt.h create mode 100644 librpc/gen_ndr/ndr_netlogon.c create mode 100644 librpc/gen_ndr/ndr_netlogon.h create mode 100644 librpc/gen_ndr/ndr_ntsvcs.c create mode 100644 librpc/gen_ndr/ndr_ntsvcs.h create mode 100644 librpc/gen_ndr/ndr_samr.c create mode 100644 librpc/gen_ndr/ndr_samr.h create mode 100644 librpc/gen_ndr/ndr_security.c create mode 100644 librpc/gen_ndr/ndr_security.h create mode 100644 librpc/gen_ndr/ndr_srvsvc.c create mode 100644 librpc/gen_ndr/ndr_srvsvc.h create mode 100644 librpc/gen_ndr/ndr_svcctl.c create mode 100644 librpc/gen_ndr/ndr_svcctl.h create mode 100644 librpc/gen_ndr/ndr_winreg.c create mode 100644 librpc/gen_ndr/ndr_winreg.h create mode 100644 librpc/gen_ndr/ndr_wkssvc.c create mode 100644 librpc/gen_ndr/ndr_wkssvc.h create mode 100644 librpc/gen_ndr/ndr_xattr.c create mode 100644 librpc/gen_ndr/ndr_xattr.h create mode 100644 librpc/gen_ndr/netlogon.h create mode 100644 librpc/gen_ndr/ntsvcs.h create mode 100644 librpc/gen_ndr/samr.h create mode 100644 librpc/gen_ndr/security.h create mode 100644 librpc/gen_ndr/srv_dfs.c create mode 100644 librpc/gen_ndr/srv_dfs.h create mode 100644 librpc/gen_ndr/srv_dssetup.c create mode 100644 librpc/gen_ndr/srv_dssetup.h create mode 100644 librpc/gen_ndr/srv_echo.c create mode 100644 librpc/gen_ndr/srv_echo.h create mode 100644 librpc/gen_ndr/srv_epmapper.c create mode 100644 librpc/gen_ndr/srv_epmapper.h create mode 100644 librpc/gen_ndr/srv_eventlog.c create mode 100644 librpc/gen_ndr/srv_eventlog.h create mode 100644 librpc/gen_ndr/srv_initshutdown.c create mode 100644 librpc/gen_ndr/srv_initshutdown.h create mode 100644 librpc/gen_ndr/srv_lsa.c create mode 100644 librpc/gen_ndr/srv_lsa.h create mode 100644 librpc/gen_ndr/srv_netlogon.c create mode 100644 librpc/gen_ndr/srv_netlogon.h create mode 100644 librpc/gen_ndr/srv_ntsvcs.c create mode 100644 librpc/gen_ndr/srv_ntsvcs.h create mode 100644 librpc/gen_ndr/srv_samr.c create mode 100644 librpc/gen_ndr/srv_samr.h create mode 100644 librpc/gen_ndr/srv_srvsvc.c create mode 100644 librpc/gen_ndr/srv_srvsvc.h create mode 100644 librpc/gen_ndr/srv_svcctl.c create mode 100644 librpc/gen_ndr/srv_svcctl.h create mode 100644 librpc/gen_ndr/srv_winreg.c create mode 100644 librpc/gen_ndr/srv_winreg.h create mode 100644 librpc/gen_ndr/srv_wkssvc.c create mode 100644 librpc/gen_ndr/srv_wkssvc.h create mode 100644 librpc/gen_ndr/srvsvc.h create mode 100644 librpc/gen_ndr/svcctl.h create mode 100644 librpc/gen_ndr/tables.c create mode 100644 librpc/gen_ndr/winreg.h create mode 100644 librpc/gen_ndr/wkssvc.h create mode 100644 librpc/gen_ndr/xattr.h delete mode 100644 source3/librpc/gen_ndr/cli_dfs.c delete mode 100644 source3/librpc/gen_ndr/cli_dfs.h delete mode 100644 source3/librpc/gen_ndr/cli_drsuapi.c delete mode 100644 source3/librpc/gen_ndr/cli_drsuapi.h delete mode 100644 source3/librpc/gen_ndr/cli_dssetup.c delete mode 100644 source3/librpc/gen_ndr/cli_dssetup.h delete mode 100644 source3/librpc/gen_ndr/cli_echo.c delete mode 100644 source3/librpc/gen_ndr/cli_echo.h delete mode 100644 source3/librpc/gen_ndr/cli_epmapper.c delete mode 100644 source3/librpc/gen_ndr/cli_epmapper.h delete mode 100644 source3/librpc/gen_ndr/cli_eventlog.c delete mode 100644 source3/librpc/gen_ndr/cli_eventlog.h delete mode 100644 source3/librpc/gen_ndr/cli_initshutdown.c delete mode 100644 source3/librpc/gen_ndr/cli_initshutdown.h delete mode 100644 source3/librpc/gen_ndr/cli_lsa.c delete mode 100644 source3/librpc/gen_ndr/cli_lsa.h delete mode 100644 source3/librpc/gen_ndr/cli_netlogon.c delete mode 100644 source3/librpc/gen_ndr/cli_netlogon.h delete mode 100644 source3/librpc/gen_ndr/cli_ntsvcs.c delete mode 100644 source3/librpc/gen_ndr/cli_ntsvcs.h delete mode 100644 source3/librpc/gen_ndr/cli_samr.c delete mode 100644 source3/librpc/gen_ndr/cli_samr.h delete mode 100644 source3/librpc/gen_ndr/cli_srvsvc.c delete mode 100644 source3/librpc/gen_ndr/cli_srvsvc.h delete mode 100644 source3/librpc/gen_ndr/cli_svcctl.c delete mode 100644 source3/librpc/gen_ndr/cli_svcctl.h delete mode 100644 source3/librpc/gen_ndr/cli_winreg.c delete mode 100644 source3/librpc/gen_ndr/cli_winreg.h delete mode 100644 source3/librpc/gen_ndr/cli_wkssvc.c delete mode 100644 source3/librpc/gen_ndr/cli_wkssvc.h delete mode 100644 source3/librpc/gen_ndr/dfs.h delete mode 100644 source3/librpc/gen_ndr/drsblobs.h delete mode 100644 source3/librpc/gen_ndr/drsuapi.h delete mode 100644 source3/librpc/gen_ndr/dssetup.h delete mode 100644 source3/librpc/gen_ndr/echo.h delete mode 100644 source3/librpc/gen_ndr/epmapper.h delete mode 100644 source3/librpc/gen_ndr/eventlog.h delete mode 100644 source3/librpc/gen_ndr/initshutdown.h delete mode 100644 source3/librpc/gen_ndr/krb5pac.h delete mode 100644 source3/librpc/gen_ndr/lsa.h delete mode 100644 source3/librpc/gen_ndr/misc.h delete mode 100644 source3/librpc/gen_ndr/named_pipe_auth.h delete mode 100644 source3/librpc/gen_ndr/nbt.h delete mode 100644 source3/librpc/gen_ndr/ndr_dfs.c delete mode 100644 source3/librpc/gen_ndr/ndr_dfs.h delete mode 100644 source3/librpc/gen_ndr/ndr_drsblobs.c delete mode 100644 source3/librpc/gen_ndr/ndr_drsblobs.h delete mode 100644 source3/librpc/gen_ndr/ndr_drsuapi.c delete mode 100644 source3/librpc/gen_ndr/ndr_drsuapi.h delete mode 100644 source3/librpc/gen_ndr/ndr_dssetup.c delete mode 100644 source3/librpc/gen_ndr/ndr_dssetup.h delete mode 100644 source3/librpc/gen_ndr/ndr_echo.c delete mode 100644 source3/librpc/gen_ndr/ndr_echo.h delete mode 100644 source3/librpc/gen_ndr/ndr_epmapper.c delete mode 100644 source3/librpc/gen_ndr/ndr_epmapper.h delete mode 100644 source3/librpc/gen_ndr/ndr_eventlog.c delete mode 100644 source3/librpc/gen_ndr/ndr_eventlog.h delete mode 100644 source3/librpc/gen_ndr/ndr_initshutdown.c delete mode 100644 source3/librpc/gen_ndr/ndr_initshutdown.h delete mode 100644 source3/librpc/gen_ndr/ndr_krb5pac.c delete mode 100644 source3/librpc/gen_ndr/ndr_krb5pac.h delete mode 100644 source3/librpc/gen_ndr/ndr_lsa.c delete mode 100644 source3/librpc/gen_ndr/ndr_lsa.h delete mode 100644 source3/librpc/gen_ndr/ndr_misc.c delete mode 100644 source3/librpc/gen_ndr/ndr_misc.h delete mode 100644 source3/librpc/gen_ndr/ndr_named_pipe_auth.c delete mode 100644 source3/librpc/gen_ndr/ndr_named_pipe_auth.h delete mode 100644 source3/librpc/gen_ndr/ndr_nbt.c delete mode 100644 source3/librpc/gen_ndr/ndr_nbt.h delete mode 100644 source3/librpc/gen_ndr/ndr_netlogon.c delete mode 100644 source3/librpc/gen_ndr/ndr_netlogon.h delete mode 100644 source3/librpc/gen_ndr/ndr_ntsvcs.c delete mode 100644 source3/librpc/gen_ndr/ndr_ntsvcs.h delete mode 100644 source3/librpc/gen_ndr/ndr_samr.c delete mode 100644 source3/librpc/gen_ndr/ndr_samr.h delete mode 100644 source3/librpc/gen_ndr/ndr_security.c delete mode 100644 source3/librpc/gen_ndr/ndr_security.h delete mode 100644 source3/librpc/gen_ndr/ndr_srvsvc.c delete mode 100644 source3/librpc/gen_ndr/ndr_srvsvc.h delete mode 100644 source3/librpc/gen_ndr/ndr_svcctl.c delete mode 100644 source3/librpc/gen_ndr/ndr_svcctl.h delete mode 100644 source3/librpc/gen_ndr/ndr_winreg.c delete mode 100644 source3/librpc/gen_ndr/ndr_winreg.h delete mode 100644 source3/librpc/gen_ndr/ndr_wkssvc.c delete mode 100644 source3/librpc/gen_ndr/ndr_wkssvc.h delete mode 100644 source3/librpc/gen_ndr/ndr_xattr.c delete mode 100644 source3/librpc/gen_ndr/ndr_xattr.h delete mode 100644 source3/librpc/gen_ndr/netlogon.h delete mode 100644 source3/librpc/gen_ndr/ntsvcs.h delete mode 100644 source3/librpc/gen_ndr/samr.h delete mode 100644 source3/librpc/gen_ndr/security.h delete mode 100644 source3/librpc/gen_ndr/srv_dfs.c delete mode 100644 source3/librpc/gen_ndr/srv_dfs.h delete mode 100644 source3/librpc/gen_ndr/srv_dssetup.c delete mode 100644 source3/librpc/gen_ndr/srv_dssetup.h delete mode 100644 source3/librpc/gen_ndr/srv_echo.c delete mode 100644 source3/librpc/gen_ndr/srv_echo.h delete mode 100644 source3/librpc/gen_ndr/srv_epmapper.c delete mode 100644 source3/librpc/gen_ndr/srv_epmapper.h delete mode 100644 source3/librpc/gen_ndr/srv_eventlog.c delete mode 100644 source3/librpc/gen_ndr/srv_eventlog.h delete mode 100644 source3/librpc/gen_ndr/srv_initshutdown.c delete mode 100644 source3/librpc/gen_ndr/srv_initshutdown.h delete mode 100644 source3/librpc/gen_ndr/srv_lsa.c delete mode 100644 source3/librpc/gen_ndr/srv_lsa.h delete mode 100644 source3/librpc/gen_ndr/srv_netlogon.c delete mode 100644 source3/librpc/gen_ndr/srv_netlogon.h delete mode 100644 source3/librpc/gen_ndr/srv_ntsvcs.c delete mode 100644 source3/librpc/gen_ndr/srv_ntsvcs.h delete mode 100644 source3/librpc/gen_ndr/srv_samr.c delete mode 100644 source3/librpc/gen_ndr/srv_samr.h delete mode 100644 source3/librpc/gen_ndr/srv_srvsvc.c delete mode 100644 source3/librpc/gen_ndr/srv_srvsvc.h delete mode 100644 source3/librpc/gen_ndr/srv_svcctl.c delete mode 100644 source3/librpc/gen_ndr/srv_svcctl.h delete mode 100644 source3/librpc/gen_ndr/srv_winreg.c delete mode 100644 source3/librpc/gen_ndr/srv_winreg.h delete mode 100644 source3/librpc/gen_ndr/srv_wkssvc.c delete mode 100644 source3/librpc/gen_ndr/srv_wkssvc.h delete mode 100644 source3/librpc/gen_ndr/srvsvc.h delete mode 100644 source3/librpc/gen_ndr/svcctl.h delete mode 100644 source3/librpc/gen_ndr/tables.c delete mode 100644 source3/librpc/gen_ndr/winreg.h delete mode 100644 source3/librpc/gen_ndr/wkssvc.h delete mode 100644 source3/librpc/gen_ndr/xattr.h diff --git a/librpc/gen_ndr/cli_dfs.c b/librpc/gen_ndr/cli_dfs.c new file mode 100644 index 0000000000..81ec14694a --- /dev/null +++ b/librpc/gen_ndr/cli_dfs.c @@ -0,0 +1,1099 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_dfs.h" + +NTSTATUS rpccli_dfs_GetManagerVersion(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum dfs_ManagerVersion *version /* [out] [ref] */) +{ + struct dfs_GetManagerVersion r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_GetManagerVersion, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_GETMANAGERVERSION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_GetManagerVersion, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *version = *r.out.version; + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_dfs_Add(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *path /* [in] [ref,charset(UTF16)] */, + const char *server /* [in] [ref,charset(UTF16)] */, + const char *share /* [in] [unique,charset(UTF16)] */, + const char *comment /* [in] [unique,charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct dfs_Add r; + NTSTATUS status; + + /* In parameters */ + r.in.path = path; + r.in.server = server; + r.in.share = share; + r.in.comment = comment; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Add, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_ADD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Add, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_Remove(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dfs_entry_path /* [in] [ref,charset(UTF16)] */, + const char *servername /* [in] [unique,charset(UTF16)] */, + const char *sharename /* [in] [unique,charset(UTF16)] */, + WERROR *werror) +{ + struct dfs_Remove r; + NTSTATUS status; + + /* In parameters */ + r.in.dfs_entry_path = dfs_entry_path; + r.in.servername = servername; + r.in.sharename = sharename; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Remove, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_REMOVE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Remove, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_SetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dfs_entry_path /* [in] [charset(UTF16)] */, + const char *servername /* [in] [unique,charset(UTF16)] */, + const char *sharename /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union dfs_Info *info /* [in] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct dfs_SetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.dfs_entry_path = dfs_entry_path; + r.in.servername = servername; + r.in.sharename = sharename; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_SetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_SETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_SetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dfs_entry_path /* [in] [charset(UTF16)] */, + const char *servername /* [in] [unique,charset(UTF16)] */, + const char *sharename /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union dfs_Info *info /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct dfs_GetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.dfs_entry_path = dfs_entry_path; + r.in.servername = servername; + r.in.sharename = sharename; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_GetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_GETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_GetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t level /* [in] */, + uint32_t bufsize /* [in] */, + struct dfs_EnumStruct *info /* [in,out] [unique] */, + uint32_t *total /* [in,out] [unique] */, + WERROR *werror) +{ + struct dfs_Enum r; + NTSTATUS status; + + /* In parameters */ + r.in.level = level; + r.in.bufsize = bufsize; + r.in.info = info; + r.in.total = total; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Enum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_ENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Enum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (info && r.out.info) { + *info = *r.out.info; + } + if (total && r.out.total) { + *total = *r.out.total; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_Rename(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dfs_Rename r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Rename, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_RENAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Rename, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_Move(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dfs_Move r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Move, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_MOVE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Move, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dfs_ManagerGetConfigInfo r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_ManagerGetConfigInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_MANAGERGETCONFIGINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_ManagerGetConfigInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_ManagerSendSiteInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dfs_ManagerSendSiteInfo r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_ManagerSendSiteInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_MANAGERSENDSITEINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_ManagerSendSiteInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *dns_servername /* [in] [charset(UTF16)] */, + const char *dfsname /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + const char *comment /* [in] [charset(UTF16)] */, + const char *dfs_config_dn /* [in] [charset(UTF16)] */, + uint8_t unknown1 /* [in] */, + uint32_t flags /* [in] */, + struct dfs_UnknownStruct **unknown2 /* [in,out] [unique] */, + WERROR *werror) +{ + struct dfs_AddFtRoot r; + NTSTATUS status; + + /* In parameters */ + r.in.servername = servername; + r.in.dns_servername = dns_servername; + r.in.dfsname = dfsname; + r.in.rootshare = rootshare; + r.in.comment = comment; + r.in.dfs_config_dn = dfs_config_dn; + r.in.unknown1 = unknown1; + r.in.flags = flags; + r.in.unknown2 = unknown2; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_AddFtRoot, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_ADDFTROOT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_AddFtRoot, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (unknown2 && r.out.unknown2) { + *unknown2 = *r.out.unknown2; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *dns_servername /* [in] [charset(UTF16)] */, + const char *dfsname /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + uint32_t flags /* [in] */, + struct dfs_UnknownStruct **unknown /* [in,out] [unique] */, + WERROR *werror) +{ + struct dfs_RemoveFtRoot r; + NTSTATUS status; + + /* In parameters */ + r.in.servername = servername; + r.in.dns_servername = dns_servername; + r.in.dfsname = dfsname; + r.in.rootshare = rootshare; + r.in.flags = flags; + r.in.unknown = unknown; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_RemoveFtRoot, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_REMOVEFTROOT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (unknown && r.out.unknown) { + *unknown = *r.out.unknown; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_AddStdRoot(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + const char *comment /* [in] [charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct dfs_AddStdRoot r; + NTSTATUS status; + + /* In parameters */ + r.in.servername = servername; + r.in.rootshare = rootshare; + r.in.comment = comment; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_AddStdRoot, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_ADDSTDROOT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_AddStdRoot, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_RemoveStdRoot(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct dfs_RemoveStdRoot r; + NTSTATUS status; + + /* In parameters */ + r.in.servername = servername; + r.in.rootshare = rootshare; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_RemoveStdRoot, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_REMOVESTDROOT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_RemoveStdRoot, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_ManagerInitialize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [ref,charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct dfs_ManagerInitialize r; + NTSTATUS status; + + /* In parameters */ + r.in.servername = servername; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_ManagerInitialize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_MANAGERINITIALIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_ManagerInitialize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + const char *comment /* [in] [charset(UTF16)] */, + const char *store /* [in] [charset(UTF16)] */, + WERROR *werror) +{ + struct dfs_AddStdRootForced r; + NTSTATUS status; + + /* In parameters */ + r.in.servername = servername; + r.in.rootshare = rootshare; + r.in.comment = comment; + r.in.store = store; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_AddStdRootForced, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_ADDSTDROOTFORCED, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_AddStdRootForced, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char **server_fullname /* [in,out] [ref,charset(UTF16)] */, + uint8_t *is_root /* [in,out] [ref] */, + uint32_t *ttl /* [in,out] [ref] */, + WERROR *werror) +{ + struct dfs_GetDcAddress r; + NTSTATUS status; + + /* In parameters */ + r.in.servername = servername; + r.in.server_fullname = server_fullname; + r.in.is_root = is_root; + r.in.ttl = ttl; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_GETDCADDRESS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *server_fullname = *r.out.server_fullname; + *is_root = *r.out.is_root; + *ttl = *r.out.ttl; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *server_fullname /* [in] [charset(UTF16)] */, + uint32_t flags /* [in] */, + uint32_t ttl /* [in] */, + WERROR *werror) +{ + struct dfs_SetDcAddress r; + NTSTATUS status; + + /* In parameters */ + r.in.servername = servername; + r.in.server_fullname = server_fullname; + r.in.flags = flags; + r.in.ttl = ttl; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_SetDcAddress, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_SETDCADDRESS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_SetDcAddress, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + WERROR *werror) +{ + struct dfs_FlushFtTable r; + NTSTATUS status; + + /* In parameters */ + r.in.servername = servername; + r.in.rootshare = rootshare; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_FlushFtTable, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_FLUSHFTTABLE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_FlushFtTable, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_Add2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dfs_Add2 r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Add2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_ADD2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Add2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dfs_Remove2 r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Remove2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_REMOVE2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Remove2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dfs_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + uint32_t bufsize /* [in] */, + struct dfs_EnumStruct *info /* [in,out] [unique] */, + uint32_t *total /* [in,out] [unique] */, + WERROR *werror) +{ + struct dfs_EnumEx r; + NTSTATUS status; + + /* In parameters */ + r.in.dfs_name = dfs_name; + r.in.level = level; + r.in.bufsize = bufsize; + r.in.info = info; + r.in.total = total; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_EnumEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_ENUMEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_EnumEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (info && r.out.info) { + *info = *r.out.info; + } + if (total && r.out.total) { + *total = *r.out.total; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dfs_SetInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dfs_SetInfo2 r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_SetInfo2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netdfs, + NDR_DFS_SETINFO2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_SetInfo2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/librpc/gen_ndr/cli_dfs.h b/librpc/gen_ndr/cli_dfs.h new file mode 100644 index 0000000000..0c862099bf --- /dev/null +++ b/librpc/gen_ndr/cli_dfs.h @@ -0,0 +1,138 @@ +#include "librpc/gen_ndr/ndr_dfs.h" +#ifndef __CLI_NETDFS__ +#define __CLI_NETDFS__ +NTSTATUS rpccli_dfs_GetManagerVersion(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum dfs_ManagerVersion *version /* [out] [ref] */); +NTSTATUS rpccli_dfs_Add(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *path /* [in] [ref,charset(UTF16)] */, + const char *server /* [in] [ref,charset(UTF16)] */, + const char *share /* [in] [unique,charset(UTF16)] */, + const char *comment /* [in] [unique,charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_dfs_Remove(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dfs_entry_path /* [in] [ref,charset(UTF16)] */, + const char *servername /* [in] [unique,charset(UTF16)] */, + const char *sharename /* [in] [unique,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_dfs_SetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dfs_entry_path /* [in] [charset(UTF16)] */, + const char *servername /* [in] [unique,charset(UTF16)] */, + const char *sharename /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union dfs_Info *info /* [in] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dfs_entry_path /* [in] [charset(UTF16)] */, + const char *servername /* [in] [unique,charset(UTF16)] */, + const char *sharename /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union dfs_Info *info /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t level /* [in] */, + uint32_t bufsize /* [in] */, + struct dfs_EnumStruct *info /* [in,out] [unique] */, + uint32_t *total /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_dfs_Rename(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dfs_Move(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dfs_ManagerSendSiteInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *dns_servername /* [in] [charset(UTF16)] */, + const char *dfsname /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + const char *comment /* [in] [charset(UTF16)] */, + const char *dfs_config_dn /* [in] [charset(UTF16)] */, + uint8_t unknown1 /* [in] */, + uint32_t flags /* [in] */, + struct dfs_UnknownStruct **unknown2 /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *dns_servername /* [in] [charset(UTF16)] */, + const char *dfsname /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + uint32_t flags /* [in] */, + struct dfs_UnknownStruct **unknown /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_dfs_AddStdRoot(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + const char *comment /* [in] [charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_dfs_RemoveStdRoot(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_dfs_ManagerInitialize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [ref,charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + const char *comment /* [in] [charset(UTF16)] */, + const char *store /* [in] [charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char **server_fullname /* [in,out] [ref,charset(UTF16)] */, + uint8_t *is_root /* [in,out] [ref] */, + uint32_t *ttl /* [in,out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *server_fullname /* [in] [charset(UTF16)] */, + uint32_t flags /* [in] */, + uint32_t ttl /* [in] */, + WERROR *werror); +NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *servername /* [in] [charset(UTF16)] */, + const char *rootshare /* [in] [charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_dfs_Add2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dfs_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + uint32_t bufsize /* [in] */, + struct dfs_EnumStruct *info /* [in,out] [unique] */, + uint32_t *total /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_dfs_SetInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +#endif /* __CLI_NETDFS__ */ diff --git a/librpc/gen_ndr/cli_drsuapi.c b/librpc/gen_ndr/cli_drsuapi.c new file mode 100644 index 0000000000..57d7a25d9c --- /dev/null +++ b/librpc/gen_ndr/cli_drsuapi.c @@ -0,0 +1,1167 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_drsuapi.h" + +NTSTATUS rpccli_drsuapi_DsBind(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct GUID *bind_guid /* [in] [unique] */, + struct drsuapi_DsBindInfoCtr *bind_info /* [in,out] [unique] */, + struct policy_handle *bind_handle /* [out] [ref] */, + WERROR *werror) +{ + struct drsuapi_DsBind r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_guid = bind_guid; + r.in.bind_info = bind_info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsBind, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSBIND, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsBind, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (bind_info && r.out.bind_info) { + *bind_info = *r.out.bind_info; + } + *bind_handle = *r.out.bind_handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsUnbind(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in,out] [ref] */, + WERROR *werror) +{ + struct drsuapi_DsUnbind r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsUnbind, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSUNBIND, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsUnbind, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *bind_handle = *r.out.bind_handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsReplicaSync(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsReplicaSyncRequest req /* [in] [switch_is(level)] */, + WERROR *werror) +{ + struct drsuapi_DsReplicaSync r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsReplicaSync, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSREPLICASYNC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaSync, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsGetNCChanges(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsGetNCChangesRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetNCChangesCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_DsGetNCChanges r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsGetNCChanges, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSGETNCCHANGES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNCChanges, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsReplicaUpdateRefsRequest req /* [in] [switch_is(level)] */, + WERROR *werror) +{ + struct drsuapi_DsReplicaUpdateRefs r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsReplicaUpdateRefs, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSREPLICAUPDATEREFS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaUpdateRefs, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_REPLICA_ADD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_REPLICA_ADD r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_ADD, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_REPLICA_ADD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_ADD, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_REPLICA_DEL(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_REPLICA_DEL r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_DEL, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_REPLICA_DEL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_DEL, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_REPLICA_MODIFY(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_REPLICA_MODIFY r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_MODIFY, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_REPLICA_MODIFY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_MODIFY, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_VERIFY_NAMES r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_VERIFY_NAMES, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_VERIFY_NAMES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_VERIFY_NAMES, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsGetMemberships(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsGetMembershipsRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetMembershipsCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_DsGetMemberships r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsGetMemberships, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSGETMEMBERSHIPS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsGetMemberships, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_INTER_DOMAIN_MOVE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_INTER_DOMAIN_MOVE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + uint32_t level /* [in] */, + union drsuapi_DsGetNT4ChangeLogRequest *req /* [in] [ref,switch_is(level)] */, + uint32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetNT4ChangeLogInfo *info /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_DsGetNT4ChangeLog r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsGetNT4ChangeLog, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSGETNT4CHANGELOG, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNT4ChangeLog, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsNameRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsNameCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_DsCrackNames r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsCrackNames, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSCRACKNAMES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsCrackNames, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsWriteAccountSpn(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsWriteAccountSpnRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsWriteAccountSpnResult *res /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_DsWriteAccountSpn r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsWriteAccountSpn, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSWRITEACCOUNTSPN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsWriteAccountSpn, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *res = *r.out.res; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsRemoveDSServerRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsRemoveDSServerResult *res /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_DsRemoveDSServer r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsRemoveDSServer, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSREMOVEDSSERVER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsRemoveDSServer, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *res = *r.out.res; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_REMOVE_DS_DOMAIN r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_REMOVE_DS_DOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsGetDCInfoRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetDCInfoCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_DsGetDomainControllerInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsGetDomainControllerInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsGetDomainControllerInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsAddEntry(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsAddEntryRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsAddEntryCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_DsAddEntry r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsAddEntry, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSADDENTRY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsAddEntry, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_EXECUTE_KCC(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_EXECUTE_KCC r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_EXECUTE_KCC, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_EXECUTE_KCC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_EXECUTE_KCC, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsReplicaGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + enum drsuapi_DsReplicaGetInfoLevel level /* [in] */, + union drsuapi_DsReplicaGetInfoRequest *req /* [in] [ref,switch_is(level)] */, + enum drsuapi_DsReplicaInfoType *info_type /* [out] [ref] */, + union drsuapi_DsReplicaInfo *info /* [out] [ref,switch_is(*info_type)] */, + WERROR *werror) +{ + struct drsuapi_DsReplicaGetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsReplicaGetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSREPLICAGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaGetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info_type = *r.out.info_type; + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_ADD_SID_HISTORY r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_ADD_SID_HISTORY, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_ADD_SID_HISTORY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_ADD_SID_HISTORY, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_DsGetMemberships2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsGetMemberships2Request *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetMemberships2Ctr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_DsGetMemberships2 r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_DsGetMemberships2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_DSGETMEMBERSHIPS2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsGetMemberships2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_REPLICA_VERIFY_OBJECTS r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_VERIFY_OBJECTS, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_REPLICA_VERIFY_OBJECTS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_VERIFY_OBJECTS, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct DRSUAPI_GET_OBJECT_EXISTENCE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(DRSUAPI_GET_OBJECT_EXISTENCE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_GET_OBJECT_EXISTENCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(DRSUAPI_GET_OBJECT_EXISTENCE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_drsuapi_QuerySitesByCost(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_QuerySitesByCostRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_QuerySitesByCostCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror) +{ + struct drsuapi_QuerySitesByCost r; + NTSTATUS status; + + /* In parameters */ + r.in.bind_handle = bind_handle; + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(drsuapi_QuerySitesByCost, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_drsuapi, + NDR_DRSUAPI_QUERYSITESBYCOST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(drsuapi_QuerySitesByCost, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/librpc/gen_ndr/cli_drsuapi.h b/librpc/gen_ndr/cli_drsuapi.h new file mode 100644 index 0000000000..ab7375f4ca --- /dev/null +++ b/librpc/gen_ndr/cli_drsuapi.h @@ -0,0 +1,144 @@ +#include "librpc/gen_ndr/ndr_drsuapi.h" +#ifndef __CLI_DRSUAPI__ +#define __CLI_DRSUAPI__ +NTSTATUS rpccli_drsuapi_DsBind(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct GUID *bind_guid /* [in] [unique] */, + struct drsuapi_DsBindInfoCtr *bind_info /* [in,out] [unique] */, + struct policy_handle *bind_handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsUnbind(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in,out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsReplicaSync(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsReplicaSyncRequest req /* [in] [switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsGetNCChanges(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsGetNCChangesRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetNCChangesCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsReplicaUpdateRefsRequest req /* [in] [switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_REPLICA_ADD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_REPLICA_DEL(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_REPLICA_MODIFY(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsGetMemberships(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsGetMembershipsRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetMembershipsCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + uint32_t level /* [in] */, + union drsuapi_DsGetNT4ChangeLogRequest *req /* [in] [ref,switch_is(level)] */, + uint32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetNT4ChangeLogInfo *info /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsNameRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsNameCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsWriteAccountSpn(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsWriteAccountSpnRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsWriteAccountSpnResult *res /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsRemoveDSServerRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsRemoveDSServerResult *res /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsGetDCInfoRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetDCInfoCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsAddEntry(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsAddEntryRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsAddEntryCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_EXECUTE_KCC(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsReplicaGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + enum drsuapi_DsReplicaGetInfoLevel level /* [in] */, + union drsuapi_DsReplicaGetInfoRequest *req /* [in] [ref,switch_is(level)] */, + enum drsuapi_DsReplicaInfoType *info_type /* [out] [ref] */, + union drsuapi_DsReplicaInfo *info /* [out] [ref,switch_is(*info_type)] */, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_drsuapi_DsGetMemberships2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_DsGetMemberships2Request *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_DsGetMemberships2Ctr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_drsuapi_QuerySitesByCost(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *bind_handle /* [in] [ref] */, + int32_t level /* [in] */, + union drsuapi_QuerySitesByCostRequest *req /* [in] [ref,switch_is(level)] */, + int32_t *level_out /* [out] [ref] */, + union drsuapi_QuerySitesByCostCtr *ctr /* [out] [ref,switch_is(*level_out)] */, + WERROR *werror); +#endif /* __CLI_DRSUAPI__ */ diff --git a/librpc/gen_ndr/cli_dssetup.c b/librpc/gen_ndr/cli_dssetup.c new file mode 100644 index 0000000000..5526f8d59b --- /dev/null +++ b/librpc/gen_ndr/cli_dssetup.c @@ -0,0 +1,465 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_dssetup.h" + +NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum dssetup_DsRoleInfoLevel level /* [in] */, + union dssetup_DsRoleInfo *info /* [out] [unique,switch_is(level)] */, + WERROR *werror) +{ + struct dssetup_DsRoleGetPrimaryDomainInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (info && r.out.info) { + *info = *r.out.info; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleDnsNameToFlatName r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDnsNameToFlatName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDnsNameToFlatName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleDcAsDc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleDcAsDc r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsDc, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEDCASDC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsDc, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleDcAsReplica(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleDcAsReplica r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsReplica, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEDCASREPLICA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsReplica, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleDemoteDc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleDemoteDc r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDemoteDc, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEDEMOTEDC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDemoteDc, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleGetDcOperationProgress r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationProgress, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationProgress, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleGetDcOperationResults r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationResults, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationResults, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleCancel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleCancel r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleCancel, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLECANCEL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleCancel, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleServerSaveStateForUpgrade r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleUpgradeDownlevelServer r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleAbortDownlevelServerUpgrade r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/librpc/gen_ndr/cli_dssetup.h b/librpc/gen_ndr/cli_dssetup.h new file mode 100644 index 0000000000..e2dca43360 --- /dev/null +++ b/librpc/gen_ndr/cli_dssetup.h @@ -0,0 +1,39 @@ +#include "librpc/gen_ndr/ndr_dssetup.h" +#ifndef __CLI_DSSETUP__ +#define __CLI_DSSETUP__ +NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum dssetup_DsRoleInfoLevel level /* [in] */, + union dssetup_DsRoleInfo *info /* [out] [unique,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleDcAsDc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleDcAsReplica(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleDemoteDc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleCancel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +#endif /* __CLI_DSSETUP__ */ diff --git a/librpc/gen_ndr/cli_echo.c b/librpc/gen_ndr/cli_echo.c new file mode 100644 index 0000000000..a775825f5f --- /dev/null +++ b/librpc/gen_ndr/cli_echo.c @@ -0,0 +1,410 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_echo.h" + +NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t in_data /* [in] */, + uint32_t *out_data /* [out] [ref] */) +{ + struct echo_AddOne r; + NTSTATUS status; + + /* In parameters */ + r.in.in_data = in_data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_AddOne, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_ADDONE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_AddOne, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *out_data = *r.out.out_data; + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t len /* [in] */, + uint8_t *in_data /* [in] [size_is(len)] */, + uint8_t *out_data /* [out] [size_is(len)] */) +{ + struct echo_EchoData r; + NTSTATUS status; + + /* In parameters */ + r.in.len = len; + r.in.in_data = in_data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_EchoData, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_ECHODATA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_EchoData, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(out_data, r.out.out_data, r.in.len * sizeof(*out_data)); + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t len /* [in] */, + uint8_t *data /* [in] [size_is(len)] */) +{ + struct echo_SinkData r; + NTSTATUS status; + + /* In parameters */ + r.in.len = len; + r.in.data = data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_SinkData, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_SINKDATA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_SinkData, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t len /* [in] */, + uint8_t *data /* [out] [size_is(len)] */) +{ + struct echo_SourceData r; + NTSTATUS status; + + /* In parameters */ + r.in.len = len; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_SourceData, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_SOURCEDATA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_SourceData, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(data, r.out.data, r.in.len * sizeof(*data)); + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *s1 /* [in] [ref,charset(UTF16)] */, + const char **s2 /* [out] [ref,charset(UTF16)] */) +{ + struct echo_TestCall r; + NTSTATUS status; + + /* In parameters */ + r.in.s1 = s1; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestCall, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_TESTCALL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestCall, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *s2 = *r.out.s2; + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t level /* [in] */, + union echo_Info *info /* [out] [ref,switch_is(level)] */) +{ + struct echo_TestCall2 r; + NTSTATUS status; + + /* In parameters */ + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestCall2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_TESTCALL2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestCall2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t seconds /* [in] */) +{ + struct echo_TestSleep r; + NTSTATUS status; + + /* In parameters */ + r.in.seconds = seconds; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestSleep, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_TESTSLEEP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestSleep, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum echo_Enum1 *foo1 /* [in,out] [ref] */, + struct echo_Enum2 *foo2 /* [in,out] [ref] */, + union echo_Enum3 *foo3 /* [in,out] [ref,switch_is(*foo1)] */) +{ + struct echo_TestEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.foo1 = foo1; + r.in.foo2 = foo2; + r.in.foo3 = foo3; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_TESTENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *foo1 = *r.out.foo1; + *foo2 = *r.out.foo2; + *foo3 = *r.out.foo3; + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct echo_Surrounding *data /* [in,out] [ref] */) +{ + struct echo_TestSurrounding r; + NTSTATUS status; + + /* In parameters */ + r.in.data = data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_TESTSURROUNDING, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *data = *r.out.data; + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_echo_TestDoublePointer(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t ***data /* [in] [ref] */) +{ + struct echo_TestDoublePointer r; + NTSTATUS status; + + /* In parameters */ + r.in.data = data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_rpcecho, + NDR_ECHO_TESTDOUBLEPOINTER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return NT_STATUS_OK; +} + diff --git a/librpc/gen_ndr/cli_echo.h b/librpc/gen_ndr/cli_echo.h new file mode 100644 index 0000000000..9da13e97f6 --- /dev/null +++ b/librpc/gen_ndr/cli_echo.h @@ -0,0 +1,43 @@ +#include "librpc/gen_ndr/ndr_echo.h" +#ifndef __CLI_RPCECHO__ +#define __CLI_RPCECHO__ +NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t in_data /* [in] */, + uint32_t *out_data /* [out] [ref] */); +NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t len /* [in] */, + uint8_t *in_data /* [in] [size_is(len)] */, + uint8_t *out_data /* [out] [size_is(len)] */); +NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t len /* [in] */, + uint8_t *data /* [in] [size_is(len)] */); +NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t len /* [in] */, + uint8_t *data /* [out] [size_is(len)] */); +NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *s1 /* [in] [ref,charset(UTF16)] */, + const char **s2 /* [out] [ref,charset(UTF16)] */); +NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t level /* [in] */, + union echo_Info *info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t seconds /* [in] */); +NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum echo_Enum1 *foo1 /* [in,out] [ref] */, + struct echo_Enum2 *foo2 /* [in,out] [ref] */, + union echo_Enum3 *foo3 /* [in,out] [ref,switch_is(*foo1)] */); +NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct echo_Surrounding *data /* [in,out] [ref] */); +NTSTATUS rpccli_echo_TestDoublePointer(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t ***data /* [in] [ref] */); +#endif /* __CLI_RPCECHO__ */ diff --git a/librpc/gen_ndr/cli_epmapper.c b/librpc/gen_ndr/cli_epmapper.c new file mode 100644 index 0000000000..19673ab659 --- /dev/null +++ b/librpc/gen_ndr/cli_epmapper.c @@ -0,0 +1,347 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_epmapper.h" + +NTSTATUS rpccli_epm_Insert(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t num_ents /* [in] */, + struct epm_entry_t *entries /* [in] [size_is(num_ents)] */, + uint32_t replace /* [in] */) +{ + struct epm_Insert r; + NTSTATUS status; + + /* In parameters */ + r.in.num_ents = num_ents; + r.in.entries = entries; + r.in.replace = replace; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_Insert, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_epmapper, + NDR_EPM_INSERT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_Insert, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_epm_Delete(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t num_ents /* [in] */, + struct epm_entry_t *entries /* [in] [size_is(num_ents)] */) +{ + struct epm_Delete r; + NTSTATUS status; + + /* In parameters */ + r.in.num_ents = num_ents; + r.in.entries = entries; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_Delete, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_epmapper, + NDR_EPM_DELETE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_Delete, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t inquiry_type /* [in] */, + struct GUID *object /* [in] [ptr] */, + struct rpc_if_id_t *interface_id /* [in] [ptr] */, + uint32_t vers_option /* [in] */, + struct policy_handle *entry_handle /* [in,out] [ref] */, + uint32_t max_ents /* [in] */, + uint32_t *num_ents /* [out] [ref] */, + struct epm_entry_t *entries /* [out] [length_is(*num_ents),size_is(max_ents)] */) +{ + struct epm_Lookup r; + NTSTATUS status; + + /* In parameters */ + r.in.inquiry_type = inquiry_type; + r.in.object = object; + r.in.interface_id = interface_id; + r.in.vers_option = vers_option; + r.in.entry_handle = entry_handle; + r.in.max_ents = max_ents; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_Lookup, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_epmapper, + NDR_EPM_LOOKUP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_Lookup, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *entry_handle = *r.out.entry_handle; + *num_ents = *r.out.num_ents; + memcpy(entries, r.out.entries, r.in.max_ents * sizeof(*entries)); + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct GUID *object /* [in] [ptr] */, + struct epm_twr_t *map_tower /* [in] [ptr] */, + struct policy_handle *entry_handle /* [in,out] [ref] */, + uint32_t max_towers /* [in] */, + uint32_t *num_towers /* [out] [ref] */, + struct epm_twr_p_t *towers /* [out] [length_is(*num_towers),size_is(max_towers)] */) +{ + struct epm_Map r; + NTSTATUS status; + + /* In parameters */ + r.in.object = object; + r.in.map_tower = map_tower; + r.in.entry_handle = entry_handle; + r.in.max_towers = max_towers; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_Map, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_epmapper, + NDR_EPM_MAP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_Map, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *entry_handle = *r.out.entry_handle; + *num_towers = *r.out.num_towers; + memcpy(towers, r.out.towers, r.in.max_towers * sizeof(*towers)); + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_epm_LookupHandleFree(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *entry_handle /* [in,out] [ref] */) +{ + struct epm_LookupHandleFree r; + NTSTATUS status; + + /* In parameters */ + r.in.entry_handle = entry_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_epmapper, + NDR_EPM_LOOKUPHANDLEFREE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *entry_handle = *r.out.entry_handle; + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_epm_InqObject(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct GUID *epm_object /* [in] [ref] */) +{ + struct epm_InqObject r; + NTSTATUS status; + + /* In parameters */ + r.in.epm_object = epm_object; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_InqObject, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_epmapper, + NDR_EPM_INQOBJECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_InqObject, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_epm_MgmtDelete(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t object_speced /* [in] */, + struct GUID *object /* [in] [ptr] */, + struct epm_twr_t *tower /* [in] [ptr] */) +{ + struct epm_MgmtDelete r; + NTSTATUS status; + + /* In parameters */ + r.in.object_speced = object_speced; + r.in.object = object; + r.in.tower = tower; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_MgmtDelete, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_epmapper, + NDR_EPM_MGMTDELETE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return NT_STATUS_OK; +} + +NTSTATUS rpccli_epm_MapAuth(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct epm_MapAuth r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_MapAuth, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_epmapper, + NDR_EPM_MAPAUTH, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_MapAuth, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return NT_STATUS_OK; +} + diff --git a/librpc/gen_ndr/cli_epmapper.h b/librpc/gen_ndr/cli_epmapper.h new file mode 100644 index 0000000000..44884fad7e --- /dev/null +++ b/librpc/gen_ndr/cli_epmapper.h @@ -0,0 +1,44 @@ +#include "librpc/gen_ndr/ndr_epmapper.h" +#ifndef __CLI_EPMAPPER__ +#define __CLI_EPMAPPER__ +NTSTATUS rpccli_epm_Insert(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t num_ents /* [in] */, + struct epm_entry_t *entries /* [in] [size_is(num_ents)] */, + uint32_t replace /* [in] */); +NTSTATUS rpccli_epm_Delete(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t num_ents /* [in] */, + struct epm_entry_t *entries /* [in] [size_is(num_ents)] */); +NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t inquiry_type /* [in] */, + struct GUID *object /* [in] [ptr] */, + struct rpc_if_id_t *interface_id /* [in] [ptr] */, + uint32_t vers_option /* [in] */, + struct policy_handle *entry_handle /* [in,out] [ref] */, + uint32_t max_ents /* [in] */, + uint32_t *num_ents /* [out] [ref] */, + struct epm_entry_t *entries /* [out] [length_is(*num_ents),size_is(max_ents)] */); +NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct GUID *object /* [in] [ptr] */, + struct epm_twr_t *map_tower /* [in] [ptr] */, + struct policy_handle *entry_handle /* [in,out] [ref] */, + uint32_t max_towers /* [in] */, + uint32_t *num_towers /* [out] [ref] */, + struct epm_twr_p_t *towers /* [out] [length_is(*num_towers),size_is(max_towers)] */); +NTSTATUS rpccli_epm_LookupHandleFree(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *entry_handle /* [in,out] [ref] */); +NTSTATUS rpccli_epm_InqObject(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct GUID *epm_object /* [in] [ref] */); +NTSTATUS rpccli_epm_MgmtDelete(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t object_speced /* [in] */, + struct GUID *object /* [in] [ptr] */, + struct epm_twr_t *tower /* [in] [ptr] */); +NTSTATUS rpccli_epm_MapAuth(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +#endif /* __CLI_EPMAPPER__ */ diff --git a/librpc/gen_ndr/cli_eventlog.c b/librpc/gen_ndr/cli_eventlog.c new file mode 100644 index 0000000000..02d8fb2e65 --- /dev/null +++ b/librpc/gen_ndr/cli_eventlog.c @@ -0,0 +1,915 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_eventlog.h" + +NTSTATUS rpccli_eventlog_ClearEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *backupfile /* [in] [unique] */) +{ + struct eventlog_ClearEventLogW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.backupfile = backupfile; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_CLEAREVENTLOGW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_BackupEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_BackupEventLogW r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_BACKUPEVENTLOGW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_CloseEventLog(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */) +{ + struct eventlog_CloseEventLog r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_CLOSEEVENTLOG, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_DeregisterEventSource(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_DeregisterEventSource r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_DEREGISTEREVENTSOURCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *number /* [out] [ref] */) +{ + struct eventlog_GetNumRecords r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_GETNUMRECORDS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *number = *r.out.number; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *oldest_entry /* [out] [ref] */) +{ + struct eventlog_GetOldestRecord r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_GETOLDESTRECORD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *oldest_entry = *r.out.oldest_entry; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_ChangeNotify r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_CHANGENOTIFY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */, + struct lsa_String *logname /* [in] [ref] */, + struct lsa_String *servername /* [in] [ref] */, + uint32_t major_version /* [in] */, + uint32_t minor_version /* [in] */, + struct policy_handle *handle /* [out] [ref] */) +{ + struct eventlog_OpenEventLogW r; + NTSTATUS status; + + /* In parameters */ + r.in.unknown0 = unknown0; + r.in.logname = logname; + r.in.servername = servername; + r.in.major_version = major_version; + r.in.minor_version = minor_version; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_OPENEVENTLOGW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_RegisterEventSourceW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_RegisterEventSourceW r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_REGISTEREVENTSOURCEW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_OpenBackupEventLogW r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_OPENBACKUPEVENTLOGW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_ReadEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t flags /* [in] */, + uint32_t offset /* [in] */, + uint32_t number_of_bytes /* [in] [range(0,0x7FFFF)] */, + uint8_t *data /* [out] [ref,size_is(number_of_bytes)] */, + uint32_t *sent_size /* [out] [ref] */, + uint32_t *real_size /* [out] [ref] */) +{ + struct eventlog_ReadEventLogW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.flags = flags; + r.in.offset = offset; + r.in.number_of_bytes = number_of_bytes; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_READEVENTLOGW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(data, r.out.data, r.in.number_of_bytes * sizeof(*data)); + *sent_size = *r.out.sent_size; + *real_size = *r.out.real_size; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_ReportEventW r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_REPORTEVENTW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_ClearEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_ClearEventLogA r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_CLEAREVENTLOGA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_BackupEventLogA r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_BACKUPEVENTLOGA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_OpenEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_OpenEventLogA r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_OPENEVENTLOGA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_RegisterEventSourceA r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_REGISTEREVENTSOURCEA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_OpenBackupEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_OpenBackupEventLogA r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_OPENBACKUPEVENTLOGA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_ReadEventLogA r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_READEVENTLOGA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_ReportEventA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_ReportEventA r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_REPORTEVENTA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_RegisterClusterSvc r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_REGISTERCLUSTERSVC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_DeregisterClusterSvc r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_DEREGISTERCLUSTERSVC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_WriteClusterEvents r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_WRITECLUSTEREVENTS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_GetLogIntormation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct eventlog_GetLogIntormation r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_GetLogIntormation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_GETLOGINTORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_eventlog_FlushEventLog(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */) +{ + struct eventlog_FlushEventLog r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_eventlog, + NDR_EVENTLOG_FLUSHEVENTLOG, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + diff --git a/librpc/gen_ndr/cli_eventlog.h b/librpc/gen_ndr/cli_eventlog.h new file mode 100644 index 0000000000..0594a06f59 --- /dev/null +++ b/librpc/gen_ndr/cli_eventlog.h @@ -0,0 +1,73 @@ +#include "librpc/gen_ndr/ndr_eventlog.h" +#ifndef __CLI_EVENTLOG__ +#define __CLI_EVENTLOG__ +NTSTATUS rpccli_eventlog_ClearEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *backupfile /* [in] [unique] */); +NTSTATUS rpccli_eventlog_BackupEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_CloseEventLog(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */); +NTSTATUS rpccli_eventlog_DeregisterEventSource(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *number /* [out] [ref] */); +NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *oldest_entry /* [out] [ref] */); +NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */, + struct lsa_String *logname /* [in] [ref] */, + struct lsa_String *servername /* [in] [ref] */, + uint32_t major_version /* [in] */, + uint32_t minor_version /* [in] */, + struct policy_handle *handle /* [out] [ref] */); +NTSTATUS rpccli_eventlog_RegisterEventSourceW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_ReadEventLogW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t flags /* [in] */, + uint32_t offset /* [in] */, + uint32_t number_of_bytes /* [in] [range(0,0x7FFFF)] */, + uint8_t *data /* [out] [ref,size_is(number_of_bytes)] */, + uint32_t *sent_size /* [out] [ref] */, + uint32_t *real_size /* [out] [ref] */); +NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_ClearEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_OpenEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_OpenBackupEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_ReportEventA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_GetLogIntormation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_eventlog_FlushEventLog(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */); +#endif /* __CLI_EVENTLOG__ */ diff --git a/librpc/gen_ndr/cli_initshutdown.c b/librpc/gen_ndr/cli_initshutdown.c new file mode 100644 index 0000000000..bc8ca5b5f1 --- /dev/null +++ b/librpc/gen_ndr/cli_initshutdown.c @@ -0,0 +1,155 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_initshutdown.h" + +NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *hostname /* [in] [unique] */, + struct lsa_StringLarge *message /* [in] [unique] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */, + WERROR *werror) +{ + struct initshutdown_Init r; + NTSTATUS status; + + /* In parameters */ + r.in.hostname = hostname; + r.in.message = message; + r.in.timeout = timeout; + r.in.force_apps = force_apps; + r.in.do_reboot = do_reboot; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(initshutdown_Init, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_initshutdown, + NDR_INITSHUTDOWN_INIT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(initshutdown_Init, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *server /* [in] [unique] */, + WERROR *werror) +{ + struct initshutdown_Abort r; + NTSTATUS status; + + /* In parameters */ + r.in.server = server; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(initshutdown_Abort, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_initshutdown, + NDR_INITSHUTDOWN_ABORT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(initshutdown_Abort, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_initshutdown_InitEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *hostname /* [in] [unique] */, + struct lsa_StringLarge *message /* [in] [unique] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */, + uint32_t reason /* [in] */, + WERROR *werror) +{ + struct initshutdown_InitEx r; + NTSTATUS status; + + /* In parameters */ + r.in.hostname = hostname; + r.in.message = message; + r.in.timeout = timeout; + r.in.force_apps = force_apps; + r.in.do_reboot = do_reboot; + r.in.reason = reason; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(initshutdown_InitEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_initshutdown, + NDR_INITSHUTDOWN_INITEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/librpc/gen_ndr/cli_initshutdown.h b/librpc/gen_ndr/cli_initshutdown.h new file mode 100644 index 0000000000..e2eb9daabe --- /dev/null +++ b/librpc/gen_ndr/cli_initshutdown.h @@ -0,0 +1,25 @@ +#include "librpc/gen_ndr/ndr_initshutdown.h" +#ifndef __CLI_INITSHUTDOWN__ +#define __CLI_INITSHUTDOWN__ +NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *hostname /* [in] [unique] */, + struct lsa_StringLarge *message /* [in] [unique] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */, + WERROR *werror); +NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *server /* [in] [unique] */, + WERROR *werror); +NTSTATUS rpccli_initshutdown_InitEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *hostname /* [in] [unique] */, + struct lsa_StringLarge *message /* [in] [unique] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */, + uint32_t reason /* [in] */, + WERROR *werror); +#endif /* __CLI_INITSHUTDOWN__ */ diff --git a/librpc/gen_ndr/cli_lsa.c b/librpc/gen_ndr/cli_lsa.c new file mode 100644 index 0000000000..e7775b1bfe --- /dev/null +++ b/librpc/gen_ndr/cli_lsa.c @@ -0,0 +1,3435 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_lsa.h" + +NTSTATUS rpccli_lsa_Close(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */) +{ + struct lsa_Close r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_Close, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CLOSE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_Close, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_Delete(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */) +{ + struct lsa_Delete r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_Delete, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_DELETE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_Delete, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_EnumPrivs(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct lsa_PrivArray *privs /* [out] [ref] */, + uint32_t max_count /* [in] */) +{ + struct lsa_EnumPrivs r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.resume_handle = resume_handle; + r.in.max_count = max_count; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumPrivs, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_ENUMPRIVS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *privs = *r.out.privs; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct sec_desc_buf **sdbuf /* [out] [ref] */) +{ + struct lsa_QuerySecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sec_info = sec_info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QuerySecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_QUERYSECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sdbuf = *r.out.sdbuf; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct sec_desc_buf *sdbuf /* [in] [ref] */) +{ + struct lsa_SetSecObj r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sec_info = sec_info; + r.in.sdbuf = sdbuf; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetSecObj, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETSECOBJ, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_ChangePassword r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_ChangePassword, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CHANGEPASSWORD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + struct lsa_ObjectAttribute *attr /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */) +{ + struct lsa_OpenPolicy r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.attr = attr; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_OPENPOLICY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum lsa_PolicyInfo level /* [in] */, + union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */) +{ + struct lsa_QueryInfoPolicy r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_QUERYINFOPOLICY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetInfoPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum lsa_PolicyInfo level /* [in] */, + union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */) +{ + struct lsa_SetInfoPolicy r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETINFOPOLICY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_ClearAuditLog r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CLEARAUDITLOG, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *acct_handle /* [out] [ref] */) +{ + struct lsa_CreateAccount r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sid = sid; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateAccount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREATEACCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *acct_handle = *r.out.acct_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct lsa_SidArray *sids /* [out] [ref] */, + uint32_t num_entries /* [in] [range(0,8192)] */) +{ + struct lsa_EnumAccounts r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.resume_handle = resume_handle; + r.in.num_entries = num_entries; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_ENUMACCOUNTS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *sids = *r.out.sids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CreateTrustedDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *policy_handle /* [in] [ref] */, + struct lsa_DomainInfo *info /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */) +{ + struct lsa_CreateTrustedDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.policy_handle = policy_handle; + r.in.info = info; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREATETRUSTEDDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *trustdom_handle = *r.out.trustdom_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct lsa_DomainList *domains /* [out] [ref] */, + uint32_t max_size /* [in] */) +{ + struct lsa_EnumTrustDom r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.resume_handle = resume_handle; + r.in.max_size = max_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_ENUMTRUSTDOM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *domains = *r.out.domains; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [size_is(num_names)] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransSidArray *sids /* [in,out] [ref] */, + enum lsa_LookupNamesLevel level /* [in] */, + uint32_t *count /* [in,out] [ref] */) +{ + struct lsa_LookupNames r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.num_names = num_names; + r.in.names = names; + r.in.sids = sids; + r.in.level = level; + r.in.count = count; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupNames, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPNAMES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupNames, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *domains = *r.out.domains; + *sids = *r.out.sids; + *count = *r.out.count; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransNameArray *names /* [in,out] [ref] */, + uint16_t level /* [in] */, + uint32_t *count /* [in,out] [ref] */) +{ + struct lsa_LookupSids r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sids = sids; + r.in.names = names; + r.in.level = level; + r.in.count = count; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupSids, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPSIDS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupSids, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *domains = *r.out.domains; + *names = *r.out.names; + *count = *r.out.count; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CreateSecret(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String name /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *sec_handle /* [out] [ref] */) +{ + struct lsa_CreateSecret r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.name = name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateSecret, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREATESECRET, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sec_handle = *r.out.sec_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *acct_handle /* [out] [ref] */) +{ + struct lsa_OpenAccount r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sid = sid; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenAccount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_OPENACCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *acct_handle = *r.out.acct_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_PrivilegeSet **privs /* [out] [ref] */) +{ + struct lsa_EnumPrivsAccount r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_ENUMPRIVSACCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *privs = *r.out.privs; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_AddPrivilegesToAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_PrivilegeSet *privs /* [in] [ref] */) +{ + struct lsa_AddPrivilegesToAccount r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.privs = privs; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_ADDPRIVILEGESTOACCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint8_t remove_all /* [in] */, + struct lsa_PrivilegeSet *privs /* [in] [unique] */) +{ + struct lsa_RemovePrivilegesFromAccount r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.remove_all = remove_all; + r.in.privs = privs; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_GetQuotasForAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_GetQuotasForAccount r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_GETQUOTASFORACCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_SetQuotasForAccount r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETQUOTASFORACCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *access_mask /* [out] [ref] */) +{ + struct lsa_GetSystemAccessAccount r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_GETSYSTEMACCESSACCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *access_mask = *r.out.access_mask; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t access_mask /* [in] */) +{ + struct lsa_SetSystemAccessAccount r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETSYSTEMACCESSACCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */) +{ + struct lsa_OpenTrustedDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sid = sid; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_OPENTRUSTEDDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *trustdom_handle = *r.out.trustdom_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *trustdom_handle /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */) +{ + struct lsa_QueryTrustedDomainInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.trustdom_handle = trustdom_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_QUERYTRUSTEDDOMAININFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *trustdom_handle /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */) +{ + struct lsa_SetInformationTrustedDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.trustdom_handle = trustdom_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String name /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *sec_handle /* [out] [ref] */) +{ + struct lsa_OpenSecret r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.name = name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenSecret, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_OPENSECRET, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sec_handle = *r.out.sec_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetSecret(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *sec_handle /* [in] [ref] */, + struct lsa_DATA_BUF *new_val /* [in] [unique] */, + struct lsa_DATA_BUF *old_val /* [in] [unique] */) +{ + struct lsa_SetSecret r; + NTSTATUS status; + + /* In parameters */ + r.in.sec_handle = sec_handle; + r.in.new_val = new_val; + r.in.old_val = old_val; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetSecret, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETSECRET, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetSecret, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *sec_handle /* [in] [ref] */, + struct lsa_DATA_BUF_PTR *new_val /* [in,out] [unique] */, + NTTIME *new_mtime /* [in,out] [unique] */, + struct lsa_DATA_BUF_PTR *old_val /* [in,out] [unique] */, + NTTIME *old_mtime /* [in,out] [unique] */) +{ + struct lsa_QuerySecret r; + NTSTATUS status; + + /* In parameters */ + r.in.sec_handle = sec_handle; + r.in.new_val = new_val; + r.in.new_mtime = new_mtime; + r.in.old_val = old_val; + r.in.old_mtime = old_mtime; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QuerySecret, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_QUERYSECRET, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (new_val && r.out.new_val) { + *new_val = *r.out.new_val; + } + if (new_mtime && r.out.new_mtime) { + *new_mtime = *r.out.new_mtime; + } + if (old_val && r.out.old_val) { + *old_val = *r.out.old_val; + } + if (old_mtime && r.out.old_mtime) { + *old_mtime = *r.out.old_mtime; + } + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupPrivValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *name /* [in] [ref] */, + struct lsa_LUID *luid /* [out] [ref] */) +{ + struct lsa_LookupPrivValue r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.name = name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPPRIVVALUE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *luid = *r.out.luid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_LUID *luid /* [in] [ref] */, + struct lsa_StringLarge **name /* [out] [ref] */) +{ + struct lsa_LookupPrivName r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.luid = luid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPPRIVNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *name = *r.out.name; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *name /* [in] [ref] */, + uint16_t language_id /* [in] */, + uint16_t language_id_sys /* [in] */, + struct lsa_StringLarge **disp_name /* [out] [ref] */, + uint16_t *returned_language_id /* [out] [ref] */) +{ + struct lsa_LookupPrivDisplayName r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.name = name; + r.in.language_id = language_id; + r.in.language_id_sys = language_id_sys; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPPRIVDISPLAYNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *disp_name = *r.out.disp_name; + *returned_language_id = *r.out.returned_language_id; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */) +{ + struct lsa_DeleteObject r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_DeleteObject, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_DELETEOBJECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *name /* [in] [unique] */, + struct lsa_SidArray *sids /* [out] [ref] */) +{ + struct lsa_EnumAccountsWithUserRight r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.name = name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sids = *r.out.sids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_EnumAccountRights(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + struct lsa_RightSet *rights /* [out] [ref] */) +{ + struct lsa_EnumAccountRights r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_ENUMACCOUNTRIGHTS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rights = *r.out.rights; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_AddAccountRights(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + struct lsa_RightSet *rights /* [in] [ref] */) +{ + struct lsa_AddAccountRights r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sid = sid; + r.in.rights = rights; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_ADDACCOUNTRIGHTS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + uint8_t remove_all /* [in] */, + struct lsa_RightSet *rights /* [in] [ref] */) +{ + struct lsa_RemoveAccountRights r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sid = sid; + r.in.remove_all = remove_all; + r.in.rights = rights; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_REMOVEACCOUNTRIGHTS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *dom_sid /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */) +{ + struct lsa_QueryTrustedDomainInfoBySid r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.dom_sid = dom_sid; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *dom_sid /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */) +{ + struct lsa_SetTrustedDomainInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.dom_sid = dom_sid; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETTRUSTEDDOMAININFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *dom_sid /* [in] [ref] */) +{ + struct lsa_DeleteTrustedDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.dom_sid = dom_sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_DELETETRUSTEDDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_StorePrivateData r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_STOREPRIVATEDATA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_RetrievePrivateData r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_RETRIEVEPRIVATEDATA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + struct lsa_ObjectAttribute *attr /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */) +{ + struct lsa_OpenPolicy2 r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.attr = attr; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_OPENPOLICY2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + struct lsa_String **account_name /* [in,out] [ref] */, + struct lsa_String **authority_name /* [in,out] [unique] */) +{ + struct lsa_GetUserName r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.account_name = account_name; + r.in.authority_name = authority_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_GetUserName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_GETUSERNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_GetUserName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *account_name = *r.out.account_name; + if (authority_name && r.out.authority_name) { + *authority_name = *r.out.authority_name; + } + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum lsa_PolicyInfo level /* [in] */, + union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */) +{ + struct lsa_QueryInfoPolicy2 r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_QUERYINFOPOLICY2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum lsa_PolicyInfo level /* [in] */, + union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */) +{ + struct lsa_SetInfoPolicy2 r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETINFOPOLICY2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *trusted_domain /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */) +{ + struct lsa_QueryTrustedDomainInfoByName r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.trusted_domain = trusted_domain; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String trusted_domain /* [in] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo *info /* [in] [unique,switch_is(level)] */) +{ + struct lsa_SetTrustedDomainInfoByName r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.trusted_domain = trusted_domain; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETTRUSTEDDOMAININFOBYNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct lsa_DomainListEx *domains /* [out] [ref] */, + uint32_t max_size /* [in] */) +{ + struct lsa_EnumTrustedDomainsEx r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.resume_handle = resume_handle; + r.in.max_size = max_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_ENUMTRUSTEDDOMAINSEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *domains = *r.out.domains; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *policy_handle /* [in] [ref] */, + struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */, + struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */) +{ + struct lsa_CreateTrustedDomainEx r; + NTSTATUS status; + + /* In parameters */ + r.in.policy_handle = policy_handle; + r.in.info = info; + r.in.auth_info = auth_info; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREATETRUSTEDDOMAINEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *trustdom_handle = *r.out.trustdom_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */) +{ + struct lsa_CloseTrustedDomainEx r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CLOSETRUSTEDDOMAINEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint16_t level /* [in] */, + union lsa_DomainInformationPolicy **info /* [out] [ref,switch_is(level)] */) +{ + struct lsa_QueryDomainInformationPolicy r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_QUERYDOMAININFORMATIONPOLICY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint16_t level /* [in] */, + union lsa_DomainInformationPolicy *info /* [in] [unique,switch_is(level)] */) +{ + struct lsa_SetDomainInformationPolicy r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_SETDOMAININFORMATIONPOLICY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_OpenTrustedDomainByName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String name /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */) +{ + struct lsa_OpenTrustedDomainByName r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.name = name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_OPENTRUSTEDDOMAINBYNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *trustdom_handle = *r.out.trustdom_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_TestCall(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_TestCall r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_TestCall, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_TESTCALL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_TestCall, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransNameArray2 *names /* [in,out] [ref] */, + uint16_t level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t unknown1 /* [in] */, + uint32_t unknown2 /* [in] */) +{ + struct lsa_LookupSids2 r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sids = sids; + r.in.names = names; + r.in.level = level; + r.in.count = count; + r.in.unknown1 = unknown1; + r.in.unknown2 = unknown2; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupSids2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPSIDS2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *domains = *r.out.domains; + *names = *r.out.names; + *count = *r.out.count; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [size_is(num_names)] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransSidArray2 *sids /* [in,out] [ref] */, + enum lsa_LookupNamesLevel level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t lookup_options /* [in] */, + uint32_t client_revision /* [in] */) +{ + struct lsa_LookupNames2 r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.num_names = num_names; + r.in.names = names; + r.in.sids = sids; + r.in.level = level; + r.in.count = count; + r.in.lookup_options = lookup_options; + r.in.client_revision = client_revision; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupNames2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPNAMES2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *domains = *r.out.domains; + *sids = *r.out.sids; + *count = *r.out.count; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *policy_handle /* [in] [ref] */, + struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */, + struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */) +{ + struct lsa_CreateTrustedDomainEx2 r; + NTSTATUS status; + + /* In parameters */ + r.in.policy_handle = policy_handle; + r.in.info = info; + r.in.auth_info = auth_info; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREATETRUSTEDDOMAINEX2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *trustdom_handle = *r.out.trustdom_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRWRITE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRWRITE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRREAD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRREAD r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRREAD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRENUMERATE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRENUMERATE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRWRITEDOMAINCREDENTIALS r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRWRITEDOMAINCREDENTIALS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRREADDOMAINCREDENTIALS r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRREADDOMAINCREDENTIALS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRDELETE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRDELETE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRGETTARGETINFO(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRGETTARGETINFO r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRGETTARGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRPROFILELOADED(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRPROFILELOADED r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRPROFILELOADED, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [size_is(num_names)] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransSidArray3 *sids /* [in,out] [ref] */, + enum lsa_LookupNamesLevel level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t lookup_options /* [in] */, + uint32_t client_revision /* [in] */) +{ + struct lsa_LookupNames3 r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.num_names = num_names; + r.in.names = names; + r.in.sids = sids; + r.in.level = level; + r.in.count = count; + r.in.lookup_options = lookup_options; + r.in.client_revision = client_revision; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupNames3, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPNAMES3, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *domains = *r.out.domains; + *sids = *r.out.sids; + *count = *r.out.count; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRGETSESSIONTYPES r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRGETSESSIONTYPES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_LSARREGISTERAUDITEVENT r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LSARREGISTERAUDITEVENT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_LSARGENAUDITEVENT r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LSARGENAUDITEVENT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_LSARUNREGISTERAUDITEVENT r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LSARUNREGISTERAUDITEVENT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *trusted_domain_name /* [in] [ref] */, + uint16_t unknown /* [in] */, + struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */) +{ + struct lsa_lsaRQueryForestTrustInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.trusted_domain_name = trusted_domain_name; + r.in.unknown = unknown; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *forest_trust_info = *r.out.forest_trust_info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_LSARSETFORESTTRUSTINFORMATION r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LSARSETFORESTTRUSTINFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_CREDRRENAME r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_CREDRRENAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_SidArray *sids /* [in] [ref] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransNameArray2 *names /* [in,out] [ref] */, + uint16_t level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t unknown1 /* [in] */, + uint32_t unknown2 /* [in] */) +{ + struct lsa_LookupSids3 r; + NTSTATUS status; + + /* In parameters */ + r.in.sids = sids; + r.in.names = names; + r.in.level = level; + r.in.count = count; + r.in.unknown1 = unknown1; + r.in.unknown2 = unknown2; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupSids3, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPSIDS3, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *domains = *r.out.domains; + *names = *r.out.names; + *count = *r.out.count; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [size_is(num_names)] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransSidArray3 *sids /* [in,out] [ref] */, + enum lsa_LookupNamesLevel level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t lookup_options /* [in] */, + uint32_t client_revision /* [in] */) +{ + struct lsa_LookupNames4 r; + NTSTATUS status; + + /* In parameters */ + r.in.num_names = num_names; + r.in.names = names; + r.in.sids = sids; + r.in.level = level; + r.in.count = count; + r.in.lookup_options = lookup_options; + r.in.client_revision = client_revision; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupNames4, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LOOKUPNAMES4, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *domains = *r.out.domains; + *sids = *r.out.sids; + *count = *r.out.count; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_LSAROPENPOLICYSCE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSAROPENPOLICYSCE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LSAROPENPOLICYSCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_lsa_LSARADTREPORTSECURITYEVENT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx) +{ + struct lsa_LSARADTREPORTSECURITYEVENT r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_lsarpc, + NDR_LSA_LSARADTREPORTSECURITYEVENT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + diff --git a/librpc/gen_ndr/cli_lsa.h b/librpc/gen_ndr/cli_lsa.h new file mode 100644 index 0000000000..554182c6db --- /dev/null +++ b/librpc/gen_ndr/cli_lsa.h @@ -0,0 +1,387 @@ +#include "librpc/gen_ndr/ndr_lsa.h" +#ifndef __CLI_LSARPC__ +#define __CLI_LSARPC__ +NTSTATUS rpccli_lsa_Close(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */); +NTSTATUS rpccli_lsa_Delete(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */); +NTSTATUS rpccli_lsa_EnumPrivs(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct lsa_PrivArray *privs /* [out] [ref] */, + uint32_t max_count /* [in] */); +NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct sec_desc_buf **sdbuf /* [out] [ref] */); +NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct sec_desc_buf *sdbuf /* [in] [ref] */); +NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + struct lsa_ObjectAttribute *attr /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum lsa_PolicyInfo level /* [in] */, + union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_SetInfoPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum lsa_PolicyInfo level /* [in] */, + union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *acct_handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct lsa_SidArray *sids /* [out] [ref] */, + uint32_t num_entries /* [in] [range(0,8192)] */); +NTSTATUS rpccli_lsa_CreateTrustedDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *policy_handle /* [in] [ref] */, + struct lsa_DomainInfo *info /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct lsa_DomainList *domains /* [out] [ref] */, + uint32_t max_size /* [in] */); +NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [size_is(num_names)] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransSidArray *sids /* [in,out] [ref] */, + enum lsa_LookupNamesLevel level /* [in] */, + uint32_t *count /* [in,out] [ref] */); +NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransNameArray *names /* [in,out] [ref] */, + uint16_t level /* [in] */, + uint32_t *count /* [in,out] [ref] */); +NTSTATUS rpccli_lsa_CreateSecret(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String name /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *sec_handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *acct_handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_PrivilegeSet **privs /* [out] [ref] */); +NTSTATUS rpccli_lsa_AddPrivilegesToAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_PrivilegeSet *privs /* [in] [ref] */); +NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint8_t remove_all /* [in] */, + struct lsa_PrivilegeSet *privs /* [in] [unique] */); +NTSTATUS rpccli_lsa_GetQuotasForAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *access_mask /* [out] [ref] */); +NTSTATUS rpccli_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t access_mask /* [in] */); +NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *trustdom_handle /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *trustdom_handle /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String name /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *sec_handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_SetSecret(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *sec_handle /* [in] [ref] */, + struct lsa_DATA_BUF *new_val /* [in] [unique] */, + struct lsa_DATA_BUF *old_val /* [in] [unique] */); +NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *sec_handle /* [in] [ref] */, + struct lsa_DATA_BUF_PTR *new_val /* [in,out] [unique] */, + NTTIME *new_mtime /* [in,out] [unique] */, + struct lsa_DATA_BUF_PTR *old_val /* [in,out] [unique] */, + NTTIME *old_mtime /* [in,out] [unique] */); +NTSTATUS rpccli_lsa_LookupPrivValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *name /* [in] [ref] */, + struct lsa_LUID *luid /* [out] [ref] */); +NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_LUID *luid /* [in] [ref] */, + struct lsa_StringLarge **name /* [out] [ref] */); +NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *name /* [in] [ref] */, + uint16_t language_id /* [in] */, + uint16_t language_id_sys /* [in] */, + struct lsa_StringLarge **disp_name /* [out] [ref] */, + uint16_t *returned_language_id /* [out] [ref] */); +NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */); +NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *name /* [in] [unique] */, + struct lsa_SidArray *sids /* [out] [ref] */); +NTSTATUS rpccli_lsa_EnumAccountRights(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + struct lsa_RightSet *rights /* [out] [ref] */); +NTSTATUS rpccli_lsa_AddAccountRights(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + struct lsa_RightSet *rights /* [in] [ref] */); +NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */, + uint8_t remove_all /* [in] */, + struct lsa_RightSet *rights /* [in] [ref] */); +NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *dom_sid /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *dom_sid /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct dom_sid2 *dom_sid /* [in] [ref] */); +NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + struct lsa_ObjectAttribute *attr /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + struct lsa_String **account_name /* [in,out] [ref] */, + struct lsa_String **authority_name /* [in,out] [unique] */); +NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum lsa_PolicyInfo level /* [in] */, + union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum lsa_PolicyInfo level /* [in] */, + union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *trusted_domain /* [in] [ref] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String trusted_domain /* [in] */, + enum lsa_TrustDomInfoEnum level /* [in] */, + union lsa_TrustedDomainInfo *info /* [in] [unique,switch_is(level)] */); +NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct lsa_DomainListEx *domains /* [out] [ref] */, + uint32_t max_size /* [in] */); +NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *policy_handle /* [in] [ref] */, + struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */, + struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */); +NTSTATUS rpccli_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint16_t level /* [in] */, + union lsa_DomainInformationPolicy **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint16_t level /* [in] */, + union lsa_DomainInformationPolicy *info /* [in] [unique,switch_is(level)] */); +NTSTATUS rpccli_lsa_OpenTrustedDomainByName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String name /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_TestCall(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransNameArray2 *names /* [in,out] [ref] */, + uint16_t level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t unknown1 /* [in] */, + uint32_t unknown2 /* [in] */); +NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [size_is(num_names)] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransSidArray2 *sids /* [in,out] [ref] */, + enum lsa_LookupNamesLevel level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t lookup_options /* [in] */, + uint32_t client_revision /* [in] */); +NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *policy_handle /* [in] [ref] */, + struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */, + struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *trustdom_handle /* [out] [ref] */); +NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_CREDRREAD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_CREDRGETTARGETINFO(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_CREDRPROFILELOADED(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [size_is(num_names)] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransSidArray3 *sids /* [in,out] [ref] */, + enum lsa_LookupNamesLevel level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t lookup_options /* [in] */, + uint32_t client_revision /* [in] */); +NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct lsa_String *trusted_domain_name /* [in] [ref] */, + uint16_t unknown /* [in] */, + struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */); +NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_SidArray *sids /* [in] [ref] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransNameArray2 *names /* [in,out] [ref] */, + uint16_t level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t unknown1 /* [in] */, + uint32_t unknown2 /* [in] */); +NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [size_is(num_names)] */, + struct lsa_RefDomainList **domains /* [out] [ref] */, + struct lsa_TransSidArray3 *sids /* [in,out] [ref] */, + enum lsa_LookupNamesLevel level /* [in] */, + uint32_t *count /* [in,out] [ref] */, + uint32_t lookup_options /* [in] */, + uint32_t client_revision /* [in] */); +NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_LSARADTREPORTSECURITYEVENT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx); +#endif /* __CLI_LSARPC__ */ diff --git a/librpc/gen_ndr/cli_netlogon.c b/librpc/gen_ndr/cli_netlogon.c new file mode 100644 index 0000000000..1ce4e67c56 --- /dev/null +++ b/librpc/gen_ndr/cli_netlogon.c @@ -0,0 +1,2352 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_netlogon.h" + +NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + const char *workstation /* [in] [charset(UTF16)] */, + struct netr_UasInfo **info /* [out] [ref] */, + WERROR *werror) +{ + struct netr_LogonUasLogon r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.workstation = workstation; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonUasLogon, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONUASLOGON, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + const char *workstation /* [in] [charset(UTF16)] */, + struct netr_UasLogoffInfo *info /* [out] [ref] */, + WERROR *werror) +{ + struct netr_LogonUasLogoff r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.workstation = workstation; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONUASLOGOFF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [unique] */, + struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, + enum netr_LogonInfoClass logon_level /* [in] */, + union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, + uint16_t validation_level /* [in] */, + union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, + uint8_t *authoritative /* [out] [ref] */) +{ + struct netr_LogonSamLogon r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.computer_name = computer_name; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.logon_level = logon_level; + r.in.logon = logon; + r.in.validation_level = validation_level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONSAMLOGON, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (return_authenticator && r.out.return_authenticator) { + *return_authenticator = *r.out.return_authenticator; + } + *validation = *r.out.validation; + *authoritative = *r.out.authoritative; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [unique] */, + struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, + enum netr_LogonInfoClass logon_level /* [in] */, + union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */) +{ + struct netr_LogonSamLogoff r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.computer_name = computer_name; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.logon_level = logon_level; + r.in.logon = logon; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONSAMLOGOFF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (return_authenticator && r.out.return_authenticator) { + *return_authenticator = *r.out.return_authenticator; + } + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Credential *credentials /* [in] [ref] */, + struct netr_Credential *return_credentials /* [out] [ref] */) +{ + struct netr_ServerReqChallenge r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.computer_name = computer_name; + r.in.credentials = credentials; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_SERVERREQCHALLENGE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_credentials = *r.out.return_credentials; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Credential *credentials /* [in] [ref] */, + struct netr_Credential *return_credentials /* [out] [ref] */) +{ + struct netr_ServerAuthenticate r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credentials = credentials; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_SERVERAUTHENTICATE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_credentials = *r.out.return_credentials; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct samr_Password *new_password /* [in] [ref] */) +{ + struct netr_ServerPasswordSet r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credential = credential; + r.in.new_password = new_password; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_SERVERPASSWORDSET, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + enum netr_SamDatabaseID database_id /* [in] */, + uint64_t *sequence_num /* [in,out] [ref] */, + struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, + uint32_t preferredmaximumlength /* [in] */) +{ + struct netr_DatabaseDeltas r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.computername = computername; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.database_id = database_id; + r.in.sequence_num = sequence_num; + r.in.preferredmaximumlength = preferredmaximumlength; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DATABASEDELTAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *sequence_num = *r.out.sequence_num; + *delta_enum_array = *r.out.delta_enum_array; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + enum netr_SamDatabaseID database_id /* [in] */, + uint32_t *sync_context /* [in,out] [ref] */, + struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, + uint32_t preferredmaximumlength /* [in] */) +{ + struct netr_DatabaseSync r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.computername = computername; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.database_id = database_id; + r.in.sync_context = sync_context; + r.in.preferredmaximumlength = preferredmaximumlength; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DatabaseSync, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DATABASESYNC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *sync_context = *r.out.sync_context; + *delta_enum_array = *r.out.delta_enum_array; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_AccountDeltas(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator credential /* [in] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + struct netr_UAS_INFO_0 uas /* [in] */, + uint32_t count /* [in] */, + uint32_t level /* [in] */, + uint32_t buffersize /* [in] */, + struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */, + uint32_t *count_returned /* [out] [ref] */, + uint32_t *total_entries /* [out] [ref] */, + struct netr_UAS_INFO_0 *recordid /* [out] [ref] */) +{ + struct netr_AccountDeltas r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.computername = computername; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.uas = uas; + r.in.count = count; + r.in.level = level; + r.in.buffersize = buffersize; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_AccountDeltas, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_ACCOUNTDELTAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *buffer = *r.out.buffer; + *count_returned = *r.out.count_returned; + *total_entries = *r.out.total_entries; + *recordid = *r.out.recordid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator credential /* [in] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + uint32_t reference /* [in] */, + uint32_t level /* [in] */, + uint32_t buffersize /* [in] */, + struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */, + uint32_t *count_returned /* [out] [ref] */, + uint32_t *total_entries /* [out] [ref] */, + uint32_t *next_reference /* [out] [ref] */, + struct netr_UAS_INFO_0 *recordid /* [in,out] [ref] */) +{ + struct netr_AccountSync r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.computername = computername; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.reference = reference; + r.in.level = level; + r.in.buffersize = buffersize; + r.in.recordid = recordid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_AccountSync, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_ACCOUNTSYNC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_AccountSync, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *buffer = *r.out.buffer; + *count_returned = *r.out.count_returned; + *total_entries = *r.out.total_entries; + *next_reference = *r.out.next_reference; + *recordid = *r.out.recordid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *domainname /* [in] [unique,charset(UTF16)] */, + const char **dcname /* [out] [ref,charset(UTF16)] */, + WERROR *werror) +{ + struct netr_GetDcName r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.domainname = domainname; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_GetDcName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_GETDCNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_GetDcName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *dcname = *r.out.dcname; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + enum netr_LogonControlCode function_code /* [in] */, + uint32_t level /* [in] */, + union netr_CONTROL_QUERY_INFORMATION *info /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct netr_LogonControl r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.function_code = function_code; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonControl, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONCONTROL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonControl, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_GetAnyDCName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + const char *domainname /* [in] [unique,charset(UTF16)] */, + const char **dcname /* [out] [ref,charset(UTF16)] */, + WERROR *werror) +{ + struct netr_GetAnyDCName r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.domainname = domainname; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_GETANYDCNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *dcname = *r.out.dcname; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + enum netr_LogonControlCode function_code /* [in] */, + uint32_t level /* [in] */, + union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */, + union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct netr_LogonControl2 r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.function_code = function_code; + r.in.level = level; + r.in.data = data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonControl2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONCONTROL2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *query = *r.out.query; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Credential *credentials /* [in] [ref] */, + struct netr_Credential *return_credentials /* [out] [ref] */, + uint32_t *negotiate_flags /* [in,out] [ref] */) +{ + struct netr_ServerAuthenticate2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credentials = credentials; + r.in.negotiate_flags = negotiate_flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_SERVERAUTHENTICATE2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_credentials = *r.out.return_credentials; + *negotiate_flags = *r.out.negotiate_flags; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + enum netr_SamDatabaseID database_id /* [in] */, + uint16_t restart_state /* [in] */, + uint32_t *sync_context /* [in,out] [ref] */, + struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, + uint32_t preferredmaximumlength /* [in] */) +{ + struct netr_DatabaseSync2 r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.computername = computername; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.database_id = database_id; + r.in.restart_state = restart_state; + r.in.sync_context = sync_context; + r.in.preferredmaximumlength = preferredmaximumlength; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DATABASESYNC2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *sync_context = *r.out.sync_context; + *delta_enum_array = *r.out.delta_enum_array; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + struct netr_ChangeLogEntry change_log_entry /* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */, + uint32_t change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->flags))] */, + struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */) +{ + struct netr_DatabaseRedo r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.computername = computername; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.change_log_entry = change_log_entry; + r.in.change_log_entry_size = change_log_entry_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DATABASEREDO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *delta_enum_array = *r.out.delta_enum_array; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + uint32_t function_code /* [in] */, + uint32_t level /* [in] */, + union netr_CONTROL_DATA_INFORMATION data /* [in] [switch_is(function_code)] */, + union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct netr_LogonControl2Ex r; + NTSTATUS status; + + /* In parameters */ + r.in.logon_server = logon_server; + r.in.function_code = function_code; + r.in.level = level; + r.in.data = data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONCONTROL2EX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *query = *r.out.query; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct netr_Blob *trusted_domains_blob /* [out] [ref] */, + WERROR *werror) +{ + struct netr_NetrEnumerateTrustedDomains r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_NETRENUMERATETRUSTEDDOMAINS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *trusted_domains_blob = *r.out.trusted_domains_blob; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [unique,charset(UTF16)] */, + struct GUID *domain_guid /* [in] [unique] */, + struct GUID *site_guid /* [in] [unique] */, + uint32_t flags /* [in] */, + struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, + WERROR *werror) +{ + struct netr_DsRGetDCName r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.domain_name = domain_name; + r.in.domain_guid = domain_guid; + r.in.site_guid = site_guid; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRGETDCNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct netr_NETRLOGONDUMMYROUTINE1 r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_NETRLOGONDUMMYROUTINE1, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct netr_NETRLOGONSETSERVICEBITS r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_NETRLOGONSETSERVICEBITS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [unique,charset(UTF16)] */, + uint32_t *rid /* [out] [ref] */, + WERROR *werror) +{ + struct netr_LogonGetTrustRid r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.domain_name = domain_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONGETTRUSTRID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rid = *r.out.rid; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct netr_NETRLOGONCOMPUTESERVERDIGEST r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct netr_NETRLOGONCOMPUTECLIENTDIGEST r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Credential *credentials /* [in] [ref] */, + struct netr_Credential *return_credentials /* [out] [ref] */, + uint32_t *negotiate_flags /* [in,out] [ref] */, + uint32_t *rid /* [out] [ref] */) +{ + struct netr_ServerAuthenticate3 r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credentials = credentials; + r.in.negotiate_flags = negotiate_flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_SERVERAUTHENTICATE3, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_credentials = *r.out.return_credentials; + *negotiate_flags = *r.out.negotiate_flags; + *rid = *r.out.rid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [unique,charset(UTF16)] */, + struct GUID *domain_guid /* [in] [unique] */, + const char *site_name /* [in] [unique,charset(UTF16)] */, + uint32_t flags /* [in] */, + struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, + WERROR *werror) +{ + struct netr_DsRGetDCNameEx r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.domain_name = domain_name; + r.in.domain_guid = domain_guid; + r.in.site_name = site_name; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRGETDCNAMEEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_DsRGetSiteName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + const char **site /* [out] [ref,charset(UTF16)] */, + WERROR *werror) +{ + struct netr_DsRGetSiteName r; + NTSTATUS status; + + /* In parameters */ + r.in.computer_name = computer_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRGETSITENAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *site = *r.out.site; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + uint32_t level /* [in] */, + union netr_DomainQuery query /* [in] [switch_is(level)] */, + union netr_DomainInfo *info /* [out] [ref,switch_is(level)] */) +{ + struct netr_LogonGetDomainInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.computer_name = computer_name; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.level = level; + r.in.query = query; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONGETDOMAININFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct netr_CryptPassword *new_password /* [in] [ref] */) +{ + struct netr_ServerPasswordSet2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credential = credential; + r.in.new_password = new_password; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_SERVERPASSWORDSET2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct samr_Password *password /* [out] [ref] */, + WERROR *werror) +{ + struct netr_ServerPasswordGet r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credential = credential; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_SERVERPASSWORDGET, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *password = *r.out.password; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct netr_NETRLOGONSENDTOSAM r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_NETRLOGONSENDTOSAM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t count /* [in] [range(0,32000)] */, + struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */, + struct netr_DsRAddressToSitenamesWCtr **ctr /* [out] [ref] */, + WERROR *werror) +{ + struct netr_DsRAddressToSitenamesW r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.count = count; + r.in.addresses = addresses; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRADDRESSTOSITENAMESW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *client_account /* [in] [unique,charset(UTF16)] */, + uint32_t mask /* [in] */, + const char *domain_name /* [in] [unique,charset(UTF16)] */, + struct GUID *domain_guid /* [in] [unique] */, + const char *site_name /* [in] [unique,charset(UTF16)] */, + uint32_t flags /* [in] */, + struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, + WERROR *werror) +{ + struct netr_DsRGetDCNameEx2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.client_account = client_account; + r.in.mask = mask; + r.in.domain_name = domain_name; + r.in.domain_guid = domain_guid; + r.in.site_name = site_name; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRGETDCNAMEEX2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct netr_DomainTrustList *dom_trust_list /* [out] [ref] */, + WERROR *werror) +{ + struct netr_NetrEnumerateTrustedDomainsEx r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *dom_trust_list = *r.out.dom_trust_list; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t count /* [in] [range(0,32000)] */, + struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */, + struct netr_DsRAddressToSitenamesExWCtr **ctr /* [out] [ref] */, + WERROR *werror) +{ + struct netr_DsRAddressToSitenamesExW r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.count = count; + r.in.addresses = addresses; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRADDRESSTOSITENAMESEXW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct DcSitesCtr **ctr /* [out] [ref] */, + WERROR *werror) +{ + struct netr_DsrGetDcSiteCoverageW r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRGETDCSITECOVERAGEW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + enum netr_LogonInfoClass logon_level /* [in] */, + union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, + uint16_t validation_level /* [in] */, + union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, + uint8_t *authoritative /* [out] [ref] */, + uint32_t *flags /* [in,out] [ref] */) +{ + struct netr_LogonSamLogonEx r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.computer_name = computer_name; + r.in.logon_level = logon_level; + r.in.logon = logon; + r.in.validation_level = validation_level; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONSAMLOGONEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *validation = *r.out.validation; + *authoritative = *r.out.authoritative; + *flags = *r.out.flags; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t trust_flags /* [in] */, + struct netr_DomainTrustList *trusts /* [out] [ref] */, + WERROR *werror) +{ + struct netr_DsrEnumerateDomainTrusts r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.trust_flags = trust_flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRENUMERATEDOMAINTRUSTS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *trusts = *r.out.trusts; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain /* [in] [unique,charset(UTF16)] */, + struct GUID *domain_guid /* [in] [unique] */, + struct GUID *dsa_guid /* [in] [unique] */, + const char *dns_host /* [in] [ref,charset(UTF16)] */, + WERROR *werror) +{ + struct netr_DsrDeregisterDNSHostRecords r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.domain = domain; + r.in.domain_guid = domain_guid; + r.in.dsa_guid = dsa_guid; + r.in.dns_host = dns_host; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct samr_Password *password /* [out] [ref] */, + struct samr_Password *password2 /* [out] [ref] */) +{ + struct netr_ServerTrustPasswordsGet r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credential = credential; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_SERVERTRUSTPASSWORDSGET, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *password = *r.out.password; + *password2 = *r.out.password2; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *trusted_domain_name /* [in] [unique,charset(UTF16)] */, + uint32_t flags /* [in] */, + struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */, + WERROR *werror) +{ + struct netr_DsRGetForestTrustInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.trusted_domain_name = trusted_domain_name; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_DSRGETFORESTTRUSTINFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *forest_trust_info = *r.out.forest_trust_info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *trusted_domain_name /* [in] [ref,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + uint32_t flags /* [in] */, + struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */, + WERROR *werror) +{ + struct netr_GetForestTrustInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.trusted_domain_name = trusted_domain_name; + r.in.credential = credential; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_GETFORESTTRUSTINFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *forest_trust_info = *r.out.forest_trust_info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [unique] */, + struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, + enum netr_LogonInfoClass logon_level /* [in] */, + union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, + uint16_t validation_level /* [in] */, + union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, + uint8_t *authoritative /* [out] [ref] */, + uint32_t *flags /* [in,out] [ref] */) +{ + struct netr_LogonSamLogonWithFlags r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.computer_name = computer_name; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.logon_level = logon_level; + r.in.logon = logon; + r.in.validation_level = validation_level; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_LOGONSAMLOGONWITHFLAGS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (return_authenticator && r.out.return_authenticator) { + *return_authenticator = *r.out.return_authenticator; + } + *validation = *r.out.validation; + *authoritative = *r.out.authoritative; + *flags = *r.out.flags; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_netr_ServerGetTrustInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [ref,charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [ref,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct samr_Password *new_owf_password /* [out] [ref] */, + struct samr_Password *old_owf_password /* [out] [ref] */, + struct netr_TrustInfo **trust_info /* [out] [ref] */) +{ + struct netr_ServerGetTrustInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credential = credential; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_netlogon, + NDR_NETR_SERVERGETTRUSTINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *new_owf_password = *r.out.new_owf_password; + *old_owf_password = *r.out.old_owf_password; + *trust_info = *r.out.trust_info; + + /* Return result */ + return r.out.result; +} + diff --git a/librpc/gen_ndr/cli_netlogon.h b/librpc/gen_ndr/cli_netlogon.h new file mode 100644 index 0000000000..3fbc00e9da --- /dev/null +++ b/librpc/gen_ndr/cli_netlogon.h @@ -0,0 +1,370 @@ +#include "librpc/gen_ndr/ndr_netlogon.h" +#ifndef __CLI_NETLOGON__ +#define __CLI_NETLOGON__ +NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + const char *workstation /* [in] [charset(UTF16)] */, + struct netr_UasInfo **info /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + const char *workstation /* [in] [charset(UTF16)] */, + struct netr_UasLogoffInfo *info /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [unique] */, + struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, + enum netr_LogonInfoClass logon_level /* [in] */, + union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, + uint16_t validation_level /* [in] */, + union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, + uint8_t *authoritative /* [out] [ref] */); +NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [unique] */, + struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, + enum netr_LogonInfoClass logon_level /* [in] */, + union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */); +NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Credential *credentials /* [in] [ref] */, + struct netr_Credential *return_credentials /* [out] [ref] */); +NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Credential *credentials /* [in] [ref] */, + struct netr_Credential *return_credentials /* [out] [ref] */); +NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct samr_Password *new_password /* [in] [ref] */); +NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + enum netr_SamDatabaseID database_id /* [in] */, + uint64_t *sequence_num /* [in,out] [ref] */, + struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, + uint32_t preferredmaximumlength /* [in] */); +NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + enum netr_SamDatabaseID database_id /* [in] */, + uint32_t *sync_context /* [in,out] [ref] */, + struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, + uint32_t preferredmaximumlength /* [in] */); +NTSTATUS rpccli_netr_AccountDeltas(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator credential /* [in] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + struct netr_UAS_INFO_0 uas /* [in] */, + uint32_t count /* [in] */, + uint32_t level /* [in] */, + uint32_t buffersize /* [in] */, + struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */, + uint32_t *count_returned /* [out] [ref] */, + uint32_t *total_entries /* [out] [ref] */, + struct netr_UAS_INFO_0 *recordid /* [out] [ref] */); +NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator credential /* [in] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + uint32_t reference /* [in] */, + uint32_t level /* [in] */, + uint32_t buffersize /* [in] */, + struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */, + uint32_t *count_returned /* [out] [ref] */, + uint32_t *total_entries /* [out] [ref] */, + uint32_t *next_reference /* [out] [ref] */, + struct netr_UAS_INFO_0 *recordid /* [in,out] [ref] */); +NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *domainname /* [in] [unique,charset(UTF16)] */, + const char **dcname /* [out] [ref,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + enum netr_LogonControlCode function_code /* [in] */, + uint32_t level /* [in] */, + union netr_CONTROL_QUERY_INFORMATION *info /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_netr_GetAnyDCName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + const char *domainname /* [in] [unique,charset(UTF16)] */, + const char **dcname /* [out] [ref,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + enum netr_LogonControlCode function_code /* [in] */, + uint32_t level /* [in] */, + union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */, + union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Credential *credentials /* [in] [ref] */, + struct netr_Credential *return_credentials /* [out] [ref] */, + uint32_t *negotiate_flags /* [in,out] [ref] */); +NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + enum netr_SamDatabaseID database_id /* [in] */, + uint16_t restart_state /* [in] */, + uint32_t *sync_context /* [in,out] [ref] */, + struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, + uint32_t preferredmaximumlength /* [in] */); +NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [charset(UTF16)] */, + const char *computername /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + struct netr_ChangeLogEntry change_log_entry /* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */, + uint32_t change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->flags))] */, + struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */); +NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *logon_server /* [in] [unique,charset(UTF16)] */, + uint32_t function_code /* [in] */, + uint32_t level /* [in] */, + union netr_CONTROL_DATA_INFORMATION data /* [in] [switch_is(function_code)] */, + union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct netr_Blob *trusted_domains_blob /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [unique,charset(UTF16)] */, + struct GUID *domain_guid /* [in] [unique] */, + struct GUID *site_guid /* [in] [unique] */, + uint32_t flags /* [in] */, + struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [unique,charset(UTF16)] */, + uint32_t *rid /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Credential *credentials /* [in] [ref] */, + struct netr_Credential *return_credentials /* [out] [ref] */, + uint32_t *negotiate_flags /* [in,out] [ref] */, + uint32_t *rid /* [out] [ref] */); +NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [unique,charset(UTF16)] */, + struct GUID *domain_guid /* [in] [unique] */, + const char *site_name /* [in] [unique,charset(UTF16)] */, + uint32_t flags /* [in] */, + struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_DsRGetSiteName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + const char **site /* [out] [ref,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + uint32_t level /* [in] */, + union netr_DomainQuery query /* [in] [switch_is(level)] */, + union netr_DomainInfo *info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct netr_CryptPassword *new_password /* [in] [ref] */); +NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct samr_Password *password /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t count /* [in] [range(0,32000)] */, + struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */, + struct netr_DsRAddressToSitenamesWCtr **ctr /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *client_account /* [in] [unique,charset(UTF16)] */, + uint32_t mask /* [in] */, + const char *domain_name /* [in] [unique,charset(UTF16)] */, + struct GUID *domain_guid /* [in] [unique] */, + const char *site_name /* [in] [unique,charset(UTF16)] */, + uint32_t flags /* [in] */, + struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct netr_DomainTrustList *dom_trust_list /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t count /* [in] [range(0,32000)] */, + struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */, + struct netr_DsRAddressToSitenamesExWCtr **ctr /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct DcSitesCtr **ctr /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + enum netr_LogonInfoClass logon_level /* [in] */, + union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, + uint16_t validation_level /* [in] */, + union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, + uint8_t *authoritative /* [out] [ref] */, + uint32_t *flags /* [in,out] [ref] */); +NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t trust_flags /* [in] */, + struct netr_DomainTrustList *trusts /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain /* [in] [unique,charset(UTF16)] */, + struct GUID *domain_guid /* [in] [unique] */, + struct GUID *dsa_guid /* [in] [unique] */, + const char *dns_host /* [in] [ref,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct samr_Password *password /* [out] [ref] */, + struct samr_Password *password2 /* [out] [ref] */); +NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *trusted_domain_name /* [in] [unique,charset(UTF16)] */, + uint32_t flags /* [in] */, + struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *trusted_domain_name /* [in] [ref,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + uint32_t flags /* [in] */, + struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [unique] */, + struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, + enum netr_LogonInfoClass logon_level /* [in] */, + union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, + uint16_t validation_level /* [in] */, + union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, + uint8_t *authoritative /* [out] [ref] */, + uint32_t *flags /* [in,out] [ref] */); +NTSTATUS rpccli_netr_ServerGetTrustInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account_name /* [in] [ref,charset(UTF16)] */, + enum netr_SchannelType secure_channel_type /* [in] */, + const char *computer_name /* [in] [ref,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [out] [ref] */, + struct samr_Password *new_owf_password /* [out] [ref] */, + struct samr_Password *old_owf_password /* [out] [ref] */, + struct netr_TrustInfo **trust_info /* [out] [ref] */); +#endif /* __CLI_NETLOGON__ */ diff --git a/librpc/gen_ndr/cli_ntsvcs.c b/librpc/gen_ndr/cli_ntsvcs.c new file mode 100644 index 0000000000..0f97970e0b --- /dev/null +++ b/librpc/gen_ndr/cli_ntsvcs.c @@ -0,0 +1,2744 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_ntsvcs.h" + +NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_Disconnect r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_Disconnect, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_DISCONNECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_Disconnect, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_Connect r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_Connect, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_CONNECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_Connect, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *version /* [out] [ref] */, + WERROR *werror) +{ + struct PNP_GetVersion r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetVersion, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETVERSION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetVersion, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *version = *r.out.version; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetGlobalState r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETGLOBALSTATE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_InitDetection r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_InitDetection, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_INITDETECTION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_InitDetection, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_ReportLogOn r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_REPORTLOGON, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicepath /* [in] [ref,charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct PNP_ValidateDeviceInstance r; + NTSTATUS status; + + /* In parameters */ + r.in.devicepath = devicepath; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_VALIDATEDEVICEINSTANCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetRootDeviceInstance r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETROOTDEVICEINSTANCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetRelatedDeviceInstance r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETRELATEDDEVICEINSTANCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_EnumerateSubKeys r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_ENUMERATESUBKEYS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *filter /* [in] [unique,charset(UTF16)] */, + uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */, + uint32_t *length /* [in,out] [ref] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct PNP_GetDeviceList r; + NTSTATUS status; + + /* In parameters */ + r.in.filter = filter; + r.in.length = length; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETDEVICELIST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(buffer, r.out.buffer, *r.in.length * sizeof(*buffer)); + *length = *r.out.length; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicename /* [in] [unique,charset(UTF16)] */, + uint32_t *size /* [out] [ref] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct PNP_GetDeviceListSize r; + NTSTATUS status; + + /* In parameters */ + r.in.devicename = devicename; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETDEVICELISTSIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *size = *r.out.size; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetDepth r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDepth, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETDEPTH, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDepth, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicepath /* [in] [ref,charset(UTF16)] */, + uint32_t property /* [in] */, + enum winreg_Type *reg_data_type /* [in,out] [ref] */, + uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */, + uint32_t *buffer_size /* [in,out] [ref] */, + uint32_t *needed /* [in,out] [ref] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct PNP_GetDeviceRegProp r; + NTSTATUS status; + + /* In parameters */ + r.in.devicepath = devicepath; + r.in.property = property; + r.in.reg_data_type = reg_data_type; + r.in.buffer_size = buffer_size; + r.in.needed = needed; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETDEVICEREGPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *reg_data_type = *r.out.reg_data_type; + memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer)); + *buffer_size = *r.out.buffer_size; + *needed = *r.out.needed; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_SetDeviceRegProp r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_SETDEVICEREGPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetClassInstance r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETCLASSINSTANCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_CreateKey r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_CreateKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_CREATEKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_CreateKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DeleteRegistryKey r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_DELETEREGISTRYKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetClassCount r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassCount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETCLASSCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetClassName r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETCLASSNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DeleteClassKey r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_DELETECLASSKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetInterfaceDeviceAlias r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETINTERFACEDEVICEALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetInterfaceDeviceList r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETINTERFACEDEVICELIST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetInterfaceDeviceListSize r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETINTERFACEDEVICELISTSIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RegisterDeviceClassAssociation r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_REGISTERDEVICECLASSASSOCIATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_UnregisterDeviceClassAssociation r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetClassRegProp r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETCLASSREGPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_SetClassRegProp r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_SETCLASSREGPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_CreateDevInst r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_CREATEDEVINST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DeviceInstanceAction r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_DEVICEINSTANCEACTION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetDeviceStatus r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETDEVICESTATUS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_SetDeviceProblem r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_SETDEVICEPROBLEM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DisableDevInst r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_DISABLEDEVINST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_UninstallDevInst r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_UNINSTALLDEVINST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_AddID r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_AddID, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_ADDID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_AddID, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RegisterDriver r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_REGISTERDRIVER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_QueryRemove r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryRemove, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_QUERYREMOVE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RequestDeviceEject r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_REQUESTDEVICEEJECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_IsDockStationPresent r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_ISDOCKSTATIONPRESENT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RequestEjectPC r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_REQUESTEJECTPC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t action /* [in] */, + const char *devicepath /* [in] [ref,charset(UTF16)] */, + uint32_t config /* [in] */, + uint32_t *profile_flags /* [in,out] [ref] */, + uint16_t *veto_type /* [in,out] [unique] */, + const char *unknown5 /* [in] [unique,charset(UTF16)] */, + const char **unknown5a /* [out] [unique,charset(UTF16)] */, + uint32_t name_length /* [in] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct PNP_HwProfFlags r; + NTSTATUS status; + + /* In parameters */ + r.in.action = action; + r.in.devicepath = devicepath; + r.in.config = config; + r.in.profile_flags = profile_flags; + r.in.veto_type = veto_type; + r.in.unknown5 = unknown5; + r.in.name_length = name_length; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_HWPROFFLAGS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *profile_flags = *r.out.profile_flags; + if (veto_type && r.out.veto_type) { + *veto_type = *r.out.veto_type; + } + if (unknown5a && r.out.unknown5a) { + *unknown5a = *r.out.unknown5a; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t idx /* [in] */, + struct PNP_HwProfInfo *info /* [in,out] [ref] */, + uint32_t size /* [in] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct PNP_GetHwProfInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.idx = idx; + r.in.info = info; + r.in.size = size; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETHWPROFINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_AddEmptyLogConf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_ADDEMPTYLOGCONF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_FreeLogConf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_FREELOGCONF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetFirstLogConf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETFIRSTLOGCONF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetNextLogConf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETNEXTLOGCONF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetLogConfPriority r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETLOGCONFPRIORITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_AddResDes r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_AddResDes, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_ADDRESDES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_AddResDes, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_FreeResDes r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_FreeResDes, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_FREERESDES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetNextResDes r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETNEXTRESDES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetResDesData r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetResDesData, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETRESDESDATA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetResDesDataSize r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETRESDESDATASIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_ModifyResDes r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_MODIFYRESDES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DetectResourceLimit r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_DETECTRESOURCELIMIT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_QueryResConfList r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_QUERYRESCONFLIST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_SetHwProf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetHwProf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_SETHWPROF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_QueryArbitratorFreeData r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_QUERYARBITRATORFREEDATA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_QueryArbitratorFreeSize r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_QUERYARBITRATORFREESIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RunDetection r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RunDetection, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_RUNDETECTION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RunDetection, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RegisterNotification r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_REGISTERNOTIFICATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_UnregisterNotification r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_UNREGISTERNOTIFICATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetCustomDevProp r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETCUSTOMDEVPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetVersionInternal r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETVERSIONINTERNAL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetBlockedDriverInfo r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetBlockedDriverInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETBLOCKEDDRIVERINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetBlockedDriverInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetServerSideDeviceInstallFlags r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetServerSideDeviceInstallFlags, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_ntsvcs, + NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetServerSideDeviceInstallFlags, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/librpc/gen_ndr/cli_ntsvcs.h b/librpc/gen_ndr/cli_ntsvcs.h new file mode 100644 index 0000000000..fc4a9f4a71 --- /dev/null +++ b/librpc/gen_ndr/cli_ntsvcs.h @@ -0,0 +1,229 @@ +#include "librpc/gen_ndr/ndr_ntsvcs.h" +#ifndef __CLI_NTSVCS__ +#define __CLI_NTSVCS__ +NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *version /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicepath /* [in] [ref,charset(UTF16)] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *filter /* [in] [unique,charset(UTF16)] */, + uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */, + uint32_t *length /* [in,out] [ref] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicename /* [in] [unique,charset(UTF16)] */, + uint32_t *size /* [out] [ref] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicepath /* [in] [ref,charset(UTF16)] */, + uint32_t property /* [in] */, + enum winreg_Type *reg_data_type /* [in,out] [ref] */, + uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */, + uint32_t *buffer_size /* [in,out] [ref] */, + uint32_t *needed /* [in,out] [ref] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t action /* [in] */, + const char *devicepath /* [in] [ref,charset(UTF16)] */, + uint32_t config /* [in] */, + uint32_t *profile_flags /* [in,out] [ref] */, + uint16_t *veto_type /* [in,out] [unique] */, + const char *unknown5 /* [in] [unique,charset(UTF16)] */, + const char **unknown5a /* [out] [unique,charset(UTF16)] */, + uint32_t name_length /* [in] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t idx /* [in] */, + struct PNP_HwProfInfo *info /* [in,out] [ref] */, + uint32_t size /* [in] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +#endif /* __CLI_NTSVCS__ */ diff --git a/librpc/gen_ndr/cli_samr.c b/librpc/gen_ndr/cli_samr.c new file mode 100644 index 0000000000..7edb790286 --- /dev/null +++ b/librpc/gen_ndr/cli_samr.c @@ -0,0 +1,2962 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_samr.h" + +NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *connect_handle /* [out] [ref] */) +{ + struct samr_Connect r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CONNECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */) +{ + struct samr_Close r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Close, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CLOSE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Close, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct sec_desc_buf *sdbuf /* [in] [ref] */) +{ + struct samr_SetSecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sec_info = sec_info; + r.in.sdbuf = sdbuf; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetSecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SETSECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetSecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct sec_desc_buf **sdbuf /* [out] [ref] */) +{ + struct samr_QuerySecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sec_info = sec_info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QuerySecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYSECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sdbuf = *r.out.sdbuf; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */) +{ + struct samr_Shutdown r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Shutdown, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SHUTDOWN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Shutdown, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */, + struct lsa_String *domain_name /* [in] [ref] */, + struct dom_sid2 **sid /* [out] [ref] */) +{ + struct samr_LookupDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + r.in.domain_name = domain_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_LOOKUPDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sid = *r.out.sid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct samr_SamArray **sam /* [out] [ref] */, + uint32_t buf_size /* [in] */, + uint32_t *num_entries /* [out] [ref] */) +{ + struct samr_EnumDomains r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + r.in.resume_handle = resume_handle; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomains, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_ENUMDOMAINS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomains, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *sam = *r.out.sam; + *num_entries = *r.out.num_entries; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct dom_sid2 *sid /* [in] [ref] */, + struct policy_handle *domain_handle /* [out] [ref] */) +{ + struct samr_OpenDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + r.in.access_mask = access_mask; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_OPENDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *domain_handle = *r.out.domain_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */) +{ + struct samr_QueryDomainInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYDOMAININFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */) +{ + struct samr_SetDomainInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SETDOMAININFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_String *name /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *group_handle /* [out] [ref] */, + uint32_t *rid /* [out] [ref] */) +{ + struct samr_CreateDomainGroup r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.name = name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CREATEDOMAINGROUP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *group_handle = *r.out.group_handle; + *rid = *r.out.rid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct samr_SamArray **sam /* [out] [ref] */, + uint32_t max_size /* [in] */, + uint32_t *num_entries /* [out] [ref] */) +{ + struct samr_EnumDomainGroups r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.resume_handle = resume_handle; + r.in.max_size = max_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_ENUMDOMAINGROUPS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *sam = *r.out.sam; + *num_entries = *r.out.num_entries; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_String *account_name /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *user_handle /* [out] [ref] */, + uint32_t *rid /* [out] [ref] */) +{ + struct samr_CreateUser r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.account_name = account_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CREATEUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *user_handle = *r.out.user_handle; + *rid = *r.out.rid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + uint32_t acct_flags /* [in] */, + struct samr_SamArray **sam /* [out] [ref] */, + uint32_t max_size /* [in] */, + uint32_t *num_entries /* [out] [ref] */) +{ + struct samr_EnumDomainUsers r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.resume_handle = resume_handle; + r.in.acct_flags = acct_flags; + r.in.max_size = max_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_ENUMDOMAINUSERS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *sam = *r.out.sam; + *num_entries = *r.out.num_entries; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_String *alias_name /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *alias_handle /* [out] [ref] */, + uint32_t *rid /* [out] [ref] */) +{ + struct samr_CreateDomAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.alias_name = alias_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CREATEDOMALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *alias_handle = *r.out.alias_handle; + *rid = *r.out.rid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct samr_SamArray **sam /* [out] [ref] */, + uint32_t max_size /* [in] */, + uint32_t *num_entries /* [out] [ref] */) +{ + struct samr_EnumDomainAliases r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.resume_handle = resume_handle; + r.in.max_size = max_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_ENUMDOMAINALIASES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *sam = *r.out.sam; + *num_entries = *r.out.num_entries; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */, + struct samr_Ids *rids /* [out] [ref] */) +{ + struct samr_GetAliasMembership r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.sids = sids; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_GETALIASMEMBERSHIP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rids = *r.out.rids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */, + struct samr_Ids *rids /* [out] [ref] */, + struct samr_Ids *types /* [out] [ref] */) +{ + struct samr_LookupNames r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.num_names = num_names; + r.in.names = names; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupNames, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_LOOKUPNAMES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupNames, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rids = *r.out.rids; + *types = *r.out.types; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t num_rids /* [in] [range(0,1000)] */, + uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */, + struct lsa_Strings *names /* [out] [ref] */, + struct samr_Ids *types /* [out] [ref] */) +{ + struct samr_LookupRids r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.num_rids = num_rids; + r.in.rids = rids; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupRids, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_LOOKUPRIDS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupRids, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *names = *r.out.names; + *types = *r.out.types; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t access_mask /* [in] */, + uint32_t rid /* [in] */, + struct policy_handle *group_handle /* [out] [ref] */) +{ + struct samr_OpenGroup r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.access_mask = access_mask; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenGroup, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_OPENGROUP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenGroup, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *group_handle = *r.out.group_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + enum samr_GroupInfoEnum level /* [in] */, + union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */) +{ + struct samr_QueryGroupInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYGROUPINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + enum samr_GroupInfoEnum level /* [in] */, + union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */) +{ + struct samr_SetGroupInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SETGROUPINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + uint32_t rid /* [in] */, + uint32_t flags /* [in] */) +{ + struct samr_AddGroupMember r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.rid = rid; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddGroupMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_ADDGROUPMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in,out] [ref] */) +{ + struct samr_DeleteDomainGroup r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_DELETEDOMAINGROUP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *group_handle = *r.out.group_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + uint32_t rid /* [in] */) +{ + struct samr_DeleteGroupMember r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_DELETEGROUPMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + struct samr_RidTypeArray **rids /* [out] [ref] */) +{ + struct samr_QueryGroupMember r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYGROUPMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rids = *r.out.rids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + uint32_t unknown1 /* [in] */, + uint32_t unknown2 /* [in] */) +{ + struct samr_SetMemberAttributesOfGroup r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.unknown1 = unknown1; + r.in.unknown2 = unknown2; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t access_mask /* [in] */, + uint32_t rid /* [in] */, + struct policy_handle *alias_handle /* [out] [ref] */) +{ + struct samr_OpenAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.access_mask = access_mask; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_OPENALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *alias_handle = *r.out.alias_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + enum samr_AliasInfoEnum level /* [in] */, + union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */) +{ + struct samr_QueryAliasInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYALIASINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + enum samr_AliasInfoEnum level /* [in] */, + union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */) +{ + struct samr_SetAliasInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SETALIASINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in,out] [ref] */) +{ + struct samr_DeleteDomAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_DELETEDOMALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *alias_handle = *r.out.alias_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */) +{ + struct samr_AddAliasMember r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddAliasMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_ADDALIASMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */) +{ + struct samr_DeleteAliasMember r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_DELETEALIASMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [out] [ref] */) +{ + struct samr_GetMembersInAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_GETMEMBERSINALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sids = *r.out.sids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t access_mask /* [in] */, + uint32_t rid /* [in] */, + struct policy_handle *user_handle /* [out] [ref] */) +{ + struct samr_OpenUser r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.access_mask = access_mask; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_OPENUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *user_handle = *r.out.user_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in,out] [ref] */) +{ + struct samr_DeleteUser r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_DELETEUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *user_handle = *r.out.user_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_UserInfo **info /* [out] [ref,switch_is(level)] */) +{ + struct samr_QueryUserInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYUSERINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_UserInfo *info /* [in] [ref,switch_is(level)] */) +{ + struct samr_SetUserInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetUserInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SETUSERINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint8_t lm_present /* [in] */, + struct samr_Password *old_lm_crypted /* [in] [unique] */, + struct samr_Password *new_lm_crypted /* [in] [unique] */, + uint8_t nt_present /* [in] */, + struct samr_Password *old_nt_crypted /* [in] [unique] */, + struct samr_Password *new_nt_crypted /* [in] [unique] */, + uint8_t cross1_present /* [in] */, + struct samr_Password *nt_cross /* [in] [unique] */, + uint8_t cross2_present /* [in] */, + struct samr_Password *lm_cross /* [in] [unique] */) +{ + struct samr_ChangePasswordUser r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.lm_present = lm_present; + r.in.old_lm_crypted = old_lm_crypted; + r.in.new_lm_crypted = new_lm_crypted; + r.in.nt_present = nt_present; + r.in.old_nt_crypted = old_nt_crypted; + r.in.new_nt_crypted = new_nt_crypted; + r.in.cross1_present = cross1_present; + r.in.nt_cross = nt_cross; + r.in.cross2_present = cross2_present; + r.in.lm_cross = lm_cross; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CHANGEPASSWORDUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + struct samr_RidWithAttributeArray **rids /* [out] [ref] */) +{ + struct samr_GetGroupsForUser r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_GETGROUPSFORUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rids = *r.out.rids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + uint32_t start_idx /* [in] */, + uint32_t max_entries /* [in] */, + uint32_t buf_size /* [in] */, + uint32_t *total_size /* [out] [ref] */, + uint32_t *returned_size /* [out] [ref] */, + union samr_DispInfo *info /* [out] [ref,switch_is(level)] */) +{ + struct samr_QueryDisplayInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.start_idx = start_idx; + r.in.max_entries = max_entries; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYDISPLAYINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *total_size = *r.out.total_size; + *returned_size = *r.out.returned_size; + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + struct lsa_String *name /* [in] [ref] */, + uint32_t *idx /* [out] [ref] */) +{ + struct samr_GetDisplayEnumerationIndex r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.name = name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_GETDISPLAYENUMERATIONINDEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *idx = *r.out.idx; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */) +{ + struct samr_TestPrivateFunctionsDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */) +{ + struct samr_TestPrivateFunctionsUser r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + struct samr_PwInfo *info /* [out] [ref] */) +{ + struct samr_GetUserPwInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_GETUSERPWINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */) +{ + struct samr_RemoveMemberFromForeignDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */) +{ + struct samr_QueryDomainInfo2 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYDOMAININFO2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_UserInfo **info /* [out] [ref,switch_is(level)] */) +{ + struct samr_QueryUserInfo2 r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYUSERINFO2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + uint32_t start_idx /* [in] */, + uint32_t max_entries /* [in] */, + uint32_t buf_size /* [in] */, + uint32_t *total_size /* [out] [ref] */, + uint32_t *returned_size /* [out] [ref] */, + union samr_DispInfo *info /* [out] [ref,switch_is(level)] */) +{ + struct samr_QueryDisplayInfo2 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.start_idx = start_idx; + r.in.max_entries = max_entries; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYDISPLAYINFO2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *total_size = *r.out.total_size; + *returned_size = *r.out.returned_size; + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + struct lsa_String *name /* [in] [ref] */, + uint32_t *idx /* [out] [ref] */) +{ + struct samr_GetDisplayEnumerationIndex2 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.name = name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_GETDISPLAYENUMERATIONINDEX2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *idx = *r.out.idx; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_String *account_name /* [in] [ref] */, + uint32_t acct_flags /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *user_handle /* [out] [ref] */, + uint32_t *access_granted /* [out] [ref] */, + uint32_t *rid /* [out] [ref] */) +{ + struct samr_CreateUser2 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.account_name = account_name; + r.in.acct_flags = acct_flags; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateUser2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CREATEUSER2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateUser2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *user_handle = *r.out.user_handle; + *access_granted = *r.out.access_granted; + *rid = *r.out.rid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + uint32_t start_idx /* [in] */, + uint32_t max_entries /* [in] */, + uint32_t buf_size /* [in] */, + uint32_t *total_size /* [out] [ref] */, + uint32_t *returned_size /* [out] [ref] */, + union samr_DispInfo *info /* [out] [ref,switch_is(level)] */) +{ + struct samr_QueryDisplayInfo3 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.start_idx = start_idx; + r.in.max_entries = max_entries; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_QUERYDISPLAYINFO3, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *total_size = *r.out.total_size; + *returned_size = *r.out.returned_size; + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */) +{ + struct samr_AddMultipleMembersToAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.sids = sids; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */) +{ + struct samr_RemoveMultipleMembersFromAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.sids = sids; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_AsciiString *server /* [in] [unique] */, + struct lsa_AsciiString *account /* [in] [ref] */, + struct samr_CryptPassword *password /* [in] [unique] */, + struct samr_Password *hash /* [in] [unique] */) +{ + struct samr_OemChangePasswordUser2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server = server; + r.in.account = account; + r.in.password = password; + r.in.hash = hash; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_OEMCHANGEPASSWORDUSER2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *server /* [in] [unique] */, + struct lsa_String *account /* [in] [ref] */, + struct samr_CryptPassword *nt_password /* [in] [unique] */, + struct samr_Password *nt_verifier /* [in] [unique] */, + uint8_t lm_change /* [in] */, + struct samr_CryptPassword *lm_password /* [in] [unique] */, + struct samr_Password *lm_verifier /* [in] [unique] */) +{ + struct samr_ChangePasswordUser2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server = server; + r.in.account = account; + r.in.nt_password = nt_password; + r.in.nt_verifier = nt_verifier; + r.in.lm_change = lm_change; + r.in.lm_password = lm_password; + r.in.lm_verifier = lm_verifier; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CHANGEPASSWORDUSER2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *domain_name /* [in] [unique] */, + struct samr_PwInfo *info /* [out] [ref] */) +{ + struct samr_GetDomPwInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_name = domain_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_GETDOMPWINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + struct policy_handle *connect_handle /* [out] [ref] */) +{ + struct samr_Connect2 r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CONNECT2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_UserInfo *info /* [in] [ref,switch_is(level)] */) +{ + struct samr_SetUserInfo2 r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SETUSERINFO2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */, + uint32_t unknown1 /* [in] */, + uint32_t unknown2 /* [in] */, + uint32_t unknown3 /* [in] */) +{ + struct samr_SetBootKeyInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + r.in.unknown1 = unknown1; + r.in.unknown2 = unknown2; + r.in.unknown3 = unknown3; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SETBOOTKEYINFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t *unknown /* [out] [ref] */) +{ + struct samr_GetBootKeyInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_GETBOOTKEYINFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *unknown = *r.out.unknown; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + uint32_t unknown /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *connect_handle /* [out] [ref] */) +{ + struct samr_Connect3 r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.unknown = unknown; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect3, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CONNECT3, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect3, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + enum samr_ConnectVersion client_version /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *connect_handle /* [out] [ref] */) +{ + struct samr_Connect4 r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.client_version = client_version; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect4, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CONNECT4, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect4, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *server /* [in] [unique] */, + struct lsa_String *account /* [in] [ref] */, + struct samr_CryptPassword *nt_password /* [in] [unique] */, + struct samr_Password *nt_verifier /* [in] [unique] */, + uint8_t lm_change /* [in] */, + struct samr_CryptPassword *lm_password /* [in] [unique] */, + struct samr_Password *lm_verifier /* [in] [unique] */, + struct samr_CryptPassword *password3 /* [in] [unique] */, + struct samr_DomInfo1 **dominfo /* [out] [ref] */, + struct samr_ChangeReject **reject /* [out] [ref] */) +{ + struct samr_ChangePasswordUser3 r; + NTSTATUS status; + + /* In parameters */ + r.in.server = server; + r.in.account = account; + r.in.nt_password = nt_password; + r.in.nt_verifier = nt_verifier; + r.in.lm_change = lm_change; + r.in.lm_password = lm_password; + r.in.lm_verifier = lm_verifier; + r.in.password3 = password3; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CHANGEPASSWORDUSER3, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *dominfo = *r.out.dominfo; + *reject = *r.out.reject; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + uint32_t level_in /* [in] */, + union samr_ConnectInfo *info_in /* [in] [ref,switch_is(level_in)] */, + uint32_t *level_out /* [out] [ref] */, + union samr_ConnectInfo *info_out /* [out] [ref,switch_is(*level_out)] */, + struct policy_handle *connect_handle /* [out] [ref] */) +{ + struct samr_Connect5 r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + r.in.level_in = level_in; + r.in.info_in = info_in; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect5, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_CONNECT5, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect5, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *info_out = *r.out.info_out; + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t rid /* [in] */, + struct dom_sid2 **sid /* [out] [ref] */) +{ + struct samr_RidToSid r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RidToSid, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_RIDTOSID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RidToSid, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sid = *r.out.sid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *name /* [in] [unique] */, + uint32_t unknown /* [in] */, + struct samr_Password *hash /* [in] [unique] */) +{ + struct samr_SetDsrmPassword r; + NTSTATUS status; + + /* In parameters */ + r.in.name = name; + r.in.unknown = unknown; + r.in.hash = hash; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_SETDSRMPASSWORD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum samr_ValidatePasswordLevel level /* [in] */, + union samr_ValidatePasswordReq *req /* [in] [ref,switch_is(level)] */, + union samr_ValidatePasswordRep **rep /* [out] [ref,switch_is(level)] */) +{ + struct samr_ValidatePassword r; + NTSTATUS status; + + /* In parameters */ + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ValidatePassword, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_samr, + NDR_SAMR_VALIDATEPASSWORD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rep = *r.out.rep; + + /* Return result */ + return r.out.result; +} + diff --git a/librpc/gen_ndr/cli_samr.h b/librpc/gen_ndr/cli_samr.h new file mode 100644 index 0000000000..b57d63334e --- /dev/null +++ b/librpc/gen_ndr/cli_samr.h @@ -0,0 +1,389 @@ +#include "librpc/gen_ndr/ndr_samr.h" +#ifndef __CLI_SAMR__ +#define __CLI_SAMR__ +NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *connect_handle /* [out] [ref] */); +NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */); +NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct sec_desc_buf *sdbuf /* [in] [ref] */); +NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct sec_desc_buf **sdbuf /* [out] [ref] */); +NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */); +NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */, + struct lsa_String *domain_name /* [in] [ref] */, + struct dom_sid2 **sid /* [out] [ref] */); +NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct samr_SamArray **sam /* [out] [ref] */, + uint32_t buf_size /* [in] */, + uint32_t *num_entries /* [out] [ref] */); +NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct dom_sid2 *sid /* [in] [ref] */, + struct policy_handle *domain_handle /* [out] [ref] */); +NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_String *name /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *group_handle /* [out] [ref] */, + uint32_t *rid /* [out] [ref] */); +NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct samr_SamArray **sam /* [out] [ref] */, + uint32_t max_size /* [in] */, + uint32_t *num_entries /* [out] [ref] */); +NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_String *account_name /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *user_handle /* [out] [ref] */, + uint32_t *rid /* [out] [ref] */); +NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + uint32_t acct_flags /* [in] */, + struct samr_SamArray **sam /* [out] [ref] */, + uint32_t max_size /* [in] */, + uint32_t *num_entries /* [out] [ref] */); +NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_String *alias_name /* [in] [ref] */, + uint32_t access_mask /* [in] */, + struct policy_handle *alias_handle /* [out] [ref] */, + uint32_t *rid /* [out] [ref] */); +NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t *resume_handle /* [in,out] [ref] */, + struct samr_SamArray **sam /* [out] [ref] */, + uint32_t max_size /* [in] */, + uint32_t *num_entries /* [out] [ref] */); +NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */, + struct samr_Ids *rids /* [out] [ref] */); +NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t num_names /* [in] [range(0,1000)] */, + struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */, + struct samr_Ids *rids /* [out] [ref] */, + struct samr_Ids *types /* [out] [ref] */); +NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t num_rids /* [in] [range(0,1000)] */, + uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */, + struct lsa_Strings *names /* [out] [ref] */, + struct samr_Ids *types /* [out] [ref] */); +NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t access_mask /* [in] */, + uint32_t rid /* [in] */, + struct policy_handle *group_handle /* [out] [ref] */); +NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + enum samr_GroupInfoEnum level /* [in] */, + union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + enum samr_GroupInfoEnum level /* [in] */, + union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + uint32_t rid /* [in] */, + uint32_t flags /* [in] */); +NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in,out] [ref] */); +NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + uint32_t rid /* [in] */); +NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + struct samr_RidTypeArray **rids /* [out] [ref] */); +NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle /* [in] [ref] */, + uint32_t unknown1 /* [in] */, + uint32_t unknown2 /* [in] */); +NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t access_mask /* [in] */, + uint32_t rid /* [in] */, + struct policy_handle *alias_handle /* [out] [ref] */); +NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + enum samr_AliasInfoEnum level /* [in] */, + union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + enum samr_AliasInfoEnum level /* [in] */, + union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in,out] [ref] */); +NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */); +NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */); +NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [out] [ref] */); +NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t access_mask /* [in] */, + uint32_t rid /* [in] */, + struct policy_handle *user_handle /* [out] [ref] */); +NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in,out] [ref] */); +NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_UserInfo **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_UserInfo *info /* [in] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint8_t lm_present /* [in] */, + struct samr_Password *old_lm_crypted /* [in] [unique] */, + struct samr_Password *new_lm_crypted /* [in] [unique] */, + uint8_t nt_present /* [in] */, + struct samr_Password *old_nt_crypted /* [in] [unique] */, + struct samr_Password *new_nt_crypted /* [in] [unique] */, + uint8_t cross1_present /* [in] */, + struct samr_Password *nt_cross /* [in] [unique] */, + uint8_t cross2_present /* [in] */, + struct samr_Password *lm_cross /* [in] [unique] */); +NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + struct samr_RidWithAttributeArray **rids /* [out] [ref] */); +NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + uint32_t start_idx /* [in] */, + uint32_t max_entries /* [in] */, + uint32_t buf_size /* [in] */, + uint32_t *total_size /* [out] [ref] */, + uint32_t *returned_size /* [out] [ref] */, + union samr_DispInfo *info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + struct lsa_String *name /* [in] [ref] */, + uint32_t *idx /* [out] [ref] */); +NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */); +NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */); +NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + struct samr_PwInfo *info /* [out] [ref] */); +NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct dom_sid2 *sid /* [in] [ref] */); +NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_UserInfo **info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + uint32_t start_idx /* [in] */, + uint32_t max_entries /* [in] */, + uint32_t buf_size /* [in] */, + uint32_t *total_size /* [out] [ref] */, + uint32_t *returned_size /* [out] [ref] */, + union samr_DispInfo *info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + struct lsa_String *name /* [in] [ref] */, + uint32_t *idx /* [out] [ref] */); +NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + struct lsa_String *account_name /* [in] [ref] */, + uint32_t acct_flags /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *user_handle /* [out] [ref] */, + uint32_t *access_granted /* [out] [ref] */, + uint32_t *rid /* [out] [ref] */); +NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint16_t level /* [in] */, + uint32_t start_idx /* [in] */, + uint32_t max_entries /* [in] */, + uint32_t buf_size /* [in] */, + uint32_t *total_size /* [out] [ref] */, + uint32_t *returned_size /* [out] [ref] */, + union samr_DispInfo *info /* [out] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */); +NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle /* [in] [ref] */, + struct lsa_SidArray *sids /* [in] [ref] */); +NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_AsciiString *server /* [in] [unique] */, + struct lsa_AsciiString *account /* [in] [ref] */, + struct samr_CryptPassword *password /* [in] [unique] */, + struct samr_Password *hash /* [in] [unique] */); +NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *server /* [in] [unique] */, + struct lsa_String *account /* [in] [ref] */, + struct samr_CryptPassword *nt_password /* [in] [unique] */, + struct samr_Password *nt_verifier /* [in] [unique] */, + uint8_t lm_change /* [in] */, + struct samr_CryptPassword *lm_password /* [in] [unique] */, + struct samr_Password *lm_verifier /* [in] [unique] */); +NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *domain_name /* [in] [unique] */, + struct samr_PwInfo *info /* [out] [ref] */); +NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + struct policy_handle *connect_handle /* [out] [ref] */); +NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle /* [in] [ref] */, + uint16_t level /* [in] */, + union samr_UserInfo *info /* [in] [ref,switch_is(level)] */); +NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle /* [in] [ref] */, + uint32_t unknown1 /* [in] */, + uint32_t unknown2 /* [in] */, + uint32_t unknown3 /* [in] */); +NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t *unknown /* [out] [ref] */); +NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + uint32_t unknown /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *connect_handle /* [out] [ref] */); +NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + enum samr_ConnectVersion client_version /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *connect_handle /* [out] [ref] */); +NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *server /* [in] [unique] */, + struct lsa_String *account /* [in] [ref] */, + struct samr_CryptPassword *nt_password /* [in] [unique] */, + struct samr_Password *nt_verifier /* [in] [unique] */, + uint8_t lm_change /* [in] */, + struct samr_CryptPassword *lm_password /* [in] [unique] */, + struct samr_Password *lm_verifier /* [in] [unique] */, + struct samr_CryptPassword *password3 /* [in] [unique] */, + struct samr_DomInfo1 **dominfo /* [out] [ref] */, + struct samr_ChangeReject **reject /* [out] [ref] */); +NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + uint32_t level_in /* [in] */, + union samr_ConnectInfo *info_in /* [in] [ref,switch_is(level_in)] */, + uint32_t *level_out /* [out] [ref] */, + union samr_ConnectInfo *info_out /* [out] [ref,switch_is(*level_out)] */, + struct policy_handle *connect_handle /* [out] [ref] */); +NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle /* [in] [ref] */, + uint32_t rid /* [in] */, + struct dom_sid2 **sid /* [out] [ref] */); +NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *name /* [in] [unique] */, + uint32_t unknown /* [in] */, + struct samr_Password *hash /* [in] [unique] */); +NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum samr_ValidatePasswordLevel level /* [in] */, + union samr_ValidatePasswordReq *req /* [in] [ref,switch_is(level)] */, + union samr_ValidatePasswordRep **rep /* [out] [ref,switch_is(level)] */); +#endif /* __CLI_SAMR__ */ diff --git a/librpc/gen_ndr/cli_srvsvc.c b/librpc/gen_ndr/cli_srvsvc.c new file mode 100644 index 0000000000..eb81652a1d --- /dev/null +++ b/librpc/gen_ndr/cli_srvsvc.c @@ -0,0 +1,2632 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_srvsvc.h" + +NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetCharDevInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetCharDevEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.info_ctr = info_ctr; + r.in.max_buffer = max_buffer; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETCHARDEVENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info_ctr = *r.out.info_ctr; + *totalentries = *r.out.totalentries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetCharDevGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *device_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetCharDevInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct srvsvc_NetCharDevGetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.device_name = device_name; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevGetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETCHARDEVGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevGetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetCharDevControl(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *device_name /* [in] [charset(UTF16)] */, + uint32_t opcode /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetCharDevControl r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.device_name = device_name; + r.in.opcode = opcode; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevControl, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETCHARDEVCONTROL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevControl, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *user /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetCharDevQInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetCharDevQEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.user = user; + r.in.info_ctr = info_ctr; + r.in.max_buffer = max_buffer; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETCHARDEVQENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info_ctr = *r.out.info_ctr; + *totalentries = *r.out.totalentries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *queue_name /* [in] [charset(UTF16)] */, + const char *user /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetCharDevQInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct srvsvc_NetCharDevQGetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.queue_name = queue_name; + r.in.user = user; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQGetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETCHARDEVQGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQGetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *queue_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetCharDevQInfo info /* [in] [switch_is(level)] */, + uint32_t *parm_error /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetCharDevQSetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.queue_name = queue_name; + r.in.level = level; + r.in.info = info; + r.in.parm_error = parm_error; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQSetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETCHARDEVQSETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQSetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (parm_error && r.out.parm_error) { + *parm_error = *r.out.parm_error; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetCharDevQPurge(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *queue_name /* [in] [charset(UTF16)] */, + WERROR *werror) +{ + struct srvsvc_NetCharDevQPurge r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.queue_name = queue_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurge, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETCHARDEVQPURGE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurge, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *queue_name /* [in] [charset(UTF16)] */, + const char *computer_name /* [in] [charset(UTF16)] */, + WERROR *werror) +{ + struct srvsvc_NetCharDevQPurgeSelf r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.queue_name = queue_name; + r.in.computer_name = computer_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurgeSelf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETCHARDEVQPURGESELF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurgeSelf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetConnInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetConnEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.path = path; + r.in.info_ctr = info_ctr; + r.in.max_buffer = max_buffer; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetConnEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETCONNENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetConnEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info_ctr = *r.out.info_ctr; + *totalentries = *r.out.totalentries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path /* [in] [unique,charset(UTF16)] */, + const char *user /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetFileInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetFileEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.path = path; + r.in.user = user; + r.in.info_ctr = info_ctr; + r.in.max_buffer = max_buffer; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetFileEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETFILEENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetFileEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info_ctr = *r.out.info_ctr; + *totalentries = *r.out.totalentries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetFileGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t fid /* [in] */, + uint32_t level /* [in] */, + union srvsvc_NetFileInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct srvsvc_NetFileGetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.fid = fid; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetFileGetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETFILEGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetFileGetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t fid /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetFileClose r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.fid = fid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetFileClose, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETFILECLOSE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetFileClose, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *client /* [in] [unique,charset(UTF16)] */, + const char *user /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetSessInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetSessEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.client = client; + r.in.user = user; + r.in.info_ctr = info_ctr; + r.in.max_buffer = max_buffer; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSessEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSESSENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSessEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info_ctr = *r.out.info_ctr; + *totalentries = *r.out.totalentries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *client /* [in] [unique,charset(UTF16)] */, + const char *user /* [in] [unique,charset(UTF16)] */, + WERROR *werror) +{ + struct srvsvc_NetSessDel r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.client = client; + r.in.user = user; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSessDel, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSESSDEL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSessDel, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_error /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetShareAdd r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.level = level; + r.in.info = info; + r.in.parm_error = parm_error; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareAdd, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHAREADD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareAdd, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (parm_error && r.out.parm_error) { + *parm_error = *r.out.parm_error; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetShareEnumAll r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.info_ctr = info_ctr; + r.in.max_buffer = max_buffer; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnumAll, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHAREENUMALL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnumAll, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info_ctr = *r.out.info_ctr; + *totalentries = *r.out.totalentries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetShareInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct srvsvc_NetShareGetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.share_name = share_name; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareGetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHAREGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareGetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_error /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetShareSetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.share_name = share_name; + r.in.level = level; + r.in.info = info; + r.in.parm_error = parm_error; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareSetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHARESETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareSetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (parm_error && r.out.parm_error) { + *parm_error = *r.out.parm_error; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share_name /* [in] [charset(UTF16)] */, + uint32_t reserved /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetShareDel r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.share_name = share_name; + r.in.reserved = reserved; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareDel, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHAREDEL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDel, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share_name /* [in] [charset(UTF16)] */, + uint32_t reserved /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetShareDelSticky r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.share_name = share_name; + r.in.reserved = reserved; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelSticky, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHAREDELSTICKY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelSticky, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareCheck(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *device_name /* [in] [charset(UTF16)] */, + enum srvsvc_ShareType *type /* [out] [ref] */, + WERROR *werror) +{ + struct srvsvc_NetShareCheck r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.device_name = device_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareCheck, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHARECHECK, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareCheck, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *type = *r.out.type; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetSrvInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct srvsvc_NetSrvGetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSrvGetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSRVGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvGetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetSrvInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_error /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetSrvSetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.level = level; + r.in.info = info; + r.in.parm_error = parm_error; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSrvSetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSRVSETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvSetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (parm_error && r.out.parm_error) { + *parm_error = *r.out.parm_error; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + struct srvsvc_NetDiskInfo *info /* [in,out] [ref] */, + uint32_t maxlen /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetDiskEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.level = level; + r.in.info = info; + r.in.maxlen = maxlen; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetDiskEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETDISKENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetDiskEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + *totalentries = *r.out.totalentries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *service /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + uint32_t options /* [in] */, + struct srvsvc_Statistics **stats /* [out] [ref] */, + WERROR *werror) +{ + struct srvsvc_NetServerStatisticsGet r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.service = service; + r.in.level = level; + r.in.options = options; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetServerStatisticsGet, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSERVERSTATISTICSGET, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetServerStatisticsGet, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *stats = *r.out.stats; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetTransportAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, + WERROR *werror) +{ + struct srvsvc_NetTransportAdd r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetTransportAdd, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETTRANSPORTADD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportAdd, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetTransportInfoCtr *transports /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetTransportEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.transports = transports; + r.in.max_buffer = max_buffer; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetTransportEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETTRANSPORTENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *transports = *r.out.transports; + *totalentries = *r.out.totalentries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetTransportDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + struct srvsvc_NetTransportInfo0 *info0 /* [in] [ref] */, + WERROR *werror) +{ + struct srvsvc_NetTransportDel r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.level = level; + r.in.info0 = info0; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetTransportDel, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETTRANSPORTDEL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportDel, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetRemoteTODInfo **info /* [out] [ref] */, + WERROR *werror) +{ + struct srvsvc_NetRemoteTOD r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetRemoteTOD, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETREMOTETOD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetRemoteTOD, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetSetServiceBits(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *transport /* [in] [unique,charset(UTF16)] */, + uint32_t servicebits /* [in] */, + uint32_t updateimmediately /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetSetServiceBits r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.transport = transport; + r.in.servicebits = servicebits; + r.in.updateimmediately = updateimmediately; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSetServiceBits, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSETSERVICEBITS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSetServiceBits, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path /* [in] [charset(UTF16)] */, + uint32_t pathflags /* [in] */, + uint32_t *pathtype /* [out] [ref] */, + WERROR *werror) +{ + struct srvsvc_NetPathType r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.path = path; + r.in.pathflags = pathflags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetPathType, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETPATHTYPE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetPathType, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *pathtype = *r.out.pathtype; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path /* [in] [charset(UTF16)] */, + uint8_t *can_path /* [out] [size_is(maxbuf)] */, + uint32_t maxbuf /* [in] */, + const char *prefix /* [in] [charset(UTF16)] */, + uint32_t *pathtype /* [in,out] [ref] */, + uint32_t pathflags /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetPathCanonicalize r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.path = path; + r.in.maxbuf = maxbuf; + r.in.prefix = prefix; + r.in.pathtype = pathtype; + r.in.pathflags = pathflags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetPathCanonicalize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETPATHCANONICALIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCanonicalize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(can_path, r.out.can_path, r.in.maxbuf * sizeof(*can_path)); + *pathtype = *r.out.pathtype; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path1 /* [in] [charset(UTF16)] */, + const char *path2 /* [in] [charset(UTF16)] */, + uint32_t pathtype /* [in] */, + uint32_t pathflags /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetPathCompare r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.path1 = path1; + r.in.path2 = path2; + r.in.pathtype = pathtype; + r.in.pathflags = pathflags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetPathCompare, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETPATHCOMPARE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCompare, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetNameValidate(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *name /* [in] [charset(UTF16)] */, + uint32_t name_type /* [in] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetNameValidate r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.name = name; + r.in.name_type = name_type; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetNameValidate, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETNAMEVALIDATE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetNameValidate, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRPRNAMECANONICALIZE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRPRNAMECANONICALIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetPRNameCompare(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *name1 /* [in] [charset(UTF16)] */, + const char *name2 /* [in] [charset(UTF16)] */, + uint32_t name_type /* [in] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetPRNameCompare r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.name1 = name1; + r.in.name2 = name2; + r.in.name_type = name_type; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetPRNameCompare, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETPRNAMECOMPARE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetPRNameCompare, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetShareEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.info_ctr = info_ctr; + r.in.max_buffer = max_buffer; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHAREENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info_ctr = *r.out.info_ctr; + *totalentries = *r.out.totalentries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share /* [in] [charset(UTF16)] */, + uint32_t reserved /* [in] */, + struct policy_handle *hnd /* [out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetShareDelStart r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.share = share; + r.in.reserved = reserved; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelStart, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHAREDELSTART, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelStart, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (hnd && r.out.hnd) { + *hnd = *r.out.hnd; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *hnd /* [in,out] [unique] */, + WERROR *werror) +{ + struct srvsvc_NetShareDelCommit r; + NTSTATUS status; + + /* In parameters */ + r.in.hnd = hnd; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelCommit, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSHAREDELCOMMIT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelCommit, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (hnd && r.out.hnd) { + *hnd = *r.out.hnd; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share /* [in] [unique,charset(UTF16)] */, + const char *file /* [in] [charset(UTF16)] */, + uint32_t securityinformation /* [in] */, + struct sec_desc_buf **sd_buf /* [out] [ref] */, + WERROR *werror) +{ + struct srvsvc_NetGetFileSecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.share = share; + r.in.file = file; + r.in.securityinformation = securityinformation; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetGetFileSecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETGETFILESECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetGetFileSecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sd_buf = *r.out.sd_buf; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share /* [in] [unique,charset(UTF16)] */, + const char *file /* [in] [charset(UTF16)] */, + uint32_t securityinformation /* [in] */, + struct sec_desc_buf *sd_buf /* [in] [ref] */, + WERROR *werror) +{ + struct srvsvc_NetSetFileSecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.share = share; + r.in.file = file; + r.in.securityinformation = securityinformation; + r.in.sd_buf = sd_buf; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSetFileSecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSETFILESECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSetFileSecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetServerTransportAddEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, + WERROR *werror) +{ + struct srvsvc_NetServerTransportAddEx r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetServerTransportAddEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSERVERTRANSPORTADDEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetServerTransportAddEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *emulated_server_unc /* [in] [unique,charset(UTF16)] */, + const char *transport /* [in] [unique,charset(UTF16)] */, + uint32_t servicebitsofinterest /* [in] */, + uint32_t servicebits /* [in] */, + uint32_t updateimmediately /* [in] */, + WERROR *werror) +{ + struct srvsvc_NetServerSetServiceBitsEx r; + NTSTATUS status; + + /* In parameters */ + r.in.server_unc = server_unc; + r.in.emulated_server_unc = emulated_server_unc; + r.in.transport = transport; + r.in.servicebitsofinterest = servicebitsofinterest; + r.in.servicebits = servicebits; + r.in.updateimmediately = updateimmediately; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetServerSetServiceBitsEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETSERVERSETSERVICEBITSEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetServerSetServiceBitsEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSGETVERSION r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSGETVERSION, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSGETVERSION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSGETVERSION, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSCREATELOCALPARTITION r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSCREATELOCALPARTITION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSDELETELOCALPARTITION r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSDELETELOCALPARTITION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSSETLOCALVOLUMESTATE r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSSETSERVERINFO r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSSETSERVERINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSCREATEEXITPOINT r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSCREATEEXITPOINT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSDELETEEXITPOINT r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSDELETEEXITPOINT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSMODIFYPREFIX r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSMODIFYPREFIX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSFIXLOCALVOLUME r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSFIXLOCALVOLUME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRDFSMANAGERREPORTSITEINFO r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_srvsvc_NETRSERVERTRANSPORTDELEX(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct srvsvc_NETRSERVERTRANSPORTDELEX r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_srvsvc, + NDR_SRVSVC_NETRSERVERTRANSPORTDELEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/librpc/gen_ndr/cli_srvsvc.h b/librpc/gen_ndr/cli_srvsvc.h new file mode 100644 index 0000000000..44b50e7d19 --- /dev/null +++ b/librpc/gen_ndr/cli_srvsvc.h @@ -0,0 +1,344 @@ +#include "librpc/gen_ndr/ndr_srvsvc.h" +#ifndef __CLI_SRVSVC__ +#define __CLI_SRVSVC__ +NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetCharDevInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetCharDevGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *device_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetCharDevInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetCharDevControl(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *device_name /* [in] [charset(UTF16)] */, + uint32_t opcode /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *user /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetCharDevQInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *queue_name /* [in] [charset(UTF16)] */, + const char *user /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetCharDevQInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *queue_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetCharDevQInfo info /* [in] [switch_is(level)] */, + uint32_t *parm_error /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetCharDevQPurge(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *queue_name /* [in] [charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *queue_name /* [in] [charset(UTF16)] */, + const char *computer_name /* [in] [charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetConnInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path /* [in] [unique,charset(UTF16)] */, + const char *user /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetFileInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetFileGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t fid /* [in] */, + uint32_t level /* [in] */, + union srvsvc_NetFileInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t fid /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *client /* [in] [unique,charset(UTF16)] */, + const char *user /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetSessInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *client /* [in] [unique,charset(UTF16)] */, + const char *user /* [in] [unique,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_error /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetShareInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share_name /* [in] [charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_error /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share_name /* [in] [charset(UTF16)] */, + uint32_t reserved /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share_name /* [in] [charset(UTF16)] */, + uint32_t reserved /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareCheck(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *device_name /* [in] [charset(UTF16)] */, + enum srvsvc_ShareType *type /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetSrvInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetSrvInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_error /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + struct srvsvc_NetDiskInfo *info /* [in,out] [ref] */, + uint32_t maxlen /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *service /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + uint32_t options /* [in] */, + struct srvsvc_Statistics **stats /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetTransportAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetTransportInfoCtr *transports /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetTransportDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + struct srvsvc_NetTransportInfo0 *info0 /* [in] [ref] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetRemoteTODInfo **info /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetSetServiceBits(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *transport /* [in] [unique,charset(UTF16)] */, + uint32_t servicebits /* [in] */, + uint32_t updateimmediately /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path /* [in] [charset(UTF16)] */, + uint32_t pathflags /* [in] */, + uint32_t *pathtype /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path /* [in] [charset(UTF16)] */, + uint8_t *can_path /* [out] [size_is(maxbuf)] */, + uint32_t maxbuf /* [in] */, + const char *prefix /* [in] [charset(UTF16)] */, + uint32_t *pathtype /* [in,out] [ref] */, + uint32_t pathflags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *path1 /* [in] [charset(UTF16)] */, + const char *path2 /* [in] [charset(UTF16)] */, + uint32_t pathtype /* [in] */, + uint32_t pathflags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetNameValidate(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *name /* [in] [charset(UTF16)] */, + uint32_t name_type /* [in] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetPRNameCompare(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *name1 /* [in] [charset(UTF16)] */, + const char *name2 /* [in] [charset(UTF16)] */, + uint32_t name_type /* [in] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *totalentries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share /* [in] [charset(UTF16)] */, + uint32_t reserved /* [in] */, + struct policy_handle *hnd /* [out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *hnd /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share /* [in] [unique,charset(UTF16)] */, + const char *file /* [in] [charset(UTF16)] */, + uint32_t securityinformation /* [in] */, + struct sec_desc_buf **sd_buf /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *share /* [in] [unique,charset(UTF16)] */, + const char *file /* [in] [charset(UTF16)] */, + uint32_t securityinformation /* [in] */, + struct sec_desc_buf *sd_buf /* [in] [ref] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetServerTransportAddEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_unc /* [in] [unique,charset(UTF16)] */, + const char *emulated_server_unc /* [in] [unique,charset(UTF16)] */, + const char *transport /* [in] [unique,charset(UTF16)] */, + uint32_t servicebitsofinterest /* [in] */, + uint32_t servicebits /* [in] */, + uint32_t updateimmediately /* [in] */, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_srvsvc_NETRSERVERTRANSPORTDELEX(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +#endif /* __CLI_SRVSVC__ */ diff --git a/librpc/gen_ndr/cli_svcctl.c b/librpc/gen_ndr/cli_svcctl.c new file mode 100644 index 0000000000..9f11a40d7e --- /dev/null +++ b/librpc/gen_ndr/cli_svcctl.c @@ -0,0 +1,2245 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_svcctl.h" + +NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */, + WERROR *werror) +{ + struct svcctl_CloseServiceHandle r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_CLOSESERVICEHANDLE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum SERVICE_CONTROL control /* [in] */, + struct SERVICE_STATUS *service_status /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_ControlService r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.control = control; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ControlService, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_CONTROLSERVICE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ControlService, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *service_status = *r.out.service_status; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + WERROR *werror) +{ + struct svcctl_DeleteService r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_DeleteService, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_DELETESERVICE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct policy_handle *lock /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_LockServiceDatabase r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_LOCKSERVICEDATABASE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *lock = *r.out.lock; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t security_flags /* [in] */, + uint8_t *buffer /* [out] [ref,size_is(buffer_size)] */, + uint32_t buffer_size /* [in] [range(0,0x40000)] */, + uint32_t *needed /* [out] [ref,range(0,0x40000)] */, + WERROR *werror) +{ + struct svcctl_QueryServiceObjectSecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.security_flags = security_flags; + r.in.buffer_size = buffer_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(buffer, r.out.buffer, r.in.buffer_size * sizeof(*buffer)); + *needed = *r.out.needed; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t security_flags /* [in] */, + uint8_t *buffer /* [in] [ref,size_is(buffer_size)] */, + uint32_t buffer_size /* [in] */, + WERROR *werror) +{ + struct svcctl_SetServiceObjectSecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.security_flags = security_flags; + r.in.buffer = buffer; + r.in.buffer_size = buffer_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_SETSERVICEOBJECTSECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct SERVICE_STATUS *service_status /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_QueryServiceStatus r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_QUERYSERVICESTATUS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *service_status = *r.out.service_status; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct svcctl_SetServiceStatus r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_SETSERVICESTATUS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *lock /* [in,out] [ref] */, + WERROR *werror) +{ + struct svcctl_UnlockServiceDatabase r; + NTSTATUS status; + + /* In parameters */ + r.in.lock = lock; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_UNLOCKSERVICEDATABASE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *lock = *r.out.lock; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct svcctl_NotifyBootConfigStatus r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t bits /* [in] */, + uint32_t bitson /* [in] */, + uint32_t immediate /* [in] */, + WERROR *werror) +{ + struct svcctl_SCSetServiceBitsW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.bits = bits; + r.in.bitson = bitson; + r.in.immediate = immediate; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_SCSETSERVICEBITSW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t type /* [in] */, + uint32_t start /* [in] */, + uint32_t error /* [in] */, + const char *binary_path /* [in] [unique,charset(UTF16)] */, + const char *load_order_group /* [in] [unique,charset(UTF16)] */, + uint32_t *tag_id /* [out] [ref] */, + const char *dependencies /* [in] [unique,charset(UTF16)] */, + const char *service_start_name /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + const char *display_name /* [in] [unique,charset(UTF16)] */, + WERROR *werror) +{ + struct svcctl_ChangeServiceConfigW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.type = type; + r.in.start = start; + r.in.error = error; + r.in.binary_path = binary_path; + r.in.load_order_group = load_order_group; + r.in.dependencies = dependencies; + r.in.service_start_name = service_start_name; + r.in.password = password; + r.in.display_name = display_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_CHANGESERVICECONFIGW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *tag_id = *r.out.tag_id; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager_handle /* [in] [ref] */, + const char *ServiceName /* [in] [charset(UTF16)] */, + const char *DisplayName /* [in] [unique,charset(UTF16)] */, + uint32_t desired_access /* [in] */, + uint32_t type /* [in] */, + uint32_t start_type /* [in] */, + uint32_t error_control /* [in] */, + const char *binary_path /* [in] [charset(UTF16)] */, + const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */, + uint32_t *TagId /* [in,out] [unique] */, + uint8_t *dependencies /* [in] [unique,size_is(dependencies_size)] */, + uint32_t dependencies_size /* [in] */, + const char *service_start_name /* [in] [unique,charset(UTF16)] */, + uint8_t *password /* [in] [unique,size_is(password_size)] */, + uint32_t password_size /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_CreateServiceW r; + NTSTATUS status; + + /* In parameters */ + r.in.scmanager_handle = scmanager_handle; + r.in.ServiceName = ServiceName; + r.in.DisplayName = DisplayName; + r.in.desired_access = desired_access; + r.in.type = type; + r.in.start_type = start_type; + r.in.error_control = error_control; + r.in.binary_path = binary_path; + r.in.LoadOrderGroupKey = LoadOrderGroupKey; + r.in.TagId = TagId; + r.in.dependencies = dependencies; + r.in.dependencies_size = dependencies_size; + r.in.service_start_name = service_start_name; + r.in.password = password; + r.in.password_size = password_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_CREATESERVICEW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (TagId && r.out.TagId) { + *TagId = *r.out.TagId; + } + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *service /* [in] [ref] */, + uint32_t state /* [in] */, + uint8_t *service_status /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,0x40000)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,0x40000)] */, + uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */, + WERROR *werror) +{ + struct svcctl_EnumDependentServicesW r; + NTSTATUS status; + + /* In parameters */ + r.in.service = service; + r.in.state = state; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_ENUMDEPENDENTSERVICESW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(service_status, r.out.service_status, r.in.buf_size * sizeof(*service_status)); + *bytes_needed = *r.out.bytes_needed; + *services_returned = *r.out.services_returned; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t type /* [in] */, + uint32_t state /* [in] */, + uint8_t *service /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,262144)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,262144)] */, + uint32_t *services_returned /* [out] [ref,range(0,262144)] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct svcctl_EnumServicesStatusW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.type = type; + r.in.state = state; + r.in.buf_size = buf_size; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_ENUMSERVICESSTATUSW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(service, r.out.service, r.in.buf_size * sizeof(*service)); + *bytes_needed = *r.out.bytes_needed; + *services_returned = *r.out.services_returned; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *MachineName /* [in] [unique,charset(UTF16)] */, + const char *DatabaseName /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_OpenSCManagerW r; + NTSTATUS status; + + /* In parameters */ + r.in.MachineName = MachineName; + r.in.DatabaseName = DatabaseName; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_OPENSCMANAGERW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager_handle /* [in] [ref] */, + const char *ServiceName /* [in] [charset(UTF16)] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_OpenServiceW r; + NTSTATUS status; + + /* In parameters */ + r.in.scmanager_handle = scmanager_handle; + r.in.ServiceName = ServiceName; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_OPENSERVICEW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct QUERY_SERVICE_CONFIG *query /* [out] [ref] */, + uint32_t buf_size /* [in] [range(0,8192)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, + WERROR *werror) +{ + struct svcctl_QueryServiceConfigW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_QUERYSERVICECONFIGW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *query = *r.out.query; + *bytes_needed = *r.out.bytes_needed; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t buf_size /* [in] */, + struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */, + uint32_t *required_buf_size /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_QueryServiceLockStatusW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_QUERYSERVICELOCKSTATUSW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *lock_status = *r.out.lock_status; + *required_buf_size = *r.out.required_buf_size; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_StartServiceW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t NumArgs /* [in] */, + const char *Arguments /* [in] [unique,charset(UTF16)] */, + WERROR *werror) +{ + struct svcctl_StartServiceW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.NumArgs = NumArgs; + r.in.Arguments = Arguments; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_STARTSERVICEW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *service_name /* [in] [unique,charset(UTF16)] */, + const char **display_name /* [out] [ref,charset(UTF16)] */, + uint32_t *display_name_length /* [in,out] [unique] */, + WERROR *werror) +{ + struct svcctl_GetServiceDisplayNameW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.service_name = service_name; + r.in.display_name_length = display_name_length; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_GETSERVICEDISPLAYNAMEW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *display_name = *r.out.display_name; + if (display_name_length && r.out.display_name_length) { + *display_name_length = *r.out.display_name_length; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *service_name /* [in] [unique,charset(UTF16)] */, + const char **key_name /* [out] [ref,charset(UTF16)] */, + uint32_t *display_name_length /* [in,out] [unique] */, + WERROR *werror) +{ + struct svcctl_GetServiceKeyNameW r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.service_name = service_name; + r.in.display_name_length = display_name_length; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_GETSERVICEKEYNAMEW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *key_name = *r.out.key_name; + if (display_name_length && r.out.display_name_length) { + *display_name_length = *r.out.display_name_length; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t bits /* [in] */, + uint32_t bitson /* [in] */, + uint32_t immediate /* [in] */, + WERROR *werror) +{ + struct svcctl_SCSetServiceBitsA r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.bits = bits; + r.in.bitson = bitson; + r.in.immediate = immediate; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_SCSETSERVICEBITSA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t type /* [in] */, + uint32_t start /* [in] */, + uint32_t error /* [in] */, + const char *binary_path /* [in] [unique,charset(UTF16)] */, + const char *load_order_group /* [in] [unique,charset(UTF16)] */, + uint32_t *tag_id /* [out] [ref] */, + const char *dependencies /* [in] [unique,charset(UTF16)] */, + const char *service_start_name /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + const char *display_name /* [in] [unique,charset(UTF16)] */, + WERROR *werror) +{ + struct svcctl_ChangeServiceConfigA r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.type = type; + r.in.start = start; + r.in.error = error; + r.in.binary_path = binary_path; + r.in.load_order_group = load_order_group; + r.in.dependencies = dependencies; + r.in.service_start_name = service_start_name; + r.in.password = password; + r.in.display_name = display_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_CHANGESERVICECONFIGA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *tag_id = *r.out.tag_id; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *ServiceName /* [in] [unique,charset(UTF16)] */, + const char *DisplayName /* [in] [unique,charset(UTF16)] */, + uint32_t desired_access /* [in] */, + uint32_t type /* [in] */, + uint32_t start_type /* [in] */, + uint32_t error_control /* [in] */, + const char *binary_path /* [in] [unique,charset(UTF16)] */, + const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */, + uint32_t *TagId /* [out] [unique] */, + const char *dependencies /* [in] [unique,charset(UTF16)] */, + const char *service_start_name /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + WERROR *werror) +{ + struct svcctl_CreateServiceA r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.ServiceName = ServiceName; + r.in.DisplayName = DisplayName; + r.in.desired_access = desired_access; + r.in.type = type; + r.in.start_type = start_type; + r.in.error_control = error_control; + r.in.binary_path = binary_path; + r.in.LoadOrderGroupKey = LoadOrderGroupKey; + r.in.dependencies = dependencies; + r.in.service_start_name = service_start_name; + r.in.password = password; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_CREATESERVICEA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (TagId && r.out.TagId) { + *TagId = *r.out.TagId; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *service /* [in] [ref] */, + uint32_t state /* [in] */, + struct ENUM_SERVICE_STATUS *service_status /* [out] [unique] */, + uint32_t buf_size /* [in] */, + uint32_t *bytes_needed /* [out] [ref] */, + uint32_t *services_returned /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_EnumDependentServicesA r; + NTSTATUS status; + + /* In parameters */ + r.in.service = service; + r.in.state = state; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_ENUMDEPENDENTSERVICESA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (service_status && r.out.service_status) { + *service_status = *r.out.service_status; + } + *bytes_needed = *r.out.bytes_needed; + *services_returned = *r.out.services_returned; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t type /* [in] */, + uint32_t state /* [in] */, + uint32_t buf_size /* [in] */, + uint8_t *service /* [out] [size_is(buf_size)] */, + uint32_t *bytes_needed /* [out] [ref] */, + uint32_t *services_returned /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct svcctl_EnumServicesStatusA r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.type = type; + r.in.state = state; + r.in.buf_size = buf_size; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_ENUMSERVICESSTATUSA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(service, r.out.service, r.in.buf_size * sizeof(*service)); + *bytes_needed = *r.out.bytes_needed; + *services_returned = *r.out.services_returned; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *MachineName /* [in] [unique,charset(UTF16)] */, + const char *DatabaseName /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_OpenSCManagerA r; + NTSTATUS status; + + /* In parameters */ + r.in.MachineName = MachineName; + r.in.DatabaseName = DatabaseName; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_OPENSCMANAGERA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_OpenServiceA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager_handle /* [in] [ref] */, + const char *ServiceName /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + WERROR *werror) +{ + struct svcctl_OpenServiceA r; + NTSTATUS status; + + /* In parameters */ + r.in.scmanager_handle = scmanager_handle; + r.in.ServiceName = ServiceName; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_OPENSERVICEA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint8_t *query /* [out] */, + uint32_t buf_size /* [in] */, + uint32_t *bytes_needed /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_QueryServiceConfigA r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_QUERYSERVICECONFIGA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(query, r.out.query, r.in.buf_size * sizeof(*query)); + *bytes_needed = *r.out.bytes_needed; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t buf_size /* [in] */, + struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */, + uint32_t *required_buf_size /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_QueryServiceLockStatusA r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_QUERYSERVICELOCKSTATUSA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *lock_status = *r.out.lock_status; + *required_buf_size = *r.out.required_buf_size; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_StartServiceA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t NumArgs /* [in] */, + const char *Arguments /* [in] [unique,charset(UTF16)] */, + WERROR *werror) +{ + struct svcctl_StartServiceA r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.NumArgs = NumArgs; + r.in.Arguments = Arguments; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_STARTSERVICEA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *service_name /* [in] [unique,charset(UTF16)] */, + const char **display_name /* [out] [ref,charset(UTF16)] */, + uint32_t *display_name_length /* [in,out] [unique] */, + WERROR *werror) +{ + struct svcctl_GetServiceDisplayNameA r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.service_name = service_name; + r.in.display_name_length = display_name_length; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_GETSERVICEDISPLAYNAMEA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *display_name = *r.out.display_name; + if (display_name_length && r.out.display_name_length) { + *display_name_length = *r.out.display_name_length; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *service_name /* [in] [unique,charset(UTF16)] */, + const char **key_name /* [out] [ref,charset(UTF16)] */, + uint32_t *display_name_length /* [in,out] [unique] */, + WERROR *werror) +{ + struct svcctl_GetServiceKeyNameA r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.service_name = service_name; + r.in.display_name_length = display_name_length; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_GETSERVICEKEYNAMEA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *key_name = *r.out.key_name; + if (display_name_length && r.out.display_name_length) { + *display_name_length = *r.out.display_name_length; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct svcctl_GetCurrentGroupeStateW r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_GETCURRENTGROUPESTATEW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct svcctl_EnumServiceGroupW r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_ENUMSERVICEGROUPW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *info /* [in] [unique] */, + WERROR *werror) +{ + struct svcctl_ChangeServiceConfig2A r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.info_level = info_level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_CHANGESERVICECONFIG2A, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *info /* [in] [unique] */, + WERROR *werror) +{ + struct svcctl_ChangeServiceConfig2W r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.info_level = info_level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_CHANGESERVICECONFIG2W, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *buffer /* [out] */, + uint32_t buf_size /* [in] */, + uint32_t *bytes_needed /* [out] [ref] */, + WERROR *werror) +{ + struct svcctl_QueryServiceConfig2A r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.info_level = info_level; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_QUERYSERVICECONFIG2A, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(buffer, r.out.buffer, r.in.buf_size * sizeof(*buffer)); + *bytes_needed = *r.out.bytes_needed; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,8192)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, + WERROR *werror) +{ + struct svcctl_QueryServiceConfig2W r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.info_level = info_level; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_QUERYSERVICECONFIG2W, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(buffer, r.out.buffer, r.in.buf_size * sizeof(*buffer)); + *bytes_needed = *r.out.bytes_needed; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,8192)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, + WERROR *werror) +{ + struct svcctl_QueryServiceStatusEx r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.info_level = info_level; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_QUERYSERVICESTATUSEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(buffer, r.out.buffer, r.in.buf_size * sizeof(*buffer)); + *bytes_needed = *r.out.bytes_needed; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint32_t type /* [in] */, + uint32_t state /* [in] */, + uint8_t *services /* [out] */, + uint32_t buf_size /* [in] */, + uint32_t *bytes_needed /* [out] [ref] */, + uint32_t *service_returned /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + const char **group_name /* [out] [ref,charset(UTF16)] */, + WERROR *werror) +{ + struct EnumServicesStatusExA r; + NTSTATUS status; + + /* In parameters */ + r.in.scmanager = scmanager; + r.in.info_level = info_level; + r.in.type = type; + r.in.state = state; + r.in.buf_size = buf_size; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_ENUMSERVICESSTATUSEXA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(services, r.out.services, r.in.buf_size * sizeof(*services)); + *bytes_needed = *r.out.bytes_needed; + *service_returned = *r.out.service_returned; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + *group_name = *r.out.group_name; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint32_t type /* [in] */, + uint32_t state /* [in] */, + uint8_t *services /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,262144)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,262144)] */, + uint32_t *service_returned /* [out] [ref,range(0,262144)] */, + uint32_t *resume_handle /* [in,out] [unique,range(0,262144)] */, + const char *group_name /* [in] [unique,charset(UTF16)] */, + WERROR *werror) +{ + struct EnumServicesStatusExW r; + NTSTATUS status; + + /* In parameters */ + r.in.scmanager = scmanager; + r.in.info_level = info_level; + r.in.type = type; + r.in.state = state; + r.in.buf_size = buf_size; + r.in.resume_handle = resume_handle; + r.in.group_name = group_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_ENUMSERVICESSTATUSEXW, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(services, r.out.services, r.in.buf_size * sizeof(*services)); + *bytes_needed = *r.out.bytes_needed; + *service_returned = *r.out.service_returned; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_svcctl_SCSendTSMessage(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct svcctl_SCSendTSMessage r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_svcctl, + NDR_SVCCTL_SCSENDTSMESSAGE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/librpc/gen_ndr/cli_svcctl.h b/librpc/gen_ndr/cli_svcctl.h new file mode 100644 index 0000000000..78c9bf40d8 --- /dev/null +++ b/librpc/gen_ndr/cli_svcctl.h @@ -0,0 +1,336 @@ +#include "librpc/gen_ndr/ndr_svcctl.h" +#ifndef __CLI_SVCCTL__ +#define __CLI_SVCCTL__ +NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + enum SERVICE_CONTROL control /* [in] */, + struct SERVICE_STATUS *service_status /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct policy_handle *lock /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t security_flags /* [in] */, + uint8_t *buffer /* [out] [ref,size_is(buffer_size)] */, + uint32_t buffer_size /* [in] [range(0,0x40000)] */, + uint32_t *needed /* [out] [ref,range(0,0x40000)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t security_flags /* [in] */, + uint8_t *buffer /* [in] [ref,size_is(buffer_size)] */, + uint32_t buffer_size /* [in] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct SERVICE_STATUS *service_status /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *lock /* [in,out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t bits /* [in] */, + uint32_t bitson /* [in] */, + uint32_t immediate /* [in] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t type /* [in] */, + uint32_t start /* [in] */, + uint32_t error /* [in] */, + const char *binary_path /* [in] [unique,charset(UTF16)] */, + const char *load_order_group /* [in] [unique,charset(UTF16)] */, + uint32_t *tag_id /* [out] [ref] */, + const char *dependencies /* [in] [unique,charset(UTF16)] */, + const char *service_start_name /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + const char *display_name /* [in] [unique,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager_handle /* [in] [ref] */, + const char *ServiceName /* [in] [charset(UTF16)] */, + const char *DisplayName /* [in] [unique,charset(UTF16)] */, + uint32_t desired_access /* [in] */, + uint32_t type /* [in] */, + uint32_t start_type /* [in] */, + uint32_t error_control /* [in] */, + const char *binary_path /* [in] [charset(UTF16)] */, + const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */, + uint32_t *TagId /* [in,out] [unique] */, + uint8_t *dependencies /* [in] [unique,size_is(dependencies_size)] */, + uint32_t dependencies_size /* [in] */, + const char *service_start_name /* [in] [unique,charset(UTF16)] */, + uint8_t *password /* [in] [unique,size_is(password_size)] */, + uint32_t password_size /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *service /* [in] [ref] */, + uint32_t state /* [in] */, + uint8_t *service_status /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,0x40000)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,0x40000)] */, + uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t type /* [in] */, + uint32_t state /* [in] */, + uint8_t *service /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,262144)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,262144)] */, + uint32_t *services_returned /* [out] [ref,range(0,262144)] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *MachineName /* [in] [unique,charset(UTF16)] */, + const char *DatabaseName /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager_handle /* [in] [ref] */, + const char *ServiceName /* [in] [charset(UTF16)] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct QUERY_SERVICE_CONFIG *query /* [out] [ref] */, + uint32_t buf_size /* [in] [range(0,8192)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t buf_size /* [in] */, + struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */, + uint32_t *required_buf_size /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_StartServiceW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t NumArgs /* [in] */, + const char *Arguments /* [in] [unique,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *service_name /* [in] [unique,charset(UTF16)] */, + const char **display_name /* [out] [ref,charset(UTF16)] */, + uint32_t *display_name_length /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *service_name /* [in] [unique,charset(UTF16)] */, + const char **key_name /* [out] [ref,charset(UTF16)] */, + uint32_t *display_name_length /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t bits /* [in] */, + uint32_t bitson /* [in] */, + uint32_t immediate /* [in] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t type /* [in] */, + uint32_t start /* [in] */, + uint32_t error /* [in] */, + const char *binary_path /* [in] [unique,charset(UTF16)] */, + const char *load_order_group /* [in] [unique,charset(UTF16)] */, + uint32_t *tag_id /* [out] [ref] */, + const char *dependencies /* [in] [unique,charset(UTF16)] */, + const char *service_start_name /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + const char *display_name /* [in] [unique,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *ServiceName /* [in] [unique,charset(UTF16)] */, + const char *DisplayName /* [in] [unique,charset(UTF16)] */, + uint32_t desired_access /* [in] */, + uint32_t type /* [in] */, + uint32_t start_type /* [in] */, + uint32_t error_control /* [in] */, + const char *binary_path /* [in] [unique,charset(UTF16)] */, + const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */, + uint32_t *TagId /* [out] [unique] */, + const char *dependencies /* [in] [unique,charset(UTF16)] */, + const char *service_start_name /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *service /* [in] [ref] */, + uint32_t state /* [in] */, + struct ENUM_SERVICE_STATUS *service_status /* [out] [unique] */, + uint32_t buf_size /* [in] */, + uint32_t *bytes_needed /* [out] [ref] */, + uint32_t *services_returned /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t type /* [in] */, + uint32_t state /* [in] */, + uint32_t buf_size /* [in] */, + uint8_t *service /* [out] [size_is(buf_size)] */, + uint32_t *bytes_needed /* [out] [ref] */, + uint32_t *services_returned /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *MachineName /* [in] [unique,charset(UTF16)] */, + const char *DatabaseName /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_OpenServiceA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager_handle /* [in] [ref] */, + const char *ServiceName /* [in] [unique,charset(UTF16)] */, + uint32_t access_mask /* [in] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint8_t *query /* [out] */, + uint32_t buf_size /* [in] */, + uint32_t *bytes_needed /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t buf_size /* [in] */, + struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */, + uint32_t *required_buf_size /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_StartServiceA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t NumArgs /* [in] */, + const char *Arguments /* [in] [unique,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *service_name /* [in] [unique,charset(UTF16)] */, + const char **display_name /* [out] [ref,charset(UTF16)] */, + uint32_t *display_name_length /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + const char *service_name /* [in] [unique,charset(UTF16)] */, + const char **key_name /* [out] [ref,charset(UTF16)] */, + uint32_t *display_name_length /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *info /* [in] [unique] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *info /* [in] [unique] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *buffer /* [out] */, + uint32_t buf_size /* [in] */, + uint32_t *bytes_needed /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,8192)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,8192)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, + WERROR *werror); +NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint32_t type /* [in] */, + uint32_t state /* [in] */, + uint8_t *services /* [out] */, + uint32_t buf_size /* [in] */, + uint32_t *bytes_needed /* [out] [ref] */, + uint32_t *service_returned /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + const char **group_name /* [out] [ref,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *scmanager /* [in] [ref] */, + uint32_t info_level /* [in] */, + uint32_t type /* [in] */, + uint32_t state /* [in] */, + uint8_t *services /* [out] [ref,size_is(buf_size)] */, + uint32_t buf_size /* [in] [range(0,262144)] */, + uint32_t *bytes_needed /* [out] [ref,range(0,262144)] */, + uint32_t *service_returned /* [out] [ref,range(0,262144)] */, + uint32_t *resume_handle /* [in,out] [unique,range(0,262144)] */, + const char *group_name /* [in] [unique,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_svcctl_SCSendTSMessage(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +#endif /* __CLI_SVCCTL__ */ diff --git a/librpc/gen_ndr/cli_winreg.c b/librpc/gen_ndr/cli_winreg.c new file mode 100644 index 0000000000..17b7281c72 --- /dev/null +++ b/librpc/gen_ndr/cli_winreg.c @@ -0,0 +1,1726 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_winreg.h" + +NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenHKCR r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENHKCR, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenHKCU r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENHKCU, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenHKLM r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENHKLM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenHKPD r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENHKPD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenHKU r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKU, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENHKU, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */, + WERROR *werror) +{ + struct winreg_CloseKey r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_CloseKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_CLOSEKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String name /* [in] */, + struct winreg_String keyclass /* [in] */, + uint32_t options /* [in] */, + uint32_t access_mask /* [in] */, + struct winreg_SecBuf *secdesc /* [in] [unique] */, + struct policy_handle *new_handle /* [out] [ref] */, + enum winreg_CreateAction *action_taken /* [in,out] [unique] */, + WERROR *werror) +{ + struct winreg_CreateKey r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.name = name; + r.in.keyclass = keyclass; + r.in.options = options; + r.in.access_mask = access_mask; + r.in.secdesc = secdesc; + r.in.action_taken = action_taken; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_CreateKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_CREATEKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_CreateKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *new_handle = *r.out.new_handle; + if (action_taken && r.out.action_taken) { + *action_taken = *r.out.action_taken; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String key /* [in] */, + WERROR *werror) +{ + struct winreg_DeleteKey r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.key = key; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_DeleteKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_DELETEKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String value /* [in] */, + WERROR *werror) +{ + struct winreg_DeleteValue r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.value = value; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_DeleteValue, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_DELETEVALUE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t enum_index /* [in] */, + struct winreg_StringBuf *name /* [in,out] [ref] */, + struct winreg_StringBuf *keyclass /* [in,out] [unique] */, + NTTIME *last_changed_time /* [in,out] [unique] */, + WERROR *werror) +{ + struct winreg_EnumKey r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.enum_index = enum_index; + r.in.name = name; + r.in.keyclass = keyclass; + r.in.last_changed_time = last_changed_time; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_EnumKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_ENUMKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_EnumKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *name = *r.out.name; + if (keyclass && r.out.keyclass) { + *keyclass = *r.out.keyclass; + } + if (last_changed_time && r.out.last_changed_time) { + *last_changed_time = *r.out.last_changed_time; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t enum_index /* [in] */, + struct winreg_StringBuf *name /* [in,out] [ref] */, + enum winreg_Type *type /* [in,out] [unique] */, + uint8_t *value /* [in,out] [unique,length_is(*length),size_is(*size)] */, + uint32_t *size /* [in,out] [unique] */, + uint32_t *length /* [in,out] [unique] */, + WERROR *werror) +{ + struct winreg_EnumValue r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.enum_index = enum_index; + r.in.name = name; + r.in.type = type; + r.in.value = value; + r.in.size = size; + r.in.length = length; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_EnumValue, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_ENUMVALUE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_EnumValue, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *name = *r.out.name; + if (type && r.out.type) { + *type = *r.out.type; + } + if (value && r.out.value) { + memcpy(value, r.out.value, *r.in.size * sizeof(*value)); + } + if (size && r.out.size) { + *size = *r.out.size; + } + if (length && r.out.length) { + *length = *r.out.length; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + WERROR *werror) +{ + struct winreg_FlushKey r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_FlushKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_FLUSHKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_FlushKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct KeySecurityData *sd /* [in,out] [ref] */, + WERROR *werror) +{ + struct winreg_GetKeySecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sec_info = sec_info; + r.in.sd = sd; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_GETKEYSECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sd = *r.out.sd; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *keyname /* [in] [unique] */, + struct winreg_String *filename /* [in] [unique] */, + WERROR *werror) +{ + struct winreg_LoadKey r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.keyname = keyname; + r.in.filename = filename; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_LoadKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_LOADKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_LoadKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint8_t watch_subtree /* [in] */, + uint32_t notify_filter /* [in] */, + uint32_t unknown /* [in] */, + struct winreg_String string1 /* [in] */, + struct winreg_String string2 /* [in] */, + uint32_t unknown2 /* [in] */, + WERROR *werror) +{ + struct winreg_NotifyChangeKeyValue r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.watch_subtree = watch_subtree; + r.in.notify_filter = notify_filter; + r.in.unknown = unknown; + r.in.string1 = string1; + r.in.string2 = string2; + r.in.unknown2 = unknown2; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_NOTIFYCHANGEKEYVALUE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *parent_handle /* [in] [ref] */, + struct winreg_String keyname /* [in] */, + uint32_t unknown /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenKey r; + NTSTATUS status; + + /* In parameters */ + r.in.parent_handle = parent_handle; + r.in.keyname = keyname; + r.in.unknown = unknown; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *classname /* [in,out] [ref] */, + uint32_t *num_subkeys /* [out] [ref] */, + uint32_t *max_subkeylen /* [out] [ref] */, + uint32_t *max_classlen /* [out] [ref] */, + uint32_t *num_values /* [out] [ref] */, + uint32_t *max_valnamelen /* [out] [ref] */, + uint32_t *max_valbufsize /* [out] [ref] */, + uint32_t *secdescsize /* [out] [ref] */, + NTTIME *last_changed_time /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_QueryInfoKey r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.classname = classname; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_QUERYINFOKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *classname = *r.out.classname; + *num_subkeys = *r.out.num_subkeys; + *max_subkeylen = *r.out.max_subkeylen; + *max_classlen = *r.out.max_classlen; + *num_values = *r.out.num_values; + *max_valnamelen = *r.out.max_valnamelen; + *max_valbufsize = *r.out.max_valbufsize; + *secdescsize = *r.out.secdescsize; + *last_changed_time = *r.out.last_changed_time; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *value_name /* [in] [ref] */, + enum winreg_Type *type /* [in,out] [unique] */, + uint8_t *data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */, + uint32_t *data_size /* [in,out] [unique] */, + uint32_t *data_length /* [in,out] [unique] */, + WERROR *werror) +{ + struct winreg_QueryValue r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.value_name = value_name; + r.in.type = type; + r.in.data = data; + r.in.data_size = data_size; + r.in.data_length = data_length; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_QueryValue, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_QUERYVALUE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_QueryValue, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (type && r.out.type) { + *type = *r.out.type; + } + if (data && r.out.data) { + memcpy(data, r.out.data, *r.in.data_size * sizeof(*data)); + } + if (data_size && r.out.data_size) { + *data_size = *r.out.data_size; + } + if (data_length && r.out.data_length) { + *data_length = *r.out.data_length; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct winreg_ReplaceKey r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_REPLACEKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *filename /* [in] [ref] */, + uint32_t flags /* [in] */, + WERROR *werror) +{ + struct winreg_RestoreKey r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.filename = filename; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_RestoreKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_RESTOREKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *filename /* [in] [ref] */, + struct KeySecurityAttribute *sec_attrib /* [in] [unique] */, + WERROR *werror) +{ + struct winreg_SaveKey r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.filename = filename; + r.in.sec_attrib = sec_attrib; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_SaveKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_SAVEKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct KeySecurityData *sd /* [in] [ref] */, + WERROR *werror) +{ + struct winreg_SetKeySecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sec_info = sec_info; + r.in.sd = sd; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_SETKEYSECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String name /* [in] */, + enum winreg_Type type /* [in] */, + uint8_t *data /* [in] [ref,size_is(size)] */, + uint32_t size /* [in] */, + WERROR *werror) +{ + struct winreg_SetValue r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.name = name; + r.in.type = type; + r.in.data = data; + r.in.size = size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_SetValue, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_SETVALUE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_SetValue, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct winreg_UnLoadKey r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_UNLOADKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *hostname /* [in] [unique] */, + struct lsa_StringLarge *message /* [in] [unique] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */, + WERROR *werror) +{ + struct winreg_InitiateSystemShutdown r; + NTSTATUS status; + + /* In parameters */ + r.in.hostname = hostname; + r.in.message = message; + r.in.timeout = timeout; + r.in.force_apps = force_apps; + r.in.do_reboot = do_reboot; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_INITIATESYSTEMSHUTDOWN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *server /* [in] [unique] */, + WERROR *werror) +{ + struct winreg_AbortSystemShutdown r; + NTSTATUS status; + + /* In parameters */ + r.in.server = server; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_ABORTSYSTEMSHUTDOWN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *version /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_GetVersion r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_GetVersion, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_GETVERSION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *version = *r.out.version; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenHKCC r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENHKCC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenHKDD r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENHKDD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *key_handle /* [in] [ref] */, + struct QueryMultipleValue *values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */, + uint32_t num_values /* [in] */, + uint8_t *buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */, + uint32_t *buffer_size /* [in,out] [ref] */, + WERROR *werror) +{ + struct winreg_QueryMultipleValues r; + NTSTATUS status; + + /* In parameters */ + r.in.key_handle = key_handle; + r.in.values = values; + r.in.num_values = num_values; + r.in.buffer = buffer; + r.in.buffer_size = buffer_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_QUERYMULTIPLEVALUES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + memcpy(values, r.out.values, r.in.num_values * sizeof(*values)); + if (buffer && r.out.buffer) { + memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer)); + } + *buffer_size = *r.out.buffer_size; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *hostname /* [in] [unique] */, + struct lsa_StringLarge *message /* [in] [unique] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */, + uint32_t reason /* [in] */, + WERROR *werror) +{ + struct winreg_InitiateSystemShutdownEx r; + NTSTATUS status; + + /* In parameters */ + r.in.hostname = hostname; + r.in.message = message; + r.in.timeout = timeout; + r.in.force_apps = force_apps; + r.in.do_reboot = do_reboot; + r.in.reason = reason; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct winreg_SaveKeyEx r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_SAVEKEYEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenHKPT r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENHKPT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror) +{ + struct winreg_OpenHKPN r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_OPENHKPN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct winreg_QueryMultipleValues2 r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_winreg, + NDR_WINREG_QUERYMULTIPLEVALUES2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/librpc/gen_ndr/cli_winreg.h b/librpc/gen_ndr/cli_winreg.h new file mode 100644 index 0000000000..fb27bce9d2 --- /dev/null +++ b/librpc/gen_ndr/cli_winreg.h @@ -0,0 +1,229 @@ +#include "librpc/gen_ndr/ndr_winreg.h" +#ifndef __CLI_WINREG__ +#define __CLI_WINREG__ +NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in,out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String name /* [in] */, + struct winreg_String keyclass /* [in] */, + uint32_t options /* [in] */, + uint32_t access_mask /* [in] */, + struct winreg_SecBuf *secdesc /* [in] [unique] */, + struct policy_handle *new_handle /* [out] [ref] */, + enum winreg_CreateAction *action_taken /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String key /* [in] */, + WERROR *werror); +NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String value /* [in] */, + WERROR *werror); +NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t enum_index /* [in] */, + struct winreg_StringBuf *name /* [in,out] [ref] */, + struct winreg_StringBuf *keyclass /* [in,out] [unique] */, + NTTIME *last_changed_time /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t enum_index /* [in] */, + struct winreg_StringBuf *name /* [in,out] [ref] */, + enum winreg_Type *type /* [in,out] [unique] */, + uint8_t *value /* [in,out] [unique,length_is(*length),size_is(*size)] */, + uint32_t *size /* [in,out] [unique] */, + uint32_t *length /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct KeySecurityData *sd /* [in,out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *keyname /* [in] [unique] */, + struct winreg_String *filename /* [in] [unique] */, + WERROR *werror); +NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint8_t watch_subtree /* [in] */, + uint32_t notify_filter /* [in] */, + uint32_t unknown /* [in] */, + struct winreg_String string1 /* [in] */, + struct winreg_String string2 /* [in] */, + uint32_t unknown2 /* [in] */, + WERROR *werror); +NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *parent_handle /* [in] [ref] */, + struct winreg_String keyname /* [in] */, + uint32_t unknown /* [in] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *classname /* [in,out] [ref] */, + uint32_t *num_subkeys /* [out] [ref] */, + uint32_t *max_subkeylen /* [out] [ref] */, + uint32_t *max_classlen /* [out] [ref] */, + uint32_t *num_values /* [out] [ref] */, + uint32_t *max_valnamelen /* [out] [ref] */, + uint32_t *max_valbufsize /* [out] [ref] */, + uint32_t *secdescsize /* [out] [ref] */, + NTTIME *last_changed_time /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *value_name /* [in] [ref] */, + enum winreg_Type *type /* [in,out] [unique] */, + uint8_t *data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */, + uint32_t *data_size /* [in,out] [unique] */, + uint32_t *data_length /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *filename /* [in] [ref] */, + uint32_t flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String *filename /* [in] [ref] */, + struct KeySecurityAttribute *sec_attrib /* [in] [unique] */, + WERROR *werror); +NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t sec_info /* [in] */, + struct KeySecurityData *sd /* [in] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + struct winreg_String name /* [in] */, + enum winreg_Type type /* [in] */, + uint8_t *data /* [in] [ref,size_is(size)] */, + uint32_t size /* [in] */, + WERROR *werror); +NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *hostname /* [in] [unique] */, + struct lsa_StringLarge *message /* [in] [unique] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */, + WERROR *werror); +NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *server /* [in] [unique] */, + WERROR *werror); +NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle /* [in] [ref] */, + uint32_t *version /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *key_handle /* [in] [ref] */, + struct QueryMultipleValue *values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */, + uint32_t num_values /* [in] */, + uint8_t *buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */, + uint32_t *buffer_size /* [in,out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *hostname /* [in] [unique] */, + struct lsa_StringLarge *message /* [in] [unique] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */, + uint32_t reason /* [in] */, + WERROR *werror); +NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name /* [in] [unique] */, + uint32_t access_mask /* [in] */, + struct policy_handle *handle /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +#endif /* __CLI_WINREG__ */ diff --git a/librpc/gen_ndr/cli_wkssvc.c b/librpc/gen_ndr/cli_wkssvc.c new file mode 100644 index 0000000000..b82e95311f --- /dev/null +++ b/librpc/gen_ndr/cli_wkssvc.c @@ -0,0 +1,1570 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_wkssvc.h" + +NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetWkstaInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct wkssvc_NetWkstaGetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETWKSTAGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetWkstaInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_error /* [in,out] [ref] */, + WERROR *werror) +{ + struct wkssvc_NetWkstaSetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.level = level; + r.in.info = info; + r.in.parm_error = parm_error; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETWKSTASETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *parm_error = *r.out.parm_error; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct wkssvc_NetWkstaEnumUsersInfo *info /* [in,out] [ref] */, + uint32_t prefmaxlen /* [in] */, + uint32_t *entries_read /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct wkssvc_NetWkstaEnumUsers r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.info = info; + r.in.prefmaxlen = prefmaxlen; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETWKSTAENUMUSERS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + *entries_read = *r.out.entries_read; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *unknown /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetrWkstaUserInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct wkssvc_NetrWkstaUserGetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.unknown = unknown; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRWKSTAUSERGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *unknown /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetrWkstaUserInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_err /* [in,out] [unique] */, + WERROR *werror) +{ + struct wkssvc_NetrWkstaUserSetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.unknown = unknown; + r.in.level = level; + r.in.info = info; + r.in.parm_err = parm_err; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRWKSTAUSERSETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (parm_err && r.out.parm_err) { + *parm_err = *r.out.parm_err; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *total_entries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct wkssvc_NetWkstaTransportEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.info = info; + r.in.max_buffer = max_buffer; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETWKSTATRANSPORTENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + *total_entries = *r.out.total_entries; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + struct wkssvc_NetWkstaTransportInfo0 *info0 /* [in] [ref] */, + uint32_t *parm_err /* [in,out] [unique] */, + WERROR *werror) +{ + struct wkssvc_NetrWkstaTransportAdd r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.level = level; + r.in.info0 = info0; + r.in.parm_err = parm_err; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRWKSTATRANSPORTADD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (parm_err && r.out.parm_err) { + *parm_err = *r.out.parm_err; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *transport_name /* [in] [unique,charset(UTF16)] */, + uint32_t unknown3 /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrWkstaTransportDel r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.transport_name = transport_name; + r.in.unknown3 = unknown3; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRWKSTATRANSPORTDEL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetrUseGetInfoCtr *ctr /* [in] [ref,switch_is(level)] */, + uint32_t *parm_err /* [in,out] [unique] */, + WERROR *werror) +{ + struct wkssvc_NetrUseAdd r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.level = level; + r.in.ctr = ctr; + r.in.parm_err = parm_err; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRUSEADD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (parm_err && r.out.parm_err) { + *parm_err = *r.out.parm_err; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *use_name /* [in] [ref,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetrUseGetInfoCtr *ctr /* [out] [ref,switch_is(level)] */, + WERROR *werror) +{ + struct wkssvc_NetrUseGetInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.use_name = use_name; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRUSEGETINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *use_name /* [in] [ref,charset(UTF16)] */, + uint32_t force_cond /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrUseDel r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.use_name = use_name; + r.in.force_cond = force_cond; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRUSEDEL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct wkssvc_NetrUseEnumInfo *info /* [in,out] [ref] */, + uint32_t prefmaxlen /* [in] */, + uint32_t *entries_read /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror) +{ + struct wkssvc_NetrUseEnum r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.info = info; + r.in.prefmaxlen = prefmaxlen; + r.in.resume_handle = resume_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRUSEENUM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + *entries_read = *r.out.entries_read; + if (resume_handle && r.out.resume_handle) { + *resume_handle = *r.out.resume_handle; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *message_name /* [in] [ref,charset(UTF16)] */, + const char *message_sender_name /* [in] [unique,charset(UTF16)] */, + uint8_t *message_buffer /* [in] [ref,size_is(message_size)] */, + uint32_t message_size /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrMessageBufferSend r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.message_name = message_name; + r.in.message_sender_name = message_sender_name; + r.in.message_buffer = message_buffer; + r.in.message_size = message_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRMESSAGEBUFFERSEND, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *unknown2 /* [in] [unique,charset(UTF16)] */, + uint32_t unknown3 /* [in] */, + uint32_t unknown4 /* [in] */, + struct wkssvc_NetrWorkstationStatistics **info /* [out] [ref] */, + WERROR *werror) +{ + struct wkssvc_NetrWorkstationStatisticsGet r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.unknown2 = unknown2; + r.in.unknown3 = unknown3; + r.in.unknown4 = unknown4; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + WERROR *werror) +{ + struct wkssvc_NetrLogonDomainNameAdd r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_name = domain_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRLOGONDOMAINNAMEADD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + WERROR *werror) +{ + struct wkssvc_NetrLogonDomainNameDel r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_name = domain_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + const char *account_ou /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + uint32_t join_flags /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrJoinDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.domain_name = domain_name; + r.in.account_ou = account_ou; + r.in.Account = Account; + r.in.password = password; + r.in.join_flags = join_flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRJOINDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + uint32_t unjoin_flags /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrUnjoinDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.Account = Account; + r.in.password = password; + r.in.unjoin_flags = unjoin_flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRUNJOINDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *NewMachineName /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + uint32_t RenameOptions /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrRenameMachineInDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.NewMachineName = NewMachineName; + r.in.Account = Account; + r.in.password = password; + r.in.RenameOptions = RenameOptions; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *name /* [in] [ref,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *Password /* [in] [unique,charset(UTF16)] */, + enum wkssvc_NetValidateNameType name_type /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrValidateName r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.name = name; + r.in.Account = Account; + r.in.Password = Password; + r.in.name_type = name_type; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRVALIDATENAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char **name_buffer /* [in,out] [ref,charset(UTF16)] */, + enum wkssvc_NetJoinStatus *name_type /* [out] [ref] */, + WERROR *werror) +{ + struct wkssvc_NetrGetJoinInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.name_buffer = name_buffer; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRGETJOININFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *name_buffer = *r.out.name_buffer; + *name_type = *r.out.name_type; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *unknown /* [in] [unique,charset(UTF16)] */, + uint32_t *num_ous /* [in,out] [ref] */, + const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */, + WERROR *werror) +{ + struct wkssvc_NetrGetJoinableOus r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.domain_name = domain_name; + r.in.Account = Account; + r.in.unknown = unknown; + r.in.num_ous = num_ous; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRGETJOINABLEOUS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *num_ous = *r.out.num_ous; + *ous = *r.out.ous; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + const char *account_ou /* [in] [unique,charset(UTF16)] */, + const char *admin_account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */, + uint32_t join_flags /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrJoinDomain2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.domain_name = domain_name; + r.in.account_ou = account_ou; + r.in.admin_account = admin_account; + r.in.encrypted_password = encrypted_password; + r.in.join_flags = join_flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRJOINDOMAIN2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */, + uint32_t unjoin_flags /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrUnjoinDomain2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.account = account; + r.in.encrypted_password = encrypted_password; + r.in.unjoin_flags = unjoin_flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRUNJOINDOMAIN2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *NewMachineName /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t RenameOptions /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrRenameMachineInDomain2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.NewMachineName = NewMachineName; + r.in.Account = Account; + r.in.EncryptedPassword = EncryptedPassword; + r.in.RenameOptions = RenameOptions; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *name /* [in] [ref,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + enum wkssvc_NetValidateNameType name_type /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrValidateName2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.name = name; + r.in.Account = Account; + r.in.EncryptedPassword = EncryptedPassword; + r.in.name_type = name_type; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRVALIDATENAME2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t *num_ous /* [in,out] [ref] */, + const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */, + WERROR *werror) +{ + struct wkssvc_NetrGetJoinableOus2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.domain_name = domain_name; + r.in.Account = Account; + r.in.EncryptedPassword = EncryptedPassword; + r.in.num_ous = num_ous; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRGETJOINABLEOUS2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *num_ous = *r.out.num_ous; + *ous = *r.out.ous; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *NewAlternateMachineName /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t Reserved /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrAddAlternateComputerName r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.NewAlternateMachineName = NewAlternateMachineName; + r.in.Account = Account; + r.in.EncryptedPassword = EncryptedPassword; + r.in.Reserved = Reserved; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t Reserved /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrRemoveAlternateComputerName r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.AlternateMachineNameToRemove = AlternateMachineNameToRemove; + r.in.Account = Account; + r.in.EncryptedPassword = EncryptedPassword; + r.in.Reserved = Reserved; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *primary_name /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t Reserved /* [in] */, + WERROR *werror) +{ + struct wkssvc_NetrSetPrimaryComputername r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.primary_name = primary_name; + r.in.Account = Account; + r.in.EncryptedPassword = EncryptedPassword; + r.in.Reserved = Reserved; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + enum wkssvc_ComputerNameType name_type /* [in] */, + uint32_t Reserved /* [in] */, + struct wkssvc_ComputerNamesCtr **ctr /* [out] [ref] */, + WERROR *werror) +{ + struct wkssvc_NetrEnumerateComputerNames r; + NTSTATUS status; + + /* In parameters */ + r.in.server_name = server_name; + r.in.name_type = name_type; + r.in.Reserved = Reserved; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + &ndr_table_wkssvc, + NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *ctr = *r.out.ctr; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/librpc/gen_ndr/cli_wkssvc.h b/librpc/gen_ndr/cli_wkssvc.h new file mode 100644 index 0000000000..0d360abfeb --- /dev/null +++ b/librpc/gen_ndr/cli_wkssvc.h @@ -0,0 +1,230 @@ +#include "librpc/gen_ndr/ndr_wkssvc.h" +#ifndef __CLI_WKSSVC__ +#define __CLI_WKSSVC__ +NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetWkstaInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetWkstaInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_error /* [in,out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct wkssvc_NetWkstaEnumUsersInfo *info /* [in,out] [ref] */, + uint32_t prefmaxlen /* [in] */, + uint32_t *entries_read /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *unknown /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetrWkstaUserInfo *info /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *unknown /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetrWkstaUserInfo *info /* [in] [ref,switch_is(level)] */, + uint32_t *parm_err /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */, + uint32_t max_buffer /* [in] */, + uint32_t *total_entries /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + struct wkssvc_NetWkstaTransportInfo0 *info0 /* [in] [ref] */, + uint32_t *parm_err /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *transport_name /* [in] [unique,charset(UTF16)] */, + uint32_t unknown3 /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetrUseGetInfoCtr *ctr /* [in] [ref,switch_is(level)] */, + uint32_t *parm_err /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *use_name /* [in] [ref,charset(UTF16)] */, + uint32_t level /* [in] */, + union wkssvc_NetrUseGetInfoCtr *ctr /* [out] [ref,switch_is(level)] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *use_name /* [in] [ref,charset(UTF16)] */, + uint32_t force_cond /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + struct wkssvc_NetrUseEnumInfo *info /* [in,out] [ref] */, + uint32_t prefmaxlen /* [in] */, + uint32_t *entries_read /* [out] [ref] */, + uint32_t *resume_handle /* [in,out] [unique] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *message_name /* [in] [ref,charset(UTF16)] */, + const char *message_sender_name /* [in] [unique,charset(UTF16)] */, + uint8_t *message_buffer /* [in] [ref,size_is(message_size)] */, + uint32_t message_size /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *unknown2 /* [in] [unique,charset(UTF16)] */, + uint32_t unknown3 /* [in] */, + uint32_t unknown4 /* [in] */, + struct wkssvc_NetrWorkstationStatistics **info /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + const char *account_ou /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + uint32_t join_flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + uint32_t unjoin_flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *NewMachineName /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *password /* [in] [unique,charset(UTF16)] */, + uint32_t RenameOptions /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *name /* [in] [ref,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *Password /* [in] [unique,charset(UTF16)] */, + enum wkssvc_NetValidateNameType name_type /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char **name_buffer /* [in,out] [ref,charset(UTF16)] */, + enum wkssvc_NetJoinStatus *name_type /* [out] [ref] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + const char *unknown /* [in] [unique,charset(UTF16)] */, + uint32_t *num_ous /* [in,out] [ref] */, + const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + const char *account_ou /* [in] [unique,charset(UTF16)] */, + const char *admin_account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */, + uint32_t join_flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */, + uint32_t unjoin_flags /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *NewMachineName /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t RenameOptions /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *name /* [in] [ref,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + enum wkssvc_NetValidateNameType name_type /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *domain_name /* [in] [ref,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t *num_ous /* [in,out] [ref] */, + const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *NewAlternateMachineName /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t Reserved /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t Reserved /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + const char *primary_name /* [in] [unique,charset(UTF16)] */, + const char *Account /* [in] [unique,charset(UTF16)] */, + struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, + uint32_t Reserved /* [in] */, + WERROR *werror); +NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [unique,charset(UTF16)] */, + enum wkssvc_ComputerNameType name_type /* [in] */, + uint32_t Reserved /* [in] */, + struct wkssvc_ComputerNamesCtr **ctr /* [out] [ref] */, + WERROR *werror); +#endif /* __CLI_WKSSVC__ */ diff --git a/librpc/gen_ndr/dfs.h b/librpc/gen_ndr/dfs.h new file mode 100644 index 0000000000..07548c3742 --- /dev/null +++ b/librpc/gen_ndr/dfs.h @@ -0,0 +1,582 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/misc.h" +#ifndef _HEADER_netdfs +#define _HEADER_netdfs + +#define DFS_STORAGE_STATES ( 0xf ) +enum dfs_ManagerVersion +#ifndef USE_UINT_ENUMS + { + DFS_MANAGER_VERSION_NT4=1, + DFS_MANAGER_VERSION_W2K=2, + DFS_MANAGER_VERSION_W2K3=4, + DFS_MANAGER_VERSION_W2K8=6 +} +#else + { __donnot_use_enum_dfs_ManagerVersion=0x7FFFFFFF} +#define DFS_MANAGER_VERSION_NT4 ( 1 ) +#define DFS_MANAGER_VERSION_W2K ( 2 ) +#define DFS_MANAGER_VERSION_W2K3 ( 4 ) +#define DFS_MANAGER_VERSION_W2K8 ( 6 ) +#endif +; + +struct dfs_Info0 { + char _empty_; +}; + +struct dfs_Info1 { + const char *path;/* [unique,charset(UTF16)] */ +}; + +/* bitmap dfs_VolumeState */ +#define DFS_VOLUME_STATE_OK ( 0x1 ) +#define DFS_VOLUME_STATE_INCONSISTENT ( 0x2 ) +#define DFS_VOLUME_STATE_OFFLINE ( 0x3 ) +#define DFS_VOLUME_STATE_ONLINE ( 0x4 ) +#define DFS_VOLUME_STATE_STANDALONE ( DFS_VOLUME_FLAVOR_STANDALONE ) +#define DFS_VOLUME_STATE_AD_BLOB ( DFS_VOLUME_FLAVOR_AD_BLOB ) + +struct dfs_Info2 { + const char *path;/* [unique,charset(UTF16)] */ + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t state; + uint32_t num_stores; +}; + +/* bitmap dfs_StorageState */ +#define DFS_STORAGE_STATE_OFFLINE ( 1 ) +#define DFS_STORAGE_STATE_ONLINE ( 2 ) +#define DFS_STORAGE_STATE_ACTIVE ( 4 ) + +struct dfs_StorageInfo { + uint32_t state; + const char *server;/* [unique,charset(UTF16)] */ + const char *share;/* [unique,charset(UTF16)] */ +}; + +struct dfs_Info3 { + const char *path;/* [unique,charset(UTF16)] */ + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t state; + uint32_t num_stores; + struct dfs_StorageInfo *stores;/* [unique,size_is(num_stores)] */ +}; + +struct dfs_Info4 { + const char *path;/* [unique,charset(UTF16)] */ + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t state; + uint32_t timeout; + struct GUID guid; + uint32_t num_stores; + struct dfs_StorageInfo *stores;/* [unique,size_is(num_stores)] */ +}; + +/* bitmap dfs_PropertyFlags */ +#define DFS_PROPERTY_FLAG_INSITE_REFERRALS ( 0x01 ) +#define DFS_PROPERTY_FLAG_ROOT_SCALABILITY ( 0x02 ) +#define DFS_PROPERTY_FLAG_SITE_COSTING ( 0x04 ) +#define DFS_PROPERTY_FLAG_TARGET_FAILBACK ( 0x08 ) +#define DFS_PROPERTY_FLAG_CLUSTER_ENABLED ( 0x10 ) + +struct dfs_Info5 { + const char *path;/* [unique,charset(UTF16)] */ + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t state; + uint32_t timeout; + struct GUID guid; + uint32_t flags; + uint32_t pktsize; + uint32_t num_stores; +}; + +enum dfs_Target_PriorityClass +#ifndef USE_UINT_ENUMS + { + DFS_INVALID_PRIORITY_CLASS=-1, + DFS_SITE_COST_NORMAL_PRIORITY_CLASS=0, + DFS_GLOBAL_HIGH_PRIORITY_CLASS=1, + DFS_SITE_COST_HIGH_PRIORITY_CLASS=2, + DFS_SITE_COST_LOW_PRIORITY_CLASS=3, + DFS_GLOBAL_LOW_PRIORITY_CLASS=4 +} +#else + { __donnot_use_enum_dfs_Target_PriorityClass=0x7FFFFFFF} +#define DFS_INVALID_PRIORITY_CLASS ( -1 ) +#define DFS_SITE_COST_NORMAL_PRIORITY_CLASS ( 0 ) +#define DFS_GLOBAL_HIGH_PRIORITY_CLASS ( 1 ) +#define DFS_SITE_COST_HIGH_PRIORITY_CLASS ( 2 ) +#define DFS_SITE_COST_LOW_PRIORITY_CLASS ( 3 ) +#define DFS_GLOBAL_LOW_PRIORITY_CLASS ( 4 ) +#endif +; + +struct dfs_Target_Priority { + enum dfs_Target_PriorityClass target_priority_class; + uint16_t target_priority_rank; + uint16_t reserved; +}; + +struct dfs_StorageInfo2 { + struct dfs_StorageInfo info; + struct dfs_Target_Priority target_priority; +}; + +struct dfs_Info6 { + const char *entry_path;/* [unique,charset(UTF16)] */ + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t state; + uint32_t timeout; + struct GUID guid; + uint32_t flags; + uint32_t pktsize; + uint16_t num_stores; + struct dfs_StorageInfo2 *stores;/* [unique,size_is(num_stores)] */ +}; + +struct dfs_Info7 { + struct GUID generation_guid; +}; + +struct dfs_Info100 { + const char *comment;/* [unique,charset(UTF16)] */ +}; + +struct dfs_Info101 { + uint32_t state; +}; + +struct dfs_Info102 { + uint32_t timeout; +}; + +struct dfs_Info103 { + uint32_t flags; +}; + +struct dfs_Info104 { + struct dfs_Target_Priority priority; +}; + +struct dfs_Info105 { + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t state; + uint32_t timeout; + uint32_t property_flag_mask; + uint32_t property_flags; +}; + +struct dfs_Info106 { + uint32_t state; + struct dfs_Target_Priority priority; +}; + +struct dfs_Info200 { + const char *dom_root;/* [unique,charset(UTF16)] */ +}; + +enum dfs_VolumeFlavor +#ifndef USE_UINT_ENUMS + { + DFS_VOLUME_FLAVOR_STANDALONE=0x100, + DFS_VOLUME_FLAVOR_AD_BLOB=0x200 +} +#else + { __donnot_use_enum_dfs_VolumeFlavor=0x7FFFFFFF} +#define DFS_VOLUME_FLAVOR_STANDALONE ( 0x100 ) +#define DFS_VOLUME_FLAVOR_AD_BLOB ( 0x200 ) +#endif +; + +struct dfs_Info300 { + enum dfs_VolumeFlavor flavor; + const char *dom_root;/* [unique,charset(UTF16)] */ +}; + +union dfs_Info { + struct dfs_Info0 *info0;/* [unique,case(0)] */ + struct dfs_Info1 *info1;/* [unique,case] */ + struct dfs_Info2 *info2;/* [unique,case(2)] */ + struct dfs_Info3 *info3;/* [unique,case(3)] */ + struct dfs_Info4 *info4;/* [unique,case(4)] */ + struct dfs_Info5 *info5;/* [unique,case(5)] */ + struct dfs_Info6 *info6;/* [unique,case(6)] */ + struct dfs_Info7 *info7;/* [unique,case(7)] */ + struct dfs_Info100 *info100;/* [unique,case(100)] */ + struct dfs_Info101 *info101;/* [unique,case(101)] */ + struct dfs_Info102 *info102;/* [unique,case(102)] */ + struct dfs_Info103 *info103;/* [unique,case(103)] */ + struct dfs_Info104 *info104;/* [unique,case(104)] */ + struct dfs_Info105 *info105;/* [unique,case(105)] */ + struct dfs_Info106 *info106;/* [unique,case(106)] */ +}; + +struct dfs_EnumArray1 { + uint32_t count; + struct dfs_Info1 *s;/* [unique,size_is(count)] */ +}; + +struct dfs_EnumArray2 { + uint32_t count; + struct dfs_Info2 *s;/* [unique,size_is(count)] */ +}; + +struct dfs_EnumArray3 { + uint32_t count; + struct dfs_Info3 *s;/* [unique,size_is(count)] */ +}; + +struct dfs_EnumArray4 { + uint32_t count; + struct dfs_Info4 *s;/* [unique,size_is(count)] */ +}; + +struct dfs_EnumArray5 { + uint32_t count; + struct dfs_Info5 *s;/* [unique,size_is(count)] */ +}; + +struct dfs_EnumArray6 { + uint32_t count; + struct dfs_Info6 *s;/* [unique,size_is(count)] */ +}; + +struct dfs_EnumArray200 { + uint32_t count; + struct dfs_Info200 *s;/* [unique,size_is(count)] */ +}; + +struct dfs_EnumArray300 { + uint32_t count; + struct dfs_Info300 *s;/* [unique,size_is(count)] */ +}; + +union dfs_EnumInfo { + struct dfs_EnumArray1 *info1;/* [unique,case] */ + struct dfs_EnumArray2 *info2;/* [unique,case(2)] */ + struct dfs_EnumArray3 *info3;/* [unique,case(3)] */ + struct dfs_EnumArray4 *info4;/* [unique,case(4)] */ + struct dfs_EnumArray5 *info5;/* [unique,case(5)] */ + struct dfs_EnumArray6 *info6;/* [unique,case(6)] */ + struct dfs_EnumArray200 *info200;/* [unique,case(200)] */ + struct dfs_EnumArray300 *info300;/* [unique,case(300)] */ +}; + +struct dfs_EnumStruct { + uint32_t level; + union dfs_EnumInfo e;/* [switch_is(level)] */ +}; + +struct dfs_UnknownStruct { + uint32_t unknown1; + const char *unknown2;/* [unique,charset(UTF16)] */ +}; + + +struct dfs_GetManagerVersion { + struct { + enum dfs_ManagerVersion *version;/* [ref] */ + } out; + +}; + + +struct dfs_Add { + struct { + const char *path;/* [ref,charset(UTF16)] */ + const char *server;/* [ref,charset(UTF16)] */ + const char *share;/* [unique,charset(UTF16)] */ + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct dfs_Remove { + struct { + const char *dfs_entry_path;/* [ref,charset(UTF16)] */ + const char *servername;/* [unique,charset(UTF16)] */ + const char *sharename;/* [unique,charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct dfs_SetInfo { + struct { + const char *dfs_entry_path;/* [charset(UTF16)] */ + const char *servername;/* [unique,charset(UTF16)] */ + const char *sharename;/* [unique,charset(UTF16)] */ + uint32_t level; + union dfs_Info *info;/* [ref,switch_is(level)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct dfs_GetInfo { + struct { + const char *dfs_entry_path;/* [charset(UTF16)] */ + const char *servername;/* [unique,charset(UTF16)] */ + const char *sharename;/* [unique,charset(UTF16)] */ + uint32_t level; + } in; + + struct { + union dfs_Info *info;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct dfs_Enum { + struct { + uint32_t level; + uint32_t bufsize; + struct dfs_EnumStruct *info;/* [unique] */ + uint32_t *total;/* [unique] */ + } in; + + struct { + struct dfs_EnumStruct *info;/* [unique] */ + uint32_t *total;/* [unique] */ + WERROR result; + } out; + +}; + + +struct dfs_Rename { + struct { + WERROR result; + } out; + +}; + + +struct dfs_Move { + struct { + WERROR result; + } out; + +}; + + +struct dfs_ManagerGetConfigInfo { + struct { + WERROR result; + } out; + +}; + + +struct dfs_ManagerSendSiteInfo { + struct { + WERROR result; + } out; + +}; + + +struct dfs_AddFtRoot { + struct { + const char *servername;/* [charset(UTF16)] */ + const char *dns_servername;/* [charset(UTF16)] */ + const char *dfsname;/* [charset(UTF16)] */ + const char *rootshare;/* [charset(UTF16)] */ + const char *comment;/* [charset(UTF16)] */ + const char *dfs_config_dn;/* [charset(UTF16)] */ + uint8_t unknown1; + uint32_t flags; + struct dfs_UnknownStruct **unknown2;/* [unique] */ + } in; + + struct { + struct dfs_UnknownStruct **unknown2;/* [unique] */ + WERROR result; + } out; + +}; + + +struct dfs_RemoveFtRoot { + struct { + const char *servername;/* [charset(UTF16)] */ + const char *dns_servername;/* [charset(UTF16)] */ + const char *dfsname;/* [charset(UTF16)] */ + const char *rootshare;/* [charset(UTF16)] */ + uint32_t flags; + struct dfs_UnknownStruct **unknown;/* [unique] */ + } in; + + struct { + struct dfs_UnknownStruct **unknown;/* [unique] */ + WERROR result; + } out; + +}; + + +struct dfs_AddStdRoot { + struct { + const char *servername;/* [charset(UTF16)] */ + const char *rootshare;/* [charset(UTF16)] */ + const char *comment;/* [charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct dfs_RemoveStdRoot { + struct { + const char *servername;/* [charset(UTF16)] */ + const char *rootshare;/* [charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct dfs_ManagerInitialize { + struct { + const char *servername;/* [ref,charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct dfs_AddStdRootForced { + struct { + const char *servername;/* [charset(UTF16)] */ + const char *rootshare;/* [charset(UTF16)] */ + const char *comment;/* [charset(UTF16)] */ + const char *store;/* [charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct dfs_GetDcAddress { + struct { + const char *servername;/* [charset(UTF16)] */ + const char **server_fullname;/* [ref,charset(UTF16)] */ + uint8_t *is_root;/* [ref] */ + uint32_t *ttl;/* [ref] */ + } in; + + struct { + const char **server_fullname;/* [ref,charset(UTF16)] */ + uint8_t *is_root;/* [ref] */ + uint32_t *ttl;/* [ref] */ + WERROR result; + } out; + +}; + + +struct dfs_SetDcAddress { + struct { + const char *servername;/* [charset(UTF16)] */ + const char *server_fullname;/* [charset(UTF16)] */ + uint32_t flags; + uint32_t ttl; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct dfs_FlushFtTable { + struct { + const char *servername;/* [charset(UTF16)] */ + const char *rootshare;/* [charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct dfs_Add2 { + struct { + WERROR result; + } out; + +}; + + +struct dfs_Remove2 { + struct { + WERROR result; + } out; + +}; + + +struct dfs_EnumEx { + struct { + const char *dfs_name;/* [charset(UTF16)] */ + uint32_t level; + uint32_t bufsize; + struct dfs_EnumStruct *info;/* [unique] */ + uint32_t *total;/* [unique] */ + } in; + + struct { + struct dfs_EnumStruct *info;/* [unique] */ + uint32_t *total;/* [unique] */ + WERROR result; + } out; + +}; + + +struct dfs_SetInfo2 { + struct { + WERROR result; + } out; + +}; + +#endif /* _HEADER_netdfs */ diff --git a/librpc/gen_ndr/drsblobs.h b/librpc/gen_ndr/drsblobs.h new file mode 100644 index 0000000000..692746468e --- /dev/null +++ b/librpc/gen_ndr/drsblobs.h @@ -0,0 +1,534 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/drsuapi.h" +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/samr.h" +#include "librpc/gen_ndr/lsa.h" +#ifndef _HEADER_drsblobs +#define _HEADER_drsblobs + +#define SUPPLEMENTAL_CREDENTIALS_PREFIX ( " " ) +enum drsuapi_DsAttributeId; + +enum lsa_TrustAuthType; + +struct replPropertyMetaData1 { + enum drsuapi_DsAttributeId attid; + uint32_t version; + NTTIME originating_change_time; + struct GUID originating_invocation_id; + uint64_t originating_usn; + uint64_t local_usn; +}; + +struct replPropertyMetaDataCtr1 { + uint32_t count; + uint32_t reserved; + struct replPropertyMetaData1 *array; +}; + +union replPropertyMetaDataCtr { + struct replPropertyMetaDataCtr1 ctr1;/* [case] */ +}/* [nodiscriminant] */; + +struct replPropertyMetaDataBlob { + uint32_t version; + uint32_t reserved; + union replPropertyMetaDataCtr ctr;/* [switch_is(version)] */ +}/* [public] */; + +struct replUpToDateVectorCtr1 { + uint32_t count; + uint32_t reserved; + struct drsuapi_DsReplicaCursor *cursors; +}; + +struct replUpToDateVectorCtr2 { + uint32_t count; + uint32_t reserved; + struct drsuapi_DsReplicaCursor2 *cursors; +}; + +union replUpToDateVectorCtr { + struct replUpToDateVectorCtr1 ctr1;/* [case] */ + struct replUpToDateVectorCtr2 ctr2;/* [case(2)] */ +}/* [nodiscriminant] */; + +struct replUpToDateVectorBlob { + uint32_t version; + uint32_t reserved; + union replUpToDateVectorCtr ctr;/* [switch_is(version)] */ +}/* [public] */; + +struct repsFromTo1OtherInfo { + uint32_t __dns_name_size;/* [value(strlen(dns_name)+1)] */ + const char *dns_name;/* [charset(DOS)] */ +}/* [gensize,public] */; + +struct repsFromTo1 { + uint32_t blobsize;/* [value(ndr_size_repsFromTo1(this,ndr->flags)+8)] */ + uint32_t consecutive_sync_failures; + NTTIME last_success; + NTTIME last_attempt; + WERROR result_last_attempt; + struct repsFromTo1OtherInfo *other_info;/* [relative] */ + uint32_t other_info_length;/* [value(ndr_size_repsFromTo1OtherInfo(other_info,ndr->flags))] */ + uint32_t replica_flags; + uint8_t schedule[84]; + uint32_t reserved; + struct drsuapi_DsReplicaHighWaterMark highwatermark; + struct GUID source_dsa_obj_guid; + struct GUID source_dsa_invocation_id; + struct GUID transport_guid; +}/* [gensize,public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +union repsFromTo { + struct repsFromTo1 ctr1;/* [case] */ +}/* [nodiscriminant] */; + +struct repsFromToBlob { + uint32_t version; + uint32_t reserved; + union repsFromTo ctr;/* [switch_is(version)] */ +}/* [public] */; + +struct partialAttributeSetCtr1 { + uint32_t count; + enum drsuapi_DsAttributeId *array; +}; + +union partialAttributeSetCtr { + struct partialAttributeSetCtr1 ctr1;/* [case] */ +}/* [nodiscriminant] */; + +struct partialAttributeSetBlob { + uint32_t version; + uint32_t reserved; + union partialAttributeSetCtr ctr;/* [switch_is(version)] */ +}/* [public] */; + +enum prefixMapVersion +#ifndef USE_UINT_ENUMS + { + PREFIX_MAP_VERSION_DSDB=0x44534442 +} +#else + { __donnot_use_enum_prefixMapVersion=0x7FFFFFFF} +#define PREFIX_MAP_VERSION_DSDB ( 0x44534442 ) +#endif +; + +union prefixMapCtr { + struct drsuapi_DsReplicaOIDMapping_Ctr dsdb;/* [case(PREFIX_MAP_VERSION_DSDB)] */ +}/* [nodiscriminant] */; + +struct prefixMapBlob { + enum prefixMapVersion version; + uint32_t reserved; + union prefixMapCtr ctr;/* [switch_is(version)] */ +}/* [public] */; + +union ldapControlDirSyncExtra { + struct replUpToDateVectorBlob uptodateness_vector;/* [default] */ +}/* [gensize,nodiscriminant] */; + +struct ldapControlDirSyncBlob { + uint32_t u1;/* [value(3)] */ + NTTIME time; + uint32_t u2; + uint32_t u3; + uint32_t extra_length;/* [value(ndr_size_ldapControlDirSyncExtra(&extra,extra.uptodateness_vector.version,0))] */ + struct drsuapi_DsReplicaHighWaterMark highwatermark; + struct GUID guid1; + union ldapControlDirSyncExtra extra;/* [switch_is(extra_length)] */ +}; + +struct ldapControlDirSyncCookie { + const char *msds;/* [value("MSDS"),charset(DOS)] */ + struct ldapControlDirSyncBlob blob;/* [subcontext(0)] */ +}/* [relative_base,public] */; + +struct supplementalCredentialsPackage { + uint16_t name_len;/* [value(2*strlen_m(name))] */ + uint16_t data_len;/* [value(strlen(data))] */ + uint16_t reserved; + const char *name;/* [charset(UTF16)] */ + const char *data;/* [charset(DOS)] */ +}; + +enum supplementalCredentialsSignature +#ifndef USE_UINT_ENUMS + { + SUPPLEMENTAL_CREDENTIALS_SIGNATURE=0x0050 +} +#else + { __donnot_use_enum_supplementalCredentialsSignature=0x7FFFFFFF} +#define SUPPLEMENTAL_CREDENTIALS_SIGNATURE ( 0x0050 ) +#endif +; + +struct supplementalCredentialsSubBlob { + const char *prefix;/* [value(SUPPLEMENTAL_CREDENTIALS_PREFIX),charset(UTF16)] */ + enum supplementalCredentialsSignature signature;/* [value(SUPPLEMENTAL_CREDENTIALS_SIGNATURE)] */ + uint16_t num_packages; + struct supplementalCredentialsPackage *packages; +}/* [gensize] */; + +struct supplementalCredentialsBlob { + uint32_t unknown1;/* [value(0)] */ + uint32_t __ndr_size;/* [value(ndr_size_supplementalCredentialsSubBlob(&sub,ndr->flags))] */ + uint32_t unknown2;/* [value(0)] */ + struct supplementalCredentialsSubBlob sub;/* [subcontext_size(__ndr_size),subcontext(0)] */ + uint8_t unknown3;/* [value(0)] */ +}/* [public] */; + +struct package_PackagesBlob { + const char ** names;/* [flag(LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING)] */ +}/* [public] */; + +struct package_PrimaryKerberosString { + uint16_t length;/* [value(2*strlen_m(string))] */ + uint16_t size;/* [value(2*strlen_m(string))] */ + const char * string;/* [relative,subcontext_size(size),subcontext(0),flag(LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING)] */ +}; + +struct package_PrimaryKerberosKey3 { + uint16_t reserved1;/* [value(0)] */ + uint16_t reserved2;/* [value(0)] */ + uint32_t reserved3;/* [value(0)] */ + uint32_t keytype; + uint32_t value_len;/* [value((value?value->length:0))] */ + DATA_BLOB *value;/* [relative,subcontext_size(value_len),subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */ +}; + +struct package_PrimaryKerberosCtr3 { + uint16_t num_keys; + uint16_t num_old_keys; + struct package_PrimaryKerberosString salt; + struct package_PrimaryKerberosKey3 *keys; + struct package_PrimaryKerberosKey3 *old_keys; + uint32_t padding1;/* [value(0)] */ + uint32_t padding2;/* [value(0)] */ + uint32_t padding3;/* [value(0)] */ + uint32_t padding4;/* [value(0)] */ + uint32_t padding5;/* [value(0)] */ +}; + +struct package_PrimaryKerberosKey4 { + uint16_t reserved1;/* [value(0)] */ + uint16_t reserved2;/* [value(0)] */ + uint32_t reserved3;/* [value(0)] */ + uint32_t iteration_count; + uint32_t keytype; + uint32_t value_len;/* [value((value?value->length:0))] */ + DATA_BLOB *value;/* [relative,subcontext_size(value_len),subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */ +}; + +struct package_PrimaryKerberosCtr4 { + uint16_t num_keys; + uint16_t num_service_keys;/* [value(0)] */ + uint16_t num_old_keys; + uint16_t num_older_keys; + struct package_PrimaryKerberosString salt; + uint32_t default_iteration_count; + struct package_PrimaryKerberosKey4 *keys; + struct package_PrimaryKerberosKey4 *service_keys; + struct package_PrimaryKerberosKey4 *old_keys; + struct package_PrimaryKerberosKey4 *older_keys; +}; + +union package_PrimaryKerberosCtr { + struct package_PrimaryKerberosCtr3 ctr3;/* [case(3)] */ + struct package_PrimaryKerberosCtr4 ctr4;/* [case(4)] */ +}/* [nodiscriminant] */; + +struct package_PrimaryKerberosBlob { + uint16_t version; + uint16_t flags;/* [value(0)] */ + union package_PrimaryKerberosCtr ctr;/* [switch_is(version)] */ +}/* [public] */; + +struct package_PrimaryCLEARTEXTBlob { + DATA_BLOB cleartext;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}/* [public] */; + +struct package_PrimaryWDigestHash { + uint8_t hash[16]; +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct package_PrimaryWDigestBlob { + uint16_t unknown1;/* [value(0x31)] */ + uint8_t unknown2;/* [value(0x01)] */ + uint8_t num_hashes; + uint32_t unknown3;/* [value(0)] */ + uint64_t uuknown4;/* [value(0)] */ + struct package_PrimaryWDigestHash *hashes; +}/* [public] */; + +struct AuthInfoNone { + uint32_t size;/* [value(0)] */ +}; + +struct AuthInfoNT4Owf { + uint32_t size;/* [value(16)] */ + struct samr_Password password; +}; + +struct AuthInfoClear { + uint32_t size; + uint8_t *password; +}; + +struct AuthInfoVersion { + uint32_t size;/* [value(4)] */ + uint32_t version; +}; + +union AuthInfo { + struct AuthInfoNone none;/* [case(TRUST_AUTH_TYPE_NONE)] */ + struct AuthInfoNT4Owf nt4owf;/* [case(TRUST_AUTH_TYPE_NT4OWF)] */ + struct AuthInfoClear clear;/* [case(TRUST_AUTH_TYPE_CLEAR)] */ + struct AuthInfoVersion version;/* [case(TRUST_AUTH_TYPE_VERSION)] */ +}/* [nodiscriminant] */; + +struct AuthenticationInformation { + NTTIME LastUpdateTime; + enum lsa_TrustAuthType AuthType; + union AuthInfo AuthInfo;/* [switch_is(AuthType)] */ + DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */ +}/* [public] */; + +struct AuthenticationInformationArray { + struct AuthenticationInformation *array;/* [size_is] */ +}/* [noprint,nopush,nopull] */; + +struct trustAuthInOutBlob { + uint32_t count; + struct AuthenticationInformationArray *current;/* [relative] */ + struct AuthenticationInformationArray *previous;/* [relative] */ +}/* [noprint,gensize,nopull,public,nopush] */; + +struct trustCurrentPasswords { + uint32_t count; + struct AuthenticationInformation **current;/* [relative] */ +}/* [gensize,public] */; + +struct trustDomainPasswords { + uint8_t confounder[512]; + struct trustCurrentPasswords outgoing;/* [subcontext_size(outgoing_size),subcontext(0)] */ + struct trustCurrentPasswords incoming;/* [subcontext_size(incoming_size),subcontext(0)] */ + uint32_t outgoing_size;/* [value(ndr_size_trustCurrentPasswords(&outgoing,ndr->flags))] */ + uint32_t incoming_size;/* [value(ndr_size_trustCurrentPasswords(&incoming,ndr->flags))] */ +}/* [public,nopull] */; + +struct DsCompressedChunk { + uint32_t marker; + DATA_BLOB data; +}/* [public] */; + +struct ExtendedErrorAString { + uint16_t __size; + const char *string;/* [unique,charset(DOS),size_is(__size)] */ +}; + +struct ExtendedErrorUString { + uint16_t __size; + const char *string;/* [unique,charset(UTF16),size_is(__size)] */ +}; + +struct ExtendedErrorBlob { + uint16_t length; + uint8_t *data;/* [unique,size_is(length)] */ +}; + +enum ExtendedErrorComputerNamePresent +#ifndef USE_UINT_ENUMS + { + EXTENDED_ERROR_COMPUTER_NAME_PRESENT=1, + EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT=2 +} +#else + { __donnot_use_enum_ExtendedErrorComputerNamePresent=0x7FFFFFFF} +#define EXTENDED_ERROR_COMPUTER_NAME_PRESENT ( 1 ) +#define EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT ( 2 ) +#endif +; + +union ExtendedErrorComputerNameU { + struct ExtendedErrorUString name;/* [case(EXTENDED_ERROR_COMPUTER_NAME_PRESENT)] */ +}/* [switch_type(ExtendedErrorComputerNamePresent)] */; + +struct ExtendedErrorComputerName { + enum ExtendedErrorComputerNamePresent present; + union ExtendedErrorComputerNameU n;/* [switch_is(present)] */ +}; + +enum ExtendedErrorParamType +#ifndef USE_UINT_ENUMS + { + EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING=1, + EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING=2, + EXTENDED_ERROR_PARAM_TYPE_UINT32=3, + EXTENDED_ERROR_PARAM_TYPE_UINT16=4, + EXTENDED_ERROR_PARAM_TYPE_UINT64=5, + EXTENDED_ERROR_PARAM_TYPE_NONE=6, + EXTENDED_ERROR_PARAM_TYPE_BLOB=7 +} +#else + { __donnot_use_enum_ExtendedErrorParamType=0x7FFFFFFF} +#define EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING ( 1 ) +#define EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING ( 2 ) +#define EXTENDED_ERROR_PARAM_TYPE_UINT32 ( 3 ) +#define EXTENDED_ERROR_PARAM_TYPE_UINT16 ( 4 ) +#define EXTENDED_ERROR_PARAM_TYPE_UINT64 ( 5 ) +#define EXTENDED_ERROR_PARAM_TYPE_NONE ( 6 ) +#define EXTENDED_ERROR_PARAM_TYPE_BLOB ( 7 ) +#endif +; + +union ExtendedErrorParamU { + struct ExtendedErrorAString a_string;/* [case(EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING)] */ + struct ExtendedErrorUString u_string;/* [case(EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING)] */ + uint32_t uint32;/* [case(EXTENDED_ERROR_PARAM_TYPE_UINT32)] */ + uint16_t uint16;/* [case(EXTENDED_ERROR_PARAM_TYPE_UINT16)] */ + uint64_t uint64;/* [case(EXTENDED_ERROR_PARAM_TYPE_UINT64)] */ + struct ExtendedErrorBlob blob;/* [case(EXTENDED_ERROR_PARAM_TYPE_BLOB)] */ +}/* [switch_type(ExtendedErrorParamType)] */; + +struct ExtendedErrorParam { + enum ExtendedErrorParamType type; + union ExtendedErrorParamU p;/* [switch_is(type)] */ +}; + +struct ExtendedErrorInfo { + struct ExtendedErrorInfo *next;/* [unique] */ + struct ExtendedErrorComputerName computer_name; + uint64_t pid; + NTTIME time; + uint32_t generating_component; + WERROR status; + uint16_t detection_location; + uint16_t flags; + uint16_t num_params; + struct ExtendedErrorParam *params;/* [size_is(num_params)] */ +}/* [public] */; + +struct ExtendedErrorInfoPtr { + struct ExtendedErrorInfo *info;/* [unique] */ +}; + + +struct decode_replPropertyMetaData { + struct { + struct replPropertyMetaDataBlob blob; + } in; + +}; + + +struct decode_replUpToDateVector { + struct { + struct replUpToDateVectorBlob blob; + } in; + +}; + + +struct decode_repsFromTo { + struct { + struct repsFromToBlob blob; + } in; + +}; + + +struct decode_partialAttributeSet { + struct { + struct partialAttributeSetBlob blob; + } in; + +}; + + +struct decode_prefixMap { + struct { + struct prefixMapBlob blob; + } in; + +}; + + +struct decode_ldapControlDirSync { + struct { + struct ldapControlDirSyncCookie cookie; + } in; + +}; + + +struct decode_supplementalCredentials { + struct { + struct supplementalCredentialsBlob blob; + } in; + +}; + + +struct decode_Packages { + struct { + struct package_PackagesBlob blob; + } in; + +}; + + +struct decode_PrimaryKerberos { + struct { + struct package_PrimaryKerberosBlob blob; + } in; + +}; + + +struct decode_PrimaryCLEARTEXT { + struct { + struct package_PrimaryCLEARTEXTBlob blob; + } in; + +}; + + +struct decode_PrimaryWDigest { + struct { + struct package_PrimaryWDigestBlob blob; + } in; + +}; + + +struct decode_trustAuthInOut { + struct { + struct trustAuthInOutBlob blob; + } in; + +}; + + +struct decode_trustDomainPasswords { + struct { + struct trustDomainPasswords blob; + } in; + +}; + + +struct decode_ExtendedErrorInfo { + struct { + struct ExtendedErrorInfoPtr ptr;/* [subcontext(0xFFFFFC01)] */ + } in; + +}; + +#endif /* _HEADER_drsblobs */ diff --git a/librpc/gen_ndr/drsuapi.h b/librpc/gen_ndr/drsuapi.h new file mode 100644 index 0000000000..ba01e8f226 --- /dev/null +++ b/librpc/gen_ndr/drsuapi.h @@ -0,0 +1,1770 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/security.h" +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/samr.h" +#ifndef _HEADER_drsuapi +#define _HEADER_drsuapi + +#define DRSUAPI_DS_BIND_GUID ( "e24d201a-4fd6-11d1-a3da-0000f875ae0d" ) +#define DRSUAPI_DS_BIND_GUID_W2K ( "6abec3d1-3054-41c8-a362-5a0c5b7d5d71" ) +#define DRSUAPI_DS_BIND_GUID_W2K3 ( "6afab99c-6e26-464a-975f-f58f105218bc" ) +#define DRSUAPI_DS_MEMBERSHIP_FLAG_GROUP_ATTR ( 0x1 ) +#define DRSUAPI_NTDSDSA_KRB5_SERVICE_GUID ( "E3514235-4B06-11D1-AB04-00C04FC2DCD2" ) +/* bitmap drsuapi_SupportedExtensions */ +#define DRSUAPI_SUPPORTED_EXTENSION_BASE ( 0x00000001 ) +#define DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION ( 0x00000002 ) +#define DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI ( 0x00000004 ) +#define DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2 ( 0x00000008 ) +#define DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS ( 0x00000010 ) +#define DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1 ( 0x00000020 ) +#define DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION ( 0x00000040 ) +#define DRSUAPI_SUPPORTED_EXTENSION_00000080 ( 0x00000080 ) +#define DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE ( 0x00000100 ) +#define DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2 ( 0x00000200 ) +#define DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION ( 0x00000400 ) +#define DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2 ( 0x00000800 ) +#define DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD ( 0x00001000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND ( 0x00002000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO ( 0x00004000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION ( 0x00008000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01 ( 0x00010000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP ( 0x00020000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY ( 0x00040000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3 ( 0x00080000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_00100000 ( 0x00100000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2 ( 0x00200000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6 ( 0x00400000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS ( 0x00800000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8 ( 0x01000000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5 ( 0x02000000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6 ( 0x04000000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3 ( 0x08000000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7 ( 0x08000000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT ( 0x08000000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS ( 0x10000000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_20000000 ( 0x20000000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_40000000 ( 0x40000000 ) +#define DRSUAPI_SUPPORTED_EXTENSION_80000000 ( 0x80000000 ) + +/* bitmap drsuapi_SupportedExtensionsExt */ +#define DRSUAPI_SUPPORTED_EXTENSION_ADAM ( 0x00000001 ) +#define DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2 ( 0x00000002 ) + +struct drsuapi_DsBindInfo24 { + uint32_t supported_extensions; + struct GUID site_guid; + uint32_t pid; +}; + +struct drsuapi_DsBindInfo28 { + uint32_t supported_extensions; + struct GUID site_guid; + uint32_t pid; + uint32_t repl_epoch; +}; + +struct drsuapi_DsBindInfo48 { + uint32_t supported_extensions; + struct GUID site_guid; + uint32_t pid; + uint32_t repl_epoch; + uint32_t supported_extensions_ext; + struct GUID config_dn_guid; +}; + +struct drsuapi_DsBindInfoFallBack { + DATA_BLOB info;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}; + +union drsuapi_DsBindInfo { + struct drsuapi_DsBindInfo24 info24;/* [subcontext(4),case(24)] */ + struct drsuapi_DsBindInfo28 info28;/* [subcontext(4),case(28)] */ + struct drsuapi_DsBindInfo48 info48;/* [subcontext(4),case(48)] */ + struct drsuapi_DsBindInfoFallBack FallBack;/* [subcontext(4),default] */ +}/* [nodiscriminant] */; + +struct drsuapi_DsBindInfoCtr { + uint32_t length;/* [range(1,10000)] */ + union drsuapi_DsBindInfo info;/* [switch_is(length)] */ +}; + +struct drsuapi_DsReplicaObjectIdentifier { + uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r,ndr->flags)-4)] */ + uint32_t __ndr_size_sid;/* [value(ndr_size_dom_sid28(&sid,ndr->flags))] */ + struct GUID guid; + struct dom_sid28 sid; + uint32_t __ndr_size_dn;/* [value(strlen_m(dn))] */ + const char *dn;/* [charset(UTF16),size_is(__ndr_size_dn+1)] */ +}/* [gensize,public] */; + +/* bitmap drsuapi_DsReplicaSyncOptions */ +#define DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION ( 0x00000001 ) +#define DRSUAPI_DS_REPLICA_SYNC_WRITEABLE ( 0x00000002 ) +#define DRSUAPI_DS_REPLICA_SYNC_PERIODIC ( 0x00000004 ) +#define DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING ( 0x00000008 ) +#define DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES ( 0x00000010 ) +#define DRSUAPI_DS_REPLICA_SYNC_FULL ( 0x00000020 ) +#define DRSUAPI_DS_REPLICA_SYNC_URGENT ( 0x00000040 ) +#define DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD ( 0x00000080 ) +#define DRSUAPI_DS_REPLICA_SYNC_FORCE ( 0x00000100 ) +#define DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE ( 0x00000200 ) +#define DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED ( 0x00000400 ) +#define DRSUAPI_DS_REPLICA_SYNC_TWO_WAY ( 0x00000800 ) +#define DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY ( 0x00001000 ) +#define DRSUAPI_DS_REPLICA_SYNC_INITIAL ( 0x00002000 ) +#define DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION ( 0x00004000 ) +#define DRSUAPI_DS_REPLICA_SYNC_ABANDONED ( 0x00008000 ) +#define DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS ( 0x00010000 ) +#define DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET ( 0x00020000 ) +#define DRSUAPI_DS_REPLICA_SYNC_REQUEUE ( 0x00040000 ) +#define DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION ( 0x00080000 ) +#define DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA ( 0x00100000 ) +#define DRSUAPI_DS_REPLICA_SYNC_CRITICAL ( 0x00200000 ) +#define DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS ( 0x00400000 ) +#define DRSUAPI_DS_REPLICA_SYNC_PREEMPTED ( 0x00800000 ) + +struct drsuapi_DsReplicaSyncRequest1 { + struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [unique] */ + struct GUID source_dsa_guid; + const char * other_info;/* [unique,flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t options; +}; + +union drsuapi_DsReplicaSyncRequest { + struct drsuapi_DsReplicaSyncRequest1 req1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsReplicaHighWaterMark { + uint64_t tmp_highest_usn; + uint64_t reserved_usn; + uint64_t highest_usn; +}/* [public] */; + +struct drsuapi_DsReplicaCursor { + struct GUID source_dsa_invocation_id; + uint64_t highest_usn; +}/* [public] */; + +struct drsuapi_DsReplicaCursorCtrEx { + uint32_t version;/* [value] */ + uint32_t reserved1;/* [value(0)] */ + uint32_t count;/* [range(0,0x100000)] */ + uint32_t reserved2;/* [value(0)] */ + struct drsuapi_DsReplicaCursor *cursors;/* [size_is(count)] */ +}; + +/* bitmap drsuapi_DsReplicaNeighbourFlags */ +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE ( 0x00000010 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP ( 0x00000020 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS ( 0x00000040 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT ( 0x00000080 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC ( 0x00000200 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS ( 0x00000800 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS ( 0x00001000 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET ( 0x00002000 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED ( 0x00200000 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED ( 0x01000000 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS ( 0x04000000 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC ( 0x08000000 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES ( 0x10000000 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS ( 0x20000000 ) +#define DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET ( 0x40000000 ) + +enum drsuapi_DsExtendedOperation +#ifndef USE_UINT_ENUMS + { + DRSUAPI_EXOP_NONE=0x00000000, + DRSUAPI_EXOP_FSMO_REQ_ROLE=0x00000001, + DRSUAPI_EXOP_FSMO_RID_ALLOC=0x00000002, + DRSUAPI_EXOP_FSMO_RID_REQ_ROLE=0x00000003, + DRSUAPI_EXOP_FSMO_REQ_PDC=0x00000004, + DRSUAPI_EXOP_FSMO_ABANDON_ROLE=0x00000005, + DRSUAPI_EXOP_REPL_OBJ=0x00000006, + DRSUAPI_EXOP_REPL_SECRET=0x00000007 +} +#else + { __donnot_use_enum_drsuapi_DsExtendedOperation=0x7FFFFFFF} +#define DRSUAPI_EXOP_NONE ( 0x00000000 ) +#define DRSUAPI_EXOP_FSMO_REQ_ROLE ( 0x00000001 ) +#define DRSUAPI_EXOP_FSMO_RID_ALLOC ( 0x00000002 ) +#define DRSUAPI_EXOP_FSMO_RID_REQ_ROLE ( 0x00000003 ) +#define DRSUAPI_EXOP_FSMO_REQ_PDC ( 0x00000004 ) +#define DRSUAPI_EXOP_FSMO_ABANDON_ROLE ( 0x00000005 ) +#define DRSUAPI_EXOP_REPL_OBJ ( 0x00000006 ) +#define DRSUAPI_EXOP_REPL_SECRET ( 0x00000007 ) +#endif +; + +enum drsuapi_DsExtendedError +#ifndef USE_UINT_ENUMS + { + DRSUAPI_EXOP_ERR_NONE=0x00000000, + DRSUAPI_EXOP_ERR_SUCCESS=0x00000001, + DRSUAPI_EXOP_ERR_UNKNOWN_OP=0x00000002, + DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER=0x00000003, + DRSUAPI_EXOP_ERR_UPDATE_ERR=0x00000004, + DRSUAPI_EXOP_ERR_EXCEPTION=0x00000005, + DRSUAPI_EXOP_ERR_UNKNOWN_CALLER=0x00000006, + DRSUAPI_EXOP_ERR_RID_ALLOC=0x00000007, + DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED=0x00000008, + DRSUAPI_EXOP_ERR_FMSO_PENDING_OP=0x00000009, + DRSUAPI_EXOP_ERR_MISMATCH=0x0000000A, + DRSUAPI_EXOP_ERR_COULDNT_CONTACT=0x0000000B, + DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES=0x0000000C, + DRSUAPI_EXOP_ERR_DIR_ERROR=0x0000000D, + DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS=0x0000000E, + DRSUAPI_EXOP_ERR_ACCESS_DENIED=0x0000000F, + DRSUAPI_EXOP_ERR_PARAM_ERROR=0x00000010 +} +#else + { __donnot_use_enum_drsuapi_DsExtendedError=0x7FFFFFFF} +#define DRSUAPI_EXOP_ERR_NONE ( 0x00000000 ) +#define DRSUAPI_EXOP_ERR_SUCCESS ( 0x00000001 ) +#define DRSUAPI_EXOP_ERR_UNKNOWN_OP ( 0x00000002 ) +#define DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER ( 0x00000003 ) +#define DRSUAPI_EXOP_ERR_UPDATE_ERR ( 0x00000004 ) +#define DRSUAPI_EXOP_ERR_EXCEPTION ( 0x00000005 ) +#define DRSUAPI_EXOP_ERR_UNKNOWN_CALLER ( 0x00000006 ) +#define DRSUAPI_EXOP_ERR_RID_ALLOC ( 0x00000007 ) +#define DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED ( 0x00000008 ) +#define DRSUAPI_EXOP_ERR_FMSO_PENDING_OP ( 0x00000009 ) +#define DRSUAPI_EXOP_ERR_MISMATCH ( 0x0000000A ) +#define DRSUAPI_EXOP_ERR_COULDNT_CONTACT ( 0x0000000B ) +#define DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES ( 0x0000000C ) +#define DRSUAPI_EXOP_ERR_DIR_ERROR ( 0x0000000D ) +#define DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS ( 0x0000000E ) +#define DRSUAPI_EXOP_ERR_ACCESS_DENIED ( 0x0000000F ) +#define DRSUAPI_EXOP_ERR_PARAM_ERROR ( 0x00000010 ) +#endif +; + +struct drsuapi_DsGetNCChangesRequest5 { + struct GUID destination_dsa_guid; + struct GUID source_dsa_invocation_id; + struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [ref] */ + struct drsuapi_DsReplicaHighWaterMark highwatermark; + struct drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;/* [unique] */ + uint32_t replica_flags; + uint32_t max_object_count; + uint32_t max_ndr_size; + enum drsuapi_DsExtendedOperation extended_op; + uint64_t fsmo_info; +}; + +struct drsuapi_DsReplicaOID { + uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaOID_oid(oid,0)),range(0,10000)] */ + const char *oid;/* [unique,charset(DOS),size_is(__ndr_size)] */ +}/* [nopush,nopull] */; + +struct drsuapi_DsReplicaOIDMapping { + uint32_t id_prefix; + struct drsuapi_DsReplicaOID oid; +}; + +struct drsuapi_DsReplicaOIDMapping_Ctr { + uint32_t num_mappings;/* [range(0,0x100000)] */ + struct drsuapi_DsReplicaOIDMapping *mappings;/* [unique,size_is(num_mappings)] */ +}/* [public] */; + +enum drsuapi_DsObjectClassId +#ifndef USE_UINT_ENUMS + { + DRSUAPI_OBJECTCLASS_top=0x00010000, + DRSUAPI_OBJECTCLASS_classSchema=0x0003000d, + DRSUAPI_OBJECTCLASS_attributeSchema=0x0003000e +} +#else + { __donnot_use_enum_drsuapi_DsObjectClassId=0x7FFFFFFF} +#define DRSUAPI_OBJECTCLASS_top ( 0x00010000 ) +#define DRSUAPI_OBJECTCLASS_classSchema ( 0x0003000d ) +#define DRSUAPI_OBJECTCLASS_attributeSchema ( 0x0003000e ) +#endif +; + +enum drsuapi_DsAttributeId +#ifndef USE_UINT_ENUMS + { + DRSUAPI_ATTRIBUTE_objectClass=0x00000000, + DRSUAPI_ATTRIBUTE_description=0x0000000d, + DRSUAPI_ATTRIBUTE_member=0x0000001f, + DRSUAPI_ATTRIBUTE_instanceType=0x00020001, + DRSUAPI_ATTRIBUTE_whenCreated=0x00020002, + DRSUAPI_ATTRIBUTE_hasMasterNCs=0x0002000e, + DRSUAPI_ATTRIBUTE_governsID=0x00020016, + DRSUAPI_ATTRIBUTE_attributeID=0x0002001e, + DRSUAPI_ATTRIBUTE_attributeSyntax=0x00020020, + DRSUAPI_ATTRIBUTE_isSingleValued=0x00020021, + DRSUAPI_ATTRIBUTE_rangeLower=0x00020022, + DRSUAPI_ATTRIBUTE_rangeUpper=0x00020023, + DRSUAPI_ATTRIBUTE_dMDLocation=0x00020024, + DRSUAPI_ATTRIBUTE_objectVersion=0x0002004c, + DRSUAPI_ATTRIBUTE_invocationId=0x00020073, + DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly=0x000200a9, + DRSUAPI_ATTRIBUTE_adminDisplayName=0x000200c2, + DRSUAPI_ATTRIBUTE_adminDescription=0x000200e2, + DRSUAPI_ATTRIBUTE_oMSyntax=0x000200e7, + DRSUAPI_ATTRIBUTE_ntSecurityDescriptor=0x00020119, + DRSUAPI_ATTRIBUTE_searchFlags=0x0002014e, + DRSUAPI_ATTRIBUTE_lDAPDisplayName=0x000201cc, + DRSUAPI_ATTRIBUTE_name=0x00090001, + DRSUAPI_ATTRIBUTE_userAccountControl=0x00090008, + DRSUAPI_ATTRIBUTE_currentValue=0x0009001b, + DRSUAPI_ATTRIBUTE_homeDirectory=0x0009002c, + DRSUAPI_ATTRIBUTE_homeDrive=0x0009002d, + DRSUAPI_ATTRIBUTE_scriptPath=0x0009003e, + DRSUAPI_ATTRIBUTE_profilePath=0x0009008b, + DRSUAPI_ATTRIBUTE_objectSid=0x00090092, + DRSUAPI_ATTRIBUTE_schemaIDGUID=0x00090094, + DRSUAPI_ATTRIBUTE_dBCSPwd=0x00090037, + DRSUAPI_ATTRIBUTE_logonHours=0x00090040, + DRSUAPI_ATTRIBUTE_userWorkstations=0x00090056, + DRSUAPI_ATTRIBUTE_unicodePwd=0x0009005a, + DRSUAPI_ATTRIBUTE_ntPwdHistory=0x0009005e, + DRSUAPI_ATTRIBUTE_priorValue=0x00090064, + DRSUAPI_ATTRIBUTE_supplementalCredentials=0x0009007d, + DRSUAPI_ATTRIBUTE_trustAuthIncoming=0x00090081, + DRSUAPI_ATTRIBUTE_trustAuthOutgoing=0x00090087, + DRSUAPI_ATTRIBUTE_lmPwdHistory=0x000900a0, + DRSUAPI_ATTRIBUTE_sAMAccountName=0x000900dd, + DRSUAPI_ATTRIBUTE_sAMAccountType=0x0009012e, + DRSUAPI_ATTRIBUTE_fSMORoleOwner=0x00090171, + DRSUAPI_ATTRIBUTE_systemFlags=0x00090177, + DRSUAPI_ATTRIBUTE_serverReference=0x00090203, + DRSUAPI_ATTRIBUTE_serverReferenceBL=0x00090204, + DRSUAPI_ATTRIBUTE_initialAuthIncoming=0x0009021b, + DRSUAPI_ATTRIBUTE_initialAuthOutgoing=0x0009021c, + DRSUAPI_ATTRIBUTE_wellKnownObjects=0x0009026a, + DRSUAPI_ATTRIBUTE_dNSHostName=0x0009026b, + DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet=0x0009027f, + DRSUAPI_ATTRIBUTE_userPrincipalName=0x00090290, + DRSUAPI_ATTRIBUTE_groupType=0x000902ee, + DRSUAPI_ATTRIBUTE_servicePrincipalName=0x00090303, + DRSUAPI_ATTRIBUTE_objectCategory=0x0009030e, + DRSUAPI_ATTRIBUTE_gPLink=0x0009037b, + DRSUAPI_ATTRIBUTE_msDS_Behavior_Version=0x000905b3, + DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber=0x000906f6, + DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs=0x0009071c, + DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs=0x0009072c +} +#else + { __donnot_use_enum_drsuapi_DsAttributeId=0x7FFFFFFF} +#define DRSUAPI_ATTRIBUTE_objectClass ( 0x00000000 ) +#define DRSUAPI_ATTRIBUTE_description ( 0x0000000d ) +#define DRSUAPI_ATTRIBUTE_member ( 0x0000001f ) +#define DRSUAPI_ATTRIBUTE_instanceType ( 0x00020001 ) +#define DRSUAPI_ATTRIBUTE_whenCreated ( 0x00020002 ) +#define DRSUAPI_ATTRIBUTE_hasMasterNCs ( 0x0002000e ) +#define DRSUAPI_ATTRIBUTE_governsID ( 0x00020016 ) +#define DRSUAPI_ATTRIBUTE_attributeID ( 0x0002001e ) +#define DRSUAPI_ATTRIBUTE_attributeSyntax ( 0x00020020 ) +#define DRSUAPI_ATTRIBUTE_isSingleValued ( 0x00020021 ) +#define DRSUAPI_ATTRIBUTE_rangeLower ( 0x00020022 ) +#define DRSUAPI_ATTRIBUTE_rangeUpper ( 0x00020023 ) +#define DRSUAPI_ATTRIBUTE_dMDLocation ( 0x00020024 ) +#define DRSUAPI_ATTRIBUTE_objectVersion ( 0x0002004c ) +#define DRSUAPI_ATTRIBUTE_invocationId ( 0x00020073 ) +#define DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly ( 0x000200a9 ) +#define DRSUAPI_ATTRIBUTE_adminDisplayName ( 0x000200c2 ) +#define DRSUAPI_ATTRIBUTE_adminDescription ( 0x000200e2 ) +#define DRSUAPI_ATTRIBUTE_oMSyntax ( 0x000200e7 ) +#define DRSUAPI_ATTRIBUTE_ntSecurityDescriptor ( 0x00020119 ) +#define DRSUAPI_ATTRIBUTE_searchFlags ( 0x0002014e ) +#define DRSUAPI_ATTRIBUTE_lDAPDisplayName ( 0x000201cc ) +#define DRSUAPI_ATTRIBUTE_name ( 0x00090001 ) +#define DRSUAPI_ATTRIBUTE_userAccountControl ( 0x00090008 ) +#define DRSUAPI_ATTRIBUTE_currentValue ( 0x0009001b ) +#define DRSUAPI_ATTRIBUTE_homeDirectory ( 0x0009002c ) +#define DRSUAPI_ATTRIBUTE_homeDrive ( 0x0009002d ) +#define DRSUAPI_ATTRIBUTE_scriptPath ( 0x0009003e ) +#define DRSUAPI_ATTRIBUTE_profilePath ( 0x0009008b ) +#define DRSUAPI_ATTRIBUTE_objectSid ( 0x00090092 ) +#define DRSUAPI_ATTRIBUTE_schemaIDGUID ( 0x00090094 ) +#define DRSUAPI_ATTRIBUTE_dBCSPwd ( 0x00090037 ) +#define DRSUAPI_ATTRIBUTE_logonHours ( 0x00090040 ) +#define DRSUAPI_ATTRIBUTE_userWorkstations ( 0x00090056 ) +#define DRSUAPI_ATTRIBUTE_unicodePwd ( 0x0009005a ) +#define DRSUAPI_ATTRIBUTE_ntPwdHistory ( 0x0009005e ) +#define DRSUAPI_ATTRIBUTE_priorValue ( 0x00090064 ) +#define DRSUAPI_ATTRIBUTE_supplementalCredentials ( 0x0009007d ) +#define DRSUAPI_ATTRIBUTE_trustAuthIncoming ( 0x00090081 ) +#define DRSUAPI_ATTRIBUTE_trustAuthOutgoing ( 0x00090087 ) +#define DRSUAPI_ATTRIBUTE_lmPwdHistory ( 0x000900a0 ) +#define DRSUAPI_ATTRIBUTE_sAMAccountName ( 0x000900dd ) +#define DRSUAPI_ATTRIBUTE_sAMAccountType ( 0x0009012e ) +#define DRSUAPI_ATTRIBUTE_fSMORoleOwner ( 0x00090171 ) +#define DRSUAPI_ATTRIBUTE_systemFlags ( 0x00090177 ) +#define DRSUAPI_ATTRIBUTE_serverReference ( 0x00090203 ) +#define DRSUAPI_ATTRIBUTE_serverReferenceBL ( 0x00090204 ) +#define DRSUAPI_ATTRIBUTE_initialAuthIncoming ( 0x0009021b ) +#define DRSUAPI_ATTRIBUTE_initialAuthOutgoing ( 0x0009021c ) +#define DRSUAPI_ATTRIBUTE_wellKnownObjects ( 0x0009026a ) +#define DRSUAPI_ATTRIBUTE_dNSHostName ( 0x0009026b ) +#define DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet ( 0x0009027f ) +#define DRSUAPI_ATTRIBUTE_userPrincipalName ( 0x00090290 ) +#define DRSUAPI_ATTRIBUTE_groupType ( 0x000902ee ) +#define DRSUAPI_ATTRIBUTE_servicePrincipalName ( 0x00090303 ) +#define DRSUAPI_ATTRIBUTE_objectCategory ( 0x0009030e ) +#define DRSUAPI_ATTRIBUTE_gPLink ( 0x0009037b ) +#define DRSUAPI_ATTRIBUTE_msDS_Behavior_Version ( 0x000905b3 ) +#define DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber ( 0x000906f6 ) +#define DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs ( 0x0009071c ) +#define DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs ( 0x0009072c ) +#endif +; + +struct drsuapi_DsPartialAttributeSet { + uint32_t version;/* [value] */ + uint32_t reserved1;/* [value(0)] */ + uint32_t num_attids;/* [range(1,0x100000)] */ + enum drsuapi_DsAttributeId *attids;/* [size_is(num_attids)] */ +}; + +struct drsuapi_DsGetNCChangesRequest8 { + struct GUID destination_dsa_guid; + struct GUID source_dsa_invocation_id; + struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [ref] */ + struct drsuapi_DsReplicaHighWaterMark highwatermark; + struct drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;/* [unique] */ + uint32_t replica_flags; + uint32_t max_object_count; + uint32_t max_ndr_size; + enum drsuapi_DsExtendedOperation extended_op; + uint64_t fsmo_info; + struct drsuapi_DsPartialAttributeSet *partial_attribute_set;/* [unique] */ + struct drsuapi_DsPartialAttributeSet *partial_attribute_set_ex;/* [unique] */ + struct drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; +}; + +union drsuapi_DsGetNCChangesRequest { + struct drsuapi_DsGetNCChangesRequest5 req5;/* [case(5)] */ + struct drsuapi_DsGetNCChangesRequest8 req8;/* [case(8)] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsReplicaCursor2 { + struct GUID source_dsa_invocation_id; + uint64_t highest_usn; + NTTIME last_sync_success; +}/* [public] */; + +struct drsuapi_DsReplicaCursor2CtrEx { + uint32_t version;/* [value(2)] */ + uint32_t reserved1;/* [value(0)] */ + uint32_t count;/* [range(0,0x100000)] */ + uint32_t reserved2;/* [value(0)] */ + struct drsuapi_DsReplicaCursor2 *cursors;/* [size_is(count)] */ +}; + +struct drsuapi_DsAttributeValue { + uint32_t __ndr_size;/* [value(ndr_size_DATA_BLOB(0,blob,0)),range(0,10485760)] */ + DATA_BLOB *blob;/* [unique] */ +}; + +struct drsuapi_DsAttributeValueCtr { + uint32_t num_values;/* [range(0,10485760)] */ + struct drsuapi_DsAttributeValue *values;/* [unique,size_is(num_values)] */ +}; + +struct drsuapi_DsReplicaObjectIdentifier3 { + uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r,ndr->flags))] */ + uint32_t __ndr_size_sid;/* [value(ndr_size_dom_sid28(&sid,ndr->flags))] */ + struct GUID guid; + struct dom_sid28 sid; + uint32_t __ndr_size_dn;/* [value(strlen_m(dn))] */ + const char *dn;/* [charset(UTF16)] */ +}/* [gensize,public] */; + +struct drsuapi_DsReplicaObjectIdentifier3Binary { + uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r,ndr->flags))] */ + uint32_t __ndr_size_sid;/* [value(ndr_size_dom_sid28(&sid,ndr->flags))] */ + struct GUID guid; + struct dom_sid28 sid; + uint32_t __ndr_size_dn;/* [value(strlen_m(dn))] */ + const char *dn;/* [charset(UTF16)] */ + uint32_t __ndr_size_binary;/* [value(binary.length+4)] */ + DATA_BLOB binary;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}/* [gensize,public] */; + +struct drsuapi_DsReplicaAttribute { + enum drsuapi_DsAttributeId attid; + struct drsuapi_DsAttributeValueCtr value_ctr; +}/* [public] */; + +struct drsuapi_DsReplicaAttributeCtr { + uint32_t num_attributes;/* [range(0,1048576)] */ + struct drsuapi_DsReplicaAttribute *attributes;/* [unique,size_is(num_attributes)] */ +}; + +/* bitmap drsuapi_DsReplicaObjectFlags */ +#define DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER ( 0x00000001 ) +#define DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC ( 0x00000002 ) +#define DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY ( 0x00010000 ) + +struct drsuapi_DsReplicaObject { + struct drsuapi_DsReplicaObjectIdentifier *identifier;/* [unique] */ + uint32_t flags; + struct drsuapi_DsReplicaAttributeCtr attribute_ctr; +}/* [public] */; + +struct drsuapi_DsReplicaMetaData { + uint32_t version; + NTTIME originating_change_time; + struct GUID originating_invocation_id; + uint64_t originating_usn; +}; + +struct drsuapi_DsReplicaMetaDataCtr { + uint32_t count;/* [range(0,1048576)] */ + struct drsuapi_DsReplicaMetaData *meta_data;/* [size_is(count)] */ +}/* [public] */; + +struct drsuapi_DsReplicaObjectListItemEx { + struct drsuapi_DsReplicaObjectListItemEx *next_object;/* [unique] */ + struct drsuapi_DsReplicaObject object; + uint32_t is_nc_prefix; + struct GUID *parent_object_guid;/* [unique] */ + struct drsuapi_DsReplicaMetaDataCtr *meta_data_ctr;/* [unique] */ +}/* [noprint,public] */; + +struct drsuapi_DsGetNCChangesCtr1 { + struct GUID source_dsa_guid; + struct GUID source_dsa_invocation_id; + struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [unique] */ + struct drsuapi_DsReplicaHighWaterMark old_highwatermark; + struct drsuapi_DsReplicaHighWaterMark new_highwatermark; + struct drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;/* [unique] */ + struct drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; + enum drsuapi_DsExtendedError extended_ret; + uint32_t object_count; + uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->flags)+55)] */ + struct drsuapi_DsReplicaObjectListItemEx *first_object;/* [unique] */ + uint32_t more_data; +}/* [gensize,public] */; + +/* bitmap drsuapi_DsLinkedAttributeFlags */ +#define DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE ( 0x00000001 ) + +struct drsuapi_DsReplicaLinkedAttribute { + struct drsuapi_DsReplicaObjectIdentifier *identifier;/* [unique] */ + enum drsuapi_DsAttributeId attid; + struct drsuapi_DsAttributeValue value; + uint32_t flags; + NTTIME originating_add_time; + struct drsuapi_DsReplicaMetaData meta_data; +}/* [public] */; + +struct drsuapi_DsGetNCChangesCtr6 { + struct GUID source_dsa_guid; + struct GUID source_dsa_invocation_id; + struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [unique] */ + struct drsuapi_DsReplicaHighWaterMark old_highwatermark; + struct drsuapi_DsReplicaHighWaterMark new_highwatermark; + struct drsuapi_DsReplicaCursor2CtrEx *uptodateness_vector;/* [unique] */ + struct drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; + enum drsuapi_DsExtendedError extended_ret; + uint32_t object_count; + uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->flags)+55)] */ + struct drsuapi_DsReplicaObjectListItemEx *first_object;/* [unique] */ + uint32_t more_data; + uint32_t nc_object_count; + uint32_t nc_linked_attributes_count; + uint32_t linked_attributes_count;/* [range(0,1048576)] */ + struct drsuapi_DsReplicaLinkedAttribute *linked_attributes;/* [unique,size_is(linked_attributes_count)] */ + WERROR drs_error; +}/* [gensize,public] */; + +struct drsuapi_DsGetNCChangesCtr1TS { + struct drsuapi_DsGetNCChangesCtr1 ctr1;/* [subcontext(0xFFFFFC01)] */ +}/* [public] */; + +struct drsuapi_DsGetNCChangesCtr6TS { + struct drsuapi_DsGetNCChangesCtr6 ctr6;/* [subcontext(0xFFFFFC01)] */ +}/* [public] */; + +struct drsuapi_DsGetNCChangesMSZIPCtr1 { + uint32_t decompressed_length; + uint32_t compressed_length; + struct drsuapi_DsGetNCChangesCtr1TS *ts;/* [unique,compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */ +}/* [nopush] */; + +struct drsuapi_DsGetNCChangesMSZIPCtr6 { + uint32_t decompressed_length; + uint32_t compressed_length; + struct drsuapi_DsGetNCChangesCtr6TS *ts;/* [unique,compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */ +}/* [nopush] */; + +struct drsuapi_DsGetNCChangesXPRESSCtr1 { + uint32_t decompressed_length; + uint32_t compressed_length; + struct drsuapi_DsGetNCChangesCtr1TS *ts;/* [unique,compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */ +}/* [nopush] */; + +struct drsuapi_DsGetNCChangesXPRESSCtr6 { + uint32_t decompressed_length; + uint32_t compressed_length; + struct drsuapi_DsGetNCChangesCtr6TS *ts;/* [unique,compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */ +}/* [nopush] */; + +enum drsuapi_DsGetNCChangesCompressionType +#ifndef USE_UINT_ENUMS + { + DRSUAPI_COMPRESSION_TYPE_MSZIP=2, + DRSUAPI_COMPRESSION_TYPE_XPRESS=3 +} +#else + { __donnot_use_enum_drsuapi_DsGetNCChangesCompressionType=0x7FFFFFFF} +#define DRSUAPI_COMPRESSION_TYPE_MSZIP ( 2 ) +#define DRSUAPI_COMPRESSION_TYPE_XPRESS ( 3 ) +#endif +; + +union drsuapi_DsGetNCChangesCompressedCtr { + struct drsuapi_DsGetNCChangesMSZIPCtr1 mszip1;/* [case(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] */ + struct drsuapi_DsGetNCChangesMSZIPCtr6 mszip6;/* [case(6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] */ + struct drsuapi_DsGetNCChangesXPRESSCtr1 xpress1;/* [case(1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] */ + struct drsuapi_DsGetNCChangesXPRESSCtr6 xpress6;/* [case(6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] */ +}/* [nodiscriminant,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct drsuapi_DsGetNCChangesCtr2 { + struct drsuapi_DsGetNCChangesMSZIPCtr1 mszip1; +}; + +struct drsuapi_DsGetNCChangesCtr7 { + int32_t level;/* [range(0,6)] */ + enum drsuapi_DsGetNCChangesCompressionType type;/* [range(2,3)] */ + union drsuapi_DsGetNCChangesCompressedCtr ctr;/* [switch_is(level|(type<<16))] */ +}; + +union drsuapi_DsGetNCChangesCtr { + struct drsuapi_DsGetNCChangesCtr1 ctr1;/* [case] */ + struct drsuapi_DsGetNCChangesCtr2 ctr2;/* [case(2)] */ + struct drsuapi_DsGetNCChangesCtr6 ctr6;/* [case(6)] */ + struct drsuapi_DsGetNCChangesCtr7 ctr7;/* [case(7)] */ +}/* [switch_type(int32)] */; + +/* bitmap drsuapi_DsReplicaUpdateRefsOptions */ +#define DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION ( 0x00000001 ) +#define DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE ( 0x00000002 ) +#define DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE ( 0x00000004 ) +#define DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE ( 0x00000008 ) +#define DRSUAPI_DS_REPLICA_UPDATE_0x00000010 ( 0x00000010 ) + +struct drsuapi_DsReplicaUpdateRefsRequest1 { + struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [ref] */ + const char *dest_dsa_dns_name;/* [ref,charset(DOS)] */ + struct GUID dest_dsa_guid; + uint32_t options; +}; + +union drsuapi_DsReplicaUpdateRefsRequest { + struct drsuapi_DsReplicaUpdateRefsRequest1 req1;/* [case] */ +}/* [switch_type(int32)] */; + +/* bitmap drsuapi_DsReplicaAddOptions */ +#define DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION ( 0x00000001 ) +#define DRSUAPI_DS_REPLICA_ADD_WRITEABLE ( 0x00000002 ) + +/* bitmap drsuapi_DsReplicaDeleteOptions */ +#define DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION ( 0x00000001 ) +#define DRSUAPI_DS_REPLICA_DELETE_WRITEABLE ( 0x00000002 ) + +/* bitmap drsuapi_DsReplicaModifyOptions */ +#define DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION ( 0x00000001 ) +#define DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE ( 0x00000002 ) + +enum drsuapi_DsMembershipType +#ifndef USE_UINT_ENUMS + { + DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS=1, + DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS=2, + DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS=3, + DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2=4, + DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS=5, + DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS=6, + DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2=7 +} +#else + { __donnot_use_enum_drsuapi_DsMembershipType=0x7FFFFFFF} +#define DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS ( 1 ) +#define DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS ( 2 ) +#define DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS ( 3 ) +#define DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2 ( 4 ) +#define DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS ( 5 ) +#define DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS ( 6 ) +#define DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2 ( 7 ) +#endif +; + +struct drsuapi_DsGetMembershipsCtr1 { + NTSTATUS status; + uint32_t num_memberships;/* [range(0,10000)] */ + uint32_t num_sids;/* [range(0,10000)] */ + struct drsuapi_DsReplicaObjectIdentifier **info_array;/* [unique,size_is(num_memberships)] */ + uint32_t *group_attrs;/* [unique,size_is(num_memberships)] */ + struct dom_sid28 **sids;/* [unique,size_is(num_sids)] */ +}; + +union drsuapi_DsGetMembershipsCtr { + struct drsuapi_DsGetMembershipsCtr1 ctr1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsGetMembershipsRequest1 { + uint32_t count;/* [range(1,10000)] */ + struct drsuapi_DsReplicaObjectIdentifier **info_array;/* [unique,size_is(count)] */ + uint32_t flags; + enum drsuapi_DsMembershipType type; + struct drsuapi_DsReplicaObjectIdentifier *domain;/* [unique] */ +}; + +union drsuapi_DsGetMembershipsRequest { + struct drsuapi_DsGetMembershipsRequest1 req1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsGetNT4ChangeLogRequest1 { + uint32_t unknown1; + uint32_t unknown2; + uint32_t length;/* [range(0,0x00A00000)] */ + uint8_t *data;/* [unique,size_is(length)] */ +}; + +union drsuapi_DsGetNT4ChangeLogRequest { + struct drsuapi_DsGetNT4ChangeLogRequest1 req1;/* [case] */ +}/* [switch_type(uint32)] */; + +struct drsuapi_DsGetNT4ChangeLogInfo1 { + uint32_t length1;/* [range(0,0x00A00000)] */ + uint32_t length2;/* [range(0,0x00A00000)] */ + uint64_t unknown1; + NTTIME time2; + uint64_t unknown3; + NTTIME time4; + uint64_t unknown5; + NTTIME time6; + NTSTATUS status; + uint8_t *data1;/* [unique,size_is(length1)] */ + uint8_t *data2;/* [unique,size_is(length2)] */ +}; + +union drsuapi_DsGetNT4ChangeLogInfo { + struct drsuapi_DsGetNT4ChangeLogInfo1 info1;/* [case] */ +}/* [switch_type(uint32)] */; + +enum drsuapi_DsNameStatus +#ifndef USE_UINT_ENUMS + { + DRSUAPI_DS_NAME_STATUS_OK=0, + DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR=1, + DRSUAPI_DS_NAME_STATUS_NOT_FOUND=2, + DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE=3, + DRSUAPI_DS_NAME_STATUS_NO_MAPPING=4, + DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY=5, + DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING=6, + DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL=7 +} +#else + { __donnot_use_enum_drsuapi_DsNameStatus=0x7FFFFFFF} +#define DRSUAPI_DS_NAME_STATUS_OK ( 0 ) +#define DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR ( 1 ) +#define DRSUAPI_DS_NAME_STATUS_NOT_FOUND ( 2 ) +#define DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE ( 3 ) +#define DRSUAPI_DS_NAME_STATUS_NO_MAPPING ( 4 ) +#define DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY ( 5 ) +#define DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING ( 6 ) +#define DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL ( 7 ) +#endif +; + +enum drsuapi_DsNameFlags +#ifndef USE_UINT_ENUMS + { + DRSUAPI_DS_NAME_FLAG_NO_FLAGS=0x0, + DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY=0x1, + DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC=0x2, + DRSUAPI_DS_NAME_FLAG_GCVERIFY=0x4, + DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL=0x8 +} +#else + { __donnot_use_enum_drsuapi_DsNameFlags=0x7FFFFFFF} +#define DRSUAPI_DS_NAME_FLAG_NO_FLAGS ( 0x0 ) +#define DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY ( 0x1 ) +#define DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC ( 0x2 ) +#define DRSUAPI_DS_NAME_FLAG_GCVERIFY ( 0x4 ) +#define DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL ( 0x8 ) +#endif +; + +enum drsuapi_DsNameFormat +#ifndef USE_UINT_ENUMS + { + DRSUAPI_DS_NAME_FORMAT_UNKNOWN=0, + DRSUAPI_DS_NAME_FORMAT_FQDN_1779=1, + DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT=2, + DRSUAPI_DS_NAME_FORMAT_DISPLAY=3, + DRSUAPI_DS_NAME_FORMAT_GUID=6, + DRSUAPI_DS_NAME_FORMAT_CANONICAL=7, + DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL=8, + DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX=9, + DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL=10, + DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY=11, + DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN=12 +} +#else + { __donnot_use_enum_drsuapi_DsNameFormat=0x7FFFFFFF} +#define DRSUAPI_DS_NAME_FORMAT_UNKNOWN ( 0 ) +#define DRSUAPI_DS_NAME_FORMAT_FQDN_1779 ( 1 ) +#define DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT ( 2 ) +#define DRSUAPI_DS_NAME_FORMAT_DISPLAY ( 3 ) +#define DRSUAPI_DS_NAME_FORMAT_GUID ( 6 ) +#define DRSUAPI_DS_NAME_FORMAT_CANONICAL ( 7 ) +#define DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL ( 8 ) +#define DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX ( 9 ) +#define DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL ( 10 ) +#define DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY ( 11 ) +#define DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN ( 12 ) +#endif +; + +struct drsuapi_DsNameString { + const char *str;/* [unique,charset(UTF16)] */ +}; + +struct drsuapi_DsNameRequest1 { + uint32_t codepage; + uint32_t language; + enum drsuapi_DsNameFlags format_flags; + enum drsuapi_DsNameFormat format_offered; + enum drsuapi_DsNameFormat format_desired; + uint32_t count;/* [range(1,10000)] */ + struct drsuapi_DsNameString *names;/* [unique,size_is(count)] */ +}; + +union drsuapi_DsNameRequest { + struct drsuapi_DsNameRequest1 req1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsNameInfo1 { + enum drsuapi_DsNameStatus status; + const char *dns_domain_name;/* [unique,charset(UTF16)] */ + const char *result_name;/* [unique,charset(UTF16)] */ +}; + +struct drsuapi_DsNameCtr1 { + uint32_t count; + struct drsuapi_DsNameInfo1 *array;/* [unique,size_is(count)] */ +}; + +union drsuapi_DsNameCtr { + struct drsuapi_DsNameCtr1 *ctr1;/* [unique,case] */ +}/* [switch_type(int32)] */; + +enum drsuapi_DsSpnOperation +#ifndef USE_UINT_ENUMS + { + DRSUAPI_DS_SPN_OPERATION_ADD=0, + DRSUAPI_DS_SPN_OPERATION_REPLACE=1, + DRSUAPI_DS_SPN_OPERATION_DELETE=2 +} +#else + { __donnot_use_enum_drsuapi_DsSpnOperation=0x7FFFFFFF} +#define DRSUAPI_DS_SPN_OPERATION_ADD ( 0 ) +#define DRSUAPI_DS_SPN_OPERATION_REPLACE ( 1 ) +#define DRSUAPI_DS_SPN_OPERATION_DELETE ( 2 ) +#endif +; + +struct drsuapi_DsWriteAccountSpnRequest1 { + enum drsuapi_DsSpnOperation operation; + uint32_t unknown1; + const char *object_dn;/* [unique,charset(UTF16)] */ + uint32_t count;/* [range(0,10000)] */ + struct drsuapi_DsNameString *spn_names;/* [unique,size_is(count)] */ +}; + +union drsuapi_DsWriteAccountSpnRequest { + struct drsuapi_DsWriteAccountSpnRequest1 req1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsWriteAccountSpnResult1 { + WERROR status; +}; + +union drsuapi_DsWriteAccountSpnResult { + struct drsuapi_DsWriteAccountSpnResult1 res1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsRemoveDSServerRequest1 { + const char *server_dn;/* [unique,charset(UTF16)] */ + const char *domain_dn;/* [unique,charset(UTF16)] */ + uint32_t commit; +}; + +union drsuapi_DsRemoveDSServerRequest { + struct drsuapi_DsRemoveDSServerRequest1 req1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsRemoveDSServerResult1 { + uint32_t last_dc_in_domain; +}; + +union drsuapi_DsRemoveDSServerResult { + struct drsuapi_DsRemoveDSServerResult1 res1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsGetDCInfoRequest1 { + const char *domain_name;/* [unique,charset(UTF16)] */ + int32_t level; +}; + +union drsuapi_DsGetDCInfoRequest { + struct drsuapi_DsGetDCInfoRequest1 req1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsGetDCInfo1 { + const char *netbios_name;/* [unique,charset(UTF16)] */ + const char *dns_name;/* [unique,charset(UTF16)] */ + const char *site_name;/* [unique,charset(UTF16)] */ + const char *computer_dn;/* [unique,charset(UTF16)] */ + const char *server_dn;/* [unique,charset(UTF16)] */ + uint32_t is_pdc; + uint32_t is_enabled; +}; + +struct drsuapi_DsGetDCInfoCtr1 { + uint32_t count;/* [range(0,10000)] */ + struct drsuapi_DsGetDCInfo1 *array;/* [unique,size_is(count)] */ +}; + +struct drsuapi_DsGetDCInfo2 { + const char *netbios_name;/* [unique,charset(UTF16)] */ + const char *dns_name;/* [unique,charset(UTF16)] */ + const char *site_name;/* [unique,charset(UTF16)] */ + const char *site_dn;/* [unique,charset(UTF16)] */ + const char *computer_dn;/* [unique,charset(UTF16)] */ + const char *server_dn;/* [unique,charset(UTF16)] */ + const char *ntds_dn;/* [unique,charset(UTF16)] */ + uint32_t is_pdc; + uint32_t is_enabled; + uint32_t is_gc; + struct GUID site_guid; + struct GUID computer_guid; + struct GUID server_guid; + struct GUID ntds_guid; +}; + +struct drsuapi_DsGetDCInfoCtr2 { + uint32_t count;/* [range(0,10000)] */ + struct drsuapi_DsGetDCInfo2 *array;/* [unique,size_is(count)] */ +}; + +struct drsuapi_DsGetDCInfo3 { + const char *netbios_name;/* [unique,charset(UTF16)] */ + const char *dns_name;/* [unique,charset(UTF16)] */ + const char *site_name;/* [unique,charset(UTF16)] */ + const char *site_dn;/* [unique,charset(UTF16)] */ + const char *computer_dn;/* [unique,charset(UTF16)] */ + const char *server_dn;/* [unique,charset(UTF16)] */ + const char *ntds_dn;/* [unique,charset(UTF16)] */ + uint32_t is_pdc; + uint32_t is_enabled; + uint32_t is_gc; + uint32_t is_rodc; + struct GUID site_guid; + struct GUID computer_guid; + struct GUID server_guid; + struct GUID ntds_guid; +}; + +struct drsuapi_DsGetDCInfoCtr3 { + uint32_t count;/* [range(0,10000)] */ + struct drsuapi_DsGetDCInfo3 *array;/* [unique,size_is(count)] */ +}; + +struct drsuapi_DsGetDCConnection01 { + const char * client_ip_address;/* [flag(LIBNDR_FLAG_BIGENDIAN)] */ + uint32_t unknown2; + uint32_t connection_time; + uint32_t unknown4; + uint32_t unknown5; + uint32_t unknown6; + const char *client_account;/* [unique,charset(UTF16)] */ +}; + +struct drsuapi_DsGetDCConnectionCtr01 { + uint32_t count;/* [range(0,10000)] */ + struct drsuapi_DsGetDCConnection01 *array;/* [unique,size_is(count)] */ +}; + +enum drsuapi_DsGetDCInfoCtrLevels +#ifndef USE_UINT_ENUMS + { + DRSUAPI_DC_INFO_CTR_1=1, + DRSUAPI_DC_INFO_CTR_2=2, + DRSUAPI_DC_INFO_CTR_3=3, + DRSUAPI_DC_CONNECTION_CTR_01=-1 +} +#else + { __donnot_use_enum_drsuapi_DsGetDCInfoCtrLevels=0x7FFFFFFF} +#define DRSUAPI_DC_INFO_CTR_1 ( 1 ) +#define DRSUAPI_DC_INFO_CTR_2 ( 2 ) +#define DRSUAPI_DC_INFO_CTR_3 ( 3 ) +#define DRSUAPI_DC_CONNECTION_CTR_01 ( -1 ) +#endif +; + +union drsuapi_DsGetDCInfoCtr { + struct drsuapi_DsGetDCInfoCtr1 ctr1;/* [case(DRSUAPI_DC_INFO_CTR_1)] */ + struct drsuapi_DsGetDCInfoCtr2 ctr2;/* [case(DRSUAPI_DC_INFO_CTR_2)] */ + struct drsuapi_DsGetDCInfoCtr3 ctr3;/* [case(DRSUAPI_DC_INFO_CTR_3)] */ + struct drsuapi_DsGetDCConnectionCtr01 ctr01;/* [case(DRSUAPI_DC_CONNECTION_CTR_01)] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsReplicaObjectListItem { + struct drsuapi_DsReplicaObjectListItem *next_object;/* [unique] */ + struct drsuapi_DsReplicaObject object; +}/* [noprint,public] */; + +struct drsuapi_DsAddEntryRequest2 { + struct drsuapi_DsReplicaObjectListItem first_object; +}; + +union drsuapi_DsAddEntryRequest { + struct drsuapi_DsAddEntryRequest2 req2;/* [case(2)] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsAddEntryErrorInfoX { + uint32_t unknown1; + WERROR status; + uint32_t unknown2; + uint16_t unknown3; +}; + +struct drsuapi_DsAddEntryExtraErrorBuffer { + uint32_t size;/* [range(0,10485760)] */ + uint8_t *data;/* [unique,size_is(size)] */ +}; + +struct drsuapi_DsAddEntryExtraError1 { + struct drsuapi_DsAddEntryErrorInfoX error; + enum drsuapi_DsAttributeId attid; + uint32_t unknown2; + struct drsuapi_DsAddEntryExtraErrorBuffer buffer; +}; + +struct drsuapi_DsAddEntryErrorListItem1 { + struct drsuapi_DsAddEntryErrorListItem1 *next;/* [unique] */ + struct drsuapi_DsAddEntryExtraError1 error; +}; + +struct drsuapi_DsAddEntryErrorInfo1 { + struct drsuapi_DsReplicaObjectIdentifier *id;/* [unique] */ + WERROR status; + struct drsuapi_DsAddEntryErrorListItem1 first; +}; + +union drsuapi_DsAddEntryErrorInfo { + struct drsuapi_DsAddEntryErrorInfo1 error1;/* [case] */ + struct drsuapi_DsAddEntryErrorInfoX errorX;/* [case(4)] */ +}/* [switch_type(uint32)] */; + +struct drsuapi_DsAddEntryError1 { + WERROR status; + uint32_t level; + union drsuapi_DsAddEntryErrorInfo *info;/* [unique,switch_is(level)] */ +}; + +union drsuapi_DsAddEntryError { + struct drsuapi_DsAddEntryError1 info1;/* [case] */ +}/* [switch_type(uint32)] */; + +struct drsuapi_DsReplicaObjectIdentifier2 { + struct GUID guid; + struct dom_sid28 sid; +}; + +struct drsuapi_DsAddEntryCtr2 { + struct drsuapi_DsReplicaObjectIdentifier *id;/* [unique] */ + uint32_t unknown1; + struct drsuapi_DsAddEntryErrorInfoX error; + uint32_t count;/* [range(0,10000)] */ + struct drsuapi_DsReplicaObjectIdentifier2 *objects;/* [unique,size_is(count)] */ +}; + +struct drsuapi_DsAddEntryCtr3 { + struct drsuapi_DsReplicaObjectIdentifier *id;/* [unique] */ + uint32_t level; + union drsuapi_DsAddEntryError *error;/* [unique,switch_is(level)] */ + uint32_t count;/* [range(0,10000)] */ + struct drsuapi_DsReplicaObjectIdentifier2 *objects;/* [unique,size_is(count)] */ +}; + +union drsuapi_DsAddEntryCtr { + struct drsuapi_DsAddEntryCtr2 ctr2;/* [case(2)] */ + struct drsuapi_DsAddEntryCtr3 ctr3;/* [case(3)] */ +}/* [switch_type(int32)] */; + +enum drsuapi_DsReplicaGetInfoLevel +#ifndef USE_UINT_ENUMS + { + DRSUAPI_DS_REPLICA_GET_INFO=1, + DRSUAPI_DS_REPLICA_GET_INFO2=2 +} +#else + { __donnot_use_enum_drsuapi_DsReplicaGetInfoLevel=0x7FFFFFFF} +#define DRSUAPI_DS_REPLICA_GET_INFO ( 1 ) +#define DRSUAPI_DS_REPLICA_GET_INFO2 ( 2 ) +#endif +; + +enum drsuapi_DsReplicaInfoType +#ifndef USE_UINT_ENUMS + { + DRSUAPI_DS_REPLICA_INFO_NEIGHBORS=0, + DRSUAPI_DS_REPLICA_INFO_CURSORS=1, + DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA=2, + DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES=3, + DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES=4, + DRSUAPI_DS_REPLICA_INFO_PENDING_OPS=5, + DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA=6, + DRSUAPI_DS_REPLICA_INFO_CURSORS2=7, + DRSUAPI_DS_REPLICA_INFO_CURSORS3=8, + DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2=9, + DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2=10, + DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02=-2, + DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04=-4, + DRSUAPI_DS_REPLICA_INFO_CURSORS05=-5, + DRSUAPI_DS_REPLICA_INFO_06=-6 +} +#else + { __donnot_use_enum_drsuapi_DsReplicaInfoType=0x7FFFFFFF} +#define DRSUAPI_DS_REPLICA_INFO_NEIGHBORS ( 0 ) +#define DRSUAPI_DS_REPLICA_INFO_CURSORS ( 1 ) +#define DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA ( 2 ) +#define DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES ( 3 ) +#define DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES ( 4 ) +#define DRSUAPI_DS_REPLICA_INFO_PENDING_OPS ( 5 ) +#define DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA ( 6 ) +#define DRSUAPI_DS_REPLICA_INFO_CURSORS2 ( 7 ) +#define DRSUAPI_DS_REPLICA_INFO_CURSORS3 ( 8 ) +#define DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2 ( 9 ) +#define DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2 ( 10 ) +#define DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02 ( -2 ) +#define DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04 ( -4 ) +#define DRSUAPI_DS_REPLICA_INFO_CURSORS05 ( -5 ) +#define DRSUAPI_DS_REPLICA_INFO_06 ( -6 ) +#endif +; + +struct drsuapi_DsReplicaGetInfoRequest1 { + enum drsuapi_DsReplicaInfoType info_type; + const char *object_dn;/* [unique,charset(UTF16)] */ + struct GUID guid1; +}; + +struct drsuapi_DsReplicaGetInfoRequest2 { + enum drsuapi_DsReplicaInfoType info_type; + const char *object_dn;/* [unique,charset(UTF16)] */ + struct GUID guid1; + uint32_t unknown1; + const char *string1;/* [unique,charset(UTF16)] */ + const char *string2;/* [unique,charset(UTF16)] */ + uint32_t unknown2; +}; + +union drsuapi_DsReplicaGetInfoRequest { + struct drsuapi_DsReplicaGetInfoRequest1 req1;/* [case(DRSUAPI_DS_REPLICA_GET_INFO)] */ + struct drsuapi_DsReplicaGetInfoRequest2 req2;/* [case(DRSUAPI_DS_REPLICA_GET_INFO2)] */ +}/* [switch_type(drsuapi_DsReplicaGetInfoLevel)] */; + +struct drsuapi_DsReplicaNeighbour { + const char *naming_context_dn;/* [unique,charset(UTF16)] */ + const char *source_dsa_obj_dn;/* [unique,charset(UTF16)] */ + const char *source_dsa_address;/* [unique,charset(UTF16)] */ + const char *transport_obj_dn;/* [unique,charset(UTF16)] */ + uint32_t replica_flags; + uint32_t reserved; + struct GUID naming_context_obj_guid; + struct GUID source_dsa_obj_guid; + struct GUID source_dsa_invocation_id; + struct GUID transport_obj_guid; + uint64_t tmp_highest_usn; + uint64_t highest_usn; + NTTIME last_success; + NTTIME last_attempt; + WERROR result_last_attempt; + uint32_t consecutive_sync_failures; +}; + +struct drsuapi_DsReplicaNeighbourCtr { + uint32_t count; + uint32_t reserved; + struct drsuapi_DsReplicaNeighbour *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplicaCursorCtr { + uint32_t count; + uint32_t reserved; + struct drsuapi_DsReplicaCursor *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplicaObjMetaData { + const char *attribute_name;/* [unique,charset(UTF16)] */ + uint32_t version; + NTTIME originating_change_time; + struct GUID originating_invocation_id; + uint64_t originating_usn; + uint64_t local_usn; +}; + +struct drsuapi_DsReplicaObjMetaDataCtr { + uint32_t count; + uint32_t reserved; + struct drsuapi_DsReplicaObjMetaData *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplicaKccDsaFailure { + const char *dsa_obj_dn;/* [unique,charset(UTF16)] */ + struct GUID dsa_obj_guid; + NTTIME first_failure; + uint32_t num_failures; + WERROR last_result; +}; + +struct drsuapi_DsReplicaKccDsaFailuresCtr { + uint32_t count; + uint32_t reserved; + struct drsuapi_DsReplicaKccDsaFailure *array;/* [size_is(count)] */ +}; + +enum drsuapi_DsReplicaOpType +#ifndef USE_UINT_ENUMS + { + DRSUAPI_DS_REPLICA_OP_TYPE_SYNC=0, + DRSUAPI_DS_REPLICA_OP_TYPE_ADD=1, + DRSUAPI_DS_REPLICA_OP_TYPE_DELETE=2, + DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY=3, + DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS=4 +} +#else + { __donnot_use_enum_drsuapi_DsReplicaOpType=0x7FFFFFFF} +#define DRSUAPI_DS_REPLICA_OP_TYPE_SYNC ( 0 ) +#define DRSUAPI_DS_REPLICA_OP_TYPE_ADD ( 1 ) +#define DRSUAPI_DS_REPLICA_OP_TYPE_DELETE ( 2 ) +#define DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY ( 3 ) +#define DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS ( 4 ) +#endif +; + +union drsuapi_DsRplicaOpOptions { + uint32_t sync;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_SYNC)] */ + uint32_t add;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_ADD)] */ + uint32_t op_delete;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_DELETE)] */ + uint32_t modify;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY)] */ + uint32_t update_refs;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS)] */ + uint32_t unknown;/* [default] */ +}/* [switch_type(drsuapi_DsReplicaOpType)] */; + +struct drsuapi_DsReplicaOp { + NTTIME operation_start; + uint32_t serial_num; + uint32_t priority; + enum drsuapi_DsReplicaOpType operation_type; + union drsuapi_DsRplicaOpOptions options;/* [switch_is(operation_type)] */ + const char *nc_dn;/* [unique,charset(UTF16)] */ + const char *remote_dsa_obj_dn;/* [unique,charset(UTF16)] */ + const char *remote_dsa_address;/* [unique,charset(UTF16)] */ + struct GUID nc_obj_guid; + struct GUID remote_dsa_obj_guid; +}; + +struct drsuapi_DsReplicaOpCtr { + NTTIME time; + uint32_t count; + struct drsuapi_DsReplicaOp *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplicaAttrValMetaData { + const char *attribute_name;/* [unique,charset(UTF16)] */ + const char *object_dn;/* [unique,charset(UTF16)] */ + uint32_t __ndr_size_binary;/* [value(ndr_size_DATA_BLOB(0,binary,0))] */ + DATA_BLOB *binary;/* [unique] */ + NTTIME deleted; + NTTIME created; + uint32_t version; + NTTIME originating_change_time; + struct GUID originating_invocation_id; + uint64_t originating_usn; + uint64_t local_usn; +}; + +struct drsuapi_DsReplicaAttrValMetaDataCtr { + uint32_t count; + int32_t enumeration_context; + struct drsuapi_DsReplicaAttrValMetaData *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplicaCursor2Ctr { + uint32_t count; + int32_t enumeration_context; + struct drsuapi_DsReplicaCursor2 *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplicaCursor3 { + struct GUID source_dsa_invocation_id; + uint64_t highest_usn; + NTTIME last_sync_success; + const char *source_dsa_obj_dn;/* [unique,charset(UTF16)] */ +}; + +struct drsuapi_DsReplicaCursor3Ctr { + uint32_t count; + int32_t enumeration_context; + struct drsuapi_DsReplicaCursor3 *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplicaObjMetaData2 { + const char *attribute_name;/* [unique,charset(UTF16)] */ + uint32_t version; + NTTIME originating_change_time; + struct GUID originating_invocation_id; + uint64_t originating_usn; + uint64_t local_usn; + const char *originating_dsa_dn;/* [unique,charset(UTF16)] */ +}; + +struct drsuapi_DsReplicaObjMetaData2Ctr { + uint32_t count; + int32_t enumeration_context; + struct drsuapi_DsReplicaObjMetaData2 *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplicaAttrValMetaData2 { + const char *attribute_name;/* [unique,charset(UTF16)] */ + const char *object_dn;/* [unique,charset(UTF16)] */ + uint32_t __ndr_size_binary;/* [value(ndr_size_DATA_BLOB(0,binary,0))] */ + DATA_BLOB *binary;/* [unique] */ + NTTIME deleted; + NTTIME created; + uint32_t version; + NTTIME originating_change_time; + struct GUID originating_invocation_id; + uint64_t originating_usn; + uint64_t local_usn; + const char *originating_dsa_dn;/* [unique,charset(UTF16)] */ +}; + +struct drsuapi_DsReplicaAttrValMetaData2Ctr { + uint32_t count; + int32_t enumeration_context; + struct drsuapi_DsReplicaAttrValMetaData2 *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplicaConnection04 { + uint64_t u1; + uint32_t u2; + uint32_t u3; + struct GUID bind_guid; + NTTIME bind_time; + const char * client_ip_address;/* [flag(LIBNDR_FLAG_BIGENDIAN)] */ + uint32_t u5; +}; + +struct drsuapi_DsReplicaConnection04Ctr { + uint32_t count;/* [range(0,10000)] */ + uint32_t reserved; + struct drsuapi_DsReplicaConnection04 *array;/* [size_is(count)] */ +}; + +struct drsuapi_DsReplica06 { + const char *str1;/* [unique,charset(UTF16)] */ + uint32_t u1; + uint32_t u2; + uint32_t u3; + uint32_t u4; + uint32_t u5; + uint64_t u6; + uint32_t u7; +}; + +struct drsuapi_DsReplica06Ctr { + uint32_t count;/* [range(0,256)] */ + uint32_t reserved; + struct drsuapi_DsReplica06 *array;/* [size_is(count)] */ +}; + +union drsuapi_DsReplicaInfo { + struct drsuapi_DsReplicaNeighbourCtr *neighbours;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS)] */ + struct drsuapi_DsReplicaCursorCtr *cursors;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CURSORS)] */ + struct drsuapi_DsReplicaObjMetaDataCtr *objmetadata;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA)] */ + struct drsuapi_DsReplicaKccDsaFailuresCtr *connectfailures;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES)] */ + struct drsuapi_DsReplicaKccDsaFailuresCtr *linkfailures;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES)] */ + struct drsuapi_DsReplicaOpCtr *pendingops;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_PENDING_OPS)] */ + struct drsuapi_DsReplicaAttrValMetaDataCtr *attrvalmetadata;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA)] */ + struct drsuapi_DsReplicaCursor2Ctr *cursors2;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CURSORS2)] */ + struct drsuapi_DsReplicaCursor3Ctr *cursors3;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CURSORS3)] */ + struct drsuapi_DsReplicaObjMetaData2Ctr *objmetadata2;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2)] */ + struct drsuapi_DsReplicaAttrValMetaData2Ctr *attrvalmetadata2;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2)] */ + struct drsuapi_DsReplicaNeighbourCtr *neighbours02;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02)] */ + struct drsuapi_DsReplicaConnection04Ctr *connections04;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04)] */ + struct drsuapi_DsReplicaCursorCtrEx *cursors05;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CURSORS05)] */ + struct drsuapi_DsReplica06Ctr *i06;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_06)] */ +}/* [switch_type(drsuapi_DsReplicaInfoType)] */; + +struct drsuapi_DsGetMemberships2Ctr1 { + uint32_t num_entries;/* [range(0,10000)] */ + struct drsuapi_DsGetMembershipsCtr1 **ctrl_array;/* [unique,size_is(num_entries)] */ +}; + +union drsuapi_DsGetMemberships2Ctr { + struct drsuapi_DsGetMembershipsCtr1 ctr1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsGetMemberships2Request1 { + uint32_t num_req;/* [range(1,10000)] */ + struct drsuapi_DsGetMembershipsRequest1 **req_array;/* [unique,size_is(num_req)] */ +}; + +union drsuapi_DsGetMemberships2Request { + struct drsuapi_DsGetMemberships2Request1 req1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_DsSiteCostInfo { + WERROR error_code; + uint32_t site_cost; +}; + +struct drsuapi_QuerySitesByCostCtr1 { + uint32_t num_info;/* [range(0,10000)] */ + struct drsuapi_DsSiteCostInfo *info;/* [unique,size_is(num_info)] */ + uint32_t unknown; +}; + +union drsuapi_QuerySitesByCostCtr { + struct drsuapi_QuerySitesByCostCtr1 ctr1;/* [case] */ +}/* [switch_type(int32)] */; + +struct drsuapi_QuerySitesByCostRequest1 { + const char *site_from;/* [unique,charset(UTF16)] */ + uint32_t num_req;/* [range(1,10000)] */ + const char **site_to;/* [unique,charset(UTF16),size_is(num_req)] */ + uint32_t flags; +}; + +union drsuapi_QuerySitesByCostRequest { + struct drsuapi_QuerySitesByCostRequest1 req1;/* [case] */ +}/* [switch_type(int32)] */; + + +struct drsuapi_DsBind { + struct { + struct GUID *bind_guid;/* [unique] */ + struct drsuapi_DsBindInfoCtr *bind_info;/* [unique] */ + } in; + + struct { + struct policy_handle *bind_handle;/* [ref] */ + struct drsuapi_DsBindInfoCtr *bind_info;/* [unique] */ + WERROR result; + } out; + +}; + + +struct drsuapi_DsUnbind { + struct { + struct policy_handle *bind_handle;/* [ref] */ + } in; + + struct { + struct policy_handle *bind_handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct drsuapi_DsReplicaSync { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsReplicaSyncRequest req;/* [switch_is(level)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct drsuapi_DsGetNCChanges { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsGetNCChangesRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + int32_t *level_out;/* [ref] */ + union drsuapi_DsGetNCChangesCtr *ctr;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + + +struct drsuapi_DsReplicaUpdateRefs { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsReplicaUpdateRefsRequest req;/* [switch_is(level)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct DRSUAPI_REPLICA_ADD { + struct { + WERROR result; + } out; + +}; + + +struct DRSUAPI_REPLICA_DEL { + struct { + WERROR result; + } out; + +}; + + +struct DRSUAPI_REPLICA_MODIFY { + struct { + WERROR result; + } out; + +}; + + +struct DRSUAPI_VERIFY_NAMES { + struct { + WERROR result; + } out; + +}; + + +struct drsuapi_DsGetMemberships { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsGetMembershipsRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + int32_t *level_out;/* [ref] */ + union drsuapi_DsGetMembershipsCtr *ctr;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + + +struct DRSUAPI_INTER_DOMAIN_MOVE { + struct { + WERROR result; + } out; + +}; + + +struct drsuapi_DsGetNT4ChangeLog { + struct { + struct policy_handle *bind_handle;/* [ref] */ + uint32_t level; + union drsuapi_DsGetNT4ChangeLogRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + uint32_t *level_out;/* [ref] */ + union drsuapi_DsGetNT4ChangeLogInfo *info;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + + +struct drsuapi_DsCrackNames { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsNameRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + int32_t *level_out;/* [ref] */ + union drsuapi_DsNameCtr *ctr;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + + +struct drsuapi_DsWriteAccountSpn { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsWriteAccountSpnRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + int32_t *level_out;/* [ref] */ + union drsuapi_DsWriteAccountSpnResult *res;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + + +struct drsuapi_DsRemoveDSServer { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsRemoveDSServerRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + int32_t *level_out;/* [ref] */ + union drsuapi_DsRemoveDSServerResult *res;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + + +struct DRSUAPI_REMOVE_DS_DOMAIN { + struct { + WERROR result; + } out; + +}; + + +struct drsuapi_DsGetDomainControllerInfo { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsGetDCInfoRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + int32_t *level_out;/* [ref] */ + union drsuapi_DsGetDCInfoCtr *ctr;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + + +struct drsuapi_DsAddEntry { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsAddEntryRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + int32_t *level_out;/* [ref] */ + union drsuapi_DsAddEntryCtr *ctr;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + + +struct DRSUAPI_EXECUTE_KCC { + struct { + WERROR result; + } out; + +}; + + +struct drsuapi_DsReplicaGetInfo { + struct { + struct policy_handle *bind_handle;/* [ref] */ + enum drsuapi_DsReplicaGetInfoLevel level; + union drsuapi_DsReplicaGetInfoRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + enum drsuapi_DsReplicaInfoType *info_type;/* [ref] */ + union drsuapi_DsReplicaInfo *info;/* [ref,switch_is(*info_type)] */ + WERROR result; + } out; + +}; + + +struct DRSUAPI_ADD_SID_HISTORY { + struct { + WERROR result; + } out; + +}; + + +struct drsuapi_DsGetMemberships2 { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_DsGetMemberships2Request *req;/* [ref,switch_is(level)] */ + } in; + + struct { + int32_t *level_out;/* [ref] */ + union drsuapi_DsGetMemberships2Ctr *ctr;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + + +struct DRSUAPI_REPLICA_VERIFY_OBJECTS { + struct { + WERROR result; + } out; + +}; + + +struct DRSUAPI_GET_OBJECT_EXISTENCE { + struct { + WERROR result; + } out; + +}; + + +struct drsuapi_QuerySitesByCost { + struct { + struct policy_handle *bind_handle;/* [ref] */ + int32_t level; + union drsuapi_QuerySitesByCostRequest *req;/* [ref,switch_is(level)] */ + } in; + + struct { + int32_t *level_out;/* [ref] */ + union drsuapi_QuerySitesByCostCtr *ctr;/* [ref,switch_is(*level_out)] */ + WERROR result; + } out; + +}; + +#endif /* _HEADER_drsuapi */ diff --git a/librpc/gen_ndr/dssetup.h b/librpc/gen_ndr/dssetup.h new file mode 100644 index 0000000000..d284a63375 --- /dev/null +++ b/librpc/gen_ndr/dssetup.h @@ -0,0 +1,211 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/misc.h" +#ifndef _HEADER_dssetup +#define _HEADER_dssetup + +enum dssetup_DsRole +#ifndef USE_UINT_ENUMS + { + DS_ROLE_STANDALONE_WORKSTATION=0, + DS_ROLE_MEMBER_WORKSTATION=1, + DS_ROLE_STANDALONE_SERVER=2, + DS_ROLE_MEMBER_SERVER=3, + DS_ROLE_BACKUP_DC=4, + DS_ROLE_PRIMARY_DC=5 +} +#else + { __donnot_use_enum_dssetup_DsRole=0x7FFFFFFF} +#define DS_ROLE_STANDALONE_WORKSTATION ( 0 ) +#define DS_ROLE_MEMBER_WORKSTATION ( 1 ) +#define DS_ROLE_STANDALONE_SERVER ( 2 ) +#define DS_ROLE_MEMBER_SERVER ( 3 ) +#define DS_ROLE_BACKUP_DC ( 4 ) +#define DS_ROLE_PRIMARY_DC ( 5 ) +#endif +; + +/* bitmap dssetup_DsRoleFlags */ +#define DS_ROLE_PRIMARY_DS_RUNNING ( 0x00000001 ) +#define DS_ROLE_PRIMARY_DS_MIXED_MODE ( 0x00000002 ) +#define DS_ROLE_UPGRADE_IN_PROGRESS ( 0x00000004 ) +#define DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT ( 0x01000000 ) + +struct dssetup_DsRolePrimaryDomInfoBasic { + enum dssetup_DsRole role; + uint32_t flags; + const char *domain;/* [unique,charset(UTF16)] */ + const char *dns_domain;/* [unique,charset(UTF16)] */ + const char *forest;/* [unique,charset(UTF16)] */ + struct GUID domain_guid; +}; + +enum dssetup_DsUpgrade +#ifndef USE_UINT_ENUMS + { + DS_ROLE_NOT_UPGRADING=0, + DS_ROLE_UPGRADING=1 +} +#else + { __donnot_use_enum_dssetup_DsUpgrade=0x7FFFFFFF} +#define DS_ROLE_NOT_UPGRADING ( 0 ) +#define DS_ROLE_UPGRADING ( 1 ) +#endif +; + +enum dssetup_DsPrevious +#ifndef USE_UINT_ENUMS + { + DS_ROLE_PREVIOUS_UNKNOWN=0, + DS_ROLE_PREVIOUS_PRIMARY=1, + DS_ROLE_PREVIOUS_BACKUP=2 +} +#else + { __donnot_use_enum_dssetup_DsPrevious=0x7FFFFFFF} +#define DS_ROLE_PREVIOUS_UNKNOWN ( 0 ) +#define DS_ROLE_PREVIOUS_PRIMARY ( 1 ) +#define DS_ROLE_PREVIOUS_BACKUP ( 2 ) +#endif +; + +struct dssetup_DsRoleUpgradeStatus { + enum dssetup_DsUpgrade upgrading; + enum dssetup_DsPrevious previous_role; +}; + +enum dssetup_DsRoleOp +#ifndef USE_UINT_ENUMS + { + DS_ROLE_OP_IDLE=0, + DS_ROLE_OP_ACTIVE=1, + DS_ROLE_OP_NEEDS_REBOOT=2 +} +#else + { __donnot_use_enum_dssetup_DsRoleOp=0x7FFFFFFF} +#define DS_ROLE_OP_IDLE ( 0 ) +#define DS_ROLE_OP_ACTIVE ( 1 ) +#define DS_ROLE_OP_NEEDS_REBOOT ( 2 ) +#endif +; + +struct dssetup_DsRoleOpStatus { + enum dssetup_DsRoleOp status; +}; + +enum dssetup_DsRoleInfoLevel +#ifndef USE_UINT_ENUMS + { + DS_ROLE_BASIC_INFORMATION=1, + DS_ROLE_UPGRADE_STATUS=2, + DS_ROLE_OP_STATUS=3 +} +#else + { __donnot_use_enum_dssetup_DsRoleInfoLevel=0x7FFFFFFF} +#define DS_ROLE_BASIC_INFORMATION ( 1 ) +#define DS_ROLE_UPGRADE_STATUS ( 2 ) +#define DS_ROLE_OP_STATUS ( 3 ) +#endif +; + +union dssetup_DsRoleInfo { + struct dssetup_DsRolePrimaryDomInfoBasic basic;/* [case(DS_ROLE_BASIC_INFORMATION)] */ + struct dssetup_DsRoleUpgradeStatus upgrade;/* [case(DS_ROLE_UPGRADE_STATUS)] */ + struct dssetup_DsRoleOpStatus opstatus;/* [case(DS_ROLE_OP_STATUS)] */ +}/* [switch_type(dssetup_DsRoleInfoLevel)] */; + + +struct dssetup_DsRoleGetPrimaryDomainInformation { + struct { + enum dssetup_DsRoleInfoLevel level; + } in; + + struct { + union dssetup_DsRoleInfo *info;/* [unique,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleDnsNameToFlatName { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleDcAsDc { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleDcAsReplica { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleDemoteDc { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleGetDcOperationProgress { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleGetDcOperationResults { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleCancel { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleServerSaveStateForUpgrade { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleUpgradeDownlevelServer { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleAbortDownlevelServerUpgrade { + struct { + WERROR result; + } out; + +}; + +#endif /* _HEADER_dssetup */ diff --git a/librpc/gen_ndr/echo.h b/librpc/gen_ndr/echo.h new file mode 100644 index 0000000000..79d4220714 --- /dev/null +++ b/librpc/gen_ndr/echo.h @@ -0,0 +1,213 @@ +/* header auto-generated by pidl */ + +#include + +#ifndef _HEADER_rpcecho +#define _HEADER_rpcecho + +struct echo_info1 { + uint8_t v; +}/* [public] */; + +struct echo_info2 { + uint16_t v; +}; + +struct echo_info3 { + uint32_t v; +}; + +struct echo_info4 { + uint64_t v; +}; + +struct echo_info5 { + uint8_t v1; + uint64_t v2; +}; + +struct echo_info6 { + uint8_t v1; + struct echo_info1 info1; +}; + +struct echo_info7 { + uint8_t v1; + struct echo_info4 info4; +}; + +union echo_Info { + struct echo_info1 info1;/* [case] */ + struct echo_info2 info2;/* [case(2)] */ + struct echo_info3 info3;/* [case(3)] */ + struct echo_info4 info4;/* [case(4)] */ + struct echo_info5 info5;/* [case(5)] */ + struct echo_info6 info6;/* [case(6)] */ + struct echo_info7 info7;/* [case(7)] */ +}/* [switch_type(uint16)] */; + +enum echo_Enum1 +#ifndef USE_UINT_ENUMS + { + ECHO_ENUM1=1, + ECHO_ENUM2=2 +} +#else + { __donnot_use_enum_echo_Enum1=0x7FFFFFFF} +#define ECHO_ENUM1 ( 1 ) +#define ECHO_ENUM2 ( 2 ) +#endif +; + +enum echo_Enum1_32 +#ifndef USE_UINT_ENUMS + { + ECHO_ENUM1_32=1, + ECHO_ENUM2_32=2 +} +#else + { __donnot_use_enum_echo_Enum1_32=0x7FFFFFFF} +#define ECHO_ENUM1_32 ( 1 ) +#define ECHO_ENUM2_32 ( 2 ) +#endif +; + +struct echo_Enum2 { + enum echo_Enum1 e1; + enum echo_Enum1_32 e2; +}; + +union echo_Enum3 { + enum echo_Enum1 e1;/* [case(ECHO_ENUM1)] */ + struct echo_Enum2 e2;/* [case(ECHO_ENUM2)] */ +}/* [switch_type(uint16)] */; + +struct echo_Surrounding { + uint32_t x; + uint16_t *surrounding;/* [size_is(x)] */ +}; + + +struct echo_AddOne { + struct { + uint32_t in_data; + } in; + + struct { + uint32_t *out_data;/* [ref] */ + } out; + +}; + + +struct echo_EchoData { + struct { + uint32_t len; + uint8_t *in_data;/* [size_is(len)] */ + } in; + + struct { + uint8_t *out_data;/* [size_is(len)] */ + } out; + +}; + + +struct echo_SinkData { + struct { + uint32_t len; + uint8_t *data;/* [size_is(len)] */ + } in; + +}; + + +struct echo_SourceData { + struct { + uint32_t len; + } in; + + struct { + uint8_t *data;/* [size_is(len)] */ + } out; + +}; + + +struct echo_TestCall { + struct { + const char *s1;/* [ref,charset(UTF16)] */ + } in; + + struct { + const char **s2;/* [ref,charset(UTF16)] */ + } out; + +}; + + +struct echo_TestCall2 { + struct { + uint16_t level; + } in; + + struct { + union echo_Info *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct echo_TestSleep { + struct { + uint32_t seconds; + } in; + + struct { + uint32_t result; + } out; + +}; + + +struct echo_TestEnum { + struct { + enum echo_Enum1 *foo1;/* [ref] */ + struct echo_Enum2 *foo2;/* [ref] */ + union echo_Enum3 *foo3;/* [ref,switch_is(*foo1)] */ + } in; + + struct { + enum echo_Enum1 *foo1;/* [ref] */ + struct echo_Enum2 *foo2;/* [ref] */ + union echo_Enum3 *foo3;/* [ref,switch_is(*foo1)] */ + } out; + +}; + + +struct echo_TestSurrounding { + struct { + struct echo_Surrounding *data;/* [ref] */ + } in; + + struct { + struct echo_Surrounding *data;/* [ref] */ + } out; + +}; + + +struct echo_TestDoublePointer { + struct { + uint16_t ***data;/* [ref] */ + } in; + + struct { + uint16_t result; + } out; + +}; + +#endif /* _HEADER_rpcecho */ diff --git a/librpc/gen_ndr/epmapper.h b/librpc/gen_ndr/epmapper.h new file mode 100644 index 0000000000..4b75261a02 --- /dev/null +++ b/librpc/gen_ndr/epmapper.h @@ -0,0 +1,357 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/misc.h" +#ifndef _HEADER_epmapper +#define _HEADER_epmapper + +#define EPMAPPER_STATUS_NO_MORE_ENTRIES ( 0x16c9a0d6 ) +#define EPMAPPER_STATUS_NO_MEMORY ( 0x16C9A012 ) +#define EPMAPPER_STATUS_OK ( 0 ) +enum epm_protocol +#ifndef USE_UINT_ENUMS + { + EPM_PROTOCOL_DNET_NSP=0x04, + EPM_PROTOCOL_OSI_TP4=0x05, + EPM_PROTOCOL_OSI_CLNS=0x06, + EPM_PROTOCOL_TCP=0x07, + EPM_PROTOCOL_UDP=0x08, + EPM_PROTOCOL_IP=0x09, + EPM_PROTOCOL_NCADG=0x0a, + EPM_PROTOCOL_NCACN=0x0b, + EPM_PROTOCOL_NCALRPC=0x0c, + EPM_PROTOCOL_UUID=0x0d, + EPM_PROTOCOL_IPX=0x0e, + EPM_PROTOCOL_SMB=0x0f, + EPM_PROTOCOL_PIPE=0x10, + EPM_PROTOCOL_NETBIOS=0x11, + EPM_PROTOCOL_NETBEUI=0x12, + EPM_PROTOCOL_SPX=0x13, + EPM_PROTOCOL_NB_IPX=0x14, + EPM_PROTOCOL_DSP=0x16, + EPM_PROTOCOL_DDP=0x17, + EPM_PROTOCOL_APPLETALK=0x18, + EPM_PROTOCOL_VINES_SPP=0x1a, + EPM_PROTOCOL_VINES_IPC=0x1b, + EPM_PROTOCOL_STREETTALK=0x1c, + EPM_PROTOCOL_HTTP=0x1f, + EPM_PROTOCOL_UNIX_DS=0x20, + EPM_PROTOCOL_NULL=0x21 +} +#else + { __donnot_use_enum_epm_protocol=0x7FFFFFFF} +#define EPM_PROTOCOL_DNET_NSP ( 0x04 ) +#define EPM_PROTOCOL_OSI_TP4 ( 0x05 ) +#define EPM_PROTOCOL_OSI_CLNS ( 0x06 ) +#define EPM_PROTOCOL_TCP ( 0x07 ) +#define EPM_PROTOCOL_UDP ( 0x08 ) +#define EPM_PROTOCOL_IP ( 0x09 ) +#define EPM_PROTOCOL_NCADG ( 0x0a ) +#define EPM_PROTOCOL_NCACN ( 0x0b ) +#define EPM_PROTOCOL_NCALRPC ( 0x0c ) +#define EPM_PROTOCOL_UUID ( 0x0d ) +#define EPM_PROTOCOL_IPX ( 0x0e ) +#define EPM_PROTOCOL_SMB ( 0x0f ) +#define EPM_PROTOCOL_PIPE ( 0x10 ) +#define EPM_PROTOCOL_NETBIOS ( 0x11 ) +#define EPM_PROTOCOL_NETBEUI ( 0x12 ) +#define EPM_PROTOCOL_SPX ( 0x13 ) +#define EPM_PROTOCOL_NB_IPX ( 0x14 ) +#define EPM_PROTOCOL_DSP ( 0x16 ) +#define EPM_PROTOCOL_DDP ( 0x17 ) +#define EPM_PROTOCOL_APPLETALK ( 0x18 ) +#define EPM_PROTOCOL_VINES_SPP ( 0x1a ) +#define EPM_PROTOCOL_VINES_IPC ( 0x1b ) +#define EPM_PROTOCOL_STREETTALK ( 0x1c ) +#define EPM_PROTOCOL_HTTP ( 0x1f ) +#define EPM_PROTOCOL_UNIX_DS ( 0x20 ) +#define EPM_PROTOCOL_NULL ( 0x21 ) +#endif +; + +struct epm_rhs_dnet_nsp { + char _empty_; +}; + +struct epm_rhs_osi_tp4 { + char _empty_; +}; + +struct epm_rhs_osi_clns { + char _empty_; +}; + +struct epm_rhs_udp { + uint16_t port; +}; + +struct epm_rhs_tcp { + uint16_t port; +}; + +struct epm_rhs_ip { + const char * ipaddr; +}; + +struct epm_rhs_ncadg { + uint16_t minor_version; +}; + +struct epm_rhs_ncacn { + uint16_t minor_version; +}; + +struct epm_rhs_uuid { + DATA_BLOB unknown;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}; + +struct epm_rhs_ipx { + char _empty_; +}; + +struct epm_rhs_smb { + const char * unc;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct epm_rhs_pipe { + const char * path;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct epm_rhs_netbios { + const char * name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct epm_rhs_netbeui { + char _empty_; +}; + +struct epm_rhs_spx { + char _empty_; +}; + +struct epm_rhs_nb_ipx { + char _empty_; +}; + +struct epm_rhs_http { + uint16_t port; +}; + +struct epm_rhs_unix_ds { + const char * path;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct epm_rhs_null { + char _empty_; +}; + +struct epm_rhs_ncalrpc { + uint16_t minor_version; +}; + +struct epm_rhs_appletalk { + char _empty_; +}; + +struct epm_rhs_atalk_stream { + char _empty_; +}; + +struct epm_rhs_atalk_datagram { + char _empty_; +}; + +struct epm_rhs_vines_spp { + uint16_t port; +}; + +struct epm_rhs_vines_ipc { + uint16_t port; +}; + +struct epm_rhs_streettalk { + const char * streettalk;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +union epm_rhs { + struct epm_rhs_dnet_nsp dnet_nsp;/* [case(EPM_PROTOCOL_DNET_NSP)] */ + struct epm_rhs_osi_tp4 osi_tp4;/* [case(EPM_PROTOCOL_OSI_TP4)] */ + struct epm_rhs_osi_clns osi_clns;/* [case(EPM_PROTOCOL_OSI_CLNS)] */ + struct epm_rhs_tcp tcp;/* [case(EPM_PROTOCOL_TCP)] */ + struct epm_rhs_udp udp;/* [case(EPM_PROTOCOL_UDP)] */ + struct epm_rhs_ip ip;/* [case(EPM_PROTOCOL_IP)] */ + struct epm_rhs_ncadg ncadg;/* [case(EPM_PROTOCOL_NCADG)] */ + struct epm_rhs_ncacn ncacn;/* [case(EPM_PROTOCOL_NCACN)] */ + struct epm_rhs_ncalrpc ncalrpc;/* [case(EPM_PROTOCOL_NCALRPC)] */ + struct epm_rhs_uuid uuid;/* [case(EPM_PROTOCOL_UUID)] */ + struct epm_rhs_ipx ipx;/* [case(EPM_PROTOCOL_IPX)] */ + struct epm_rhs_smb smb;/* [case(EPM_PROTOCOL_SMB)] */ + struct epm_rhs_pipe pipe;/* [case(EPM_PROTOCOL_PIPE)] */ + struct epm_rhs_netbios netbios;/* [case(EPM_PROTOCOL_NETBIOS)] */ + struct epm_rhs_netbeui netbeui;/* [case(EPM_PROTOCOL_NETBEUI)] */ + struct epm_rhs_spx spx;/* [case(EPM_PROTOCOL_SPX)] */ + struct epm_rhs_nb_ipx nb_ipx;/* [case(EPM_PROTOCOL_NB_IPX)] */ + struct epm_rhs_atalk_stream atalk_stream;/* [case(EPM_PROTOCOL_DSP)] */ + struct epm_rhs_atalk_datagram atalk_datagram;/* [case(EPM_PROTOCOL_DDP)] */ + struct epm_rhs_appletalk appletalk;/* [case(EPM_PROTOCOL_APPLETALK)] */ + struct epm_rhs_vines_spp vines_spp;/* [case(EPM_PROTOCOL_VINES_SPP)] */ + struct epm_rhs_vines_ipc vines_ipc;/* [case(EPM_PROTOCOL_VINES_IPC)] */ + struct epm_rhs_streettalk streettalk;/* [case(EPM_PROTOCOL_STREETTALK)] */ + struct epm_rhs_http http;/* [case(EPM_PROTOCOL_HTTP)] */ + struct epm_rhs_unix_ds unix_ds;/* [case(EPM_PROTOCOL_UNIX_DS)] */ + struct epm_rhs_null null;/* [case(EPM_PROTOCOL_NULL)] */ + DATA_BLOB unknown;/* [default,flag(LIBNDR_FLAG_REMAINING)] */ +}/* [nodiscriminant,flag(LIBNDR_FLAG_BIGENDIAN)] */; + +struct epm_lhs { + enum epm_protocol protocol; + DATA_BLOB lhs_data;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}; + +struct epm_floor { + struct epm_lhs lhs;/* [subcontext(2)] */ + union epm_rhs rhs;/* [subcontext(2),switch_is(lhs.protocol)] */ +}; + +struct epm_tower { + uint16_t num_floors; + struct epm_floor *floors; +}/* [gensize,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN)] */; + +struct epm_twr_t { + uint32_t tower_length;/* [value(ndr_size_epm_tower(&tower,ndr->flags))] */ + struct epm_tower tower;/* [subcontext(4)] */ +}; + +struct epm_entry_t { + struct GUID object; + struct epm_twr_t *tower;/* [ptr] */ + uint32_t __annotation_offset;/* [value(0)] */ + uint32_t __annotation_length;/* [value(strlen(annotation)+1)] */ + const char *annotation;/* [charset(DOS)] */ +}; + +struct rpc_if_id_t { + struct GUID uuid; + uint16_t vers_major; + uint16_t vers_minor; +}; + +struct epm_twr_p_t { + struct epm_twr_t *twr;/* [ptr] */ +}; + + +struct epm_Insert { + struct { + uint32_t num_ents; + struct epm_entry_t *entries;/* [size_is(num_ents)] */ + uint32_t replace; + } in; + + struct { + uint32_t result; + } out; + +}; + + +struct epm_Delete { + struct { + uint32_t num_ents; + struct epm_entry_t *entries;/* [size_is(num_ents)] */ + } in; + + struct { + uint32_t result; + } out; + +}; + + +struct epm_Lookup { + struct { + uint32_t inquiry_type; + struct GUID *object;/* [ptr] */ + struct rpc_if_id_t *interface_id;/* [ptr] */ + uint32_t vers_option; + uint32_t max_ents; + struct policy_handle *entry_handle;/* [ref] */ + } in; + + struct { + uint32_t *num_ents;/* [ref] */ + struct epm_entry_t *entries;/* [length_is(*num_ents),size_is(max_ents)] */ + struct policy_handle *entry_handle;/* [ref] */ + uint32_t result; + } out; + +}; + + +struct epm_Map { + struct { + struct GUID *object;/* [ptr] */ + struct epm_twr_t *map_tower;/* [ptr] */ + uint32_t max_towers; + struct policy_handle *entry_handle;/* [ref] */ + } in; + + struct { + uint32_t *num_towers;/* [ref] */ + struct epm_twr_p_t *towers;/* [length_is(*num_towers),size_is(max_towers)] */ + struct policy_handle *entry_handle;/* [ref] */ + uint32_t result; + } out; + +}; + + +struct epm_LookupHandleFree { + struct { + struct policy_handle *entry_handle;/* [ref] */ + } in; + + struct { + struct policy_handle *entry_handle;/* [ref] */ + uint32_t result; + } out; + +}; + + +struct epm_InqObject { + struct { + struct GUID *epm_object;/* [ref] */ + } in; + + struct { + uint32_t result; + } out; + +}; + + +struct epm_MgmtDelete { + struct { + uint32_t object_speced; + struct GUID *object;/* [ptr] */ + struct epm_twr_t *tower;/* [ptr] */ + } in; + + struct { + uint32_t result; + } out; + +}; + + +struct epm_MapAuth { + struct { + uint32_t result; + } out; + +}; + +#endif /* _HEADER_epmapper */ diff --git a/librpc/gen_ndr/eventlog.h b/librpc/gen_ndr/eventlog.h new file mode 100644 index 0000000000..76b9e863bb --- /dev/null +++ b/librpc/gen_ndr/eventlog.h @@ -0,0 +1,287 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/lsa.h" +#include "librpc/gen_ndr/security.h" +#ifndef _HEADER_eventlog +#define _HEADER_eventlog + +/* bitmap eventlogReadFlags */ +#define EVENTLOG_SEQUENTIAL_READ ( 0x0001 ) +#define EVENTLOG_SEEK_READ ( 0x0002 ) +#define EVENTLOG_FORWARDS_READ ( 0x0004 ) +#define EVENTLOG_BACKWARDS_READ ( 0x0008 ) + +/* bitmap eventlogEventTypes */ +#define EVENTLOG_SUCCESS ( 0x0000 ) +#define EVENTLOG_ERROR_TYPE ( 0x0001 ) +#define EVENTLOG_WARNING_TYPE ( 0x0002 ) +#define EVENTLOG_INFORMATION_TYPE ( 0x0004 ) +#define EVENTLOG_AUDIT_SUCCESS ( 0x0008 ) +#define EVENTLOG_AUDIT_FAILURE ( 0x0010 ) + +struct eventlog_OpenUnknown0 { + uint16_t unknown0; + uint16_t unknown1; +}; + +struct eventlog_Record { + uint32_t size; + uint32_t reserved; + uint32_t record_number; + uint32_t time_generated; + uint32_t time_written; + uint32_t event_id; + uint16_t event_type; + uint16_t num_of_strings; + uint16_t event_category; + uint16_t reserved_flags; + uint32_t closing_record_number; + uint32_t stringoffset; + uint32_t sid_length; + uint32_t sid_offset; + uint32_t data_length; + uint32_t data_offset; + const char * source_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * computer_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * *strings;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * raw_data;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}/* [public] */; + + +struct eventlog_ClearEventLogW { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String *backupfile;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_BackupEventLogW { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_CloseEventLog { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct eventlog_DeregisterEventSource { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_GetNumRecords { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + uint32_t *number;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct eventlog_GetOldestRecord { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + uint32_t *oldest_entry;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct eventlog_ChangeNotify { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_OpenEventLogW { + struct { + struct eventlog_OpenUnknown0 *unknown0;/* [unique] */ + struct lsa_String *logname;/* [ref] */ + struct lsa_String *servername;/* [ref] */ + uint32_t major_version; + uint32_t minor_version; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct eventlog_RegisterEventSourceW { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_OpenBackupEventLogW { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_ReadEventLogW { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t flags; + uint32_t offset; + uint32_t number_of_bytes;/* [range(0,0x7FFFF)] */ + } in; + + struct { + uint8_t *data;/* [ref,size_is(number_of_bytes)] */ + uint32_t *sent_size;/* [ref] */ + uint32_t *real_size;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct eventlog_ReportEventW { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_ClearEventLogA { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_BackupEventLogA { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_OpenEventLogA { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_RegisterEventSourceA { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_OpenBackupEventLogA { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_ReadEventLogA { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_ReportEventA { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_RegisterClusterSvc { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_DeregisterClusterSvc { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_WriteClusterEvents { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_GetLogIntormation { + struct { + NTSTATUS result; + } out; + +}; + + +struct eventlog_FlushEventLog { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + +#endif /* _HEADER_eventlog */ diff --git a/librpc/gen_ndr/initshutdown.h b/librpc/gen_ndr/initshutdown.h new file mode 100644 index 0000000000..014e2fe689 --- /dev/null +++ b/librpc/gen_ndr/initshutdown.h @@ -0,0 +1,54 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/lsa.h" +#ifndef _HEADER_initshutdown +#define _HEADER_initshutdown + + +struct initshutdown_Init { + struct { + uint16_t *hostname;/* [unique] */ + struct lsa_StringLarge *message;/* [unique] */ + uint32_t timeout; + uint8_t force_apps; + uint8_t do_reboot; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct initshutdown_Abort { + struct { + uint16_t *server;/* [unique] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct initshutdown_InitEx { + struct { + uint16_t *hostname;/* [unique] */ + struct lsa_StringLarge *message;/* [unique] */ + uint32_t timeout; + uint8_t force_apps; + uint8_t do_reboot; + uint32_t reason; + } in; + + struct { + WERROR result; + } out; + +}; + +#endif /* _HEADER_initshutdown */ diff --git a/librpc/gen_ndr/krb5pac.h b/librpc/gen_ndr/krb5pac.h new file mode 100644 index 0000000000..73bd0d95bb --- /dev/null +++ b/librpc/gen_ndr/krb5pac.h @@ -0,0 +1,150 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/security.h" +#include "librpc/gen_ndr/netlogon.h" +#include "librpc/gen_ndr/samr.h" +#ifndef _HEADER_krb5pac +#define _HEADER_krb5pac + +#define NETLOGON_GENERIC_KRB5_PAC_VALIDATE ( 3 ) +struct PAC_LOGON_NAME { + NTTIME logon_time; + uint16_t size;/* [value(2*strlen_m(account_name))] */ + const char *account_name;/* [charset(UTF16)] */ +}; + +struct PAC_SIGNATURE_DATA { + uint32_t type; + DATA_BLOB signature;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct PAC_LOGON_INFO { + struct netr_SamInfo3 info3; + struct dom_sid2 *res_group_dom_sid;/* [unique] */ + struct samr_RidWithAttributeArray res_groups; +}; + +struct PAC_UNKNOWN_12 { + uint16_t upn_size;/* [value(2*strlen_m(upn_name))] */ + uint16_t upn_offset; + uint16_t domain_size;/* [value(2*strlen_m(domain_name))] */ + uint16_t domain_offset; + uint16_t unknown3; + uint16_t unknown4; + uint32_t unknown5; + const char *upn_name;/* [charset(UTF16)] */ + const char *domain_name;/* [charset(UTF16)] */ + uint32_t unknown6; +}; + +struct PAC_LOGON_INFO_CTR { + struct PAC_LOGON_INFO *info;/* [unique] */ +}/* [public] */; + +enum PAC_TYPE +#ifndef USE_UINT_ENUMS + { + PAC_TYPE_LOGON_INFO=1, + PAC_TYPE_SRV_CHECKSUM=6, + PAC_TYPE_KDC_CHECKSUM=7, + PAC_TYPE_LOGON_NAME=10, + PAC_TYPE_CONSTRAINED_DELEGATION=11, + PAC_TYPE_UNKNOWN_12=12 +} +#else + { __donnot_use_enum_PAC_TYPE=0x7FFFFFFF} +#define PAC_TYPE_LOGON_INFO ( 1 ) +#define PAC_TYPE_SRV_CHECKSUM ( 6 ) +#define PAC_TYPE_KDC_CHECKSUM ( 7 ) +#define PAC_TYPE_LOGON_NAME ( 10 ) +#define PAC_TYPE_CONSTRAINED_DELEGATION ( 11 ) +#define PAC_TYPE_UNKNOWN_12 ( 12 ) +#endif +; + +struct DATA_BLOB_REM { + DATA_BLOB remaining;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}; + +union PAC_INFO { + struct PAC_LOGON_INFO_CTR logon_info;/* [subcontext(0xFFFFFC01),case(PAC_TYPE_LOGON_INFO)] */ + struct PAC_SIGNATURE_DATA srv_cksum;/* [case(PAC_TYPE_SRV_CHECKSUM)] */ + struct PAC_SIGNATURE_DATA kdc_cksum;/* [case(PAC_TYPE_KDC_CHECKSUM)] */ + struct PAC_LOGON_NAME logon_name;/* [case(PAC_TYPE_LOGON_NAME)] */ + struct DATA_BLOB_REM unknown;/* [subcontext(0),default] */ +}/* [gensize,nodiscriminant,public] */; + +struct PAC_BUFFER { + enum PAC_TYPE type; + uint32_t _ndr_size;/* [value(_ndr_size_PAC_INFO(info,type,0))] */ + union PAC_INFO *info;/* [relative,subcontext_size(_subcontext_size_PAC_INFO(r,ndr->flags)),subcontext(0),switch_is(type),flag(LIBNDR_FLAG_ALIGN8)] */ + uint32_t _pad;/* [value(0)] */ +}/* [noprint,nopull,public,nopush] */; + +struct PAC_DATA { + uint32_t num_buffers; + uint32_t version; + struct PAC_BUFFER *buffers; +}/* [public] */; + +struct PAC_BUFFER_RAW { + enum PAC_TYPE type; + uint32_t ndr_size; + struct DATA_BLOB_REM *info;/* [relative,subcontext_size(NDR_ROUND(ndr_size,8)),subcontext(0),flag(LIBNDR_FLAG_ALIGN8)] */ + uint32_t _pad;/* [value(0)] */ +}/* [public] */; + +struct PAC_DATA_RAW { + uint32_t num_buffers; + uint32_t version; + struct PAC_BUFFER_RAW *buffers; +}/* [public] */; + +struct PAC_Validate { + uint32_t MessageType;/* [value(NETLOGON_GENERIC_KRB5_PAC_VALIDATE)] */ + uint32_t ChecksumLength; + int32_t SignatureType; + uint32_t SignatureLength; + DATA_BLOB ChecksumAndSignature;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}/* [public] */; + +struct netsamlogoncache_entry { + time_t timestamp; + struct netr_SamInfo3 info3; +}/* [public] */; + + +struct decode_pac { + struct { + struct PAC_DATA pac; + } in; + +}; + + +struct decode_pac_raw { + struct { + struct PAC_DATA_RAW pac; + } in; + +}; + + +struct decode_login_info { + struct { + struct PAC_LOGON_INFO logon_info; + } in; + +}; + + +struct decode_pac_validate { + struct { + struct PAC_Validate pac_validate; + } in; + +}; + +#endif /* _HEADER_krb5pac */ diff --git a/librpc/gen_ndr/lsa.h b/librpc/gen_ndr/lsa.h new file mode 100644 index 0000000000..ee8a31138d --- /dev/null +++ b/librpc/gen_ndr/lsa.h @@ -0,0 +1,1785 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/security.h" +#ifndef _HEADER_lsarpc +#define _HEADER_lsarpc + +#define LSA_ENUM_TRUST_DOMAIN_MULTIPLIER ( 60 ) +#define LSA_REF_DOMAIN_LIST_MULTIPLIER ( 32 ) +#define LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER ( 82 ) +#define LSA_CLIENT_REVISION_NO_DNS ( 0x00000001 ) +#define LSA_CLIENT_REVISION_DNS ( 0x00000002 ) +#define LSA_LOOKUP_OPTIONS_NO_ISOLATED ( 0x80000000 ) +struct lsa_String { + uint16_t length;/* [value(2*strlen_m(string))] */ + uint16_t size;/* [value(2*strlen_m(string))] */ + const char *string;/* [unique,charset(UTF16),length_is(length/2),size_is(size/2)] */ +}/* [public] */; + +struct lsa_StringLarge { + uint16_t length;/* [value(2*strlen_m(string))] */ + uint16_t size;/* [value(2*strlen_m_term(string))] */ + const char *string;/* [unique,charset(UTF16),length_is(length/2),size_is(size/2)] */ +}/* [public] */; + +struct lsa_Strings { + uint32_t count; + struct lsa_String *names;/* [unique,size_is(count)] */ +}/* [public] */; + +struct lsa_AsciiString { + uint16_t length;/* [value(strlen_m(string))] */ + uint16_t size;/* [value(strlen_m(string))] */ + const char *string;/* [unique,charset(DOS),length_is(length),size_is(size)] */ +}/* [public] */; + +struct lsa_AsciiStringLarge { + uint16_t length;/* [value(strlen_m(string))] */ + uint16_t size;/* [value(strlen_m_term(string))] */ + const char *string;/* [unique,charset(DOS),length_is(length),size_is(size)] */ +}/* [public] */; + +struct lsa_BinaryString { + uint16_t length; + uint16_t size; + uint16_t *array;/* [unique,length_is(length/2),size_is(size/2)] */ +}/* [public] */; + +struct lsa_LUID { + uint32_t low; + uint32_t high; +}; + +struct lsa_PrivEntry { + struct lsa_StringLarge name; + struct lsa_LUID luid; +}; + +struct lsa_PrivArray { + uint32_t count; + struct lsa_PrivEntry *privs;/* [unique,size_is(count)] */ +}; + +struct lsa_QosInfo { + uint32_t len; + uint16_t impersonation_level; + uint8_t context_mode; + uint8_t effective_only; +}; + +struct lsa_ObjectAttribute { + uint32_t len; + uint8_t *root_dir;/* [unique] */ + const char *object_name;/* [unique,charset(UTF16)] */ + uint32_t attributes; + struct security_descriptor *sec_desc;/* [unique] */ + struct lsa_QosInfo *sec_qos;/* [unique] */ +}; + +/* bitmap lsa_PolicyAccessMask */ +#define LSA_POLICY_VIEW_LOCAL_INFORMATION ( 0x00000001 ) +#define LSA_POLICY_VIEW_AUDIT_INFORMATION ( 0x00000002 ) +#define LSA_POLICY_GET_PRIVATE_INFORMATION ( 0x00000004 ) +#define LSA_POLICY_TRUST_ADMIN ( 0x00000008 ) +#define LSA_POLICY_CREATE_ACCOUNT ( 0x00000010 ) +#define LSA_POLICY_CREATE_SECRET ( 0x00000020 ) +#define LSA_POLICY_CREATE_PRIVILEGE ( 0x00000040 ) +#define LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS ( 0x00000080 ) +#define LSA_POLICY_SET_AUDIT_REQUIREMENTS ( 0x00000100 ) +#define LSA_POLICY_AUDIT_LOG_ADMIN ( 0x00000200 ) +#define LSA_POLICY_SERVER_ADMIN ( 0x00000400 ) +#define LSA_POLICY_LOOKUP_NAMES ( 0x00000800 ) + +struct lsa_AuditLogInfo { + uint32_t percent_full; + uint32_t maximum_log_size; + uint64_t retention_time; + uint8_t shutdown_in_progress; + uint64_t time_to_shutdown; + uint32_t next_audit_record; +}; + +enum lsa_PolicyAuditPolicy +#ifndef USE_UINT_ENUMS + { + LSA_AUDIT_POLICY_NONE=0, + LSA_AUDIT_POLICY_SUCCESS=1, + LSA_AUDIT_POLICY_FAILURE=2, + LSA_AUDIT_POLICY_ALL=(LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE), + LSA_AUDIT_POLICY_CLEAR=4 +} +#else + { __donnot_use_enum_lsa_PolicyAuditPolicy=0x7FFFFFFF} +#define LSA_AUDIT_POLICY_NONE ( 0 ) +#define LSA_AUDIT_POLICY_SUCCESS ( 1 ) +#define LSA_AUDIT_POLICY_FAILURE ( 2 ) +#define LSA_AUDIT_POLICY_ALL ( (LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE) ) +#define LSA_AUDIT_POLICY_CLEAR ( 4 ) +#endif +; + +enum lsa_PolicyAuditEventType +#ifndef USE_UINT_ENUMS + { + LSA_AUDIT_CATEGORY_SYSTEM=0, + LSA_AUDIT_CATEGORY_LOGON=1, + LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS=2, + LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS=3, + LSA_AUDIT_CATEGORY_PROCCESS_TRACKING=4, + LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES=5, + LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT=6, + LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS=7, + LSA_AUDIT_CATEGORY_ACCOUNT_LOGON=8 +} +#else + { __donnot_use_enum_lsa_PolicyAuditEventType=0x7FFFFFFF} +#define LSA_AUDIT_CATEGORY_SYSTEM ( 0 ) +#define LSA_AUDIT_CATEGORY_LOGON ( 1 ) +#define LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS ( 2 ) +#define LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS ( 3 ) +#define LSA_AUDIT_CATEGORY_PROCCESS_TRACKING ( 4 ) +#define LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES ( 5 ) +#define LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT ( 6 ) +#define LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS ( 7 ) +#define LSA_AUDIT_CATEGORY_ACCOUNT_LOGON ( 8 ) +#endif +; + +struct lsa_AuditEventsInfo { + uint32_t auditing_mode; + enum lsa_PolicyAuditPolicy *settings;/* [unique,size_is(count)] */ + uint32_t count; +}; + +struct lsa_DomainInfo { + struct lsa_StringLarge name; + struct dom_sid2 *sid;/* [unique] */ +}; + +struct lsa_PDAccountInfo { + struct lsa_String name; +}; + +enum lsa_Role +#ifndef USE_UINT_ENUMS + { + LSA_ROLE_BACKUP=2, + LSA_ROLE_PRIMARY=3 +} +#else + { __donnot_use_enum_lsa_Role=0x7FFFFFFF} +#define LSA_ROLE_BACKUP ( 2 ) +#define LSA_ROLE_PRIMARY ( 3 ) +#endif +; + +struct lsa_ServerRole { + enum lsa_Role role; +}; + +struct lsa_ReplicaSourceInfo { + struct lsa_String source; + struct lsa_String account; +}; + +struct lsa_DefaultQuotaInfo { + uint32_t paged_pool; + uint32_t non_paged_pool; + uint32_t min_wss; + uint32_t max_wss; + uint32_t pagefile; + uint64_t unknown; +}; + +struct lsa_ModificationInfo { + uint64_t modified_id; + NTTIME db_create_time; +}; + +struct lsa_AuditFullSetInfo { + uint8_t shutdown_on_full; +}; + +struct lsa_AuditFullQueryInfo { + uint8_t shutdown_on_full; + uint8_t log_is_full; +}; + +struct lsa_DnsDomainInfo { + struct lsa_StringLarge name; + struct lsa_StringLarge dns_domain; + struct lsa_StringLarge dns_forest; + struct GUID domain_guid; + struct dom_sid2 *sid;/* [unique] */ +}; + +enum lsa_PolicyInfo +#ifndef USE_UINT_ENUMS + { + LSA_POLICY_INFO_AUDIT_LOG=1, + LSA_POLICY_INFO_AUDIT_EVENTS=2, + LSA_POLICY_INFO_DOMAIN=3, + LSA_POLICY_INFO_PD=4, + LSA_POLICY_INFO_ACCOUNT_DOMAIN=5, + LSA_POLICY_INFO_ROLE=6, + LSA_POLICY_INFO_REPLICA=7, + LSA_POLICY_INFO_QUOTA=8, + LSA_POLICY_INFO_MOD=9, + LSA_POLICY_INFO_AUDIT_FULL_SET=10, + LSA_POLICY_INFO_AUDIT_FULL_QUERY=11, + LSA_POLICY_INFO_DNS=12, + LSA_POLICY_INFO_DNS_INT=13, + LSA_POLICY_INFO_L_ACCOUNT_DOMAIN=14 +} +#else + { __donnot_use_enum_lsa_PolicyInfo=0x7FFFFFFF} +#define LSA_POLICY_INFO_AUDIT_LOG ( 1 ) +#define LSA_POLICY_INFO_AUDIT_EVENTS ( 2 ) +#define LSA_POLICY_INFO_DOMAIN ( 3 ) +#define LSA_POLICY_INFO_PD ( 4 ) +#define LSA_POLICY_INFO_ACCOUNT_DOMAIN ( 5 ) +#define LSA_POLICY_INFO_ROLE ( 6 ) +#define LSA_POLICY_INFO_REPLICA ( 7 ) +#define LSA_POLICY_INFO_QUOTA ( 8 ) +#define LSA_POLICY_INFO_MOD ( 9 ) +#define LSA_POLICY_INFO_AUDIT_FULL_SET ( 10 ) +#define LSA_POLICY_INFO_AUDIT_FULL_QUERY ( 11 ) +#define LSA_POLICY_INFO_DNS ( 12 ) +#define LSA_POLICY_INFO_DNS_INT ( 13 ) +#define LSA_POLICY_INFO_L_ACCOUNT_DOMAIN ( 14 ) +#endif +; + +union lsa_PolicyInformation { + struct lsa_AuditLogInfo audit_log;/* [case(LSA_POLICY_INFO_AUDIT_LOG)] */ + struct lsa_AuditEventsInfo audit_events;/* [case(LSA_POLICY_INFO_AUDIT_EVENTS)] */ + struct lsa_DomainInfo domain;/* [case(LSA_POLICY_INFO_DOMAIN)] */ + struct lsa_PDAccountInfo pd;/* [case(LSA_POLICY_INFO_PD)] */ + struct lsa_DomainInfo account_domain;/* [case(LSA_POLICY_INFO_ACCOUNT_DOMAIN)] */ + struct lsa_ServerRole role;/* [case(LSA_POLICY_INFO_ROLE)] */ + struct lsa_ReplicaSourceInfo replica;/* [case(LSA_POLICY_INFO_REPLICA)] */ + struct lsa_DefaultQuotaInfo quota;/* [case(LSA_POLICY_INFO_QUOTA)] */ + struct lsa_ModificationInfo mod;/* [case(LSA_POLICY_INFO_MOD)] */ + struct lsa_AuditFullSetInfo auditfullset;/* [case(LSA_POLICY_INFO_AUDIT_FULL_SET)] */ + struct lsa_AuditFullQueryInfo auditfullquery;/* [case(LSA_POLICY_INFO_AUDIT_FULL_QUERY)] */ + struct lsa_DnsDomainInfo dns;/* [case(LSA_POLICY_INFO_DNS)] */ + struct lsa_DomainInfo l_account_domain;/* [case(LSA_POLICY_INFO_L_ACCOUNT_DOMAIN)] */ +}/* [switch_type(uint16)] */; + +struct lsa_SidPtr { + struct dom_sid2 *sid;/* [unique] */ +}; + +struct lsa_SidArray { + uint32_t num_sids;/* [range(0,1000)] */ + struct lsa_SidPtr *sids;/* [unique,size_is(num_sids)] */ +}/* [public] */; + +struct lsa_DomainList { + uint32_t count; + struct lsa_DomainInfo *domains;/* [unique,size_is(count)] */ +}; + +enum lsa_SidType +#ifndef USE_UINT_ENUMS + { + SID_NAME_USE_NONE=0, + SID_NAME_USER=1, + SID_NAME_DOM_GRP=2, + SID_NAME_DOMAIN=3, + SID_NAME_ALIAS=4, + SID_NAME_WKN_GRP=5, + SID_NAME_DELETED=6, + SID_NAME_INVALID=7, + SID_NAME_UNKNOWN=8, + SID_NAME_COMPUTER=9 +} +#else + { __donnot_use_enum_lsa_SidType=0x7FFFFFFF} +#define SID_NAME_USE_NONE ( 0 ) +#define SID_NAME_USER ( 1 ) +#define SID_NAME_DOM_GRP ( 2 ) +#define SID_NAME_DOMAIN ( 3 ) +#define SID_NAME_ALIAS ( 4 ) +#define SID_NAME_WKN_GRP ( 5 ) +#define SID_NAME_DELETED ( 6 ) +#define SID_NAME_INVALID ( 7 ) +#define SID_NAME_UNKNOWN ( 8 ) +#define SID_NAME_COMPUTER ( 9 ) +#endif +; + +struct lsa_TranslatedSid { + enum lsa_SidType sid_type; + uint32_t rid; + uint32_t sid_index; +}; + +struct lsa_TransSidArray { + uint32_t count;/* [range(0,1000)] */ + struct lsa_TranslatedSid *sids;/* [unique,size_is(count)] */ +}; + +struct lsa_RefDomainList { + uint32_t count;/* [range(0,1000)] */ + struct lsa_DomainInfo *domains;/* [unique,size_is(count)] */ + uint32_t max_size; +}; + +enum lsa_LookupNamesLevel +#ifndef USE_UINT_ENUMS + { + LSA_LOOKUP_NAMES_ALL=1, + LSA_LOOKUP_NAMES_DOMAINS_ONLY=2, + LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY=3, + LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY=4, + LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY=5, + LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2=6, + LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC=7 +} +#else + { __donnot_use_enum_lsa_LookupNamesLevel=0x7FFFFFFF} +#define LSA_LOOKUP_NAMES_ALL ( 1 ) +#define LSA_LOOKUP_NAMES_DOMAINS_ONLY ( 2 ) +#define LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY ( 3 ) +#define LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY ( 4 ) +#define LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY ( 5 ) +#define LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 ( 6 ) +#define LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC ( 7 ) +#endif +; + +struct lsa_TranslatedName { + enum lsa_SidType sid_type; + struct lsa_String name; + uint32_t sid_index; +}; + +struct lsa_TransNameArray { + uint32_t count;/* [range(0,1000)] */ + struct lsa_TranslatedName *names;/* [unique,size_is(count)] */ +}; + +struct lsa_LUIDAttribute { + struct lsa_LUID luid; + uint32_t attribute; +}; + +struct lsa_PrivilegeSet { + uint32_t count;/* [range(0,1000)] */ + uint32_t unknown; + struct lsa_LUIDAttribute *set;/* [size_is(count)] */ +}; + +/* bitmap lsa_SystemAccessModeFlags */ +#define LSA_POLICY_MODE_INTERACTIVE ( 0x00000001 ) +#define LSA_POLICY_MODE_NETWORK ( 0x00000002 ) +#define LSA_POLICY_MODE_BATCH ( 0x00000004 ) +#define LSA_POLICY_MODE_SERVICE ( 0x00000010 ) +#define LSA_POLICY_MODE_PROXY ( 0x00000020 ) +#define LSA_POLICY_MODE_DENY_INTERACTIVE ( 0x00000040 ) +#define LSA_POLICY_MODE_DENY_NETWORK ( 0x00000080 ) +#define LSA_POLICY_MODE_DENY_BATCH ( 0x00000100 ) +#define LSA_POLICY_MODE_DENY_SERVICE ( 0x00000200 ) +#define LSA_POLICY_MODE_REMOTE_INTERACTIVE ( 0x00000400 ) +#define LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE ( 0x00000800 ) +#define LSA_POLICY_MODE_ALL ( 0x00000FF7 ) +#define LSA_POLICY_MODE_ALL_NT4 ( 0x00000037 ) + +struct lsa_DATA_BUF { + uint32_t length; + uint32_t size; + uint8_t *data;/* [unique,length_is(length),size_is(size)] */ +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct lsa_DATA_BUF2 { + uint32_t size;/* [range(0,65536)] */ + uint8_t *data;/* [unique,size_is(size)] */ +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +enum lsa_TrustDomInfoEnum +#ifndef USE_UINT_ENUMS + { + LSA_TRUSTED_DOMAIN_INFO_NAME=1, + LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS=2, + LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET=3, + LSA_TRUSTED_DOMAIN_INFO_PASSWORD=4, + LSA_TRUSTED_DOMAIN_INFO_BASIC=5, + LSA_TRUSTED_DOMAIN_INFO_INFO_EX=6, + LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO=7, + LSA_TRUSTED_DOMAIN_INFO_FULL_INFO=8, + LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL=9, + LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL=10, + LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL=11, + LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL=12, + LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES=13 +} +#else + { __donnot_use_enum_lsa_TrustDomInfoEnum=0x7FFFFFFF} +#define LSA_TRUSTED_DOMAIN_INFO_NAME ( 1 ) +#define LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS ( 2 ) +#define LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET ( 3 ) +#define LSA_TRUSTED_DOMAIN_INFO_PASSWORD ( 4 ) +#define LSA_TRUSTED_DOMAIN_INFO_BASIC ( 5 ) +#define LSA_TRUSTED_DOMAIN_INFO_INFO_EX ( 6 ) +#define LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO ( 7 ) +#define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO ( 8 ) +#define LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL ( 9 ) +#define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL ( 10 ) +#define LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL ( 11 ) +#define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL ( 12 ) +#define LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES ( 13 ) +#endif +; + +/* bitmap lsa_TrustDirection */ +#define LSA_TRUST_DIRECTION_INBOUND ( 0x00000001 ) +#define LSA_TRUST_DIRECTION_OUTBOUND ( 0x00000002 ) + +enum lsa_TrustType +#ifndef USE_UINT_ENUMS + { + LSA_TRUST_TYPE_DOWNLEVEL=0x00000001, + LSA_TRUST_TYPE_UPLEVEL=0x00000002, + LSA_TRUST_TYPE_MIT=0x00000003 +} +#else + { __donnot_use_enum_lsa_TrustType=0x7FFFFFFF} +#define LSA_TRUST_TYPE_DOWNLEVEL ( 0x00000001 ) +#define LSA_TRUST_TYPE_UPLEVEL ( 0x00000002 ) +#define LSA_TRUST_TYPE_MIT ( 0x00000003 ) +#endif +; + +/* bitmap lsa_TrustAttributes */ +#define LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE ( 0x00000001 ) +#define LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY ( 0x00000002 ) +#define LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN ( 0x00000004 ) +#define LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE ( 0x00000008 ) +#define LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION ( 0x00000010 ) +#define LSA_TRUST_ATTRIBUTE_WITHIN_FOREST ( 0x00000020 ) +#define LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL ( 0x00000040 ) +#define LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION ( 0x00000080 ) + +struct lsa_TrustDomainInfoName { + struct lsa_StringLarge netbios_name; +}; + +struct lsa_TrustDomainInfoControllers { + uint32_t entries; + struct lsa_StringLarge *netbios_names;/* [unique,size_is(entries)] */ +}; + +struct lsa_TrustDomainInfoPosixOffset { + uint32_t posix_offset; +}; + +struct lsa_TrustDomainInfoPassword { + struct lsa_DATA_BUF *password;/* [unique] */ + struct lsa_DATA_BUF *old_password;/* [unique] */ +}; + +struct lsa_TrustDomainInfoBasic { + struct lsa_String netbios_name; + struct dom_sid2 *sid;/* [unique] */ +}; + +struct lsa_TrustDomainInfoInfoEx { + struct lsa_StringLarge domain_name; + struct lsa_StringLarge netbios_name; + struct dom_sid2 *sid;/* [unique] */ + uint32_t trust_direction; + enum lsa_TrustType trust_type; + uint32_t trust_attributes; +}; + +enum lsa_TrustAuthType +#ifndef USE_UINT_ENUMS + { + TRUST_AUTH_TYPE_NONE=0, + TRUST_AUTH_TYPE_NT4OWF=1, + TRUST_AUTH_TYPE_CLEAR=2, + TRUST_AUTH_TYPE_VERSION=3 +} +#else + { __donnot_use_enum_lsa_TrustAuthType=0x7FFFFFFF} +#define TRUST_AUTH_TYPE_NONE ( 0 ) +#define TRUST_AUTH_TYPE_NT4OWF ( 1 ) +#define TRUST_AUTH_TYPE_CLEAR ( 2 ) +#define TRUST_AUTH_TYPE_VERSION ( 3 ) +#endif +; + +struct lsa_TrustDomainInfoBuffer { + NTTIME last_update_time; + enum lsa_TrustAuthType AuthType; + struct lsa_DATA_BUF2 data; +}; + +struct lsa_TrustDomainInfoAuthInfo { + uint32_t incoming_count; + struct lsa_TrustDomainInfoBuffer *incoming_current_auth_info;/* [unique] */ + struct lsa_TrustDomainInfoBuffer *incoming_previous_auth_info;/* [unique] */ + uint32_t outgoing_count; + struct lsa_TrustDomainInfoBuffer *outgoing_current_auth_info;/* [unique] */ + struct lsa_TrustDomainInfoBuffer *outgoing_previous_auth_info;/* [unique] */ +}; + +struct lsa_TrustDomainInfoFullInfo { + struct lsa_TrustDomainInfoInfoEx info_ex; + struct lsa_TrustDomainInfoPosixOffset posix_offset; + struct lsa_TrustDomainInfoAuthInfo auth_info; +}; + +struct lsa_TrustDomainInfoAuthInfoInternal { + struct lsa_DATA_BUF2 auth_blob; +}; + +struct lsa_TrustDomainInfoFullInfoInternal { + struct lsa_TrustDomainInfoInfoEx info_ex; + struct lsa_TrustDomainInfoPosixOffset posix_offset; + struct lsa_TrustDomainInfoAuthInfoInternal auth_info; +}; + +struct lsa_TrustDomainInfoInfoEx2Internal { + struct lsa_TrustDomainInfoInfoEx info_ex; + uint32_t forest_trust_length; + uint8_t *forest_trust_data;/* [unique,size_is(forest_trust_length)] */ +}; + +struct lsa_TrustDomainInfoFullInfo2Internal { + struct lsa_TrustDomainInfoInfoEx2Internal info; + struct lsa_TrustDomainInfoPosixOffset posix_offset; + struct lsa_TrustDomainInfoAuthInfo auth_info; +}; + +struct lsa_TrustDomainInfoSupportedEncTypes { + uint32_t enc_types; +}; + +union lsa_TrustedDomainInfo { + struct lsa_TrustDomainInfoName name;/* [case(LSA_TRUSTED_DOMAIN_INFO_NAME)] */ + struct lsa_TrustDomainInfoControllers controllers;/* [case(LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS)] */ + struct lsa_TrustDomainInfoPosixOffset posix_offset;/* [case(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)] */ + struct lsa_TrustDomainInfoPassword password;/* [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)] */ + struct lsa_TrustDomainInfoBasic info_basic;/* [case(LSA_TRUSTED_DOMAIN_INFO_BASIC)] */ + struct lsa_TrustDomainInfoInfoEx info_ex;/* [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)] */ + struct lsa_TrustDomainInfoAuthInfo auth_info;/* [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)] */ + struct lsa_TrustDomainInfoFullInfo full_info;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)] */ + struct lsa_TrustDomainInfoAuthInfoInternal auth_info_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL)] */ + struct lsa_TrustDomainInfoFullInfoInternal full_info_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL)] */ + struct lsa_TrustDomainInfoInfoEx2Internal info_ex2_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL)] */ + struct lsa_TrustDomainInfoFullInfo2Internal full_info2_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL)] */ + struct lsa_TrustDomainInfoSupportedEncTypes enc_types;/* [case(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES)] */ +}/* [switch_type(lsa_TrustDomInfoEnum)] */; + +struct lsa_DATA_BUF_PTR { + struct lsa_DATA_BUF *buf;/* [unique] */ +}; + +struct lsa_RightAttribute { + const char *name;/* [unique,charset(UTF16)] */ +}; + +struct lsa_RightSet { + uint32_t count;/* [range(0,256)] */ + struct lsa_StringLarge *names;/* [unique,size_is(count)] */ +}; + +struct lsa_DomainListEx { + uint32_t count; + struct lsa_TrustDomainInfoInfoEx *domains;/* [unique,size_is(count)] */ +}; + +struct lsa_DomainInfoKerberos { + uint32_t enforce_restrictions; + uint64_t service_tkt_lifetime; + uint64_t user_tkt_lifetime; + uint64_t user_tkt_renewaltime; + uint64_t clock_skew; + uint64_t unknown6; +}; + +struct lsa_DomainInfoEfs { + uint32_t blob_size; + uint8_t *efs_blob;/* [unique,size_is(blob_size)] */ +}; + +enum lsa_DomainInfoEnum +#ifndef USE_UINT_ENUMS + { + LSA_DOMAIN_INFO_POLICY_EFS=2, + LSA_DOMAIN_INFO_POLICY_KERBEROS=3 +} +#else + { __donnot_use_enum_lsa_DomainInfoEnum=0x7FFFFFFF} +#define LSA_DOMAIN_INFO_POLICY_EFS ( 2 ) +#define LSA_DOMAIN_INFO_POLICY_KERBEROS ( 3 ) +#endif +; + +union lsa_DomainInformationPolicy { + struct lsa_DomainInfoEfs efs_info;/* [case(LSA_DOMAIN_INFO_POLICY_EFS)] */ + struct lsa_DomainInfoKerberos kerberos_info;/* [case(LSA_DOMAIN_INFO_POLICY_KERBEROS)] */ +}/* [switch_type(uint16)] */; + +struct lsa_TranslatedName2 { + enum lsa_SidType sid_type; + struct lsa_String name; + uint32_t sid_index; + uint32_t unknown; +}; + +struct lsa_TransNameArray2 { + uint32_t count;/* [range(0,1000)] */ + struct lsa_TranslatedName2 *names;/* [unique,size_is(count)] */ +}; + +struct lsa_TranslatedSid2 { + enum lsa_SidType sid_type; + uint32_t rid; + uint32_t sid_index; + uint32_t unknown; +}; + +struct lsa_TransSidArray2 { + uint32_t count;/* [range(0,1000)] */ + struct lsa_TranslatedSid2 *sids;/* [unique,size_is(count)] */ +}; + +struct lsa_TranslatedSid3 { + enum lsa_SidType sid_type; + struct dom_sid2 *sid;/* [unique] */ + uint32_t sid_index; + uint32_t flags; +}; + +struct lsa_TransSidArray3 { + uint32_t count;/* [range(0,1000)] */ + struct lsa_TranslatedSid3 *sids;/* [unique,size_is(count)] */ +}; + +struct lsa_ForestTrustBinaryData { + uint32_t length;/* [range(0,131072)] */ + uint8_t *data;/* [unique,size_is(length)] */ +}; + +struct lsa_ForestTrustDomainInfo { + struct dom_sid2 *domain_sid;/* [unique] */ + struct lsa_StringLarge dns_domain_name; + struct lsa_StringLarge netbios_domain_name; +}; + +union lsa_ForestTrustData { + struct lsa_String top_level_name;/* [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME)] */ + struct lsa_StringLarge top_level_name_ex;/* [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX)] */ + struct lsa_ForestTrustDomainInfo domain_info;/* [case(LSA_FOREST_TRUST_DOMAIN_INFO)] */ + struct lsa_ForestTrustBinaryData data;/* [default] */ +}/* [switch_type(uint32)] */; + +enum lsa_ForestTrustRecordType +#ifndef USE_UINT_ENUMS + { + LSA_FOREST_TRUST_TOP_LEVEL_NAME=0, + LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX=1, + LSA_FOREST_TRUST_DOMAIN_INFO=2, + LSA_FOREST_TRUST_RECORD_TYPE_LAST=3 +} +#else + { __donnot_use_enum_lsa_ForestTrustRecordType=0x7FFFFFFF} +#define LSA_FOREST_TRUST_TOP_LEVEL_NAME ( 0 ) +#define LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX ( 1 ) +#define LSA_FOREST_TRUST_DOMAIN_INFO ( 2 ) +#define LSA_FOREST_TRUST_RECORD_TYPE_LAST ( 3 ) +#endif +; + +struct lsa_ForestTrustRecord { + uint32_t flags; + enum lsa_ForestTrustRecordType level; + uint64_t unknown; + union lsa_ForestTrustData forest_trust_data;/* [switch_is(level)] */ +}; + +struct lsa_ForestTrustInformation { + uint32_t count;/* [range(0,4000)] */ + struct lsa_ForestTrustRecord **entries;/* [unique,size_is(count)] */ +}/* [public] */; + + +struct lsa_Close { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_Delete { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_EnumPrivs { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t max_count; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct lsa_PrivArray *privs;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_QuerySecurity { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t sec_info; + } in; + + struct { + struct sec_desc_buf **sdbuf;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_SetSecObj { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t sec_info; + struct sec_desc_buf *sdbuf;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_ChangePassword { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_OpenPolicy { + struct { + uint16_t *system_name;/* [unique] */ + struct lsa_ObjectAttribute *attr;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_QueryInfoPolicy { + struct { + struct policy_handle *handle;/* [ref] */ + enum lsa_PolicyInfo level; + } in; + + struct { + union lsa_PolicyInformation **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_SetInfoPolicy { + struct { + struct policy_handle *handle;/* [ref] */ + enum lsa_PolicyInfo level; + union lsa_PolicyInformation *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_ClearAuditLog { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_CreateAccount { + struct { + struct policy_handle *handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *acct_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_EnumAccounts { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t num_entries;/* [range(0,8192)] */ + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct lsa_SidArray *sids;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_CreateTrustedDomain { + struct { + struct policy_handle *policy_handle;/* [ref] */ + struct lsa_DomainInfo *info;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *trustdom_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_EnumTrustDom { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t max_size; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct lsa_DomainList *domains;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupNames { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t num_names;/* [range(0,1000)] */ + struct lsa_String *names;/* [size_is(num_names)] */ + enum lsa_LookupNamesLevel level; + struct lsa_TransSidArray *sids;/* [ref] */ + uint32_t *count;/* [ref] */ + } in; + + struct { + struct lsa_RefDomainList **domains;/* [ref] */ + struct lsa_TransSidArray *sids;/* [ref] */ + uint32_t *count;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupSids { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_SidArray *sids;/* [ref] */ + uint16_t level; + struct lsa_TransNameArray *names;/* [ref] */ + uint32_t *count;/* [ref] */ + } in; + + struct { + struct lsa_RefDomainList **domains;/* [ref] */ + struct lsa_TransNameArray *names;/* [ref] */ + uint32_t *count;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_CreateSecret { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String name; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *sec_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_OpenAccount { + struct { + struct policy_handle *handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *acct_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_EnumPrivsAccount { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct lsa_PrivilegeSet **privs;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_AddPrivilegesToAccount { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_PrivilegeSet *privs;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_RemovePrivilegesFromAccount { + struct { + struct policy_handle *handle;/* [ref] */ + uint8_t remove_all; + struct lsa_PrivilegeSet *privs;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_GetQuotasForAccount { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_SetQuotasForAccount { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_GetSystemAccessAccount { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + uint32_t *access_mask;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_SetSystemAccessAccount { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_OpenTrustedDomain { + struct { + struct policy_handle *handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *trustdom_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_QueryTrustedDomainInfo { + struct { + struct policy_handle *trustdom_handle;/* [ref] */ + enum lsa_TrustDomInfoEnum level; + } in; + + struct { + union lsa_TrustedDomainInfo **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_SetInformationTrustedDomain { + struct { + struct policy_handle *trustdom_handle;/* [ref] */ + enum lsa_TrustDomInfoEnum level; + union lsa_TrustedDomainInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_OpenSecret { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String name; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *sec_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_SetSecret { + struct { + struct policy_handle *sec_handle;/* [ref] */ + struct lsa_DATA_BUF *new_val;/* [unique] */ + struct lsa_DATA_BUF *old_val;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_QuerySecret { + struct { + struct policy_handle *sec_handle;/* [ref] */ + struct lsa_DATA_BUF_PTR *new_val;/* [unique] */ + NTTIME *new_mtime;/* [unique] */ + struct lsa_DATA_BUF_PTR *old_val;/* [unique] */ + NTTIME *old_mtime;/* [unique] */ + } in; + + struct { + struct lsa_DATA_BUF_PTR *new_val;/* [unique] */ + NTTIME *new_mtime;/* [unique] */ + struct lsa_DATA_BUF_PTR *old_val;/* [unique] */ + NTTIME *old_mtime;/* [unique] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupPrivValue { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String *name;/* [ref] */ + } in; + + struct { + struct lsa_LUID *luid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupPrivName { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_LUID *luid;/* [ref] */ + } in; + + struct { + struct lsa_StringLarge **name;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupPrivDisplayName { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String *name;/* [ref] */ + uint16_t language_id; + uint16_t language_id_sys; + } in; + + struct { + struct lsa_StringLarge **disp_name;/* [ref] */ + uint16_t *returned_language_id;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_DeleteObject { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_EnumAccountsWithUserRight { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String *name;/* [unique] */ + } in; + + struct { + struct lsa_SidArray *sids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_EnumAccountRights { + struct { + struct policy_handle *handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + } in; + + struct { + struct lsa_RightSet *rights;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_AddAccountRights { + struct { + struct policy_handle *handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + struct lsa_RightSet *rights;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_RemoveAccountRights { + struct { + struct policy_handle *handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + uint8_t remove_all; + struct lsa_RightSet *rights;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_QueryTrustedDomainInfoBySid { + struct { + struct policy_handle *handle;/* [ref] */ + struct dom_sid2 *dom_sid;/* [ref] */ + enum lsa_TrustDomInfoEnum level; + } in; + + struct { + union lsa_TrustedDomainInfo **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_SetTrustedDomainInfo { + struct { + struct policy_handle *handle;/* [ref] */ + struct dom_sid2 *dom_sid;/* [ref] */ + enum lsa_TrustDomInfoEnum level; + union lsa_TrustedDomainInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_DeleteTrustedDomain { + struct { + struct policy_handle *handle;/* [ref] */ + struct dom_sid2 *dom_sid;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_StorePrivateData { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_RetrievePrivateData { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_OpenPolicy2 { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + struct lsa_ObjectAttribute *attr;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_GetUserName { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + struct lsa_String **account_name;/* [ref] */ + struct lsa_String **authority_name;/* [unique] */ + } in; + + struct { + struct lsa_String **account_name;/* [ref] */ + struct lsa_String **authority_name;/* [unique] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_QueryInfoPolicy2 { + struct { + struct policy_handle *handle;/* [ref] */ + enum lsa_PolicyInfo level; + } in; + + struct { + union lsa_PolicyInformation **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_SetInfoPolicy2 { + struct { + struct policy_handle *handle;/* [ref] */ + enum lsa_PolicyInfo level; + union lsa_PolicyInformation *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_QueryTrustedDomainInfoByName { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String *trusted_domain;/* [ref] */ + enum lsa_TrustDomInfoEnum level; + } in; + + struct { + union lsa_TrustedDomainInfo **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_SetTrustedDomainInfoByName { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String trusted_domain; + enum lsa_TrustDomInfoEnum level; + union lsa_TrustedDomainInfo *info;/* [unique,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_EnumTrustedDomainsEx { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t max_size; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct lsa_DomainListEx *domains;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_CreateTrustedDomainEx { + struct { + struct policy_handle *policy_handle;/* [ref] */ + struct lsa_TrustDomainInfoInfoEx *info;/* [ref] */ + struct lsa_TrustDomainInfoAuthInfoInternal *auth_info;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *trustdom_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_CloseTrustedDomainEx { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_QueryDomainInformationPolicy { + struct { + struct policy_handle *handle;/* [ref] */ + uint16_t level; + } in; + + struct { + union lsa_DomainInformationPolicy **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_SetDomainInformationPolicy { + struct { + struct policy_handle *handle;/* [ref] */ + uint16_t level; + union lsa_DomainInformationPolicy *info;/* [unique,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_OpenTrustedDomainByName { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String name; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *trustdom_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_TestCall { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupSids2 { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_SidArray *sids;/* [ref] */ + uint16_t level; + uint32_t unknown1; + uint32_t unknown2; + struct lsa_TransNameArray2 *names;/* [ref] */ + uint32_t *count;/* [ref] */ + } in; + + struct { + struct lsa_RefDomainList **domains;/* [ref] */ + struct lsa_TransNameArray2 *names;/* [ref] */ + uint32_t *count;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupNames2 { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t num_names;/* [range(0,1000)] */ + struct lsa_String *names;/* [size_is(num_names)] */ + enum lsa_LookupNamesLevel level; + uint32_t lookup_options; + uint32_t client_revision; + struct lsa_TransSidArray2 *sids;/* [ref] */ + uint32_t *count;/* [ref] */ + } in; + + struct { + struct lsa_RefDomainList **domains;/* [ref] */ + struct lsa_TransSidArray2 *sids;/* [ref] */ + uint32_t *count;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_CreateTrustedDomainEx2 { + struct { + struct policy_handle *policy_handle;/* [ref] */ + struct lsa_TrustDomainInfoInfoEx *info;/* [ref] */ + struct lsa_TrustDomainInfoAuthInfoInternal *auth_info;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *trustdom_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRWRITE { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRREAD { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRENUMERATE { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRWRITEDOMAINCREDENTIALS { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRREADDOMAINCREDENTIALS { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRDELETE { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRGETTARGETINFO { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRPROFILELOADED { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupNames3 { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t num_names;/* [range(0,1000)] */ + struct lsa_String *names;/* [size_is(num_names)] */ + enum lsa_LookupNamesLevel level; + uint32_t lookup_options; + uint32_t client_revision; + struct lsa_TransSidArray3 *sids;/* [ref] */ + uint32_t *count;/* [ref] */ + } in; + + struct { + struct lsa_RefDomainList **domains;/* [ref] */ + struct lsa_TransSidArray3 *sids;/* [ref] */ + uint32_t *count;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRGETSESSIONTYPES { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_LSARREGISTERAUDITEVENT { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_LSARGENAUDITEVENT { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_LSARUNREGISTERAUDITEVENT { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_lsaRQueryForestTrustInformation { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String *trusted_domain_name;/* [ref] */ + uint16_t unknown; + } in; + + struct { + struct lsa_ForestTrustInformation **forest_trust_info;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_LSARSETFORESTTRUSTINFORMATION { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_CREDRRENAME { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupSids3 { + struct { + struct lsa_SidArray *sids;/* [ref] */ + uint16_t level; + uint32_t unknown1; + uint32_t unknown2; + struct lsa_TransNameArray2 *names;/* [ref] */ + uint32_t *count;/* [ref] */ + } in; + + struct { + struct lsa_RefDomainList **domains;/* [ref] */ + struct lsa_TransNameArray2 *names;/* [ref] */ + uint32_t *count;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_LookupNames4 { + struct { + uint32_t num_names;/* [range(0,1000)] */ + struct lsa_String *names;/* [size_is(num_names)] */ + enum lsa_LookupNamesLevel level; + uint32_t lookup_options; + uint32_t client_revision; + struct lsa_TransSidArray3 *sids;/* [ref] */ + uint32_t *count;/* [ref] */ + } in; + + struct { + struct lsa_RefDomainList **domains;/* [ref] */ + struct lsa_TransSidArray3 *sids;/* [ref] */ + uint32_t *count;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct lsa_LSAROPENPOLICYSCE { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE { + struct { + NTSTATUS result; + } out; + +}; + + +struct lsa_LSARADTREPORTSECURITYEVENT { + struct { + NTSTATUS result; + } out; + +}; + +#endif /* _HEADER_lsarpc */ diff --git a/librpc/gen_ndr/misc.h b/librpc/gen_ndr/misc.h new file mode 100644 index 0000000000..de4abdcae5 --- /dev/null +++ b/librpc/gen_ndr/misc.h @@ -0,0 +1,45 @@ +/* header auto-generated by pidl */ + +#include + +#ifndef _HEADER_misc +#define _HEADER_misc + +struct GUID { + uint32_t time_low; + uint16_t time_mid; + uint16_t time_hi_and_version; + uint8_t clock_seq[2]; + uint8_t node[6]; +}/* [noprint,gensize,public] */; + +struct ndr_syntax_id { + struct GUID uuid; + uint32_t if_version; +}/* [public] */; + +struct policy_handle { + uint32_t handle_type; + struct GUID uuid; +}/* [public] */; + +enum netr_SchannelType +#ifndef USE_UINT_ENUMS + { + SEC_CHAN_NULL=0, + SEC_CHAN_WKSTA=2, + SEC_CHAN_DNS_DOMAIN=3, + SEC_CHAN_DOMAIN=4, + SEC_CHAN_BDC=6 +} +#else + { __donnot_use_enum_netr_SchannelType=0x7FFFFFFF} +#define SEC_CHAN_NULL ( 0 ) +#define SEC_CHAN_WKSTA ( 2 ) +#define SEC_CHAN_DNS_DOMAIN ( 3 ) +#define SEC_CHAN_DOMAIN ( 4 ) +#define SEC_CHAN_BDC ( 6 ) +#endif +; + +#endif /* _HEADER_misc */ diff --git a/librpc/gen_ndr/named_pipe_auth.h b/librpc/gen_ndr/named_pipe_auth.h new file mode 100644 index 0000000000..5f4ba9afb1 --- /dev/null +++ b/librpc/gen_ndr/named_pipe_auth.h @@ -0,0 +1,32 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/netlogon.h" +#ifndef _HEADER_named_pipe_auth +#define _HEADER_named_pipe_auth + +#define NAMED_PIPE_AUTH_MAGIC ( "NPAM" ) +union named_pipe_auth_req_info { + struct netr_SamInfo3 info1;/* [case] */ +}/* [switch_type(uint32)] */; + +struct named_pipe_auth_req { + uint32_t length;/* [value(ndr_size_named_pipe_auth_req(r,ndr->flags)-4),flag(LIBNDR_FLAG_BIGENDIAN)] */ + const char *magic;/* [value(NAMED_PIPE_AUTH_MAGIC),charset(DOS)] */ + uint32_t level; + union named_pipe_auth_req_info info;/* [switch_is(level)] */ +}/* [gensize,public] */; + +union named_pipe_auth_rep_info { +}/* [switch_type(uint32)] */; + +struct named_pipe_auth_rep { + uint32_t length;/* [value(ndr_size_named_pipe_auth_rep(r,ndr->flags)-4),flag(LIBNDR_FLAG_BIGENDIAN)] */ + const char *magic;/* [value(NAMED_PIPE_AUTH_MAGIC),charset(DOS)] */ + uint32_t level; + union named_pipe_auth_rep_info info;/* [switch_is(level)] */ + NTSTATUS status; +}/* [gensize,public] */; + +#endif /* _HEADER_named_pipe_auth */ diff --git a/librpc/gen_ndr/nbt.h b/librpc/gen_ndr/nbt.h new file mode 100644 index 0000000000..4b872d7936 --- /dev/null +++ b/librpc/gen_ndr/nbt.h @@ -0,0 +1,694 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/security.h" +#include "librpc/gen_ndr/svcctl.h" +#include "librpc/gen_ndr/samr.h" +#ifndef _HEADER_nbt +#define _HEADER_nbt + +#define NBT_NAME_SERVICE_PORT ( 137 ) +#define NBT_DGRAM_SERVICE_PORT ( 138 ) +#define NBT_MAILSLOT_NETLOGON ( "\\MAILSLOT\\NET\\NETLOGON" ) +#define NBT_MAILSLOT_NTLOGON ( "\\MAILSLOT\\NET\\NTLOGON" ) +#define NBT_MAILSLOT_GETDC ( "\\MAILSLOT\\NET\\GETDC" ) +#define NBT_MAILSLOT_BROWSE ( "\\MAILSLOT\\BROWSE" ) +#define DGRAM_SMB ( 0xff534d42 ) +/* bitmap nbt_operation */ +#define NBT_RCODE ( 0x000F ) +#define NBT_FLAG_BROADCAST ( 0x0010 ) +#define NBT_FLAG_RECURSION_AVAIL ( 0x0080 ) +#define NBT_FLAG_RECURSION_DESIRED ( 0x0100 ) +#define NBT_FLAG_TRUNCATION ( 0x0200 ) +#define NBT_FLAG_AUTHORITIVE ( 0x0400 ) +#define NBT_OPCODE ( 0x7800 ) +#define NBT_FLAG_REPLY ( 0x8000 ) + +enum nbt_opcode +#ifndef USE_UINT_ENUMS + { + NBT_OPCODE_QUERY=(0x0<<11), + NBT_OPCODE_REGISTER=(0x5<<11), + NBT_OPCODE_RELEASE=(0x6<<11), + NBT_OPCODE_WACK=(0x7<<11), + NBT_OPCODE_REFRESH=(0x8<<11), + NBT_OPCODE_REFRESH2=(0x9<<11), + NBT_OPCODE_MULTI_HOME_REG=(0xf<<11) +} +#else + { __donnot_use_enum_nbt_opcode=0x7FFFFFFF} +#define NBT_OPCODE_QUERY ( (0x0<<11) ) +#define NBT_OPCODE_REGISTER ( (0x5<<11) ) +#define NBT_OPCODE_RELEASE ( (0x6<<11) ) +#define NBT_OPCODE_WACK ( (0x7<<11) ) +#define NBT_OPCODE_REFRESH ( (0x8<<11) ) +#define NBT_OPCODE_REFRESH2 ( (0x9<<11) ) +#define NBT_OPCODE_MULTI_HOME_REG ( (0xf<<11) ) +#endif +; + +enum nbt_rcode +#ifndef USE_UINT_ENUMS + { + NBT_RCODE_OK=0x0, + NBT_RCODE_FMT=0x1, + NBT_RCODE_SVR=0x2, + NBT_RCODE_NAM=0x3, + NBT_RCODE_IMP=0x4, + NBT_RCODE_RFS=0x5, + NBT_RCODE_ACT=0x6, + NBT_RCODE_CFT=0x7 +} +#else + { __donnot_use_enum_nbt_rcode=0x7FFFFFFF} +#define NBT_RCODE_OK ( 0x0 ) +#define NBT_RCODE_FMT ( 0x1 ) +#define NBT_RCODE_SVR ( 0x2 ) +#define NBT_RCODE_NAM ( 0x3 ) +#define NBT_RCODE_IMP ( 0x4 ) +#define NBT_RCODE_RFS ( 0x5 ) +#define NBT_RCODE_ACT ( 0x6 ) +#define NBT_RCODE_CFT ( 0x7 ) +#endif +; + +enum nbt_name_type +#ifndef USE_UINT_ENUMS + { + NBT_NAME_CLIENT=0x00, + NBT_NAME_MS=0x01, + NBT_NAME_USER=0x03, + NBT_NAME_SERVER=0x20, + NBT_NAME_PDC=0x1B, + NBT_NAME_LOGON=0x1C, + NBT_NAME_MASTER=0x1D, + NBT_NAME_BROWSER=0x1E +} +#else + { __donnot_use_enum_nbt_name_type=0x7FFFFFFF} +#define NBT_NAME_CLIENT ( 0x00 ) +#define NBT_NAME_MS ( 0x01 ) +#define NBT_NAME_USER ( 0x03 ) +#define NBT_NAME_SERVER ( 0x20 ) +#define NBT_NAME_PDC ( 0x1B ) +#define NBT_NAME_LOGON ( 0x1C ) +#define NBT_NAME_MASTER ( 0x1D ) +#define NBT_NAME_BROWSER ( 0x1E ) +#endif +; + +struct nbt_name { + const char * name; + const char * scope; + enum nbt_name_type type; +}/* [nopull,public,nopush] */; + +enum nbt_qclass +#ifndef USE_UINT_ENUMS + { + NBT_QCLASS_IP=0x01 +} +#else + { __donnot_use_enum_nbt_qclass=0x7FFFFFFF} +#define NBT_QCLASS_IP ( 0x01 ) +#endif +; + +enum nbt_qtype +#ifndef USE_UINT_ENUMS + { + NBT_QTYPE_ADDRESS=0x0001, + NBT_QTYPE_NAMESERVICE=0x0002, + NBT_QTYPE_NULL=0x000A, + NBT_QTYPE_NETBIOS=0x0020, + NBT_QTYPE_STATUS=0x0021 +} +#else + { __donnot_use_enum_nbt_qtype=0x7FFFFFFF} +#define NBT_QTYPE_ADDRESS ( 0x0001 ) +#define NBT_QTYPE_NAMESERVICE ( 0x0002 ) +#define NBT_QTYPE_NULL ( 0x000A ) +#define NBT_QTYPE_NETBIOS ( 0x0020 ) +#define NBT_QTYPE_STATUS ( 0x0021 ) +#endif +; + +struct nbt_name_question { + struct nbt_name name; + enum nbt_qtype question_type; + enum nbt_qclass question_class; +}; + +enum nbt_node_type +#ifndef USE_UINT_ENUMS + { + NBT_NODE_B=0x0000, + NBT_NODE_P=0x2000, + NBT_NODE_M=0x4000, + NBT_NODE_H=0x6000 +} +#else + { __donnot_use_enum_nbt_node_type=0x7FFFFFFF} +#define NBT_NODE_B ( 0x0000 ) +#define NBT_NODE_P ( 0x2000 ) +#define NBT_NODE_M ( 0x4000 ) +#define NBT_NODE_H ( 0x6000 ) +#endif +; + +/* bitmap nb_flags */ +#define NBT_NM_PERMANENT ( 0x0200 ) +#define NBT_NM_ACTIVE ( 0x0400 ) +#define NBT_NM_CONFLICT ( 0x0800 ) +#define NBT_NM_DEREGISTER ( 0x1000 ) +#define NBT_NM_OWNER_TYPE ( 0x6000 ) +#define NBT_NM_GROUP ( 0x8000 ) + +struct nbt_rdata_address { + uint16_t nb_flags; + const char * ipaddr; +}; + +struct nbt_rdata_netbios { + uint16_t length; + struct nbt_rdata_address *addresses; +}; + +struct nbt_statistics { + uint8_t unit_id[6]; + uint8_t jumpers; + uint8_t test_result; + uint16_t version_number; + uint16_t period_of_statistics; + uint16_t number_of_crcs; + uint16_t number_alignment_errors; + uint16_t number_of_collisions; + uint16_t number_send_aborts; + uint32_t number_good_sends; + uint32_t number_good_receives; + uint16_t number_retransmits; + uint16_t number_no_resource_conditions; + uint16_t number_free_command_blocks; + uint16_t total_number_command_blocks; + uint16_t max_total_number_command_blocks; + uint16_t number_pending_sessions; + uint16_t max_number_pending_sessions; + uint16_t max_total_sessions_possible; + uint16_t session_data_packet_size; +}; + +struct nbt_status_name { + const char *name;/* [charset(DOS)] */ + enum nbt_name_type type; + uint16_t nb_flags; +}; + +struct nbt_rdata_status { + uint16_t length;/* [value(num_names*18+47)] */ + uint8_t num_names; + struct nbt_status_name *names; + struct nbt_statistics statistics; +}; + +struct nbt_rdata_data { + uint16_t length; + uint8_t *data; +}; + +union nbt_rdata { + struct nbt_rdata_netbios netbios;/* [case(NBT_QTYPE_NETBIOS)] */ + struct nbt_rdata_status status;/* [case(NBT_QTYPE_STATUS)] */ + struct nbt_rdata_data data;/* [default] */ +}/* [nodiscriminant,public] */; + +struct nbt_res_rec { + struct nbt_name name; + enum nbt_qtype rr_type; + enum nbt_qclass rr_class; + uint32_t ttl; + union nbt_rdata rdata;/* [switch_is(rr_type)] */ +}/* [nopush,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct nbt_name_packet { + uint16_t name_trn_id; + uint16_t operation; + uint16_t qdcount; + uint16_t ancount; + uint16_t nscount; + uint16_t arcount; + struct nbt_name_question *questions; + struct nbt_res_rec *answers; + struct nbt_res_rec *nsrecs; + struct nbt_res_rec *additional; + DATA_BLOB padding;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}/* [public,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX)] */; + +enum dgram_msg_type +#ifndef USE_UINT_ENUMS + { + DGRAM_DIRECT_UNIQUE=0x10, + DGRAM_DIRECT_GROUP=0x11, + DGRAM_BCAST=0x12, + DGRAM_ERROR=0x13, + DGRAM_QUERY=0x14, + DGRAM_QUERY_POSITIVE=0x15, + DGRAM_QUERY_NEGATIVE=0x16 +} +#else + { __donnot_use_enum_dgram_msg_type=0x7FFFFFFF} +#define DGRAM_DIRECT_UNIQUE ( 0x10 ) +#define DGRAM_DIRECT_GROUP ( 0x11 ) +#define DGRAM_BCAST ( 0x12 ) +#define DGRAM_ERROR ( 0x13 ) +#define DGRAM_QUERY ( 0x14 ) +#define DGRAM_QUERY_POSITIVE ( 0x15 ) +#define DGRAM_QUERY_NEGATIVE ( 0x16 ) +#endif +; + +/* bitmap dgram_flags */ +#define DGRAM_FLAG_MORE ( 0x01 ) +#define DGRAM_FLAG_FIRST ( 0x02 ) +#define DGRAM_FLAG_NODE_TYPE ( 0x0C ) + +enum dgram_node_type +#ifndef USE_UINT_ENUMS + { + DGRAM_NODE_B=0x00, + DGRAM_NODE_P=0x04, + DGRAM_NODE_M=0x08, + DGRAM_NODE_NBDD=0x0C +} +#else + { __donnot_use_enum_dgram_node_type=0x7FFFFFFF} +#define DGRAM_NODE_B ( 0x00 ) +#define DGRAM_NODE_P ( 0x04 ) +#define DGRAM_NODE_M ( 0x08 ) +#define DGRAM_NODE_NBDD ( 0x0C ) +#endif +; + +enum smb_command +#ifndef USE_UINT_ENUMS + { + SMB_TRANSACTION=0x25 +} +#else + { __donnot_use_enum_smb_command=0x7FFFFFFF} +#define SMB_TRANSACTION ( 0x25 ) +#endif +; + +struct smb_trans_body { + uint8_t wct;/* [value(17),range(17,17)] */ + uint16_t total_param_count; + uint16_t total_data_count; + uint16_t max_param_count; + uint16_t max_data_count; + uint8_t max_setup_count; + uint8_t pad; + uint16_t trans_flags; + uint32_t timeout; + uint16_t reserved; + uint16_t param_count; + uint16_t param_offset; + uint16_t data_count; + uint16_t data_offset; + uint8_t setup_count;/* [value(3),range(3,3)] */ + uint8_t pad2; + uint16_t opcode; + uint16_t priority; + uint16_t _class; + uint16_t byte_count;/* [value(strlen(mailslot_name)+1+data.length)] */ + const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + DATA_BLOB data;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}; + +union smb_body { + struct smb_trans_body trans;/* [case(SMB_TRANSACTION)] */ +}/* [nodiscriminant] */; + +struct dgram_smb_packet { + enum smb_command smb_command; + uint8_t err_class; + uint8_t pad; + uint16_t err_code; + uint8_t flags; + uint16_t flags2; + uint16_t pid_high; + uint8_t signature[8]; + uint16_t reserved; + uint16_t tid; + uint16_t pid; + uint16_t vuid; + uint16_t mid; + union smb_body body;/* [switch_is(smb_command)] */ +}/* [public,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX)] */; + +union dgram_message_body { + struct dgram_smb_packet smb;/* [case(DGRAM_SMB)] */ +}/* [nodiscriminant] */; + +struct dgram_message { + uint16_t length; + uint16_t offset; + struct nbt_name source_name; + struct nbt_name dest_name; + uint32_t dgram_body_type; + union dgram_message_body body;/* [switch_is(dgram_body_type)] */ +}; + +enum dgram_err_code +#ifndef USE_UINT_ENUMS + { + DGRAM_ERROR_NAME_NOT_PRESENT=0x82, + DGRAM_ERROR_INVALID_SOURCE=0x83, + DGRAM_ERROR_INVALID_DEST=0x84 +} +#else + { __donnot_use_enum_dgram_err_code=0x7FFFFFFF} +#define DGRAM_ERROR_NAME_NOT_PRESENT ( 0x82 ) +#define DGRAM_ERROR_INVALID_SOURCE ( 0x83 ) +#define DGRAM_ERROR_INVALID_DEST ( 0x84 ) +#endif +; + +union dgram_data { + struct dgram_message msg;/* [case(DGRAM_DIRECT_UNIQUE)] */ + enum dgram_err_code error;/* [case(DGRAM_ERROR)] */ + struct nbt_name dest_name;/* [case(DGRAM_QUERY)] */ +}/* [nodiscriminant] */; + +struct nbt_dgram_packet { + enum dgram_msg_type msg_type; + uint8_t flags; + uint16_t dgram_id; + const char * src_addr; + uint16_t src_port; + union dgram_data data;/* [switch_is(msg_type)] */ +}/* [public,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX)] */; + +struct nbt_sockaddr { + uint32_t sockaddr_family; + const char * pdc_ip;/* [flag(LIBNDR_FLAG_BIGENDIAN)] */ + DATA_BLOB remaining;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}/* [gensize,public] */; + +/* bitmap nbt_server_type */ +#define NBT_SERVER_PDC ( 0x00000001 ) +#define NBT_SERVER_GC ( 0x00000004 ) +#define NBT_SERVER_LDAP ( 0x00000008 ) +#define NBT_SERVER_DS ( 0x00000010 ) +#define NBT_SERVER_KDC ( 0x00000020 ) +#define NBT_SERVER_TIMESERV ( 0x00000040 ) +#define NBT_SERVER_CLOSEST ( 0x00000080 ) +#define NBT_SERVER_WRITABLE ( 0x00000100 ) +#define NBT_SERVER_GOOD_TIMESERV ( 0x00000200 ) +#define NBT_SERVER_NDNC ( 0x00000400 ) +#define NBT_SERVER_SELECT_SECRET_DOMAIN_6 ( 0x00000800 ) +#define NBT_SERVER_FULL_SECRET_DOMAIN_6 ( 0x00001000 ) + +/* bitmap netlogon_nt_version_flags */ +#define NETLOGON_NT_VERSION_1 ( 0x00000001 ) +#define NETLOGON_NT_VERSION_5 ( 0x00000002 ) +#define NETLOGON_NT_VERSION_5EX ( 0x00000004 ) +#define NETLOGON_NT_VERSION_5EX_WITH_IP ( 0x00000008 ) +#define NETLOGON_NT_VERSION_WITH_CLOSEST_SITE ( 0x00000010 ) +#define NETLOGON_NT_VERSION_AVIOD_NT4EMUL ( 0x01000000 ) +#define NETLOGON_NT_VERSION_PDC ( 0x10000000 ) +#define NETLOGON_NT_VERSION_IP ( 0x20000000 ) +#define NETLOGON_NT_VERSION_LOCAL ( 0x40000000 ) +#define NETLOGON_NT_VERSION_GC ( 0x80000000 ) + +enum netlogon_command +#ifndef USE_UINT_ENUMS + { + LOGON_PRIMARY_QUERY=7, + NETLOGON_ANNOUNCE_UAS=10, + NETLOGON_RESPONSE_FROM_PDC=12, + LOGON_SAM_LOGON_REQUEST=18, + LOGON_SAM_LOGON_RESPONSE=19, + LOGON_SAM_LOGON_PAUSE_RESPONSE=20, + LOGON_SAM_LOGON_USER_UNKNOWN=21, + LOGON_SAM_LOGON_RESPONSE_EX=23, + LOGON_SAM_LOGON_PAUSE_RESPONSE_EX=24, + LOGON_SAM_LOGON_USER_UNKNOWN_EX=25 +} +#else + { __donnot_use_enum_netlogon_command=0x7FFFFFFF} +#define LOGON_PRIMARY_QUERY ( 7 ) +#define NETLOGON_ANNOUNCE_UAS ( 10 ) +#define NETLOGON_RESPONSE_FROM_PDC ( 12 ) +#define LOGON_SAM_LOGON_REQUEST ( 18 ) +#define LOGON_SAM_LOGON_RESPONSE ( 19 ) +#define LOGON_SAM_LOGON_PAUSE_RESPONSE ( 20 ) +#define LOGON_SAM_LOGON_USER_UNKNOWN ( 21 ) +#define LOGON_SAM_LOGON_RESPONSE_EX ( 23 ) +#define LOGON_SAM_LOGON_PAUSE_RESPONSE_EX ( 24 ) +#define LOGON_SAM_LOGON_USER_UNKNOWN_EX ( 25 ) +#endif +; + +struct NETLOGON_SAM_LOGON_REQUEST { + uint16_t request_count; + const char * computer_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t acct_control; + uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */ + DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */ + struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */ + uint32_t nt_version; + uint16_t lmnt_token; + uint16_t lm20_token; +}/* [nopull,nopush] */; + +struct NETLOGON_SAM_LOGON_RESPONSE_NT40 { + enum netlogon_command command; + const char * server;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * domain;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t nt_version; + uint16_t lmnt_token; + uint16_t lm20_token; +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; + +struct NETLOGON_SAM_LOGON_RESPONSE { + enum netlogon_command command; + const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * domain_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + struct GUID domain_uuid; + struct GUID zero_uuid; + const char * forest; + const char * dns_domain; + const char * pdc_dns_name; + const char * pdc_ip; + uint32_t server_type; + uint32_t nt_version; + uint16_t lmnt_token; + uint16_t lm20_token; +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; + +struct NETLOGON_SAM_LOGON_RESPONSE_EX { + enum netlogon_command command; + uint16_t sbz; + uint32_t server_type; + struct GUID domain_uuid; + const char * forest; + const char * dns_domain; + const char * pdc_dns_name; + const char * domain; + const char * pdc_name; + const char * user_name; + const char * server_site; + const char * client_site; + uint8_t sockaddr_size;/* [value(ndr_size_nbt_sockaddr(&sockaddr,ndr->flags))] */ + struct nbt_sockaddr sockaddr;/* [subcontext_size(sockaddr_size),subcontext(0)] */ + const char * next_closest_site; + uint32_t nt_version; + uint16_t lmnt_token; + uint16_t lm20_token; +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; + +struct nbt_netlogon_query_for_pdc { + const char * computer_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ + const char * unicode_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t nt_version; + uint16_t lmnt_token; + uint16_t lm20_token; +}; + +struct nbt_netlogon_response_from_pdc { + enum netlogon_command command; + const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ + const char * unicode_pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * domain_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t nt_version; + uint16_t lmnt_token; + uint16_t lm20_token; +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; + +enum netr_SamDatabaseID; + +struct nbt_db_change_info { + enum netr_SamDatabaseID db_index; + uint64_t serial; + NTTIME timestamp; +}; + +struct NETLOGON_DB_CHANGE { + uint32_t serial_lo; + time_t timestamp; + uint32_t pulse; + uint32_t random; + const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + const char * domain;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ + const char * unicode_pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * unicode_domain;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t db_count; + struct nbt_db_change_info *dbchange; + uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */ + struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */ + uint32_t message_format_version; + uint32_t message_token; +}; + +union nbt_netlogon_request { + struct NETLOGON_SAM_LOGON_REQUEST logon;/* [case(LOGON_SAM_LOGON_REQUEST)] */ + struct nbt_netlogon_query_for_pdc pdc;/* [case(LOGON_PRIMARY_QUERY)] */ + struct NETLOGON_DB_CHANGE uas;/* [case(NETLOGON_ANNOUNCE_UAS)] */ +}/* [nodiscriminant] */; + +struct nbt_netlogon_packet { + enum netlogon_command command; + union nbt_netlogon_request req;/* [switch_is(command)] */ +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; + +enum nbt_browse_opcode +#ifndef USE_UINT_ENUMS + { + HostAnnouncement=1, + AnnouncementRequest=2, + Election=8, + GetBackupListReq=9, + GetBackupListResp=10, + BecomeBackup=11, + DomainAnnouncement=12, + MasterAnnouncement=13, + ResetBrowserState=14, + LocalMasterAnnouncement=15 +} +#else + { __donnot_use_enum_nbt_browse_opcode=0x7FFFFFFF} +#define HostAnnouncement ( 1 ) +#define AnnouncementRequest ( 2 ) +#define Election ( 8 ) +#define GetBackupListReq ( 9 ) +#define GetBackupListResp ( 10 ) +#define BecomeBackup ( 11 ) +#define DomainAnnouncement ( 12 ) +#define MasterAnnouncement ( 13 ) +#define ResetBrowserState ( 14 ) +#define LocalMasterAnnouncement ( 15 ) +#endif +; + +struct nbt_browse_host_announcement { + uint8_t UpdateCount; + uint32_t Periodicity; + const char *ServerName;/* [charset(DOS)] */ + uint8_t OSMajor; + uint8_t OSMinor; + uint32_t ServerType; + uint8_t BroMajorVer; + uint8_t BroMinorVer; + uint16_t Signature; + const char * Comment;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct nbt_browse_announcement_request { + uint8_t Unused; + const char * ResponseName;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct nbt_browse_election_request { + uint8_t Version; + uint32_t Criteria; + uint32_t UpTime; + uint32_t Reserved; + const char * ServerName;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct nbt_browse_backup_list_request { + uint8_t ReqCount; + uint32_t Token; +}; + +struct nbt_browse_backup_list_response { + uint8_t BackupCount; + uint32_t Token; + struct nbt_name *BackupServerList; +}; + +struct nbt_browse_become_backup { + const char * BrowserName;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct nbt_browse_domain_announcement { + uint8_t UpdateCount; + uint32_t Periodicity; + const char *ServerName;/* [charset(DOS)] */ + uint8_t OSMajor; + uint8_t OSMinor; + uint32_t ServerType; + uint32_t MysteriousField; + const char * Comment;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct nbt_browse_master_announcement { + const char * ServerName;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct nbt_browse_reset_state { + uint8_t Command; +}; + +struct nbt_browse_local_master_announcement { + uint8_t UpdateCount; + uint32_t Periodicity; + const char *ServerName;/* [charset(DOS)] */ + uint8_t OSMajor; + uint8_t OSMinor; + uint32_t ServerType; + uint8_t BroMajorVer; + uint8_t BroMinorVer; + uint16_t Signature; + const char * Comment;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +union nbt_browse_payload { + struct nbt_browse_host_announcement host_annoucement;/* [case(HostAnnouncement)] */ + struct nbt_browse_announcement_request announcement_request;/* [case(AnnouncementRequest)] */ + struct nbt_browse_election_request election_request;/* [case(Election)] */ + struct nbt_browse_backup_list_request backup_list_request;/* [case(GetBackupListReq)] */ + struct nbt_browse_backup_list_response backup_list_response;/* [case(GetBackupListResp)] */ + struct nbt_browse_become_backup become_backup;/* [case(BecomeBackup)] */ + struct nbt_browse_domain_announcement domain_announcement;/* [case(DomainAnnouncement)] */ + struct nbt_browse_master_announcement master_announcement;/* [case(MasterAnnouncement)] */ + struct nbt_browse_reset_state reset_browser_state;/* [case(ResetBrowserState)] */ + struct nbt_browse_local_master_announcement local_master_announcement;/* [case(LocalMasterAnnouncement)] */ +}/* [nodiscriminant] */; + +struct nbt_browse_packet { + enum nbt_browse_opcode opcode; + union nbt_browse_payload payload;/* [switch_is(opcode)] */ +}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; + +#endif /* _HEADER_nbt */ diff --git a/librpc/gen_ndr/ndr_dfs.c b/librpc/gen_ndr/ndr_dfs.c new file mode 100644 index 0000000000..75a0d4b755 --- /dev/null +++ b/librpc/gen_ndr/ndr_dfs.c @@ -0,0 +1,5795 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_dfs.h" + +#include "librpc/gen_ndr/ndr_misc.h" +static enum ndr_err_code ndr_push_dfs_ManagerVersion(struct ndr_push *ndr, int ndr_flags, enum dfs_ManagerVersion r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_ManagerVersion(struct ndr_pull *ndr, int ndr_flags, enum dfs_ManagerVersion *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_ManagerVersion(struct ndr_print *ndr, const char *name, enum dfs_ManagerVersion r) +{ + const char *val = NULL; + + switch (r) { + case DFS_MANAGER_VERSION_NT4: val = "DFS_MANAGER_VERSION_NT4"; break; + case DFS_MANAGER_VERSION_W2K: val = "DFS_MANAGER_VERSION_W2K"; break; + case DFS_MANAGER_VERSION_W2K3: val = "DFS_MANAGER_VERSION_W2K3"; break; + case DFS_MANAGER_VERSION_W2K8: val = "DFS_MANAGER_VERSION_W2K8"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dfs_Info0(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info0(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info0(struct ndr_print *ndr, const char *name, const struct dfs_Info0 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info0"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info1(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info1(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info1 *r) +{ + uint32_t _ptr_path; + TALLOC_CTX *_mem_save_path_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->path); + } else { + r->path = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); + if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info1(struct ndr_print *ndr, const char *name, const struct dfs_Info1 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info1"); + ndr->depth++; + ndr_print_ptr(ndr, "path", r->path); + ndr->depth++; + if (r->path) { + ndr_print_string(ndr, "path", r->path); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_dfs_VolumeState(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_dfs_VolumeState(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_VolumeState(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_OK", DFS_VOLUME_STATE_OK, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_INCONSISTENT", DFS_VOLUME_STATE_INCONSISTENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_OFFLINE", DFS_VOLUME_STATE_OFFLINE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_ONLINE", DFS_VOLUME_STATE_ONLINE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_STANDALONE", DFS_VOLUME_STATE_STANDALONE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_AD_BLOB", DFS_VOLUME_STATE_AD_BLOB, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info2(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info2(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info2 *r) +{ + uint32_t _ptr_path; + TALLOC_CTX *_mem_save_path_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->path); + } else { + r->path = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_stores)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); + if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info2(struct ndr_print *ndr, const char *name, const struct dfs_Info2 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info2"); + ndr->depth++; + ndr_print_ptr(ndr, "path", r->path); + ndr->depth++; + if (r->path) { + ndr_print_string(ndr, "path", r->path); + } + ndr->depth--; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_dfs_VolumeState(ndr, "state", r->state); + ndr_print_uint32(ndr, "num_stores", r->num_stores); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_dfs_StorageState(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_dfs_StorageState(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_StorageState(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_STORAGE_STATE_OFFLINE", DFS_STORAGE_STATE_OFFLINE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_STORAGE_STATE_ONLINE", DFS_STORAGE_STATE_ONLINE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_STORAGE_STATE_ACTIVE", DFS_STORAGE_STATE_ACTIVE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_StorageInfo(struct ndr_push *ndr, int ndr_flags, const struct dfs_StorageInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dfs_StorageState(ndr, NDR_SCALARS, r->state)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->share)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server, ndr_charset_length(r->server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->share) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->share, ndr_charset_length(r->share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_StorageInfo(struct ndr_pull *ndr, int ndr_flags, struct dfs_StorageInfo *r) +{ + uint32_t _ptr_server; + TALLOC_CTX *_mem_save_server_0; + uint32_t _ptr_share; + TALLOC_CTX *_mem_save_share_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dfs_StorageState(ndr, NDR_SCALARS, &r->state)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->server); + } else { + r->server = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); + if (_ptr_share) { + NDR_PULL_ALLOC(ndr, r->share); + } else { + r->share = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server)); + if (ndr_get_array_length(ndr, &r->server) > ndr_get_array_size(ndr, &r->server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server), ndr_get_array_length(ndr, &r->server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server, ndr_get_array_length(ndr, &r->server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + if (r->share) { + _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->share, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->share)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->share)); + if (ndr_get_array_length(ndr, &r->share) > ndr_get_array_size(ndr, &r->share)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->share), ndr_get_array_length(ndr, &r->share)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->share, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_StorageInfo(struct ndr_print *ndr, const char *name, const struct dfs_StorageInfo *r) +{ + ndr_print_struct(ndr, name, "dfs_StorageInfo"); + ndr->depth++; + ndr_print_dfs_StorageState(ndr, "state", r->state); + ndr_print_ptr(ndr, "server", r->server); + ndr->depth++; + if (r->server) { + ndr_print_string(ndr, "server", r->server); + } + ndr->depth--; + ndr_print_ptr(ndr, "share", r->share); + ndr->depth++; + if (r->share) { + ndr_print_string(ndr, "share", r->share); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info3(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info3 *r) +{ + uint32_t cntr_stores_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->stores)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->stores) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); + } + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info3(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info3 *r) +{ + uint32_t _ptr_path; + TALLOC_CTX *_mem_save_path_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + uint32_t _ptr_stores; + uint32_t cntr_stores_1; + TALLOC_CTX *_mem_save_stores_0; + TALLOC_CTX *_mem_save_stores_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->path); + } else { + r->path = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_stores)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_stores)); + if (_ptr_stores) { + NDR_PULL_ALLOC(ndr, r->stores); + } else { + r->stores = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); + if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + if (r->stores) { + _mem_save_stores_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->stores)); + NDR_PULL_ALLOC_N(ndr, r->stores, ndr_get_array_size(ndr, &r->stores)); + _mem_save_stores_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); + } + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_0, 0); + } + if (r->stores) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->stores, r->num_stores)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info3(struct ndr_print *ndr, const char *name, const struct dfs_Info3 *r) +{ + uint32_t cntr_stores_1; + ndr_print_struct(ndr, name, "dfs_Info3"); + ndr->depth++; + ndr_print_ptr(ndr, "path", r->path); + ndr->depth++; + if (r->path) { + ndr_print_string(ndr, "path", r->path); + } + ndr->depth--; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_dfs_VolumeState(ndr, "state", r->state); + ndr_print_uint32(ndr, "num_stores", r->num_stores); + ndr_print_ptr(ndr, "stores", r->stores); + ndr->depth++; + if (r->stores) { + ndr->print(ndr, "%s: ARRAY(%d)", "stores", (int)r->num_stores); + ndr->depth++; + for (cntr_stores_1=0;cntr_stores_1num_stores;cntr_stores_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { + ndr_print_dfs_StorageInfo(ndr, "stores", &r->stores[cntr_stores_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info4(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info4 *r) +{ + uint32_t cntr_stores_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->stores)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->stores) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); + } + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info4(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info4 *r) +{ + uint32_t _ptr_path; + TALLOC_CTX *_mem_save_path_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + uint32_t _ptr_stores; + uint32_t cntr_stores_1; + TALLOC_CTX *_mem_save_stores_0; + TALLOC_CTX *_mem_save_stores_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->path); + } else { + r->path = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_stores)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_stores)); + if (_ptr_stores) { + NDR_PULL_ALLOC(ndr, r->stores); + } else { + r->stores = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); + if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + if (r->stores) { + _mem_save_stores_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->stores)); + NDR_PULL_ALLOC_N(ndr, r->stores, ndr_get_array_size(ndr, &r->stores)); + _mem_save_stores_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); + } + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_0, 0); + } + if (r->stores) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->stores, r->num_stores)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info4(struct ndr_print *ndr, const char *name, const struct dfs_Info4 *r) +{ + uint32_t cntr_stores_1; + ndr_print_struct(ndr, name, "dfs_Info4"); + ndr->depth++; + ndr_print_ptr(ndr, "path", r->path); + ndr->depth++; + if (r->path) { + ndr_print_string(ndr, "path", r->path); + } + ndr->depth--; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_dfs_VolumeState(ndr, "state", r->state); + ndr_print_uint32(ndr, "timeout", r->timeout); + ndr_print_GUID(ndr, "guid", &r->guid); + ndr_print_uint32(ndr, "num_stores", r->num_stores); + ndr_print_ptr(ndr, "stores", r->stores); + ndr->depth++; + if (r->stores) { + ndr->print(ndr, "%s: ARRAY(%d)", "stores", (int)r->num_stores); + ndr->depth++; + for (cntr_stores_1=0;cntr_stores_1num_stores;cntr_stores_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { + ndr_print_dfs_StorageInfo(ndr, "stores", &r->stores[cntr_stores_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_dfs_PropertyFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_dfs_PropertyFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_PropertyFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_INSITE_REFERRALS", DFS_PROPERTY_FLAG_INSITE_REFERRALS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_ROOT_SCALABILITY", DFS_PROPERTY_FLAG_ROOT_SCALABILITY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_SITE_COSTING", DFS_PROPERTY_FLAG_SITE_COSTING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_TARGET_FAILBACK", DFS_PROPERTY_FLAG_TARGET_FAILBACK, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_CLUSTER_ENABLED", DFS_PROPERTY_FLAG_CLUSTER_ENABLED, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info5(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_push_dfs_PropertyFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pktsize)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info5(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info5 *r) +{ + uint32_t _ptr_path; + TALLOC_CTX *_mem_save_path_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->path); + } else { + r->path = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_pull_dfs_PropertyFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pktsize)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_stores)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); + if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info5(struct ndr_print *ndr, const char *name, const struct dfs_Info5 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info5"); + ndr->depth++; + ndr_print_ptr(ndr, "path", r->path); + ndr->depth++; + if (r->path) { + ndr_print_string(ndr, "path", r->path); + } + ndr->depth--; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_dfs_VolumeState(ndr, "state", r->state); + ndr_print_uint32(ndr, "timeout", r->timeout); + ndr_print_GUID(ndr, "guid", &r->guid); + ndr_print_dfs_PropertyFlags(ndr, "flags", r->flags); + ndr_print_uint32(ndr, "pktsize", r->pktsize); + ndr_print_uint32(ndr, "num_stores", r->num_stores); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Target_PriorityClass(struct ndr_push *ndr, int ndr_flags, enum dfs_Target_PriorityClass r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Target_PriorityClass(struct ndr_pull *ndr, int ndr_flags, enum dfs_Target_PriorityClass *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Target_PriorityClass(struct ndr_print *ndr, const char *name, enum dfs_Target_PriorityClass r) +{ + const char *val = NULL; + + switch (r) { + case DFS_INVALID_PRIORITY_CLASS: val = "DFS_INVALID_PRIORITY_CLASS"; break; + case DFS_SITE_COST_NORMAL_PRIORITY_CLASS: val = "DFS_SITE_COST_NORMAL_PRIORITY_CLASS"; break; + case DFS_GLOBAL_HIGH_PRIORITY_CLASS: val = "DFS_GLOBAL_HIGH_PRIORITY_CLASS"; break; + case DFS_SITE_COST_HIGH_PRIORITY_CLASS: val = "DFS_SITE_COST_HIGH_PRIORITY_CLASS"; break; + case DFS_SITE_COST_LOW_PRIORITY_CLASS: val = "DFS_SITE_COST_LOW_PRIORITY_CLASS"; break; + case DFS_GLOBAL_LOW_PRIORITY_CLASS: val = "DFS_GLOBAL_LOW_PRIORITY_CLASS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dfs_Target_Priority(struct ndr_push *ndr, int ndr_flags, const struct dfs_Target_Priority *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dfs_Target_PriorityClass(ndr, NDR_SCALARS, r->target_priority_class)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->target_priority_rank)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Target_Priority(struct ndr_pull *ndr, int ndr_flags, struct dfs_Target_Priority *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dfs_Target_PriorityClass(ndr, NDR_SCALARS, &r->target_priority_class)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->target_priority_rank)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Target_Priority(struct ndr_print *ndr, const char *name, const struct dfs_Target_Priority *r) +{ + ndr_print_struct(ndr, name, "dfs_Target_Priority"); + ndr->depth++; + ndr_print_dfs_Target_PriorityClass(ndr, "target_priority_class", r->target_priority_class); + ndr_print_uint16(ndr, "target_priority_rank", r->target_priority_rank); + ndr_print_uint16(ndr, "reserved", r->reserved); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_StorageInfo2(struct ndr_push *ndr, int ndr_flags, const struct dfs_StorageInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_dfs_Target_Priority(ndr, NDR_SCALARS, &r->target_priority)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_StorageInfo2(struct ndr_pull *ndr, int ndr_flags, struct dfs_StorageInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_dfs_Target_Priority(ndr, NDR_SCALARS, &r->target_priority)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_StorageInfo2(struct ndr_print *ndr, const char *name, const struct dfs_StorageInfo2 *r) +{ + ndr_print_struct(ndr, name, "dfs_StorageInfo2"); + ndr->depth++; + ndr_print_dfs_StorageInfo(ndr, "info", &r->info); + ndr_print_dfs_Target_Priority(ndr, "target_priority", &r->target_priority); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info6(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info6 *r) +{ + uint32_t cntr_stores_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entry_path)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_push_dfs_PropertyFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pktsize)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_stores)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->stores)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entry_path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->entry_path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->entry_path, ndr_charset_length(r->entry_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->stores) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_push_dfs_StorageInfo2(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); + } + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_push_dfs_StorageInfo2(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info6(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info6 *r) +{ + uint32_t _ptr_entry_path; + TALLOC_CTX *_mem_save_entry_path_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + uint32_t _ptr_stores; + uint32_t cntr_stores_1; + TALLOC_CTX *_mem_save_stores_0; + TALLOC_CTX *_mem_save_stores_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entry_path)); + if (_ptr_entry_path) { + NDR_PULL_ALLOC(ndr, r->entry_path); + } else { + r->entry_path = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_pull_dfs_PropertyFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pktsize)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_stores)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_stores)); + if (_ptr_stores) { + NDR_PULL_ALLOC(ndr, r->stores); + } else { + r->stores = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entry_path) { + _mem_save_entry_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entry_path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entry_path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->entry_path)); + if (ndr_get_array_length(ndr, &r->entry_path) > ndr_get_array_size(ndr, &r->entry_path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->entry_path), ndr_get_array_length(ndr, &r->entry_path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->entry_path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->entry_path, ndr_get_array_length(ndr, &r->entry_path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_path_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + if (r->stores) { + _mem_save_stores_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->stores)); + NDR_PULL_ALLOC_N(ndr, r->stores, ndr_get_array_size(ndr, &r->stores)); + _mem_save_stores_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_pull_dfs_StorageInfo2(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); + } + for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { + NDR_CHECK(ndr_pull_dfs_StorageInfo2(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_0, 0); + } + if (r->stores) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->stores, r->num_stores)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info6(struct ndr_print *ndr, const char *name, const struct dfs_Info6 *r) +{ + uint32_t cntr_stores_1; + ndr_print_struct(ndr, name, "dfs_Info6"); + ndr->depth++; + ndr_print_ptr(ndr, "entry_path", r->entry_path); + ndr->depth++; + if (r->entry_path) { + ndr_print_string(ndr, "entry_path", r->entry_path); + } + ndr->depth--; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_dfs_VolumeState(ndr, "state", r->state); + ndr_print_uint32(ndr, "timeout", r->timeout); + ndr_print_GUID(ndr, "guid", &r->guid); + ndr_print_dfs_PropertyFlags(ndr, "flags", r->flags); + ndr_print_uint32(ndr, "pktsize", r->pktsize); + ndr_print_uint16(ndr, "num_stores", r->num_stores); + ndr_print_ptr(ndr, "stores", r->stores); + ndr->depth++; + if (r->stores) { + ndr->print(ndr, "%s: ARRAY(%d)", "stores", (int)r->num_stores); + ndr->depth++; + for (cntr_stores_1=0;cntr_stores_1num_stores;cntr_stores_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { + ndr_print_dfs_StorageInfo2(ndr, "stores", &r->stores[cntr_stores_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info7(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->generation_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info7(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->generation_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info7(struct ndr_print *ndr, const char *name, const struct dfs_Info7 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info7"); + ndr->depth++; + ndr_print_GUID(ndr, "generation_guid", &r->generation_guid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info100(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info100 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info100(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info100 *r) +{ + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info100(struct ndr_print *ndr, const char *name, const struct dfs_Info100 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info100"); + ndr->depth++; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info101(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info101 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dfs_StorageState(ndr, NDR_SCALARS, r->state)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info101(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info101 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dfs_StorageState(ndr, NDR_SCALARS, &r->state)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info101(struct ndr_print *ndr, const char *name, const struct dfs_Info101 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info101"); + ndr->depth++; + ndr_print_dfs_StorageState(ndr, "state", r->state); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info102(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info102 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info102(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info102 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info102(struct ndr_print *ndr, const char *name, const struct dfs_Info102 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info102"); + ndr->depth++; + ndr_print_uint32(ndr, "timeout", r->timeout); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info103(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info103 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dfs_PropertyFlags(ndr, NDR_SCALARS, r->flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info103(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info103 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dfs_PropertyFlags(ndr, NDR_SCALARS, &r->flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info103(struct ndr_print *ndr, const char *name, const struct dfs_Info103 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info103"); + ndr->depth++; + ndr_print_dfs_PropertyFlags(ndr, "flags", r->flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info104(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info104 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dfs_Target_Priority(ndr, NDR_SCALARS, &r->priority)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info104(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info104 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dfs_Target_Priority(ndr, NDR_SCALARS, &r->priority)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info104(struct ndr_print *ndr, const char *name, const struct dfs_Info104 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info104"); + ndr->depth++; + ndr_print_dfs_Target_Priority(ndr, "priority", &r->priority); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info105(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info105 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->property_flag_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->property_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info105(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info105 *r) +{ + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->property_flag_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->property_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info105(struct ndr_print *ndr, const char *name, const struct dfs_Info105 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info105"); + ndr->depth++; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_dfs_VolumeState(ndr, "state", r->state); + ndr_print_uint32(ndr, "timeout", r->timeout); + ndr_print_uint32(ndr, "property_flag_mask", r->property_flag_mask); + ndr_print_uint32(ndr, "property_flags", r->property_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info106(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info106 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dfs_StorageState(ndr, NDR_SCALARS, r->state)); + NDR_CHECK(ndr_push_dfs_Target_Priority(ndr, NDR_SCALARS, &r->priority)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info106(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info106 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dfs_StorageState(ndr, NDR_SCALARS, &r->state)); + NDR_CHECK(ndr_pull_dfs_Target_Priority(ndr, NDR_SCALARS, &r->priority)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info106(struct ndr_print *ndr, const char *name, const struct dfs_Info106 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info106"); + ndr->depth++; + ndr_print_dfs_StorageState(ndr, "state", r->state); + ndr_print_dfs_Target_Priority(ndr, "priority", &r->priority); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info200(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info200 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dom_root)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dom_root) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dom_root, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dom_root, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dom_root, ndr_charset_length(r->dom_root, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info200(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info200 *r) +{ + uint32_t _ptr_dom_root; + TALLOC_CTX *_mem_save_dom_root_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_root)); + if (_ptr_dom_root) { + NDR_PULL_ALLOC(ndr, r->dom_root); + } else { + r->dom_root = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dom_root) { + _mem_save_dom_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dom_root, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dom_root)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dom_root)); + if (ndr_get_array_length(ndr, &r->dom_root) > ndr_get_array_size(ndr, &r->dom_root)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dom_root), ndr_get_array_length(ndr, &r->dom_root)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dom_root), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dom_root, ndr_get_array_length(ndr, &r->dom_root), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_root_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info200(struct ndr_print *ndr, const char *name, const struct dfs_Info200 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info200"); + ndr->depth++; + ndr_print_ptr(ndr, "dom_root", r->dom_root); + ndr->depth++; + if (r->dom_root) { + ndr_print_string(ndr, "dom_root", r->dom_root); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_VolumeFlavor(struct ndr_push *ndr, int ndr_flags, enum dfs_VolumeFlavor r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_VolumeFlavor(struct ndr_pull *ndr, int ndr_flags, enum dfs_VolumeFlavor *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_VolumeFlavor(struct ndr_print *ndr, const char *name, enum dfs_VolumeFlavor r) +{ + const char *val = NULL; + + switch (r) { + case DFS_VOLUME_FLAVOR_STANDALONE: val = "DFS_VOLUME_FLAVOR_STANDALONE"; break; + case DFS_VOLUME_FLAVOR_AD_BLOB: val = "DFS_VOLUME_FLAVOR_AD_BLOB"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dfs_Info300(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info300 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dfs_VolumeFlavor(ndr, NDR_SCALARS, r->flavor)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dom_root)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dom_root) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dom_root, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dom_root, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dom_root, ndr_charset_length(r->dom_root, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info300(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info300 *r) +{ + uint32_t _ptr_dom_root; + TALLOC_CTX *_mem_save_dom_root_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dfs_VolumeFlavor(ndr, NDR_SCALARS, &r->flavor)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_root)); + if (_ptr_dom_root) { + NDR_PULL_ALLOC(ndr, r->dom_root); + } else { + r->dom_root = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dom_root) { + _mem_save_dom_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dom_root, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dom_root)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dom_root)); + if (ndr_get_array_length(ndr, &r->dom_root) > ndr_get_array_size(ndr, &r->dom_root)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dom_root), ndr_get_array_length(ndr, &r->dom_root)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dom_root), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dom_root, ndr_get_array_length(ndr, &r->dom_root), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_root_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info300(struct ndr_print *ndr, const char *name, const struct dfs_Info300 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info300"); + ndr->depth++; + ndr_print_dfs_VolumeFlavor(ndr, "flavor", r->flavor); + ndr_print_ptr(ndr, "dom_root", r->dom_root); + ndr->depth++; + if (r->dom_root) { + ndr_print_string(ndr, "dom_root", r->dom_root); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Info(struct ndr_push *ndr, int ndr_flags, const union dfs_Info *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info7)); + break; } + + case 100: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info100)); + break; } + + case 101: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info101)); + break; } + + case 102: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info102)); + break; } + + case 103: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info103)); + break; } + + case 104: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info104)); + break; } + + case 105: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info105)); + break; } + + case 106: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info106)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->info0) { + NDR_CHECK(ndr_push_dfs_Info0(ndr, NDR_SCALARS, r->info0)); + } + break; + + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_dfs_Info1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + case 2: + if (r->info2) { + NDR_CHECK(ndr_push_dfs_Info2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + } + break; + + case 3: + if (r->info3) { + NDR_CHECK(ndr_push_dfs_Info3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + } + break; + + case 4: + if (r->info4) { + NDR_CHECK(ndr_push_dfs_Info4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); + } + break; + + case 5: + if (r->info5) { + NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); + } + break; + + case 6: + if (r->info6) { + NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); + } + break; + + case 7: + if (r->info7) { + NDR_CHECK(ndr_push_dfs_Info7(ndr, NDR_SCALARS, r->info7)); + } + break; + + case 100: + if (r->info100) { + NDR_CHECK(ndr_push_dfs_Info100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); + } + break; + + case 101: + if (r->info101) { + NDR_CHECK(ndr_push_dfs_Info101(ndr, NDR_SCALARS, r->info101)); + } + break; + + case 102: + if (r->info102) { + NDR_CHECK(ndr_push_dfs_Info102(ndr, NDR_SCALARS, r->info102)); + } + break; + + case 103: + if (r->info103) { + NDR_CHECK(ndr_push_dfs_Info103(ndr, NDR_SCALARS, r->info103)); + } + break; + + case 104: + if (r->info104) { + NDR_CHECK(ndr_push_dfs_Info104(ndr, NDR_SCALARS, r->info104)); + } + break; + + case 105: + if (r->info105) { + NDR_CHECK(ndr_push_dfs_Info105(ndr, NDR_SCALARS|NDR_BUFFERS, r->info105)); + } + break; + + case 106: + if (r->info106) { + NDR_CHECK(ndr_push_dfs_Info106(ndr, NDR_SCALARS, r->info106)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Info(struct ndr_pull *ndr, int ndr_flags, union dfs_Info *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info0_0; + TALLOC_CTX *_mem_save_info1_0; + TALLOC_CTX *_mem_save_info2_0; + TALLOC_CTX *_mem_save_info3_0; + TALLOC_CTX *_mem_save_info4_0; + TALLOC_CTX *_mem_save_info5_0; + TALLOC_CTX *_mem_save_info6_0; + TALLOC_CTX *_mem_save_info7_0; + TALLOC_CTX *_mem_save_info100_0; + TALLOC_CTX *_mem_save_info101_0; + TALLOC_CTX *_mem_save_info102_0; + TALLOC_CTX *_mem_save_info103_0; + TALLOC_CTX *_mem_save_info104_0; + TALLOC_CTX *_mem_save_info105_0; + TALLOC_CTX *_mem_save_info106_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_info0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); + if (_ptr_info0) { + NDR_PULL_ALLOC(ndr, r->info0); + } else { + r->info0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_info2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_PULL_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + + case 3: { + uint32_t _ptr_info3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); + if (_ptr_info3) { + NDR_PULL_ALLOC(ndr, r->info3); + } else { + r->info3 = NULL; + } + break; } + + case 4: { + uint32_t _ptr_info4; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4)); + if (_ptr_info4) { + NDR_PULL_ALLOC(ndr, r->info4); + } else { + r->info4 = NULL; + } + break; } + + case 5: { + uint32_t _ptr_info5; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info5)); + if (_ptr_info5) { + NDR_PULL_ALLOC(ndr, r->info5); + } else { + r->info5 = NULL; + } + break; } + + case 6: { + uint32_t _ptr_info6; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info6)); + if (_ptr_info6) { + NDR_PULL_ALLOC(ndr, r->info6); + } else { + r->info6 = NULL; + } + break; } + + case 7: { + uint32_t _ptr_info7; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info7)); + if (_ptr_info7) { + NDR_PULL_ALLOC(ndr, r->info7); + } else { + r->info7 = NULL; + } + break; } + + case 100: { + uint32_t _ptr_info100; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info100)); + if (_ptr_info100) { + NDR_PULL_ALLOC(ndr, r->info100); + } else { + r->info100 = NULL; + } + break; } + + case 101: { + uint32_t _ptr_info101; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info101)); + if (_ptr_info101) { + NDR_PULL_ALLOC(ndr, r->info101); + } else { + r->info101 = NULL; + } + break; } + + case 102: { + uint32_t _ptr_info102; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info102)); + if (_ptr_info102) { + NDR_PULL_ALLOC(ndr, r->info102); + } else { + r->info102 = NULL; + } + break; } + + case 103: { + uint32_t _ptr_info103; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info103)); + if (_ptr_info103) { + NDR_PULL_ALLOC(ndr, r->info103); + } else { + r->info103 = NULL; + } + break; } + + case 104: { + uint32_t _ptr_info104; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info104)); + if (_ptr_info104) { + NDR_PULL_ALLOC(ndr, r->info104); + } else { + r->info104 = NULL; + } + break; } + + case 105: { + uint32_t _ptr_info105; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info105)); + if (_ptr_info105) { + NDR_PULL_ALLOC(ndr, r->info105); + } else { + r->info105 = NULL; + } + break; } + + case 106: { + uint32_t _ptr_info106; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info106)); + if (_ptr_info106) { + NDR_PULL_ALLOC(ndr, r->info106); + } else { + r->info106 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->info0) { + _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); + NDR_CHECK(ndr_pull_dfs_Info0(ndr, NDR_SCALARS, r->info0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); + } + break; + + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_dfs_Info1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + case 2: + if (r->info2) { + _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); + NDR_CHECK(ndr_pull_dfs_Info2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); + } + break; + + case 3: + if (r->info3) { + _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); + NDR_CHECK(ndr_pull_dfs_Info3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); + } + break; + + case 4: + if (r->info4) { + _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0); + NDR_CHECK(ndr_pull_dfs_Info4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0); + } + break; + + case 5: + if (r->info5) { + _mem_save_info5_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info5, 0); + NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info5_0, 0); + } + break; + + case 6: + if (r->info6) { + _mem_save_info6_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info6, 0); + NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info6_0, 0); + } + break; + + case 7: + if (r->info7) { + _mem_save_info7_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info7, 0); + NDR_CHECK(ndr_pull_dfs_Info7(ndr, NDR_SCALARS, r->info7)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info7_0, 0); + } + break; + + case 100: + if (r->info100) { + _mem_save_info100_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info100, 0); + NDR_CHECK(ndr_pull_dfs_Info100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info100_0, 0); + } + break; + + case 101: + if (r->info101) { + _mem_save_info101_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info101, 0); + NDR_CHECK(ndr_pull_dfs_Info101(ndr, NDR_SCALARS, r->info101)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info101_0, 0); + } + break; + + case 102: + if (r->info102) { + _mem_save_info102_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info102, 0); + NDR_CHECK(ndr_pull_dfs_Info102(ndr, NDR_SCALARS, r->info102)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info102_0, 0); + } + break; + + case 103: + if (r->info103) { + _mem_save_info103_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info103, 0); + NDR_CHECK(ndr_pull_dfs_Info103(ndr, NDR_SCALARS, r->info103)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info103_0, 0); + } + break; + + case 104: + if (r->info104) { + _mem_save_info104_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info104, 0); + NDR_CHECK(ndr_pull_dfs_Info104(ndr, NDR_SCALARS, r->info104)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info104_0, 0); + } + break; + + case 105: + if (r->info105) { + _mem_save_info105_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info105, 0); + NDR_CHECK(ndr_pull_dfs_Info105(ndr, NDR_SCALARS|NDR_BUFFERS, r->info105)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info105_0, 0); + } + break; + + case 106: + if (r->info106) { + _mem_save_info106_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info106, 0); + NDR_CHECK(ndr_pull_dfs_Info106(ndr, NDR_SCALARS, r->info106)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info106_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Info(struct ndr_print *ndr, const char *name, const union dfs_Info *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "dfs_Info"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "info0", r->info0); + ndr->depth++; + if (r->info0) { + ndr_print_dfs_Info0(ndr, "info0", r->info0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_dfs_Info1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_dfs_Info2(ndr, "info2", r->info2); + } + ndr->depth--; + break; + + case 3: + ndr_print_ptr(ndr, "info3", r->info3); + ndr->depth++; + if (r->info3) { + ndr_print_dfs_Info3(ndr, "info3", r->info3); + } + ndr->depth--; + break; + + case 4: + ndr_print_ptr(ndr, "info4", r->info4); + ndr->depth++; + if (r->info4) { + ndr_print_dfs_Info4(ndr, "info4", r->info4); + } + ndr->depth--; + break; + + case 5: + ndr_print_ptr(ndr, "info5", r->info5); + ndr->depth++; + if (r->info5) { + ndr_print_dfs_Info5(ndr, "info5", r->info5); + } + ndr->depth--; + break; + + case 6: + ndr_print_ptr(ndr, "info6", r->info6); + ndr->depth++; + if (r->info6) { + ndr_print_dfs_Info6(ndr, "info6", r->info6); + } + ndr->depth--; + break; + + case 7: + ndr_print_ptr(ndr, "info7", r->info7); + ndr->depth++; + if (r->info7) { + ndr_print_dfs_Info7(ndr, "info7", r->info7); + } + ndr->depth--; + break; + + case 100: + ndr_print_ptr(ndr, "info100", r->info100); + ndr->depth++; + if (r->info100) { + ndr_print_dfs_Info100(ndr, "info100", r->info100); + } + ndr->depth--; + break; + + case 101: + ndr_print_ptr(ndr, "info101", r->info101); + ndr->depth++; + if (r->info101) { + ndr_print_dfs_Info101(ndr, "info101", r->info101); + } + ndr->depth--; + break; + + case 102: + ndr_print_ptr(ndr, "info102", r->info102); + ndr->depth++; + if (r->info102) { + ndr_print_dfs_Info102(ndr, "info102", r->info102); + } + ndr->depth--; + break; + + case 103: + ndr_print_ptr(ndr, "info103", r->info103); + ndr->depth++; + if (r->info103) { + ndr_print_dfs_Info103(ndr, "info103", r->info103); + } + ndr->depth--; + break; + + case 104: + ndr_print_ptr(ndr, "info104", r->info104); + ndr->depth++; + if (r->info104) { + ndr_print_dfs_Info104(ndr, "info104", r->info104); + } + ndr->depth--; + break; + + case 105: + ndr_print_ptr(ndr, "info105", r->info105); + ndr->depth++; + if (r->info105) { + ndr_print_dfs_Info105(ndr, "info105", r->info105); + } + ndr->depth--; + break; + + case 106: + ndr_print_ptr(ndr, "info106", r->info106); + ndr->depth++; + if (r->info106) { + ndr_print_dfs_Info106(ndr, "info106", r->info106); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_dfs_EnumArray1(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray1 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info1(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info1(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray1(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray1 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info1(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info1(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray1 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info1(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumArray2(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray2 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info2(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info2(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray2(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray2 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info2(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info2(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray2 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info2(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumArray3(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray3 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info3(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info3(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray3(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray3 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info3(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info3(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray3 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray3"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info3(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumArray4(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray4 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info4(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info4(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray4(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray4 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info4(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info4(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray4 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray4"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info4(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumArray5(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray5 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray5(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray5 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray5(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray5 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray5"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info5(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumArray6(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray6 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray6(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray6 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray6(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray6 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray6"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info6(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumArray200(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray200 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info200(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info200(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray200(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray200 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info200(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info200(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray200 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray200"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info200(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumArray300(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray300 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info300(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info300(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray300(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray300 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info300(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info300(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray300(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray300 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray300"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info300(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumInfo(struct ndr_push *ndr, int ndr_flags, const union dfs_EnumInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info6)); + break; } + + case 200: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info200)); + break; } + + case 300: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info300)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_dfs_EnumArray1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + case 2: + if (r->info2) { + NDR_CHECK(ndr_push_dfs_EnumArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + } + break; + + case 3: + if (r->info3) { + NDR_CHECK(ndr_push_dfs_EnumArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + } + break; + + case 4: + if (r->info4) { + NDR_CHECK(ndr_push_dfs_EnumArray4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); + } + break; + + case 5: + if (r->info5) { + NDR_CHECK(ndr_push_dfs_EnumArray5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); + } + break; + + case 6: + if (r->info6) { + NDR_CHECK(ndr_push_dfs_EnumArray6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); + } + break; + + case 200: + if (r->info200) { + NDR_CHECK(ndr_push_dfs_EnumArray200(ndr, NDR_SCALARS|NDR_BUFFERS, r->info200)); + } + break; + + case 300: + if (r->info300) { + NDR_CHECK(ndr_push_dfs_EnumArray300(ndr, NDR_SCALARS|NDR_BUFFERS, r->info300)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumInfo(struct ndr_pull *ndr, int ndr_flags, union dfs_EnumInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info1_0; + TALLOC_CTX *_mem_save_info2_0; + TALLOC_CTX *_mem_save_info3_0; + TALLOC_CTX *_mem_save_info4_0; + TALLOC_CTX *_mem_save_info5_0; + TALLOC_CTX *_mem_save_info6_0; + TALLOC_CTX *_mem_save_info200_0; + TALLOC_CTX *_mem_save_info300_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_info2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_PULL_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + + case 3: { + uint32_t _ptr_info3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); + if (_ptr_info3) { + NDR_PULL_ALLOC(ndr, r->info3); + } else { + r->info3 = NULL; + } + break; } + + case 4: { + uint32_t _ptr_info4; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4)); + if (_ptr_info4) { + NDR_PULL_ALLOC(ndr, r->info4); + } else { + r->info4 = NULL; + } + break; } + + case 5: { + uint32_t _ptr_info5; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info5)); + if (_ptr_info5) { + NDR_PULL_ALLOC(ndr, r->info5); + } else { + r->info5 = NULL; + } + break; } + + case 6: { + uint32_t _ptr_info6; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info6)); + if (_ptr_info6) { + NDR_PULL_ALLOC(ndr, r->info6); + } else { + r->info6 = NULL; + } + break; } + + case 200: { + uint32_t _ptr_info200; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info200)); + if (_ptr_info200) { + NDR_PULL_ALLOC(ndr, r->info200); + } else { + r->info200 = NULL; + } + break; } + + case 300: { + uint32_t _ptr_info300; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info300)); + if (_ptr_info300) { + NDR_PULL_ALLOC(ndr, r->info300); + } else { + r->info300 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + case 2: + if (r->info2) { + _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); + } + break; + + case 3: + if (r->info3) { + _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); + } + break; + + case 4: + if (r->info4) { + _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0); + } + break; + + case 5: + if (r->info5) { + _mem_save_info5_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info5, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info5_0, 0); + } + break; + + case 6: + if (r->info6) { + _mem_save_info6_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info6, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info6_0, 0); + } + break; + + case 200: + if (r->info200) { + _mem_save_info200_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info200, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray200(ndr, NDR_SCALARS|NDR_BUFFERS, r->info200)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info200_0, 0); + } + break; + + case 300: + if (r->info300) { + _mem_save_info300_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info300, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray300(ndr, NDR_SCALARS|NDR_BUFFERS, r->info300)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info300_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumInfo(struct ndr_print *ndr, const char *name, const union dfs_EnumInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "dfs_EnumInfo"); + switch (level) { + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_dfs_EnumArray1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_dfs_EnumArray2(ndr, "info2", r->info2); + } + ndr->depth--; + break; + + case 3: + ndr_print_ptr(ndr, "info3", r->info3); + ndr->depth++; + if (r->info3) { + ndr_print_dfs_EnumArray3(ndr, "info3", r->info3); + } + ndr->depth--; + break; + + case 4: + ndr_print_ptr(ndr, "info4", r->info4); + ndr->depth++; + if (r->info4) { + ndr_print_dfs_EnumArray4(ndr, "info4", r->info4); + } + ndr->depth--; + break; + + case 5: + ndr_print_ptr(ndr, "info5", r->info5); + ndr->depth++; + if (r->info5) { + ndr_print_dfs_EnumArray5(ndr, "info5", r->info5); + } + ndr->depth--; + break; + + case 6: + ndr_print_ptr(ndr, "info6", r->info6); + ndr->depth++; + if (r->info6) { + ndr_print_dfs_EnumArray6(ndr, "info6", r->info6); + } + ndr->depth--; + break; + + case 200: + ndr_print_ptr(ndr, "info200", r->info200); + ndr->depth++; + if (r->info200) { + ndr_print_dfs_EnumArray200(ndr, "info200", r->info200); + } + ndr->depth--; + break; + + case 300: + ndr_print_ptr(ndr, "info300", r->info300); + ndr->depth++; + if (r->info300) { + ndr_print_dfs_EnumArray300(ndr, "info300", r->info300); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_dfs_EnumStruct(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumStruct *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->e, r->level)); + NDR_CHECK(ndr_push_dfs_EnumInfo(ndr, NDR_SCALARS, &r->e)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_dfs_EnumInfo(ndr, NDR_BUFFERS, &r->e)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumStruct(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumStruct *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->e, r->level)); + NDR_CHECK(ndr_pull_dfs_EnumInfo(ndr, NDR_SCALARS, &r->e)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_dfs_EnumInfo(ndr, NDR_BUFFERS, &r->e)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumStruct(struct ndr_print *ndr, const char *name, const struct dfs_EnumStruct *r) +{ + ndr_print_struct(ndr, name, "dfs_EnumStruct"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->e, r->level); + ndr_print_dfs_EnumInfo(ndr, "e", &r->e); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_UnknownStruct(struct ndr_push *ndr, int ndr_flags, const struct dfs_UnknownStruct *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->unknown2) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown2, ndr_charset_length(r->unknown2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_UnknownStruct(struct ndr_pull *ndr, int ndr_flags, struct dfs_UnknownStruct *r) +{ + uint32_t _ptr_unknown2; + TALLOC_CTX *_mem_save_unknown2_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); + if (_ptr_unknown2) { + NDR_PULL_ALLOC(ndr, r->unknown2); + } else { + r->unknown2 = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->unknown2) { + _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->unknown2, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown2)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown2)); + if (ndr_get_array_length(ndr, &r->unknown2) > ndr_get_array_size(ndr, &r->unknown2)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown2), ndr_get_array_length(ndr, &r->unknown2)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown2, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_UnknownStruct(struct ndr_print *ndr, const char *name, const struct dfs_UnknownStruct *r) +{ + ndr_print_struct(ndr, name, "dfs_UnknownStruct"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_ptr(ndr, "unknown2", r->unknown2); + ndr->depth++; + if (r->unknown2) { + ndr_print_string(ndr, "unknown2", r->unknown2); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_dfs_GetManagerVersion(struct ndr_push *ndr, int flags, const struct dfs_GetManagerVersion *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + 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 NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_dfs_GetManagerVersion(struct ndr_pull *ndr, int flags, struct dfs_GetManagerVersion *r) +{ + TALLOC_CTX *_mem_save_version_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_PULL_ALLOC(ndr, r->out.version); + ZERO_STRUCTP(r->out.version); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.version); + } + _mem_save_version_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.version, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dfs_ManagerVersion(ndr, NDR_SCALARS, r->out.version)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_0, LIBNDR_FLAG_REF_ALLOC); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_GetManagerVersion(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetManagerVersion *r) +{ + ndr_print_struct(ndr, name, "dfs_GetManagerVersion"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_GetManagerVersion"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_GetManagerVersion"); + ndr->depth++; + ndr_print_ptr(ndr, "version", r->out.version); + ndr->depth++; + ndr_print_dfs_ManagerVersion(ndr, "version", *r->out.version); + ndr->depth--; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 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 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server, ndr_charset_length(r->in.server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.share)); + if (r->in.share) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share, ndr_charset_length(r->in.share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.comment)); + if (r->in.comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.comment, ndr_charset_length(r->in.comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Add(struct ndr_pull *ndr, int flags, struct dfs_Add *r) +{ + uint32_t _ptr_share; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_share_0; + TALLOC_CTX *_mem_save_comment_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); + if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server)); + if (ndr_get_array_length(ndr, &r->in.server) > ndr_get_array_size(ndr, &r->in.server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server), ndr_get_array_length(ndr, &r->in.server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); + if (_ptr_share) { + NDR_PULL_ALLOC(ndr, r->in.share); + } else { + r->in.share = NULL; + } + if (r->in.share) { + _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.share, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share)); + if (ndr_get_array_length(ndr, &r->in.share) > ndr_get_array_size(ndr, &r->in.share)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share), ndr_get_array_length(ndr, &r->in.share)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->in.comment); + } else { + r->in.comment = NULL; + } + if (r->in.comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.comment)); + if (ndr_get_array_length(ndr, &r->in.comment) > ndr_get_array_size(ndr, &r->in.comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.comment), ndr_get_array_length(ndr, &r->in.comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.comment, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Add(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Add *r) +{ + ndr_print_struct(ndr, name, "dfs_Add"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_Add"); + ndr->depth++; + ndr_print_ptr(ndr, "path", r->in.path); + ndr->depth++; + ndr_print_string(ndr, "path", r->in.path); + ndr->depth--; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + ndr_print_string(ndr, "server", r->in.server); + ndr->depth--; + ndr_print_ptr(ndr, "share", r->in.share); + ndr->depth++; + if (r->in.share) { + ndr_print_string(ndr, "share", r->in.share); + } + ndr->depth--; + ndr_print_ptr(ndr, "comment", r->in.comment); + ndr->depth++; + if (r->in.comment) { + ndr_print_string(ndr, "comment", r->in.comment); + } + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_Add"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_entry_path, ndr_charset_length(r->in.dfs_entry_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.servername)); + if (r->in.servername) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.sharename)); + if (r->in.sharename) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.sharename, ndr_charset_length(r->in.sharename, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Remove(struct ndr_pull *ndr, int flags, struct dfs_Remove *r) +{ + uint32_t _ptr_servername; + uint32_t _ptr_sharename; + TALLOC_CTX *_mem_save_servername_0; + TALLOC_CTX *_mem_save_sharename_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_entry_path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_entry_path)); + if (ndr_get_array_length(ndr, &r->in.dfs_entry_path) > ndr_get_array_size(ndr, &r->in.dfs_entry_path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_entry_path), ndr_get_array_length(ndr, &r->in.dfs_entry_path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_entry_path, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername)); + if (_ptr_servername) { + NDR_PULL_ALLOC(ndr, r->in.servername); + } else { + r->in.servername = NULL; + } + if (r->in.servername) { + _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sharename)); + if (_ptr_sharename) { + NDR_PULL_ALLOC(ndr, r->in.sharename); + } else { + r->in.sharename = NULL; + } + if (r->in.sharename) { + _mem_save_sharename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sharename, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.sharename)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.sharename)); + if (ndr_get_array_length(ndr, &r->in.sharename) > ndr_get_array_size(ndr, &r->in.sharename)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.sharename), ndr_get_array_length(ndr, &r->in.sharename)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.sharename, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sharename_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Remove(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Remove *r) +{ + ndr_print_struct(ndr, name, "dfs_Remove"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_Remove"); + ndr->depth++; + ndr_print_ptr(ndr, "dfs_entry_path", r->in.dfs_entry_path); + ndr->depth++; + ndr_print_string(ndr, "dfs_entry_path", r->in.dfs_entry_path); + ndr->depth--; + ndr_print_ptr(ndr, "servername", r->in.servername); + ndr->depth++; + if (r->in.servername) { + ndr_print_string(ndr, "servername", r->in.servername); + } + ndr->depth--; + ndr_print_ptr(ndr, "sharename", r->in.sharename); + ndr->depth++; + if (r->in.sharename) { + ndr_print_string(ndr, "sharename", r->in.sharename); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_Remove"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_SetInfo(struct ndr_push *ndr, int flags, const struct dfs_SetInfo *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_entry_path, ndr_charset_length(r->in.dfs_entry_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.servername)); + if (r->in.servername) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.sharename)); + if (r->in.sharename) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); + 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 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)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_SetInfo(struct ndr_pull *ndr, int flags, struct dfs_SetInfo *r) +{ + uint32_t _ptr_servername; + uint32_t _ptr_sharename; + TALLOC_CTX *_mem_save_servername_0; + TALLOC_CTX *_mem_save_sharename_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_entry_path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_entry_path)); + if (ndr_get_array_length(ndr, &r->in.dfs_entry_path) > ndr_get_array_size(ndr, &r->in.dfs_entry_path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_entry_path), ndr_get_array_length(ndr, &r->in.dfs_entry_path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_entry_path, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername)); + if (_ptr_servername) { + NDR_PULL_ALLOC(ndr, r->in.servername); + } else { + r->in.servername = NULL; + } + if (r->in.servername) { + _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sharename)); + if (_ptr_sharename) { + NDR_PULL_ALLOC(ndr, r->in.sharename); + } else { + r->in.sharename = NULL; + } + if (r->in.sharename) { + _mem_save_sharename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sharename, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.sharename)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.sharename)); + if (ndr_get_array_length(ndr, &r->in.sharename) > ndr_get_array_size(ndr, &r->in.sharename)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.sharename), ndr_get_array_length(ndr, &r->in.sharename)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.sharename, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sharename_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_dfs_Info(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_SetInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetInfo *r) +{ + ndr_print_struct(ndr, name, "dfs_SetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_SetInfo"); + ndr->depth++; + ndr_print_string(ndr, "dfs_entry_path", r->in.dfs_entry_path); + ndr_print_ptr(ndr, "servername", r->in.servername); + ndr->depth++; + if (r->in.servername) { + ndr_print_string(ndr, "servername", r->in.servername); + } + ndr->depth--; + ndr_print_ptr(ndr, "sharename", r->in.sharename); + ndr->depth++; + if (r->in.sharename) { + ndr_print_string(ndr, "sharename", r->in.sharename); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_dfs_Info(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_SetInfo"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_GetInfo(struct ndr_push *ndr, int flags, const struct dfs_GetInfo *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_entry_path, ndr_charset_length(r->in.dfs_entry_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.servername)); + if (r->in.servername) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.sharename)); + if (r->in.sharename) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); + 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 (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_GetInfo(struct ndr_pull *ndr, int flags, struct dfs_GetInfo *r) +{ + uint32_t _ptr_servername; + uint32_t _ptr_sharename; + TALLOC_CTX *_mem_save_servername_0; + TALLOC_CTX *_mem_save_sharename_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_entry_path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_entry_path)); + if (ndr_get_array_length(ndr, &r->in.dfs_entry_path) > ndr_get_array_size(ndr, &r->in.dfs_entry_path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_entry_path), ndr_get_array_length(ndr, &r->in.dfs_entry_path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_entry_path, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername)); + if (_ptr_servername) { + NDR_PULL_ALLOC(ndr, r->in.servername); + } else { + r->in.servername = NULL; + } + if (r->in.servername) { + _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sharename)); + if (_ptr_sharename) { + NDR_PULL_ALLOC(ndr, r->in.sharename); + } else { + r->in.sharename = NULL; + } + if (r->in.sharename) { + _mem_save_sharename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sharename, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.sharename)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.sharename)); + if (ndr_get_array_length(ndr, &r->in.sharename) > ndr_get_array_size(ndr, &r->in.sharename)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.sharename), ndr_get_array_length(ndr, &r->in.sharename)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.sharename, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sharename_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_dfs_Info(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_GetInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetInfo *r) +{ + ndr_print_struct(ndr, name, "dfs_GetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_GetInfo"); + ndr->depth++; + ndr_print_string(ndr, "dfs_entry_path", r->in.dfs_entry_path); + ndr_print_ptr(ndr, "servername", r->in.servername); + ndr->depth++; + if (r->in.servername) { + ndr_print_string(ndr, "servername", r->in.servername); + } + ndr->depth--; + ndr_print_ptr(ndr, "sharename", r->in.sharename); + ndr->depth++; + if (r->in.sharename) { + ndr_print_string(ndr, "sharename", r->in.sharename); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_GetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_dfs_Info(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Enum(struct ndr_push *ndr, int flags, const struct dfs_Enum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); + if (r->in.info) { + NDR_CHECK(ndr_push_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.total)); + if (r->in.total) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.total)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); + if (r->out.info) { + NDR_CHECK(ndr_push_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.total)); + if (r->out.total) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Enum(struct ndr_pull *ndr, int flags, struct dfs_Enum *r) +{ + uint32_t _ptr_info; + uint32_t _ptr_total; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_total_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bufsize)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->in.info); + } else { + r->in.info = NULL; + } + if (r->in.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); + NDR_CHECK(ndr_pull_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_total)); + if (_ptr_total) { + NDR_PULL_ALLOC(ndr, r->in.total); + } else { + r->in.total = NULL; + } + if (r->in.total) { + _mem_save_total_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.total, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.total)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->out.info); + } else { + r->out.info = NULL; + } + if (r->out.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); + NDR_CHECK(ndr_pull_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_total)); + if (_ptr_total) { + NDR_PULL_ALLOC(ndr, r->out.total); + } else { + r->out.total = NULL; + } + if (r->out.total) { + _mem_save_total_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Enum(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Enum *r) +{ + ndr_print_struct(ndr, name, "dfs_Enum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_Enum"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "bufsize", r->in.bufsize); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + if (r->in.info) { + ndr_print_dfs_EnumStruct(ndr, "info", r->in.info); + } + ndr->depth--; + ndr_print_ptr(ndr, "total", r->in.total); + ndr->depth++; + if (r->in.total) { + ndr_print_uint32(ndr, "total", *r->in.total); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_Enum"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + if (r->out.info) { + ndr_print_dfs_EnumStruct(ndr, "info", r->out.info); + } + ndr->depth--; + ndr_print_ptr(ndr, "total", r->out.total); + ndr->depth++; + if (r->out.total) { + ndr_print_uint32(ndr, "total", *r->out.total); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Rename(struct ndr_push *ndr, int flags, const struct dfs_Rename *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Rename(struct ndr_pull *ndr, int flags, struct dfs_Rename *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Rename(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Rename *r) +{ + ndr_print_struct(ndr, name, "dfs_Rename"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_Rename"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_Rename"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Move(struct ndr_push *ndr, int flags, const struct dfs_Move *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Move(struct ndr_pull *ndr, int flags, struct dfs_Move *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Move(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Move *r) +{ + ndr_print_struct(ndr, name, "dfs_Move"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_Move"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_Move"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_ManagerGetConfigInfo(struct ndr_push *ndr, int flags, const struct dfs_ManagerGetConfigInfo *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_ManagerGetConfigInfo(struct ndr_pull *ndr, int flags, struct dfs_ManagerGetConfigInfo *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_ManagerGetConfigInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerGetConfigInfo *r) +{ + ndr_print_struct(ndr, name, "dfs_ManagerGetConfigInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_ManagerGetConfigInfo"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_ManagerGetConfigInfo"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_ManagerSendSiteInfo(struct ndr_push *ndr, int flags, const struct dfs_ManagerSendSiteInfo *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_ManagerSendSiteInfo(struct ndr_pull *ndr, int flags, struct dfs_ManagerSendSiteInfo *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_ManagerSendSiteInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerSendSiteInfo *r) +{ + ndr_print_struct(ndr, name, "dfs_ManagerSendSiteInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_ManagerSendSiteInfo"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_ManagerSendSiteInfo"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_AddFtRoot(struct ndr_push *ndr, int flags, const struct dfs_AddFtRoot *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_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.dns_servername, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dns_servername, ndr_charset_length(r->in.dns_servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfsname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfsname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfsname, ndr_charset_length(r->in.dfsname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.comment, ndr_charset_length(r->in.comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfs_config_dn, 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_config_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_config_dn, ndr_charset_length(r->in.dfs_config_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown2)); + if (r->in.unknown2) { + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.unknown2)); + if (*r->in.unknown2) { + NDR_CHECK(ndr_push_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.unknown2)); + } + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.unknown2)); + if (r->out.unknown2) { + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.unknown2)); + if (*r->out.unknown2) { + NDR_CHECK(ndr_push_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.unknown2)); + } + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_AddFtRoot(struct ndr_pull *ndr, int flags, struct dfs_AddFtRoot *r) +{ + uint32_t _ptr_unknown2; + TALLOC_CTX *_mem_save_unknown2_0; + TALLOC_CTX *_mem_save_unknown2_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_servername)); + if (ndr_get_array_length(ndr, &r->in.dns_servername) > ndr_get_array_size(ndr, &r->in.dns_servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dns_servername), ndr_get_array_length(ndr, &r->in.dns_servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dns_servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_servername, ndr_get_array_length(ndr, &r->in.dns_servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfsname)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfsname)); + if (ndr_get_array_length(ndr, &r->in.dfsname) > ndr_get_array_size(ndr, &r->in.dfsname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfsname), ndr_get_array_length(ndr, &r->in.dfsname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfsname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfsname, ndr_get_array_length(ndr, &r->in.dfsname), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); + if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.comment)); + if (ndr_get_array_length(ndr, &r->in.comment) > ndr_get_array_size(ndr, &r->in.comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.comment), ndr_get_array_length(ndr, &r->in.comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.comment, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_config_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_config_dn)); + if (ndr_get_array_length(ndr, &r->in.dfs_config_dn) > ndr_get_array_size(ndr, &r->in.dfs_config_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_config_dn), ndr_get_array_length(ndr, &r->in.dfs_config_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_config_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_config_dn, ndr_get_array_length(ndr, &r->in.dfs_config_dn), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); + if (_ptr_unknown2) { + NDR_PULL_ALLOC(ndr, r->in.unknown2); + } else { + r->in.unknown2 = NULL; + } + if (r->in.unknown2) { + _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown2, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); + if (_ptr_unknown2) { + NDR_PULL_ALLOC(ndr, *r->in.unknown2); + } else { + *r->in.unknown2 = NULL; + } + if (*r->in.unknown2) { + _mem_save_unknown2_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.unknown2, 0); + NDR_CHECK(ndr_pull_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.unknown2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); + if (_ptr_unknown2) { + NDR_PULL_ALLOC(ndr, r->out.unknown2); + } else { + r->out.unknown2 = NULL; + } + if (r->out.unknown2) { + _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown2, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); + if (_ptr_unknown2) { + NDR_PULL_ALLOC(ndr, *r->out.unknown2); + } else { + *r->out.unknown2 = NULL; + } + if (*r->out.unknown2) { + _mem_save_unknown2_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.unknown2, 0); + NDR_CHECK(ndr_pull_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.unknown2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_AddFtRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddFtRoot *r) +{ + ndr_print_struct(ndr, name, "dfs_AddFtRoot"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_AddFtRoot"); + ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_string(ndr, "dns_servername", r->in.dns_servername); + ndr_print_string(ndr, "dfsname", r->in.dfsname); + ndr_print_string(ndr, "rootshare", r->in.rootshare); + ndr_print_string(ndr, "comment", r->in.comment); + ndr_print_string(ndr, "dfs_config_dn", r->in.dfs_config_dn); + ndr_print_uint8(ndr, "unknown1", r->in.unknown1); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr_print_ptr(ndr, "unknown2", r->in.unknown2); + ndr->depth++; + if (r->in.unknown2) { + ndr_print_ptr(ndr, "unknown2", *r->in.unknown2); + ndr->depth++; + if (*r->in.unknown2) { + ndr_print_dfs_UnknownStruct(ndr, "unknown2", *r->in.unknown2); + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_AddFtRoot"); + ndr->depth++; + ndr_print_ptr(ndr, "unknown2", r->out.unknown2); + ndr->depth++; + if (r->out.unknown2) { + ndr_print_ptr(ndr, "unknown2", *r->out.unknown2); + ndr->depth++; + if (*r->out.unknown2) { + ndr_print_dfs_UnknownStruct(ndr, "unknown2", *r->out.unknown2); + } + ndr->depth--; + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_RemoveFtRoot(struct ndr_push *ndr, int flags, const struct dfs_RemoveFtRoot *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_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.dns_servername, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dns_servername, ndr_charset_length(r->in.dns_servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfsname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfsname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfsname, ndr_charset_length(r->in.dfsname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); + if (r->in.unknown) { + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.unknown)); + if (*r->in.unknown) { + NDR_CHECK(ndr_push_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.unknown)); + } + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.unknown)); + if (r->out.unknown) { + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.unknown)); + if (*r->out.unknown) { + NDR_CHECK(ndr_push_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.unknown)); + } + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_RemoveFtRoot(struct ndr_pull *ndr, int flags, struct dfs_RemoveFtRoot *r) +{ + uint32_t _ptr_unknown; + TALLOC_CTX *_mem_save_unknown_0; + TALLOC_CTX *_mem_save_unknown_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_servername)); + if (ndr_get_array_length(ndr, &r->in.dns_servername) > ndr_get_array_size(ndr, &r->in.dns_servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dns_servername), ndr_get_array_length(ndr, &r->in.dns_servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dns_servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_servername, ndr_get_array_length(ndr, &r->in.dns_servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfsname)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfsname)); + if (ndr_get_array_length(ndr, &r->in.dfsname) > ndr_get_array_size(ndr, &r->in.dfsname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfsname), ndr_get_array_length(ndr, &r->in.dfsname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfsname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfsname, ndr_get_array_length(ndr, &r->in.dfsname), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); + if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); + if (_ptr_unknown) { + NDR_PULL_ALLOC(ndr, r->in.unknown); + } else { + r->in.unknown = NULL; + } + if (r->in.unknown) { + _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); + if (_ptr_unknown) { + NDR_PULL_ALLOC(ndr, *r->in.unknown); + } else { + *r->in.unknown = NULL; + } + if (*r->in.unknown) { + _mem_save_unknown_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.unknown, 0); + NDR_CHECK(ndr_pull_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.unknown)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); + if (_ptr_unknown) { + NDR_PULL_ALLOC(ndr, r->out.unknown); + } else { + r->out.unknown = NULL; + } + if (r->out.unknown) { + _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); + if (_ptr_unknown) { + NDR_PULL_ALLOC(ndr, *r->out.unknown); + } else { + *r->out.unknown = NULL; + } + if (*r->out.unknown) { + _mem_save_unknown_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.unknown, 0); + NDR_CHECK(ndr_pull_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.unknown)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_RemoveFtRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_RemoveFtRoot *r) +{ + ndr_print_struct(ndr, name, "dfs_RemoveFtRoot"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_RemoveFtRoot"); + ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_string(ndr, "dns_servername", r->in.dns_servername); + ndr_print_string(ndr, "dfsname", r->in.dfsname); + ndr_print_string(ndr, "rootshare", r->in.rootshare); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr_print_ptr(ndr, "unknown", r->in.unknown); + ndr->depth++; + if (r->in.unknown) { + ndr_print_ptr(ndr, "unknown", *r->in.unknown); + ndr->depth++; + if (*r->in.unknown) { + ndr_print_dfs_UnknownStruct(ndr, "unknown", *r->in.unknown); + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_RemoveFtRoot"); + ndr->depth++; + ndr_print_ptr(ndr, "unknown", r->out.unknown); + ndr->depth++; + if (r->out.unknown) { + ndr_print_ptr(ndr, "unknown", *r->out.unknown); + ndr->depth++; + if (*r->out.unknown) { + ndr_print_dfs_UnknownStruct(ndr, "unknown", *r->out.unknown); + } + ndr->depth--; + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_AddStdRoot(struct ndr_push *ndr, int flags, const struct dfs_AddStdRoot *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.comment, ndr_charset_length(r->in.comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_AddStdRoot(struct ndr_pull *ndr, int flags, struct dfs_AddStdRoot *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); + if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.comment)); + if (ndr_get_array_length(ndr, &r->in.comment) > ndr_get_array_size(ndr, &r->in.comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.comment), ndr_get_array_length(ndr, &r->in.comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.comment, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_AddStdRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddStdRoot *r) +{ + ndr_print_struct(ndr, name, "dfs_AddStdRoot"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_AddStdRoot"); + ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_string(ndr, "rootshare", r->in.rootshare); + ndr_print_string(ndr, "comment", r->in.comment); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_AddStdRoot"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_RemoveStdRoot(struct ndr_push *ndr, int flags, const struct dfs_RemoveStdRoot *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_RemoveStdRoot(struct ndr_pull *ndr, int flags, struct dfs_RemoveStdRoot *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); + if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_RemoveStdRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_RemoveStdRoot *r) +{ + ndr_print_struct(ndr, name, "dfs_RemoveStdRoot"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_RemoveStdRoot"); + ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_string(ndr, "rootshare", r->in.rootshare); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_RemoveStdRoot"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_ManagerInitialize(struct ndr_pull *ndr, int flags, struct dfs_ManagerInitialize *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_ManagerInitialize(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerInitialize *r) +{ + ndr_print_struct(ndr, name, "dfs_ManagerInitialize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_ManagerInitialize"); + ndr->depth++; + ndr_print_ptr(ndr, "servername", r->in.servername); + ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_ManagerInitialize"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_AddStdRootForced(struct ndr_push *ndr, int flags, const struct dfs_AddStdRootForced *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.comment, ndr_charset_length(r->in.comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.store, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.store, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.store, ndr_charset_length(r->in.store, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_AddStdRootForced(struct ndr_pull *ndr, int flags, struct dfs_AddStdRootForced *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); + if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.comment)); + if (ndr_get_array_length(ndr, &r->in.comment) > ndr_get_array_size(ndr, &r->in.comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.comment), ndr_get_array_length(ndr, &r->in.comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.comment, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.store)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.store)); + if (ndr_get_array_length(ndr, &r->in.store) > ndr_get_array_size(ndr, &r->in.store)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.store), ndr_get_array_length(ndr, &r->in.store)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.store), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.store, ndr_get_array_length(ndr, &r->in.store), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_AddStdRootForced(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddStdRootForced *r) +{ + ndr_print_struct(ndr, name, "dfs_AddStdRootForced"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_AddStdRootForced"); + ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_string(ndr, "rootshare", r->in.rootshare); + ndr_print_string(ndr, "comment", r->in.comment); + ndr_print_string(ndr, "store", r->in.store); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_AddStdRootForced"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_GetDcAddress(struct ndr_push *ndr, int flags, const struct dfs_GetDcAddress *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + if (r->in.server_fullname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.server_fullname)); + if (*r->in.server_fullname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.server_fullname, 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_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->in.server_fullname, ndr_charset_length(*r->in.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->in.is_root == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.is_root)); + if (r->in.ttl == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.ttl)); + } + if (flags & NDR_OUT) { + if (r->out.server_fullname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.server_fullname)); + if (*r->out.server_fullname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.server_fullname, ndr_charset_length(*r->out.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->out.is_root == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.is_root)); + if (r->out.ttl == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.ttl)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_GetDcAddress(struct ndr_pull *ndr, int flags, struct dfs_GetDcAddress *r) +{ + uint32_t _ptr_server_fullname; + TALLOC_CTX *_mem_save_server_fullname_0; + TALLOC_CTX *_mem_save_server_fullname_1; + TALLOC_CTX *_mem_save_is_root_0; + TALLOC_CTX *_mem_save_ttl_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.server_fullname); + } + _mem_save_server_fullname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_fullname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_fullname)); + if (_ptr_server_fullname) { + NDR_PULL_ALLOC(ndr, *r->in.server_fullname); + } else { + *r->in.server_fullname = NULL; + } + if (*r->in.server_fullname) { + _mem_save_server_fullname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.server_fullname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->in.server_fullname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->in.server_fullname)); + if (ndr_get_array_length(ndr, r->in.server_fullname) > ndr_get_array_size(ndr, r->in.server_fullname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->in.server_fullname), ndr_get_array_length(ndr, r->in.server_fullname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->in.server_fullname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->in.server_fullname, ndr_get_array_length(ndr, r->in.server_fullname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.is_root); + } + _mem_save_is_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.is_root, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.is_root)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_is_root_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.ttl); + } + _mem_save_ttl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.ttl, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.ttl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ttl_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.server_fullname); + *r->out.server_fullname = *r->in.server_fullname; + NDR_PULL_ALLOC(ndr, r->out.is_root); + *r->out.is_root = *r->in.is_root; + NDR_PULL_ALLOC(ndr, r->out.ttl); + *r->out.ttl = *r->in.ttl; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.server_fullname); + } + _mem_save_server_fullname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.server_fullname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_fullname)); + if (_ptr_server_fullname) { + NDR_PULL_ALLOC(ndr, *r->out.server_fullname); + } else { + *r->out.server_fullname = NULL; + } + if (*r->out.server_fullname) { + _mem_save_server_fullname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.server_fullname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.server_fullname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.server_fullname)); + if (ndr_get_array_length(ndr, r->out.server_fullname) > ndr_get_array_size(ndr, r->out.server_fullname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.server_fullname), ndr_get_array_length(ndr, r->out.server_fullname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.server_fullname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.server_fullname, ndr_get_array_length(ndr, r->out.server_fullname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.is_root); + } + _mem_save_is_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.is_root, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.is_root)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_is_root_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ttl); + } + _mem_save_ttl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ttl, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.ttl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ttl_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_GetDcAddress(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetDcAddress *r) +{ + ndr_print_struct(ndr, name, "dfs_GetDcAddress"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_GetDcAddress"); + ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_ptr(ndr, "server_fullname", r->in.server_fullname); + ndr->depth++; + ndr_print_ptr(ndr, "server_fullname", *r->in.server_fullname); + ndr->depth++; + if (*r->in.server_fullname) { + ndr_print_string(ndr, "server_fullname", *r->in.server_fullname); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "is_root", r->in.is_root); + ndr->depth++; + ndr_print_uint8(ndr, "is_root", *r->in.is_root); + ndr->depth--; + ndr_print_ptr(ndr, "ttl", r->in.ttl); + ndr->depth++; + ndr_print_uint32(ndr, "ttl", *r->in.ttl); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_GetDcAddress"); + ndr->depth++; + ndr_print_ptr(ndr, "server_fullname", r->out.server_fullname); + ndr->depth++; + ndr_print_ptr(ndr, "server_fullname", *r->out.server_fullname); + ndr->depth++; + if (*r->out.server_fullname) { + ndr_print_string(ndr, "server_fullname", *r->out.server_fullname); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "is_root", r->out.is_root); + ndr->depth++; + ndr_print_uint8(ndr, "is_root", *r->out.is_root); + ndr->depth--; + ndr_print_ptr(ndr, "ttl", r->out.ttl); + ndr->depth++; + ndr_print_uint32(ndr, "ttl", *r->out.ttl); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_SetDcAddress(struct ndr_push *ndr, int flags, const struct dfs_SetDcAddress *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_fullname, 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_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_fullname, ndr_charset_length(r->in.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.ttl)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_SetDcAddress(struct ndr_pull *ndr, int flags, struct dfs_SetDcAddress *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_fullname)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_fullname)); + if (ndr_get_array_length(ndr, &r->in.server_fullname) > ndr_get_array_size(ndr, &r->in.server_fullname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_fullname), ndr_get_array_length(ndr, &r->in.server_fullname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_fullname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_fullname, ndr_get_array_length(ndr, &r->in.server_fullname), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.ttl)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_SetDcAddress(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetDcAddress *r) +{ + ndr_print_struct(ndr, name, "dfs_SetDcAddress"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_SetDcAddress"); + ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_string(ndr, "server_fullname", r->in.server_fullname); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr_print_uint32(ndr, "ttl", r->in.ttl); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_SetDcAddress"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_FlushFtTable(struct ndr_push *ndr, int flags, const struct dfs_FlushFtTable *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_FlushFtTable(struct ndr_pull *ndr, int flags, struct dfs_FlushFtTable *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); + if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_FlushFtTable(struct ndr_print *ndr, const char *name, int flags, const struct dfs_FlushFtTable *r) +{ + ndr_print_struct(ndr, name, "dfs_FlushFtTable"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_FlushFtTable"); + ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_string(ndr, "rootshare", r->in.rootshare); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_FlushFtTable"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Add2(struct ndr_push *ndr, int flags, const struct dfs_Add2 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Add2(struct ndr_pull *ndr, int flags, struct dfs_Add2 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Add2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Add2 *r) +{ + ndr_print_struct(ndr, name, "dfs_Add2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_Add2"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_Add2"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_Remove2(struct ndr_push *ndr, int flags, const struct dfs_Remove2 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_Remove2(struct ndr_pull *ndr, int flags, struct dfs_Remove2 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_Remove2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Remove2 *r) +{ + ndr_print_struct(ndr, name, "dfs_Remove2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_Remove2"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_Remove2"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_dfs_EnumEx(struct ndr_push *ndr, int flags, const struct dfs_EnumEx *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfs_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.dfs_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_name, ndr_charset_length(r->in.dfs_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); + if (r->in.info) { + NDR_CHECK(ndr_push_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.total)); + if (r->in.total) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.total)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); + if (r->out.info) { + NDR_CHECK(ndr_push_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.total)); + if (r->out.total) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_dfs_EnumEx(struct ndr_pull *ndr, int flags, struct dfs_EnumEx *r) +{ + uint32_t _ptr_info; + uint32_t _ptr_total; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_total_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_name)); + if (ndr_get_array_length(ndr, &r->in.dfs_name) > ndr_get_array_size(ndr, &r->in.dfs_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_name), ndr_get_array_length(ndr, &r->in.dfs_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_name, ndr_get_array_length(ndr, &r->in.dfs_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bufsize)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->in.info); + } else { + r->in.info = NULL; + } + if (r->in.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); + NDR_CHECK(ndr_pull_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_total)); + if (_ptr_total) { + NDR_PULL_ALLOC(ndr, r->in.total); + } else { + r->in.total = NULL; + } + if (r->in.total) { + _mem_save_total_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.total, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.total)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->out.info); + } else { + r->out.info = NULL; + } + if (r->out.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); + NDR_CHECK(ndr_pull_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_total)); + if (_ptr_total) { + NDR_PULL_ALLOC(ndr, r->out.total); + } else { + r->out.total = NULL; + } + if (r->out.total) { + _mem_save_total_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumEx(struct ndr_print *ndr, const char *name, int flags, const struct dfs_EnumEx *r) +{ + ndr_print_struct(ndr, name, "dfs_EnumEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_EnumEx"); + ndr->depth++; + ndr_print_string(ndr, "dfs_name", r->in.dfs_name); + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "bufsize", r->in.bufsize); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + if (r->in.info) { + ndr_print_dfs_EnumStruct(ndr, "info", r->in.info); + } + ndr->depth--; + ndr_print_ptr(ndr, "total", r->in.total); + ndr->depth++; + if (r->in.total) { + ndr_print_uint32(ndr, "total", *r->in.total); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_EnumEx"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + if (r->out.info) { + ndr_print_dfs_EnumStruct(ndr, "info", r->out.info); + } + ndr->depth--; + ndr_print_ptr(ndr, "total", r->out.total); + ndr->depth++; + if (r->out.total) { + ndr_print_uint32(ndr, "total", *r->out.total); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_SetInfo2(struct ndr_push *ndr, int flags, const struct dfs_SetInfo2 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_SetInfo2(struct ndr_pull *ndr, int flags, struct dfs_SetInfo2 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_SetInfo2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetInfo2 *r) +{ + ndr_print_struct(ndr, name, "dfs_SetInfo2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dfs_SetInfo2"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dfs_SetInfo2"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call netdfs_calls[] = { + { + "dfs_GetManagerVersion", + sizeof(struct dfs_GetManagerVersion), + (ndr_push_flags_fn_t) ndr_push_dfs_GetManagerVersion, + (ndr_pull_flags_fn_t) ndr_pull_dfs_GetManagerVersion, + (ndr_print_function_t) ndr_print_dfs_GetManagerVersion, + false, + }, + { + "dfs_Add", + sizeof(struct dfs_Add), + (ndr_push_flags_fn_t) ndr_push_dfs_Add, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Add, + (ndr_print_function_t) ndr_print_dfs_Add, + false, + }, + { + "dfs_Remove", + sizeof(struct dfs_Remove), + (ndr_push_flags_fn_t) ndr_push_dfs_Remove, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Remove, + (ndr_print_function_t) ndr_print_dfs_Remove, + false, + }, + { + "dfs_SetInfo", + sizeof(struct dfs_SetInfo), + (ndr_push_flags_fn_t) ndr_push_dfs_SetInfo, + (ndr_pull_flags_fn_t) ndr_pull_dfs_SetInfo, + (ndr_print_function_t) ndr_print_dfs_SetInfo, + false, + }, + { + "dfs_GetInfo", + sizeof(struct dfs_GetInfo), + (ndr_push_flags_fn_t) ndr_push_dfs_GetInfo, + (ndr_pull_flags_fn_t) ndr_pull_dfs_GetInfo, + (ndr_print_function_t) ndr_print_dfs_GetInfo, + false, + }, + { + "dfs_Enum", + sizeof(struct dfs_Enum), + (ndr_push_flags_fn_t) ndr_push_dfs_Enum, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Enum, + (ndr_print_function_t) ndr_print_dfs_Enum, + false, + }, + { + "dfs_Rename", + sizeof(struct dfs_Rename), + (ndr_push_flags_fn_t) ndr_push_dfs_Rename, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Rename, + (ndr_print_function_t) ndr_print_dfs_Rename, + false, + }, + { + "dfs_Move", + sizeof(struct dfs_Move), + (ndr_push_flags_fn_t) ndr_push_dfs_Move, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Move, + (ndr_print_function_t) ndr_print_dfs_Move, + false, + }, + { + "dfs_ManagerGetConfigInfo", + sizeof(struct dfs_ManagerGetConfigInfo), + (ndr_push_flags_fn_t) ndr_push_dfs_ManagerGetConfigInfo, + (ndr_pull_flags_fn_t) ndr_pull_dfs_ManagerGetConfigInfo, + (ndr_print_function_t) ndr_print_dfs_ManagerGetConfigInfo, + false, + }, + { + "dfs_ManagerSendSiteInfo", + sizeof(struct dfs_ManagerSendSiteInfo), + (ndr_push_flags_fn_t) ndr_push_dfs_ManagerSendSiteInfo, + (ndr_pull_flags_fn_t) ndr_pull_dfs_ManagerSendSiteInfo, + (ndr_print_function_t) ndr_print_dfs_ManagerSendSiteInfo, + false, + }, + { + "dfs_AddFtRoot", + sizeof(struct dfs_AddFtRoot), + (ndr_push_flags_fn_t) ndr_push_dfs_AddFtRoot, + (ndr_pull_flags_fn_t) ndr_pull_dfs_AddFtRoot, + (ndr_print_function_t) ndr_print_dfs_AddFtRoot, + false, + }, + { + "dfs_RemoveFtRoot", + sizeof(struct dfs_RemoveFtRoot), + (ndr_push_flags_fn_t) ndr_push_dfs_RemoveFtRoot, + (ndr_pull_flags_fn_t) ndr_pull_dfs_RemoveFtRoot, + (ndr_print_function_t) ndr_print_dfs_RemoveFtRoot, + false, + }, + { + "dfs_AddStdRoot", + sizeof(struct dfs_AddStdRoot), + (ndr_push_flags_fn_t) ndr_push_dfs_AddStdRoot, + (ndr_pull_flags_fn_t) ndr_pull_dfs_AddStdRoot, + (ndr_print_function_t) ndr_print_dfs_AddStdRoot, + false, + }, + { + "dfs_RemoveStdRoot", + sizeof(struct dfs_RemoveStdRoot), + (ndr_push_flags_fn_t) ndr_push_dfs_RemoveStdRoot, + (ndr_pull_flags_fn_t) ndr_pull_dfs_RemoveStdRoot, + (ndr_print_function_t) ndr_print_dfs_RemoveStdRoot, + false, + }, + { + "dfs_ManagerInitialize", + sizeof(struct dfs_ManagerInitialize), + (ndr_push_flags_fn_t) ndr_push_dfs_ManagerInitialize, + (ndr_pull_flags_fn_t) ndr_pull_dfs_ManagerInitialize, + (ndr_print_function_t) ndr_print_dfs_ManagerInitialize, + false, + }, + { + "dfs_AddStdRootForced", + sizeof(struct dfs_AddStdRootForced), + (ndr_push_flags_fn_t) ndr_push_dfs_AddStdRootForced, + (ndr_pull_flags_fn_t) ndr_pull_dfs_AddStdRootForced, + (ndr_print_function_t) ndr_print_dfs_AddStdRootForced, + false, + }, + { + "dfs_GetDcAddress", + sizeof(struct dfs_GetDcAddress), + (ndr_push_flags_fn_t) ndr_push_dfs_GetDcAddress, + (ndr_pull_flags_fn_t) ndr_pull_dfs_GetDcAddress, + (ndr_print_function_t) ndr_print_dfs_GetDcAddress, + false, + }, + { + "dfs_SetDcAddress", + sizeof(struct dfs_SetDcAddress), + (ndr_push_flags_fn_t) ndr_push_dfs_SetDcAddress, + (ndr_pull_flags_fn_t) ndr_pull_dfs_SetDcAddress, + (ndr_print_function_t) ndr_print_dfs_SetDcAddress, + false, + }, + { + "dfs_FlushFtTable", + sizeof(struct dfs_FlushFtTable), + (ndr_push_flags_fn_t) ndr_push_dfs_FlushFtTable, + (ndr_pull_flags_fn_t) ndr_pull_dfs_FlushFtTable, + (ndr_print_function_t) ndr_print_dfs_FlushFtTable, + false, + }, + { + "dfs_Add2", + sizeof(struct dfs_Add2), + (ndr_push_flags_fn_t) ndr_push_dfs_Add2, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Add2, + (ndr_print_function_t) ndr_print_dfs_Add2, + false, + }, + { + "dfs_Remove2", + sizeof(struct dfs_Remove2), + (ndr_push_flags_fn_t) ndr_push_dfs_Remove2, + (ndr_pull_flags_fn_t) ndr_pull_dfs_Remove2, + (ndr_print_function_t) ndr_print_dfs_Remove2, + false, + }, + { + "dfs_EnumEx", + sizeof(struct dfs_EnumEx), + (ndr_push_flags_fn_t) ndr_push_dfs_EnumEx, + (ndr_pull_flags_fn_t) ndr_pull_dfs_EnumEx, + (ndr_print_function_t) ndr_print_dfs_EnumEx, + false, + }, + { + "dfs_SetInfo2", + sizeof(struct dfs_SetInfo2), + (ndr_push_flags_fn_t) ndr_push_dfs_SetInfo2, + (ndr_pull_flags_fn_t) ndr_pull_dfs_SetInfo2, + (ndr_print_function_t) ndr_print_dfs_SetInfo2, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const netdfs_endpoint_strings[] = { + "ncacn_np:[\\pipe\\netdfs]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array netdfs_endpoints = { + .count = 3, + .names = netdfs_endpoint_strings +}; + +static const char * const netdfs_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array netdfs_authservices = { + .count = 1, + .names = netdfs_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_netdfs = { + .name = "netdfs", + .syntax_id = { + {0x4fc742e0,0x4a10,0x11cf,{0x82,0x73},{0x00,0xaa,0x00,0x4a,0xe6,0x73}}, + NDR_NETDFS_VERSION + }, + .helpstring = NDR_NETDFS_HELPSTRING, + .num_calls = 23, + .calls = netdfs_calls, + .endpoints = &netdfs_endpoints, + .authservices = &netdfs_authservices +}; + diff --git a/librpc/gen_ndr/ndr_dfs.h b/librpc/gen_ndr/ndr_dfs.h new file mode 100644 index 0000000000..a7c66f9693 --- /dev/null +++ b/librpc/gen_ndr/ndr_dfs.h @@ -0,0 +1,132 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/dfs.h" + +#ifndef _HEADER_NDR_netdfs +#define _HEADER_NDR_netdfs + +#define NDR_NETDFS_UUID "4fc742e0-4a10-11cf-8273-00aa004ae673" +#define NDR_NETDFS_VERSION 3.0 +#define NDR_NETDFS_NAME "netdfs" +#define NDR_NETDFS_HELPSTRING "Settings for Microsoft Distributed File System" +extern const struct ndr_interface_table ndr_table_netdfs; +#define NDR_DFS_GETMANAGERVERSION (0x00) + +#define NDR_DFS_ADD (0x01) + +#define NDR_DFS_REMOVE (0x02) + +#define NDR_DFS_SETINFO (0x03) + +#define NDR_DFS_GETINFO (0x04) + +#define NDR_DFS_ENUM (0x05) + +#define NDR_DFS_RENAME (0x06) + +#define NDR_DFS_MOVE (0x07) + +#define NDR_DFS_MANAGERGETCONFIGINFO (0x08) + +#define NDR_DFS_MANAGERSENDSITEINFO (0x09) + +#define NDR_DFS_ADDFTROOT (0x0a) + +#define NDR_DFS_REMOVEFTROOT (0x0b) + +#define NDR_DFS_ADDSTDROOT (0x0c) + +#define NDR_DFS_REMOVESTDROOT (0x0d) + +#define NDR_DFS_MANAGERINITIALIZE (0x0e) + +#define NDR_DFS_ADDSTDROOTFORCED (0x0f) + +#define NDR_DFS_GETDCADDRESS (0x10) + +#define NDR_DFS_SETDCADDRESS (0x11) + +#define NDR_DFS_FLUSHFTTABLE (0x12) + +#define NDR_DFS_ADD2 (0x13) + +#define NDR_DFS_REMOVE2 (0x14) + +#define NDR_DFS_ENUMEX (0x15) + +#define NDR_DFS_SETINFO2 (0x16) + +#define NDR_NETDFS_CALL_COUNT (23) +void ndr_print_dfs_ManagerVersion(struct ndr_print *ndr, const char *name, enum dfs_ManagerVersion r); +void ndr_print_dfs_Info0(struct ndr_print *ndr, const char *name, const struct dfs_Info0 *r); +void ndr_print_dfs_Info1(struct ndr_print *ndr, const char *name, const struct dfs_Info1 *r); +enum ndr_err_code ndr_push_dfs_VolumeState(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_dfs_VolumeState(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_dfs_VolumeState(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_dfs_Info2(struct ndr_print *ndr, const char *name, const struct dfs_Info2 *r); +enum ndr_err_code ndr_push_dfs_StorageState(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_dfs_StorageState(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_dfs_StorageState(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_dfs_StorageInfo(struct ndr_print *ndr, const char *name, const struct dfs_StorageInfo *r); +void ndr_print_dfs_Info3(struct ndr_print *ndr, const char *name, const struct dfs_Info3 *r); +void ndr_print_dfs_Info4(struct ndr_print *ndr, const char *name, const struct dfs_Info4 *r); +enum ndr_err_code ndr_push_dfs_PropertyFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_dfs_PropertyFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_dfs_PropertyFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_dfs_Info5(struct ndr_print *ndr, const char *name, const struct dfs_Info5 *r); +void ndr_print_dfs_Target_PriorityClass(struct ndr_print *ndr, const char *name, enum dfs_Target_PriorityClass r); +void ndr_print_dfs_Target_Priority(struct ndr_print *ndr, const char *name, const struct dfs_Target_Priority *r); +void ndr_print_dfs_StorageInfo2(struct ndr_print *ndr, const char *name, const struct dfs_StorageInfo2 *r); +void ndr_print_dfs_Info6(struct ndr_print *ndr, const char *name, const struct dfs_Info6 *r); +void ndr_print_dfs_Info7(struct ndr_print *ndr, const char *name, const struct dfs_Info7 *r); +void ndr_print_dfs_Info100(struct ndr_print *ndr, const char *name, const struct dfs_Info100 *r); +void ndr_print_dfs_Info101(struct ndr_print *ndr, const char *name, const struct dfs_Info101 *r); +void ndr_print_dfs_Info102(struct ndr_print *ndr, const char *name, const struct dfs_Info102 *r); +void ndr_print_dfs_Info103(struct ndr_print *ndr, const char *name, const struct dfs_Info103 *r); +void ndr_print_dfs_Info104(struct ndr_print *ndr, const char *name, const struct dfs_Info104 *r); +void ndr_print_dfs_Info105(struct ndr_print *ndr, const char *name, const struct dfs_Info105 *r); +void ndr_print_dfs_Info106(struct ndr_print *ndr, const char *name, const struct dfs_Info106 *r); +void ndr_print_dfs_Info200(struct ndr_print *ndr, const char *name, const struct dfs_Info200 *r); +void ndr_print_dfs_VolumeFlavor(struct ndr_print *ndr, const char *name, enum dfs_VolumeFlavor r); +void ndr_print_dfs_Info300(struct ndr_print *ndr, const char *name, const struct dfs_Info300 *r); +void ndr_print_dfs_Info(struct ndr_print *ndr, const char *name, const union dfs_Info *r); +void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray1 *r); +void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray2 *r); +void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray3 *r); +void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray4 *r); +void ndr_print_dfs_EnumArray5(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray5 *r); +void ndr_print_dfs_EnumArray6(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray6 *r); +void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray200 *r); +void ndr_print_dfs_EnumArray300(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray300 *r); +void ndr_print_dfs_EnumInfo(struct ndr_print *ndr, const char *name, const union dfs_EnumInfo *r); +void ndr_print_dfs_EnumStruct(struct ndr_print *ndr, const char *name, const struct dfs_EnumStruct *r); +void ndr_print_dfs_UnknownStruct(struct ndr_print *ndr, const char *name, const struct dfs_UnknownStruct *r); +enum ndr_err_code ndr_push_dfs_GetManagerVersion(struct ndr_push *ndr, int flags, const struct dfs_GetManagerVersion *r); +enum ndr_err_code ndr_pull_dfs_GetManagerVersion(struct ndr_pull *ndr, int flags, struct dfs_GetManagerVersion *r); +void ndr_print_dfs_GetManagerVersion(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetManagerVersion *r); +void ndr_print_dfs_Add(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Add *r); +void ndr_print_dfs_Remove(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Remove *r); +void ndr_print_dfs_SetInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetInfo *r); +void ndr_print_dfs_GetInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetInfo *r); +void ndr_print_dfs_Enum(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Enum *r); +void ndr_print_dfs_Rename(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Rename *r); +void ndr_print_dfs_Move(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Move *r); +void ndr_print_dfs_ManagerGetConfigInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerGetConfigInfo *r); +void ndr_print_dfs_ManagerSendSiteInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerSendSiteInfo *r); +void ndr_print_dfs_AddFtRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddFtRoot *r); +void ndr_print_dfs_RemoveFtRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_RemoveFtRoot *r); +void ndr_print_dfs_AddStdRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddStdRoot *r); +void ndr_print_dfs_RemoveStdRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_RemoveStdRoot *r); +void ndr_print_dfs_ManagerInitialize(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerInitialize *r); +void ndr_print_dfs_AddStdRootForced(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddStdRootForced *r); +void ndr_print_dfs_GetDcAddress(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetDcAddress *r); +void ndr_print_dfs_SetDcAddress(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetDcAddress *r); +void ndr_print_dfs_FlushFtTable(struct ndr_print *ndr, const char *name, int flags, const struct dfs_FlushFtTable *r); +void ndr_print_dfs_Add2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Add2 *r); +void ndr_print_dfs_Remove2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Remove2 *r); +enum ndr_err_code ndr_push_dfs_EnumEx(struct ndr_push *ndr, int flags, const struct dfs_EnumEx *r); +enum ndr_err_code ndr_pull_dfs_EnumEx(struct ndr_pull *ndr, int flags, struct dfs_EnumEx *r); +void ndr_print_dfs_EnumEx(struct ndr_print *ndr, const char *name, int flags, const struct dfs_EnumEx *r); +void ndr_print_dfs_SetInfo2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetInfo2 *r); +#endif /* _HEADER_NDR_netdfs */ diff --git a/librpc/gen_ndr/ndr_drsblobs.c b/librpc/gen_ndr/ndr_drsblobs.c new file mode 100644 index 0000000000..d965e40bd2 --- /dev/null +++ b/librpc/gen_ndr/ndr_drsblobs.c @@ -0,0 +1,4267 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_drsblobs.h" + +#include "librpc/gen_ndr/ndr_drsuapi.h" +#include "librpc/gen_ndr/ndr_misc.h" +#include "librpc/gen_ndr/ndr_samr.h" +#include "librpc/gen_ndr/ndr_lsa.h" +static enum ndr_err_code ndr_push_replPropertyMetaData1(struct ndr_push *ndr, int ndr_flags, const struct replPropertyMetaData1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_change_time)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_replPropertyMetaData1(struct ndr_pull *ndr, int ndr_flags, struct replPropertyMetaData1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_change_time)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_replPropertyMetaData1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaData1 *r) +{ + ndr_print_struct(ndr, name, "replPropertyMetaData1"); + ndr->depth++; + ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid); + ndr_print_uint32(ndr, "version", r->version); + ndr_print_NTTIME_1sec(ndr, "originating_change_time", r->originating_change_time); + ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); + ndr_print_hyper(ndr, "originating_usn", r->originating_usn); + ndr_print_hyper(ndr, "local_usn", r->local_usn); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_replPropertyMetaDataCtr1(struct ndr_push *ndr, int ndr_flags, const struct replPropertyMetaDataCtr1 *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_replPropertyMetaData1(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_replPropertyMetaDataCtr1(struct ndr_pull *ndr, int ndr_flags, struct replPropertyMetaDataCtr1 *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_PULL_ALLOC_N(ndr, r->array, r->count); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_replPropertyMetaData1(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_replPropertyMetaDataCtr1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataCtr1 *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "replPropertyMetaDataCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_replPropertyMetaData1(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_replPropertyMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const union replPropertyMetaDataCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_replPropertyMetaDataCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_replPropertyMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, union replPropertyMetaDataCtr *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_replPropertyMetaDataCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_replPropertyMetaDataCtr(struct ndr_print *ndr, const char *name, const union replPropertyMetaDataCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "replPropertyMetaDataCtr"); + switch (level) { + case 1: + ndr_print_replPropertyMetaDataCtr1(ndr, "ctr1", &r->ctr1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_replPropertyMetaDataBlob(struct ndr_push *ndr, int ndr_flags, const struct replPropertyMetaDataBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_push_replPropertyMetaDataCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_replPropertyMetaDataBlob(struct ndr_pull *ndr, int ndr_flags, struct replPropertyMetaDataBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_pull_replPropertyMetaDataCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_replPropertyMetaDataBlob(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataBlob *r) +{ + ndr_print_struct(ndr, name, "replPropertyMetaDataBlob"); + ndr->depth++; + ndr_print_uint32(ndr, "version", r->version); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr_print_set_switch_value(ndr, &r->ctr, r->version); + ndr_print_replPropertyMetaDataCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_replUpToDateVectorCtr1(struct ndr_push *ndr, int ndr_flags, const struct replUpToDateVectorCtr1 *r) +{ + uint32_t cntr_cursors_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_replUpToDateVectorCtr1(struct ndr_pull *ndr, int ndr_flags, struct replUpToDateVectorCtr1 *r) +{ + uint32_t cntr_cursors_0; + TALLOC_CTX *_mem_save_cursors_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_PULL_ALLOC_N(ndr, r->cursors, r->count); + _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); + for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_replUpToDateVectorCtr1(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorCtr1 *r) +{ + uint32_t cntr_cursors_0; + ndr_print_struct(ndr, name, "replUpToDateVectorCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count); + ndr->depth++; + for (cntr_cursors_0=0;cntr_cursors_0count;cntr_cursors_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) { + ndr_print_drsuapi_DsReplicaCursor(ndr, "cursors", &r->cursors[cntr_cursors_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_replUpToDateVectorCtr2(struct ndr_push *ndr, int ndr_flags, const struct replUpToDateVectorCtr2 *r) +{ + uint32_t cntr_cursors_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_replUpToDateVectorCtr2(struct ndr_pull *ndr, int ndr_flags, struct replUpToDateVectorCtr2 *r) +{ + uint32_t cntr_cursors_0; + TALLOC_CTX *_mem_save_cursors_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_PULL_ALLOC_N(ndr, r->cursors, r->count); + _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); + for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_replUpToDateVectorCtr2(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorCtr2 *r) +{ + uint32_t cntr_cursors_0; + ndr_print_struct(ndr, name, "replUpToDateVectorCtr2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count); + ndr->depth++; + for (cntr_cursors_0=0;cntr_cursors_0count;cntr_cursors_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) { + ndr_print_drsuapi_DsReplicaCursor2(ndr, "cursors", &r->cursors[cntr_cursors_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_replUpToDateVectorCtr(struct ndr_push *ndr, int ndr_flags, const union replUpToDateVectorCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_replUpToDateVectorCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_replUpToDateVectorCtr2(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + case 2: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_replUpToDateVectorCtr(struct ndr_pull *ndr, int ndr_flags, union replUpToDateVectorCtr *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_replUpToDateVectorCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_replUpToDateVectorCtr2(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + case 2: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_replUpToDateVectorCtr(struct ndr_print *ndr, const char *name, const union replUpToDateVectorCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "replUpToDateVectorCtr"); + switch (level) { + case 1: + ndr_print_replUpToDateVectorCtr1(ndr, "ctr1", &r->ctr1); + break; + + case 2: + ndr_print_replUpToDateVectorCtr2(ndr, "ctr2", &r->ctr2); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_replUpToDateVectorBlob(struct ndr_push *ndr, int ndr_flags, const struct replUpToDateVectorBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_push_replUpToDateVectorCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_replUpToDateVectorBlob(struct ndr_pull *ndr, int ndr_flags, struct replUpToDateVectorBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_pull_replUpToDateVectorCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_replUpToDateVectorBlob(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorBlob *r) +{ + ndr_print_struct(ndr, name, "replUpToDateVectorBlob"); + ndr->depth++; + ndr_print_uint32(ndr, "version", r->version); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr_print_set_switch_value(ndr, &r->ctr, r->version); + ndr_print_replUpToDateVectorCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_repsFromTo1OtherInfo(struct ndr_push *ndr, int ndr_flags, const struct repsFromTo1OtherInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen(r->dns_name) + 1)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, strlen(r->dns_name) + 1, sizeof(uint8_t), CH_DOS)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_repsFromTo1OtherInfo(struct ndr_pull *ndr, int ndr_flags, struct repsFromTo1OtherInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__dns_name_size)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, r->__dns_name_size, sizeof(uint8_t), CH_DOS)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_repsFromTo1OtherInfo(struct ndr_print *ndr, const char *name, const struct repsFromTo1OtherInfo *r) +{ + ndr_print_struct(ndr, name, "repsFromTo1OtherInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "__dns_name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->dns_name) + 1:r->__dns_name_size); + ndr_print_string(ndr, "dns_name", r->dns_name); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_repsFromTo1OtherInfo(const struct repsFromTo1OtherInfo *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_repsFromTo1OtherInfo); +} + +_PUBLIC_ enum ndr_err_code ndr_push_repsFromTo1(struct ndr_push *ndr, int ndr_flags, const struct repsFromTo1 *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_repsFromTo1(r, ndr->flags) + 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->consecutive_sync_failures)); + NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->last_success)); + NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->last_attempt)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->result_last_attempt)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->other_info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_repsFromTo1OtherInfo(r->other_info, ndr->flags))); + NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->schedule, 84)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->transport_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->other_info) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->other_info)); + NDR_CHECK(ndr_push_repsFromTo1OtherInfo(ndr, NDR_SCALARS, r->other_info)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_repsFromTo1(struct ndr_pull *ndr, int ndr_flags, struct repsFromTo1 *r) +{ + uint32_t _ptr_other_info; + TALLOC_CTX *_mem_save_other_info_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->blobsize)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->consecutive_sync_failures)); + NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->last_success)); + NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->last_attempt)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->result_last_attempt)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_info)); + if (_ptr_other_info) { + NDR_PULL_ALLOC(ndr, r->other_info); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->other_info, _ptr_other_info)); + } else { + r->other_info = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->other_info_length)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->schedule, 84)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->transport_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->other_info) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->other_info)); + _mem_save_other_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->other_info, 0); + NDR_CHECK(ndr_pull_repsFromTo1OtherInfo(ndr, NDR_SCALARS, r->other_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_info_0, 0); + ndr->offset = _relative_save_offset; + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_repsFromTo1(struct ndr_print *ndr, const char *name, const struct repsFromTo1 *r) +{ + ndr_print_struct(ndr, name, "repsFromTo1"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint32(ndr, "blobsize", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_repsFromTo1(r, ndr->flags) + 8:r->blobsize); + ndr_print_uint32(ndr, "consecutive_sync_failures", r->consecutive_sync_failures); + ndr_print_NTTIME_1sec(ndr, "last_success", r->last_success); + ndr_print_NTTIME_1sec(ndr, "last_attempt", r->last_attempt); + ndr_print_WERROR(ndr, "result_last_attempt", r->result_last_attempt); + ndr_print_ptr(ndr, "other_info", r->other_info); + ndr->depth++; + if (r->other_info) { + ndr_print_repsFromTo1OtherInfo(ndr, "other_info", r->other_info); + } + ndr->depth--; + ndr_print_uint32(ndr, "other_info_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_repsFromTo1OtherInfo(r->other_info, ndr->flags):r->other_info_length); + ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags); + ndr_print_array_uint8(ndr, "schedule", r->schedule, 84); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark); + ndr_print_GUID(ndr, "source_dsa_obj_guid", &r->source_dsa_obj_guid); + ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); + ndr_print_GUID(ndr, "transport_guid", &r->transport_guid); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ size_t ndr_size_repsFromTo1(const struct repsFromTo1 *r, int flags) +{ + flags |= LIBNDR_PRINT_ARRAY_HEX; + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_repsFromTo1); +} + +static enum ndr_err_code ndr_push_repsFromTo(struct ndr_push *ndr, int ndr_flags, const union repsFromTo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_repsFromTo1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_repsFromTo1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_repsFromTo(struct ndr_pull *ndr, int ndr_flags, union repsFromTo *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_repsFromTo1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_repsFromTo1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_repsFromTo(struct ndr_print *ndr, const char *name, const union repsFromTo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "repsFromTo"); + switch (level) { + case 1: + ndr_print_repsFromTo1(ndr, "ctr1", &r->ctr1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_repsFromToBlob(struct ndr_push *ndr, int ndr_flags, const struct repsFromToBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_push_repsFromTo(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_repsFromTo(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_repsFromToBlob(struct ndr_pull *ndr, int ndr_flags, struct repsFromToBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_pull_repsFromTo(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_repsFromTo(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_repsFromToBlob(struct ndr_print *ndr, const char *name, const struct repsFromToBlob *r) +{ + ndr_print_struct(ndr, name, "repsFromToBlob"); + ndr->depth++; + ndr_print_uint32(ndr, "version", r->version); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr_print_set_switch_value(ndr, &r->ctr, r->version); + ndr_print_repsFromTo(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_partialAttributeSetCtr1(struct ndr_push *ndr, int ndr_flags, const struct partialAttributeSetCtr1 *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_partialAttributeSetCtr1(struct ndr_pull *ndr, int ndr_flags, struct partialAttributeSetCtr1 *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_PULL_ALLOC_N(ndr, r->array, r->count); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_partialAttributeSetCtr1(struct ndr_print *ndr, const char *name, const struct partialAttributeSetCtr1 *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "partialAttributeSetCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsAttributeId(ndr, "array", r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_partialAttributeSetCtr(struct ndr_push *ndr, int ndr_flags, const union partialAttributeSetCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_partialAttributeSetCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_partialAttributeSetCtr(struct ndr_pull *ndr, int ndr_flags, union partialAttributeSetCtr *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_partialAttributeSetCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_partialAttributeSetCtr(struct ndr_print *ndr, const char *name, const union partialAttributeSetCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "partialAttributeSetCtr"); + switch (level) { + case 1: + ndr_print_partialAttributeSetCtr1(ndr, "ctr1", &r->ctr1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_partialAttributeSetBlob(struct ndr_push *ndr, int ndr_flags, const struct partialAttributeSetBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_push_partialAttributeSetCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_partialAttributeSetBlob(struct ndr_pull *ndr, int ndr_flags, struct partialAttributeSetBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_pull_partialAttributeSetCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_partialAttributeSetBlob(struct ndr_print *ndr, const char *name, const struct partialAttributeSetBlob *r) +{ + ndr_print_struct(ndr, name, "partialAttributeSetBlob"); + ndr->depth++; + ndr_print_uint32(ndr, "version", r->version); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr_print_set_switch_value(ndr, &r->ctr, r->version); + ndr_print_partialAttributeSetCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_prefixMapVersion(struct ndr_push *ndr, int ndr_flags, enum prefixMapVersion r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_prefixMapVersion(struct ndr_pull *ndr, int ndr_flags, enum prefixMapVersion *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_prefixMapVersion(struct ndr_print *ndr, const char *name, enum prefixMapVersion r) +{ + const char *val = NULL; + + switch (r) { + case PREFIX_MAP_VERSION_DSDB: val = "PREFIX_MAP_VERSION_DSDB"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_prefixMapCtr(struct ndr_push *ndr, int ndr_flags, const union prefixMapCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case PREFIX_MAP_VERSION_DSDB: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->dsdb)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case PREFIX_MAP_VERSION_DSDB: + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->dsdb)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_prefixMapCtr(struct ndr_pull *ndr, int ndr_flags, union prefixMapCtr *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case PREFIX_MAP_VERSION_DSDB: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->dsdb)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case PREFIX_MAP_VERSION_DSDB: + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->dsdb)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_prefixMapCtr(struct ndr_print *ndr, const char *name, const union prefixMapCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "prefixMapCtr"); + switch (level) { + case PREFIX_MAP_VERSION_DSDB: + ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "dsdb", &r->dsdb); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_prefixMapBlob(struct ndr_push *ndr, int ndr_flags, const struct prefixMapBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_prefixMapVersion(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_push_prefixMapCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_prefixMapCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_prefixMapBlob(struct ndr_pull *ndr, int ndr_flags, struct prefixMapBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_prefixMapVersion(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_pull_prefixMapCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_prefixMapCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_prefixMapBlob(struct ndr_print *ndr, const char *name, const struct prefixMapBlob *r) +{ + ndr_print_struct(ndr, name, "prefixMapBlob"); + ndr->depth++; + ndr_print_prefixMapVersion(ndr, "version", r->version); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr_print_set_switch_value(ndr, &r->ctr, r->version); + ndr_print_prefixMapCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ldapControlDirSyncExtra(struct ndr_push *ndr, int ndr_flags, const union ldapControlDirSyncExtra *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: { + break; } + + default: { + NDR_CHECK(ndr_push_replUpToDateVectorBlob(ndr, NDR_SCALARS, &r->uptodateness_vector)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ldapControlDirSyncExtra(struct ndr_pull *ndr, int ndr_flags, union ldapControlDirSyncExtra *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 0: { + break; } + + default: { + NDR_CHECK(ndr_pull_replUpToDateVectorBlob(ndr, NDR_SCALARS, &r->uptodateness_vector)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ldapControlDirSyncExtra(struct ndr_print *ndr, const char *name, const union ldapControlDirSyncExtra *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "ldapControlDirSyncExtra"); + switch (level) { + case 0: + break; + + default: + ndr_print_replUpToDateVectorBlob(ndr, "uptodateness_vector", &r->uptodateness_vector); + break; + + } +} + +static size_t ndr_size_ldapControlDirSyncExtra(const union ldapControlDirSyncExtra *r, uint32_t level, int flags) +{ + return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_ldapControlDirSyncExtra); +} + +static enum ndr_err_code ndr_push_ldapControlDirSyncBlob(struct ndr_push *ndr, int ndr_flags, const struct ldapControlDirSyncBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 3)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_ldapControlDirSyncExtra(&r->extra, r->extra.uptodateness_vector.version, 0))); + NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->extra, ndr_size_ldapControlDirSyncExtra(&r->extra, r->extra.uptodateness_vector.version, 0))); + NDR_CHECK(ndr_push_ldapControlDirSyncExtra(ndr, NDR_SCALARS, &r->extra)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_ldapControlDirSyncExtra(ndr, NDR_BUFFERS, &r->extra)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ldapControlDirSyncBlob(struct ndr_pull *ndr, int ndr_flags, struct ldapControlDirSyncBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u1)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->extra_length)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->extra, r->extra_length)); + NDR_CHECK(ndr_pull_ldapControlDirSyncExtra(ndr, NDR_SCALARS, &r->extra)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_ldapControlDirSyncExtra(ndr, NDR_BUFFERS, &r->extra)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ldapControlDirSyncBlob(struct ndr_print *ndr, const char *name, const struct ldapControlDirSyncBlob *r) +{ + ndr_print_struct(ndr, name, "ldapControlDirSyncBlob"); + ndr->depth++; + ndr_print_uint32(ndr, "u1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?3:r->u1); + ndr_print_NTTIME(ndr, "time", r->time); + ndr_print_uint32(ndr, "u2", r->u2); + ndr_print_uint32(ndr, "u3", r->u3); + ndr_print_uint32(ndr, "extra_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_ldapControlDirSyncExtra(&r->extra, r->extra.uptodateness_vector.version, 0):r->extra_length); + ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark); + ndr_print_GUID(ndr, "guid1", &r->guid1); + ndr_print_set_switch_value(ndr, &r->extra, r->extra_length); + ndr_print_ldapControlDirSyncExtra(ndr, "extra", &r->extra); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_ldapControlDirSyncCookie(struct ndr_push *ndr, int ndr_flags, const struct ldapControlDirSyncCookie *r) +{ + uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "MSDS", 4, sizeof(uint8_t), CH_DOS)); + { + struct ndr_push *_ndr_blob; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_blob, 0, -1)); + NDR_CHECK(ndr_push_ldapControlDirSyncBlob(_ndr_blob, NDR_SCALARS|NDR_BUFFERS, &r->blob)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_blob, 0, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r)); + } + ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_ldapControlDirSyncCookie(struct ndr_pull *ndr, int ndr_flags, struct ldapControlDirSyncCookie *r) +{ + uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->msds, 4, sizeof(uint8_t), CH_DOS)); + { + struct ndr_pull *_ndr_blob; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_blob, 0, -1)); + NDR_CHECK(ndr_pull_ldapControlDirSyncBlob(_ndr_blob, NDR_SCALARS|NDR_BUFFERS, &r->blob)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_blob, 0, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r)); + } + ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ldapControlDirSyncCookie(struct ndr_print *ndr, const char *name, const struct ldapControlDirSyncCookie *r) +{ + ndr_print_struct(ndr, name, "ldapControlDirSyncCookie"); + ndr->depth++; + ndr_print_string(ndr, "msds", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"MSDS":r->msds); + ndr_print_ldapControlDirSyncBlob(ndr, "blob", &r->blob); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_supplementalCredentialsPackage(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsPackage *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->name))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->data))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, 2 * strlen_m(r->name), sizeof(uint8_t), CH_UTF16)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data, strlen(r->data), sizeof(uint8_t), CH_DOS)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_supplementalCredentialsPackage(struct ndr_pull *ndr, int ndr_flags, struct supplementalCredentialsPackage *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_len)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_len)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, r->name_len, sizeof(uint8_t), CH_UTF16)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data, r->data_len, sizeof(uint8_t), CH_DOS)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_supplementalCredentialsPackage(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsPackage *r) +{ + ndr_print_struct(ndr, name, "supplementalCredentialsPackage"); + ndr->depth++; + ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->name):r->name_len); + ndr_print_uint16(ndr, "data_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->data):r->data_len); + ndr_print_uint16(ndr, "reserved", r->reserved); + ndr_print_string(ndr, "name", r->name); + ndr_print_string(ndr, "data", r->data); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_supplementalCredentialsSignature(struct ndr_push *ndr, int ndr_flags, enum supplementalCredentialsSignature r) +{ + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_supplementalCredentialsSignature(struct ndr_pull *ndr, int ndr_flags, enum supplementalCredentialsSignature *r) +{ + uint16_t v; + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_supplementalCredentialsSignature(struct ndr_print *ndr, const char *name, enum supplementalCredentialsSignature r) +{ + const char *val = NULL; + + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + switch (r) { + case SUPPLEMENTAL_CREDENTIALS_SIGNATURE: val = "SUPPLEMENTAL_CREDENTIALS_SIGNATURE"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); + ndr->flags = _flags_save_ENUM; + } +} + +static enum ndr_err_code ndr_push_supplementalCredentialsSubBlob(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsSubBlob *r) +{ + uint32_t cntr_packages_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, SUPPLEMENTAL_CREDENTIALS_PREFIX, 0x30, sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_supplementalCredentialsSignature(ndr, NDR_SCALARS, SUPPLEMENTAL_CREDENTIALS_SIGNATURE)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_packages)); + for (cntr_packages_0 = 0; cntr_packages_0 < r->num_packages; cntr_packages_0++) { + NDR_CHECK(ndr_push_supplementalCredentialsPackage(ndr, NDR_SCALARS, &r->packages[cntr_packages_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_supplementalCredentialsSubBlob(struct ndr_pull *ndr, int ndr_flags, struct supplementalCredentialsSubBlob *r) +{ + uint32_t cntr_packages_0; + TALLOC_CTX *_mem_save_packages_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->prefix, 0x30, sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_supplementalCredentialsSignature(ndr, NDR_SCALARS, &r->signature)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_packages)); + NDR_PULL_ALLOC_N(ndr, r->packages, r->num_packages); + _mem_save_packages_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->packages, 0); + for (cntr_packages_0 = 0; cntr_packages_0 < r->num_packages; cntr_packages_0++) { + NDR_CHECK(ndr_pull_supplementalCredentialsPackage(ndr, NDR_SCALARS, &r->packages[cntr_packages_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_packages_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_supplementalCredentialsSubBlob(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsSubBlob *r) +{ + uint32_t cntr_packages_0; + ndr_print_struct(ndr, name, "supplementalCredentialsSubBlob"); + ndr->depth++; + ndr_print_string(ndr, "prefix", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?SUPPLEMENTAL_CREDENTIALS_PREFIX:r->prefix); + ndr_print_supplementalCredentialsSignature(ndr, "signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?SUPPLEMENTAL_CREDENTIALS_SIGNATURE:r->signature); + ndr_print_uint16(ndr, "num_packages", r->num_packages); + ndr->print(ndr, "%s: ARRAY(%d)", "packages", (int)r->num_packages); + ndr->depth++; + for (cntr_packages_0=0;cntr_packages_0num_packages;cntr_packages_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_packages_0) != -1) { + ndr_print_supplementalCredentialsPackage(ndr, "packages", &r->packages[cntr_packages_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static size_t ndr_size_supplementalCredentialsSubBlob(const struct supplementalCredentialsSubBlob *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_supplementalCredentialsSubBlob); +} + +_PUBLIC_ enum ndr_err_code ndr_push_supplementalCredentialsBlob(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_supplementalCredentialsSubBlob(&r->sub, ndr->flags))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + { + struct ndr_push *_ndr_sub; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sub, 0, ndr_size_supplementalCredentialsSubBlob(&r->sub, ndr->flags))); + NDR_CHECK(ndr_push_supplementalCredentialsSubBlob(_ndr_sub, NDR_SCALARS, &r->sub)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sub, 0, ndr_size_supplementalCredentialsSubBlob(&r->sub, ndr->flags))); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 0)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_supplementalCredentialsBlob(struct ndr_pull *ndr, int ndr_flags, struct supplementalCredentialsBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + { + struct ndr_pull *_ndr_sub; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sub, 0, r->__ndr_size)); + NDR_CHECK(ndr_pull_supplementalCredentialsSubBlob(_ndr_sub, NDR_SCALARS, &r->sub)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sub, 0, r->__ndr_size)); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown3)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_supplementalCredentialsBlob(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsBlob *r) +{ + ndr_print_struct(ndr, name, "supplementalCredentialsBlob"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown1); + ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_supplementalCredentialsSubBlob(&r->sub, ndr->flags):r->__ndr_size); + ndr_print_uint32(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown2); + ndr_print_supplementalCredentialsSubBlob(ndr, "sub", &r->sub); + ndr_print_uint8(ndr, "unknown3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown3); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_package_PackagesBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PackagesBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->names)); + ndr->flags = _flags_save_string_array; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_package_PackagesBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PackagesBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->names)); + ndr->flags = _flags_save_string_array; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PackagesBlob(struct ndr_print *ndr, const char *name, const struct package_PackagesBlob *r) +{ + ndr_print_struct(ndr, name, "package_PackagesBlob"); + ndr->depth++; + ndr_print_string_array(ndr, "names", r->names); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_package_PrimaryKerberosString(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosString *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->string)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); + if (r->string) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->string)); + { + struct ndr_push *_ndr_string; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_string, 0, 2 * strlen_m(r->string))); + NDR_CHECK(ndr_push_string(_ndr_string, NDR_SCALARS, r->string)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_string, 0, 2 * strlen_m(r->string))); + } + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryKerberosString(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosString *r) +{ + uint32_t _ptr_string; + TALLOC_CTX *_mem_save_string_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->string, _ptr_string)); + } else { + r->string = NULL; + } + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); + if (r->string) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->string)); + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + { + struct ndr_pull *_ndr_string; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_string, 0, r->size)); + NDR_CHECK(ndr_pull_string(_ndr_string, NDR_SCALARS, &r->string)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_string, 0, r->size)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosString(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosString *r) +{ + ndr_print_struct(ndr, name, "package_PrimaryKerberosString"); + ndr->depth++; + ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->length); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->size); + ndr_print_ptr(ndr, "string", r->string); + ndr->depth++; + if (r->string) { + ndr_print_string(ndr, "string", r->string); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_package_PrimaryKerberosKey3(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosKey3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keytype)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (r->value?r->value->length:0))); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (r->value) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value)); + { + struct ndr_push *_ndr_value; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_value, 0, (r->value?r->value->length:0))); + NDR_CHECK(ndr_push_DATA_BLOB(_ndr_value, NDR_SCALARS, *r->value)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_value, 0, (r->value?r->value->length:0))); + } + } + ndr->flags = _flags_save_DATA_BLOB; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryKerberosKey3(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosKey3 *r) +{ + uint32_t _ptr_value; + TALLOC_CTX *_mem_save_value_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved1)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keytype)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value_len)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value)); + if (_ptr_value) { + NDR_PULL_ALLOC(ndr, r->value); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value, _ptr_value)); + } else { + r->value = NULL; + } + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (r->value) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value)); + _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->value, 0); + { + struct ndr_pull *_ndr_value; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_value, 0, r->value_len)); + NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_value, NDR_SCALARS, r->value)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_value, 0, r->value_len)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_DATA_BLOB; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosKey3(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosKey3 *r) +{ + ndr_print_struct(ndr, name, "package_PrimaryKerberosKey3"); + ndr->depth++; + ndr_print_uint16(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); + ndr_print_uint16(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2); + ndr_print_uint32(ndr, "reserved3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved3); + ndr_print_uint32(ndr, "keytype", r->keytype); + ndr_print_uint32(ndr, "value_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?(r->value?r->value->length:0):r->value_len); + ndr_print_ptr(ndr, "value", r->value); + ndr->depth++; + if (r->value) { + ndr_print_DATA_BLOB(ndr, "value", *r->value); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr3(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosCtr3 *r) +{ + uint32_t cntr_keys_0; + uint32_t cntr_old_keys_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_keys)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_old_keys)); + NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey3(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); + } + for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey3(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey3(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); + } + for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey3(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryKerberosCtr3(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosCtr3 *r) +{ + uint32_t cntr_keys_0; + TALLOC_CTX *_mem_save_keys_0; + uint32_t cntr_old_keys_0; + TALLOC_CTX *_mem_save_old_keys_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_keys)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_old_keys)); + NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); + NDR_PULL_ALLOC_N(ndr, r->keys, r->num_keys); + _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey3(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); + NDR_PULL_ALLOC_N(ndr, r->old_keys, r->num_old_keys); + _mem_save_old_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->old_keys, 0); + for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey3(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys_0, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding5)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); + _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey3(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); + _mem_save_old_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->old_keys, 0); + for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey3(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosCtr3(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosCtr3 *r) +{ + uint32_t cntr_keys_0; + uint32_t cntr_old_keys_0; + ndr_print_struct(ndr, name, "package_PrimaryKerberosCtr3"); + ndr->depth++; + ndr_print_uint16(ndr, "num_keys", r->num_keys); + ndr_print_uint16(ndr, "num_old_keys", r->num_old_keys); + ndr_print_package_PrimaryKerberosString(ndr, "salt", &r->salt); + ndr->print(ndr, "%s: ARRAY(%d)", "keys", (int)r->num_keys); + ndr->depth++; + for (cntr_keys_0=0;cntr_keys_0num_keys;cntr_keys_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_keys_0) != -1) { + ndr_print_package_PrimaryKerberosKey3(ndr, "keys", &r->keys[cntr_keys_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "old_keys", (int)r->num_old_keys); + ndr->depth++; + for (cntr_old_keys_0=0;cntr_old_keys_0num_old_keys;cntr_old_keys_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_old_keys_0) != -1) { + ndr_print_package_PrimaryKerberosKey3(ndr, "old_keys", &r->old_keys[cntr_old_keys_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_uint32(ndr, "padding1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding1); + ndr_print_uint32(ndr, "padding2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding2); + ndr_print_uint32(ndr, "padding3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding3); + ndr_print_uint32(ndr, "padding4", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding4); + ndr_print_uint32(ndr, "padding5", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding5); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_package_PrimaryKerberosKey4(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosKey4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->iteration_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keytype)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (r->value?r->value->length:0))); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (r->value) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value)); + { + struct ndr_push *_ndr_value; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_value, 0, (r->value?r->value->length:0))); + NDR_CHECK(ndr_push_DATA_BLOB(_ndr_value, NDR_SCALARS, *r->value)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_value, 0, (r->value?r->value->length:0))); + } + } + ndr->flags = _flags_save_DATA_BLOB; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryKerberosKey4(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosKey4 *r) +{ + uint32_t _ptr_value; + TALLOC_CTX *_mem_save_value_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved1)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->iteration_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keytype)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value_len)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value)); + if (_ptr_value) { + NDR_PULL_ALLOC(ndr, r->value); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value, _ptr_value)); + } else { + r->value = NULL; + } + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (r->value) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value)); + _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->value, 0); + { + struct ndr_pull *_ndr_value; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_value, 0, r->value_len)); + NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_value, NDR_SCALARS, r->value)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_value, 0, r->value_len)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_DATA_BLOB; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosKey4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosKey4 *r) +{ + ndr_print_struct(ndr, name, "package_PrimaryKerberosKey4"); + ndr->depth++; + ndr_print_uint16(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); + ndr_print_uint16(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2); + ndr_print_uint32(ndr, "reserved3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved3); + ndr_print_uint32(ndr, "iteration_count", r->iteration_count); + ndr_print_uint32(ndr, "keytype", r->keytype); + ndr_print_uint32(ndr, "value_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?(r->value?r->value->length:0):r->value_len); + ndr_print_ptr(ndr, "value", r->value); + ndr->depth++; + if (r->value) { + ndr_print_DATA_BLOB(ndr, "value", *r->value); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr4(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosCtr4 *r) +{ + uint32_t cntr_keys_0; + uint32_t cntr_service_keys_0; + uint32_t cntr_old_keys_0; + uint32_t cntr_older_keys_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_keys)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_old_keys)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_older_keys)); + NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->default_iteration_count)); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); + } + for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; cntr_service_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->service_keys[cntr_service_keys_0])); + } + for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); + } + for (cntr_older_keys_0 = 0; cntr_older_keys_0 < r->num_older_keys; cntr_older_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->older_keys[cntr_older_keys_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); + } + for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; cntr_service_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->service_keys[cntr_service_keys_0])); + } + for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0])); + } + for (cntr_older_keys_0 = 0; cntr_older_keys_0 < r->num_older_keys; cntr_older_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->older_keys[cntr_older_keys_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryKerberosCtr4(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosCtr4 *r) +{ + uint32_t cntr_keys_0; + TALLOC_CTX *_mem_save_keys_0; + uint32_t cntr_service_keys_0; + TALLOC_CTX *_mem_save_service_keys_0; + uint32_t cntr_old_keys_0; + TALLOC_CTX *_mem_save_old_keys_0; + uint32_t cntr_older_keys_0; + TALLOC_CTX *_mem_save_older_keys_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_keys)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_service_keys)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_old_keys)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_older_keys)); + NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->default_iteration_count)); + NDR_PULL_ALLOC_N(ndr, r->keys, r->num_keys); + _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); + NDR_PULL_ALLOC_N(ndr, r->service_keys, r->num_service_keys); + _mem_save_service_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->service_keys, 0); + for (cntr_service_keys_0 = 0; cntr_service_keys_0 < r->num_service_keys; cntr_service_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->service_keys[cntr_service_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_keys_0, 0); + NDR_PULL_ALLOC_N(ndr, r->old_keys, r->num_old_keys); + _mem_save_old_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->old_keys, 0); + for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys_0, 0); + NDR_PULL_ALLOC_N(ndr, r->older_keys, r->num_older_keys); + _mem_save_older_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->older_keys, 0); + for (cntr_older_keys_0 = 0; cntr_older_keys_0 < r->num_older_keys; cntr_older_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->older_keys[cntr_older_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_older_keys_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); + _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); + _mem_save_service_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->service_keys, 0); + for (cntr_service_keys_0 = 0; cntr_service_keys_0 < r->num_service_keys; cntr_service_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->service_keys[cntr_service_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_keys_0, 0); + _mem_save_old_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->old_keys, 0); + for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys_0, 0); + _mem_save_older_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->older_keys, 0); + for (cntr_older_keys_0 = 0; cntr_older_keys_0 < r->num_older_keys; cntr_older_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->older_keys[cntr_older_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_older_keys_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosCtr4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosCtr4 *r) +{ + uint32_t cntr_keys_0; + uint32_t cntr_service_keys_0; + uint32_t cntr_old_keys_0; + uint32_t cntr_older_keys_0; + ndr_print_struct(ndr, name, "package_PrimaryKerberosCtr4"); + ndr->depth++; + ndr_print_uint16(ndr, "num_keys", r->num_keys); + ndr_print_uint16(ndr, "num_service_keys", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->num_service_keys); + ndr_print_uint16(ndr, "num_old_keys", r->num_old_keys); + ndr_print_uint16(ndr, "num_older_keys", r->num_older_keys); + ndr_print_package_PrimaryKerberosString(ndr, "salt", &r->salt); + ndr_print_uint32(ndr, "default_iteration_count", r->default_iteration_count); + ndr->print(ndr, "%s: ARRAY(%d)", "keys", (int)r->num_keys); + ndr->depth++; + for (cntr_keys_0=0;cntr_keys_0num_keys;cntr_keys_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_keys_0) != -1) { + ndr_print_package_PrimaryKerberosKey4(ndr, "keys", &r->keys[cntr_keys_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "service_keys", (int)r->num_service_keys); + ndr->depth++; + for (cntr_service_keys_0=0;cntr_service_keys_0num_service_keys;cntr_service_keys_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_service_keys_0) != -1) { + ndr_print_package_PrimaryKerberosKey4(ndr, "service_keys", &r->service_keys[cntr_service_keys_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "old_keys", (int)r->num_old_keys); + ndr->depth++; + for (cntr_old_keys_0=0;cntr_old_keys_0num_old_keys;cntr_old_keys_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_old_keys_0) != -1) { + ndr_print_package_PrimaryKerberosKey4(ndr, "old_keys", &r->old_keys[cntr_old_keys_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "older_keys", (int)r->num_older_keys); + ndr->depth++; + for (cntr_older_keys_0=0;cntr_older_keys_0num_older_keys;cntr_older_keys_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_older_keys_0) != -1) { + ndr_print_package_PrimaryKerberosKey4(ndr, "older_keys", &r->older_keys[cntr_older_keys_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr(struct ndr_push *ndr, int ndr_flags, const union package_PrimaryKerberosCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 3: { + NDR_CHECK(ndr_push_package_PrimaryKerberosCtr3(ndr, NDR_SCALARS, &r->ctr3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_package_PrimaryKerberosCtr4(ndr, NDR_SCALARS, &r->ctr4)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 3: + NDR_CHECK(ndr_push_package_PrimaryKerberosCtr3(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + case 4: + NDR_CHECK(ndr_push_package_PrimaryKerberosCtr4(ndr, NDR_BUFFERS, &r->ctr4)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryKerberosCtr(struct ndr_pull *ndr, int ndr_flags, union package_PrimaryKerberosCtr *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 3: { + NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr3(ndr, NDR_SCALARS, &r->ctr3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr4(ndr, NDR_SCALARS, &r->ctr4)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 3: + NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr3(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + case 4: + NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr4(ndr, NDR_BUFFERS, &r->ctr4)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosCtr(struct ndr_print *ndr, const char *name, const union package_PrimaryKerberosCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "package_PrimaryKerberosCtr"); + switch (level) { + case 3: + ndr_print_package_PrimaryKerberosCtr3(ndr, "ctr3", &r->ctr3); + break; + + case 4: + ndr_print_package_PrimaryKerberosCtr4(ndr, "ctr4", &r->ctr4); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_package_PrimaryKerberosBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_push_package_PrimaryKerberosCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_package_PrimaryKerberosCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_package_PrimaryKerberosBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosBlob *r) +{ + ndr_print_struct(ndr, name, "package_PrimaryKerberosBlob"); + ndr->depth++; + ndr_print_uint16(ndr, "version", r->version); + ndr_print_uint16(ndr, "flags", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->flags); + ndr_print_set_switch_value(ndr, &r->ctr, r->version); + ndr_print_package_PrimaryKerberosCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_package_PrimaryCLEARTEXTBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryCLEARTEXTBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->cleartext)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_package_PrimaryCLEARTEXTBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryCLEARTEXTBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->cleartext)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryCLEARTEXTBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryCLEARTEXTBlob *r) +{ + ndr_print_struct(ndr, name, "package_PrimaryCLEARTEXTBlob"); + ndr->depth++; + ndr_print_DATA_BLOB(ndr, "cleartext", r->cleartext); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_package_PrimaryWDigestHash(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryWDigestHash *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryWDigestHash(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryWDigestHash *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryWDigestHash(struct ndr_print *ndr, const char *name, const struct package_PrimaryWDigestHash *r) +{ + ndr_print_struct(ndr, name, "package_PrimaryWDigestHash"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "hash", r->hash, 16); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_package_PrimaryWDigestBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryWDigestBlob *r) +{ + uint32_t cntr_hashes_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0x31)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 0x01)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_hashes)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, 0)); + for (cntr_hashes_0 = 0; cntr_hashes_0 < r->num_hashes; cntr_hashes_0++) { + NDR_CHECK(ndr_push_package_PrimaryWDigestHash(ndr, NDR_SCALARS, &r->hashes[cntr_hashes_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_package_PrimaryWDigestBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryWDigestBlob *r) +{ + uint32_t cntr_hashes_0; + TALLOC_CTX *_mem_save_hashes_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_hashes)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->uuknown4)); + NDR_PULL_ALLOC_N(ndr, r->hashes, r->num_hashes); + _mem_save_hashes_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->hashes, 0); + for (cntr_hashes_0 = 0; cntr_hashes_0 < r->num_hashes; cntr_hashes_0++) { + NDR_CHECK(ndr_pull_package_PrimaryWDigestHash(ndr, NDR_SCALARS, &r->hashes[cntr_hashes_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hashes_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryWDigestBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryWDigestBlob *r) +{ + uint32_t cntr_hashes_0; + ndr_print_struct(ndr, name, "package_PrimaryWDigestBlob"); + ndr->depth++; + ndr_print_uint16(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x31:r->unknown1); + ndr_print_uint8(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x01:r->unknown2); + ndr_print_uint8(ndr, "num_hashes", r->num_hashes); + ndr_print_uint32(ndr, "unknown3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown3); + ndr_print_udlong(ndr, "uuknown4", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->uuknown4); + ndr->print(ndr, "%s: ARRAY(%d)", "hashes", (int)r->num_hashes); + ndr->depth++; + for (cntr_hashes_0=0;cntr_hashes_0num_hashes;cntr_hashes_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_hashes_0) != -1) { + ndr_print_package_PrimaryWDigestHash(ndr, "hashes", &r->hashes[cntr_hashes_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_AuthInfoNone(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoNone *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_AuthInfoNone(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoNone *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_AuthInfoNone(struct ndr_print *ndr, const char *name, const struct AuthInfoNone *r) +{ + ndr_print_struct(ndr, name, "AuthInfoNone"); + ndr->depth++; + ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->size); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_AuthInfoNT4Owf(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoNT4Owf *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 16)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_AuthInfoNT4Owf(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoNT4Owf *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_AuthInfoNT4Owf(struct ndr_print *ndr, const char *name, const struct AuthInfoNT4Owf *r) +{ + ndr_print_struct(ndr, name, "AuthInfoNT4Owf"); + ndr->depth++; + ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?16:r->size); + ndr_print_samr_Password(ndr, "password", &r->password); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_AuthInfoClear(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoClear *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->password, r->size)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_AuthInfoClear(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoClear *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_PULL_ALLOC_N(ndr, r->password, r->size); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->password, r->size)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_AuthInfoClear(struct ndr_print *ndr, const char *name, const struct AuthInfoClear *r) +{ + ndr_print_struct(ndr, name, "AuthInfoClear"); + ndr->depth++; + ndr_print_uint32(ndr, "size", r->size); + ndr_print_array_uint8(ndr, "password", r->password, r->size); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_AuthInfoVersion(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoVersion *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_AuthInfoVersion(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoVersion *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_AuthInfoVersion(struct ndr_print *ndr, const char *name, const struct AuthInfoVersion *r) +{ + ndr_print_struct(ndr, name, "AuthInfoVersion"); + ndr->depth++; + ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?4:r->size); + ndr_print_uint32(ndr, "version", r->version); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_AuthInfo(struct ndr_push *ndr, int ndr_flags, const union AuthInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case TRUST_AUTH_TYPE_NONE: { + NDR_CHECK(ndr_push_AuthInfoNone(ndr, NDR_SCALARS, &r->none)); + break; } + + case TRUST_AUTH_TYPE_NT4OWF: { + NDR_CHECK(ndr_push_AuthInfoNT4Owf(ndr, NDR_SCALARS, &r->nt4owf)); + break; } + + case TRUST_AUTH_TYPE_CLEAR: { + NDR_CHECK(ndr_push_AuthInfoClear(ndr, NDR_SCALARS, &r->clear)); + break; } + + case TRUST_AUTH_TYPE_VERSION: { + NDR_CHECK(ndr_push_AuthInfoVersion(ndr, NDR_SCALARS, &r->version)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case TRUST_AUTH_TYPE_NONE: + break; + + case TRUST_AUTH_TYPE_NT4OWF: + break; + + case TRUST_AUTH_TYPE_CLEAR: + break; + + case TRUST_AUTH_TYPE_VERSION: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_AuthInfo(struct ndr_pull *ndr, int ndr_flags, union AuthInfo *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case TRUST_AUTH_TYPE_NONE: { + NDR_CHECK(ndr_pull_AuthInfoNone(ndr, NDR_SCALARS, &r->none)); + break; } + + case TRUST_AUTH_TYPE_NT4OWF: { + NDR_CHECK(ndr_pull_AuthInfoNT4Owf(ndr, NDR_SCALARS, &r->nt4owf)); + break; } + + case TRUST_AUTH_TYPE_CLEAR: { + NDR_CHECK(ndr_pull_AuthInfoClear(ndr, NDR_SCALARS, &r->clear)); + break; } + + case TRUST_AUTH_TYPE_VERSION: { + NDR_CHECK(ndr_pull_AuthInfoVersion(ndr, NDR_SCALARS, &r->version)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case TRUST_AUTH_TYPE_NONE: + break; + + case TRUST_AUTH_TYPE_NT4OWF: + break; + + case TRUST_AUTH_TYPE_CLEAR: + break; + + case TRUST_AUTH_TYPE_VERSION: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_AuthInfo(struct ndr_print *ndr, const char *name, const union AuthInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "AuthInfo"); + switch (level) { + case TRUST_AUTH_TYPE_NONE: + ndr_print_AuthInfoNone(ndr, "none", &r->none); + break; + + case TRUST_AUTH_TYPE_NT4OWF: + ndr_print_AuthInfoNT4Owf(ndr, "nt4owf", &r->nt4owf); + break; + + case TRUST_AUTH_TYPE_CLEAR: + ndr_print_AuthInfoClear(ndr, "clear", &r->clear); + break; + + case TRUST_AUTH_TYPE_VERSION: + ndr_print_AuthInfoVersion(ndr, "version", &r->version); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_AuthenticationInformation(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformation *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->LastUpdateTime)); + NDR_CHECK(ndr_push_lsa_TrustAuthType(ndr, NDR_SCALARS, r->AuthType)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->AuthInfo, r->AuthType)); + NDR_CHECK(ndr_push_AuthInfo(ndr, NDR_SCALARS, &r->AuthInfo)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_AuthenticationInformation(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformation *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->LastUpdateTime)); + NDR_CHECK(ndr_pull_lsa_TrustAuthType(ndr, NDR_SCALARS, &r->AuthType)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->AuthInfo, r->AuthType)); + NDR_CHECK(ndr_pull_AuthInfo(ndr, NDR_SCALARS, &r->AuthInfo)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_AuthenticationInformation(struct ndr_print *ndr, const char *name, const struct AuthenticationInformation *r) +{ + ndr_print_struct(ndr, name, "AuthenticationInformation"); + ndr->depth++; + ndr_print_NTTIME(ndr, "LastUpdateTime", r->LastUpdateTime); + ndr_print_lsa_TrustAuthType(ndr, "AuthType", r->AuthType); + ndr_print_set_switch_value(ndr, &r->AuthInfo, r->AuthType); + ndr_print_AuthInfo(ndr, "AuthInfo", &r->AuthInfo); + ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_trustAuthInOutBlob(const struct trustAuthInOutBlob *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_trustAuthInOutBlob); +} + +_PUBLIC_ enum ndr_err_code ndr_push_trustCurrentPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustCurrentPasswords *r) +{ + uint32_t cntr_current_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) { + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->current[cntr_current_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) { + if (r->current[cntr_current_0]) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->current[cntr_current_0])); + NDR_CHECK(ndr_push_AuthenticationInformation(ndr, NDR_SCALARS, r->current[cntr_current_0])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_trustCurrentPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustCurrentPasswords *r) +{ + uint32_t _ptr_current; + uint32_t cntr_current_0; + TALLOC_CTX *_mem_save_current_0; + TALLOC_CTX *_mem_save_current_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_PULL_ALLOC_N(ndr, r->current, r->count); + _mem_save_current_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->current, 0); + for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_current)); + if (_ptr_current) { + NDR_PULL_ALLOC(ndr, r->current[cntr_current_0]); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->current[cntr_current_0], _ptr_current)); + } else { + r->current[cntr_current_0] = NULL; + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_current_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->current, 0); + for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) { + if (r->current[cntr_current_0]) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->current[cntr_current_0])); + _mem_save_current_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->current[cntr_current_0], 0); + NDR_CHECK(ndr_pull_AuthenticationInformation(ndr, NDR_SCALARS, r->current[cntr_current_0])); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_1, 0); + ndr->offset = _relative_save_offset; + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_trustCurrentPasswords(struct ndr_print *ndr, const char *name, const struct trustCurrentPasswords *r) +{ + uint32_t cntr_current_0; + ndr_print_struct(ndr, name, "trustCurrentPasswords"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr->print(ndr, "%s: ARRAY(%d)", "current", (int)r->count); + ndr->depth++; + for (cntr_current_0=0;cntr_current_0count;cntr_current_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_current_0) != -1) { + ndr_print_ptr(ndr, "current", r->current[cntr_current_0]); + ndr->depth++; + if (r->current[cntr_current_0]) { + ndr_print_AuthenticationInformation(ndr, "current", r->current[cntr_current_0]); + } + ndr->depth--; + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_trustCurrentPasswords(const struct trustCurrentPasswords *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_trustCurrentPasswords); +} + +_PUBLIC_ enum ndr_err_code ndr_push_trustDomainPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustDomainPasswords *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->confounder, 512)); + { + struct ndr_push *_ndr_outgoing; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_outgoing, 0, ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags))); + NDR_CHECK(ndr_push_trustCurrentPasswords(_ndr_outgoing, NDR_SCALARS|NDR_BUFFERS, &r->outgoing)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_outgoing, 0, ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags))); + } + { + struct ndr_push *_ndr_incoming; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_incoming, 0, ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags))); + NDR_CHECK(ndr_push_trustCurrentPasswords(_ndr_incoming, NDR_SCALARS|NDR_BUFFERS, &r->incoming)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_incoming, 0, ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags))); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags))); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_trustDomainPasswords(struct ndr_print *ndr, const char *name, const struct trustDomainPasswords *r) +{ + ndr_print_struct(ndr, name, "trustDomainPasswords"); + ndr->depth++; + ndr_print_array_uint8(ndr, "confounder", r->confounder, 512); + ndr_print_trustCurrentPasswords(ndr, "outgoing", &r->outgoing); + ndr_print_trustCurrentPasswords(ndr, "incoming", &r->incoming); + ndr_print_uint32(ndr, "outgoing_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags):r->outgoing_size); + ndr_print_uint32(ndr, "incoming_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags):r->incoming_size); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_DsCompressedChunk(struct ndr_push *ndr, int ndr_flags, const struct DsCompressedChunk *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->marker)); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_DsCompressedChunk(struct ndr_pull *ndr, int ndr_flags, struct DsCompressedChunk *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->marker)); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DsCompressedChunk(struct ndr_print *ndr, const char *name, const struct DsCompressedChunk *r) +{ + ndr_print_struct(ndr, name, "DsCompressedChunk"); + ndr->depth++; + ndr_print_uint32(ndr, "marker", r->marker); + ndr_print_DATA_BLOB(ndr, "data", r->data); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ExtendedErrorAString(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorAString *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->__size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->__size)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, r->__size, sizeof(uint8_t), CH_DOS)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorAString(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorAString *r) +{ + uint32_t _ptr_string; + TALLOC_CTX *_mem_save_string_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->__size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + } else { + r->string = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_size(ndr, &r->string), sizeof(uint8_t), CH_DOS)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + } + if (r->string) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->__size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorAString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorAString *r) +{ + ndr_print_struct(ndr, name, "ExtendedErrorAString"); + ndr->depth++; + ndr_print_uint16(ndr, "__size", r->__size); + ndr_print_ptr(ndr, "string", r->string); + ndr->depth++; + if (r->string) { + ndr_print_string(ndr, "string", r->string); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ExtendedErrorUString(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorUString *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->__size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->__size)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, r->__size, sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorUString(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorUString *r) +{ + uint32_t _ptr_string; + TALLOC_CTX *_mem_save_string_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->__size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + } else { + r->string = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_size(ndr, &r->string), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + } + if (r->string) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->__size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorUString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorUString *r) +{ + ndr_print_struct(ndr, name, "ExtendedErrorUString"); + ndr->depth++; + ndr_print_uint16(ndr, "__size", r->__size); + ndr_print_ptr(ndr, "string", r->string); + ndr->depth++; + if (r->string) { + ndr_print_string(ndr, "string", r->string); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ExtendedErrorBlob(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorBlob(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorBlob *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorBlob(struct ndr_print *ndr, const char *name, const struct ExtendedErrorBlob *r) +{ + ndr_print_struct(ndr, name, "ExtendedErrorBlob"); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ExtendedErrorComputerNamePresent(struct ndr_push *ndr, int ndr_flags, enum ExtendedErrorComputerNamePresent r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorComputerNamePresent(struct ndr_pull *ndr, int ndr_flags, enum ExtendedErrorComputerNamePresent *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorComputerNamePresent(struct ndr_print *ndr, const char *name, enum ExtendedErrorComputerNamePresent r) +{ + const char *val = NULL; + + switch (r) { + case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: val = "EXTENDED_ERROR_COMPUTER_NAME_PRESENT"; break; + case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: val = "EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_ExtendedErrorComputerNameU(struct ndr_push *ndr, int ndr_flags, const union ExtendedErrorComputerNameU *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_ExtendedErrorComputerNamePresent(ndr, NDR_SCALARS, level)); + switch (level) { + case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: { + NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_SCALARS, &r->name)); + break; } + + case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: { + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: + NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->name)); + break; + + case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorComputerNameU(struct ndr_pull *ndr, int ndr_flags, union ExtendedErrorComputerNameU *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: { + NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_SCALARS, &r->name)); + break; } + + case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: { + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: + NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->name)); + break; + + case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorComputerNameU(struct ndr_print *ndr, const char *name, const union ExtendedErrorComputerNameU *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "ExtendedErrorComputerNameU"); + switch (level) { + case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: + ndr_print_ExtendedErrorUString(ndr, "name", &r->name); + break; + + case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_ExtendedErrorComputerName(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorComputerName *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_ExtendedErrorComputerNamePresent(ndr, NDR_SCALARS, r->present)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->n, r->present)); + NDR_CHECK(ndr_push_ExtendedErrorComputerNameU(ndr, NDR_SCALARS, &r->n)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_ExtendedErrorComputerNameU(ndr, NDR_BUFFERS, &r->n)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorComputerName(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorComputerName *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_ExtendedErrorComputerNamePresent(ndr, NDR_SCALARS, &r->present)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->n, r->present)); + NDR_CHECK(ndr_pull_ExtendedErrorComputerNameU(ndr, NDR_SCALARS, &r->n)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_ExtendedErrorComputerNameU(ndr, NDR_BUFFERS, &r->n)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorComputerName(struct ndr_print *ndr, const char *name, const struct ExtendedErrorComputerName *r) +{ + ndr_print_struct(ndr, name, "ExtendedErrorComputerName"); + ndr->depth++; + ndr_print_ExtendedErrorComputerNamePresent(ndr, "present", r->present); + ndr_print_set_switch_value(ndr, &r->n, r->present); + ndr_print_ExtendedErrorComputerNameU(ndr, "n", &r->n); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ExtendedErrorParamType(struct ndr_push *ndr, int ndr_flags, enum ExtendedErrorParamType r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorParamType(struct ndr_pull *ndr, int ndr_flags, enum ExtendedErrorParamType *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorParamType(struct ndr_print *ndr, const char *name, enum ExtendedErrorParamType r) +{ + const char *val = NULL; + + switch (r) { + case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: val = "EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING"; break; + case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: val = "EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING"; break; + case EXTENDED_ERROR_PARAM_TYPE_UINT32: val = "EXTENDED_ERROR_PARAM_TYPE_UINT32"; break; + case EXTENDED_ERROR_PARAM_TYPE_UINT16: val = "EXTENDED_ERROR_PARAM_TYPE_UINT16"; break; + case EXTENDED_ERROR_PARAM_TYPE_UINT64: val = "EXTENDED_ERROR_PARAM_TYPE_UINT64"; break; + case EXTENDED_ERROR_PARAM_TYPE_NONE: val = "EXTENDED_ERROR_PARAM_TYPE_NONE"; break; + case EXTENDED_ERROR_PARAM_TYPE_BLOB: val = "EXTENDED_ERROR_PARAM_TYPE_BLOB"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_ExtendedErrorParamU(struct ndr_push *ndr, int ndr_flags, const union ExtendedErrorParamU *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_ExtendedErrorParamType(ndr, NDR_SCALARS, level)); + switch (level) { + case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: { + NDR_CHECK(ndr_push_ExtendedErrorAString(ndr, NDR_SCALARS, &r->a_string)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: { + NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_SCALARS, &r->u_string)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_UINT32: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->uint32)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_UINT16: { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->uint16)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_UINT64: { + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->uint64)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_NONE: { + break; } + + case EXTENDED_ERROR_PARAM_TYPE_BLOB: { + NDR_CHECK(ndr_push_ExtendedErrorBlob(ndr, NDR_SCALARS, &r->blob)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: + NDR_CHECK(ndr_push_ExtendedErrorAString(ndr, NDR_BUFFERS, &r->a_string)); + break; + + case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: + NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->u_string)); + break; + + case EXTENDED_ERROR_PARAM_TYPE_UINT32: + break; + + case EXTENDED_ERROR_PARAM_TYPE_UINT16: + break; + + case EXTENDED_ERROR_PARAM_TYPE_UINT64: + break; + + case EXTENDED_ERROR_PARAM_TYPE_NONE: + break; + + case EXTENDED_ERROR_PARAM_TYPE_BLOB: + NDR_CHECK(ndr_push_ExtendedErrorBlob(ndr, NDR_BUFFERS, &r->blob)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorParamU(struct ndr_pull *ndr, int ndr_flags, union ExtendedErrorParamU *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: { + NDR_CHECK(ndr_pull_ExtendedErrorAString(ndr, NDR_SCALARS, &r->a_string)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: { + NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_SCALARS, &r->u_string)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_UINT32: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->uint32)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_UINT16: { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->uint16)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_UINT64: { + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->uint64)); + break; } + + case EXTENDED_ERROR_PARAM_TYPE_NONE: { + break; } + + case EXTENDED_ERROR_PARAM_TYPE_BLOB: { + NDR_CHECK(ndr_pull_ExtendedErrorBlob(ndr, NDR_SCALARS, &r->blob)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: + NDR_CHECK(ndr_pull_ExtendedErrorAString(ndr, NDR_BUFFERS, &r->a_string)); + break; + + case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: + NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->u_string)); + break; + + case EXTENDED_ERROR_PARAM_TYPE_UINT32: + break; + + case EXTENDED_ERROR_PARAM_TYPE_UINT16: + break; + + case EXTENDED_ERROR_PARAM_TYPE_UINT64: + break; + + case EXTENDED_ERROR_PARAM_TYPE_NONE: + break; + + case EXTENDED_ERROR_PARAM_TYPE_BLOB: + NDR_CHECK(ndr_pull_ExtendedErrorBlob(ndr, NDR_BUFFERS, &r->blob)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorParamU(struct ndr_print *ndr, const char *name, const union ExtendedErrorParamU *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "ExtendedErrorParamU"); + switch (level) { + case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: + ndr_print_ExtendedErrorAString(ndr, "a_string", &r->a_string); + break; + + case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: + ndr_print_ExtendedErrorUString(ndr, "u_string", &r->u_string); + break; + + case EXTENDED_ERROR_PARAM_TYPE_UINT32: + ndr_print_uint32(ndr, "uint32", r->uint32); + break; + + case EXTENDED_ERROR_PARAM_TYPE_UINT16: + ndr_print_uint16(ndr, "uint16", r->uint16); + break; + + case EXTENDED_ERROR_PARAM_TYPE_UINT64: + ndr_print_hyper(ndr, "uint64", r->uint64); + break; + + case EXTENDED_ERROR_PARAM_TYPE_NONE: + break; + + case EXTENDED_ERROR_PARAM_TYPE_BLOB: + ndr_print_ExtendedErrorBlob(ndr, "blob", &r->blob); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_ExtendedErrorParam(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorParam *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_ExtendedErrorParamType(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->p, r->type)); + NDR_CHECK(ndr_push_ExtendedErrorParamU(ndr, NDR_SCALARS, &r->p)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_ExtendedErrorParamU(ndr, NDR_BUFFERS, &r->p)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorParam(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorParam *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_ExtendedErrorParamType(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->p, r->type)); + NDR_CHECK(ndr_pull_ExtendedErrorParamU(ndr, NDR_SCALARS, &r->p)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_ExtendedErrorParamU(ndr, NDR_BUFFERS, &r->p)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorParam(struct ndr_print *ndr, const char *name, const struct ExtendedErrorParam *r) +{ + ndr_print_struct(ndr, name, "ExtendedErrorParam"); + ndr->depth++; + ndr_print_ExtendedErrorParamType(ndr, "type", r->type); + ndr_print_set_switch_value(ndr, &r->p, r->type); + ndr_print_ExtendedErrorParamU(ndr, "p", &r->p); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_ExtendedErrorInfo(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorInfo *r) +{ + uint32_t cntr_params_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_params)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->next)); + NDR_CHECK(ndr_push_ExtendedErrorComputerName(ndr, NDR_SCALARS, &r->computer_name)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->pid)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->generating_component)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->detection_location)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_params)); + for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) { + NDR_CHECK(ndr_push_ExtendedErrorParam(ndr, NDR_SCALARS, &r->params[cntr_params_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->next) { + NDR_CHECK(ndr_push_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->next)); + } + NDR_CHECK(ndr_push_ExtendedErrorComputerName(ndr, NDR_BUFFERS, &r->computer_name)); + for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) { + NDR_CHECK(ndr_push_ExtendedErrorParam(ndr, NDR_BUFFERS, &r->params[cntr_params_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_ExtendedErrorInfo(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorInfo *r) +{ + uint32_t _ptr_next; + TALLOC_CTX *_mem_save_next_0; + uint32_t cntr_params_0; + TALLOC_CTX *_mem_save_params_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->params)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next)); + if (_ptr_next) { + NDR_PULL_ALLOC(ndr, r->next); + } else { + r->next = NULL; + } + NDR_CHECK(ndr_pull_ExtendedErrorComputerName(ndr, NDR_SCALARS, &r->computer_name)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->pid)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->generating_component)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->detection_location)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_params)); + NDR_PULL_ALLOC_N(ndr, r->params, ndr_get_array_size(ndr, &r->params)); + _mem_save_params_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->params, 0); + for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) { + NDR_CHECK(ndr_pull_ExtendedErrorParam(ndr, NDR_SCALARS, &r->params[cntr_params_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_params_0, 0); + if (r->params) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->params, r->num_params)); + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->next) { + _mem_save_next_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->next, 0); + NDR_CHECK(ndr_pull_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->next)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_0, 0); + } + NDR_CHECK(ndr_pull_ExtendedErrorComputerName(ndr, NDR_BUFFERS, &r->computer_name)); + _mem_save_params_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->params, 0); + for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) { + NDR_CHECK(ndr_pull_ExtendedErrorParam(ndr, NDR_BUFFERS, &r->params[cntr_params_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_params_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfo *r) +{ + uint32_t cntr_params_0; + ndr_print_struct(ndr, name, "ExtendedErrorInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "next", r->next); + ndr->depth++; + if (r->next) { + ndr_print_ExtendedErrorInfo(ndr, "next", r->next); + } + ndr->depth--; + ndr_print_ExtendedErrorComputerName(ndr, "computer_name", &r->computer_name); + ndr_print_hyper(ndr, "pid", r->pid); + ndr_print_NTTIME(ndr, "time", r->time); + ndr_print_uint32(ndr, "generating_component", r->generating_component); + ndr_print_WERROR(ndr, "status", r->status); + ndr_print_uint16(ndr, "detection_location", r->detection_location); + ndr_print_uint16(ndr, "flags", r->flags); + ndr_print_uint16(ndr, "num_params", r->num_params); + ndr->print(ndr, "%s: ARRAY(%d)", "params", (int)r->num_params); + ndr->depth++; + for (cntr_params_0=0;cntr_params_0num_params;cntr_params_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_params_0) != -1) { + ndr_print_ExtendedErrorParam(ndr, "params", &r->params[cntr_params_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ExtendedErrorInfoPtr(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorInfoPtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + NDR_CHECK(ndr_push_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ExtendedErrorInfoPtr(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorInfoPtr *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->info); + } else { + r->info = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + NDR_CHECK(ndr_pull_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ExtendedErrorInfoPtr(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfoPtr *r) +{ + ndr_print_struct(ndr, name, "ExtendedErrorInfoPtr"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->info); + ndr->depth++; + if (r->info) { + ndr_print_ExtendedErrorInfo(ndr, "info", r->info); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_replPropertyMetaData(struct ndr_push *ndr, int flags, const struct decode_replPropertyMetaData *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_replPropertyMetaDataBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_replPropertyMetaData(struct ndr_pull *ndr, int flags, struct decode_replPropertyMetaData *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_replPropertyMetaDataBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_replPropertyMetaData(struct ndr_print *ndr, const char *name, int flags, const struct decode_replPropertyMetaData *r) +{ + ndr_print_struct(ndr, name, "decode_replPropertyMetaData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_replPropertyMetaData"); + ndr->depth++; + ndr_print_replPropertyMetaDataBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_replPropertyMetaData"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_replUpToDateVector(struct ndr_push *ndr, int flags, const struct decode_replUpToDateVector *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_replUpToDateVectorBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_replUpToDateVector(struct ndr_pull *ndr, int flags, struct decode_replUpToDateVector *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_replUpToDateVectorBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_replUpToDateVector(struct ndr_print *ndr, const char *name, int flags, const struct decode_replUpToDateVector *r) +{ + ndr_print_struct(ndr, name, "decode_replUpToDateVector"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_replUpToDateVector"); + ndr->depth++; + ndr_print_replUpToDateVectorBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_replUpToDateVector"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_repsFromTo(struct ndr_push *ndr, int flags, const struct decode_repsFromTo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_repsFromToBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_repsFromTo(struct ndr_pull *ndr, int flags, struct decode_repsFromTo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_repsFromToBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_repsFromTo(struct ndr_print *ndr, const char *name, int flags, const struct decode_repsFromTo *r) +{ + ndr_print_struct(ndr, name, "decode_repsFromTo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_repsFromTo"); + ndr->depth++; + ndr_print_repsFromToBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_repsFromTo"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_partialAttributeSet(struct ndr_push *ndr, int flags, const struct decode_partialAttributeSet *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_partialAttributeSetBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_partialAttributeSet(struct ndr_pull *ndr, int flags, struct decode_partialAttributeSet *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_partialAttributeSetBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_partialAttributeSet(struct ndr_print *ndr, const char *name, int flags, const struct decode_partialAttributeSet *r) +{ + ndr_print_struct(ndr, name, "decode_partialAttributeSet"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_partialAttributeSet"); + ndr->depth++; + ndr_print_partialAttributeSetBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_partialAttributeSet"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_prefixMap(struct ndr_push *ndr, int flags, const struct decode_prefixMap *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_prefixMapBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_prefixMap(struct ndr_pull *ndr, int flags, struct decode_prefixMap *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_prefixMapBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_prefixMap(struct ndr_print *ndr, const char *name, int flags, const struct decode_prefixMap *r) +{ + ndr_print_struct(ndr, name, "decode_prefixMap"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_prefixMap"); + ndr->depth++; + ndr_print_prefixMapBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_prefixMap"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_ldapControlDirSync(struct ndr_push *ndr, int flags, const struct decode_ldapControlDirSync *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_ldapControlDirSyncCookie(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.cookie)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_ldapControlDirSync(struct ndr_pull *ndr, int flags, struct decode_ldapControlDirSync *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_ldapControlDirSyncCookie(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.cookie)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_ldapControlDirSync(struct ndr_print *ndr, const char *name, int flags, const struct decode_ldapControlDirSync *r) +{ + ndr_print_struct(ndr, name, "decode_ldapControlDirSync"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_ldapControlDirSync"); + ndr->depth++; + ndr_print_ldapControlDirSyncCookie(ndr, "cookie", &r->in.cookie); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_ldapControlDirSync"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_supplementalCredentials(struct ndr_push *ndr, int flags, const struct decode_supplementalCredentials *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_supplementalCredentialsBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_supplementalCredentials(struct ndr_pull *ndr, int flags, struct decode_supplementalCredentials *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_supplementalCredentialsBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_supplementalCredentials(struct ndr_print *ndr, const char *name, int flags, const struct decode_supplementalCredentials *r) +{ + ndr_print_struct(ndr, name, "decode_supplementalCredentials"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_supplementalCredentials"); + ndr->depth++; + ndr_print_supplementalCredentialsBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_supplementalCredentials"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_Packages(struct ndr_push *ndr, int flags, const struct decode_Packages *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_package_PackagesBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_Packages(struct ndr_pull *ndr, int flags, struct decode_Packages *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_package_PackagesBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_Packages(struct ndr_print *ndr, const char *name, int flags, const struct decode_Packages *r) +{ + ndr_print_struct(ndr, name, "decode_Packages"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_Packages"); + ndr->depth++; + ndr_print_package_PackagesBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_Packages"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_PrimaryKerberos(struct ndr_push *ndr, int flags, const struct decode_PrimaryKerberos *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_package_PrimaryKerberosBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_PrimaryKerberos(struct ndr_pull *ndr, int flags, struct decode_PrimaryKerberos *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_PrimaryKerberos(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryKerberos *r) +{ + ndr_print_struct(ndr, name, "decode_PrimaryKerberos"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_PrimaryKerberos"); + ndr->depth++; + ndr_print_package_PrimaryKerberosBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_PrimaryKerberos"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_PrimaryCLEARTEXT(struct ndr_push *ndr, int flags, const struct decode_PrimaryCLEARTEXT *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_package_PrimaryCLEARTEXTBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_PrimaryCLEARTEXT(struct ndr_pull *ndr, int flags, struct decode_PrimaryCLEARTEXT *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_package_PrimaryCLEARTEXTBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_PrimaryCLEARTEXT(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryCLEARTEXT *r) +{ + ndr_print_struct(ndr, name, "decode_PrimaryCLEARTEXT"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_PrimaryCLEARTEXT"); + ndr->depth++; + ndr_print_package_PrimaryCLEARTEXTBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_PrimaryCLEARTEXT"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_PrimaryWDigest(struct ndr_push *ndr, int flags, const struct decode_PrimaryWDigest *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_package_PrimaryWDigestBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_PrimaryWDigest(struct ndr_pull *ndr, int flags, struct decode_PrimaryWDigest *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_package_PrimaryWDigestBlob(ndr, NDR_SCALARS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_PrimaryWDigest(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryWDigest *r) +{ + ndr_print_struct(ndr, name, "decode_PrimaryWDigest"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_PrimaryWDigest"); + ndr->depth++; + ndr_print_package_PrimaryWDigestBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_PrimaryWDigest"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_trustAuthInOut(struct ndr_push *ndr, int flags, const struct decode_trustAuthInOut *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_trustAuthInOutBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_trustAuthInOut(struct ndr_pull *ndr, int flags, struct decode_trustAuthInOut *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_trustAuthInOutBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_trustAuthInOut(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustAuthInOut *r) +{ + ndr_print_struct(ndr, name, "decode_trustAuthInOut"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_trustAuthInOut"); + ndr->depth++; + ndr_print_trustAuthInOutBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_trustAuthInOut"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_trustDomainPasswords(struct ndr_push *ndr, int flags, const struct decode_trustDomainPasswords *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_trustDomainPasswords(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_trustDomainPasswords(struct ndr_pull *ndr, int flags, struct decode_trustDomainPasswords *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_trustDomainPasswords(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_trustDomainPasswords(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustDomainPasswords *r) +{ + ndr_print_struct(ndr, name, "decode_trustDomainPasswords"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_trustDomainPasswords"); + ndr->depth++; + ndr_print_trustDomainPasswords(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_trustDomainPasswords"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_ExtendedErrorInfo(struct ndr_push *ndr, int flags, const struct decode_ExtendedErrorInfo *r) +{ + if (flags & NDR_IN) { + { + struct ndr_push *_ndr_ptr; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ptr, 0xFFFFFC01, -1)); + NDR_CHECK(ndr_push_ExtendedErrorInfoPtr(_ndr_ptr, NDR_SCALARS|NDR_BUFFERS, &r->in.ptr)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ptr, 0xFFFFFC01, -1)); + } + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_ExtendedErrorInfo(struct ndr_pull *ndr, int flags, struct decode_ExtendedErrorInfo *r) +{ + if (flags & NDR_IN) { + { + struct ndr_pull *_ndr_ptr; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ptr, 0xFFFFFC01, -1)); + NDR_CHECK(ndr_pull_ExtendedErrorInfoPtr(_ndr_ptr, NDR_SCALARS|NDR_BUFFERS, &r->in.ptr)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ptr, 0xFFFFFC01, -1)); + } + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, int flags, const struct decode_ExtendedErrorInfo *r) +{ + ndr_print_struct(ndr, name, "decode_ExtendedErrorInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_ExtendedErrorInfo"); + ndr->depth++; + ndr_print_ExtendedErrorInfoPtr(ndr, "ptr", &r->in.ptr); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_ExtendedErrorInfo"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call drsblobs_calls[] = { + { + "decode_replPropertyMetaData", + sizeof(struct decode_replPropertyMetaData), + (ndr_push_flags_fn_t) ndr_push_decode_replPropertyMetaData, + (ndr_pull_flags_fn_t) ndr_pull_decode_replPropertyMetaData, + (ndr_print_function_t) ndr_print_decode_replPropertyMetaData, + false, + }, + { + "decode_replUpToDateVector", + sizeof(struct decode_replUpToDateVector), + (ndr_push_flags_fn_t) ndr_push_decode_replUpToDateVector, + (ndr_pull_flags_fn_t) ndr_pull_decode_replUpToDateVector, + (ndr_print_function_t) ndr_print_decode_replUpToDateVector, + false, + }, + { + "decode_repsFromTo", + sizeof(struct decode_repsFromTo), + (ndr_push_flags_fn_t) ndr_push_decode_repsFromTo, + (ndr_pull_flags_fn_t) ndr_pull_decode_repsFromTo, + (ndr_print_function_t) ndr_print_decode_repsFromTo, + false, + }, + { + "decode_partialAttributeSet", + sizeof(struct decode_partialAttributeSet), + (ndr_push_flags_fn_t) ndr_push_decode_partialAttributeSet, + (ndr_pull_flags_fn_t) ndr_pull_decode_partialAttributeSet, + (ndr_print_function_t) ndr_print_decode_partialAttributeSet, + false, + }, + { + "decode_prefixMap", + sizeof(struct decode_prefixMap), + (ndr_push_flags_fn_t) ndr_push_decode_prefixMap, + (ndr_pull_flags_fn_t) ndr_pull_decode_prefixMap, + (ndr_print_function_t) ndr_print_decode_prefixMap, + false, + }, + { + "decode_ldapControlDirSync", + sizeof(struct decode_ldapControlDirSync), + (ndr_push_flags_fn_t) ndr_push_decode_ldapControlDirSync, + (ndr_pull_flags_fn_t) ndr_pull_decode_ldapControlDirSync, + (ndr_print_function_t) ndr_print_decode_ldapControlDirSync, + false, + }, + { + "decode_supplementalCredentials", + sizeof(struct decode_supplementalCredentials), + (ndr_push_flags_fn_t) ndr_push_decode_supplementalCredentials, + (ndr_pull_flags_fn_t) ndr_pull_decode_supplementalCredentials, + (ndr_print_function_t) ndr_print_decode_supplementalCredentials, + false, + }, + { + "decode_Packages", + sizeof(struct decode_Packages), + (ndr_push_flags_fn_t) ndr_push_decode_Packages, + (ndr_pull_flags_fn_t) ndr_pull_decode_Packages, + (ndr_print_function_t) ndr_print_decode_Packages, + false, + }, + { + "decode_PrimaryKerberos", + sizeof(struct decode_PrimaryKerberos), + (ndr_push_flags_fn_t) ndr_push_decode_PrimaryKerberos, + (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryKerberos, + (ndr_print_function_t) ndr_print_decode_PrimaryKerberos, + false, + }, + { + "decode_PrimaryCLEARTEXT", + sizeof(struct decode_PrimaryCLEARTEXT), + (ndr_push_flags_fn_t) ndr_push_decode_PrimaryCLEARTEXT, + (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryCLEARTEXT, + (ndr_print_function_t) ndr_print_decode_PrimaryCLEARTEXT, + false, + }, + { + "decode_PrimaryWDigest", + sizeof(struct decode_PrimaryWDigest), + (ndr_push_flags_fn_t) ndr_push_decode_PrimaryWDigest, + (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryWDigest, + (ndr_print_function_t) ndr_print_decode_PrimaryWDigest, + false, + }, + { + "decode_trustAuthInOut", + sizeof(struct decode_trustAuthInOut), + (ndr_push_flags_fn_t) ndr_push_decode_trustAuthInOut, + (ndr_pull_flags_fn_t) ndr_pull_decode_trustAuthInOut, + (ndr_print_function_t) ndr_print_decode_trustAuthInOut, + false, + }, + { + "decode_trustDomainPasswords", + sizeof(struct decode_trustDomainPasswords), + (ndr_push_flags_fn_t) ndr_push_decode_trustDomainPasswords, + (ndr_pull_flags_fn_t) ndr_pull_decode_trustDomainPasswords, + (ndr_print_function_t) ndr_print_decode_trustDomainPasswords, + false, + }, + { + "decode_ExtendedErrorInfo", + sizeof(struct decode_ExtendedErrorInfo), + (ndr_push_flags_fn_t) ndr_push_decode_ExtendedErrorInfo, + (ndr_pull_flags_fn_t) ndr_pull_decode_ExtendedErrorInfo, + (ndr_print_function_t) ndr_print_decode_ExtendedErrorInfo, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const drsblobs_endpoint_strings[] = { + "ncacn_np:[\\pipe\\drsblobs]", +}; + +static const struct ndr_interface_string_array drsblobs_endpoints = { + .count = 1, + .names = drsblobs_endpoint_strings +}; + +static const char * const drsblobs_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array drsblobs_authservices = { + .count = 1, + .names = drsblobs_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_drsblobs = { + .name = "drsblobs", + .syntax_id = { + {0x12345778,0x1234,0xabcd,{0x00,0x01},{0x00,0x00,0x00,0x01}}, + NDR_DRSBLOBS_VERSION + }, + .helpstring = NDR_DRSBLOBS_HELPSTRING, + .num_calls = 14, + .calls = drsblobs_calls, + .endpoints = &drsblobs_endpoints, + .authservices = &drsblobs_authservices +}; + diff --git a/librpc/gen_ndr/ndr_drsblobs.h b/librpc/gen_ndr/ndr_drsblobs.h new file mode 100644 index 0000000000..8a5298874a --- /dev/null +++ b/librpc/gen_ndr/ndr_drsblobs.h @@ -0,0 +1,159 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/drsblobs.h" + +#ifndef _HEADER_NDR_drsblobs +#define _HEADER_NDR_drsblobs + +#define NDR_DRSBLOBS_UUID "12345778-1234-abcd-0001-00000001" +#define NDR_DRSBLOBS_VERSION 0.0 +#define NDR_DRSBLOBS_NAME "drsblobs" +#define NDR_DRSBLOBS_HELPSTRING "Active Directory Replication LDAP Blobs" +extern const struct ndr_interface_table ndr_table_drsblobs; +#define NDR_DECODE_REPLPROPERTYMETADATA (0x00) + +#define NDR_DECODE_REPLUPTODATEVECTOR (0x01) + +#define NDR_DECODE_REPSFROMTO (0x02) + +#define NDR_DECODE_PARTIALATTRIBUTESET (0x03) + +#define NDR_DECODE_PREFIXMAP (0x04) + +#define NDR_DECODE_LDAPCONTROLDIRSYNC (0x05) + +#define NDR_DECODE_SUPPLEMENTALCREDENTIALS (0x06) + +#define NDR_DECODE_PACKAGES (0x07) + +#define NDR_DECODE_PRIMARYKERBEROS (0x08) + +#define NDR_DECODE_PRIMARYCLEARTEXT (0x09) + +#define NDR_DECODE_PRIMARYWDIGEST (0x0a) + +#define NDR_DECODE_TRUSTAUTHINOUT (0x0b) + +#define NDR_DECODE_TRUSTDOMAINPASSWORDS (0x0c) + +#define NDR_DECODE_EXTENDEDERRORINFO (0x0d) + +#define NDR_DRSBLOBS_CALL_COUNT (14) +void ndr_print_replPropertyMetaData1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaData1 *r); +void ndr_print_replPropertyMetaDataCtr1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataCtr1 *r); +void ndr_print_replPropertyMetaDataCtr(struct ndr_print *ndr, const char *name, const union replPropertyMetaDataCtr *r); +enum ndr_err_code ndr_push_replPropertyMetaDataBlob(struct ndr_push *ndr, int ndr_flags, const struct replPropertyMetaDataBlob *r); +enum ndr_err_code ndr_pull_replPropertyMetaDataBlob(struct ndr_pull *ndr, int ndr_flags, struct replPropertyMetaDataBlob *r); +void ndr_print_replPropertyMetaDataBlob(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataBlob *r); +void ndr_print_replUpToDateVectorCtr1(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorCtr1 *r); +void ndr_print_replUpToDateVectorCtr2(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorCtr2 *r); +void ndr_print_replUpToDateVectorCtr(struct ndr_print *ndr, const char *name, const union replUpToDateVectorCtr *r); +enum ndr_err_code ndr_push_replUpToDateVectorBlob(struct ndr_push *ndr, int ndr_flags, const struct replUpToDateVectorBlob *r); +enum ndr_err_code ndr_pull_replUpToDateVectorBlob(struct ndr_pull *ndr, int ndr_flags, struct replUpToDateVectorBlob *r); +void ndr_print_replUpToDateVectorBlob(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorBlob *r); +enum ndr_err_code ndr_push_repsFromTo1OtherInfo(struct ndr_push *ndr, int ndr_flags, const struct repsFromTo1OtherInfo *r); +enum ndr_err_code ndr_pull_repsFromTo1OtherInfo(struct ndr_pull *ndr, int ndr_flags, struct repsFromTo1OtherInfo *r); +void ndr_print_repsFromTo1OtherInfo(struct ndr_print *ndr, const char *name, const struct repsFromTo1OtherInfo *r); +size_t ndr_size_repsFromTo1OtherInfo(const struct repsFromTo1OtherInfo *r, int flags); +enum ndr_err_code ndr_push_repsFromTo1(struct ndr_push *ndr, int ndr_flags, const struct repsFromTo1 *r); +enum ndr_err_code ndr_pull_repsFromTo1(struct ndr_pull *ndr, int ndr_flags, struct repsFromTo1 *r); +void ndr_print_repsFromTo1(struct ndr_print *ndr, const char *name, const struct repsFromTo1 *r); +size_t ndr_size_repsFromTo1(const struct repsFromTo1 *r, int flags); +void ndr_print_repsFromTo(struct ndr_print *ndr, const char *name, const union repsFromTo *r); +enum ndr_err_code ndr_push_repsFromToBlob(struct ndr_push *ndr, int ndr_flags, const struct repsFromToBlob *r); +enum ndr_err_code ndr_pull_repsFromToBlob(struct ndr_pull *ndr, int ndr_flags, struct repsFromToBlob *r); +void ndr_print_repsFromToBlob(struct ndr_print *ndr, const char *name, const struct repsFromToBlob *r); +void ndr_print_partialAttributeSetCtr1(struct ndr_print *ndr, const char *name, const struct partialAttributeSetCtr1 *r); +void ndr_print_partialAttributeSetCtr(struct ndr_print *ndr, const char *name, const union partialAttributeSetCtr *r); +enum ndr_err_code ndr_push_partialAttributeSetBlob(struct ndr_push *ndr, int ndr_flags, const struct partialAttributeSetBlob *r); +enum ndr_err_code ndr_pull_partialAttributeSetBlob(struct ndr_pull *ndr, int ndr_flags, struct partialAttributeSetBlob *r); +void ndr_print_partialAttributeSetBlob(struct ndr_print *ndr, const char *name, const struct partialAttributeSetBlob *r); +void ndr_print_prefixMapVersion(struct ndr_print *ndr, const char *name, enum prefixMapVersion r); +void ndr_print_prefixMapCtr(struct ndr_print *ndr, const char *name, const union prefixMapCtr *r); +enum ndr_err_code ndr_push_prefixMapBlob(struct ndr_push *ndr, int ndr_flags, const struct prefixMapBlob *r); +enum ndr_err_code ndr_pull_prefixMapBlob(struct ndr_pull *ndr, int ndr_flags, struct prefixMapBlob *r); +void ndr_print_prefixMapBlob(struct ndr_print *ndr, const char *name, const struct prefixMapBlob *r); +void ndr_print_ldapControlDirSyncExtra(struct ndr_print *ndr, const char *name, const union ldapControlDirSyncExtra *r); +void ndr_print_ldapControlDirSyncBlob(struct ndr_print *ndr, const char *name, const struct ldapControlDirSyncBlob *r); +enum ndr_err_code ndr_push_ldapControlDirSyncCookie(struct ndr_push *ndr, int ndr_flags, const struct ldapControlDirSyncCookie *r); +enum ndr_err_code ndr_pull_ldapControlDirSyncCookie(struct ndr_pull *ndr, int ndr_flags, struct ldapControlDirSyncCookie *r); +void ndr_print_ldapControlDirSyncCookie(struct ndr_print *ndr, const char *name, const struct ldapControlDirSyncCookie *r); +void ndr_print_supplementalCredentialsPackage(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsPackage *r); +void ndr_print_supplementalCredentialsSignature(struct ndr_print *ndr, const char *name, enum supplementalCredentialsSignature r); +void ndr_print_supplementalCredentialsSubBlob(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsSubBlob *r); +enum ndr_err_code ndr_push_supplementalCredentialsBlob(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsBlob *r); +enum ndr_err_code ndr_pull_supplementalCredentialsBlob(struct ndr_pull *ndr, int ndr_flags, struct supplementalCredentialsBlob *r); +void ndr_print_supplementalCredentialsBlob(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsBlob *r); +enum ndr_err_code ndr_push_package_PackagesBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PackagesBlob *r); +enum ndr_err_code ndr_pull_package_PackagesBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PackagesBlob *r); +void ndr_print_package_PackagesBlob(struct ndr_print *ndr, const char *name, const struct package_PackagesBlob *r); +void ndr_print_package_PrimaryKerberosString(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosString *r); +void ndr_print_package_PrimaryKerberosKey3(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosKey3 *r); +void ndr_print_package_PrimaryKerberosCtr3(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosCtr3 *r); +void ndr_print_package_PrimaryKerberosKey4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosKey4 *r); +void ndr_print_package_PrimaryKerberosCtr4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosCtr4 *r); +void ndr_print_package_PrimaryKerberosCtr(struct ndr_print *ndr, const char *name, const union package_PrimaryKerberosCtr *r); +enum ndr_err_code ndr_push_package_PrimaryKerberosBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosBlob *r); +enum ndr_err_code ndr_pull_package_PrimaryKerberosBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosBlob *r); +void ndr_print_package_PrimaryKerberosBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosBlob *r); +enum ndr_err_code ndr_push_package_PrimaryCLEARTEXTBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryCLEARTEXTBlob *r); +enum ndr_err_code ndr_pull_package_PrimaryCLEARTEXTBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryCLEARTEXTBlob *r); +void ndr_print_package_PrimaryCLEARTEXTBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryCLEARTEXTBlob *r); +void ndr_print_package_PrimaryWDigestHash(struct ndr_print *ndr, const char *name, const struct package_PrimaryWDigestHash *r); +enum ndr_err_code ndr_push_package_PrimaryWDigestBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryWDigestBlob *r); +enum ndr_err_code ndr_pull_package_PrimaryWDigestBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryWDigestBlob *r); +void ndr_print_package_PrimaryWDigestBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryWDigestBlob *r); +void ndr_print_AuthInfoNone(struct ndr_print *ndr, const char *name, const struct AuthInfoNone *r); +void ndr_print_AuthInfoNT4Owf(struct ndr_print *ndr, const char *name, const struct AuthInfoNT4Owf *r); +void ndr_print_AuthInfoClear(struct ndr_print *ndr, const char *name, const struct AuthInfoClear *r); +void ndr_print_AuthInfoVersion(struct ndr_print *ndr, const char *name, const struct AuthInfoVersion *r); +void ndr_print_AuthInfo(struct ndr_print *ndr, const char *name, const union AuthInfo *r); +enum ndr_err_code ndr_push_AuthenticationInformation(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformation *r); +enum ndr_err_code ndr_pull_AuthenticationInformation(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformation *r); +void ndr_print_AuthenticationInformation(struct ndr_print *ndr, const char *name, const struct AuthenticationInformation *r); +enum ndr_err_code ndr_push_AuthenticationInformationArray(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformationArray *r); +enum ndr_err_code ndr_pull_AuthenticationInformationArray(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformationArray *r); +void ndr_print_AuthenticationInformationArray(struct ndr_print *ndr, const char *name, const struct AuthenticationInformationArray *r); +enum ndr_err_code ndr_push_trustAuthInOutBlob(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutBlob *r); +enum ndr_err_code ndr_pull_trustAuthInOutBlob(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutBlob *r); +void ndr_print_trustAuthInOutBlob(struct ndr_print *ndr, const char *name, const struct trustAuthInOutBlob *r); +size_t ndr_size_trustAuthInOutBlob(const struct trustAuthInOutBlob *r, int flags); +enum ndr_err_code ndr_push_trustCurrentPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustCurrentPasswords *r); +enum ndr_err_code ndr_pull_trustCurrentPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustCurrentPasswords *r); +void ndr_print_trustCurrentPasswords(struct ndr_print *ndr, const char *name, const struct trustCurrentPasswords *r); +size_t ndr_size_trustCurrentPasswords(const struct trustCurrentPasswords *r, int flags); +enum ndr_err_code ndr_push_trustDomainPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustDomainPasswords *r); +enum ndr_err_code ndr_pull_trustDomainPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustDomainPasswords *r); +void ndr_print_trustDomainPasswords(struct ndr_print *ndr, const char *name, const struct trustDomainPasswords *r); +enum ndr_err_code ndr_push_DsCompressedChunk(struct ndr_push *ndr, int ndr_flags, const struct DsCompressedChunk *r); +enum ndr_err_code ndr_pull_DsCompressedChunk(struct ndr_pull *ndr, int ndr_flags, struct DsCompressedChunk *r); +void ndr_print_DsCompressedChunk(struct ndr_print *ndr, const char *name, const struct DsCompressedChunk *r); +void ndr_print_ExtendedErrorAString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorAString *r); +void ndr_print_ExtendedErrorUString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorUString *r); +void ndr_print_ExtendedErrorBlob(struct ndr_print *ndr, const char *name, const struct ExtendedErrorBlob *r); +void ndr_print_ExtendedErrorComputerNamePresent(struct ndr_print *ndr, const char *name, enum ExtendedErrorComputerNamePresent r); +void ndr_print_ExtendedErrorComputerNameU(struct ndr_print *ndr, const char *name, const union ExtendedErrorComputerNameU *r); +void ndr_print_ExtendedErrorComputerName(struct ndr_print *ndr, const char *name, const struct ExtendedErrorComputerName *r); +void ndr_print_ExtendedErrorParamType(struct ndr_print *ndr, const char *name, enum ExtendedErrorParamType r); +void ndr_print_ExtendedErrorParamU(struct ndr_print *ndr, const char *name, const union ExtendedErrorParamU *r); +void ndr_print_ExtendedErrorParam(struct ndr_print *ndr, const char *name, const struct ExtendedErrorParam *r); +enum ndr_err_code ndr_push_ExtendedErrorInfo(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorInfo *r); +enum ndr_err_code ndr_pull_ExtendedErrorInfo(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorInfo *r); +void ndr_print_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfo *r); +void ndr_print_ExtendedErrorInfoPtr(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfoPtr *r); +void ndr_print_decode_replPropertyMetaData(struct ndr_print *ndr, const char *name, int flags, const struct decode_replPropertyMetaData *r); +void ndr_print_decode_replUpToDateVector(struct ndr_print *ndr, const char *name, int flags, const struct decode_replUpToDateVector *r); +void ndr_print_decode_repsFromTo(struct ndr_print *ndr, const char *name, int flags, const struct decode_repsFromTo *r); +void ndr_print_decode_partialAttributeSet(struct ndr_print *ndr, const char *name, int flags, const struct decode_partialAttributeSet *r); +void ndr_print_decode_prefixMap(struct ndr_print *ndr, const char *name, int flags, const struct decode_prefixMap *r); +void ndr_print_decode_ldapControlDirSync(struct ndr_print *ndr, const char *name, int flags, const struct decode_ldapControlDirSync *r); +void ndr_print_decode_supplementalCredentials(struct ndr_print *ndr, const char *name, int flags, const struct decode_supplementalCredentials *r); +void ndr_print_decode_Packages(struct ndr_print *ndr, const char *name, int flags, const struct decode_Packages *r); +void ndr_print_decode_PrimaryKerberos(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryKerberos *r); +void ndr_print_decode_PrimaryCLEARTEXT(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryCLEARTEXT *r); +void ndr_print_decode_PrimaryWDigest(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryWDigest *r); +void ndr_print_decode_trustAuthInOut(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustAuthInOut *r); +void ndr_print_decode_trustDomainPasswords(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustDomainPasswords *r); +void ndr_print_decode_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, int flags, const struct decode_ExtendedErrorInfo *r); +#endif /* _HEADER_NDR_drsblobs */ diff --git a/librpc/gen_ndr/ndr_drsuapi.c b/librpc/gen_ndr/ndr_drsuapi.c new file mode 100644 index 0000000000..c2a4aee180 --- /dev/null +++ b/librpc/gen_ndr/ndr_drsuapi.c @@ -0,0 +1,14532 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_drsuapi.h" + +#include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/ndr_misc.h" +#include "librpc/gen_ndr/ndr_samr.h" +#include "librpc/ndr/ndr_compression.h" +static enum ndr_err_code ndr_push_drsuapi_SupportedExtensions(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_SupportedExtensions(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_BASE", DRSUAPI_SUPPORTED_EXTENSION_BASE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION", DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI", DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2", DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS", DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION", DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_00000080", DRSUAPI_SUPPORTED_EXTENSION_00000080, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE", DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2", DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION", DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD", DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND", DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO", DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION", DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP", DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY", DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3", DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_00100000", DRSUAPI_SUPPORTED_EXTENSION_00100000, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2", DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS", DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3", DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT", DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS", DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_20000000", DRSUAPI_SUPPORTED_EXTENSION_20000000, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_40000000", DRSUAPI_SUPPORTED_EXTENSION_40000000, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_80000000", DRSUAPI_SUPPORTED_EXTENSION_80000000, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_SupportedExtensionsExt(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensionsExt(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_SupportedExtensionsExt(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADAM", DRSUAPI_SUPPORTED_EXTENSION_ADAM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2", DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsBindInfo24(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo24 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo24(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo24 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsBindInfo24(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo24 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsBindInfo24"); + ndr->depth++; + ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions); + ndr_print_GUID(ndr, "site_guid", &r->site_guid); + ndr_print_uint32(ndr, "pid", r->pid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsBindInfo28(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo28 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->repl_epoch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo28(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo28 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->repl_epoch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsBindInfo28(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo28 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsBindInfo28"); + ndr->depth++; + ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions); + ndr_print_GUID(ndr, "site_guid", &r->site_guid); + ndr_print_uint32(ndr, "pid", r->pid); + ndr_print_uint32(ndr, "repl_epoch", r->repl_epoch); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsBindInfo48(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo48 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->repl_epoch)); + NDR_CHECK(ndr_push_drsuapi_SupportedExtensionsExt(ndr, NDR_SCALARS, r->supported_extensions_ext)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->config_dn_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo48(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo48 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->repl_epoch)); + NDR_CHECK(ndr_pull_drsuapi_SupportedExtensionsExt(ndr, NDR_SCALARS, &r->supported_extensions_ext)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->config_dn_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsBindInfo48(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo48 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsBindInfo48"); + ndr->depth++; + ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions); + ndr_print_GUID(ndr, "site_guid", &r->site_guid); + ndr_print_uint32(ndr, "pid", r->pid); + ndr_print_uint32(ndr, "repl_epoch", r->repl_epoch); + ndr_print_drsuapi_SupportedExtensionsExt(ndr, "supported_extensions_ext", r->supported_extensions_ext); + ndr_print_GUID(ndr, "config_dn_guid", &r->config_dn_guid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsBindInfoFallBack(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoFallBack *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->info)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoFallBack(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoFallBack *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->info)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsBindInfoFallBack(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoFallBack *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsBindInfoFallBack"); + ndr->depth++; + ndr_print_DATA_BLOB(ndr, "info", r->info); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsBindInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsBindInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 24: { + { + struct ndr_push *_ndr_info24; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info24, 4, -1)); + NDR_CHECK(ndr_push_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info24, 4, -1)); + } + break; } + + case 28: { + { + struct ndr_push *_ndr_info28; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info28, 4, -1)); + NDR_CHECK(ndr_push_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info28, 4, -1)); + } + break; } + + case 48: { + { + struct ndr_push *_ndr_info48; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info48, 4, -1)); + NDR_CHECK(ndr_push_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info48, 4, -1)); + } + break; } + + default: { + { + struct ndr_push *_ndr_FallBack; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_FallBack, 4, -1)); + NDR_CHECK(ndr_push_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_FallBack, 4, -1)); + } + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 24: + break; + + case 28: + break; + + case 48: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsBindInfo *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 24: { + { + struct ndr_pull *_ndr_info24; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info24, 4, -1)); + NDR_CHECK(ndr_pull_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info24, 4, -1)); + } + break; } + + case 28: { + { + struct ndr_pull *_ndr_info28; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info28, 4, -1)); + NDR_CHECK(ndr_pull_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info28, 4, -1)); + } + break; } + + case 48: { + { + struct ndr_pull *_ndr_info48; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info48, 4, -1)); + NDR_CHECK(ndr_pull_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info48, 4, -1)); + } + break; } + + default: { + { + struct ndr_pull *_ndr_FallBack; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_FallBack, 4, -1)); + NDR_CHECK(ndr_pull_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_FallBack, 4, -1)); + } + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 24: + break; + + case 28: + break; + + case 48: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsBindInfo"); + switch (level) { + case 24: + ndr_print_drsuapi_DsBindInfo24(ndr, "info24", &r->info24); + break; + + case 28: + ndr_print_drsuapi_DsBindInfo28(ndr, "info28", &r->info28); + break; + + case 48: + ndr_print_drsuapi_DsBindInfo48(ndr, "info48", &r->info48); + break; + + default: + ndr_print_drsuapi_DsBindInfoFallBack(ndr, "FallBack", &r->FallBack); + break; + + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsBindInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->length)); + NDR_CHECK(ndr_push_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + if (r->length < 1 || r->length > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->length)); + NDR_CHECK(ndr_pull_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsBindInfoCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoCtr *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsBindInfoCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "length", r->length); + ndr_print_set_switch_value(ndr, &r->info, r->length); + ndr_print_drsuapi_DsBindInfo(ndr, "info", &r->info); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn) + 1)); + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->flags) - 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags))); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->dn)); + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, ndr_get_array_size(ndr, &r->dn), sizeof(uint16_t), CH_UTF16)); + if (r->dn) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->dn, r->__ndr_size_dn + 1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier"); + ndr->depth++; + ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->flags) - 4:r->__ndr_size); + ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid); + ndr_print_GUID(ndr, "guid", &r->guid); + ndr_print_dom_sid28(ndr, "sid", &r->sid); + ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn); + ndr_print_string(ndr, "dn", r->dn); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier(const struct drsuapi_DsReplicaObjectIdentifier *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier); +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncOptions(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_WRITEABLE", DRSUAPI_DS_REPLICA_SYNC_WRITEABLE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PERIODIC", DRSUAPI_DS_REPLICA_SYNC_PERIODIC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING", DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES", DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL", DRSUAPI_DS_REPLICA_SYNC_FULL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_URGENT", DRSUAPI_DS_REPLICA_SYNC_URGENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD", DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FORCE", DRSUAPI_DS_REPLICA_SYNC_FORCE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE", DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED", DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_TWO_WAY", DRSUAPI_DS_REPLICA_SYNC_TWO_WAY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY", DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL", DRSUAPI_DS_REPLICA_SYNC_INITIAL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION", DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ABANDONED", DRSUAPI_DS_REPLICA_SYNC_ABANDONED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_REQUEUE", DRSUAPI_DS_REPLICA_SYNC_REQUEUE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION", DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_CRITICAL", DRSUAPI_DS_REPLICA_SYNC_CRITICAL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PREEMPTED", DRSUAPI_DS_REPLICA_SYNC_PREEMPTED, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaSyncRequest1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->other_info)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->options)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->naming_context) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + if (r->other_info) { + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->other_info)); + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaSyncRequest1 *r) +{ + uint32_t _ptr_naming_context; + TALLOC_CTX *_mem_save_naming_context_0; + uint32_t _ptr_other_info; + TALLOC_CTX *_mem_save_other_info_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context)); + if (_ptr_naming_context) { + NDR_PULL_ALLOC(ndr, r->naming_context); + } else { + r->naming_context = NULL; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_info)); + if (_ptr_other_info) { + NDR_PULL_ALLOC(ndr, r->other_info); + } else { + r->other_info = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->options)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->naming_context) { + _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + if (r->other_info) { + _mem_save_other_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->other_info, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->other_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_info_0, 0); + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaSyncRequest1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaSyncRequest1"); + ndr->depth++; + ndr_print_ptr(ndr, "naming_context", r->naming_context); + ndr->depth++; + if (r->naming_context) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); + } + ndr->depth--; + ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid); + ndr_print_ptr(ndr, "other_info", r->other_info); + ndr->depth++; + if (r->other_info) { + ndr_print_string(ndr, "other_info", r->other_info); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "options", r->options); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaSyncRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaSyncRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaSyncRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsReplicaSyncRequest"); + switch (level) { + case 1: + ndr_print_drsuapi_DsReplicaSyncRequest1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaHighWaterMark(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaHighWaterMark *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->tmp_highest_usn)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->reserved_usn)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaHighWaterMark(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaHighWaterMark *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->tmp_highest_usn)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->reserved_usn)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaHighWaterMark(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaHighWaterMark *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaHighWaterMark"); + ndr->depth++; + ndr_print_hyper(ndr, "tmp_highest_usn", r->tmp_highest_usn); + ndr_print_hyper(ndr, "reserved_usn", r->reserved_usn); + ndr_print_hyper(ndr, "highest_usn", r->highest_usn); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor"); + ndr->depth++; + ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); + ndr_print_hyper(ndr, "highest_usn", r->highest_usn); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtrEx *r) +{ + uint32_t cntr_cursors_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtrEx *r) +{ + uint32_t cntr_cursors_0; + TALLOC_CTX *_mem_save_cursors_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 0x100000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2)); + NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors)); + _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); + for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); + if (r->cursors) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtrEx *r) +{ + uint32_t cntr_cursors_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursorCtrEx"); + ndr->depth++; + ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version); + ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2); + ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count); + ndr->depth++; + for (cntr_cursors_0=0;cntr_cursors_0count;cntr_cursors_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) { + ndr_print_drsuapi_DsReplicaCursor(ndr, "cursors", &r->cursors[cntr_cursors_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE", DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP", DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS", DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT", DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS", DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED", DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED", DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES", DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsExtendedOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation r) +{ + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsExtendedOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation *r) +{ + uint32_t v; + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsExtendedOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedOperation r) +{ + const char *val = NULL; + + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + switch (r) { + case DRSUAPI_EXOP_NONE: val = "DRSUAPI_EXOP_NONE"; break; + case DRSUAPI_EXOP_FSMO_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_REQ_ROLE"; break; + case DRSUAPI_EXOP_FSMO_RID_ALLOC: val = "DRSUAPI_EXOP_FSMO_RID_ALLOC"; break; + case DRSUAPI_EXOP_FSMO_RID_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_RID_REQ_ROLE"; break; + case DRSUAPI_EXOP_FSMO_REQ_PDC: val = "DRSUAPI_EXOP_FSMO_REQ_PDC"; break; + case DRSUAPI_EXOP_FSMO_ABANDON_ROLE: val = "DRSUAPI_EXOP_FSMO_ABANDON_ROLE"; break; + case DRSUAPI_EXOP_REPL_OBJ: val = "DRSUAPI_EXOP_REPL_OBJ"; break; + case DRSUAPI_EXOP_REPL_SECRET: val = "DRSUAPI_EXOP_REPL_SECRET"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); + ndr->flags = _flags_save_ENUM; + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsExtendedError(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedError r) +{ + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsExtendedError(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedError *r) +{ + uint32_t v; + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsExtendedError(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedError r) +{ + const char *val = NULL; + + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + switch (r) { + case DRSUAPI_EXOP_ERR_NONE: val = "DRSUAPI_EXOP_ERR_NONE"; break; + case DRSUAPI_EXOP_ERR_SUCCESS: val = "DRSUAPI_EXOP_ERR_SUCCESS"; break; + case DRSUAPI_EXOP_ERR_UNKNOWN_OP: val = "DRSUAPI_EXOP_ERR_UNKNOWN_OP"; break; + case DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER: val = "DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER"; break; + case DRSUAPI_EXOP_ERR_UPDATE_ERR: val = "DRSUAPI_EXOP_ERR_UPDATE_ERR"; break; + case DRSUAPI_EXOP_ERR_EXCEPTION: val = "DRSUAPI_EXOP_ERR_EXCEPTION"; break; + case DRSUAPI_EXOP_ERR_UNKNOWN_CALLER: val = "DRSUAPI_EXOP_ERR_UNKNOWN_CALLER"; break; + case DRSUAPI_EXOP_ERR_RID_ALLOC: val = "DRSUAPI_EXOP_ERR_RID_ALLOC"; break; + case DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED: val = "DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED"; break; + case DRSUAPI_EXOP_ERR_FMSO_PENDING_OP: val = "DRSUAPI_EXOP_ERR_FMSO_PENDING_OP"; break; + case DRSUAPI_EXOP_ERR_MISMATCH: val = "DRSUAPI_EXOP_ERR_MISMATCH"; break; + case DRSUAPI_EXOP_ERR_COULDNT_CONTACT: val = "DRSUAPI_EXOP_ERR_COULDNT_CONTACT"; break; + case DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES: val = "DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES"; break; + case DRSUAPI_EXOP_ERR_DIR_ERROR: val = "DRSUAPI_EXOP_ERR_DIR_ERROR"; break; + case DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS: val = "DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS"; break; + case DRSUAPI_EXOP_ERR_ACCESS_DENIED: val = "DRSUAPI_EXOP_ERR_ACCESS_DENIED"; break; + case DRSUAPI_EXOP_ERR_PARAM_ERROR: val = "DRSUAPI_EXOP_ERR_PARAM_ERROR"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); + ndr->flags = _flags_save_ENUM; + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest5(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + if (r->naming_context == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_ref_ptr(ndr)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size)); + NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + if (r->uptodateness_vector) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest5(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest5 *r) +{ + uint32_t _ptr_naming_context; + TALLOC_CTX *_mem_save_naming_context_0; + uint32_t _ptr_uptodateness_vector; + TALLOC_CTX *_mem_save_uptodateness_vector_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context)); + if (_ptr_naming_context) { + NDR_PULL_ALLOC(ndr, r->naming_context); + } else { + r->naming_context = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector)); + if (_ptr_uptodateness_vector) { + NDR_PULL_ALLOC(ndr, r->uptodateness_vector); + } else { + r->uptodateness_vector = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size)); + NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info)); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); + if (r->uptodateness_vector) { + _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest5(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest5 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest5"); + ndr->depth++; + ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid); + ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); + ndr_print_ptr(ndr, "naming_context", r->naming_context); + ndr->depth++; + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); + ndr->depth--; + ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark); + ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector); + ndr->depth++; + if (r->uptodateness_vector) { + ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags); + ndr_print_uint32(ndr, "max_object_count", r->max_object_count); + ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size); + ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op); + ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info); + ndr->depth--; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaOID"); + ndr->depth++; + ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaOID_oid(r->oid, 0):r->__ndr_size); + ndr_print_ptr(ndr, "oid", r->oid); + ndr->depth++; + if (r->oid) { + ndr_print_string(ndr, "oid", r->oid); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id_prefix)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id_prefix)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping"); + ndr->depth++; + ndr_print_uint32(ndr, "id_prefix", r->id_prefix); + ndr_print_drsuapi_DsReplicaOID(ndr, "oid", &r->oid); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping_Ctr *r) +{ + uint32_t cntr_mappings_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mappings)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->mappings)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->mappings) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mappings)); + for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1])); + } + for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping_Ctr *r) +{ + uint32_t _ptr_mappings; + uint32_t cntr_mappings_1; + TALLOC_CTX *_mem_save_mappings_0; + TALLOC_CTX *_mem_save_mappings_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_mappings)); + if (r->num_mappings < 0 || r->num_mappings > 0x100000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_mappings)); + if (_ptr_mappings) { + NDR_PULL_ALLOC(ndr, r->mappings); + } else { + r->mappings = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->mappings) { + _mem_save_mappings_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->mappings)); + NDR_PULL_ALLOC_N(ndr, r->mappings, ndr_get_array_size(ndr, &r->mappings)); + _mem_save_mappings_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0); + for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1])); + } + for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_0, 0); + } + if (r->mappings) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->mappings, r->num_mappings)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping_Ctr *r) +{ + uint32_t cntr_mappings_1; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping_Ctr"); + ndr->depth++; + ndr_print_uint32(ndr, "num_mappings", r->num_mappings); + ndr_print_ptr(ndr, "mappings", r->mappings); + ndr->depth++; + if (r->mappings) { + ndr->print(ndr, "%s: ARRAY(%d)", "mappings", (int)r->num_mappings); + ndr->depth++; + for (cntr_mappings_1=0;cntr_mappings_1num_mappings;cntr_mappings_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_mappings_1) != -1) { + ndr_print_drsuapi_DsReplicaOIDMapping(ndr, "mappings", &r->mappings[cntr_mappings_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAttributeId(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsAttributeId r) +{ + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAttributeId(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsAttributeId *r) +{ + uint32_t v; + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char *name, enum drsuapi_DsAttributeId r) +{ + const char *val = NULL; + + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + switch (r) { + case DRSUAPI_ATTRIBUTE_objectClass: val = "DRSUAPI_ATTRIBUTE_objectClass"; break; + case DRSUAPI_ATTRIBUTE_description: val = "DRSUAPI_ATTRIBUTE_description"; break; + case DRSUAPI_ATTRIBUTE_member: val = "DRSUAPI_ATTRIBUTE_member"; break; + case DRSUAPI_ATTRIBUTE_instanceType: val = "DRSUAPI_ATTRIBUTE_instanceType"; break; + case DRSUAPI_ATTRIBUTE_whenCreated: val = "DRSUAPI_ATTRIBUTE_whenCreated"; break; + case DRSUAPI_ATTRIBUTE_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_hasMasterNCs"; break; + case DRSUAPI_ATTRIBUTE_governsID: val = "DRSUAPI_ATTRIBUTE_governsID"; break; + case DRSUAPI_ATTRIBUTE_attributeID: val = "DRSUAPI_ATTRIBUTE_attributeID"; break; + case DRSUAPI_ATTRIBUTE_attributeSyntax: val = "DRSUAPI_ATTRIBUTE_attributeSyntax"; break; + case DRSUAPI_ATTRIBUTE_isSingleValued: val = "DRSUAPI_ATTRIBUTE_isSingleValued"; break; + case DRSUAPI_ATTRIBUTE_rangeLower: val = "DRSUAPI_ATTRIBUTE_rangeLower"; break; + case DRSUAPI_ATTRIBUTE_rangeUpper: val = "DRSUAPI_ATTRIBUTE_rangeUpper"; break; + case DRSUAPI_ATTRIBUTE_dMDLocation: val = "DRSUAPI_ATTRIBUTE_dMDLocation"; break; + case DRSUAPI_ATTRIBUTE_objectVersion: val = "DRSUAPI_ATTRIBUTE_objectVersion"; break; + case DRSUAPI_ATTRIBUTE_invocationId: val = "DRSUAPI_ATTRIBUTE_invocationId"; break; + case DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly: val = "DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly"; break; + case DRSUAPI_ATTRIBUTE_adminDisplayName: val = "DRSUAPI_ATTRIBUTE_adminDisplayName"; break; + case DRSUAPI_ATTRIBUTE_adminDescription: val = "DRSUAPI_ATTRIBUTE_adminDescription"; break; + case DRSUAPI_ATTRIBUTE_oMSyntax: val = "DRSUAPI_ATTRIBUTE_oMSyntax"; break; + case DRSUAPI_ATTRIBUTE_ntSecurityDescriptor: val = "DRSUAPI_ATTRIBUTE_ntSecurityDescriptor"; break; + case DRSUAPI_ATTRIBUTE_searchFlags: val = "DRSUAPI_ATTRIBUTE_searchFlags"; break; + case DRSUAPI_ATTRIBUTE_lDAPDisplayName: val = "DRSUAPI_ATTRIBUTE_lDAPDisplayName"; break; + case DRSUAPI_ATTRIBUTE_name: val = "DRSUAPI_ATTRIBUTE_name"; break; + case DRSUAPI_ATTRIBUTE_userAccountControl: val = "DRSUAPI_ATTRIBUTE_userAccountControl"; break; + case DRSUAPI_ATTRIBUTE_currentValue: val = "DRSUAPI_ATTRIBUTE_currentValue"; break; + case DRSUAPI_ATTRIBUTE_homeDirectory: val = "DRSUAPI_ATTRIBUTE_homeDirectory"; break; + case DRSUAPI_ATTRIBUTE_homeDrive: val = "DRSUAPI_ATTRIBUTE_homeDrive"; break; + case DRSUAPI_ATTRIBUTE_scriptPath: val = "DRSUAPI_ATTRIBUTE_scriptPath"; break; + case DRSUAPI_ATTRIBUTE_profilePath: val = "DRSUAPI_ATTRIBUTE_profilePath"; break; + case DRSUAPI_ATTRIBUTE_objectSid: val = "DRSUAPI_ATTRIBUTE_objectSid"; break; + case DRSUAPI_ATTRIBUTE_schemaIDGUID: val = "DRSUAPI_ATTRIBUTE_schemaIDGUID"; break; + case DRSUAPI_ATTRIBUTE_dBCSPwd: val = "DRSUAPI_ATTRIBUTE_dBCSPwd"; break; + case DRSUAPI_ATTRIBUTE_logonHours: val = "DRSUAPI_ATTRIBUTE_logonHours"; break; + case DRSUAPI_ATTRIBUTE_userWorkstations: val = "DRSUAPI_ATTRIBUTE_userWorkstations"; break; + case DRSUAPI_ATTRIBUTE_unicodePwd: val = "DRSUAPI_ATTRIBUTE_unicodePwd"; break; + case DRSUAPI_ATTRIBUTE_ntPwdHistory: val = "DRSUAPI_ATTRIBUTE_ntPwdHistory"; break; + case DRSUAPI_ATTRIBUTE_priorValue: val = "DRSUAPI_ATTRIBUTE_priorValue"; break; + case DRSUAPI_ATTRIBUTE_supplementalCredentials: val = "DRSUAPI_ATTRIBUTE_supplementalCredentials"; break; + case DRSUAPI_ATTRIBUTE_trustAuthIncoming: val = "DRSUAPI_ATTRIBUTE_trustAuthIncoming"; break; + case DRSUAPI_ATTRIBUTE_trustAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_trustAuthOutgoing"; break; + case DRSUAPI_ATTRIBUTE_lmPwdHistory: val = "DRSUAPI_ATTRIBUTE_lmPwdHistory"; break; + case DRSUAPI_ATTRIBUTE_sAMAccountName: val = "DRSUAPI_ATTRIBUTE_sAMAccountName"; break; + case DRSUAPI_ATTRIBUTE_sAMAccountType: val = "DRSUAPI_ATTRIBUTE_sAMAccountType"; break; + case DRSUAPI_ATTRIBUTE_fSMORoleOwner: val = "DRSUAPI_ATTRIBUTE_fSMORoleOwner"; break; + case DRSUAPI_ATTRIBUTE_systemFlags: val = "DRSUAPI_ATTRIBUTE_systemFlags"; break; + case DRSUAPI_ATTRIBUTE_serverReference: val = "DRSUAPI_ATTRIBUTE_serverReference"; break; + case DRSUAPI_ATTRIBUTE_serverReferenceBL: val = "DRSUAPI_ATTRIBUTE_serverReferenceBL"; break; + case DRSUAPI_ATTRIBUTE_initialAuthIncoming: val = "DRSUAPI_ATTRIBUTE_initialAuthIncoming"; break; + case DRSUAPI_ATTRIBUTE_initialAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_initialAuthOutgoing"; break; + case DRSUAPI_ATTRIBUTE_wellKnownObjects: val = "DRSUAPI_ATTRIBUTE_wellKnownObjects"; break; + case DRSUAPI_ATTRIBUTE_dNSHostName: val = "DRSUAPI_ATTRIBUTE_dNSHostName"; break; + case DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet: val = "DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet"; break; + case DRSUAPI_ATTRIBUTE_userPrincipalName: val = "DRSUAPI_ATTRIBUTE_userPrincipalName"; break; + case DRSUAPI_ATTRIBUTE_groupType: val = "DRSUAPI_ATTRIBUTE_groupType"; break; + case DRSUAPI_ATTRIBUTE_servicePrincipalName: val = "DRSUAPI_ATTRIBUTE_servicePrincipalName"; break; + case DRSUAPI_ATTRIBUTE_objectCategory: val = "DRSUAPI_ATTRIBUTE_objectCategory"; break; + case DRSUAPI_ATTRIBUTE_gPLink: val = "DRSUAPI_ATTRIBUTE_gPLink"; break; + case DRSUAPI_ATTRIBUTE_msDS_Behavior_Version: val = "DRSUAPI_ATTRIBUTE_msDS_Behavior_Version"; break; + case DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber: val = "DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber"; break; + case DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs: val = "DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs"; break; + case DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); + ndr->flags = _flags_save_ENUM; + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsPartialAttributeSet(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsPartialAttributeSet *r) +{ + uint32_t cntr_attids_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attids)); + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attids)); + for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) { + NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attids[cntr_attids_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsPartialAttributeSet(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsPartialAttributeSet *r) +{ + uint32_t cntr_attids_0; + TALLOC_CTX *_mem_save_attids_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->attids)); + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attids)); + if (r->num_attids < 1 || r->num_attids > 0x100000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->attids, ndr_get_array_size(ndr, &r->attids)); + _mem_save_attids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attids, 0); + for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attids[cntr_attids_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attids_0, 0); + if (r->attids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attids, r->num_attids)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsPartialAttributeSet(struct ndr_print *ndr, const char *name, const struct drsuapi_DsPartialAttributeSet *r) +{ + uint32_t cntr_attids_0; + ndr_print_struct(ndr, name, "drsuapi_DsPartialAttributeSet"); + ndr->depth++; + ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version); + ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); + ndr_print_uint32(ndr, "num_attids", r->num_attids); + ndr->print(ndr, "%s: ARRAY(%d)", "attids", (int)r->num_attids); + ndr->depth++; + for (cntr_attids_0=0;cntr_attids_0num_attids;cntr_attids_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_attids_0) != -1) { + ndr_print_drsuapi_DsAttributeId(ndr, "attids", r->attids[cntr_attids_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest8(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + if (r->naming_context == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_ref_ptr(ndr)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size)); + NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set_ex)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + if (r->uptodateness_vector) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); + } + if (r->partial_attribute_set) { + NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set)); + } + if (r->partial_attribute_set_ex) { + NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex)); + } + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest8(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest8 *r) +{ + uint32_t _ptr_naming_context; + TALLOC_CTX *_mem_save_naming_context_0; + uint32_t _ptr_uptodateness_vector; + TALLOC_CTX *_mem_save_uptodateness_vector_0; + uint32_t _ptr_partial_attribute_set; + TALLOC_CTX *_mem_save_partial_attribute_set_0; + uint32_t _ptr_partial_attribute_set_ex; + TALLOC_CTX *_mem_save_partial_attribute_set_ex_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context)); + if (_ptr_naming_context) { + NDR_PULL_ALLOC(ndr, r->naming_context); + } else { + r->naming_context = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector)); + if (_ptr_uptodateness_vector) { + NDR_PULL_ALLOC(ndr, r->uptodateness_vector); + } else { + r->uptodateness_vector = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size)); + NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set)); + if (_ptr_partial_attribute_set) { + NDR_PULL_ALLOC(ndr, r->partial_attribute_set); + } else { + r->partial_attribute_set = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set_ex)); + if (_ptr_partial_attribute_set_ex) { + NDR_PULL_ALLOC(ndr, r->partial_attribute_set_ex); + } else { + r->partial_attribute_set_ex = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); + if (r->uptodateness_vector) { + _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0); + } + if (r->partial_attribute_set) { + _mem_save_partial_attribute_set_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set, 0); + NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_0, 0); + } + if (r->partial_attribute_set_ex) { + _mem_save_partial_attribute_set_ex_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set_ex, 0); + NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_ex_0, 0); + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest8(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest8 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest8"); + ndr->depth++; + ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid); + ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); + ndr_print_ptr(ndr, "naming_context", r->naming_context); + ndr->depth++; + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); + ndr->depth--; + ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark); + ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector); + ndr->depth++; + if (r->uptodateness_vector) { + ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags); + ndr_print_uint32(ndr, "max_object_count", r->max_object_count); + ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size); + ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op); + ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info); + ndr_print_ptr(ndr, "partial_attribute_set", r->partial_attribute_set); + ndr->depth++; + if (r->partial_attribute_set) { + ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set", r->partial_attribute_set); + } + ndr->depth--; + ndr_print_ptr(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex); + ndr->depth++; + if (r->partial_attribute_set_ex) { + ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 5: { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5)); + break; } + + case 8: { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 5: + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5)); + break; + + case 8: + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 5: { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5)); + break; } + + case 8: { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 5: + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5)); + break; + + case 8: + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesRequest"); + switch (level) { + case 5: + ndr_print_drsuapi_DsGetNCChangesRequest5(ndr, "req5", &r->req5); + break; + + case 8: + ndr_print_drsuapi_DsGetNCChangesRequest8(ndr, "req8", &r->req8); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2"); + ndr->depth++; + ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); + ndr_print_hyper(ndr, "highest_usn", r->highest_usn); + ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2CtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2CtrEx *r) +{ + uint32_t cntr_cursors_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2CtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2CtrEx *r) +{ + uint32_t cntr_cursors_0; + TALLOC_CTX *_mem_save_cursors_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 0x100000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2)); + NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors)); + _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); + for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); + if (r->cursors) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2CtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2CtrEx *r) +{ + uint32_t cntr_cursors_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2CtrEx"); + ndr->depth++; + ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->version); + ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2); + ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count); + ndr->depth++; + for (cntr_cursors_0=0;cntr_cursors_0count;cntr_cursors_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) { + ndr_print_drsuapi_DsReplicaCursor2(ndr, "cursors", &r->cursors[cntr_cursors_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAttributeValue(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValue *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->blob, 0))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->blob)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->blob) { + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->blob)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValue(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValue *r) +{ + uint32_t _ptr_blob; + TALLOC_CTX *_mem_save_blob_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); + if (r->__ndr_size < 0 || r->__ndr_size > 10485760) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_blob)); + if (_ptr_blob) { + NDR_PULL_ALLOC(ndr, r->blob); + } else { + r->blob = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->blob) { + _mem_save_blob_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->blob, 0); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->blob)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_blob_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAttributeValue(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue"); + ndr->depth++; + ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->blob, 0):r->__ndr_size); + ndr_print_ptr(ndr, "blob", r->blob); + ndr->depth++; + if (r->blob) { + ndr_print_DATA_BLOB(ndr, "blob", *r->blob); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAttributeValueCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValueCtr *r) +{ + uint32_t cntr_values_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_values)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->values)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->values) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_values)); + for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) { + NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1])); + } + for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) { + NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValueCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValueCtr *r) +{ + uint32_t _ptr_values; + uint32_t cntr_values_1; + TALLOC_CTX *_mem_save_values_0; + TALLOC_CTX *_mem_save_values_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_values)); + if (r->num_values < 0 || r->num_values > 10485760) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_values)); + if (_ptr_values) { + NDR_PULL_ALLOC(ndr, r->values); + } else { + r->values = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->values) { + _mem_save_values_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->values, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->values)); + NDR_PULL_ALLOC_N(ndr, r->values, ndr_get_array_size(ndr, &r->values)); + _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->values, 0); + for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1])); + } + for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_0, 0); + } + if (r->values) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->values, r->num_values)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValueCtr *r) +{ + uint32_t cntr_values_1; + ndr_print_struct(ndr, name, "drsuapi_DsAttributeValueCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "num_values", r->num_values); + ndr_print_ptr(ndr, "values", r->values); + ndr->depth++; + if (r->values) { + ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->num_values); + ndr->depth++; + for (cntr_values_1=0;cntr_values_1num_values;cntr_values_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) { + ndr_print_drsuapi_DsAttributeValue(ndr, "values", &r->values[cntr_values_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->flags))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags))); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3"); + ndr->depth++; + ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->flags):r->__ndr_size); + ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid); + ndr_print_GUID(ndr, "guid", &r->guid); + ndr_print_dom_sid28(ndr, "sid", &r->sid); + ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn); + ndr_print_string(ndr, "dn", r->dn); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplicaObjectIdentifier3 *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r, ndr->flags))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags))); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->binary.length + 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->binary)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->binary)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3Binary"); + ndr->depth++; + ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r, ndr->flags):r->__ndr_size); + ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid); + ndr_print_GUID(ndr, "guid", &r->guid); + ndr_print_dom_sid28(ndr, "sid", &r->sid); + ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn); + ndr_print_string(ndr, "dn", r->dn); + ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->binary.length + 4:r->__ndr_size_binary); + ndr_print_DATA_BLOB(ndr, "binary", r->binary); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary); +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid)); + NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid)); + NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttribute"); + ndr->depth++; + ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid); + ndr_print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttributeCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttributeCtr *r) +{ + uint32_t cntr_attributes_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attributes)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attributes) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attributes)); + for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1])); + } + for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttributeCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttributeCtr *r) +{ + uint32_t _ptr_attributes; + uint32_t cntr_attributes_1; + TALLOC_CTX *_mem_save_attributes_0; + TALLOC_CTX *_mem_save_attributes_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attributes)); + if (r->num_attributes < 0 || r->num_attributes > 1048576) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attributes)); + if (_ptr_attributes) { + NDR_PULL_ALLOC(ndr, r->attributes); + } else { + r->attributes = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attributes) { + _mem_save_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->attributes)); + NDR_PULL_ALLOC_N(ndr, r->attributes, ndr_get_array_size(ndr, &r->attributes)); + _mem_save_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0); + for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1])); + } + for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_0, 0); + } + if (r->attributes) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attributes, r->num_attributes)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttributeCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttributeCtr *r) +{ + uint32_t cntr_attributes_1; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttributeCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "num_attributes", r->num_attributes); + ndr_print_ptr(ndr, "attributes", r->attributes); + ndr->depth++; + if (r->attributes) { + ndr->print(ndr, "%s: ARRAY(%d)", "attributes", (int)r->num_attributes); + ndr->depth++; + for (cntr_attributes_1=0;cntr_attributes_1num_attributes;cntr_attributes_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_attributes_1) != -1) { + ndr_print_drsuapi_DsReplicaAttribute(ndr, "attributes", &r->attributes[cntr_attributes_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER", DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC", DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY", DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObject(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObject *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->identifier) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier)); + } + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObject(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObject *r) +{ + uint32_t _ptr_identifier; + TALLOC_CTX *_mem_save_identifier_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier)); + if (_ptr_identifier) { + NDR_PULL_ALLOC(ndr, r->identifier); + } else { + r->identifier = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->identifier) { + _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0); + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObject(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObject *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaObject"); + ndr->depth++; + ndr_print_ptr(ndr, "identifier", r->identifier); + ndr->depth++; + if (r->identifier) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaObjectFlags(ndr, "flags", r->flags); + ndr_print_drsuapi_DsReplicaAttributeCtr(ndr, "attribute_ctr", &r->attribute_ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaData *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_change_time)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaData *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_change_time)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaData *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaData"); + ndr->depth++; + ndr_print_uint32(ndr, "version", r->version); + ndr_print_NTTIME_1sec(ndr, "originating_change_time", r->originating_change_time); + ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); + ndr_print_hyper(ndr, "originating_usn", r->originating_usn); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaDataCtr *r) +{ + uint32_t cntr_meta_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaDataCtr *r) +{ + uint32_t cntr_meta_data_0; + TALLOC_CTX *_mem_save_meta_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->meta_data)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1048576) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->meta_data, ndr_get_array_size(ndr, &r->meta_data)); + _mem_save_meta_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->meta_data, 0); + for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_0, 0); + if (r->meta_data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->meta_data, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaDataCtr *r) +{ + uint32_t cntr_meta_data_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaDataCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr->print(ndr, "%s: ARRAY(%d)", "meta_data", (int)r->count); + ndr->depth++; + for (cntr_meta_data_0=0;cntr_meta_data_0count;cntr_meta_data_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_meta_data_0) != -1) { + ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data[cntr_meta_data_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItemEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItemEx *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_nc_prefix)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->parent_object_guid)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->meta_data_ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->next_object) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object)); + } + NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object)); + if (r->parent_object_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->parent_object_guid)); + } + if (r->meta_data_ctr) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItemEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItemEx *r) +{ + uint32_t _ptr_next_object; + TALLOC_CTX *_mem_save_next_object_0; + uint32_t _ptr_parent_object_guid; + TALLOC_CTX *_mem_save_parent_object_guid_0; + uint32_t _ptr_meta_data_ctr; + TALLOC_CTX *_mem_save_meta_data_ctr_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object)); + if (_ptr_next_object) { + NDR_PULL_ALLOC(ndr, r->next_object); + } else { + r->next_object = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_nc_prefix)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parent_object_guid)); + if (_ptr_parent_object_guid) { + NDR_PULL_ALLOC(ndr, r->parent_object_guid); + } else { + r->parent_object_guid = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_meta_data_ctr)); + if (_ptr_meta_data_ctr) { + NDR_PULL_ALLOC(ndr, r->meta_data_ctr); + } else { + r->meta_data_ctr = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->next_object) { + _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0); + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object)); + if (r->parent_object_guid) { + _mem_save_parent_object_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->parent_object_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->parent_object_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_object_guid_0, 0); + } + if (r->meta_data_ctr) { + _mem_save_meta_data_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->meta_data_ctr, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_ctr_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); + NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->flags) + 55)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->naming_context) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + } + if (r->uptodateness_vector) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); + } + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); + if (r->first_object) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1 *r) +{ + uint32_t _ptr_naming_context; + TALLOC_CTX *_mem_save_naming_context_0; + uint32_t _ptr_uptodateness_vector; + TALLOC_CTX *_mem_save_uptodateness_vector_0; + uint32_t _ptr_first_object; + TALLOC_CTX *_mem_save_first_object_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context)); + if (_ptr_naming_context) { + NDR_PULL_ALLOC(ndr, r->naming_context); + } else { + r->naming_context = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector)); + if (_ptr_uptodateness_vector) { + NDR_PULL_ALLOC(ndr, r->uptodateness_vector); + } else { + r->uptodateness_vector = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); + NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object)); + if (_ptr_first_object) { + NDR_PULL_ALLOC(ndr, r->first_object); + } else { + r->first_object = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->naming_context) { + _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); + } + if (r->uptodateness_vector) { + _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0); + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); + if (r->first_object) { + _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1"); + ndr->depth++; + ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid); + ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); + ndr_print_ptr(ndr, "naming_context", r->naming_context); + ndr->depth++; + if (r->naming_context) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark); + ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark); + ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector); + ndr->depth++; + if (r->uptodateness_vector) { + ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr); + ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret); + ndr_print_uint32(ndr, "object_count", r->object_count); + ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->flags) + 55:r->__ndr_size); + ndr_print_ptr(ndr, "first_object", r->first_object); + ndr->depth++; + if (r->first_object) { + ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object); + } + ndr->depth--; + ndr_print_uint32(ndr, "more_data", r->more_data); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr1(const struct drsuapi_DsGetNCChangesCtr1 *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr1); +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsLinkedAttributeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsLinkedAttributeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsLinkedAttributeFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE", DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaLinkedAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaLinkedAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier)); + NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid)); + NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value)); + NDR_CHECK(ndr_push_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_add_time)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->identifier) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier)); + } + NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaLinkedAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaLinkedAttribute *r) +{ + uint32_t _ptr_identifier; + TALLOC_CTX *_mem_save_identifier_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier)); + if (_ptr_identifier) { + NDR_PULL_ALLOC(ndr, r->identifier); + } else { + r->identifier = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid)); + NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value)); + NDR_CHECK(ndr_pull_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_add_time)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->identifier) { + _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0); + } + NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaLinkedAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaLinkedAttribute *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaLinkedAttribute"); + ndr->depth++; + ndr_print_ptr(ndr, "identifier", r->identifier); + ndr->depth++; + if (r->identifier) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier); + } + ndr->depth--; + ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid); + ndr_print_drsuapi_DsAttributeValue(ndr, "value", &r->value); + ndr_print_drsuapi_DsLinkedAttributeFlags(ndr, "flags", r->flags); + ndr_print_NTTIME_1sec(ndr, "originating_add_time", r->originating_add_time); + ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6 *r) +{ + uint32_t cntr_linked_attributes_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); + NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr6(r, ndr->flags) + 55)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_object_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_linked_attributes_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linked_attributes_count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->linked_attributes)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->drs_error)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->naming_context) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + } + if (r->uptodateness_vector) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); + } + NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); + if (r->first_object) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object)); + } + if (r->linked_attributes) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linked_attributes_count)); + for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1])); + } + for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6 *r) +{ + uint32_t _ptr_naming_context; + TALLOC_CTX *_mem_save_naming_context_0; + uint32_t _ptr_uptodateness_vector; + TALLOC_CTX *_mem_save_uptodateness_vector_0; + uint32_t _ptr_first_object; + TALLOC_CTX *_mem_save_first_object_0; + uint32_t _ptr_linked_attributes; + uint32_t cntr_linked_attributes_1; + TALLOC_CTX *_mem_save_linked_attributes_0; + TALLOC_CTX *_mem_save_linked_attributes_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context)); + if (_ptr_naming_context) { + NDR_PULL_ALLOC(ndr, r->naming_context); + } else { + r->naming_context = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector)); + if (_ptr_uptodateness_vector) { + NDR_PULL_ALLOC(ndr, r->uptodateness_vector); + } else { + r->uptodateness_vector = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); + NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object)); + if (_ptr_first_object) { + NDR_PULL_ALLOC(ndr, r->first_object); + } else { + r->first_object = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_object_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_linked_attributes_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->linked_attributes_count)); + if (r->linked_attributes_count < 0 || r->linked_attributes_count > 1048576) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_linked_attributes)); + if (_ptr_linked_attributes) { + NDR_PULL_ALLOC(ndr, r->linked_attributes); + } else { + r->linked_attributes = NULL; + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->drs_error)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->naming_context) { + _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); + } + if (r->uptodateness_vector) { + _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0); + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); + if (r->first_object) { + _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0); + } + if (r->linked_attributes) { + _mem_save_linked_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->linked_attributes)); + NDR_PULL_ALLOC_N(ndr, r->linked_attributes, ndr_get_array_size(ndr, &r->linked_attributes)); + _mem_save_linked_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0); + for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1])); + } + for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_0, 0); + } + if (r->linked_attributes) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->linked_attributes, r->linked_attributes_count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6 *r) +{ + uint32_t cntr_linked_attributes_1; + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6"); + ndr->depth++; + ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid); + ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); + ndr_print_ptr(ndr, "naming_context", r->naming_context); + ndr->depth++; + if (r->naming_context) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark); + ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark); + ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector); + ndr->depth++; + if (r->uptodateness_vector) { + ndr_print_drsuapi_DsReplicaCursor2CtrEx(ndr, "uptodateness_vector", r->uptodateness_vector); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr); + ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret); + ndr_print_uint32(ndr, "object_count", r->object_count); + ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsGetNCChangesCtr6(r, ndr->flags) + 55:r->__ndr_size); + ndr_print_ptr(ndr, "first_object", r->first_object); + ndr->depth++; + if (r->first_object) { + ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object); + } + ndr->depth--; + ndr_print_uint32(ndr, "more_data", r->more_data); + ndr_print_uint32(ndr, "nc_object_count", r->nc_object_count); + ndr_print_uint32(ndr, "nc_linked_attributes_count", r->nc_linked_attributes_count); + ndr_print_uint32(ndr, "linked_attributes_count", r->linked_attributes_count); + ndr_print_ptr(ndr, "linked_attributes", r->linked_attributes); + ndr->depth++; + if (r->linked_attributes) { + ndr->print(ndr, "%s: ARRAY(%d)", "linked_attributes", (int)r->linked_attributes_count); + ndr->depth++; + for (cntr_linked_attributes_1=0;cntr_linked_attributes_1linked_attributes_count;cntr_linked_attributes_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_linked_attributes_1) != -1) { + ndr_print_drsuapi_DsReplicaLinkedAttribute(ndr, "linked_attributes", &r->linked_attributes[cntr_linked_attributes_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_WERROR(ndr, "drs_error", r->drs_error); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNCChangesCtr6 *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr6); +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + { + struct ndr_push *_ndr_ctr1; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1)); + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1TS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + { + struct ndr_pull *_ndr_ctr1; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1TS *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1TS"); + ndr->depth++; + ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6TS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + { + struct ndr_push *_ndr_ctr6; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1)); + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6TS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + { + struct ndr_pull *_ndr_ctr6; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6TS *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6TS"); + ndr->depth++; + ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6); + ndr->depth--; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr1 *r) +{ + uint32_t _ptr_ts; + TALLOC_CTX *_mem_save_ts_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts)); + if (_ptr_ts) { + NDR_PULL_ALLOC(ndr, r->ts); + } else { + r->ts = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->ts) { + _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0); + { + struct ndr_pull *_ndr_ts; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length)); + { + struct ndr_pull *_ndr_ts_compressed; + NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); + NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length)); + } + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length); + ndr_print_uint32(ndr, "compressed_length", r->compressed_length); + ndr_print_ptr(ndr, "ts", r->ts); + ndr->depth++; + if (r->ts) { + ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr6 *r) +{ + uint32_t _ptr_ts; + TALLOC_CTX *_mem_save_ts_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts)); + if (_ptr_ts) { + NDR_PULL_ALLOC(ndr, r->ts); + } else { + r->ts = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->ts) { + _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0); + { + struct ndr_pull *_ndr_ts; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length)); + { + struct ndr_pull *_ndr_ts_compressed; + NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); + NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length)); + } + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr6"); + ndr->depth++; + ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length); + ndr_print_uint32(ndr, "compressed_length", r->compressed_length); + ndr_print_ptr(ndr, "ts", r->ts); + ndr->depth++; + if (r->ts) { + ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr1 *r) +{ + uint32_t _ptr_ts; + TALLOC_CTX *_mem_save_ts_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts)); + if (_ptr_ts) { + NDR_PULL_ALLOC(ndr, r->ts); + } else { + r->ts = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->ts) { + _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0); + { + struct ndr_pull *_ndr_ts; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length)); + { + struct ndr_pull *_ndr_ts_compressed; + NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); + NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length)); + } + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesXPRESSCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length); + ndr_print_uint32(ndr, "compressed_length", r->compressed_length); + ndr_print_ptr(ndr, "ts", r->ts); + ndr->depth++; + if (r->ts) { + ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr6 *r) +{ + uint32_t _ptr_ts; + TALLOC_CTX *_mem_save_ts_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts)); + if (_ptr_ts) { + NDR_PULL_ALLOC(ndr, r->ts); + } else { + r->ts = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->ts) { + _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0); + { + struct ndr_pull *_ndr_ts; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length)); + { + struct ndr_pull *_ndr_ts_compressed; + NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); + NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length)); + } + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesXPRESSCtr6"); + ndr->depth++; + ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length); + ndr_print_uint32(ndr, "compressed_length", r->compressed_length); + ndr_print_ptr(ndr, "ts", r->ts); + ndr->depth++; + if (r->ts) { + ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCompressionType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsGetNCChangesCompressionType r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCompressionType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsGetNCChangesCompressionType *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCompressionType(struct ndr_print *ndr, const char *name, enum drsuapi_DsGetNCChangesCompressionType r) +{ + const char *val = NULL; + + switch (r) { + case DRSUAPI_COMPRESSION_TYPE_MSZIP: val = "DRSUAPI_COMPRESSION_TYPE_MSZIP"; break; + case DRSUAPI_COMPRESSION_TYPE_XPRESS: val = "DRSUAPI_COMPRESSION_TYPE_XPRESS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesCompressedCtr *r) +{ + { + uint32_t _flags_save_UNION = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1)); + break; } + + case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_SCALARS, &r->mszip6)); + break; } + + case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_SCALARS, &r->xpress1)); + break; } + + case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_SCALARS, &r->xpress6)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1)); + break; + + case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_BUFFERS, &r->mszip6)); + break; + + case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_BUFFERS, &r->xpress1)); + break; + + case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_BUFFERS, &r->xpress6)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + ndr->flags = _flags_save_UNION; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesCompressedCtr *r) +{ + int level; + { + uint32_t _flags_save_UNION = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1)); + break; } + + case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_SCALARS, &r->mszip6)); + break; } + + case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_SCALARS, &r->xpress1)); + break; } + + case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_SCALARS, &r->xpress6)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1)); + break; + + case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_BUFFERS, &r->mszip6)); + break; + + case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_BUFFERS, &r->xpress1)); + break; + + case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_BUFFERS, &r->xpress6)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + ndr->flags = _flags_save_UNION; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCompressedCtr *r) +{ + int level; + { + uint32_t _flags_save_UNION = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesCompressedCtr"); + switch (level) { + case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): + ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, "mszip1", &r->mszip1); + break; + + case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): + ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, "mszip6", &r->mszip6); + break; + + case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): + ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, "xpress1", &r->xpress1); + break; + + case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): + ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, "xpress6", &r->xpress6); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } + ndr->flags = _flags_save_UNION; + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr2 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr2"); + ndr->depth++; + ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, "mszip1", &r->mszip1); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr7(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressionType(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16))); + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr7(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->level)); + if (r->level < 0 || r->level > 6) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressionType(ndr, NDR_SCALARS, &r->type)); + if (r->type < 2 || r->type > 3) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16))); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr7(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr7 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr7"); + ndr->depth++; + ndr_print_int32(ndr, "level", r->level); + ndr_print_drsuapi_DsGetNCChangesCompressionType(ndr, "type", r->type); + ndr_print_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16)); + ndr_print_drsuapi_DsGetNCChangesCompressedCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr2(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + case 6: { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(ndr, NDR_SCALARS, &r->ctr6)); + break; } + + case 7: { + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr7(ndr, NDR_SCALARS, &r->ctr7)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + case 2: + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr2(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case 6: + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(ndr, NDR_BUFFERS, &r->ctr6)); + break; + + case 7: + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr7(ndr, NDR_BUFFERS, &r->ctr7)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesCtr *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr2(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + case 6: { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(ndr, NDR_SCALARS, &r->ctr6)); + break; } + + case 7: { + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr7(ndr, NDR_SCALARS, &r->ctr7)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + case 2: + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr2(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case 6: + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(ndr, NDR_BUFFERS, &r->ctr6)); + break; + + case 7: + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr7(ndr, NDR_BUFFERS, &r->ctr7)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesCtr"); + switch (level) { + case 1: + ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1); + break; + + case 2: + ndr_print_drsuapi_DsGetNCChangesCtr2(ndr, "ctr2", &r->ctr2); + break; + + case 6: + ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6); + break; + + case 7: + ndr_print_drsuapi_DsGetNCChangesCtr7(ndr, "ctr7", &r->ctr7); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE", DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE", DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE", DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_0x00000010", DRSUAPI_DS_REPLICA_UPDATE_0x00000010, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + if (r->naming_context == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_ref_ptr(ndr)); + if (r->dest_dsa_dns_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_GUID(ndr, NDR_SCALARS, &r->dest_dsa_guid)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, r->options)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dest_dsa_dns_name, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS), sizeof(uint8_t), CH_DOS)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaUpdateRefsRequest1 *r) +{ + uint32_t _ptr_naming_context; + TALLOC_CTX *_mem_save_naming_context_0; + uint32_t _ptr_dest_dsa_dns_name; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context)); + if (_ptr_naming_context) { + NDR_PULL_ALLOC(ndr, r->naming_context); + } else { + r->naming_context = NULL; + } + NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_dest_dsa_dns_name)); + if (_ptr_dest_dsa_dns_name) { + NDR_PULL_ALLOC(ndr, r->dest_dsa_dns_name); + } else { + r->dest_dsa_dns_name = NULL; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->dest_dsa_guid)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, &r->options)); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dest_dsa_dns_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dest_dsa_dns_name)); + if (ndr_get_array_length(ndr, &r->dest_dsa_dns_name) > ndr_get_array_size(ndr, &r->dest_dsa_dns_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dest_dsa_dns_name), ndr_get_array_length(ndr, &r->dest_dsa_dns_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dest_dsa_dns_name), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dest_dsa_dns_name, ndr_get_array_length(ndr, &r->dest_dsa_dns_name), sizeof(uint8_t), CH_DOS)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaUpdateRefsRequest1"); + ndr->depth++; + ndr_print_ptr(ndr, "naming_context", r->naming_context); + ndr->depth++; + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); + ndr->depth--; + ndr_print_ptr(ndr, "dest_dsa_dns_name", r->dest_dsa_dns_name); + ndr->depth++; + ndr_print_string(ndr, "dest_dsa_dns_name", r->dest_dsa_dns_name); + ndr->depth--; + ndr_print_GUID(ndr, "dest_dsa_guid", &r->dest_dsa_guid); + ndr_print_drsuapi_DsReplicaUpdateRefsOptions(ndr, "options", r->options); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaUpdateRefsRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaUpdateRefsRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaUpdateRefsRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsReplicaUpdateRefsRequest"); + switch (level) { + case 1: + ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaAddOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAddOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaAddOptions(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_WRITEABLE", DRSUAPI_DS_REPLICA_ADD_WRITEABLE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaDeleteOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaDeleteOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaDeleteOptions(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_DELETE_WRITEABLE", DRSUAPI_DS_REPLICA_DELETE_WRITEABLE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaModifyOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaModifyOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaModifyOptions(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE", DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsMembershipType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsMembershipType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsMembershipType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsMembershipType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsMembershipType(struct ndr_print *ndr, const char *name, enum drsuapi_DsMembershipType r) +{ + const char *val = NULL; + + switch (r) { + case DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS"; break; + case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS"; break; + case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS"; break; + case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2"; break; + case DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS"; break; + case DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS"; break; + case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMembershipsCtr1 *r) +{ + uint32_t cntr_info_array_1; + uint32_t cntr_group_attrs_1; + uint32_t cntr_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_attrs)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info_array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships)); + for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array[cntr_info_array_1])); + } + for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) { + if (r->info_array[cntr_info_array_1]) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1])); + } + } + } + if (r->group_attrs) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships)); + for (cntr_group_attrs_1 = 0; cntr_group_attrs_1 < r->num_memberships; cntr_group_attrs_1++) { + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->group_attrs[cntr_group_attrs_1])); + } + } + if (r->sids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids[cntr_sids_1])); + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { + if (r->sids[cntr_sids_1]) { + NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_1])); + } + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMembershipsCtr1 *r) +{ + uint32_t _ptr_info_array; + uint32_t cntr_info_array_1; + TALLOC_CTX *_mem_save_info_array_0; + TALLOC_CTX *_mem_save_info_array_1; + TALLOC_CTX *_mem_save_info_array_2; + uint32_t _ptr_group_attrs; + uint32_t cntr_group_attrs_1; + TALLOC_CTX *_mem_save_group_attrs_0; + TALLOC_CTX *_mem_save_group_attrs_1; + uint32_t _ptr_sids; + uint32_t cntr_sids_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_sids_1; + TALLOC_CTX *_mem_save_sids_2; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_memberships)); + if (r->num_memberships < 0 || r->num_memberships > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids)); + if (r->num_sids < 0 || r->num_sids > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array)); + if (_ptr_info_array) { + NDR_PULL_ALLOC(ndr, r->info_array); + } else { + r->info_array = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_attrs)); + if (_ptr_group_attrs) { + NDR_PULL_ALLOC(ndr, r->group_attrs); + } else { + r->group_attrs = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids); + } else { + r->sids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info_array) { + _mem_save_info_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->info_array)); + NDR_PULL_ALLOC_N(ndr, r->info_array, ndr_get_array_size(ndr, &r->info_array)); + _mem_save_info_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0); + for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array)); + if (_ptr_info_array) { + NDR_PULL_ALLOC(ndr, r->info_array[cntr_info_array_1]); + } else { + r->info_array[cntr_info_array_1] = NULL; + } + } + for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) { + if (r->info_array[cntr_info_array_1]) { + _mem_save_info_array_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info_array[cntr_info_array_1], 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1])); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_2, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_0, 0); + } + if (r->group_attrs) { + _mem_save_group_attrs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->group_attrs, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->group_attrs)); + NDR_PULL_ALLOC_N(ndr, r->group_attrs, ndr_get_array_size(ndr, &r->group_attrs)); + _mem_save_group_attrs_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->group_attrs, 0); + for (cntr_group_attrs_1 = 0; cntr_group_attrs_1 < r->num_memberships; cntr_group_attrs_1++) { + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->group_attrs[cntr_group_attrs_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_attrs_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_attrs_0, 0); + } + if (r->sids) { + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids[cntr_sids_1]); + } else { + r->sids[cntr_sids_1] = NULL; + } + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { + if (r->sids[cntr_sids_1]) { + _mem_save_sids_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids[cntr_sids_1], 0); + NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_1])); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_2, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + } + if (r->info_array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info_array, r->num_memberships)); + } + if (r->group_attrs) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->group_attrs, r->num_memberships)); + } + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsCtr1 *r) +{ + uint32_t cntr_info_array_1; + uint32_t cntr_group_attrs_1; + uint32_t cntr_sids_1; + ndr_print_struct(ndr, name, "drsuapi_DsGetMembershipsCtr1"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "status", r->status); + ndr_print_uint32(ndr, "num_memberships", r->num_memberships); + ndr_print_uint32(ndr, "num_sids", r->num_sids); + ndr_print_ptr(ndr, "info_array", r->info_array); + ndr->depth++; + if (r->info_array) { + ndr->print(ndr, "%s: ARRAY(%d)", "info_array", (int)r->num_memberships); + ndr->depth++; + for (cntr_info_array_1=0;cntr_info_array_1num_memberships;cntr_info_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_info_array_1) != -1) { + ndr_print_ptr(ndr, "info_array", r->info_array[cntr_info_array_1]); + ndr->depth++; + if (r->info_array[cntr_info_array_1]) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "info_array", r->info_array[cntr_info_array_1]); + } + ndr->depth--; + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_ptr(ndr, "group_attrs", r->group_attrs); + ndr->depth++; + if (r->group_attrs) { + ndr->print(ndr, "%s: ARRAY(%d)", "group_attrs", (int)r->num_memberships); + ndr->depth++; + for (cntr_group_attrs_1=0;cntr_group_attrs_1num_memberships;cntr_group_attrs_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_group_attrs_1) != -1) { + ndr_print_samr_GroupAttrs(ndr, "group_attrs", r->group_attrs[cntr_group_attrs_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->sids); + ndr->depth++; + if (r->sids) { + ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids); + ndr->depth++; + for (cntr_sids_1=0;cntr_sids_1num_sids;cntr_sids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { + ndr_print_ptr(ndr, "sids", r->sids[cntr_sids_1]); + ndr->depth++; + if (r->sids[cntr_sids_1]) { + ndr_print_dom_sid28(ndr, "sids", r->sids[cntr_sids_1]); + } + ndr->depth--; + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMembershipsCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMembershipsCtr *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetMembershipsCtr"); + switch (level) { + case 1: + ndr_print_drsuapi_DsGetMembershipsCtr1(ndr, "ctr1", &r->ctr1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMembershipsRequest1 *r) +{ + uint32_t cntr_info_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_drsuapi_DsMembershipType(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info_array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array[cntr_info_array_1])); + } + for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) { + if (r->info_array[cntr_info_array_1]) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1])); + } + } + } + if (r->domain) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMembershipsRequest1 *r) +{ + uint32_t _ptr_info_array; + uint32_t cntr_info_array_1; + TALLOC_CTX *_mem_save_info_array_0; + TALLOC_CTX *_mem_save_info_array_1; + TALLOC_CTX *_mem_save_info_array_2; + uint32_t _ptr_domain; + TALLOC_CTX *_mem_save_domain_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 1 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array)); + if (_ptr_info_array) { + NDR_PULL_ALLOC(ndr, r->info_array); + } else { + r->info_array = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_drsuapi_DsMembershipType(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info_array) { + _mem_save_info_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->info_array)); + NDR_PULL_ALLOC_N(ndr, r->info_array, ndr_get_array_size(ndr, &r->info_array)); + _mem_save_info_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0); + for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array)); + if (_ptr_info_array) { + NDR_PULL_ALLOC(ndr, r->info_array[cntr_info_array_1]); + } else { + r->info_array[cntr_info_array_1] = NULL; + } + } + for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) { + if (r->info_array[cntr_info_array_1]) { + _mem_save_info_array_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info_array[cntr_info_array_1], 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1])); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_2, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_0, 0); + } + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + if (r->info_array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info_array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsRequest1 *r) +{ + uint32_t cntr_info_array_1; + ndr_print_struct(ndr, name, "drsuapi_DsGetMembershipsRequest1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "info_array", r->info_array); + ndr->depth++; + if (r->info_array) { + ndr->print(ndr, "%s: ARRAY(%d)", "info_array", (int)r->count); + ndr->depth++; + for (cntr_info_array_1=0;cntr_info_array_1count;cntr_info_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_info_array_1) != -1) { + ndr_print_ptr(ndr, "info_array", r->info_array[cntr_info_array_1]); + ndr->depth++; + if (r->info_array[cntr_info_array_1]) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "info_array", r->info_array[cntr_info_array_1]); + } + ndr->depth--; + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->flags); + ndr_print_drsuapi_DsMembershipType(ndr, "type", r->type); + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "domain", r->domain); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMembershipsRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMembershipsRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetMembershipsRequest"); + switch (level) { + case 1: + ndr_print_drsuapi_DsGetMembershipsRequest1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNT4ChangeLogRequest1 *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + if (r->length < 0 || r->length > 0x00A00000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLogRequest1"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr_print_uint32(ndr, "length", r->length); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNT4ChangeLogRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNT4ChangeLogRequest *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetNT4ChangeLogRequest"); + switch (level) { + case 1: + ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length2)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time2)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown3)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time4)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time6)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data1)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data2)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data1) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data1, r->length1)); + } + if (r->data2) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length2)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data2, r->length2)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNT4ChangeLogInfo1 *r) +{ + uint32_t _ptr_data1; + TALLOC_CTX *_mem_save_data1_0; + uint32_t _ptr_data2; + TALLOC_CTX *_mem_save_data2_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length1)); + if (r->length1 < 0 || r->length1 > 0x00A00000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length2)); + if (r->length2 < 0 || r->length2 > 0x00A00000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time2)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time4)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time6)); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data1)); + if (_ptr_data1) { + NDR_PULL_ALLOC(ndr, r->data1); + } else { + r->data1 = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data2)); + if (_ptr_data2) { + NDR_PULL_ALLOC(ndr, r->data2); + } else { + r->data2 = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data1) { + _mem_save_data1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data1, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data1)); + NDR_PULL_ALLOC_N(ndr, r->data1, ndr_get_array_size(ndr, &r->data1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data1, ndr_get_array_size(ndr, &r->data1))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data1_0, 0); + } + if (r->data2) { + _mem_save_data2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data2, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data2)); + NDR_PULL_ALLOC_N(ndr, r->data2, ndr_get_array_size(ndr, &r->data2)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data2, ndr_get_array_size(ndr, &r->data2))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data2_0, 0); + } + if (r->data1) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data1, r->length1)); + } + if (r->data2) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data2, r->length2)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLogInfo1"); + ndr->depth++; + ndr_print_uint32(ndr, "length1", r->length1); + ndr_print_uint32(ndr, "length2", r->length2); + ndr_print_hyper(ndr, "unknown1", r->unknown1); + ndr_print_NTTIME(ndr, "time2", r->time2); + ndr_print_hyper(ndr, "unknown3", r->unknown3); + ndr_print_NTTIME(ndr, "time4", r->time4); + ndr_print_hyper(ndr, "unknown5", r->unknown5); + ndr_print_NTTIME(ndr, "time6", r->time6); + ndr_print_NTSTATUS(ndr, "status", r->status); + ndr_print_ptr(ndr, "data1", r->data1); + ndr->depth++; + if (r->data1) { + ndr_print_array_uint8(ndr, "data1", r->data1, r->length1); + } + ndr->depth--; + ndr_print_ptr(ndr, "data2", r->data2); + ndr->depth++; + if (r->data2) { + ndr_print_array_uint8(ndr, "data2", r->data2, r->length2); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNT4ChangeLogInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNT4ChangeLogInfo *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetNT4ChangeLogInfo"); + switch (level) { + case 1: + ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(ndr, "info1", &r->info1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsNameStatus(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameStatus r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsNameStatus(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameStatus *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsNameStatus(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameStatus r) +{ + const char *val = NULL; + + switch (r) { + case DRSUAPI_DS_NAME_STATUS_OK: val = "DRSUAPI_DS_NAME_STATUS_OK"; break; + case DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR: val = "DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR"; break; + case DRSUAPI_DS_NAME_STATUS_NOT_FOUND: val = "DRSUAPI_DS_NAME_STATUS_NOT_FOUND"; break; + case DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE: val = "DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE"; break; + case DRSUAPI_DS_NAME_STATUS_NO_MAPPING: val = "DRSUAPI_DS_NAME_STATUS_NO_MAPPING"; break; + case DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY: val = "DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY"; break; + case DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING: val = "DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING"; break; + case DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL: val = "DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_drsuapi_DsNameFlags(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameFlags r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsNameFlags(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameFlags *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsNameFlags(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFlags r) +{ + const char *val = NULL; + + switch (r) { + case DRSUAPI_DS_NAME_FLAG_NO_FLAGS: val = "DRSUAPI_DS_NAME_FLAG_NO_FLAGS"; break; + case DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY: val = "DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY"; break; + case DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC: val = "DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC"; break; + case DRSUAPI_DS_NAME_FLAG_GCVERIFY: val = "DRSUAPI_DS_NAME_FLAG_GCVERIFY"; break; + case DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL: val = "DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_drsuapi_DsNameFormat(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameFormat r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsNameFormat(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameFormat *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsNameFormat(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFormat r) +{ + const char *val = NULL; + + switch (r) { + case DRSUAPI_DS_NAME_FORMAT_UNKNOWN: val = "DRSUAPI_DS_NAME_FORMAT_UNKNOWN"; break; + case DRSUAPI_DS_NAME_FORMAT_FQDN_1779: val = "DRSUAPI_DS_NAME_FORMAT_FQDN_1779"; break; + case DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT: val = "DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT"; break; + case DRSUAPI_DS_NAME_FORMAT_DISPLAY: val = "DRSUAPI_DS_NAME_FORMAT_DISPLAY"; break; + case DRSUAPI_DS_NAME_FORMAT_GUID: val = "DRSUAPI_DS_NAME_FORMAT_GUID"; break; + case DRSUAPI_DS_NAME_FORMAT_CANONICAL: val = "DRSUAPI_DS_NAME_FORMAT_CANONICAL"; break; + case DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL: val = "DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL"; break; + case DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX: val = "DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX"; break; + case DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL: val = "DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL"; break; + case DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY: val = "DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY"; break; + case DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN: val = "DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_drsuapi_DsNameString(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameString *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->str)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->str) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->str, ndr_charset_length(r->str, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsNameString(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameString *r) +{ + uint32_t _ptr_str; + TALLOC_CTX *_mem_save_str_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_str)); + if (_ptr_str) { + NDR_PULL_ALLOC(ndr, r->str); + } else { + r->str = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->str) { + _mem_save_str_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->str, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->str)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->str)); + if (ndr_get_array_length(ndr, &r->str) > ndr_get_array_size(ndr, &r->str)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->str), ndr_get_array_length(ndr, &r->str)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->str), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->str, ndr_get_array_length(ndr, &r->str), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_str_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsNameString(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameString *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsNameString"); + ndr->depth++; + ndr_print_ptr(ndr, "str", r->str); + ndr->depth++; + if (r->str) { + ndr_print_string(ndr, "str", r->str); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsNameRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameRequest1 *r) +{ + uint32_t cntr_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->codepage)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->language)); + NDR_CHECK(ndr_push_drsuapi_DsNameFlags(ndr, NDR_SCALARS, r->format_flags)); + NDR_CHECK(ndr_push_drsuapi_DsNameFormat(ndr, NDR_SCALARS, r->format_offered)); + NDR_CHECK(ndr_push_drsuapi_DsNameFormat(ndr, NDR_SCALARS, r->format_desired)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsNameRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameRequest1 *r) +{ + uint32_t _ptr_names; + uint32_t cntr_names_1; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->codepage)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->language)); + NDR_CHECK(ndr_pull_drsuapi_DsNameFlags(ndr, NDR_SCALARS, &r->format_flags)); + NDR_CHECK(ndr_pull_drsuapi_DsNameFormat(ndr, NDR_SCALARS, &r->format_offered)); + NDR_CHECK(ndr_pull_drsuapi_DsNameFormat(ndr, NDR_SCALARS, &r->format_desired)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 1 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); + if (_ptr_names) { + NDR_PULL_ALLOC(ndr, r->names); + } else { + r->names = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); + NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); + _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + } + if (r->names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsNameRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameRequest1 *r) +{ + uint32_t cntr_names_1; + ndr_print_struct(ndr, name, "drsuapi_DsNameRequest1"); + ndr->depth++; + ndr_print_uint32(ndr, "codepage", r->codepage); + ndr_print_uint32(ndr, "language", r->language); + ndr_print_drsuapi_DsNameFlags(ndr, "format_flags", r->format_flags); + ndr_print_drsuapi_DsNameFormat(ndr, "format_offered", r->format_offered); + ndr_print_drsuapi_DsNameFormat(ndr, "format_desired", r->format_desired); + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "names", r->names); + ndr->depth++; + if (r->names) { + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); + ndr->depth++; + for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { + ndr_print_drsuapi_DsNameString(ndr, "names", &r->names[cntr_names_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsNameRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsNameRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsNameRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsNameRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsNameRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsNameRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsNameRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsNameRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsNameRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsNameRequest"); + switch (level) { + case 1: + ndr_print_drsuapi_DsNameRequest1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsNameInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_DsNameStatus(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_domain_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->result_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dns_domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_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->dns_domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_domain_name, ndr_charset_length(r->dns_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->result_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->result_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->result_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->result_name, ndr_charset_length(r->result_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsNameInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameInfo1 *r) +{ + uint32_t _ptr_dns_domain_name; + TALLOC_CTX *_mem_save_dns_domain_name_0; + uint32_t _ptr_result_name; + TALLOC_CTX *_mem_save_result_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_DsNameStatus(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_domain_name)); + if (_ptr_dns_domain_name) { + NDR_PULL_ALLOC(ndr, r->dns_domain_name); + } else { + r->dns_domain_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_result_name)); + if (_ptr_result_name) { + NDR_PULL_ALLOC(ndr, r->result_name); + } else { + r->result_name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dns_domain_name) { + _mem_save_dns_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dns_domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_domain_name)); + if (ndr_get_array_length(ndr, &r->dns_domain_name) > ndr_get_array_size(ndr, &r->dns_domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_domain_name), ndr_get_array_length(ndr, &r->dns_domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_domain_name, ndr_get_array_length(ndr, &r->dns_domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_domain_name_0, 0); + } + if (r->result_name) { + _mem_save_result_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->result_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->result_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->result_name)); + if (ndr_get_array_length(ndr, &r->result_name) > ndr_get_array_size(ndr, &r->result_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->result_name), ndr_get_array_length(ndr, &r->result_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->result_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->result_name, ndr_get_array_length(ndr, &r->result_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_result_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsNameInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameInfo1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsNameInfo1"); + ndr->depth++; + ndr_print_drsuapi_DsNameStatus(ndr, "status", r->status); + ndr_print_ptr(ndr, "dns_domain_name", r->dns_domain_name); + ndr->depth++; + if (r->dns_domain_name) { + ndr_print_string(ndr, "dns_domain_name", r->dns_domain_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "result_name", r->result_name); + ndr->depth++; + if (r->result_name) { + ndr_print_string(ndr, "result_name", r->result_name); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsNameCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameCtr1 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsNameInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsNameInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsNameCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameCtr1 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsNameInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsNameInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsNameCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameCtr1 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "drsuapi_DsNameCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_drsuapi_DsNameInfo1(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsNameCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsNameCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + if (r->ctr1) { + NDR_CHECK(ndr_push_drsuapi_DsNameCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsNameCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsNameCtr *r) +{ + int level; + int32_t _level; + TALLOC_CTX *_mem_save_ctr1_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + uint32_t _ptr_ctr1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); + if (_ptr_ctr1) { + NDR_PULL_ALLOC(ndr, r->ctr1); + } else { + r->ctr1 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + if (r->ctr1) { + _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); + NDR_CHECK(ndr_pull_drsuapi_DsNameCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsNameCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsNameCtr"); + switch (level) { + case 1: + ndr_print_ptr(ndr, "ctr1", r->ctr1); + ndr->depth++; + if (r->ctr1) { + ndr_print_drsuapi_DsNameCtr1(ndr, "ctr1", r->ctr1); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsSpnOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsSpnOperation r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsSpnOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsSpnOperation *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsSpnOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsSpnOperation r) +{ + const char *val = NULL; + + switch (r) { + case DRSUAPI_DS_SPN_OPERATION_ADD: val = "DRSUAPI_DS_SPN_OPERATION_ADD"; break; + case DRSUAPI_DS_SPN_OPERATION_REPLACE: val = "DRSUAPI_DS_SPN_OPERATION_REPLACE"; break; + case DRSUAPI_DS_SPN_OPERATION_DELETE: val = "DRSUAPI_DS_SPN_OPERATION_DELETE"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsWriteAccountSpnRequest1 *r) +{ + uint32_t cntr_spn_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_DsSpnOperation(ndr, NDR_SCALARS, r->operation)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->spn_names)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->object_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->spn_names) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) { + NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->spn_names[cntr_spn_names_1])); + } + for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) { + NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->spn_names[cntr_spn_names_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsWriteAccountSpnRequest1 *r) +{ + uint32_t _ptr_object_dn; + TALLOC_CTX *_mem_save_object_dn_0; + uint32_t _ptr_spn_names; + uint32_t cntr_spn_names_1; + TALLOC_CTX *_mem_save_spn_names_0; + TALLOC_CTX *_mem_save_spn_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_DsSpnOperation(ndr, NDR_SCALARS, &r->operation)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); + if (_ptr_object_dn) { + NDR_PULL_ALLOC(ndr, r->object_dn); + } else { + r->object_dn = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_spn_names)); + if (_ptr_spn_names) { + NDR_PULL_ALLOC(ndr, r->spn_names); + } else { + r->spn_names = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->object_dn) { + _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); + if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); + } + if (r->spn_names) { + _mem_save_spn_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->spn_names, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->spn_names)); + NDR_PULL_ALLOC_N(ndr, r->spn_names, ndr_get_array_size(ndr, &r->spn_names)); + _mem_save_spn_names_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->spn_names, 0); + for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->spn_names[cntr_spn_names_1])); + } + for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->spn_names[cntr_spn_names_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_spn_names_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_spn_names_0, 0); + } + if (r->spn_names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->spn_names, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnRequest1 *r) +{ + uint32_t cntr_spn_names_1; + ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpnRequest1"); + ndr->depth++; + ndr_print_drsuapi_DsSpnOperation(ndr, "operation", r->operation); + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_ptr(ndr, "object_dn", r->object_dn); + ndr->depth++; + if (r->object_dn) { + ndr_print_string(ndr, "object_dn", r->object_dn); + } + ndr->depth--; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "spn_names", r->spn_names); + ndr->depth++; + if (r->spn_names) { + ndr->print(ndr, "%s: ARRAY(%d)", "spn_names", (int)r->count); + ndr->depth++; + for (cntr_spn_names_1=0;cntr_spn_names_1count;cntr_spn_names_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_spn_names_1) != -1) { + ndr_print_drsuapi_DsNameString(ndr, "spn_names", &r->spn_names[cntr_spn_names_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsWriteAccountSpnRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsWriteAccountSpnRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsWriteAccountSpnRequest"); + switch (level) { + case 1: + ndr_print_drsuapi_DsWriteAccountSpnRequest1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnResult1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsWriteAccountSpnResult1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnResult1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsWriteAccountSpnResult1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnResult1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpnResult1"); + ndr->depth++; + ndr_print_WERROR(ndr, "status", r->status); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnResult(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsWriteAccountSpnResult *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnResult1(ndr, NDR_SCALARS, &r->res1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnResult(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsWriteAccountSpnResult *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnResult1(ndr, NDR_SCALARS, &r->res1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnResult *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsWriteAccountSpnResult"); + switch (level) { + case 1: + ndr_print_drsuapi_DsWriteAccountSpnResult1(ndr, "res1", &r->res1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsRemoveDSServerRequest1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_dn)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->commit)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_dn, ndr_charset_length(r->domain_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsRemoveDSServerRequest1 *r) +{ + uint32_t _ptr_server_dn; + TALLOC_CTX *_mem_save_server_dn_0; + uint32_t _ptr_domain_dn; + TALLOC_CTX *_mem_save_domain_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn)); + if (_ptr_server_dn) { + NDR_PULL_ALLOC(ndr, r->server_dn); + } else { + r->server_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_dn)); + if (_ptr_domain_dn) { + NDR_PULL_ALLOC(ndr, r->domain_dn); + } else { + r->domain_dn = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->commit)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_dn) { + _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn)); + if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0); + } + if (r->domain_dn) { + _mem_save_domain_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_dn)); + if (ndr_get_array_length(ndr, &r->domain_dn) > ndr_get_array_size(ndr, &r->domain_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_dn), ndr_get_array_length(ndr, &r->domain_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_dn, ndr_get_array_length(ndr, &r->domain_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerRequest1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServerRequest1"); + ndr->depth++; + ndr_print_ptr(ndr, "server_dn", r->server_dn); + ndr->depth++; + if (r->server_dn) { + ndr_print_string(ndr, "server_dn", r->server_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_dn", r->domain_dn); + ndr->depth++; + if (r->domain_dn) { + ndr_print_string(ndr, "domain_dn", r->domain_dn); + } + ndr->depth--; + ndr_print_uint32(ndr, "commit", r->commit); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRemoveDSServerRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRemoveDSServerRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsRemoveDSServerRequest"); + switch (level) { + case 1: + ndr_print_drsuapi_DsRemoveDSServerRequest1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerResult1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsRemoveDSServerResult1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->last_dc_in_domain)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerResult1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsRemoveDSServerResult1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->last_dc_in_domain)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerResult1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServerResult1"); + ndr->depth++; + ndr_print_uint32(ndr, "last_dc_in_domain", r->last_dc_in_domain); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerResult(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRemoveDSServerResult *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerResult1(ndr, NDR_SCALARS, &r->res1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerResult(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRemoveDSServerResult *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerResult1(ndr, NDR_SCALARS, &r->res1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerResult *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsRemoveDSServerResult"); + switch (level) { + case 1: + ndr_print_drsuapi_DsRemoveDSServerResult1(ndr, "res1", &r->res1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoRequest1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->level)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoRequest1 *r) +{ + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_domain_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->domain_name); + } else { + r->domain_name = NULL; + } + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->level)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); + if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoRequest1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoRequest1"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_name", r->domain_name); + ndr->depth++; + if (r->domain_name) { + ndr_print_string(ndr, "domain_name", r->domain_name); + } + ndr->depth--; + ndr_print_int32(ndr, "level", r->level); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetDCInfoRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetDCInfoRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetDCInfoRequest"); + switch (level) { + case 1: + ndr_print_drsuapi_DsGetDCInfoRequest1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->dns_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->site_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->computer_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->server_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo1 *r) +{ + uint32_t _ptr_netbios_name; + TALLOC_CTX *_mem_save_netbios_name_0; + uint32_t _ptr_dns_name; + TALLOC_CTX *_mem_save_dns_name_0; + uint32_t _ptr_site_name; + TALLOC_CTX *_mem_save_site_name_0; + uint32_t _ptr_computer_dn; + TALLOC_CTX *_mem_save_computer_dn_0; + uint32_t _ptr_server_dn; + TALLOC_CTX *_mem_save_server_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name)); + if (_ptr_netbios_name) { + NDR_PULL_ALLOC(ndr, r->netbios_name); + } else { + r->netbios_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name)); + if (_ptr_dns_name) { + NDR_PULL_ALLOC(ndr, r->dns_name); + } else { + r->dns_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); + if (_ptr_site_name) { + NDR_PULL_ALLOC(ndr, r->site_name); + } else { + r->site_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn)); + if (_ptr_computer_dn) { + NDR_PULL_ALLOC(ndr, r->computer_dn); + } else { + r->computer_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn)); + if (_ptr_server_dn) { + NDR_PULL_ALLOC(ndr, r->server_dn); + } else { + r->server_dn = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_name) { + _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name)); + if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0); + } + if (r->dns_name) { + _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name)); + if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0); + } + if (r->site_name) { + _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name)); + if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_name), ndr_get_array_length(ndr, &r->site_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); + } + if (r->computer_dn) { + _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn)); + if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer_dn), ndr_get_array_length(ndr, &r->computer_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0); + } + if (r->server_dn) { + _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn)); + if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo1"); + ndr->depth++; + ndr_print_ptr(ndr, "netbios_name", r->netbios_name); + ndr->depth++; + if (r->netbios_name) { + ndr_print_string(ndr, "netbios_name", r->netbios_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "dns_name", r->dns_name); + ndr->depth++; + if (r->dns_name) { + ndr_print_string(ndr, "dns_name", r->dns_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "site_name", r->site_name); + ndr->depth++; + if (r->site_name) { + ndr_print_string(ndr, "site_name", r->site_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "computer_dn", r->computer_dn); + ndr->depth++; + if (r->computer_dn) { + ndr_print_string(ndr, "computer_dn", r->computer_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "server_dn", r->server_dn); + ndr->depth++; + if (r->server_dn) { + ndr_print_string(ndr, "server_dn", r->server_dn); + } + ndr->depth--; + ndr_print_uint32(ndr, "is_pdc", r->is_pdc); + ndr_print_uint32(ndr, "is_enabled", r->is_enabled); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr1 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr1 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr1 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_drsuapi_DsGetDCInfo1(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ntds_dn)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_gc)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->computer_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->server_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->ntds_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->dns_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->site_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->site_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_dn, ndr_charset_length(r->site_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->computer_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->server_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->ntds_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ntds_dn, ndr_charset_length(r->ntds_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo2 *r) +{ + uint32_t _ptr_netbios_name; + TALLOC_CTX *_mem_save_netbios_name_0; + uint32_t _ptr_dns_name; + TALLOC_CTX *_mem_save_dns_name_0; + uint32_t _ptr_site_name; + TALLOC_CTX *_mem_save_site_name_0; + uint32_t _ptr_site_dn; + TALLOC_CTX *_mem_save_site_dn_0; + uint32_t _ptr_computer_dn; + TALLOC_CTX *_mem_save_computer_dn_0; + uint32_t _ptr_server_dn; + TALLOC_CTX *_mem_save_server_dn_0; + uint32_t _ptr_ntds_dn; + TALLOC_CTX *_mem_save_ntds_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name)); + if (_ptr_netbios_name) { + NDR_PULL_ALLOC(ndr, r->netbios_name); + } else { + r->netbios_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name)); + if (_ptr_dns_name) { + NDR_PULL_ALLOC(ndr, r->dns_name); + } else { + r->dns_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); + if (_ptr_site_name) { + NDR_PULL_ALLOC(ndr, r->site_name); + } else { + r->site_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_dn)); + if (_ptr_site_dn) { + NDR_PULL_ALLOC(ndr, r->site_dn); + } else { + r->site_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn)); + if (_ptr_computer_dn) { + NDR_PULL_ALLOC(ndr, r->computer_dn); + } else { + r->computer_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn)); + if (_ptr_server_dn) { + NDR_PULL_ALLOC(ndr, r->server_dn); + } else { + r->server_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ntds_dn)); + if (_ptr_ntds_dn) { + NDR_PULL_ALLOC(ndr, r->ntds_dn); + } else { + r->ntds_dn = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_gc)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->computer_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->server_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->ntds_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_name) { + _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name)); + if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0); + } + if (r->dns_name) { + _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name)); + if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0); + } + if (r->site_name) { + _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name)); + if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_name), ndr_get_array_length(ndr, &r->site_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); + } + if (r->site_dn) { + _mem_save_site_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->site_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->site_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->site_dn)); + if (ndr_get_array_length(ndr, &r->site_dn) > ndr_get_array_size(ndr, &r->site_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_dn), ndr_get_array_length(ndr, &r->site_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_dn, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_dn_0, 0); + } + if (r->computer_dn) { + _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn)); + if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer_dn), ndr_get_array_length(ndr, &r->computer_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0); + } + if (r->server_dn) { + _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn)); + if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0); + } + if (r->ntds_dn) { + _mem_save_ntds_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ntds_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->ntds_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->ntds_dn)); + if (ndr_get_array_length(ndr, &r->ntds_dn) > ndr_get_array_size(ndr, &r->ntds_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->ntds_dn), ndr_get_array_length(ndr, &r->ntds_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ntds_dn, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ntds_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo2 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "netbios_name", r->netbios_name); + ndr->depth++; + if (r->netbios_name) { + ndr_print_string(ndr, "netbios_name", r->netbios_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "dns_name", r->dns_name); + ndr->depth++; + if (r->dns_name) { + ndr_print_string(ndr, "dns_name", r->dns_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "site_name", r->site_name); + ndr->depth++; + if (r->site_name) { + ndr_print_string(ndr, "site_name", r->site_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "site_dn", r->site_dn); + ndr->depth++; + if (r->site_dn) { + ndr_print_string(ndr, "site_dn", r->site_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "computer_dn", r->computer_dn); + ndr->depth++; + if (r->computer_dn) { + ndr_print_string(ndr, "computer_dn", r->computer_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "server_dn", r->server_dn); + ndr->depth++; + if (r->server_dn) { + ndr_print_string(ndr, "server_dn", r->server_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "ntds_dn", r->ntds_dn); + ndr->depth++; + if (r->ntds_dn) { + ndr_print_string(ndr, "ntds_dn", r->ntds_dn); + } + ndr->depth--; + ndr_print_uint32(ndr, "is_pdc", r->is_pdc); + ndr_print_uint32(ndr, "is_enabled", r->is_enabled); + ndr_print_uint32(ndr, "is_gc", r->is_gc); + ndr_print_GUID(ndr, "site_guid", &r->site_guid); + ndr_print_GUID(ndr, "computer_guid", &r->computer_guid); + ndr_print_GUID(ndr, "server_guid", &r->server_guid); + ndr_print_GUID(ndr, "ntds_guid", &r->ntds_guid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr2 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr2 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr2 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_drsuapi_DsGetDCInfo2(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ntds_dn)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_gc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_rodc)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->computer_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->server_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->ntds_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->dns_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->site_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->site_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_dn, ndr_charset_length(r->site_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->computer_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->server_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->ntds_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ntds_dn, ndr_charset_length(r->ntds_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo3 *r) +{ + uint32_t _ptr_netbios_name; + TALLOC_CTX *_mem_save_netbios_name_0; + uint32_t _ptr_dns_name; + TALLOC_CTX *_mem_save_dns_name_0; + uint32_t _ptr_site_name; + TALLOC_CTX *_mem_save_site_name_0; + uint32_t _ptr_site_dn; + TALLOC_CTX *_mem_save_site_dn_0; + uint32_t _ptr_computer_dn; + TALLOC_CTX *_mem_save_computer_dn_0; + uint32_t _ptr_server_dn; + TALLOC_CTX *_mem_save_server_dn_0; + uint32_t _ptr_ntds_dn; + TALLOC_CTX *_mem_save_ntds_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name)); + if (_ptr_netbios_name) { + NDR_PULL_ALLOC(ndr, r->netbios_name); + } else { + r->netbios_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name)); + if (_ptr_dns_name) { + NDR_PULL_ALLOC(ndr, r->dns_name); + } else { + r->dns_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); + if (_ptr_site_name) { + NDR_PULL_ALLOC(ndr, r->site_name); + } else { + r->site_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_dn)); + if (_ptr_site_dn) { + NDR_PULL_ALLOC(ndr, r->site_dn); + } else { + r->site_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn)); + if (_ptr_computer_dn) { + NDR_PULL_ALLOC(ndr, r->computer_dn); + } else { + r->computer_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn)); + if (_ptr_server_dn) { + NDR_PULL_ALLOC(ndr, r->server_dn); + } else { + r->server_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ntds_dn)); + if (_ptr_ntds_dn) { + NDR_PULL_ALLOC(ndr, r->ntds_dn); + } else { + r->ntds_dn = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_gc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_rodc)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->computer_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->server_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->ntds_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_name) { + _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name)); + if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0); + } + if (r->dns_name) { + _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name)); + if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0); + } + if (r->site_name) { + _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name)); + if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_name), ndr_get_array_length(ndr, &r->site_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); + } + if (r->site_dn) { + _mem_save_site_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->site_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->site_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->site_dn)); + if (ndr_get_array_length(ndr, &r->site_dn) > ndr_get_array_size(ndr, &r->site_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_dn), ndr_get_array_length(ndr, &r->site_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_dn, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_dn_0, 0); + } + if (r->computer_dn) { + _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn)); + if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer_dn), ndr_get_array_length(ndr, &r->computer_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0); + } + if (r->server_dn) { + _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn)); + if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0); + } + if (r->ntds_dn) { + _mem_save_ntds_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ntds_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->ntds_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->ntds_dn)); + if (ndr_get_array_length(ndr, &r->ntds_dn) > ndr_get_array_size(ndr, &r->ntds_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->ntds_dn), ndr_get_array_length(ndr, &r->ntds_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ntds_dn, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ntds_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo3 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo3"); + ndr->depth++; + ndr_print_ptr(ndr, "netbios_name", r->netbios_name); + ndr->depth++; + if (r->netbios_name) { + ndr_print_string(ndr, "netbios_name", r->netbios_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "dns_name", r->dns_name); + ndr->depth++; + if (r->dns_name) { + ndr_print_string(ndr, "dns_name", r->dns_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "site_name", r->site_name); + ndr->depth++; + if (r->site_name) { + ndr_print_string(ndr, "site_name", r->site_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "site_dn", r->site_dn); + ndr->depth++; + if (r->site_dn) { + ndr_print_string(ndr, "site_dn", r->site_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "computer_dn", r->computer_dn); + ndr->depth++; + if (r->computer_dn) { + ndr_print_string(ndr, "computer_dn", r->computer_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "server_dn", r->server_dn); + ndr->depth++; + if (r->server_dn) { + ndr_print_string(ndr, "server_dn", r->server_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "ntds_dn", r->ntds_dn); + ndr->depth++; + if (r->ntds_dn) { + ndr_print_string(ndr, "ntds_dn", r->ntds_dn); + } + ndr->depth--; + ndr_print_uint32(ndr, "is_pdc", r->is_pdc); + ndr_print_uint32(ndr, "is_enabled", r->is_enabled); + ndr_print_uint32(ndr, "is_gc", r->is_gc); + ndr_print_uint32(ndr, "is_rodc", r->is_rodc); + ndr_print_GUID(ndr, "site_guid", &r->site_guid); + ndr_print_GUID(ndr, "computer_guid", &r->computer_guid); + ndr_print_GUID(ndr, "server_guid", &r->server_guid); + ndr_print_GUID(ndr, "ntds_guid", &r->ntds_guid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr3 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr3 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr3 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr3"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_drsuapi_DsGetDCInfo3(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCConnection01(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCConnection01 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_ipv4address = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->client_ip_address)); + ndr->flags = _flags_save_ipv4address; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->connection_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_account)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client_account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_account, ndr_charset_length(r->client_account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCConnection01(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCConnection01 *r) +{ + uint32_t _ptr_client_account; + TALLOC_CTX *_mem_save_client_account_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_ipv4address = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->client_ip_address)); + ndr->flags = _flags_save_ipv4address; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->connection_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_account)); + if (_ptr_client_account) { + NDR_PULL_ALLOC(ndr, r->client_account); + } else { + r->client_account = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client_account) { + _mem_save_client_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->client_account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->client_account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->client_account)); + if (ndr_get_array_length(ndr, &r->client_account) > ndr_get_array_size(ndr, &r->client_account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_account), ndr_get_array_length(ndr, &r->client_account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_account, ndr_get_array_length(ndr, &r->client_account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCConnection01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnection01 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetDCConnection01"); + ndr->depth++; + ndr_print_ipv4address(ndr, "client_ip_address", r->client_ip_address); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr_print_uint32(ndr, "connection_time", r->connection_time); + ndr_print_uint32(ndr, "unknown4", r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_ptr(ndr, "client_account", r->client_account); + ndr->depth++; + if (r->client_account) { + ndr_print_string(ndr, "client_account", r->client_account); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCConnectionCtr01(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCConnectionCtr01 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsGetDCConnection01(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_drsuapi_DsGetDCConnection01(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCConnectionCtr01(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCConnectionCtr01 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnection01(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnection01(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCConnectionCtr01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnectionCtr01 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "drsuapi_DsGetDCConnectionCtr01"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_drsuapi_DsGetDCConnection01(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetDCInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case DRSUAPI_DC_INFO_CTR_1: { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + case DRSUAPI_DC_INFO_CTR_2: { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr2(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + case DRSUAPI_DC_INFO_CTR_3: { + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr3(ndr, NDR_SCALARS, &r->ctr3)); + break; } + + case DRSUAPI_DC_CONNECTION_CTR_01: { + NDR_CHECK(ndr_push_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_SCALARS, &r->ctr01)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case DRSUAPI_DC_INFO_CTR_1: + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + case DRSUAPI_DC_INFO_CTR_2: + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr2(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case DRSUAPI_DC_INFO_CTR_3: + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr3(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + case DRSUAPI_DC_CONNECTION_CTR_01: + NDR_CHECK(ndr_push_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_BUFFERS, &r->ctr01)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetDCInfoCtr *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case DRSUAPI_DC_INFO_CTR_1: { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + case DRSUAPI_DC_INFO_CTR_2: { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr2(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + case DRSUAPI_DC_INFO_CTR_3: { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr3(ndr, NDR_SCALARS, &r->ctr3)); + break; } + + case DRSUAPI_DC_CONNECTION_CTR_01: { + NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_SCALARS, &r->ctr01)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case DRSUAPI_DC_INFO_CTR_1: + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + case DRSUAPI_DC_INFO_CTR_2: + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr2(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case DRSUAPI_DC_INFO_CTR_3: + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr3(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + case DRSUAPI_DC_CONNECTION_CTR_01: + NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_BUFFERS, &r->ctr01)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetDCInfoCtr"); + switch (level) { + case DRSUAPI_DC_INFO_CTR_1: + ndr_print_drsuapi_DsGetDCInfoCtr1(ndr, "ctr1", &r->ctr1); + break; + + case DRSUAPI_DC_INFO_CTR_2: + ndr_print_drsuapi_DsGetDCInfoCtr2(ndr, "ctr2", &r->ctr2); + break; + + case DRSUAPI_DC_INFO_CTR_3: + ndr_print_drsuapi_DsGetDCInfoCtr3(ndr, "ctr3", &r->ctr3); + break; + + case DRSUAPI_DC_CONNECTION_CTR_01: + ndr_print_drsuapi_DsGetDCConnectionCtr01(ndr, "ctr01", &r->ctr01); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItem(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItem *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->next_object) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object)); + } + NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItem(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItem *r) +{ + uint32_t _ptr_next_object; + TALLOC_CTX *_mem_save_next_object_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object)); + if (_ptr_next_object) { + NDR_PULL_ALLOC(ndr, r->next_object); + } else { + r->next_object = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->next_object) { + _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0); + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryRequest2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryRequest2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS, &r->first_object)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_BUFFERS, &r->first_object)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryRequest2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryRequest2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS, &r->first_object)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_BUFFERS, &r->first_object)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryRequest2 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsAddEntryRequest2"); + ndr->depth++; + ndr_print_drsuapi_DsReplicaObjectListItem(ndr, "first_object", &r->first_object); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 2: { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest2(ndr, NDR_SCALARS, &r->req2)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 2: + NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest2(ndr, NDR_BUFFERS, &r->req2)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 2: { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest2(ndr, NDR_SCALARS, &r->req2)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 2: + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest2(ndr, NDR_BUFFERS, &r->req2)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryRequest"); + switch (level) { + case 2: + ndr_print_drsuapi_DsAddEntryRequest2(ndr, "req2", &r->req2); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfoX(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorInfoX *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown3)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfoX(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorInfoX *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown3)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfoX(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfoX *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorInfoX"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_WERROR(ndr, "status", r->status); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr_print_uint16(ndr, "unknown3", r->unknown3); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryExtraErrorBuffer *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->size)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryExtraErrorBuffer *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + if (r->size < 0 || r->size > 10485760) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraErrorBuffer *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsAddEntryExtraErrorBuffer"); + ndr->depth++; + ndr_print_uint32(ndr, "size", r->size); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->size); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryExtraError1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryExtraError1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error)); + NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_SCALARS, &r->buffer)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_BUFFERS, &r->buffer)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryExtraError1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryExtraError1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error)); + NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_SCALARS, &r->buffer)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_BUFFERS, &r->buffer)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryExtraError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraError1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsAddEntryExtraError1"); + ndr->depth++; + ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "error", &r->error); + ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(ndr, "buffer", &r->buffer); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorListItem1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorListItem1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->next)); + NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraError1(ndr, NDR_SCALARS, &r->error)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->next) { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS|NDR_BUFFERS, r->next)); + } + NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraError1(ndr, NDR_BUFFERS, &r->error)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorListItem1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorListItem1 *r) +{ + uint32_t _ptr_next; + TALLOC_CTX *_mem_save_next_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next)); + if (_ptr_next) { + NDR_PULL_ALLOC(ndr, r->next); + } else { + r->next = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraError1(ndr, NDR_SCALARS, &r->error)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->next) { + _mem_save_next_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->next, 0); + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS|NDR_BUFFERS, r->next)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_0, 0); + } + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraError1(ndr, NDR_BUFFERS, &r->error)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorListItem1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorListItem1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorListItem1"); + ndr->depth++; + ndr_print_ptr(ndr, "next", r->next); + ndr->depth++; + if (r->next) { + ndr_print_drsuapi_DsAddEntryErrorListItem1(ndr, "next", r->next); + } + ndr->depth--; + ndr_print_drsuapi_DsAddEntryExtraError1(ndr, "error", &r->error); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->id)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS, &r->first)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->id) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); + } + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_BUFFERS, &r->first)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorInfo1 *r) +{ + uint32_t _ptr_id; + TALLOC_CTX *_mem_save_id_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id)); + if (_ptr_id) { + NDR_PULL_ALLOC(ndr, r->id); + } else { + r->id = NULL; + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS, &r->first)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->id) { + _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->id, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0); + } + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_BUFFERS, &r->first)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfo1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorInfo1"); + ndr->depth++; + ndr_print_ptr(ndr, "id", r->id); + ndr->depth++; + if (r->id) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id); + } + ndr->depth--; + ndr_print_WERROR(ndr, "status", r->status); + ndr_print_drsuapi_DsAddEntryErrorListItem1(ndr, "first", &r->first); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryErrorInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_SCALARS, &r->error1)); + break; } + + case 4: { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); + break; } + + case 5: { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); + break; } + + case 6: { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); + break; } + + case 7: { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_BUFFERS, &r->error1)); + break; + + case 4: + break; + + case 5: + break; + + case 6: + break; + + case 7: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryErrorInfo *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_SCALARS, &r->error1)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); + break; } + + case 5: { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); + break; } + + case 6: { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); + break; } + + case 7: { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_BUFFERS, &r->error1)); + break; + + case 4: + break; + + case 5: + break; + + case 6: + break; + + case 7: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryErrorInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryErrorInfo"); + switch (level) { + case 1: + ndr_print_drsuapi_DsAddEntryErrorInfo1(ndr, "error1", &r->error1); + break; + + case 4: + ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX); + break; + + case 5: + ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX); + break; + + case 6: + ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX); + break; + + case 7: + ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryError1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryError1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, r->info, r->level)); + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryError1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryError1 *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->info); + } else { + r->info = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->info, r->level)); + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryError1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsAddEntryError1"); + ndr->depth++; + ndr_print_WERROR(ndr, "status", r->status); + ndr_print_uint32(ndr, "level", r->level); + ndr_print_ptr(ndr, "info", r->info); + ndr->depth++; + if (r->info) { + ndr_print_set_switch_value(ndr, r->info, r->level); + ndr_print_drsuapi_DsAddEntryErrorInfo(ndr, "info", r->info); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryError(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryError *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryError1(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsAddEntryError1(ndr, NDR_BUFFERS, &r->info1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryError(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryError *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError1(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError1(ndr, NDR_BUFFERS, &r->info1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryError(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryError *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryError"); + switch (level) { + case 1: + ndr_print_drsuapi_DsAddEntryError1(ndr, "info1", &r->info1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier2 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier2"); + ndr->depth++; + ndr_print_GUID(ndr, "guid", &r->guid); + ndr_print_dom_sid28(ndr, "sid", &r->sid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryCtr2 *r) +{ + uint32_t cntr_objects_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->id)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->objects)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->id) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); + } + if (r->objects) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1])); + } + for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryCtr2 *r) +{ + uint32_t _ptr_id; + TALLOC_CTX *_mem_save_id_0; + uint32_t _ptr_objects; + uint32_t cntr_objects_1; + TALLOC_CTX *_mem_save_objects_0; + TALLOC_CTX *_mem_save_objects_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id)); + if (_ptr_id) { + NDR_PULL_ALLOC(ndr, r->id); + } else { + r->id = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objects)); + if (_ptr_objects) { + NDR_PULL_ALLOC(ndr, r->objects); + } else { + r->objects = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->id) { + _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->id, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0); + } + if (r->objects) { + _mem_save_objects_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->objects)); + NDR_PULL_ALLOC_N(ndr, r->objects, ndr_get_array_size(ndr, &r->objects)); + _mem_save_objects_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0); + for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1])); + } + for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_0, 0); + } + if (r->objects) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->objects, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr2 *r) +{ + uint32_t cntr_objects_1; + ndr_print_struct(ndr, name, "drsuapi_DsAddEntryCtr2"); + ndr->depth++; + ndr_print_ptr(ndr, "id", r->id); + ndr->depth++; + if (r->id) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "error", &r->error); + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "objects", r->objects); + ndr->depth++; + if (r->objects) { + ndr->print(ndr, "%s: ARRAY(%d)", "objects", (int)r->count); + ndr->depth++; + for (cntr_objects_1=0;cntr_objects_1count;cntr_objects_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_objects_1) != -1) { + ndr_print_drsuapi_DsReplicaObjectIdentifier2(ndr, "objects", &r->objects[cntr_objects_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryCtr3 *r) +{ + uint32_t cntr_objects_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->id)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->error)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->objects)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->id) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); + } + if (r->error) { + NDR_CHECK(ndr_push_set_switch_value(ndr, r->error, r->level)); + NDR_CHECK(ndr_push_drsuapi_DsAddEntryError(ndr, NDR_SCALARS|NDR_BUFFERS, r->error)); + } + if (r->objects) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1])); + } + for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryCtr3 *r) +{ + uint32_t _ptr_id; + TALLOC_CTX *_mem_save_id_0; + uint32_t _ptr_error; + TALLOC_CTX *_mem_save_error_0; + uint32_t _ptr_objects; + uint32_t cntr_objects_1; + TALLOC_CTX *_mem_save_objects_0; + TALLOC_CTX *_mem_save_objects_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id)); + if (_ptr_id) { + NDR_PULL_ALLOC(ndr, r->id); + } else { + r->id = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_error)); + if (_ptr_error) { + NDR_PULL_ALLOC(ndr, r->error); + } else { + r->error = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objects)); + if (_ptr_objects) { + NDR_PULL_ALLOC(ndr, r->objects); + } else { + r->objects = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->id) { + _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->id, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0); + } + if (r->error) { + _mem_save_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->error, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->error, r->level)); + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError(ndr, NDR_SCALARS|NDR_BUFFERS, r->error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_error_0, 0); + } + if (r->objects) { + _mem_save_objects_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->objects)); + NDR_PULL_ALLOC_N(ndr, r->objects, ndr_get_array_size(ndr, &r->objects)); + _mem_save_objects_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0); + for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1])); + } + for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_0, 0); + } + if (r->objects) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->objects, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr3 *r) +{ + uint32_t cntr_objects_1; + ndr_print_struct(ndr, name, "drsuapi_DsAddEntryCtr3"); + ndr->depth++; + ndr_print_ptr(ndr, "id", r->id); + ndr->depth++; + if (r->id) { + ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_ptr(ndr, "error", r->error); + ndr->depth++; + if (r->error) { + ndr_print_set_switch_value(ndr, r->error, r->level); + ndr_print_drsuapi_DsAddEntryError(ndr, "error", r->error); + } + ndr->depth--; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "objects", r->objects); + ndr->depth++; + if (r->objects) { + ndr->print(ndr, "%s: ARRAY(%d)", "objects", (int)r->count); + ndr->depth++; + for (cntr_objects_1=0;cntr_objects_1count;cntr_objects_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_objects_1) != -1) { + ndr_print_drsuapi_DsReplicaObjectIdentifier2(ndr, "objects", &r->objects[cntr_objects_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 2: { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr2(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr3(ndr, NDR_SCALARS, &r->ctr3)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 2: + NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr2(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case 3: + NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr3(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryCtr *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 2: { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr2(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr3(ndr, NDR_SCALARS, &r->ctr3)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 2: + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr2(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case 3: + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr3(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryCtr"); + switch (level) { + case 2: + ndr_print_drsuapi_DsAddEntryCtr2(ndr, "ctr2", &r->ctr2); + break; + + case 3: + ndr_print_drsuapi_DsAddEntryCtr3(ndr, "ctr3", &r->ctr3); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoLevel(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaGetInfoLevel r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoLevel(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaGetInfoLevel *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoLevel(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaGetInfoLevel r) +{ + const char *val = NULL; + + switch (r) { + case DRSUAPI_DS_REPLICA_GET_INFO: val = "DRSUAPI_DS_REPLICA_GET_INFO"; break; + case DRSUAPI_DS_REPLICA_GET_INFO2: val = "DRSUAPI_DS_REPLICA_GET_INFO2"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaInfoType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaInfoType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaInfoType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaInfoType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaInfoType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaInfoType r) +{ + const char *val = NULL; + + switch (r) { + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: val = "DRSUAPI_DS_REPLICA_INFO_NEIGHBORS"; break; + case DRSUAPI_DS_REPLICA_INFO_CURSORS: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS"; break; + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: val = "DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA"; break; + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: val = "DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES"; break; + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: val = "DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES"; break; + case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: val = "DRSUAPI_DS_REPLICA_INFO_PENDING_OPS"; break; + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: val = "DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA"; break; + case DRSUAPI_DS_REPLICA_INFO_CURSORS2: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS2"; break; + case DRSUAPI_DS_REPLICA_INFO_CURSORS3: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS3"; break; + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: val = "DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2"; break; + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: val = "DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2"; break; + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: val = "DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02"; break; + case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: val = "DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04"; break; + case DRSUAPI_DS_REPLICA_INFO_CURSORS05: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS05"; break; + case DRSUAPI_DS_REPLICA_INFO_06: val = "DRSUAPI_DS_REPLICA_INFO_06"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaGetInfoRequest1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->info_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->object_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaGetInfoRequest1 *r) +{ + uint32_t _ptr_object_dn; + TALLOC_CTX *_mem_save_object_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, &r->info_type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); + if (_ptr_object_dn) { + NDR_PULL_ALLOC(ndr, r->object_dn); + } else { + r->object_dn = NULL; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->object_dn) { + _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); + if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest1 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfoRequest1"); + ndr->depth++; + ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", r->info_type); + ndr_print_ptr(ndr, "object_dn", r->object_dn); + ndr->depth++; + if (r->object_dn) { + ndr_print_string(ndr, "object_dn", r->object_dn); + } + ndr->depth--; + ndr_print_GUID(ndr, "guid1", &r->guid1); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaGetInfoRequest2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->info_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string1)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->object_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->string1) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string1, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string1, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string1, ndr_charset_length(r->string1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->string2) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string2, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string2, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string2, ndr_charset_length(r->string2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaGetInfoRequest2 *r) +{ + uint32_t _ptr_object_dn; + TALLOC_CTX *_mem_save_object_dn_0; + uint32_t _ptr_string1; + TALLOC_CTX *_mem_save_string1_0; + uint32_t _ptr_string2; + TALLOC_CTX *_mem_save_string2_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, &r->info_type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); + if (_ptr_object_dn) { + NDR_PULL_ALLOC(ndr, r->object_dn); + } else { + r->object_dn = NULL; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string1)); + if (_ptr_string1) { + NDR_PULL_ALLOC(ndr, r->string1); + } else { + r->string1 = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string2)); + if (_ptr_string2) { + NDR_PULL_ALLOC(ndr, r->string2); + } else { + r->string2 = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->object_dn) { + _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); + if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); + } + if (r->string1) { + _mem_save_string1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string1, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string1)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->string1)); + if (ndr_get_array_length(ndr, &r->string1) > ndr_get_array_size(ndr, &r->string1)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string1), ndr_get_array_length(ndr, &r->string1)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->string1), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string1, ndr_get_array_length(ndr, &r->string1), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string1_0, 0); + } + if (r->string2) { + _mem_save_string2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string2, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string2)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->string2)); + if (ndr_get_array_length(ndr, &r->string2) > ndr_get_array_size(ndr, &r->string2)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string2), ndr_get_array_length(ndr, &r->string2)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->string2), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string2, ndr_get_array_length(ndr, &r->string2), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string2_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest2 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfoRequest2"); + ndr->depth++; + ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", r->info_type); + ndr_print_ptr(ndr, "object_dn", r->object_dn); + ndr->depth++; + if (r->object_dn) { + ndr_print_string(ndr, "object_dn", r->object_dn); + } + ndr->depth--; + ndr_print_GUID(ndr, "guid1", &r->guid1); + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_ptr(ndr, "string1", r->string1); + ndr->depth++; + if (r->string1) { + ndr_print_string(ndr, "string1", r->string1); + } + ndr->depth--; + ndr_print_ptr(ndr, "string2", r->string2); + ndr->depth++; + if (r->string2) { + ndr_print_string(ndr, "string2", r->string2); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaGetInfoRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, level)); + switch (level) { + case DRSUAPI_DS_REPLICA_GET_INFO: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + case DRSUAPI_DS_REPLICA_GET_INFO2: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_SCALARS, &r->req2)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case DRSUAPI_DS_REPLICA_GET_INFO: + NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + case DRSUAPI_DS_REPLICA_GET_INFO2: + NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_BUFFERS, &r->req2)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaGetInfoRequest *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case DRSUAPI_DS_REPLICA_GET_INFO: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + case DRSUAPI_DS_REPLICA_GET_INFO2: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_SCALARS, &r->req2)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case DRSUAPI_DS_REPLICA_GET_INFO: + NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + case DRSUAPI_DS_REPLICA_GET_INFO2: + NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_BUFFERS, &r->req2)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaGetInfoRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsReplicaGetInfoRequest"); + switch (level) { + case DRSUAPI_DS_REPLICA_GET_INFO: + ndr_print_drsuapi_DsReplicaGetInfoRequest1(ndr, "req1", &r->req1); + break; + + case DRSUAPI_DS_REPLICA_GET_INFO2: + ndr_print_drsuapi_DsReplicaGetInfoRequest2(ndr, "req2", &r->req2); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbour(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaNeighbour *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_obj_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_address)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->transport_obj_dn)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->naming_context_obj_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->transport_obj_guid)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->tmp_highest_usn)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_success)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_attempt)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->result_last_attempt)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->consecutive_sync_failures)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->naming_context_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->naming_context_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->naming_context_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->naming_context_dn, ndr_charset_length(r->naming_context_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->source_dsa_obj_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_obj_dn, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->source_dsa_address) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_address, ndr_charset_length(r->source_dsa_address, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->transport_obj_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->transport_obj_dn, ndr_charset_length(r->transport_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbour(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaNeighbour *r) +{ + uint32_t _ptr_naming_context_dn; + TALLOC_CTX *_mem_save_naming_context_dn_0; + uint32_t _ptr_source_dsa_obj_dn; + TALLOC_CTX *_mem_save_source_dsa_obj_dn_0; + uint32_t _ptr_source_dsa_address; + TALLOC_CTX *_mem_save_source_dsa_address_0; + uint32_t _ptr_transport_obj_dn; + TALLOC_CTX *_mem_save_transport_obj_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context_dn)); + if (_ptr_naming_context_dn) { + NDR_PULL_ALLOC(ndr, r->naming_context_dn); + } else { + r->naming_context_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_obj_dn)); + if (_ptr_source_dsa_obj_dn) { + NDR_PULL_ALLOC(ndr, r->source_dsa_obj_dn); + } else { + r->source_dsa_obj_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_address)); + if (_ptr_source_dsa_address) { + NDR_PULL_ALLOC(ndr, r->source_dsa_address); + } else { + r->source_dsa_address = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport_obj_dn)); + if (_ptr_transport_obj_dn) { + NDR_PULL_ALLOC(ndr, r->transport_obj_dn); + } else { + r->transport_obj_dn = NULL; + } + NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->naming_context_obj_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->transport_obj_guid)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->tmp_highest_usn)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_success)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_attempt)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->result_last_attempt)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->consecutive_sync_failures)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->naming_context_dn) { + _mem_save_naming_context_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->naming_context_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->naming_context_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->naming_context_dn)); + if (ndr_get_array_length(ndr, &r->naming_context_dn) > ndr_get_array_size(ndr, &r->naming_context_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->naming_context_dn), ndr_get_array_length(ndr, &r->naming_context_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->naming_context_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->naming_context_dn, ndr_get_array_length(ndr, &r->naming_context_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_dn_0, 0); + } + if (r->source_dsa_obj_dn) { + _mem_save_source_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_obj_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_obj_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_obj_dn)); + if (ndr_get_array_length(ndr, &r->source_dsa_obj_dn) > ndr_get_array_size(ndr, &r->source_dsa_obj_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_obj_dn), ndr_get_array_length(ndr, &r->source_dsa_obj_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_obj_dn, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_obj_dn_0, 0); + } + if (r->source_dsa_address) { + _mem_save_source_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_address, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_address)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_address)); + if (ndr_get_array_length(ndr, &r->source_dsa_address) > ndr_get_array_size(ndr, &r->source_dsa_address)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_address), ndr_get_array_length(ndr, &r->source_dsa_address)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_address, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_address_0, 0); + } + if (r->transport_obj_dn) { + _mem_save_transport_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->transport_obj_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->transport_obj_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->transport_obj_dn)); + if (ndr_get_array_length(ndr, &r->transport_obj_dn) > ndr_get_array_size(ndr, &r->transport_obj_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->transport_obj_dn), ndr_get_array_length(ndr, &r->transport_obj_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->transport_obj_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->transport_obj_dn, ndr_get_array_length(ndr, &r->transport_obj_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_obj_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbour(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbour *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaNeighbour"); + ndr->depth++; + ndr_print_ptr(ndr, "naming_context_dn", r->naming_context_dn); + ndr->depth++; + if (r->naming_context_dn) { + ndr_print_string(ndr, "naming_context_dn", r->naming_context_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn); + ndr->depth++; + if (r->source_dsa_obj_dn) { + ndr_print_string(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "source_dsa_address", r->source_dsa_address); + ndr->depth++; + if (r->source_dsa_address) { + ndr_print_string(ndr, "source_dsa_address", r->source_dsa_address); + } + ndr->depth--; + ndr_print_ptr(ndr, "transport_obj_dn", r->transport_obj_dn); + ndr->depth++; + if (r->transport_obj_dn) { + ndr_print_string(ndr, "transport_obj_dn", r->transport_obj_dn); + } + ndr->depth--; + ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr_print_GUID(ndr, "naming_context_obj_guid", &r->naming_context_obj_guid); + ndr_print_GUID(ndr, "source_dsa_obj_guid", &r->source_dsa_obj_guid); + ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); + ndr_print_GUID(ndr, "transport_obj_guid", &r->transport_obj_guid); + ndr_print_hyper(ndr, "tmp_highest_usn", r->tmp_highest_usn); + ndr_print_hyper(ndr, "highest_usn", r->highest_usn); + ndr_print_NTTIME(ndr, "last_success", r->last_success); + ndr_print_NTTIME(ndr, "last_attempt", r->last_attempt); + ndr_print_WERROR(ndr, "result_last_attempt", r->result_last_attempt); + ndr_print_uint32(ndr, "consecutive_sync_failures", r->consecutive_sync_failures); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaNeighbourCtr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbour(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbour(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaNeighbourCtr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbour(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbour(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbourCtr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaNeighbourCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaNeighbour(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursorCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaCursor(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attribute_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData *r) +{ + uint32_t _ptr_attribute_name; + TALLOC_CTX *_mem_save_attribute_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name)); + if (_ptr_attribute_name) { + NDR_PULL_ALLOC(ndr, r->attribute_name); + } else { + r->attribute_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attribute_name) { + _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name)); + if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData"); + ndr->depth++; + ndr_print_ptr(ndr, "attribute_name", r->attribute_name); + ndr->depth++; + if (r->attribute_name) { + ndr_print_string(ndr, "attribute_name", r->attribute_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "version", r->version); + ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time); + ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); + ndr_print_hyper(ndr, "originating_usn", r->originating_usn); + ndr_print_hyper(ndr, "local_usn", r->local_usn); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaDataCtr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaDataCtr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaDataCtr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaDataCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaObjMetaData(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaKccDsaFailure(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaKccDsaFailure *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dsa_obj_dn)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->dsa_obj_guid)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->first_failure)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_failures)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->last_result)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dsa_obj_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dsa_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dsa_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dsa_obj_dn, ndr_charset_length(r->dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaKccDsaFailure(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaKccDsaFailure *r) +{ + uint32_t _ptr_dsa_obj_dn; + TALLOC_CTX *_mem_save_dsa_obj_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_obj_dn)); + if (_ptr_dsa_obj_dn) { + NDR_PULL_ALLOC(ndr, r->dsa_obj_dn); + } else { + r->dsa_obj_dn = NULL; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->dsa_obj_guid)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->first_failure)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_failures)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->last_result)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dsa_obj_dn) { + _mem_save_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dsa_obj_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dsa_obj_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dsa_obj_dn)); + if (ndr_get_array_length(ndr, &r->dsa_obj_dn) > ndr_get_array_size(ndr, &r->dsa_obj_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dsa_obj_dn), ndr_get_array_length(ndr, &r->dsa_obj_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dsa_obj_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dsa_obj_dn, ndr_get_array_length(ndr, &r->dsa_obj_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_obj_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaKccDsaFailure(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailure *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaKccDsaFailure"); + ndr->depth++; + ndr_print_ptr(ndr, "dsa_obj_dn", r->dsa_obj_dn); + ndr->depth++; + if (r->dsa_obj_dn) { + ndr_print_string(ndr, "dsa_obj_dn", r->dsa_obj_dn); + } + ndr->depth--; + ndr_print_GUID(ndr, "dsa_obj_guid", &r->dsa_obj_guid); + ndr_print_NTTIME(ndr, "first_failure", r->first_failure); + ndr_print_uint32(ndr, "num_failures", r->num_failures); + ndr_print_WERROR(ndr, "last_result", r->last_result); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaKccDsaFailuresCtr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaKccDsaFailuresCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaKccDsaFailure(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaOpType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaOpType r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOpType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaOpType *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaOpType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaOpType r) +{ + const char *val = NULL; + + switch (r) { + case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: val = "DRSUAPI_DS_REPLICA_OP_TYPE_SYNC"; break; + case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: val = "DRSUAPI_DS_REPLICA_OP_TYPE_ADD"; break; + case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: val = "DRSUAPI_DS_REPLICA_OP_TYPE_DELETE"; break; + case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: val = "DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY"; break; + case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: val = "DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_drsuapi_DsRplicaOpOptions(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRplicaOpOptions *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, level)); + switch (level) { + case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->sync)); + break; } + + case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, r->add)); + break; } + + case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, r->op_delete)); + break; } + + case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, r->modify)); + break; } + + case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: { + NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, r->update_refs)); + break; } + + default: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsRplicaOpOptions(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRplicaOpOptions *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->sync)); + break; } + + case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, &r->add)); + break; } + + case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, &r->op_delete)); + break; } + + case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, &r->modify)); + break; } + + case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, &r->update_refs)); + break; } + + default: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsRplicaOpOptions(struct ndr_print *ndr, const char *name, const union drsuapi_DsRplicaOpOptions *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsRplicaOpOptions"); + switch (level) { + case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: + ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "sync", r->sync); + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: + ndr_print_drsuapi_DsReplicaAddOptions(ndr, "add", r->add); + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: + ndr_print_drsuapi_DsReplicaDeleteOptions(ndr, "op_delete", r->op_delete); + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: + ndr_print_drsuapi_DsReplicaModifyOptions(ndr, "modify", r->modify); + break; + + case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: + ndr_print_drsuapi_DsReplicaUpdateRefsOptions(ndr, "update_refs", r->update_refs); + break; + + default: + ndr_print_uint32(ndr, "unknown", r->unknown); + break; + + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaOp(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOp *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->operation_start)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_num)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, r->operation_type)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->options, r->operation_type)); + NDR_CHECK(ndr_push_drsuapi_DsRplicaOpOptions(ndr, NDR_SCALARS, &r->options)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->nc_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_dsa_obj_dn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_dsa_address)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->nc_obj_guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->remote_dsa_obj_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->nc_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->nc_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->nc_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->nc_dn, ndr_charset_length(r->nc_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->remote_dsa_obj_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote_dsa_obj_dn, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->remote_dsa_address) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_address, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_address, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote_dsa_address, ndr_charset_length(r->remote_dsa_address, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOp(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOp *r) +{ + uint32_t _ptr_nc_dn; + TALLOC_CTX *_mem_save_nc_dn_0; + uint32_t _ptr_remote_dsa_obj_dn; + TALLOC_CTX *_mem_save_remote_dsa_obj_dn_0; + uint32_t _ptr_remote_dsa_address; + TALLOC_CTX *_mem_save_remote_dsa_address_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->operation_start)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_num)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, &r->operation_type)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->options, r->operation_type)); + NDR_CHECK(ndr_pull_drsuapi_DsRplicaOpOptions(ndr, NDR_SCALARS, &r->options)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nc_dn)); + if (_ptr_nc_dn) { + NDR_PULL_ALLOC(ndr, r->nc_dn); + } else { + r->nc_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_dsa_obj_dn)); + if (_ptr_remote_dsa_obj_dn) { + NDR_PULL_ALLOC(ndr, r->remote_dsa_obj_dn); + } else { + r->remote_dsa_obj_dn = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_dsa_address)); + if (_ptr_remote_dsa_address) { + NDR_PULL_ALLOC(ndr, r->remote_dsa_address); + } else { + r->remote_dsa_address = NULL; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->nc_obj_guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->remote_dsa_obj_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->nc_dn) { + _mem_save_nc_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->nc_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->nc_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->nc_dn)); + if (ndr_get_array_length(ndr, &r->nc_dn) > ndr_get_array_size(ndr, &r->nc_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->nc_dn), ndr_get_array_length(ndr, &r->nc_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->nc_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->nc_dn, ndr_get_array_length(ndr, &r->nc_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nc_dn_0, 0); + } + if (r->remote_dsa_obj_dn) { + _mem_save_remote_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->remote_dsa_obj_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_dsa_obj_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_dsa_obj_dn)); + if (ndr_get_array_length(ndr, &r->remote_dsa_obj_dn) > ndr_get_array_size(ndr, &r->remote_dsa_obj_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote_dsa_obj_dn), ndr_get_array_length(ndr, &r->remote_dsa_obj_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote_dsa_obj_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_dsa_obj_dn, ndr_get_array_length(ndr, &r->remote_dsa_obj_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_dsa_obj_dn_0, 0); + } + if (r->remote_dsa_address) { + _mem_save_remote_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->remote_dsa_address, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_dsa_address)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_dsa_address)); + if (ndr_get_array_length(ndr, &r->remote_dsa_address) > ndr_get_array_size(ndr, &r->remote_dsa_address)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote_dsa_address), ndr_get_array_length(ndr, &r->remote_dsa_address)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote_dsa_address), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_dsa_address, ndr_get_array_length(ndr, &r->remote_dsa_address), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_dsa_address_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaOp(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOp *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaOp"); + ndr->depth++; + ndr_print_NTTIME(ndr, "operation_start", r->operation_start); + ndr_print_uint32(ndr, "serial_num", r->serial_num); + ndr_print_uint32(ndr, "priority", r->priority); + ndr_print_drsuapi_DsReplicaOpType(ndr, "operation_type", r->operation_type); + ndr_print_set_switch_value(ndr, &r->options, r->operation_type); + ndr_print_drsuapi_DsRplicaOpOptions(ndr, "options", &r->options); + ndr_print_ptr(ndr, "nc_dn", r->nc_dn); + ndr->depth++; + if (r->nc_dn) { + ndr_print_string(ndr, "nc_dn", r->nc_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "remote_dsa_obj_dn", r->remote_dsa_obj_dn); + ndr->depth++; + if (r->remote_dsa_obj_dn) { + ndr_print_string(ndr, "remote_dsa_obj_dn", r->remote_dsa_obj_dn); + } + ndr->depth--; + ndr_print_ptr(ndr, "remote_dsa_address", r->remote_dsa_address); + ndr->depth++; + if (r->remote_dsa_address) { + ndr_print_string(ndr, "remote_dsa_address", r->remote_dsa_address); + } + ndr->depth--; + ndr_print_GUID(ndr, "nc_obj_guid", &r->nc_obj_guid); + ndr_print_GUID(ndr, "remote_dsa_obj_guid", &r->remote_dsa_obj_guid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaOpCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOpCtr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaOp(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaOp(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOpCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOpCtr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOp(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOp(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaOpCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOpCtr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaOpCtr"); + ndr->depth++; + ndr_print_NTTIME(ndr, "time", r->time); + ndr_print_uint32(ndr, "count", r->count); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaOp(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->binary, 0))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->binary)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->deleted)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->created)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attribute_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->object_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->binary) { + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->binary)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData *r) +{ + uint32_t _ptr_attribute_name; + TALLOC_CTX *_mem_save_attribute_name_0; + uint32_t _ptr_object_dn; + TALLOC_CTX *_mem_save_object_dn_0; + uint32_t _ptr_binary; + TALLOC_CTX *_mem_save_binary_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name)); + if (_ptr_attribute_name) { + NDR_PULL_ALLOC(ndr, r->attribute_name); + } else { + r->attribute_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); + if (_ptr_object_dn) { + NDR_PULL_ALLOC(ndr, r->object_dn); + } else { + r->object_dn = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary)); + if (_ptr_binary) { + NDR_PULL_ALLOC(ndr, r->binary); + } else { + r->binary = NULL; + } + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->deleted)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->created)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attribute_name) { + _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name)); + if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0); + } + if (r->object_dn) { + _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); + if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); + } + if (r->binary) { + _mem_save_binary_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->binary, 0); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->binary)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData"); + ndr->depth++; + ndr_print_ptr(ndr, "attribute_name", r->attribute_name); + ndr->depth++; + if (r->attribute_name) { + ndr_print_string(ndr, "attribute_name", r->attribute_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "object_dn", r->object_dn); + ndr->depth++; + if (r->object_dn) { + ndr_print_string(ndr, "object_dn", r->object_dn); + } + ndr->depth--; + ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->binary, 0):r->__ndr_size_binary); + ndr_print_ptr(ndr, "binary", r->binary); + ndr->depth++; + if (r->binary) { + ndr_print_DATA_BLOB(ndr, "binary", *r->binary); + } + ndr->depth--; + ndr_print_NTTIME(ndr, "deleted", r->deleted); + ndr_print_NTTIME(ndr, "created", r->created); + ndr_print_uint32(ndr, "version", r->version); + ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time); + ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); + ndr_print_hyper(ndr, "originating_usn", r->originating_usn); + ndr_print_hyper(ndr, "local_usn", r->local_usn); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaDataCtr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaDataCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaAttrValMetaData(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2Ctr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2Ctr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2Ctr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2Ctr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaCursor2(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_obj_dn)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->source_dsa_obj_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_obj_dn, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor3 *r) +{ + uint32_t _ptr_source_dsa_obj_dn; + TALLOC_CTX *_mem_save_source_dsa_obj_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_obj_dn)); + if (_ptr_source_dsa_obj_dn) { + NDR_PULL_ALLOC(ndr, r->source_dsa_obj_dn); + } else { + r->source_dsa_obj_dn = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->source_dsa_obj_dn) { + _mem_save_source_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_obj_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_obj_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_obj_dn)); + if (ndr_get_array_length(ndr, &r->source_dsa_obj_dn) > ndr_get_array_size(ndr, &r->source_dsa_obj_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_obj_dn), ndr_get_array_length(ndr, &r->source_dsa_obj_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_obj_dn, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_obj_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor3"); + ndr->depth++; + ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); + ndr_print_hyper(ndr, "highest_usn", r->highest_usn); + ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success); + ndr_print_ptr(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn); + ndr->depth++; + if (r->source_dsa_obj_dn) { + ndr_print_string(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor3Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor3Ctr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor3Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor3Ctr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor3Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3Ctr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor3Ctr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaCursor3(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->originating_dsa_dn)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attribute_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->originating_dsa_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->originating_dsa_dn, ndr_charset_length(r->originating_dsa_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData2 *r) +{ + uint32_t _ptr_attribute_name; + TALLOC_CTX *_mem_save_attribute_name_0; + uint32_t _ptr_originating_dsa_dn; + TALLOC_CTX *_mem_save_originating_dsa_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name)); + if (_ptr_attribute_name) { + NDR_PULL_ALLOC(ndr, r->attribute_name); + } else { + r->attribute_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_originating_dsa_dn)); + if (_ptr_originating_dsa_dn) { + NDR_PULL_ALLOC(ndr, r->originating_dsa_dn); + } else { + r->originating_dsa_dn = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attribute_name) { + _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name)); + if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0); + } + if (r->originating_dsa_dn) { + _mem_save_originating_dsa_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->originating_dsa_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->originating_dsa_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->originating_dsa_dn)); + if (ndr_get_array_length(ndr, &r->originating_dsa_dn) > ndr_get_array_size(ndr, &r->originating_dsa_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->originating_dsa_dn), ndr_get_array_length(ndr, &r->originating_dsa_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->originating_dsa_dn, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_originating_dsa_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData2"); + ndr->depth++; + ndr_print_ptr(ndr, "attribute_name", r->attribute_name); + ndr->depth++; + if (r->attribute_name) { + ndr_print_string(ndr, "attribute_name", r->attribute_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "version", r->version); + ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time); + ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); + ndr_print_hyper(ndr, "originating_usn", r->originating_usn); + ndr_print_hyper(ndr, "local_usn", r->local_usn); + ndr_print_ptr(ndr, "originating_dsa_dn", r->originating_dsa_dn); + ndr->depth++; + if (r->originating_dsa_dn) { + ndr_print_string(ndr, "originating_dsa_dn", r->originating_dsa_dn); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData2Ctr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData2Ctr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2Ctr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData2Ctr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaObjMetaData2(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->binary, 0))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->binary)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->deleted)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->created)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->originating_dsa_dn)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attribute_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->object_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->binary) { + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->binary)); + } + if (r->originating_dsa_dn) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->originating_dsa_dn, ndr_charset_length(r->originating_dsa_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData2 *r) +{ + uint32_t _ptr_attribute_name; + TALLOC_CTX *_mem_save_attribute_name_0; + uint32_t _ptr_object_dn; + TALLOC_CTX *_mem_save_object_dn_0; + uint32_t _ptr_binary; + TALLOC_CTX *_mem_save_binary_0; + uint32_t _ptr_originating_dsa_dn; + TALLOC_CTX *_mem_save_originating_dsa_dn_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name)); + if (_ptr_attribute_name) { + NDR_PULL_ALLOC(ndr, r->attribute_name); + } else { + r->attribute_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); + if (_ptr_object_dn) { + NDR_PULL_ALLOC(ndr, r->object_dn); + } else { + r->object_dn = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary)); + if (_ptr_binary) { + NDR_PULL_ALLOC(ndr, r->binary); + } else { + r->binary = NULL; + } + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->deleted)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->created)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_originating_dsa_dn)); + if (_ptr_originating_dsa_dn) { + NDR_PULL_ALLOC(ndr, r->originating_dsa_dn); + } else { + r->originating_dsa_dn = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->attribute_name) { + _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name)); + if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0); + } + if (r->object_dn) { + _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); + if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); + } + if (r->binary) { + _mem_save_binary_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->binary, 0); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->binary)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_0, 0); + } + if (r->originating_dsa_dn) { + _mem_save_originating_dsa_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->originating_dsa_dn, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->originating_dsa_dn)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->originating_dsa_dn)); + if (ndr_get_array_length(ndr, &r->originating_dsa_dn) > ndr_get_array_size(ndr, &r->originating_dsa_dn)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->originating_dsa_dn), ndr_get_array_length(ndr, &r->originating_dsa_dn)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->originating_dsa_dn, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_originating_dsa_dn_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData2"); + ndr->depth++; + ndr_print_ptr(ndr, "attribute_name", r->attribute_name); + ndr->depth++; + if (r->attribute_name) { + ndr_print_string(ndr, "attribute_name", r->attribute_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "object_dn", r->object_dn); + ndr->depth++; + if (r->object_dn) { + ndr_print_string(ndr, "object_dn", r->object_dn); + } + ndr->depth--; + ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->binary, 0):r->__ndr_size_binary); + ndr_print_ptr(ndr, "binary", r->binary); + ndr->depth++; + if (r->binary) { + ndr_print_DATA_BLOB(ndr, "binary", *r->binary); + } + ndr->depth--; + ndr_print_NTTIME(ndr, "deleted", r->deleted); + ndr_print_NTTIME(ndr, "created", r->created); + ndr_print_uint32(ndr, "version", r->version); + ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time); + ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); + ndr_print_hyper(ndr, "originating_usn", r->originating_usn); + ndr_print_hyper(ndr, "local_usn", r->local_usn); + ndr_print_ptr(ndr, "originating_dsa_dn", r->originating_dsa_dn); + ndr->depth++; + if (r->originating_dsa_dn) { + ndr_print_string(ndr, "originating_dsa_dn", r->originating_dsa_dn); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData2Ctr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData2Ctr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaAttrValMetaData2(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaConnection04(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaConnection04 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->u1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->bind_guid)); + NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->bind_time)); + { + uint32_t _flags_save_ipv4address = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->client_ip_address)); + ndr->flags = _flags_save_ipv4address; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u5)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaConnection04(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaConnection04 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->u1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->bind_guid)); + NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->bind_time)); + { + uint32_t _flags_save_ipv4address = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->client_ip_address)); + ndr->flags = _flags_save_ipv4address; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u5)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaConnection04(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaConnection04"); + ndr->depth++; + ndr_print_hyper(ndr, "u1", r->u1); + ndr_print_uint32(ndr, "u2", r->u2); + ndr_print_uint32(ndr, "u3", r->u3); + ndr_print_GUID(ndr, "bind_guid", &r->bind_guid); + ndr_print_NTTIME_1sec(ndr, "bind_time", r->bind_time); + ndr_print_ipv4address(ndr, "client_ip_address", r->client_ip_address); + ndr_print_uint32(ndr, "u5", r->u5); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaConnection04Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaConnection04Ctr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaConnection04(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaConnection04Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaConnection04Ctr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplicaConnection04(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaConnection04Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04Ctr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplicaConnection04Ctr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplicaConnection04(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplica06(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplica06 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->str1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u5)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->u6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u7)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->str1) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str1, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str1, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->str1, ndr_charset_length(r->str1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplica06(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplica06 *r) +{ + uint32_t _ptr_str1; + TALLOC_CTX *_mem_save_str1_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_str1)); + if (_ptr_str1) { + NDR_PULL_ALLOC(ndr, r->str1); + } else { + r->str1 = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u5)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->u6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u7)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->str1) { + _mem_save_str1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->str1, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->str1)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->str1)); + if (ndr_get_array_length(ndr, &r->str1) > ndr_get_array_size(ndr, &r->str1)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->str1), ndr_get_array_length(ndr, &r->str1)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->str1), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->str1, ndr_get_array_length(ndr, &r->str1), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_str1_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplica06(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplica06"); + ndr->depth++; + ndr_print_ptr(ndr, "str1", r->str1); + ndr->depth++; + if (r->str1) { + ndr_print_string(ndr, "str1", r->str1); + } + ndr->depth--; + ndr_print_uint32(ndr, "u1", r->u1); + ndr_print_uint32(ndr, "u2", r->u2); + ndr_print_uint32(ndr, "u3", r->u3); + ndr_print_uint32(ndr, "u4", r->u4); + ndr_print_uint32(ndr, "u5", r->u5); + ndr_print_hyper(ndr, "u6", r->u6); + ndr_print_uint32(ndr, "u7", r->u7); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplica06Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplica06Ctr *r) +{ + uint32_t cntr_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplica06(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_push_drsuapi_DsReplica06(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplica06Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplica06Ctr *r) +{ + uint32_t cntr_array_0; + TALLOC_CTX *_mem_save_array_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 256) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplica06(ndr, NDR_SCALARS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { + NDR_CHECK(ndr_pull_drsuapi_DsReplica06(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplica06Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06Ctr *r) +{ + uint32_t cntr_array_0; + ndr_print_struct(ndr, name, "drsuapi_DsReplica06Ctr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { + ndr_print_drsuapi_DsReplica06(ndr, "array", &r->array[cntr_array_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, level)); + switch (level) { + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->neighbours)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_CURSORS: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->objmetadata)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->connectfailures)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->linkfailures)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->pendingops)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->attrvalmetadata)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_CURSORS2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors2)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_CURSORS3: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors3)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->objmetadata2)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->attrvalmetadata2)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->neighbours02)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->connections04)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_CURSORS05: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors05)); + break; } + + case DRSUAPI_DS_REPLICA_INFO_06: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->i06)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: + if (r->neighbours) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS: + if (r->cursors) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtr(ndr, NDR_SCALARS, r->cursors)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: + if (r->objmetadata) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: + if (r->connectfailures) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->connectfailures)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: + if (r->linkfailures) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->linkfailures)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: + if (r->pendingops) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaOpCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->pendingops)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: + if (r->attrvalmetadata) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS2: + if (r->cursors2) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2Ctr(ndr, NDR_SCALARS, r->cursors2)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS3: + if (r->cursors3) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->cursors3)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: + if (r->objmetadata2) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata2)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: + if (r->attrvalmetadata2) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata2)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: + if (r->neighbours02) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours02)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: + if (r->connections04) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaConnection04Ctr(ndr, NDR_SCALARS, r->connections04)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS05: + if (r->cursors05) { + NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->cursors05)); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_06: + if (r->i06) { + NDR_CHECK(ndr_push_drsuapi_DsReplica06Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->i06)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_neighbours_0; + TALLOC_CTX *_mem_save_cursors_0; + TALLOC_CTX *_mem_save_objmetadata_0; + TALLOC_CTX *_mem_save_connectfailures_0; + TALLOC_CTX *_mem_save_linkfailures_0; + TALLOC_CTX *_mem_save_pendingops_0; + TALLOC_CTX *_mem_save_attrvalmetadata_0; + TALLOC_CTX *_mem_save_cursors2_0; + TALLOC_CTX *_mem_save_cursors3_0; + TALLOC_CTX *_mem_save_objmetadata2_0; + TALLOC_CTX *_mem_save_attrvalmetadata2_0; + TALLOC_CTX *_mem_save_neighbours02_0; + TALLOC_CTX *_mem_save_connections04_0; + TALLOC_CTX *_mem_save_cursors05_0; + TALLOC_CTX *_mem_save_i06_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: { + uint32_t _ptr_neighbours; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_neighbours)); + if (_ptr_neighbours) { + NDR_PULL_ALLOC(ndr, r->neighbours); + } else { + r->neighbours = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_CURSORS: { + uint32_t _ptr_cursors; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors)); + if (_ptr_cursors) { + NDR_PULL_ALLOC(ndr, r->cursors); + } else { + r->cursors = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: { + uint32_t _ptr_objmetadata; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objmetadata)); + if (_ptr_objmetadata) { + NDR_PULL_ALLOC(ndr, r->objmetadata); + } else { + r->objmetadata = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: { + uint32_t _ptr_connectfailures; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_connectfailures)); + if (_ptr_connectfailures) { + NDR_PULL_ALLOC(ndr, r->connectfailures); + } else { + r->connectfailures = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: { + uint32_t _ptr_linkfailures; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_linkfailures)); + if (_ptr_linkfailures) { + NDR_PULL_ALLOC(ndr, r->linkfailures); + } else { + r->linkfailures = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: { + uint32_t _ptr_pendingops; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pendingops)); + if (_ptr_pendingops) { + NDR_PULL_ALLOC(ndr, r->pendingops); + } else { + r->pendingops = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: { + uint32_t _ptr_attrvalmetadata; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attrvalmetadata)); + if (_ptr_attrvalmetadata) { + NDR_PULL_ALLOC(ndr, r->attrvalmetadata); + } else { + r->attrvalmetadata = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_CURSORS2: { + uint32_t _ptr_cursors2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors2)); + if (_ptr_cursors2) { + NDR_PULL_ALLOC(ndr, r->cursors2); + } else { + r->cursors2 = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_CURSORS3: { + uint32_t _ptr_cursors3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors3)); + if (_ptr_cursors3) { + NDR_PULL_ALLOC(ndr, r->cursors3); + } else { + r->cursors3 = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: { + uint32_t _ptr_objmetadata2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objmetadata2)); + if (_ptr_objmetadata2) { + NDR_PULL_ALLOC(ndr, r->objmetadata2); + } else { + r->objmetadata2 = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: { + uint32_t _ptr_attrvalmetadata2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attrvalmetadata2)); + if (_ptr_attrvalmetadata2) { + NDR_PULL_ALLOC(ndr, r->attrvalmetadata2); + } else { + r->attrvalmetadata2 = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: { + uint32_t _ptr_neighbours02; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_neighbours02)); + if (_ptr_neighbours02) { + NDR_PULL_ALLOC(ndr, r->neighbours02); + } else { + r->neighbours02 = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: { + uint32_t _ptr_connections04; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_connections04)); + if (_ptr_connections04) { + NDR_PULL_ALLOC(ndr, r->connections04); + } else { + r->connections04 = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_CURSORS05: { + uint32_t _ptr_cursors05; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors05)); + if (_ptr_cursors05) { + NDR_PULL_ALLOC(ndr, r->cursors05); + } else { + r->cursors05 = NULL; + } + break; } + + case DRSUAPI_DS_REPLICA_INFO_06: { + uint32_t _ptr_i06; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_i06)); + if (_ptr_i06) { + NDR_PULL_ALLOC(ndr, r->i06); + } else { + r->i06 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: + if (r->neighbours) { + _mem_save_neighbours_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->neighbours, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_neighbours_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS: + if (r->cursors) { + _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtr(ndr, NDR_SCALARS, r->cursors)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: + if (r->objmetadata) { + _mem_save_objmetadata_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->objmetadata, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objmetadata_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: + if (r->connectfailures) { + _mem_save_connectfailures_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->connectfailures, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->connectfailures)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connectfailures_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: + if (r->linkfailures) { + _mem_save_linkfailures_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->linkfailures, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->linkfailures)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linkfailures_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: + if (r->pendingops) { + _mem_save_pendingops_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->pendingops, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaOpCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->pendingops)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pendingops_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: + if (r->attrvalmetadata) { + _mem_save_attrvalmetadata_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attrvalmetadata, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attrvalmetadata_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS2: + if (r->cursors2) { + _mem_save_cursors2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->cursors2, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2Ctr(ndr, NDR_SCALARS, r->cursors2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors2_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS3: + if (r->cursors3) { + _mem_save_cursors3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->cursors3, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->cursors3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors3_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: + if (r->objmetadata2) { + _mem_save_objmetadata2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->objmetadata2, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objmetadata2_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: + if (r->attrvalmetadata2) { + _mem_save_attrvalmetadata2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attrvalmetadata2, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attrvalmetadata2_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: + if (r->neighbours02) { + _mem_save_neighbours02_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->neighbours02, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours02)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_neighbours02_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: + if (r->connections04) { + _mem_save_connections04_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->connections04, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaConnection04Ctr(ndr, NDR_SCALARS, r->connections04)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connections04_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS05: + if (r->cursors05) { + _mem_save_cursors05_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->cursors05, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->cursors05)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors05_0, 0); + } + break; + + case DRSUAPI_DS_REPLICA_INFO_06: + if (r->i06) { + _mem_save_i06_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->i06, 0); + NDR_CHECK(ndr_pull_drsuapi_DsReplica06Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->i06)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_i06_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsReplicaInfo"); + switch (level) { + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: + ndr_print_ptr(ndr, "neighbours", r->neighbours); + ndr->depth++; + if (r->neighbours) { + ndr_print_drsuapi_DsReplicaNeighbourCtr(ndr, "neighbours", r->neighbours); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS: + ndr_print_ptr(ndr, "cursors", r->cursors); + ndr->depth++; + if (r->cursors) { + ndr_print_drsuapi_DsReplicaCursorCtr(ndr, "cursors", r->cursors); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: + ndr_print_ptr(ndr, "objmetadata", r->objmetadata); + ndr->depth++; + if (r->objmetadata) { + ndr_print_drsuapi_DsReplicaObjMetaDataCtr(ndr, "objmetadata", r->objmetadata); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: + ndr_print_ptr(ndr, "connectfailures", r->connectfailures); + ndr->depth++; + if (r->connectfailures) { + ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, "connectfailures", r->connectfailures); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: + ndr_print_ptr(ndr, "linkfailures", r->linkfailures); + ndr->depth++; + if (r->linkfailures) { + ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, "linkfailures", r->linkfailures); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: + ndr_print_ptr(ndr, "pendingops", r->pendingops); + ndr->depth++; + if (r->pendingops) { + ndr_print_drsuapi_DsReplicaOpCtr(ndr, "pendingops", r->pendingops); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: + ndr_print_ptr(ndr, "attrvalmetadata", r->attrvalmetadata); + ndr->depth++; + if (r->attrvalmetadata) { + ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, "attrvalmetadata", r->attrvalmetadata); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS2: + ndr_print_ptr(ndr, "cursors2", r->cursors2); + ndr->depth++; + if (r->cursors2) { + ndr_print_drsuapi_DsReplicaCursor2Ctr(ndr, "cursors2", r->cursors2); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS3: + ndr_print_ptr(ndr, "cursors3", r->cursors3); + ndr->depth++; + if (r->cursors3) { + ndr_print_drsuapi_DsReplicaCursor3Ctr(ndr, "cursors3", r->cursors3); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: + ndr_print_ptr(ndr, "objmetadata2", r->objmetadata2); + ndr->depth++; + if (r->objmetadata2) { + ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(ndr, "objmetadata2", r->objmetadata2); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: + ndr_print_ptr(ndr, "attrvalmetadata2", r->attrvalmetadata2); + ndr->depth++; + if (r->attrvalmetadata2) { + ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, "attrvalmetadata2", r->attrvalmetadata2); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: + ndr_print_ptr(ndr, "neighbours02", r->neighbours02); + ndr->depth++; + if (r->neighbours02) { + ndr_print_drsuapi_DsReplicaNeighbourCtr(ndr, "neighbours02", r->neighbours02); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: + ndr_print_ptr(ndr, "connections04", r->connections04); + ndr->depth++; + if (r->connections04) { + ndr_print_drsuapi_DsReplicaConnection04Ctr(ndr, "connections04", r->connections04); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_CURSORS05: + ndr_print_ptr(ndr, "cursors05", r->cursors05); + ndr->depth++; + if (r->cursors05) { + ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "cursors05", r->cursors05); + } + ndr->depth--; + break; + + case DRSUAPI_DS_REPLICA_INFO_06: + ndr_print_ptr(ndr, "i06", r->i06); + ndr->depth++; + if (r->i06) { + ndr_print_drsuapi_DsReplica06Ctr(ndr, "i06", r->i06); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Ctr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMemberships2Ctr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Ctr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMemberships2Ctr *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Ctr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Ctr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetMemberships2Ctr"); + switch (level) { + case 1: + ndr_print_drsuapi_DsGetMembershipsCtr1(ndr, "ctr1", &r->ctr1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Request1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMemberships2Request1 *r) +{ + uint32_t cntr_req_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->req_array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->req_array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req)); + for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->req_array[cntr_req_array_1])); + } + for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) { + if (r->req_array[cntr_req_array_1]) { + NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS|NDR_BUFFERS, r->req_array[cntr_req_array_1])); + } + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Request1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMemberships2Request1 *r) +{ + uint32_t _ptr_req_array; + uint32_t cntr_req_array_1; + TALLOC_CTX *_mem_save_req_array_0; + TALLOC_CTX *_mem_save_req_array_1; + TALLOC_CTX *_mem_save_req_array_2; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_req)); + if (r->num_req < 1 || r->num_req > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_req_array)); + if (_ptr_req_array) { + NDR_PULL_ALLOC(ndr, r->req_array); + } else { + r->req_array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->req_array) { + _mem_save_req_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->req_array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->req_array)); + NDR_PULL_ALLOC_N(ndr, r->req_array, ndr_get_array_size(ndr, &r->req_array)); + _mem_save_req_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->req_array, 0); + for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_req_array)); + if (_ptr_req_array) { + NDR_PULL_ALLOC(ndr, r->req_array[cntr_req_array_1]); + } else { + r->req_array[cntr_req_array_1] = NULL; + } + } + for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) { + if (r->req_array[cntr_req_array_1]) { + _mem_save_req_array_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->req_array[cntr_req_array_1], 0); + NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS|NDR_BUFFERS, r->req_array[cntr_req_array_1])); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_2, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_0, 0); + } + if (r->req_array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->req_array, r->num_req)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Request1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMemberships2Request1 *r) +{ + uint32_t cntr_req_array_1; + ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships2Request1"); + ndr->depth++; + ndr_print_uint32(ndr, "num_req", r->num_req); + ndr_print_ptr(ndr, "req_array", r->req_array); + ndr->depth++; + if (r->req_array) { + ndr->print(ndr, "%s: ARRAY(%d)", "req_array", (int)r->num_req); + ndr->depth++; + for (cntr_req_array_1=0;cntr_req_array_1num_req;cntr_req_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_req_array_1) != -1) { + ndr_print_ptr(ndr, "req_array", r->req_array[cntr_req_array_1]); + ndr->depth++; + if (r->req_array[cntr_req_array_1]) { + ndr_print_drsuapi_DsGetMembershipsRequest1(ndr, "req_array", r->req_array[cntr_req_array_1]); + } + ndr->depth--; + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Request(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMemberships2Request *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Request(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMemberships2Request *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Request(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Request *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_DsGetMemberships2Request"); + switch (level) { + case 1: + ndr_print_drsuapi_DsGetMemberships2Request1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_DsSiteCostInfo(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsSiteCostInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->error_code)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->site_cost)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsSiteCostInfo(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsSiteCostInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->error_code)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->site_cost)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsSiteCostInfo(struct ndr_print *ndr, const char *name, const struct drsuapi_DsSiteCostInfo *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsSiteCostInfo"); + ndr->depth++; + ndr_print_WERROR(ndr, "error_code", r->error_code); + ndr_print_uint32(ndr, "site_cost", r->site_cost); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_QuerySitesByCostCtr1 *r) +{ + uint32_t cntr_info_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_info)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_info)); + for (cntr_info_1 = 0; cntr_info_1 < r->num_info; cntr_info_1++) { + NDR_CHECK(ndr_push_drsuapi_DsSiteCostInfo(ndr, NDR_SCALARS, &r->info[cntr_info_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_QuerySitesByCostCtr1 *r) +{ + uint32_t _ptr_info; + uint32_t cntr_info_1; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_info)); + if (r->num_info < 0 || r->num_info > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->info); + } else { + r->info = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->info)); + NDR_PULL_ALLOC_N(ndr, r->info, ndr_get_array_size(ndr, &r->info)); + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + for (cntr_info_1 = 0; cntr_info_1 < r->num_info; cntr_info_1++) { + NDR_CHECK(ndr_pull_drsuapi_DsSiteCostInfo(ndr, NDR_SCALARS, &r->info[cntr_info_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + if (r->info) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info, r->num_info)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostCtr1 *r) +{ + uint32_t cntr_info_1; + ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCostCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "num_info", r->num_info); + ndr_print_ptr(ndr, "info", r->info); + ndr->depth++; + if (r->info) { + ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->num_info); + ndr->depth++; + for (cntr_info_1=0;cntr_info_1num_info;cntr_info_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { + ndr_print_drsuapi_DsSiteCostInfo(ndr, "info", &r->info[cntr_info_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_QuerySitesByCostCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_QuerySitesByCostCtr *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr1(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr1(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostCtr(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_QuerySitesByCostCtr"); + switch (level) { + case 1: + ndr_print_drsuapi_QuerySitesByCostCtr1(ndr, "ctr1", &r->ctr1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_QuerySitesByCostRequest1 *r) +{ + uint32_t cntr_site_to_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_from)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_to)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->site_from) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_from, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_from, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_from, ndr_charset_length(r->site_from, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->site_to) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req)); + for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_to[cntr_site_to_1])); + } + for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) { + if (r->site_to[cntr_site_to_1]) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_to[cntr_site_to_1], ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_QuerySitesByCostRequest1 *r) +{ + uint32_t _ptr_site_from; + TALLOC_CTX *_mem_save_site_from_0; + uint32_t _ptr_site_to; + uint32_t cntr_site_to_1; + TALLOC_CTX *_mem_save_site_to_0; + TALLOC_CTX *_mem_save_site_to_1; + TALLOC_CTX *_mem_save_site_to_2; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_from)); + if (_ptr_site_from) { + NDR_PULL_ALLOC(ndr, r->site_from); + } else { + r->site_from = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_req)); + if (r->num_req < 1 || r->num_req > 10000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_to)); + if (_ptr_site_to) { + NDR_PULL_ALLOC(ndr, r->site_to); + } else { + r->site_to = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->site_from) { + _mem_save_site_from_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->site_from, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->site_from)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->site_from)); + if (ndr_get_array_length(ndr, &r->site_from) > ndr_get_array_size(ndr, &r->site_from)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_from), ndr_get_array_length(ndr, &r->site_from)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_from), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_from, ndr_get_array_length(ndr, &r->site_from), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_from_0, 0); + } + if (r->site_to) { + _mem_save_site_to_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->site_to, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->site_to)); + NDR_PULL_ALLOC_N(ndr, r->site_to, ndr_get_array_size(ndr, &r->site_to)); + _mem_save_site_to_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->site_to, 0); + for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_to)); + if (_ptr_site_to) { + NDR_PULL_ALLOC(ndr, r->site_to[cntr_site_to_1]); + } else { + r->site_to[cntr_site_to_1] = NULL; + } + } + for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) { + if (r->site_to[cntr_site_to_1]) { + _mem_save_site_to_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->site_to[cntr_site_to_1], 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->site_to[cntr_site_to_1])); + NDR_CHECK(ndr_pull_array_length(ndr, &r->site_to[cntr_site_to_1])); + if (ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]) > ndr_get_array_size(ndr, &r->site_to[cntr_site_to_1])) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_to[cntr_site_to_1]), ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1])); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_to[cntr_site_to_1], ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_2, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_0, 0); + } + if (r->site_to) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->site_to, r->num_req)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostRequest1 *r) +{ + uint32_t cntr_site_to_1; + ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCostRequest1"); + ndr->depth++; + ndr_print_ptr(ndr, "site_from", r->site_from); + ndr->depth++; + if (r->site_from) { + ndr_print_string(ndr, "site_from", r->site_from); + } + ndr->depth--; + ndr_print_uint32(ndr, "num_req", r->num_req); + ndr_print_ptr(ndr, "site_to", r->site_to); + ndr->depth++; + if (r->site_to) { + ndr->print(ndr, "%s: ARRAY(%d)", "site_to", (int)r->num_req); + ndr->depth++; + for (cntr_site_to_1=0;cntr_site_to_1num_req;cntr_site_to_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_site_to_1) != -1) { + ndr_print_ptr(ndr, "site_to", r->site_to[cntr_site_to_1]); + ndr->depth++; + if (r->site_to[cntr_site_to_1]) { + ndr_print_string(ndr, "site_to", r->site_to[cntr_site_to_1]); + } + ndr->depth--; + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_QuerySitesByCostRequest *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_QuerySitesByCostRequest *r) +{ + int level; + int32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest1(ndr, NDR_SCALARS, &r->req1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest1(ndr, NDR_BUFFERS, &r->req1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostRequest(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostRequest *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "drsuapi_QuerySitesByCostRequest"); + switch (level) { + case 1: + ndr_print_drsuapi_QuerySitesByCostRequest1(ndr, "req1", &r->req1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsBind(struct ndr_push *ndr, int flags, const struct drsuapi_DsBind *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.bind_guid)); + if (r->in.bind_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.bind_guid)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.bind_info)); + if (r->in.bind_info) { + NDR_CHECK(ndr_push_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->in.bind_info)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.bind_info)); + if (r->out.bind_info) { + NDR_CHECK(ndr_push_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->out.bind_info)); + } + if (r->out.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsBind(struct ndr_pull *ndr, int flags, struct drsuapi_DsBind *r) +{ + uint32_t _ptr_bind_guid; + uint32_t _ptr_bind_info; + TALLOC_CTX *_mem_save_bind_guid_0; + TALLOC_CTX *_mem_save_bind_info_0; + TALLOC_CTX *_mem_save_bind_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_guid)); + if (_ptr_bind_guid) { + NDR_PULL_ALLOC(ndr, r->in.bind_guid); + } else { + r->in.bind_guid = NULL; + } + if (r->in.bind_guid) { + _mem_save_bind_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.bind_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_guid_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_info)); + if (_ptr_bind_info) { + NDR_PULL_ALLOC(ndr, r->in.bind_info); + } else { + r->in.bind_info = NULL; + } + if (r->in.bind_info) { + _mem_save_bind_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_info, 0); + NDR_CHECK(ndr_pull_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->in.bind_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_info_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.bind_handle); + ZERO_STRUCTP(r->out.bind_handle); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_info)); + if (_ptr_bind_info) { + NDR_PULL_ALLOC(ndr, r->out.bind_info); + } else { + r->out.bind_info = NULL; + } + if (r->out.bind_info) { + _mem_save_bind_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_info, 0); + NDR_CHECK(ndr_pull_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->out.bind_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_info_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsBind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsBind *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsBind"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsBind"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_guid", r->in.bind_guid); + ndr->depth++; + if (r->in.bind_guid) { + ndr_print_GUID(ndr, "bind_guid", r->in.bind_guid); + } + ndr->depth--; + ndr_print_ptr(ndr, "bind_info", r->in.bind_info); + ndr->depth++; + if (r->in.bind_info) { + ndr_print_drsuapi_DsBindInfoCtr(ndr, "bind_info", r->in.bind_info); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsBind"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_info", r->out.bind_info); + ndr->depth++; + if (r->out.bind_info) { + ndr_print_drsuapi_DsBindInfoCtr(ndr, "bind_info", r->out.bind_info); + } + ndr->depth--; + ndr_print_ptr(ndr, "bind_handle", r->out.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->out.bind_handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsUnbind(struct ndr_push *ndr, int flags, const struct drsuapi_DsUnbind *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + } + if (flags & NDR_OUT) { + if (r->out.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsUnbind(struct ndr_pull *ndr, int flags, struct drsuapi_DsUnbind *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.bind_handle); + *r->out.bind_handle = *r->in.bind_handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsUnbind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsUnbind *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsUnbind"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsUnbind"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsUnbind"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->out.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->out.bind_handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaSync(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaSync *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSync(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaSync *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaSync(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaSync *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaSync"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsReplicaSync"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_set_switch_value(ndr, &r->in.req, r->in.level); + ndr_print_drsuapi_DsReplicaSyncRequest(ndr, "req", &r->in.req); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsReplicaSync"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNCChanges(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetNCChanges *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); + 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_out)); + NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChanges(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetNCChanges *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_ctr_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNCChanges(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNCChanges *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNCChanges"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsGetNCChanges"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsGetNCChangesRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsGetNCChanges"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_int32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); + ndr_print_drsuapi_DsGetNCChangesCtr(ndr, "ctr", r->out.ctr); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefs(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaUpdateRefs *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefs(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaUpdateRefs *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefs(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaUpdateRefs *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaUpdateRefs"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsReplicaUpdateRefs"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_set_switch_value(ndr, &r->in.req, r->in.level); + ndr_print_drsuapi_DsReplicaUpdateRefsRequest(ndr, "req", &r->in.req); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsReplicaUpdateRefs"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_ADD(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_ADD *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_ADD(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_ADD *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_REPLICA_ADD(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_ADD *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_ADD"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_ADD"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_ADD"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_DEL(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_DEL *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_DEL(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_DEL *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_REPLICA_DEL(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_DEL *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_DEL"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_DEL"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_DEL"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_MODIFY(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_MODIFY *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_MODIFY(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_MODIFY *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_REPLICA_MODIFY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_MODIFY *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_MODIFY"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_MODIFY"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_MODIFY"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_VERIFY_NAMES(struct ndr_push *ndr, int flags, const struct DRSUAPI_VERIFY_NAMES *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_VERIFY_NAMES(struct ndr_pull *ndr, int flags, struct DRSUAPI_VERIFY_NAMES *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_VERIFY_NAMES(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_VERIFY_NAMES *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_VERIFY_NAMES"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_VERIFY_NAMES"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_VERIFY_NAMES"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetMemberships *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); + 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_out)); + NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetMemberships *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_ctr_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsGetMemberships"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsGetMembershipsRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsGetMemberships"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_int32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); + ndr_print_drsuapi_DsGetMembershipsCtr(ndr, "ctr", r->out.ctr); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_push *ndr, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_pull *ndr, int flags, struct DRSUAPI_INTER_DOMAIN_MOVE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_INTER_DOMAIN_MOVE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_INTER_DOMAIN_MOVE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_INTER_DOMAIN_MOVE"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLog(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetNT4ChangeLog *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level_out)); + 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->out.level_out)); + NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLog(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetNT4ChangeLog *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLog(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNT4ChangeLog *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLog"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsGetNT4ChangeLog"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsGetNT4ChangeLogRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsGetNT4ChangeLog"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_uint32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, *r->out.level_out); + ndr_print_drsuapi_DsGetNT4ChangeLogInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsCrackNames(struct ndr_push *ndr, int flags, const struct drsuapi_DsCrackNames *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsNameRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); + 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_out)); + NDR_CHECK(ndr_push_drsuapi_DsNameCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsCrackNames(struct ndr_pull *ndr, int flags, struct drsuapi_DsCrackNames *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_ctr_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsNameRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_DsNameCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsCrackNames(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsCrackNames *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsCrackNames"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsCrackNames"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsNameRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsCrackNames"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_int32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); + ndr_print_drsuapi_DsNameCtr(ndr, "ctr", r->out.ctr); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpn(struct ndr_push *ndr, int flags, const struct drsuapi_DsWriteAccountSpn *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); + if (r->out.res == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.res, *r->out.level_out)); + NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnResult(ndr, NDR_SCALARS, r->out.res)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpn(struct ndr_pull *ndr, int flags, struct drsuapi_DsWriteAccountSpn *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_res_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.res); + ZERO_STRUCTP(r->out.res); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.res); + } + _mem_save_res_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.res, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.res, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnResult(ndr, NDR_SCALARS, r->out.res)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpn(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsWriteAccountSpn *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpn"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsWriteAccountSpn"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsWriteAccountSpnRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsWriteAccountSpn"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_int32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "res", r->out.res); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.res, *r->out.level_out); + ndr_print_drsuapi_DsWriteAccountSpnResult(ndr, "res", r->out.res); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServer(struct ndr_push *ndr, int flags, const struct drsuapi_DsRemoveDSServer *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); + if (r->out.res == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.res, *r->out.level_out)); + NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerResult(ndr, NDR_SCALARS, r->out.res)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServer(struct ndr_pull *ndr, int flags, struct drsuapi_DsRemoveDSServer *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_res_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.res); + ZERO_STRUCTP(r->out.res); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.res); + } + _mem_save_res_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.res, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.res, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerResult(ndr, NDR_SCALARS, r->out.res)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServer(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsRemoveDSServer *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServer"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsRemoveDSServer"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsRemoveDSServerRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsRemoveDSServer"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_int32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "res", r->out.res); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.res, *r->out.level_out); + ndr_print_drsuapi_DsRemoveDSServerResult(ndr, "res", r->out.res); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_push *ndr, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_pull *ndr, int flags, struct DRSUAPI_REMOVE_DS_DOMAIN *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_REMOVE_DS_DOMAIN"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_REMOVE_DS_DOMAIN"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_REMOVE_DS_DOMAIN"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetDomainControllerInfo(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetDomainControllerInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); + 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_out)); + NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetDomainControllerInfo(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetDomainControllerInfo *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_ctr_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetDomainControllerInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetDomainControllerInfo *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetDomainControllerInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsGetDomainControllerInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsGetDCInfoRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsGetDomainControllerInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_int32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); + ndr_print_drsuapi_DsGetDCInfoCtr(ndr, "ctr", r->out.ctr); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAddEntry(struct ndr_push *ndr, int flags, const struct drsuapi_DsAddEntry *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); + 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_out)); + NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAddEntry(struct ndr_pull *ndr, int flags, struct drsuapi_DsAddEntry *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_ctr_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsAddEntry(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsAddEntry *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsAddEntry"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsAddEntry"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsAddEntryRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsAddEntry"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_int32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); + ndr_print_drsuapi_DsAddEntryCtr(ndr, "ctr", r->out.ctr); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_EXECUTE_KCC(struct ndr_push *ndr, int flags, const struct DRSUAPI_EXECUTE_KCC *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_EXECUTE_KCC(struct ndr_pull *ndr, int flags, struct DRSUAPI_EXECUTE_KCC *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_EXECUTE_KCC(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_EXECUTE_KCC *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_EXECUTE_KCC"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_EXECUTE_KCC"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_EXECUTE_KCC"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfo(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaGetInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.info_type == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, *r->out.info_type)); + 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->out.info_type)); + NDR_CHECK(ndr_push_drsuapi_DsReplicaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfo(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaGetInfo *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_info_type_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.info_type); + ZERO_STRUCTP(r->out.info_type); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_type); + } + _mem_save_info_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->out.info_type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_type_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, *r->out.info_type)); + NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaGetInfo *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsReplicaGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_drsuapi_DsReplicaGetInfoLevel(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsReplicaGetInfoRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsReplicaGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info_type", r->out.info_type); + ndr->depth++; + ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", *r->out.info_type); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, *r->out.info_type); + ndr_print_drsuapi_DsReplicaInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_ADD_SID_HISTORY(struct ndr_push *ndr, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_ADD_SID_HISTORY(struct ndr_pull *ndr, int flags, struct DRSUAPI_ADD_SID_HISTORY *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_ADD_SID_HISTORY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_ADD_SID_HISTORY"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_ADD_SID_HISTORY"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_ADD_SID_HISTORY"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetMemberships2 *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); + 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_out)); + NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetMemberships2 *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_ctr_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships2 *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_DsGetMemberships2"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_DsGetMemberships2Request(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_DsGetMemberships2"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_int32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); + ndr_print_drsuapi_DsGetMemberships2Ctr(ndr, "ctr", r->out.ctr); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_VERIFY_OBJECTS"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_VERIFY_OBJECTS"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_VERIFY_OBJECTS"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_push *ndr, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_pull *ndr, int flags, struct DRSUAPI_GET_OBJECT_EXISTENCE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r) +{ + ndr_print_struct(ndr, name, "DRSUAPI_GET_OBJECT_EXISTENCE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "DRSUAPI_GET_OBJECT_EXISTENCE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "DRSUAPI_GET_OBJECT_EXISTENCE"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCost(struct ndr_push *ndr, int flags, const struct drsuapi_QuerySitesByCost *r) +{ + if (flags & NDR_IN) { + if (r->in.bind_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); + 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_out)); + NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCost(struct ndr_pull *ndr, int flags, struct drsuapi_QuerySitesByCost *r) +{ + TALLOC_CTX *_mem_save_bind_handle_0; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_ctr_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.bind_handle); + } + _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); + NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCost(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_QuerySitesByCost *r) +{ + ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCost"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "drsuapi_QuerySitesByCost"); + ndr->depth++; + ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); + ndr->depth--; + ndr_print_int32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_drsuapi_QuerySitesByCostRequest(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "drsuapi_QuerySitesByCost"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_int32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); + ndr_print_drsuapi_QuerySitesByCostCtr(ndr, "ctr", r->out.ctr); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call drsuapi_calls[] = { + { + "drsuapi_DsBind", + sizeof(struct drsuapi_DsBind), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsBind, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsBind, + (ndr_print_function_t) ndr_print_drsuapi_DsBind, + false, + }, + { + "drsuapi_DsUnbind", + sizeof(struct drsuapi_DsUnbind), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsUnbind, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsUnbind, + (ndr_print_function_t) ndr_print_drsuapi_DsUnbind, + false, + }, + { + "drsuapi_DsReplicaSync", + sizeof(struct drsuapi_DsReplicaSync), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaSync, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaSync, + (ndr_print_function_t) ndr_print_drsuapi_DsReplicaSync, + false, + }, + { + "drsuapi_DsGetNCChanges", + sizeof(struct drsuapi_DsGetNCChanges), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNCChanges, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNCChanges, + (ndr_print_function_t) ndr_print_drsuapi_DsGetNCChanges, + false, + }, + { + "drsuapi_DsReplicaUpdateRefs", + sizeof(struct drsuapi_DsReplicaUpdateRefs), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaUpdateRefs, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaUpdateRefs, + (ndr_print_function_t) ndr_print_drsuapi_DsReplicaUpdateRefs, + false, + }, + { + "DRSUAPI_REPLICA_ADD", + sizeof(struct DRSUAPI_REPLICA_ADD), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_ADD, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_ADD, + (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_ADD, + false, + }, + { + "DRSUAPI_REPLICA_DEL", + sizeof(struct DRSUAPI_REPLICA_DEL), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_DEL, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_DEL, + (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_DEL, + false, + }, + { + "DRSUAPI_REPLICA_MODIFY", + sizeof(struct DRSUAPI_REPLICA_MODIFY), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_MODIFY, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_MODIFY, + (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_MODIFY, + false, + }, + { + "DRSUAPI_VERIFY_NAMES", + sizeof(struct DRSUAPI_VERIFY_NAMES), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_VERIFY_NAMES, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_VERIFY_NAMES, + (ndr_print_function_t) ndr_print_DRSUAPI_VERIFY_NAMES, + false, + }, + { + "drsuapi_DsGetMemberships", + sizeof(struct drsuapi_DsGetMemberships), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships, + (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships, + false, + }, + { + "DRSUAPI_INTER_DOMAIN_MOVE", + sizeof(struct DRSUAPI_INTER_DOMAIN_MOVE), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_INTER_DOMAIN_MOVE, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_INTER_DOMAIN_MOVE, + (ndr_print_function_t) ndr_print_DRSUAPI_INTER_DOMAIN_MOVE, + false, + }, + { + "drsuapi_DsGetNT4ChangeLog", + sizeof(struct drsuapi_DsGetNT4ChangeLog), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNT4ChangeLog, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNT4ChangeLog, + (ndr_print_function_t) ndr_print_drsuapi_DsGetNT4ChangeLog, + false, + }, + { + "drsuapi_DsCrackNames", + sizeof(struct drsuapi_DsCrackNames), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsCrackNames, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsCrackNames, + (ndr_print_function_t) ndr_print_drsuapi_DsCrackNames, + false, + }, + { + "drsuapi_DsWriteAccountSpn", + sizeof(struct drsuapi_DsWriteAccountSpn), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsWriteAccountSpn, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsWriteAccountSpn, + (ndr_print_function_t) ndr_print_drsuapi_DsWriteAccountSpn, + false, + }, + { + "drsuapi_DsRemoveDSServer", + sizeof(struct drsuapi_DsRemoveDSServer), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsRemoveDSServer, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsRemoveDSServer, + (ndr_print_function_t) ndr_print_drsuapi_DsRemoveDSServer, + false, + }, + { + "DRSUAPI_REMOVE_DS_DOMAIN", + sizeof(struct DRSUAPI_REMOVE_DS_DOMAIN), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REMOVE_DS_DOMAIN, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REMOVE_DS_DOMAIN, + (ndr_print_function_t) ndr_print_DRSUAPI_REMOVE_DS_DOMAIN, + false, + }, + { + "drsuapi_DsGetDomainControllerInfo", + sizeof(struct drsuapi_DsGetDomainControllerInfo), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetDomainControllerInfo, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetDomainControllerInfo, + (ndr_print_function_t) ndr_print_drsuapi_DsGetDomainControllerInfo, + false, + }, + { + "drsuapi_DsAddEntry", + sizeof(struct drsuapi_DsAddEntry), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsAddEntry, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsAddEntry, + (ndr_print_function_t) ndr_print_drsuapi_DsAddEntry, + false, + }, + { + "DRSUAPI_EXECUTE_KCC", + sizeof(struct DRSUAPI_EXECUTE_KCC), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_EXECUTE_KCC, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_EXECUTE_KCC, + (ndr_print_function_t) ndr_print_DRSUAPI_EXECUTE_KCC, + false, + }, + { + "drsuapi_DsReplicaGetInfo", + sizeof(struct drsuapi_DsReplicaGetInfo), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaGetInfo, + (ndr_print_function_t) ndr_print_drsuapi_DsReplicaGetInfo, + false, + }, + { + "DRSUAPI_ADD_SID_HISTORY", + sizeof(struct DRSUAPI_ADD_SID_HISTORY), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_ADD_SID_HISTORY, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_ADD_SID_HISTORY, + (ndr_print_function_t) ndr_print_DRSUAPI_ADD_SID_HISTORY, + false, + }, + { + "drsuapi_DsGetMemberships2", + sizeof(struct drsuapi_DsGetMemberships2), + (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships2, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships2, + (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships2, + false, + }, + { + "DRSUAPI_REPLICA_VERIFY_OBJECTS", + sizeof(struct DRSUAPI_REPLICA_VERIFY_OBJECTS), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_VERIFY_OBJECTS, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_VERIFY_OBJECTS, + (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS, + false, + }, + { + "DRSUAPI_GET_OBJECT_EXISTENCE", + sizeof(struct DRSUAPI_GET_OBJECT_EXISTENCE), + (ndr_push_flags_fn_t) ndr_push_DRSUAPI_GET_OBJECT_EXISTENCE, + (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_GET_OBJECT_EXISTENCE, + (ndr_print_function_t) ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE, + false, + }, + { + "drsuapi_QuerySitesByCost", + sizeof(struct drsuapi_QuerySitesByCost), + (ndr_push_flags_fn_t) ndr_push_drsuapi_QuerySitesByCost, + (ndr_pull_flags_fn_t) ndr_pull_drsuapi_QuerySitesByCost, + (ndr_print_function_t) ndr_print_drsuapi_QuerySitesByCost, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const drsuapi_endpoint_strings[] = { + "ncacn_np:[\\pipe\\lsass]", + "ncacn_np:[\\pipe\\protected_storage]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array drsuapi_endpoints = { + .count = 4, + .names = drsuapi_endpoint_strings +}; + +static const char * const drsuapi_authservice_strings[] = { + "ldap", +}; + +static const struct ndr_interface_string_array drsuapi_authservices = { + .count = 1, + .names = drsuapi_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_drsuapi = { + .name = "drsuapi", + .syntax_id = { + {0xe3514235,0x4b06,0x11d1,{0xab,0x04},{0x00,0xc0,0x4f,0xc2,0xdc,0xd2}}, + NDR_DRSUAPI_VERSION + }, + .helpstring = NDR_DRSUAPI_HELPSTRING, + .num_calls = 25, + .calls = drsuapi_calls, + .endpoints = &drsuapi_endpoints, + .authservices = &drsuapi_authservices +}; + diff --git a/librpc/gen_ndr/ndr_drsuapi.h b/librpc/gen_ndr/ndr_drsuapi.h new file mode 100644 index 0000000000..4b5ead467f --- /dev/null +++ b/librpc/gen_ndr/ndr_drsuapi.h @@ -0,0 +1,301 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/drsuapi.h" + +#ifndef _HEADER_NDR_drsuapi +#define _HEADER_NDR_drsuapi + +#include "../librpc/ndr/ndr_drsuapi.h" +#define NDR_DRSUAPI_UUID "e3514235-4b06-11d1-ab04-00c04fc2dcd2" +#define NDR_DRSUAPI_VERSION 4.0 +#define NDR_DRSUAPI_NAME "drsuapi" +#define NDR_DRSUAPI_HELPSTRING "Active Directory Replication" +extern const struct ndr_interface_table ndr_table_drsuapi; +#define NDR_DRSUAPI_DSBIND (0x00) + +#define NDR_DRSUAPI_DSUNBIND (0x01) + +#define NDR_DRSUAPI_DSREPLICASYNC (0x02) + +#define NDR_DRSUAPI_DSGETNCCHANGES (0x03) + +#define NDR_DRSUAPI_DSREPLICAUPDATEREFS (0x04) + +#define NDR_DRSUAPI_REPLICA_ADD (0x05) + +#define NDR_DRSUAPI_REPLICA_DEL (0x06) + +#define NDR_DRSUAPI_REPLICA_MODIFY (0x07) + +#define NDR_DRSUAPI_VERIFY_NAMES (0x08) + +#define NDR_DRSUAPI_DSGETMEMBERSHIPS (0x09) + +#define NDR_DRSUAPI_INTER_DOMAIN_MOVE (0x0a) + +#define NDR_DRSUAPI_DSGETNT4CHANGELOG (0x0b) + +#define NDR_DRSUAPI_DSCRACKNAMES (0x0c) + +#define NDR_DRSUAPI_DSWRITEACCOUNTSPN (0x0d) + +#define NDR_DRSUAPI_DSREMOVEDSSERVER (0x0e) + +#define NDR_DRSUAPI_REMOVE_DS_DOMAIN (0x0f) + +#define NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO (0x10) + +#define NDR_DRSUAPI_DSADDENTRY (0x11) + +#define NDR_DRSUAPI_EXECUTE_KCC (0x12) + +#define NDR_DRSUAPI_DSREPLICAGETINFO (0x13) + +#define NDR_DRSUAPI_ADD_SID_HISTORY (0x14) + +#define NDR_DRSUAPI_DSGETMEMBERSHIPS2 (0x15) + +#define NDR_DRSUAPI_REPLICA_VERIFY_OBJECTS (0x16) + +#define NDR_DRSUAPI_GET_OBJECT_EXISTENCE (0x17) + +#define NDR_DRSUAPI_QUERYSITESBYCOST (0x18) + +#define NDR_DRSUAPI_CALL_COUNT (25) +void ndr_print_drsuapi_SupportedExtensions(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_drsuapi_SupportedExtensionsExt(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_drsuapi_DsBindInfo24(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo24 *r); +void ndr_print_drsuapi_DsBindInfo28(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo28 *r); +void ndr_print_drsuapi_DsBindInfo48(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo48 *r); +void ndr_print_drsuapi_DsBindInfoFallBack(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoFallBack *r); +void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r); +void ndr_print_drsuapi_DsBindInfoCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoCtr *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier *r); +void ndr_print_drsuapi_DsReplicaObjectIdentifier(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier *r); +size_t ndr_size_drsuapi_DsReplicaObjectIdentifier(const struct drsuapi_DsReplicaObjectIdentifier *r, int flags); +enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_drsuapi_DsReplicaSyncOptions(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_drsuapi_DsReplicaSyncRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaSyncRequest1 *r); +void ndr_print_drsuapi_DsReplicaSyncRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaSyncRequest *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaHighWaterMark(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaHighWaterMark *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaHighWaterMark(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaHighWaterMark *r); +void ndr_print_drsuapi_DsReplicaHighWaterMark(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaHighWaterMark *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor *r); +void ndr_print_drsuapi_DsReplicaCursor(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor *r); +void ndr_print_drsuapi_DsReplicaCursorCtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtrEx *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_drsuapi_DsReplicaNeighbourFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_drsuapi_DsExtendedOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedOperation r); +void ndr_print_drsuapi_DsExtendedError(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedError r); +void ndr_print_drsuapi_DsGetNCChangesRequest5(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest5 *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaOID(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOID *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOID *r); +void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r); +void ndr_print_drsuapi_DsReplicaOIDMapping(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping_Ctr *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping_Ctr *r); +void ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping_Ctr *r); +enum ndr_err_code ndr_push_drsuapi_DsAttributeId(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsAttributeId r); +enum ndr_err_code ndr_pull_drsuapi_DsAttributeId(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsAttributeId *r); +void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char *name, enum drsuapi_DsAttributeId r); +void ndr_print_drsuapi_DsPartialAttributeSet(struct ndr_print *ndr, const char *name, const struct drsuapi_DsPartialAttributeSet *r); +void ndr_print_drsuapi_DsGetNCChangesRequest8(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest8 *r); +void ndr_print_drsuapi_DsGetNCChangesRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesRequest *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2 *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2 *r); +void ndr_print_drsuapi_DsReplicaCursor2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2 *r); +void ndr_print_drsuapi_DsReplicaCursor2CtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2CtrEx *r); +void ndr_print_drsuapi_DsAttributeValue(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r); +void ndr_print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValueCtr *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3 *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3 *r); +void ndr_print_drsuapi_DsReplicaObjectIdentifier3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3 *r); +size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplicaObjectIdentifier3 *r, int flags); +enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r); +void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r); +size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags); +enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r); +void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r); +void ndr_print_drsuapi_DsReplicaAttributeCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttributeCtr *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_drsuapi_DsReplicaObjectFlags(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaObject(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObject *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaObject(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObject *r); +void ndr_print_drsuapi_DsReplicaObject(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObject *r); +void ndr_print_drsuapi_DsReplicaMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaData *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaDataCtr *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaDataCtr *r); +void ndr_print_drsuapi_DsReplicaMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaDataCtr *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItemEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItemEx *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItemEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItemEx *r); +void ndr_print_drsuapi_DsReplicaObjectListItemEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectListItemEx *r); +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1 *r); +enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1 *r); +void ndr_print_drsuapi_DsGetNCChangesCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1 *r); +size_t ndr_size_drsuapi_DsGetNCChangesCtr1(const struct drsuapi_DsGetNCChangesCtr1 *r, int flags); +enum ndr_err_code ndr_push_drsuapi_DsLinkedAttributeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_drsuapi_DsLinkedAttributeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_drsuapi_DsLinkedAttributeFlags(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaLinkedAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaLinkedAttribute *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaLinkedAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaLinkedAttribute *r); +void ndr_print_drsuapi_DsReplicaLinkedAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaLinkedAttribute *r); +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6 *r); +enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6 *r); +void ndr_print_drsuapi_DsGetNCChangesCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6 *r); +size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNCChangesCtr6 *r, int flags); +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r); +enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1TS *r); +void ndr_print_drsuapi_DsGetNCChangesCtr1TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1TS *r); +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6TS *r); +enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6TS *r); +void ndr_print_drsuapi_DsGetNCChangesCtr6TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6TS *r); +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r); +void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r); +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r); +void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r); +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r); +void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r); +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r); +void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r); +void ndr_print_drsuapi_DsGetNCChangesCompressionType(struct ndr_print *ndr, const char *name, enum drsuapi_DsGetNCChangesCompressionType r); +void ndr_print_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCompressedCtr *r); +void ndr_print_drsuapi_DsGetNCChangesCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr2 *r); +void ndr_print_drsuapi_DsGetNCChangesCtr7(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr7 *r); +void ndr_print_drsuapi_DsGetNCChangesCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCtr *r); +void ndr_print_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r); +void ndr_print_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaUpdateRefsRequest *r); +void ndr_print_drsuapi_DsReplicaAddOptions(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_drsuapi_DsReplicaDeleteOptions(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_drsuapi_DsReplicaModifyOptions(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_drsuapi_DsMembershipType(struct ndr_print *ndr, const char *name, enum drsuapi_DsMembershipType r); +void ndr_print_drsuapi_DsGetMembershipsCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsCtr1 *r); +void ndr_print_drsuapi_DsGetMembershipsCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsCtr *r); +void ndr_print_drsuapi_DsGetMembershipsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsRequest1 *r); +void ndr_print_drsuapi_DsGetMembershipsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsRequest *r); +void ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r); +void ndr_print_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogRequest *r); +void ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r); +void ndr_print_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogInfo *r); +void ndr_print_drsuapi_DsNameStatus(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameStatus r); +void ndr_print_drsuapi_DsNameFlags(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFlags r); +void ndr_print_drsuapi_DsNameFormat(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFormat r); +void ndr_print_drsuapi_DsNameString(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameString *r); +void ndr_print_drsuapi_DsNameRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameRequest1 *r); +void ndr_print_drsuapi_DsNameRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameRequest *r); +void ndr_print_drsuapi_DsNameInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameInfo1 *r); +void ndr_print_drsuapi_DsNameCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameCtr1 *r); +void ndr_print_drsuapi_DsNameCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameCtr *r); +void ndr_print_drsuapi_DsSpnOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsSpnOperation r); +void ndr_print_drsuapi_DsWriteAccountSpnRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnRequest1 *r); +void ndr_print_drsuapi_DsWriteAccountSpnRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnRequest *r); +void ndr_print_drsuapi_DsWriteAccountSpnResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnResult1 *r); +void ndr_print_drsuapi_DsWriteAccountSpnResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnResult *r); +void ndr_print_drsuapi_DsRemoveDSServerRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerRequest1 *r); +void ndr_print_drsuapi_DsRemoveDSServerRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerRequest *r); +void ndr_print_drsuapi_DsRemoveDSServerResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerResult1 *r); +void ndr_print_drsuapi_DsRemoveDSServerResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerResult *r); +void ndr_print_drsuapi_DsGetDCInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoRequest1 *r); +void ndr_print_drsuapi_DsGetDCInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoRequest *r); +void ndr_print_drsuapi_DsGetDCInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo1 *r); +void ndr_print_drsuapi_DsGetDCInfoCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr1 *r); +void ndr_print_drsuapi_DsGetDCInfo2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo2 *r); +void ndr_print_drsuapi_DsGetDCInfoCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr2 *r); +void ndr_print_drsuapi_DsGetDCInfo3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo3 *r); +void ndr_print_drsuapi_DsGetDCInfoCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr3 *r); +void ndr_print_drsuapi_DsGetDCConnection01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnection01 *r); +void ndr_print_drsuapi_DsGetDCConnectionCtr01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnectionCtr01 *r); +void ndr_print_drsuapi_DsGetDCInfoCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoCtr *r); +enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItem(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItem *r); +enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItem(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItem *r); +void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectListItem *r); +void ndr_print_drsuapi_DsAddEntryRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryRequest2 *r); +void ndr_print_drsuapi_DsAddEntryRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryRequest *r); +void ndr_print_drsuapi_DsAddEntryErrorInfoX(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfoX *r); +void ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraErrorBuffer *r); +void ndr_print_drsuapi_DsAddEntryExtraError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraError1 *r); +void ndr_print_drsuapi_DsAddEntryErrorListItem1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorListItem1 *r); +void ndr_print_drsuapi_DsAddEntryErrorInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfo1 *r); +void ndr_print_drsuapi_DsAddEntryErrorInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryErrorInfo *r); +void ndr_print_drsuapi_DsAddEntryError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryError1 *r); +void ndr_print_drsuapi_DsAddEntryError(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryError *r); +void ndr_print_drsuapi_DsReplicaObjectIdentifier2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier2 *r); +void ndr_print_drsuapi_DsAddEntryCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr2 *r); +void ndr_print_drsuapi_DsAddEntryCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr3 *r); +void ndr_print_drsuapi_DsAddEntryCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryCtr *r); +void ndr_print_drsuapi_DsReplicaGetInfoLevel(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaGetInfoLevel r); +void ndr_print_drsuapi_DsReplicaInfoType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaInfoType r); +void ndr_print_drsuapi_DsReplicaGetInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest1 *r); +void ndr_print_drsuapi_DsReplicaGetInfoRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest2 *r); +void ndr_print_drsuapi_DsReplicaGetInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaGetInfoRequest *r); +void ndr_print_drsuapi_DsReplicaNeighbour(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbour *r); +void ndr_print_drsuapi_DsReplicaNeighbourCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbourCtr *r); +void ndr_print_drsuapi_DsReplicaCursorCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtr *r); +void ndr_print_drsuapi_DsReplicaObjMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData *r); +void ndr_print_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaDataCtr *r); +void ndr_print_drsuapi_DsReplicaKccDsaFailure(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailure *r); +void ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r); +void ndr_print_drsuapi_DsReplicaOpType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaOpType r); +void ndr_print_drsuapi_DsRplicaOpOptions(struct ndr_print *ndr, const char *name, const union drsuapi_DsRplicaOpOptions *r); +void ndr_print_drsuapi_DsReplicaOp(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOp *r); +void ndr_print_drsuapi_DsReplicaOpCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOpCtr *r); +void ndr_print_drsuapi_DsReplicaAttrValMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData *r); +void ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r); +void ndr_print_drsuapi_DsReplicaCursor2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2Ctr *r); +void ndr_print_drsuapi_DsReplicaCursor3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3 *r); +void ndr_print_drsuapi_DsReplicaCursor3Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3Ctr *r); +void ndr_print_drsuapi_DsReplicaObjMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2 *r); +void ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2Ctr *r); +void ndr_print_drsuapi_DsReplicaAttrValMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2 *r); +void ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r); +void ndr_print_drsuapi_DsReplicaConnection04(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04 *r); +void ndr_print_drsuapi_DsReplicaConnection04Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04Ctr *r); +void ndr_print_drsuapi_DsReplica06(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06 *r); +void ndr_print_drsuapi_DsReplica06Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06Ctr *r); +void ndr_print_drsuapi_DsReplicaInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaInfo *r); +void ndr_print_drsuapi_DsGetMemberships2Ctr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Ctr *r); +void ndr_print_drsuapi_DsGetMemberships2Request1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMemberships2Request1 *r); +void ndr_print_drsuapi_DsGetMemberships2Request(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Request *r); +void ndr_print_drsuapi_DsSiteCostInfo(struct ndr_print *ndr, const char *name, const struct drsuapi_DsSiteCostInfo *r); +void ndr_print_drsuapi_QuerySitesByCostCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostCtr1 *r); +void ndr_print_drsuapi_QuerySitesByCostCtr(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostCtr *r); +void ndr_print_drsuapi_QuerySitesByCostRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostRequest1 *r); +void ndr_print_drsuapi_QuerySitesByCostRequest(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostRequest *r); +enum ndr_err_code ndr_push_drsuapi_DsBind(struct ndr_push *ndr, int flags, const struct drsuapi_DsBind *r); +enum ndr_err_code ndr_pull_drsuapi_DsBind(struct ndr_pull *ndr, int flags, struct drsuapi_DsBind *r); +void ndr_print_drsuapi_DsBind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsBind *r); +void ndr_print_drsuapi_DsUnbind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsUnbind *r); +void ndr_print_drsuapi_DsReplicaSync(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaSync *r); +void ndr_print_drsuapi_DsGetNCChanges(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNCChanges *r); +void ndr_print_drsuapi_DsReplicaUpdateRefs(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaUpdateRefs *r); +void ndr_print_DRSUAPI_REPLICA_ADD(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_ADD *r); +void ndr_print_DRSUAPI_REPLICA_DEL(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_DEL *r); +void ndr_print_DRSUAPI_REPLICA_MODIFY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_MODIFY *r); +void ndr_print_DRSUAPI_VERIFY_NAMES(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_VERIFY_NAMES *r); +void ndr_print_drsuapi_DsGetMemberships(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships *r); +void ndr_print_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r); +void ndr_print_drsuapi_DsGetNT4ChangeLog(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNT4ChangeLog *r); +void ndr_print_drsuapi_DsCrackNames(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsCrackNames *r); +void ndr_print_drsuapi_DsWriteAccountSpn(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsWriteAccountSpn *r); +void ndr_print_drsuapi_DsRemoveDSServer(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsRemoveDSServer *r); +void ndr_print_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r); +void ndr_print_drsuapi_DsGetDomainControllerInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetDomainControllerInfo *r); +enum ndr_err_code ndr_push_drsuapi_DsAddEntry(struct ndr_push *ndr, int flags, const struct drsuapi_DsAddEntry *r); +enum ndr_err_code ndr_pull_drsuapi_DsAddEntry(struct ndr_pull *ndr, int flags, struct drsuapi_DsAddEntry *r); +void ndr_print_drsuapi_DsAddEntry(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsAddEntry *r); +void ndr_print_DRSUAPI_EXECUTE_KCC(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_EXECUTE_KCC *r); +void ndr_print_drsuapi_DsReplicaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaGetInfo *r); +void ndr_print_DRSUAPI_ADD_SID_HISTORY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r); +void ndr_print_drsuapi_DsGetMemberships2(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships2 *r); +void ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r); +void ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r); +void ndr_print_drsuapi_QuerySitesByCost(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_QuerySitesByCost *r); +#endif /* _HEADER_NDR_drsuapi */ diff --git a/librpc/gen_ndr/ndr_dssetup.c b/librpc/gen_ndr/ndr_dssetup.c new file mode 100644 index 0000000000..0c02784db8 --- /dev/null +++ b/librpc/gen_ndr/ndr_dssetup.c @@ -0,0 +1,1082 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_dssetup.h" + +#include "librpc/gen_ndr/ndr_misc.h" +static enum ndr_err_code ndr_push_dssetup_DsRole(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRole r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRole(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRole *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRole(struct ndr_print *ndr, const char *name, enum dssetup_DsRole r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_STANDALONE_WORKSTATION: val = "DS_ROLE_STANDALONE_WORKSTATION"; break; + case DS_ROLE_MEMBER_WORKSTATION: val = "DS_ROLE_MEMBER_WORKSTATION"; break; + case DS_ROLE_STANDALONE_SERVER: val = "DS_ROLE_STANDALONE_SERVER"; break; + case DS_ROLE_MEMBER_SERVER: val = "DS_ROLE_MEMBER_SERVER"; break; + case DS_ROLE_BACKUP_DC: val = "DS_ROLE_BACKUP_DC"; break; + case DS_ROLE_PRIMARY_DC: val = "DS_ROLE_PRIMARY_DC"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DS_RUNNING", DS_ROLE_PRIMARY_DS_RUNNING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DS_MIXED_MODE", DS_ROLE_PRIMARY_DS_MIXED_MODE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_UPGRADE_IN_PROGRESS", DS_ROLE_UPGRADE_IN_PROGRESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRolePrimaryDomInfoBasic *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dssetup_DsRole(ndr, NDR_SCALARS, r->role)); + NDR_CHECK(ndr_push_dssetup_DsRoleFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_domain)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->dns_domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_domain, ndr_charset_length(r->dns_domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->forest) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->forest, ndr_charset_length(r->forest, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRolePrimaryDomInfoBasic *r) +{ + uint32_t _ptr_domain; + TALLOC_CTX *_mem_save_domain_0; + uint32_t _ptr_dns_domain; + TALLOC_CTX *_mem_save_dns_domain_0; + uint32_t _ptr_forest; + TALLOC_CTX *_mem_save_forest_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dssetup_DsRole(ndr, NDR_SCALARS, &r->role)); + NDR_CHECK(ndr_pull_dssetup_DsRoleFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_domain)); + if (_ptr_dns_domain) { + NDR_PULL_ALLOC(ndr, r->dns_domain); + } else { + r->dns_domain = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest)); + if (_ptr_forest) { + NDR_PULL_ALLOC(ndr, r->forest); + } else { + r->forest = NULL; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + if (r->dns_domain) { + _mem_save_dns_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dns_domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_domain)); + if (ndr_get_array_length(ndr, &r->dns_domain) > ndr_get_array_size(ndr, &r->dns_domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_domain), ndr_get_array_length(ndr, &r->dns_domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_domain, ndr_get_array_length(ndr, &r->dns_domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_domain_0, 0); + } + if (r->forest) { + _mem_save_forest_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->forest, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->forest)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->forest)); + if (ndr_get_array_length(ndr, &r->forest) > ndr_get_array_size(ndr, &r->forest)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->forest), ndr_get_array_length(ndr, &r->forest)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->forest), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->forest, ndr_get_array_length(ndr, &r->forest), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_print *ndr, const char *name, const struct dssetup_DsRolePrimaryDomInfoBasic *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRolePrimaryDomInfoBasic"); + ndr->depth++; + ndr_print_dssetup_DsRole(ndr, "role", r->role); + ndr_print_dssetup_DsRoleFlags(ndr, "flags", r->flags); + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + ndr_print_ptr(ndr, "dns_domain", r->dns_domain); + ndr->depth++; + if (r->dns_domain) { + ndr_print_string(ndr, "dns_domain", r->dns_domain); + } + ndr->depth--; + ndr_print_ptr(ndr, "forest", r->forest); + ndr->depth++; + if (r->forest) { + ndr_print_string(ndr, "forest", r->forest); + } + ndr->depth--; + ndr_print_GUID(ndr, "domain_guid", &r->domain_guid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsUpgrade(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsUpgrade r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsUpgrade(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsUpgrade *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsUpgrade(struct ndr_print *ndr, const char *name, enum dssetup_DsUpgrade r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_NOT_UPGRADING: val = "DS_ROLE_NOT_UPGRADING"; break; + case DS_ROLE_UPGRADING: val = "DS_ROLE_UPGRADING"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsPrevious(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsPrevious r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsPrevious(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsPrevious *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsPrevious(struct ndr_print *ndr, const char *name, enum dssetup_DsPrevious r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_PREVIOUS_UNKNOWN: val = "DS_ROLE_PREVIOUS_UNKNOWN"; break; + case DS_ROLE_PREVIOUS_PRIMARY: val = "DS_ROLE_PREVIOUS_PRIMARY"; break; + case DS_ROLE_PREVIOUS_BACKUP: val = "DS_ROLE_PREVIOUS_BACKUP"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleUpgradeStatus(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRoleUpgradeStatus *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dssetup_DsUpgrade(ndr, NDR_SCALARS, r->upgrading)); + NDR_CHECK(ndr_push_dssetup_DsPrevious(ndr, NDR_SCALARS, r->previous_role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleUpgradeStatus(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRoleUpgradeStatus *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dssetup_DsUpgrade(ndr, NDR_SCALARS, &r->upgrading)); + NDR_CHECK(ndr_pull_dssetup_DsPrevious(ndr, NDR_SCALARS, &r->previous_role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleUpgradeStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleUpgradeStatus *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleUpgradeStatus"); + ndr->depth++; + ndr_print_dssetup_DsUpgrade(ndr, "upgrading", r->upgrading); + ndr_print_dssetup_DsPrevious(ndr, "previous_role", r->previous_role); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleOp(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRoleOp r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleOp(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRoleOp *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleOp(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleOp r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_OP_IDLE: val = "DS_ROLE_OP_IDLE"; break; + case DS_ROLE_OP_ACTIVE: val = "DS_ROLE_OP_ACTIVE"; break; + case DS_ROLE_OP_NEEDS_REBOOT: val = "DS_ROLE_OP_NEEDS_REBOOT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleOpStatus(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRoleOpStatus *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_dssetup_DsRoleOp(ndr, NDR_SCALARS, r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleOpStatus(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRoleOpStatus *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_dssetup_DsRoleOp(ndr, NDR_SCALARS, &r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleOpStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleOpStatus *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleOpStatus"); + ndr->depth++; + ndr_print_dssetup_DsRoleOp(ndr, "status", r->status); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleInfoLevel(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRoleInfoLevel r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleInfoLevel(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRoleInfoLevel *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleInfoLevel(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleInfoLevel r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_BASIC_INFORMATION: val = "DS_ROLE_BASIC_INFORMATION"; break; + case DS_ROLE_UPGRADE_STATUS: val = "DS_ROLE_UPGRADE_STATUS"; break; + case DS_ROLE_OP_STATUS: val = "DS_ROLE_OP_STATUS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleInfo(struct ndr_push *ndr, int ndr_flags, const union dssetup_DsRoleInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, level)); + switch (level) { + case DS_ROLE_BASIC_INFORMATION: { + NDR_CHECK(ndr_push_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_SCALARS, &r->basic)); + break; } + + case DS_ROLE_UPGRADE_STATUS: { + NDR_CHECK(ndr_push_dssetup_DsRoleUpgradeStatus(ndr, NDR_SCALARS, &r->upgrade)); + break; } + + case DS_ROLE_OP_STATUS: { + NDR_CHECK(ndr_push_dssetup_DsRoleOpStatus(ndr, NDR_SCALARS, &r->opstatus)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case DS_ROLE_BASIC_INFORMATION: + NDR_CHECK(ndr_push_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_BUFFERS, &r->basic)); + break; + + case DS_ROLE_UPGRADE_STATUS: + break; + + case DS_ROLE_OP_STATUS: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleInfo(struct ndr_pull *ndr, int ndr_flags, union dssetup_DsRoleInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case DS_ROLE_BASIC_INFORMATION: { + NDR_CHECK(ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_SCALARS, &r->basic)); + break; } + + case DS_ROLE_UPGRADE_STATUS: { + NDR_CHECK(ndr_pull_dssetup_DsRoleUpgradeStatus(ndr, NDR_SCALARS, &r->upgrade)); + break; } + + case DS_ROLE_OP_STATUS: { + NDR_CHECK(ndr_pull_dssetup_DsRoleOpStatus(ndr, NDR_SCALARS, &r->opstatus)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case DS_ROLE_BASIC_INFORMATION: + NDR_CHECK(ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_BUFFERS, &r->basic)); + break; + + case DS_ROLE_UPGRADE_STATUS: + break; + + case DS_ROLE_OP_STATUS: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleInfo(struct ndr_print *ndr, const char *name, const union dssetup_DsRoleInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "dssetup_DsRoleInfo"); + switch (level) { + case DS_ROLE_BASIC_INFORMATION: + ndr_print_dssetup_DsRolePrimaryDomInfoBasic(ndr, "basic", &r->basic); + break; + + case DS_ROLE_UPGRADE_STATUS: + ndr_print_dssetup_DsRoleUpgradeStatus(ndr, "upgrade", &r->upgrade); + break; + + case DS_ROLE_OP_STATUS: + ndr_print_dssetup_DsRoleOpStatus(ndr, "opstatus", &r->opstatus); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); + if (r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_dssetup_DsRoleInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetPrimaryDomainInformation *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, &r->in.level)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->out.info); + } else { + r->out.info = NULL; + } + if (r->out.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_dssetup_DsRoleInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleGetPrimaryDomainInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleGetPrimaryDomainInformation"); + ndr->depth++; + ndr_print_dssetup_DsRoleInfoLevel(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleGetPrimaryDomainInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + if (r->out.info) { + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_dssetup_DsRoleInfo(ndr, "info", r->out.info); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleDnsNameToFlatName(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleDnsNameToFlatName(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDnsNameToFlatName *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleDnsNameToFlatName(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleDnsNameToFlatName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleDnsNameToFlatName"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleDnsNameToFlatName"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleDcAsDc(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDcAsDc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleDcAsDc(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDcAsDc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleDcAsDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsDc *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleDcAsDc"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleDcAsDc"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleDcAsDc"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleDcAsReplica(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDcAsReplica *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleDcAsReplica(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDcAsReplica *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleDcAsReplica(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsReplica *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleDcAsReplica"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleDcAsReplica"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleDcAsReplica"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleDemoteDc(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDemoteDc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleDemoteDc(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDemoteDc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleDemoteDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDemoteDc *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleDemoteDc"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleDemoteDc"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleDemoteDc"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleGetDcOperationProgress(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleGetDcOperationProgress(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetDcOperationProgress *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleGetDcOperationProgress(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleGetDcOperationProgress"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleGetDcOperationProgress"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleGetDcOperationProgress"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleGetDcOperationResults(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetDcOperationResults *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleGetDcOperationResults(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetDcOperationResults *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleGetDcOperationResults(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationResults *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleGetDcOperationResults"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleGetDcOperationResults"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleGetDcOperationResults"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleCancel(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleCancel *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleCancel(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleCancel *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleCancel(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleCancel *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleCancel"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleCancel"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleCancel"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleServerSaveStateForUpgrade *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleServerSaveStateForUpgrade"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleServerSaveStateForUpgrade"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleServerSaveStateForUpgrade"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleUpgradeDownlevelServer *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleUpgradeDownlevelServer"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleUpgradeDownlevelServer"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleUpgradeDownlevelServer"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleAbortDownlevelServerUpgrade *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleAbortDownlevelServerUpgrade"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleAbortDownlevelServerUpgrade"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleAbortDownlevelServerUpgrade"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call dssetup_calls[] = { + { + "dssetup_DsRoleGetPrimaryDomainInformation", + sizeof(struct dssetup_DsRoleGetPrimaryDomainInformation), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetPrimaryDomainInformation, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetPrimaryDomainInformation, + (ndr_print_function_t) ndr_print_dssetup_DsRoleGetPrimaryDomainInformation, + false, + }, + { + "dssetup_DsRoleDnsNameToFlatName", + sizeof(struct dssetup_DsRoleDnsNameToFlatName), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDnsNameToFlatName, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDnsNameToFlatName, + (ndr_print_function_t) ndr_print_dssetup_DsRoleDnsNameToFlatName, + false, + }, + { + "dssetup_DsRoleDcAsDc", + sizeof(struct dssetup_DsRoleDcAsDc), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsDc, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsDc, + (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsDc, + false, + }, + { + "dssetup_DsRoleDcAsReplica", + sizeof(struct dssetup_DsRoleDcAsReplica), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsReplica, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsReplica, + (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsReplica, + false, + }, + { + "dssetup_DsRoleDemoteDc", + sizeof(struct dssetup_DsRoleDemoteDc), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDemoteDc, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDemoteDc, + (ndr_print_function_t) ndr_print_dssetup_DsRoleDemoteDc, + false, + }, + { + "dssetup_DsRoleGetDcOperationProgress", + sizeof(struct dssetup_DsRoleGetDcOperationProgress), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationProgress, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationProgress, + (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationProgress, + false, + }, + { + "dssetup_DsRoleGetDcOperationResults", + sizeof(struct dssetup_DsRoleGetDcOperationResults), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationResults, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationResults, + (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationResults, + false, + }, + { + "dssetup_DsRoleCancel", + sizeof(struct dssetup_DsRoleCancel), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleCancel, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleCancel, + (ndr_print_function_t) ndr_print_dssetup_DsRoleCancel, + false, + }, + { + "dssetup_DsRoleServerSaveStateForUpgrade", + sizeof(struct dssetup_DsRoleServerSaveStateForUpgrade), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleServerSaveStateForUpgrade, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleServerSaveStateForUpgrade, + (ndr_print_function_t) ndr_print_dssetup_DsRoleServerSaveStateForUpgrade, + false, + }, + { + "dssetup_DsRoleUpgradeDownlevelServer", + sizeof(struct dssetup_DsRoleUpgradeDownlevelServer), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleUpgradeDownlevelServer, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleUpgradeDownlevelServer, + (ndr_print_function_t) ndr_print_dssetup_DsRoleUpgradeDownlevelServer, + false, + }, + { + "dssetup_DsRoleAbortDownlevelServerUpgrade", + sizeof(struct dssetup_DsRoleAbortDownlevelServerUpgrade), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleAbortDownlevelServerUpgrade, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleAbortDownlevelServerUpgrade, + (ndr_print_function_t) ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const dssetup_endpoint_strings[] = { + "ncacn_np:[\\pipe\\lsarpc]", + "ncacn_np:[\\pipe\\lsass]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array dssetup_endpoints = { + .count = 4, + .names = dssetup_endpoint_strings +}; + +static const char * const dssetup_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array dssetup_authservices = { + .count = 1, + .names = dssetup_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_dssetup = { + .name = "dssetup", + .syntax_id = { + {0x3919286a,0xb10c,0x11d0,{0x9b,0xa8},{0x00,0xc0,0x4f,0xd9,0x2e,0xf5}}, + NDR_DSSETUP_VERSION + }, + .helpstring = NDR_DSSETUP_HELPSTRING, + .num_calls = 11, + .calls = dssetup_calls, + .endpoints = &dssetup_endpoints, + .authservices = &dssetup_authservices +}; + diff --git a/librpc/gen_ndr/ndr_dssetup.h b/librpc/gen_ndr/ndr_dssetup.h new file mode 100644 index 0000000000..103ad116a3 --- /dev/null +++ b/librpc/gen_ndr/ndr_dssetup.h @@ -0,0 +1,58 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/dssetup.h" + +#ifndef _HEADER_NDR_dssetup +#define _HEADER_NDR_dssetup + +#define NDR_DSSETUP_UUID "3919286a-b10c-11d0-9ba8-00c04fd92ef5" +#define NDR_DSSETUP_VERSION 0.0 +#define NDR_DSSETUP_NAME "dssetup" +#define NDR_DSSETUP_HELPSTRING "Active Directory Setup" +extern const struct ndr_interface_table ndr_table_dssetup; +#define NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION (0x00) + +#define NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME (0x01) + +#define NDR_DSSETUP_DSROLEDCASDC (0x02) + +#define NDR_DSSETUP_DSROLEDCASREPLICA (0x03) + +#define NDR_DSSETUP_DSROLEDEMOTEDC (0x04) + +#define NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS (0x05) + +#define NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS (0x06) + +#define NDR_DSSETUP_DSROLECANCEL (0x07) + +#define NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE (0x08) + +#define NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER (0x09) + +#define NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE (0x0a) + +#define NDR_DSSETUP_CALL_COUNT (11) +void ndr_print_dssetup_DsRole(struct ndr_print *ndr, const char *name, enum dssetup_DsRole r); +void ndr_print_dssetup_DsRoleFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_print *ndr, const char *name, const struct dssetup_DsRolePrimaryDomInfoBasic *r); +void ndr_print_dssetup_DsUpgrade(struct ndr_print *ndr, const char *name, enum dssetup_DsUpgrade r); +void ndr_print_dssetup_DsPrevious(struct ndr_print *ndr, const char *name, enum dssetup_DsPrevious r); +void ndr_print_dssetup_DsRoleUpgradeStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleUpgradeStatus *r); +void ndr_print_dssetup_DsRoleOp(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleOp r); +void ndr_print_dssetup_DsRoleOpStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleOpStatus *r); +void ndr_print_dssetup_DsRoleInfoLevel(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleInfoLevel r); +void ndr_print_dssetup_DsRoleInfo(struct ndr_print *ndr, const char *name, const union dssetup_DsRoleInfo *r); +void ndr_print_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r); +void ndr_print_dssetup_DsRoleDnsNameToFlatName(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r); +void ndr_print_dssetup_DsRoleDcAsDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsDc *r); +void ndr_print_dssetup_DsRoleDcAsReplica(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsReplica *r); +void ndr_print_dssetup_DsRoleDemoteDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDemoteDc *r); +void ndr_print_dssetup_DsRoleGetDcOperationProgress(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r); +void ndr_print_dssetup_DsRoleGetDcOperationResults(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationResults *r); +void ndr_print_dssetup_DsRoleCancel(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleCancel *r); +void ndr_print_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r); +void ndr_print_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r); +void ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r); +#endif /* _HEADER_NDR_dssetup */ diff --git a/librpc/gen_ndr/ndr_echo.c b/librpc/gen_ndr/ndr_echo.c new file mode 100644 index 0000000000..99556e1bff --- /dev/null +++ b/librpc/gen_ndr/ndr_echo.c @@ -0,0 +1,1513 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_echo.h" + +_PUBLIC_ enum ndr_err_code ndr_push_echo_info1(struct ndr_push *ndr, int ndr_flags, const struct echo_info1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_echo_info1(struct ndr_pull *ndr, int ndr_flags, struct echo_info1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r) +{ + ndr_print_struct(ndr, name, "echo_info1"); + ndr->depth++; + ndr_print_uint8(ndr, "v", r->v); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_info2(struct ndr_push *ndr, int ndr_flags, const struct echo_info2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->v)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_info2(struct ndr_pull *ndr, int ndr_flags, struct echo_info2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->v)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_info2(struct ndr_print *ndr, const char *name, const struct echo_info2 *r) +{ + ndr_print_struct(ndr, name, "echo_info2"); + ndr->depth++; + ndr_print_uint16(ndr, "v", r->v); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_info3(struct ndr_push *ndr, int ndr_flags, const struct echo_info3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->v)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_info3(struct ndr_pull *ndr, int ndr_flags, struct echo_info3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->v)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_info3(struct ndr_print *ndr, const char *name, const struct echo_info3 *r) +{ + ndr_print_struct(ndr, name, "echo_info3"); + ndr->depth++; + ndr_print_uint32(ndr, "v", r->v); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_STRUCT_echo_info4(struct ndr_push *ndr, int ndr_flags, const struct echo_info4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_STRUCT_echo_info4(struct ndr_pull *ndr, int ndr_flags, struct echo_info4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_STRUCT_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r) +{ + ndr_print_struct(ndr, name, "echo_info4"); + ndr->depth++; + ndr_print_hyper(ndr, "v", r->v); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_info5(struct ndr_push *ndr, int ndr_flags, const struct echo_info5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_info5(struct ndr_pull *ndr, int ndr_flags, struct echo_info5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_info5(struct ndr_print *ndr, const char *name, const struct echo_info5 *r) +{ + ndr_print_struct(ndr, name, "echo_info5"); + ndr->depth++; + ndr_print_uint8(ndr, "v1", r->v1); + ndr_print_hyper(ndr, "v2", r->v2); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_info6(struct ndr_push *ndr, int ndr_flags, const struct echo_info6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1)); + NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_info6(struct ndr_pull *ndr, int ndr_flags, struct echo_info6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1)); + NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_info6(struct ndr_print *ndr, const char *name, const struct echo_info6 *r) +{ + ndr_print_struct(ndr, name, "echo_info6"); + ndr->depth++; + ndr_print_uint8(ndr, "v1", r->v1); + ndr_print_echo_info1(ndr, "info1", &r->info1); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_info7(struct ndr_push *ndr, int ndr_flags, const struct echo_info7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1)); + NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_info7(struct ndr_pull *ndr, int ndr_flags, struct echo_info7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1)); + NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_info7(struct ndr_print *ndr, const char *name, const struct echo_info7 *r) +{ + ndr_print_struct(ndr, name, "echo_info7"); + ndr->depth++; + ndr_print_uint8(ndr, "v1", r->v1); + ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_Info(struct ndr_push *ndr, int ndr_flags, const union echo_Info *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_echo_info2(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_echo_info3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_push_echo_info5(ndr, NDR_SCALARS, &r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_push_echo_info6(ndr, NDR_SCALARS, &r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_push_echo_info7(ndr, NDR_SCALARS, &r->info7)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + case 2: + break; + + case 3: + break; + + case 4: + break; + + case 5: + break; + + case 6: + break; + + case 7: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_Info(struct ndr_pull *ndr, int ndr_flags, union echo_Info *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_echo_info2(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_echo_info3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_pull_echo_info5(ndr, NDR_SCALARS, &r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_pull_echo_info6(ndr, NDR_SCALARS, &r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_pull_echo_info7(ndr, NDR_SCALARS, &r->info7)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + case 2: + break; + + case 3: + break; + + case 4: + break; + + case 5: + break; + + case 6: + break; + + case 7: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_Info(struct ndr_print *ndr, const char *name, const union echo_Info *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "echo_Info"); + switch (level) { + case 1: + ndr_print_echo_info1(ndr, "info1", &r->info1); + break; + + case 2: + ndr_print_echo_info2(ndr, "info2", &r->info2); + break; + + case 3: + ndr_print_echo_info3(ndr, "info3", &r->info3); + break; + + case 4: + ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4); + break; + + case 5: + ndr_print_echo_info5(ndr, "info5", &r->info5); + break; + + case 6: + ndr_print_echo_info6(ndr, "info6", &r->info6); + break; + + case 7: + ndr_print_echo_info7(ndr, "info7", &r->info7); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_echo_Enum1(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1 r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_Enum1(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1 *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_Enum1(struct ndr_print *ndr, const char *name, enum echo_Enum1 r) +{ + const char *val = NULL; + + switch (r) { + case ECHO_ENUM1: val = "ECHO_ENUM1"; break; + case ECHO_ENUM2: val = "ECHO_ENUM2"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_echo_Enum1_32(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1_32 r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_Enum1_32(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1_32 *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_Enum1_32(struct ndr_print *ndr, const char *name, enum echo_Enum1_32 r) +{ + const char *val = NULL; + + switch (r) { + case ECHO_ENUM1_32: val = "ECHO_ENUM1_32"; break; + case ECHO_ENUM2_32: val = "ECHO_ENUM2_32"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_echo_Enum2(struct ndr_push *ndr, int ndr_flags, const struct echo_Enum2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1)); + NDR_CHECK(ndr_push_echo_Enum1_32(ndr, NDR_SCALARS, r->e2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_Enum2(struct ndr_pull *ndr, int ndr_flags, struct echo_Enum2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1)); + NDR_CHECK(ndr_pull_echo_Enum1_32(ndr, NDR_SCALARS, &r->e2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_Enum2(struct ndr_print *ndr, const char *name, const struct echo_Enum2 *r) +{ + ndr_print_struct(ndr, name, "echo_Enum2"); + ndr->depth++; + ndr_print_echo_Enum1(ndr, "e1", r->e1); + ndr_print_echo_Enum1_32(ndr, "e2", r->e2); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_Enum3(struct ndr_push *ndr, int ndr_flags, const union echo_Enum3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case ECHO_ENUM1: { + NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1)); + break; } + + case ECHO_ENUM2: { + NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, &r->e2)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case ECHO_ENUM1: + break; + + case ECHO_ENUM2: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_Enum3(struct ndr_pull *ndr, int ndr_flags, union echo_Enum3 *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case ECHO_ENUM1: { + NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1)); + break; } + + case ECHO_ENUM2: { + NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, &r->e2)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case ECHO_ENUM1: + break; + + case ECHO_ENUM2: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_Enum3(struct ndr_print *ndr, const char *name, const union echo_Enum3 *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "echo_Enum3"); + switch (level) { + case ECHO_ENUM1: + ndr_print_echo_Enum1(ndr, "e1", r->e1); + break; + + case ECHO_ENUM2: + ndr_print_echo_Enum2(ndr, "e2", &r->e2); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_echo_Surrounding(struct ndr_push *ndr, int ndr_flags, const struct echo_Surrounding *r) +{ + uint32_t cntr_surrounding_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->x)); + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->x)); + for (cntr_surrounding_0 = 0; cntr_surrounding_0 < r->x; cntr_surrounding_0++) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->surrounding[cntr_surrounding_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_Surrounding(struct ndr_pull *ndr, int ndr_flags, struct echo_Surrounding *r) +{ + uint32_t cntr_surrounding_0; + TALLOC_CTX *_mem_save_surrounding_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->surrounding)); + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->x)); + NDR_PULL_ALLOC_N(ndr, r->surrounding, ndr_get_array_size(ndr, &r->surrounding)); + _mem_save_surrounding_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->surrounding, 0); + for (cntr_surrounding_0 = 0; cntr_surrounding_0 < r->x; cntr_surrounding_0++) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->surrounding[cntr_surrounding_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_surrounding_0, 0); + if (r->surrounding) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->surrounding, r->x)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name, const struct echo_Surrounding *r) +{ + uint32_t cntr_surrounding_0; + ndr_print_struct(ndr, name, "echo_Surrounding"); + ndr->depth++; + ndr_print_uint32(ndr, "x", r->x); + ndr->print(ndr, "%s: ARRAY(%d)", "surrounding", (int)r->x); + ndr->depth++; + for (cntr_surrounding_0=0;cntr_surrounding_0x;cntr_surrounding_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_surrounding_0) != -1) { + ndr_print_uint16(ndr, "surrounding", r->surrounding[cntr_surrounding_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_AddOne(struct ndr_push *ndr, int flags, const struct echo_AddOne *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data)); + } + if (flags & NDR_OUT) { + 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 NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_AddOne(struct ndr_pull *ndr, int flags, struct echo_AddOne *r) +{ + TALLOC_CTX *_mem_save_out_data_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data)); + NDR_PULL_ALLOC(ndr, r->out.out_data); + ZERO_STRUCTP(r->out.out_data); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.out_data); + } + _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, const struct echo_AddOne *r) +{ + ndr_print_struct(ndr, name, "echo_AddOne"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_AddOne"); + ndr->depth++; + ndr_print_uint32(ndr, "in_data", r->in.in_data); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_AddOne"); + ndr->depth++; + ndr_print_ptr(ndr, "out_data", r->out.out_data); + ndr->depth++; + ndr_print_uint32(ndr, "out_data", *r->out.out_data); + ndr->depth--; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_EchoData(struct ndr_push *ndr, int flags, const struct echo_EchoData *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.in_data, r->in.len)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.out_data, r->in.len)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_EchoData(struct ndr_pull *ndr, int flags, struct echo_EchoData *r) +{ + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.in_data)); + NDR_PULL_ALLOC_N(ndr, r->in.in_data, ndr_get_array_size(ndr, &r->in.in_data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.in_data, ndr_get_array_size(ndr, &r->in.in_data))); + if (r->in.in_data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.in_data, r->in.len)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.out_data)); + NDR_PULL_ALLOC_N(ndr, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data))); + if (r->out.out_data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.out_data, r->in.len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, const struct echo_EchoData *r) +{ + ndr_print_struct(ndr, name, "echo_EchoData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_EchoData"); + ndr->depth++; + ndr_print_uint32(ndr, "len", r->in.len); + ndr_print_array_uint8(ndr, "in_data", r->in.in_data, r->in.len); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_EchoData"); + ndr->depth++; + ndr_print_array_uint8(ndr, "out_data", r->out.out_data, r->in.len); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_SinkData(struct ndr_push *ndr, int flags, const struct echo_SinkData *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, r->in.len)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_SinkData(struct ndr_pull *ndr, int flags, struct echo_SinkData *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data)); + NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_size(ndr, &r->in.data))); + if (r->in.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, r->in.len)); + } + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SinkData *r) +{ + ndr_print_struct(ndr, name, "echo_SinkData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_SinkData"); + ndr->depth++; + ndr_print_uint32(ndr, "len", r->in.len); + ndr_print_array_uint8(ndr, "data", r->in.data, r->in.len); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_SinkData"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_SourceData(struct ndr_push *ndr, int flags, const struct echo_SourceData *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.len)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_SourceData(struct ndr_pull *ndr, int flags, struct echo_SourceData *r) +{ + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data)); + NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_size(ndr, &r->out.data))); + if (r->out.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_SourceData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SourceData *r) +{ + ndr_print_struct(ndr, name, "echo_SourceData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_SourceData"); + ndr->depth++; + ndr_print_uint32(ndr, "len", r->in.len); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_SourceData"); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->out.data, r->in.len); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.s2)); + if (*r->out.s2) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.s2, ndr_charset_length(*r->out.s2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_TestCall(struct ndr_pull *ndr, int flags, struct echo_TestCall *r) +{ + uint32_t _ptr_s2; + TALLOC_CTX *_mem_save_s2_0; + TALLOC_CTX *_mem_save_s2_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.s1)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.s1)); + if (ndr_get_array_length(ndr, &r->in.s1) > ndr_get_array_size(ndr, &r->in.s1)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.s1), ndr_get_array_length(ndr, &r->in.s1)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.s1), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.s1, ndr_get_array_length(ndr, &r->in.s1), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_ALLOC(ndr, r->out.s2); + ZERO_STRUCTP(r->out.s2); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.s2); + } + _mem_save_s2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.s2, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s2)); + if (_ptr_s2) { + NDR_PULL_ALLOC(ndr, *r->out.s2); + } else { + *r->out.s2 = NULL; + } + if (*r->out.s2) { + _mem_save_s2_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.s2, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.s2)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.s2)); + if (ndr_get_array_length(ndr, r->out.s2) > ndr_get_array_size(ndr, r->out.s2)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.s2), ndr_get_array_length(ndr, r->out.s2)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.s2, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_0, LIBNDR_FLAG_REF_ALLOC); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall *r) +{ + ndr_print_struct(ndr, name, "echo_TestCall"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_TestCall"); + ndr->depth++; + ndr_print_ptr(ndr, "s1", r->in.s1); + ndr->depth++; + ndr_print_string(ndr, "s1", r->in.s1); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_TestCall"); + ndr->depth++; + ndr_print_ptr(ndr, "s2", r->out.s2); + ndr->depth++; + ndr_print_ptr(ndr, "s2", *r->out.s2); + ndr->depth++; + if (*r->out.s2) { + ndr_print_string(ndr, "s2", *r->out.s2); + } + ndr->depth--; + ndr->depth--; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_TestCall2(struct ndr_push *ndr, int flags, const struct echo_TestCall2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_TestCall2(struct ndr_pull *ndr, int flags, struct echo_TestCall2 *r) +{ + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_echo_Info(ndr, NDR_SCALARS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_TestCall2(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall2 *r) +{ + ndr_print_struct(ndr, name, "echo_TestCall2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_TestCall2"); + ndr->depth++; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_TestCall2"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_echo_Info(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_echo_TestSleep(struct ndr_push *ndr, int flags, const struct echo_TestSleep *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.seconds)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_TestSleep(struct ndr_pull *ndr, int flags, struct echo_TestSleep *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.seconds)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_TestSleep(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSleep *r) +{ + ndr_print_struct(ndr, name, "echo_TestSleep"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_TestSleep"); + ndr->depth++; + ndr_print_uint32(ndr, "seconds", r->in.seconds); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_TestSleep"); + ndr->depth++; + ndr_print_uint32(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 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 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 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 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_TestEnum(struct ndr_pull *ndr, int flags, struct echo_TestEnum *r) +{ + TALLOC_CTX *_mem_save_foo1_0; + TALLOC_CTX *_mem_save_foo2_0; + TALLOC_CTX *_mem_save_foo3_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.foo1); + } + _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.foo1, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->in.foo1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.foo2); + } + _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.foo2, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->in.foo2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.foo3); + } + _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.foo3, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.foo3, *r->in.foo1)); + NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->in.foo3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.foo1); + *r->out.foo1 = *r->in.foo1; + NDR_PULL_ALLOC(ndr, r->out.foo2); + *r->out.foo2 = *r->in.foo2; + NDR_PULL_ALLOC(ndr, r->out.foo3); + *r->out.foo3 = *r->in.foo3; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.foo1); + } + _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.foo1, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->out.foo1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.foo2); + } + _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.foo2, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->out.foo2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.foo3); + } + _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.foo3, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.foo3, *r->out.foo1)); + NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->out.foo3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestEnum *r) +{ + ndr_print_struct(ndr, name, "echo_TestEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_TestEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "foo1", r->in.foo1); + ndr->depth++; + ndr_print_echo_Enum1(ndr, "foo1", *r->in.foo1); + ndr->depth--; + ndr_print_ptr(ndr, "foo2", r->in.foo2); + ndr->depth++; + ndr_print_echo_Enum2(ndr, "foo2", r->in.foo2); + ndr->depth--; + ndr_print_ptr(ndr, "foo3", r->in.foo3); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.foo3, *r->in.foo1); + ndr_print_echo_Enum3(ndr, "foo3", r->in.foo3); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_TestEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "foo1", r->out.foo1); + ndr->depth++; + ndr_print_echo_Enum1(ndr, "foo1", *r->out.foo1); + ndr->depth--; + ndr_print_ptr(ndr, "foo2", r->out.foo2); + ndr->depth++; + ndr_print_echo_Enum2(ndr, "foo2", r->out.foo2); + ndr->depth--; + ndr_print_ptr(ndr, "foo3", r->out.foo3); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.foo3, *r->out.foo1); + ndr_print_echo_Enum3(ndr, "foo3", r->out.foo3); + ndr->depth--; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->out.data)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_TestSurrounding(struct ndr_pull *ndr, int flags, struct echo_TestSurrounding *r) +{ + TALLOC_CTX *_mem_save_data_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.data); + } + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->in.data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.data); + *r->out.data = *r->in.data; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.data); + } + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->out.data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSurrounding *r) +{ + ndr_print_struct(ndr, name, "echo_TestSurrounding"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_TestSurrounding"); + ndr->depth++; + ndr_print_ptr(ndr, "data", r->in.data); + ndr->depth++; + ndr_print_echo_Surrounding(ndr, "data", r->in.data); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_TestSurrounding"); + ndr->depth++; + ndr_print_ptr(ndr, "data", r->out.data); + ndr->depth++; + ndr_print_echo_Surrounding(ndr, "data", r->out.data); + ndr->depth--; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.data)); + if (*r->in.data) { + NDR_CHECK(ndr_push_unique_ptr(ndr, **r->in.data)); + if (**r->in.data) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ***r->in.data)); + } + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_echo_TestDoublePointer(struct ndr_pull *ndr, int flags, struct echo_TestDoublePointer *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + TALLOC_CTX *_mem_save_data_1; + TALLOC_CTX *_mem_save_data_2; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.data); + } + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, *r->in.data); + } else { + *r->in.data = NULL; + } + if (*r->in.data) { + _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.data, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, **r->in.data); + } else { + **r->in.data = NULL; + } + if (**r->in.data) { + _mem_save_data_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, **r->in.data, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, **r->in.data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_2, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestDoublePointer *r) +{ + ndr_print_struct(ndr, name, "echo_TestDoublePointer"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "echo_TestDoublePointer"); + ndr->depth++; + ndr_print_ptr(ndr, "data", r->in.data); + ndr->depth++; + ndr_print_ptr(ndr, "data", *r->in.data); + ndr->depth++; + if (*r->in.data) { + ndr_print_ptr(ndr, "data", **r->in.data); + ndr->depth++; + if (**r->in.data) { + ndr_print_uint16(ndr, "data", ***r->in.data); + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "echo_TestDoublePointer"); + ndr->depth++; + ndr_print_uint16(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call rpcecho_calls[] = { + { + "echo_AddOne", + sizeof(struct echo_AddOne), + (ndr_push_flags_fn_t) ndr_push_echo_AddOne, + (ndr_pull_flags_fn_t) ndr_pull_echo_AddOne, + (ndr_print_function_t) ndr_print_echo_AddOne, + false, + }, + { + "echo_EchoData", + sizeof(struct echo_EchoData), + (ndr_push_flags_fn_t) ndr_push_echo_EchoData, + (ndr_pull_flags_fn_t) ndr_pull_echo_EchoData, + (ndr_print_function_t) ndr_print_echo_EchoData, + false, + }, + { + "echo_SinkData", + sizeof(struct echo_SinkData), + (ndr_push_flags_fn_t) ndr_push_echo_SinkData, + (ndr_pull_flags_fn_t) ndr_pull_echo_SinkData, + (ndr_print_function_t) ndr_print_echo_SinkData, + false, + }, + { + "echo_SourceData", + sizeof(struct echo_SourceData), + (ndr_push_flags_fn_t) ndr_push_echo_SourceData, + (ndr_pull_flags_fn_t) ndr_pull_echo_SourceData, + (ndr_print_function_t) ndr_print_echo_SourceData, + false, + }, + { + "echo_TestCall", + sizeof(struct echo_TestCall), + (ndr_push_flags_fn_t) ndr_push_echo_TestCall, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall, + (ndr_print_function_t) ndr_print_echo_TestCall, + false, + }, + { + "echo_TestCall2", + sizeof(struct echo_TestCall2), + (ndr_push_flags_fn_t) ndr_push_echo_TestCall2, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall2, + (ndr_print_function_t) ndr_print_echo_TestCall2, + false, + }, + { + "echo_TestSleep", + sizeof(struct echo_TestSleep), + (ndr_push_flags_fn_t) ndr_push_echo_TestSleep, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestSleep, + (ndr_print_function_t) ndr_print_echo_TestSleep, + false, + }, + { + "echo_TestEnum", + sizeof(struct echo_TestEnum), + (ndr_push_flags_fn_t) ndr_push_echo_TestEnum, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestEnum, + (ndr_print_function_t) ndr_print_echo_TestEnum, + false, + }, + { + "echo_TestSurrounding", + sizeof(struct echo_TestSurrounding), + (ndr_push_flags_fn_t) ndr_push_echo_TestSurrounding, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestSurrounding, + (ndr_print_function_t) ndr_print_echo_TestSurrounding, + false, + }, + { + "echo_TestDoublePointer", + sizeof(struct echo_TestDoublePointer), + (ndr_push_flags_fn_t) ndr_push_echo_TestDoublePointer, + (ndr_pull_flags_fn_t) ndr_pull_echo_TestDoublePointer, + (ndr_print_function_t) ndr_print_echo_TestDoublePointer, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const rpcecho_endpoint_strings[] = { + "ncacn_np:[\\pipe\\rpcecho]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array rpcecho_endpoints = { + .count = 3, + .names = rpcecho_endpoint_strings +}; + +static const char * const rpcecho_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array rpcecho_authservices = { + .count = 1, + .names = rpcecho_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_rpcecho = { + .name = "rpcecho", + .syntax_id = { + {0x60a15ec5,0x4de8,0x11d7,{0xa6,0x37},{0x00,0x50,0x56,0xa2,0x01,0x82}}, + NDR_RPCECHO_VERSION + }, + .helpstring = NDR_RPCECHO_HELPSTRING, + .num_calls = 10, + .calls = rpcecho_calls, + .endpoints = &rpcecho_endpoints, + .authservices = &rpcecho_authservices +}; + diff --git a/librpc/gen_ndr/ndr_echo.h b/librpc/gen_ndr/ndr_echo.h new file mode 100644 index 0000000000..c1c7716573 --- /dev/null +++ b/librpc/gen_ndr/ndr_echo.h @@ -0,0 +1,60 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/echo.h" + +#ifndef _HEADER_NDR_rpcecho +#define _HEADER_NDR_rpcecho + +#define NDR_RPCECHO_UUID "60a15ec5-4de8-11d7-a637-005056a20182" +#define NDR_RPCECHO_VERSION 1.0 +#define NDR_RPCECHO_NAME "rpcecho" +#define NDR_RPCECHO_HELPSTRING "Simple echo pipe" +extern const struct ndr_interface_table ndr_table_rpcecho; +#define NDR_ECHO_ADDONE (0x00) + +#define NDR_ECHO_ECHODATA (0x01) + +#define NDR_ECHO_SINKDATA (0x02) + +#define NDR_ECHO_SOURCEDATA (0x03) + +#define NDR_ECHO_TESTCALL (0x04) + +#define NDR_ECHO_TESTCALL2 (0x05) + +#define NDR_ECHO_TESTSLEEP (0x06) + +#define NDR_ECHO_TESTENUM (0x07) + +#define NDR_ECHO_TESTSURROUNDING (0x08) + +#define NDR_ECHO_TESTDOUBLEPOINTER (0x09) + +#define NDR_RPCECHO_CALL_COUNT (10) +enum ndr_err_code ndr_push_echo_info1(struct ndr_push *ndr, int ndr_flags, const struct echo_info1 *r); +enum ndr_err_code ndr_pull_echo_info1(struct ndr_pull *ndr, int ndr_flags, struct echo_info1 *r); +void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r); +void ndr_print_echo_info2(struct ndr_print *ndr, const char *name, const struct echo_info2 *r); +void ndr_print_echo_info3(struct ndr_print *ndr, const char *name, const struct echo_info3 *r); +void ndr_print_STRUCT_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r); +void ndr_print_echo_info5(struct ndr_print *ndr, const char *name, const struct echo_info5 *r); +void ndr_print_echo_info6(struct ndr_print *ndr, const char *name, const struct echo_info6 *r); +void ndr_print_echo_info7(struct ndr_print *ndr, const char *name, const struct echo_info7 *r); +void ndr_print_echo_Info(struct ndr_print *ndr, const char *name, const union echo_Info *r); +void ndr_print_echo_Enum1(struct ndr_print *ndr, const char *name, enum echo_Enum1 r); +void ndr_print_echo_Enum1_32(struct ndr_print *ndr, const char *name, enum echo_Enum1_32 r); +void ndr_print_echo_Enum2(struct ndr_print *ndr, const char *name, const struct echo_Enum2 *r); +void ndr_print_echo_Enum3(struct ndr_print *ndr, const char *name, const union echo_Enum3 *r); +void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name, const struct echo_Surrounding *r); +void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, const struct echo_AddOne *r); +void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, const struct echo_EchoData *r); +void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SinkData *r); +void ndr_print_echo_SourceData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SourceData *r); +void ndr_print_echo_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall *r); +void ndr_print_echo_TestCall2(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall2 *r); +void ndr_print_echo_TestSleep(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSleep *r); +void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestEnum *r); +void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSurrounding *r); +void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestDoublePointer *r); +#endif /* _HEADER_NDR_rpcecho */ diff --git a/librpc/gen_ndr/ndr_epmapper.c b/librpc/gen_ndr/ndr_epmapper.c new file mode 100644 index 0000000000..0f1005dda7 --- /dev/null +++ b/librpc/gen_ndr/ndr_epmapper.c @@ -0,0 +1,2692 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_epmapper.h" + +#include "librpc/gen_ndr/ndr_misc.h" +static enum ndr_err_code ndr_push_epm_protocol(struct ndr_push *ndr, int ndr_flags, enum epm_protocol r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_protocol(struct ndr_pull *ndr, int ndr_flags, enum epm_protocol *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_protocol(struct ndr_print *ndr, const char *name, enum epm_protocol r) +{ + const char *val = NULL; + + switch (r) { + case EPM_PROTOCOL_DNET_NSP: val = "EPM_PROTOCOL_DNET_NSP"; break; + case EPM_PROTOCOL_OSI_TP4: val = "EPM_PROTOCOL_OSI_TP4"; break; + case EPM_PROTOCOL_OSI_CLNS: val = "EPM_PROTOCOL_OSI_CLNS"; break; + case EPM_PROTOCOL_TCP: val = "EPM_PROTOCOL_TCP"; break; + case EPM_PROTOCOL_UDP: val = "EPM_PROTOCOL_UDP"; break; + case EPM_PROTOCOL_IP: val = "EPM_PROTOCOL_IP"; break; + case EPM_PROTOCOL_NCADG: val = "EPM_PROTOCOL_NCADG"; break; + case EPM_PROTOCOL_NCACN: val = "EPM_PROTOCOL_NCACN"; break; + case EPM_PROTOCOL_NCALRPC: val = "EPM_PROTOCOL_NCALRPC"; break; + case EPM_PROTOCOL_UUID: val = "EPM_PROTOCOL_UUID"; break; + case EPM_PROTOCOL_IPX: val = "EPM_PROTOCOL_IPX"; break; + case EPM_PROTOCOL_SMB: val = "EPM_PROTOCOL_SMB"; break; + case EPM_PROTOCOL_PIPE: val = "EPM_PROTOCOL_PIPE"; break; + case EPM_PROTOCOL_NETBIOS: val = "EPM_PROTOCOL_NETBIOS"; break; + case EPM_PROTOCOL_NETBEUI: val = "EPM_PROTOCOL_NETBEUI"; break; + case EPM_PROTOCOL_SPX: val = "EPM_PROTOCOL_SPX"; break; + case EPM_PROTOCOL_NB_IPX: val = "EPM_PROTOCOL_NB_IPX"; break; + case EPM_PROTOCOL_DSP: val = "EPM_PROTOCOL_DSP"; break; + case EPM_PROTOCOL_DDP: val = "EPM_PROTOCOL_DDP"; break; + case EPM_PROTOCOL_APPLETALK: val = "EPM_PROTOCOL_APPLETALK"; break; + case EPM_PROTOCOL_VINES_SPP: val = "EPM_PROTOCOL_VINES_SPP"; break; + case EPM_PROTOCOL_VINES_IPC: val = "EPM_PROTOCOL_VINES_IPC"; break; + case EPM_PROTOCOL_STREETTALK: val = "EPM_PROTOCOL_STREETTALK"; break; + case EPM_PROTOCOL_HTTP: val = "EPM_PROTOCOL_HTTP"; break; + case EPM_PROTOCOL_UNIX_DS: val = "EPM_PROTOCOL_UNIX_DS"; break; + case EPM_PROTOCOL_NULL: val = "EPM_PROTOCOL_NULL"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_epm_rhs_dnet_nsp(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_dnet_nsp *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_dnet_nsp(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_dnet_nsp *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_dnet_nsp(struct ndr_print *ndr, const char *name, const struct epm_rhs_dnet_nsp *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_dnet_nsp"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_osi_tp4(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_osi_tp4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_osi_tp4(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_osi_tp4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_osi_tp4(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_tp4 *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_osi_tp4"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_osi_clns(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_osi_clns *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_osi_clns(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_osi_clns *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_osi_clns(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_clns *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_osi_clns"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_udp(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_udp *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_udp(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_udp *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_udp(struct ndr_print *ndr, const char *name, const struct epm_rhs_udp *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_udp"); + ndr->depth++; + ndr_print_uint16(ndr, "port", r->port); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_tcp(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_tcp *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_tcp(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_tcp *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_tcp(struct ndr_print *ndr, const char *name, const struct epm_rhs_tcp *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_tcp"); + ndr->depth++; + ndr_print_uint16(ndr, "port", r->port); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_ip(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ip *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipaddr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_ip(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ip *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipaddr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_ip(struct ndr_print *ndr, const char *name, const struct epm_rhs_ip *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_ip"); + ndr->depth++; + ndr_print_ipv4address(ndr, "ipaddr", r->ipaddr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_ncadg(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ncadg *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->minor_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_ncadg(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ncadg *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->minor_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_ncadg(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncadg *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_ncadg"); + ndr->depth++; + ndr_print_uint16(ndr, "minor_version", r->minor_version); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_ncacn(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ncacn *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->minor_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_ncacn(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ncacn *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->minor_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_ncacn(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncacn *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_ncacn"); + ndr->depth++; + ndr_print_uint16(ndr, "minor_version", r->minor_version); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_uuid(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_uuid *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->unknown)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_uuid(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_uuid *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->unknown)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_uuid(struct ndr_print *ndr, const char *name, const struct epm_rhs_uuid *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_uuid"); + ndr->depth++; + ndr_print_DATA_BLOB(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_ipx(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ipx *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_ipx(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ipx *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_ipx *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_ipx"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_smb(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_smb *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unc)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_smb(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_smb *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unc)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_smb(struct ndr_print *ndr, const char *name, const struct epm_rhs_smb *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_smb"); + ndr->depth++; + ndr_print_string(ndr, "unc", r->unc); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_pipe(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_pipe *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->path)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_pipe(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_pipe *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_pipe(struct ndr_print *ndr, const char *name, const struct epm_rhs_pipe *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_pipe"); + ndr->depth++; + ndr_print_string(ndr, "path", r->path); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_netbios(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_netbios *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_netbios(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_netbios *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_netbios(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbios *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_netbios"); + ndr->depth++; + ndr_print_string(ndr, "name", r->name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_netbeui(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_netbeui *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_netbeui(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_netbeui *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_netbeui(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbeui *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_netbeui"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_spx(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_spx *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_spx(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_spx *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_spx(struct ndr_print *ndr, const char *name, const struct epm_rhs_spx *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_spx"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_nb_ipx(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_nb_ipx *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_nb_ipx(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_nb_ipx *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_nb_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_nb_ipx *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_nb_ipx"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_http(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_http *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_http(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_http *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_http(struct ndr_print *ndr, const char *name, const struct epm_rhs_http *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_http"); + ndr->depth++; + ndr_print_uint16(ndr, "port", r->port); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_unix_ds(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_unix_ds *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->path)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_unix_ds(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_unix_ds *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_unix_ds(struct ndr_print *ndr, const char *name, const struct epm_rhs_unix_ds *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_unix_ds"); + ndr->depth++; + ndr_print_string(ndr, "path", r->path); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_null(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_null *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_null(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_null *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_null(struct ndr_print *ndr, const char *name, const struct epm_rhs_null *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_null"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_ncalrpc(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ncalrpc *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->minor_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_ncalrpc(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ncalrpc *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->minor_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_ncalrpc(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncalrpc *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_ncalrpc"); + ndr->depth++; + ndr_print_uint16(ndr, "minor_version", r->minor_version); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_appletalk(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_appletalk *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_appletalk(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_appletalk *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_appletalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_appletalk *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_appletalk"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_atalk_stream(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_atalk_stream *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_atalk_stream(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_atalk_stream *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_atalk_stream(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_stream *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_atalk_stream"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_atalk_datagram(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_atalk_datagram *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_atalk_datagram(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_atalk_datagram *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_atalk_datagram(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_datagram *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_atalk_datagram"); + ndr->depth++; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_vines_spp(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_vines_spp *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_vines_spp(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_vines_spp *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_vines_spp(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_spp *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_vines_spp"); + ndr->depth++; + ndr_print_uint16(ndr, "port", r->port); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_vines_ipc(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_vines_ipc *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_vines_ipc(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_vines_ipc *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_vines_ipc(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_ipc *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_vines_ipc"); + ndr->depth++; + ndr_print_uint16(ndr, "port", r->port); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs_streettalk(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_streettalk *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->streettalk)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs_streettalk(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_streettalk *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->streettalk)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs_streettalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_streettalk *r) +{ + ndr_print_struct(ndr, name, "epm_rhs_streettalk"); + ndr->depth++; + ndr_print_string(ndr, "streettalk", r->streettalk); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_rhs(struct ndr_push *ndr, int ndr_flags, const union epm_rhs *r) +{ + { + uint32_t _flags_save_UNION = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case EPM_PROTOCOL_DNET_NSP: { + NDR_CHECK(ndr_push_epm_rhs_dnet_nsp(ndr, NDR_SCALARS, &r->dnet_nsp)); + break; } + + case EPM_PROTOCOL_OSI_TP4: { + NDR_CHECK(ndr_push_epm_rhs_osi_tp4(ndr, NDR_SCALARS, &r->osi_tp4)); + break; } + + case EPM_PROTOCOL_OSI_CLNS: { + NDR_CHECK(ndr_push_epm_rhs_osi_clns(ndr, NDR_SCALARS, &r->osi_clns)); + break; } + + case EPM_PROTOCOL_TCP: { + NDR_CHECK(ndr_push_epm_rhs_tcp(ndr, NDR_SCALARS, &r->tcp)); + break; } + + case EPM_PROTOCOL_UDP: { + NDR_CHECK(ndr_push_epm_rhs_udp(ndr, NDR_SCALARS, &r->udp)); + break; } + + case EPM_PROTOCOL_IP: { + NDR_CHECK(ndr_push_epm_rhs_ip(ndr, NDR_SCALARS, &r->ip)); + break; } + + case EPM_PROTOCOL_NCADG: { + NDR_CHECK(ndr_push_epm_rhs_ncadg(ndr, NDR_SCALARS, &r->ncadg)); + break; } + + case EPM_PROTOCOL_NCACN: { + NDR_CHECK(ndr_push_epm_rhs_ncacn(ndr, NDR_SCALARS, &r->ncacn)); + break; } + + case EPM_PROTOCOL_NCALRPC: { + NDR_CHECK(ndr_push_epm_rhs_ncalrpc(ndr, NDR_SCALARS, &r->ncalrpc)); + break; } + + case EPM_PROTOCOL_UUID: { + NDR_CHECK(ndr_push_epm_rhs_uuid(ndr, NDR_SCALARS, &r->uuid)); + break; } + + case EPM_PROTOCOL_IPX: { + NDR_CHECK(ndr_push_epm_rhs_ipx(ndr, NDR_SCALARS, &r->ipx)); + break; } + + case EPM_PROTOCOL_SMB: { + NDR_CHECK(ndr_push_epm_rhs_smb(ndr, NDR_SCALARS, &r->smb)); + break; } + + case EPM_PROTOCOL_PIPE: { + NDR_CHECK(ndr_push_epm_rhs_pipe(ndr, NDR_SCALARS, &r->pipe)); + break; } + + case EPM_PROTOCOL_NETBIOS: { + NDR_CHECK(ndr_push_epm_rhs_netbios(ndr, NDR_SCALARS, &r->netbios)); + break; } + + case EPM_PROTOCOL_NETBEUI: { + NDR_CHECK(ndr_push_epm_rhs_netbeui(ndr, NDR_SCALARS, &r->netbeui)); + break; } + + case EPM_PROTOCOL_SPX: { + NDR_CHECK(ndr_push_epm_rhs_spx(ndr, NDR_SCALARS, &r->spx)); + break; } + + case EPM_PROTOCOL_NB_IPX: { + NDR_CHECK(ndr_push_epm_rhs_nb_ipx(ndr, NDR_SCALARS, &r->nb_ipx)); + break; } + + case EPM_PROTOCOL_DSP: { + NDR_CHECK(ndr_push_epm_rhs_atalk_stream(ndr, NDR_SCALARS, &r->atalk_stream)); + break; } + + case EPM_PROTOCOL_DDP: { + NDR_CHECK(ndr_push_epm_rhs_atalk_datagram(ndr, NDR_SCALARS, &r->atalk_datagram)); + break; } + + case EPM_PROTOCOL_APPLETALK: { + NDR_CHECK(ndr_push_epm_rhs_appletalk(ndr, NDR_SCALARS, &r->appletalk)); + break; } + + case EPM_PROTOCOL_VINES_SPP: { + NDR_CHECK(ndr_push_epm_rhs_vines_spp(ndr, NDR_SCALARS, &r->vines_spp)); + break; } + + case EPM_PROTOCOL_VINES_IPC: { + NDR_CHECK(ndr_push_epm_rhs_vines_ipc(ndr, NDR_SCALARS, &r->vines_ipc)); + break; } + + case EPM_PROTOCOL_STREETTALK: { + NDR_CHECK(ndr_push_epm_rhs_streettalk(ndr, NDR_SCALARS, &r->streettalk)); + break; } + + case EPM_PROTOCOL_HTTP: { + NDR_CHECK(ndr_push_epm_rhs_http(ndr, NDR_SCALARS, &r->http)); + break; } + + case EPM_PROTOCOL_UNIX_DS: { + NDR_CHECK(ndr_push_epm_rhs_unix_ds(ndr, NDR_SCALARS, &r->unix_ds)); + break; } + + case EPM_PROTOCOL_NULL: { + NDR_CHECK(ndr_push_epm_rhs_null(ndr, NDR_SCALARS, &r->null)); + break; } + + default: { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->unknown)); + ndr->flags = _flags_save_DATA_BLOB; + } + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case EPM_PROTOCOL_DNET_NSP: + break; + + case EPM_PROTOCOL_OSI_TP4: + break; + + case EPM_PROTOCOL_OSI_CLNS: + break; + + case EPM_PROTOCOL_TCP: + break; + + case EPM_PROTOCOL_UDP: + break; + + case EPM_PROTOCOL_IP: + break; + + case EPM_PROTOCOL_NCADG: + break; + + case EPM_PROTOCOL_NCACN: + break; + + case EPM_PROTOCOL_NCALRPC: + break; + + case EPM_PROTOCOL_UUID: + break; + + case EPM_PROTOCOL_IPX: + break; + + case EPM_PROTOCOL_SMB: + break; + + case EPM_PROTOCOL_PIPE: + break; + + case EPM_PROTOCOL_NETBIOS: + break; + + case EPM_PROTOCOL_NETBEUI: + break; + + case EPM_PROTOCOL_SPX: + break; + + case EPM_PROTOCOL_NB_IPX: + break; + + case EPM_PROTOCOL_DSP: + break; + + case EPM_PROTOCOL_DDP: + break; + + case EPM_PROTOCOL_APPLETALK: + break; + + case EPM_PROTOCOL_VINES_SPP: + break; + + case EPM_PROTOCOL_VINES_IPC: + break; + + case EPM_PROTOCOL_STREETTALK: + break; + + case EPM_PROTOCOL_HTTP: + break; + + case EPM_PROTOCOL_UNIX_DS: + break; + + case EPM_PROTOCOL_NULL: + break; + + default: + break; + + } + } + ndr->flags = _flags_save_UNION; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_rhs(struct ndr_pull *ndr, int ndr_flags, union epm_rhs *r) +{ + int level; + { + uint32_t _flags_save_UNION = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case EPM_PROTOCOL_DNET_NSP: { + NDR_CHECK(ndr_pull_epm_rhs_dnet_nsp(ndr, NDR_SCALARS, &r->dnet_nsp)); + break; } + + case EPM_PROTOCOL_OSI_TP4: { + NDR_CHECK(ndr_pull_epm_rhs_osi_tp4(ndr, NDR_SCALARS, &r->osi_tp4)); + break; } + + case EPM_PROTOCOL_OSI_CLNS: { + NDR_CHECK(ndr_pull_epm_rhs_osi_clns(ndr, NDR_SCALARS, &r->osi_clns)); + break; } + + case EPM_PROTOCOL_TCP: { + NDR_CHECK(ndr_pull_epm_rhs_tcp(ndr, NDR_SCALARS, &r->tcp)); + break; } + + case EPM_PROTOCOL_UDP: { + NDR_CHECK(ndr_pull_epm_rhs_udp(ndr, NDR_SCALARS, &r->udp)); + break; } + + case EPM_PROTOCOL_IP: { + NDR_CHECK(ndr_pull_epm_rhs_ip(ndr, NDR_SCALARS, &r->ip)); + break; } + + case EPM_PROTOCOL_NCADG: { + NDR_CHECK(ndr_pull_epm_rhs_ncadg(ndr, NDR_SCALARS, &r->ncadg)); + break; } + + case EPM_PROTOCOL_NCACN: { + NDR_CHECK(ndr_pull_epm_rhs_ncacn(ndr, NDR_SCALARS, &r->ncacn)); + break; } + + case EPM_PROTOCOL_NCALRPC: { + NDR_CHECK(ndr_pull_epm_rhs_ncalrpc(ndr, NDR_SCALARS, &r->ncalrpc)); + break; } + + case EPM_PROTOCOL_UUID: { + NDR_CHECK(ndr_pull_epm_rhs_uuid(ndr, NDR_SCALARS, &r->uuid)); + break; } + + case EPM_PROTOCOL_IPX: { + NDR_CHECK(ndr_pull_epm_rhs_ipx(ndr, NDR_SCALARS, &r->ipx)); + break; } + + case EPM_PROTOCOL_SMB: { + NDR_CHECK(ndr_pull_epm_rhs_smb(ndr, NDR_SCALARS, &r->smb)); + break; } + + case EPM_PROTOCOL_PIPE: { + NDR_CHECK(ndr_pull_epm_rhs_pipe(ndr, NDR_SCALARS, &r->pipe)); + break; } + + case EPM_PROTOCOL_NETBIOS: { + NDR_CHECK(ndr_pull_epm_rhs_netbios(ndr, NDR_SCALARS, &r->netbios)); + break; } + + case EPM_PROTOCOL_NETBEUI: { + NDR_CHECK(ndr_pull_epm_rhs_netbeui(ndr, NDR_SCALARS, &r->netbeui)); + break; } + + case EPM_PROTOCOL_SPX: { + NDR_CHECK(ndr_pull_epm_rhs_spx(ndr, NDR_SCALARS, &r->spx)); + break; } + + case EPM_PROTOCOL_NB_IPX: { + NDR_CHECK(ndr_pull_epm_rhs_nb_ipx(ndr, NDR_SCALARS, &r->nb_ipx)); + break; } + + case EPM_PROTOCOL_DSP: { + NDR_CHECK(ndr_pull_epm_rhs_atalk_stream(ndr, NDR_SCALARS, &r->atalk_stream)); + break; } + + case EPM_PROTOCOL_DDP: { + NDR_CHECK(ndr_pull_epm_rhs_atalk_datagram(ndr, NDR_SCALARS, &r->atalk_datagram)); + break; } + + case EPM_PROTOCOL_APPLETALK: { + NDR_CHECK(ndr_pull_epm_rhs_appletalk(ndr, NDR_SCALARS, &r->appletalk)); + break; } + + case EPM_PROTOCOL_VINES_SPP: { + NDR_CHECK(ndr_pull_epm_rhs_vines_spp(ndr, NDR_SCALARS, &r->vines_spp)); + break; } + + case EPM_PROTOCOL_VINES_IPC: { + NDR_CHECK(ndr_pull_epm_rhs_vines_ipc(ndr, NDR_SCALARS, &r->vines_ipc)); + break; } + + case EPM_PROTOCOL_STREETTALK: { + NDR_CHECK(ndr_pull_epm_rhs_streettalk(ndr, NDR_SCALARS, &r->streettalk)); + break; } + + case EPM_PROTOCOL_HTTP: { + NDR_CHECK(ndr_pull_epm_rhs_http(ndr, NDR_SCALARS, &r->http)); + break; } + + case EPM_PROTOCOL_UNIX_DS: { + NDR_CHECK(ndr_pull_epm_rhs_unix_ds(ndr, NDR_SCALARS, &r->unix_ds)); + break; } + + case EPM_PROTOCOL_NULL: { + NDR_CHECK(ndr_pull_epm_rhs_null(ndr, NDR_SCALARS, &r->null)); + break; } + + default: { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->unknown)); + ndr->flags = _flags_save_DATA_BLOB; + } + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case EPM_PROTOCOL_DNET_NSP: + break; + + case EPM_PROTOCOL_OSI_TP4: + break; + + case EPM_PROTOCOL_OSI_CLNS: + break; + + case EPM_PROTOCOL_TCP: + break; + + case EPM_PROTOCOL_UDP: + break; + + case EPM_PROTOCOL_IP: + break; + + case EPM_PROTOCOL_NCADG: + break; + + case EPM_PROTOCOL_NCACN: + break; + + case EPM_PROTOCOL_NCALRPC: + break; + + case EPM_PROTOCOL_UUID: + break; + + case EPM_PROTOCOL_IPX: + break; + + case EPM_PROTOCOL_SMB: + break; + + case EPM_PROTOCOL_PIPE: + break; + + case EPM_PROTOCOL_NETBIOS: + break; + + case EPM_PROTOCOL_NETBEUI: + break; + + case EPM_PROTOCOL_SPX: + break; + + case EPM_PROTOCOL_NB_IPX: + break; + + case EPM_PROTOCOL_DSP: + break; + + case EPM_PROTOCOL_DDP: + break; + + case EPM_PROTOCOL_APPLETALK: + break; + + case EPM_PROTOCOL_VINES_SPP: + break; + + case EPM_PROTOCOL_VINES_IPC: + break; + + case EPM_PROTOCOL_STREETTALK: + break; + + case EPM_PROTOCOL_HTTP: + break; + + case EPM_PROTOCOL_UNIX_DS: + break; + + case EPM_PROTOCOL_NULL: + break; + + default: + break; + + } + } + ndr->flags = _flags_save_UNION; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_rhs(struct ndr_print *ndr, const char *name, const union epm_rhs *r) +{ + int level; + { + uint32_t _flags_save_UNION = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "epm_rhs"); + switch (level) { + case EPM_PROTOCOL_DNET_NSP: + ndr_print_epm_rhs_dnet_nsp(ndr, "dnet_nsp", &r->dnet_nsp); + break; + + case EPM_PROTOCOL_OSI_TP4: + ndr_print_epm_rhs_osi_tp4(ndr, "osi_tp4", &r->osi_tp4); + break; + + case EPM_PROTOCOL_OSI_CLNS: + ndr_print_epm_rhs_osi_clns(ndr, "osi_clns", &r->osi_clns); + break; + + case EPM_PROTOCOL_TCP: + ndr_print_epm_rhs_tcp(ndr, "tcp", &r->tcp); + break; + + case EPM_PROTOCOL_UDP: + ndr_print_epm_rhs_udp(ndr, "udp", &r->udp); + break; + + case EPM_PROTOCOL_IP: + ndr_print_epm_rhs_ip(ndr, "ip", &r->ip); + break; + + case EPM_PROTOCOL_NCADG: + ndr_print_epm_rhs_ncadg(ndr, "ncadg", &r->ncadg); + break; + + case EPM_PROTOCOL_NCACN: + ndr_print_epm_rhs_ncacn(ndr, "ncacn", &r->ncacn); + break; + + case EPM_PROTOCOL_NCALRPC: + ndr_print_epm_rhs_ncalrpc(ndr, "ncalrpc", &r->ncalrpc); + break; + + case EPM_PROTOCOL_UUID: + ndr_print_epm_rhs_uuid(ndr, "uuid", &r->uuid); + break; + + case EPM_PROTOCOL_IPX: + ndr_print_epm_rhs_ipx(ndr, "ipx", &r->ipx); + break; + + case EPM_PROTOCOL_SMB: + ndr_print_epm_rhs_smb(ndr, "smb", &r->smb); + break; + + case EPM_PROTOCOL_PIPE: + ndr_print_epm_rhs_pipe(ndr, "pipe", &r->pipe); + break; + + case EPM_PROTOCOL_NETBIOS: + ndr_print_epm_rhs_netbios(ndr, "netbios", &r->netbios); + break; + + case EPM_PROTOCOL_NETBEUI: + ndr_print_epm_rhs_netbeui(ndr, "netbeui", &r->netbeui); + break; + + case EPM_PROTOCOL_SPX: + ndr_print_epm_rhs_spx(ndr, "spx", &r->spx); + break; + + case EPM_PROTOCOL_NB_IPX: + ndr_print_epm_rhs_nb_ipx(ndr, "nb_ipx", &r->nb_ipx); + break; + + case EPM_PROTOCOL_DSP: + ndr_print_epm_rhs_atalk_stream(ndr, "atalk_stream", &r->atalk_stream); + break; + + case EPM_PROTOCOL_DDP: + ndr_print_epm_rhs_atalk_datagram(ndr, "atalk_datagram", &r->atalk_datagram); + break; + + case EPM_PROTOCOL_APPLETALK: + ndr_print_epm_rhs_appletalk(ndr, "appletalk", &r->appletalk); + break; + + case EPM_PROTOCOL_VINES_SPP: + ndr_print_epm_rhs_vines_spp(ndr, "vines_spp", &r->vines_spp); + break; + + case EPM_PROTOCOL_VINES_IPC: + ndr_print_epm_rhs_vines_ipc(ndr, "vines_ipc", &r->vines_ipc); + break; + + case EPM_PROTOCOL_STREETTALK: + ndr_print_epm_rhs_streettalk(ndr, "streettalk", &r->streettalk); + break; + + case EPM_PROTOCOL_HTTP: + ndr_print_epm_rhs_http(ndr, "http", &r->http); + break; + + case EPM_PROTOCOL_UNIX_DS: + ndr_print_epm_rhs_unix_ds(ndr, "unix_ds", &r->unix_ds); + break; + + case EPM_PROTOCOL_NULL: + ndr_print_epm_rhs_null(ndr, "null", &r->null); + break; + + default: + ndr_print_DATA_BLOB(ndr, "unknown", r->unknown); + break; + + } + ndr->flags = _flags_save_UNION; + } +} + +static enum ndr_err_code ndr_push_epm_lhs(struct ndr_push *ndr, int ndr_flags, const struct epm_lhs *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_epm_protocol(ndr, NDR_SCALARS, r->protocol)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->lhs_data)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_lhs(struct ndr_pull *ndr, int ndr_flags, struct epm_lhs *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_epm_protocol(ndr, NDR_SCALARS, &r->protocol)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->lhs_data)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_lhs(struct ndr_print *ndr, const char *name, const struct epm_lhs *r) +{ + ndr_print_struct(ndr, name, "epm_lhs"); + ndr->depth++; + ndr_print_epm_protocol(ndr, "protocol", r->protocol); + ndr_print_DATA_BLOB(ndr, "lhs_data", r->lhs_data); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_floor(struct ndr_push *ndr, int ndr_flags, const struct epm_floor *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + { + struct ndr_push *_ndr_lhs; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_lhs, 2, -1)); + NDR_CHECK(ndr_push_epm_lhs(_ndr_lhs, NDR_SCALARS, &r->lhs)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_lhs, 2, -1)); + } + { + struct ndr_push *_ndr_rhs; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_rhs, 2, -1)); + NDR_CHECK(ndr_push_set_switch_value(_ndr_rhs, &r->rhs, r->lhs.protocol)); + NDR_CHECK(ndr_push_epm_rhs(_ndr_rhs, NDR_SCALARS, &r->rhs)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_rhs, 2, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_floor(struct ndr_pull *ndr, int ndr_flags, struct epm_floor *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + { + struct ndr_pull *_ndr_lhs; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_lhs, 2, -1)); + NDR_CHECK(ndr_pull_epm_lhs(_ndr_lhs, NDR_SCALARS, &r->lhs)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_lhs, 2, -1)); + } + { + struct ndr_pull *_ndr_rhs; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_rhs, 2, -1)); + NDR_CHECK(ndr_pull_set_switch_value(_ndr_rhs, &r->rhs, r->lhs.protocol)); + NDR_CHECK(ndr_pull_epm_rhs(_ndr_rhs, NDR_SCALARS, &r->rhs)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_rhs, 2, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_floor(struct ndr_print *ndr, const char *name, const struct epm_floor *r) +{ + ndr_print_struct(ndr, name, "epm_floor"); + ndr->depth++; + ndr_print_epm_lhs(ndr, "lhs", &r->lhs); + ndr_print_set_switch_value(ndr, &r->rhs, r->lhs.protocol); + ndr_print_epm_rhs(ndr, "rhs", &r->rhs); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_tower(struct ndr_push *ndr, int ndr_flags, const struct epm_tower *r) +{ + uint32_t cntr_floors_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_floors)); + for (cntr_floors_0 = 0; cntr_floors_0 < r->num_floors; cntr_floors_0++) { + NDR_CHECK(ndr_push_epm_floor(ndr, NDR_SCALARS, &r->floors[cntr_floors_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_tower(struct ndr_pull *ndr, int ndr_flags, struct epm_tower *r) +{ + uint32_t cntr_floors_0; + TALLOC_CTX *_mem_save_floors_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_floors)); + NDR_PULL_ALLOC_N(ndr, r->floors, r->num_floors); + _mem_save_floors_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->floors, 0); + for (cntr_floors_0 = 0; cntr_floors_0 < r->num_floors; cntr_floors_0++) { + NDR_CHECK(ndr_pull_epm_floor(ndr, NDR_SCALARS, &r->floors[cntr_floors_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_floors_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_tower(struct ndr_print *ndr, const char *name, const struct epm_tower *r) +{ + uint32_t cntr_floors_0; + ndr_print_struct(ndr, name, "epm_tower"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN); + ndr->depth++; + ndr_print_uint16(ndr, "num_floors", r->num_floors); + ndr->print(ndr, "%s: ARRAY(%d)", "floors", (int)r->num_floors); + ndr->depth++; + for (cntr_floors_0=0;cntr_floors_0num_floors;cntr_floors_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_floors_0) != -1) { + ndr_print_epm_floor(ndr, "floors", &r->floors[cntr_floors_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static size_t ndr_size_epm_tower(const struct epm_tower *r, int flags) +{ + flags |= LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN; + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_epm_tower); +} + +static enum ndr_err_code ndr_push_epm_twr_t(struct ndr_push *ndr, int ndr_flags, const struct epm_twr_t *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_epm_tower(&r->tower, ndr->flags))); + { + struct ndr_push *_ndr_tower; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_tower, 4, -1)); + NDR_CHECK(ndr_push_epm_tower(_ndr_tower, NDR_SCALARS, &r->tower)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_tower, 4, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_twr_t(struct ndr_pull *ndr, int ndr_flags, struct epm_twr_t *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tower_length)); + { + struct ndr_pull *_ndr_tower; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_tower, 4, -1)); + NDR_CHECK(ndr_pull_epm_tower(_ndr_tower, NDR_SCALARS, &r->tower)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_tower, 4, -1)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_twr_t(struct ndr_print *ndr, const char *name, const struct epm_twr_t *r) +{ + ndr_print_struct(ndr, name, "epm_twr_t"); + ndr->depth++; + ndr_print_uint32(ndr, "tower_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_epm_tower(&r->tower, ndr->flags):r->tower_length); + ndr_print_epm_tower(ndr, "tower", &r->tower); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_entry_t(struct ndr_push *ndr, int ndr_flags, const struct epm_entry_t *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object)); + NDR_CHECK(ndr_push_full_ptr(ndr, r->tower)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen(r->annotation) + 1)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->annotation, strlen(r->annotation) + 1, sizeof(uint8_t), CH_DOS)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->tower) { + NDR_CHECK(ndr_push_epm_twr_t(ndr, NDR_SCALARS, r->tower)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_entry_t(struct ndr_pull *ndr, int ndr_flags, struct epm_entry_t *r) +{ + uint32_t _ptr_tower; + TALLOC_CTX *_mem_save_tower_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->object)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_tower)); + if (_ptr_tower) { + NDR_PULL_ALLOC(ndr, r->tower); + } else { + r->tower = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__annotation_offset)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__annotation_length)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->annotation, r->__annotation_length, sizeof(uint8_t), CH_DOS)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->tower) { + _mem_save_tower_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->tower, 0); + NDR_CHECK(ndr_pull_epm_twr_t(ndr, NDR_SCALARS, r->tower)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tower_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_entry_t(struct ndr_print *ndr, const char *name, const struct epm_entry_t *r) +{ + ndr_print_struct(ndr, name, "epm_entry_t"); + ndr->depth++; + ndr_print_GUID(ndr, "object", &r->object); + ndr_print_ptr(ndr, "tower", r->tower); + ndr->depth++; + if (r->tower) { + ndr_print_epm_twr_t(ndr, "tower", r->tower); + } + ndr->depth--; + ndr_print_uint32(ndr, "__annotation_offset", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->__annotation_offset); + ndr_print_uint32(ndr, "__annotation_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->annotation) + 1:r->__annotation_length); + ndr_print_string(ndr, "annotation", r->annotation); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_rpc_if_id_t(struct ndr_push *ndr, int ndr_flags, const struct rpc_if_id_t *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->vers_major)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->vers_minor)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_rpc_if_id_t(struct ndr_pull *ndr, int ndr_flags, struct rpc_if_id_t *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->vers_major)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->vers_minor)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_rpc_if_id_t(struct ndr_print *ndr, const char *name, const struct rpc_if_id_t *r) +{ + ndr_print_struct(ndr, name, "rpc_if_id_t"); + ndr->depth++; + ndr_print_GUID(ndr, "uuid", &r->uuid); + ndr_print_uint16(ndr, "vers_major", r->vers_major); + ndr_print_uint16(ndr, "vers_minor", r->vers_minor); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_twr_p_t(struct ndr_push *ndr, int ndr_flags, const struct epm_twr_p_t *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_full_ptr(ndr, r->twr)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->twr) { + NDR_CHECK(ndr_push_epm_twr_t(ndr, NDR_SCALARS, r->twr)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_twr_p_t(struct ndr_pull *ndr, int ndr_flags, struct epm_twr_p_t *r) +{ + uint32_t _ptr_twr; + TALLOC_CTX *_mem_save_twr_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_twr)); + if (_ptr_twr) { + NDR_PULL_ALLOC(ndr, r->twr); + } else { + r->twr = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->twr) { + _mem_save_twr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->twr, 0); + NDR_CHECK(ndr_pull_epm_twr_t(ndr, NDR_SCALARS, r->twr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_twr_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_twr_p_t(struct ndr_print *ndr, const char *name, const struct epm_twr_p_t *r) +{ + ndr_print_struct(ndr, name, "epm_twr_p_t"); + ndr->depth++; + ndr_print_ptr(ndr, "twr", r->twr); + ndr->depth++; + if (r->twr) { + ndr_print_epm_twr_t(ndr, "twr", r->twr); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_Insert(struct ndr_push *ndr, int flags, const struct epm_Insert *r) +{ + uint32_t cntr_entries_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_ents)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_ents)); + for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_SCALARS, &r->in.entries[cntr_entries_0])); + } + for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_BUFFERS, &r->in.entries[cntr_entries_0])); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.replace)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_Insert(struct ndr_pull *ndr, int flags, struct epm_Insert *r) +{ + uint32_t cntr_entries_0; + TALLOC_CTX *_mem_save_entries_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_ents)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.entries)); + NDR_PULL_ALLOC_N(ndr, r->in.entries, ndr_get_array_size(ndr, &r->in.entries)); + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.entries, 0); + for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_SCALARS, &r->in.entries[cntr_entries_0])); + } + for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_BUFFERS, &r->in.entries[cntr_entries_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.replace)); + if (r->in.entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.entries, r->in.num_ents)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_Insert(struct ndr_print *ndr, const char *name, int flags, const struct epm_Insert *r) +{ + uint32_t cntr_entries_0; + ndr_print_struct(ndr, name, "epm_Insert"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "epm_Insert"); + ndr->depth++; + ndr_print_uint32(ndr, "num_ents", r->in.num_ents); + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->in.num_ents); + ndr->depth++; + for (cntr_entries_0=0;cntr_entries_0in.num_ents;cntr_entries_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { + ndr_print_epm_entry_t(ndr, "entries", &r->in.entries[cntr_entries_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_uint32(ndr, "replace", r->in.replace); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "epm_Insert"); + ndr->depth++; + ndr_print_uint32(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_Delete(struct ndr_push *ndr, int flags, const struct epm_Delete *r) +{ + uint32_t cntr_entries_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_ents)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_ents)); + for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_SCALARS, &r->in.entries[cntr_entries_0])); + } + for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_BUFFERS, &r->in.entries[cntr_entries_0])); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_Delete(struct ndr_pull *ndr, int flags, struct epm_Delete *r) +{ + uint32_t cntr_entries_0; + TALLOC_CTX *_mem_save_entries_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_ents)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.entries)); + NDR_PULL_ALLOC_N(ndr, r->in.entries, ndr_get_array_size(ndr, &r->in.entries)); + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.entries, 0); + for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_SCALARS, &r->in.entries[cntr_entries_0])); + } + for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_BUFFERS, &r->in.entries[cntr_entries_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + if (r->in.entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.entries, r->in.num_ents)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_Delete(struct ndr_print *ndr, const char *name, int flags, const struct epm_Delete *r) +{ + uint32_t cntr_entries_0; + ndr_print_struct(ndr, name, "epm_Delete"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "epm_Delete"); + ndr->depth++; + ndr_print_uint32(ndr, "num_ents", r->in.num_ents); + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->in.num_ents); + ndr->depth++; + for (cntr_entries_0=0;cntr_entries_0in.num_ents;cntr_entries_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { + ndr_print_epm_entry_t(ndr, "entries", &r->in.entries[cntr_entries_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "epm_Delete"); + ndr->depth++; + ndr_print_uint32(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_Lookup(struct ndr_push *ndr, int flags, const struct epm_Lookup *r) +{ + uint32_t cntr_entries_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.inquiry_type)); + NDR_CHECK(ndr_push_full_ptr(ndr, r->in.object)); + if (r->in.object) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.object)); + } + NDR_CHECK(ndr_push_full_ptr(ndr, r->in.interface_id)); + if (r->in.interface_id) { + NDR_CHECK(ndr_push_rpc_if_id_t(ndr, NDR_SCALARS, r->in.interface_id)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.vers_option)); + 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, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ents)); + for (cntr_entries_0 = 0; cntr_entries_0 < *r->out.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_SCALARS, &r->out.entries[cntr_entries_0])); + } + for (cntr_entries_0 = 0; cntr_entries_0 < *r->out.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_BUFFERS, &r->out.entries[cntr_entries_0])); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_Lookup(struct ndr_pull *ndr, int flags, struct epm_Lookup *r) +{ + uint32_t _ptr_object; + uint32_t _ptr_interface_id; + uint32_t cntr_entries_0; + TALLOC_CTX *_mem_save_object_0; + TALLOC_CTX *_mem_save_interface_id_0; + TALLOC_CTX *_mem_save_entry_handle_0; + TALLOC_CTX *_mem_save_num_ents_0; + TALLOC_CTX *_mem_save_entries_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.inquiry_type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object)); + if (_ptr_object) { + NDR_PULL_ALLOC(ndr, r->in.object); + } else { + r->in.object = NULL; + } + if (r->in.object) { + _mem_save_object_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.object, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.object)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_interface_id)); + if (_ptr_interface_id) { + NDR_PULL_ALLOC(ndr, r->in.interface_id); + } else { + r->in.interface_id = NULL; + } + if (r->in.interface_id) { + _mem_save_interface_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.interface_id, 0); + NDR_CHECK(ndr_pull_rpc_if_id_t(ndr, NDR_SCALARS, r->in.interface_id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interface_id_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.vers_option)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.entry_handle); + } + _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.entry_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.entry_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_ents)); + NDR_PULL_ALLOC(ndr, r->out.entry_handle); + *r->out.entry_handle = *r->in.entry_handle; + NDR_PULL_ALLOC(ndr, r->out.num_ents); + ZERO_STRUCTP(r->out.num_ents); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.entry_handle); + } + _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.entry_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_ents); + } + _mem_save_num_ents_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_ents, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_ents)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ents_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.entries)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->out.entries)); + if (ndr_get_array_length(ndr, &r->out.entries) > ndr_get_array_size(ndr, &r->out.entries)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.entries), ndr_get_array_length(ndr, &r->out.entries)); + } + NDR_PULL_ALLOC_N(ndr, r->out.entries, ndr_get_array_size(ndr, &r->out.entries)); + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.entries, 0); + for (cntr_entries_0 = 0; cntr_entries_0 < *r->out.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_SCALARS, &r->out.entries[cntr_entries_0])); + } + for (cntr_entries_0 = 0; cntr_entries_0 < *r->out.num_ents; cntr_entries_0++) { + NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_BUFFERS, &r->out.entries[cntr_entries_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.entries, r->in.max_ents)); + } + if (r->out.entries) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.entries, *r->out.num_ents)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_Lookup(struct ndr_print *ndr, const char *name, int flags, const struct epm_Lookup *r) +{ + uint32_t cntr_entries_0; + ndr_print_struct(ndr, name, "epm_Lookup"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "epm_Lookup"); + ndr->depth++; + ndr_print_uint32(ndr, "inquiry_type", r->in.inquiry_type); + ndr_print_ptr(ndr, "object", r->in.object); + ndr->depth++; + if (r->in.object) { + ndr_print_GUID(ndr, "object", r->in.object); + } + ndr->depth--; + ndr_print_ptr(ndr, "interface_id", r->in.interface_id); + ndr->depth++; + if (r->in.interface_id) { + ndr_print_rpc_if_id_t(ndr, "interface_id", r->in.interface_id); + } + ndr->depth--; + ndr_print_uint32(ndr, "vers_option", r->in.vers_option); + ndr_print_ptr(ndr, "entry_handle", r->in.entry_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "entry_handle", r->in.entry_handle); + ndr->depth--; + ndr_print_uint32(ndr, "max_ents", r->in.max_ents); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "epm_Lookup"); + ndr->depth++; + ndr_print_ptr(ndr, "entry_handle", r->out.entry_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "entry_handle", r->out.entry_handle); + ndr->depth--; + ndr_print_ptr(ndr, "num_ents", r->out.num_ents); + ndr->depth++; + ndr_print_uint32(ndr, "num_ents", *r->out.num_ents); + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)*r->out.num_ents); + ndr->depth++; + for (cntr_entries_0=0;cntr_entries_0<*r->out.num_ents;cntr_entries_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { + ndr_print_epm_entry_t(ndr, "entries", &r->out.entries[cntr_entries_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_uint32(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_epm_Map(struct ndr_push *ndr, int flags, const struct epm_Map *r) +{ + uint32_t cntr_towers_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_full_ptr(ndr, r->in.object)); + if (r->in.object) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.object)); + } + NDR_CHECK(ndr_push_full_ptr(ndr, r->in.map_tower)); + 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_towers)); + for (cntr_towers_0 = 0; cntr_towers_0 < *r->out.num_towers; cntr_towers_0++) { + NDR_CHECK(ndr_push_epm_twr_p_t(ndr, NDR_SCALARS, &r->out.towers[cntr_towers_0])); + } + for (cntr_towers_0 = 0; cntr_towers_0 < *r->out.num_towers; cntr_towers_0++) { + NDR_CHECK(ndr_push_epm_twr_p_t(ndr, NDR_BUFFERS, &r->out.towers[cntr_towers_0])); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_epm_Map(struct ndr_pull *ndr, int flags, struct epm_Map *r) +{ + uint32_t _ptr_object; + uint32_t _ptr_map_tower; + uint32_t cntr_towers_0; + TALLOC_CTX *_mem_save_object_0; + TALLOC_CTX *_mem_save_map_tower_0; + TALLOC_CTX *_mem_save_entry_handle_0; + TALLOC_CTX *_mem_save_num_towers_0; + TALLOC_CTX *_mem_save_towers_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object)); + if (_ptr_object) { + NDR_PULL_ALLOC(ndr, r->in.object); + } else { + r->in.object = NULL; + } + if (r->in.object) { + _mem_save_object_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.object, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.object)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_map_tower)); + if (_ptr_map_tower) { + NDR_PULL_ALLOC(ndr, r->in.map_tower); + } else { + r->in.map_tower = NULL; + } + if (r->in.map_tower) { + _mem_save_map_tower_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.map_tower, 0); + NDR_CHECK(ndr_pull_epm_twr_t(ndr, NDR_SCALARS, r->in.map_tower)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_map_tower_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.entry_handle); + } + _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.entry_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.entry_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_towers)); + NDR_PULL_ALLOC(ndr, r->out.entry_handle); + *r->out.entry_handle = *r->in.entry_handle; + NDR_PULL_ALLOC(ndr, r->out.num_towers); + ZERO_STRUCTP(r->out.num_towers); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.entry_handle); + } + _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.entry_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_towers); + } + _mem_save_num_towers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_towers, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_towers)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_towers_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.towers)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->out.towers)); + if (ndr_get_array_length(ndr, &r->out.towers) > ndr_get_array_size(ndr, &r->out.towers)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.towers), ndr_get_array_length(ndr, &r->out.towers)); + } + NDR_PULL_ALLOC_N(ndr, r->out.towers, ndr_get_array_size(ndr, &r->out.towers)); + _mem_save_towers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.towers, 0); + for (cntr_towers_0 = 0; cntr_towers_0 < *r->out.num_towers; cntr_towers_0++) { + NDR_CHECK(ndr_pull_epm_twr_p_t(ndr, NDR_SCALARS, &r->out.towers[cntr_towers_0])); + } + for (cntr_towers_0 = 0; cntr_towers_0 < *r->out.num_towers; cntr_towers_0++) { + NDR_CHECK(ndr_pull_epm_twr_p_t(ndr, NDR_BUFFERS, &r->out.towers[cntr_towers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_towers_0, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.towers) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.towers, r->in.max_towers)); + } + if (r->out.towers) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.towers, *r->out.num_towers)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_Map(struct ndr_print *ndr, const char *name, int flags, const struct epm_Map *r) +{ + uint32_t cntr_towers_0; + ndr_print_struct(ndr, name, "epm_Map"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "epm_Map"); + ndr->depth++; + ndr_print_ptr(ndr, "object", r->in.object); + ndr->depth++; + if (r->in.object) { + ndr_print_GUID(ndr, "object", r->in.object); + } + ndr->depth--; + ndr_print_ptr(ndr, "map_tower", r->in.map_tower); + ndr->depth++; + if (r->in.map_tower) { + ndr_print_epm_twr_t(ndr, "map_tower", r->in.map_tower); + } + ndr->depth--; + ndr_print_ptr(ndr, "entry_handle", r->in.entry_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "entry_handle", r->in.entry_handle); + ndr->depth--; + ndr_print_uint32(ndr, "max_towers", r->in.max_towers); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "epm_Map"); + ndr->depth++; + ndr_print_ptr(ndr, "entry_handle", r->out.entry_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "entry_handle", r->out.entry_handle); + ndr->depth--; + ndr_print_ptr(ndr, "num_towers", r->out.num_towers); + ndr->depth++; + ndr_print_uint32(ndr, "num_towers", *r->out.num_towers); + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "towers", (int)*r->out.num_towers); + ndr->depth++; + for (cntr_towers_0=0;cntr_towers_0<*r->out.num_towers;cntr_towers_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_towers_0) != -1) { + ndr_print_epm_twr_p_t(ndr, "towers", &r->out.towers[cntr_towers_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_uint32(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.entry_handle)); + } + if (flags & NDR_OUT) { + 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, r->out.entry_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_LookupHandleFree(struct ndr_pull *ndr, int flags, struct epm_LookupHandleFree *r) +{ + TALLOC_CTX *_mem_save_entry_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.entry_handle); + } + _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.entry_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.entry_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.entry_handle); + *r->out.entry_handle = *r->in.entry_handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.entry_handle); + } + _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.entry_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_LookupHandleFree(struct ndr_print *ndr, const char *name, int flags, const struct epm_LookupHandleFree *r) +{ + ndr_print_struct(ndr, name, "epm_LookupHandleFree"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "epm_LookupHandleFree"); + ndr->depth++; + ndr_print_ptr(ndr, "entry_handle", r->in.entry_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "entry_handle", r->in.entry_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "epm_LookupHandleFree"); + ndr->depth++; + ndr_print_ptr(ndr, "entry_handle", r->out.entry_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "entry_handle", r->out.entry_handle); + ndr->depth--; + ndr_print_uint32(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.epm_object)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_InqObject(struct ndr_pull *ndr, int flags, struct epm_InqObject *r) +{ + TALLOC_CTX *_mem_save_epm_object_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.epm_object); + } + _mem_save_epm_object_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.epm_object, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.epm_object)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_epm_object_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_InqObject(struct ndr_print *ndr, const char *name, int flags, const struct epm_InqObject *r) +{ + ndr_print_struct(ndr, name, "epm_InqObject"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "epm_InqObject"); + ndr->depth++; + ndr_print_ptr(ndr, "epm_object", r->in.epm_object); + ndr->depth++; + ndr_print_GUID(ndr, "epm_object", r->in.epm_object); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "epm_InqObject"); + ndr->depth++; + ndr_print_uint32(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_MgmtDelete(struct ndr_push *ndr, int flags, const struct epm_MgmtDelete *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.object_speced)); + NDR_CHECK(ndr_push_full_ptr(ndr, r->in.object)); + if (r->in.object) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.object)); + } + NDR_CHECK(ndr_push_full_ptr(ndr, r->in.tower)); + if (r->in.tower) { + NDR_CHECK(ndr_push_epm_twr_t(ndr, NDR_SCALARS, r->in.tower)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_MgmtDelete(struct ndr_pull *ndr, int flags, struct epm_MgmtDelete *r) +{ + uint32_t _ptr_object; + uint32_t _ptr_tower; + TALLOC_CTX *_mem_save_object_0; + TALLOC_CTX *_mem_save_tower_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.object_speced)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object)); + if (_ptr_object) { + NDR_PULL_ALLOC(ndr, r->in.object); + } else { + r->in.object = NULL; + } + if (r->in.object) { + _mem_save_object_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.object, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.object)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_tower)); + if (_ptr_tower) { + NDR_PULL_ALLOC(ndr, r->in.tower); + } else { + r->in.tower = NULL; + } + if (r->in.tower) { + _mem_save_tower_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.tower, 0); + NDR_CHECK(ndr_pull_epm_twr_t(ndr, NDR_SCALARS, r->in.tower)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tower_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_MgmtDelete(struct ndr_print *ndr, const char *name, int flags, const struct epm_MgmtDelete *r) +{ + ndr_print_struct(ndr, name, "epm_MgmtDelete"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "epm_MgmtDelete"); + ndr->depth++; + ndr_print_uint32(ndr, "object_speced", r->in.object_speced); + ndr_print_ptr(ndr, "object", r->in.object); + ndr->depth++; + if (r->in.object) { + ndr_print_GUID(ndr, "object", r->in.object); + } + ndr->depth--; + ndr_print_ptr(ndr, "tower", r->in.tower); + ndr->depth++; + if (r->in.tower) { + ndr_print_epm_twr_t(ndr, "tower", r->in.tower); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "epm_MgmtDelete"); + ndr->depth++; + ndr_print_uint32(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_epm_MapAuth(struct ndr_push *ndr, int flags, const struct epm_MapAuth *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_epm_MapAuth(struct ndr_pull *ndr, int flags, struct epm_MapAuth *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_epm_MapAuth(struct ndr_print *ndr, const char *name, int flags, const struct epm_MapAuth *r) +{ + ndr_print_struct(ndr, name, "epm_MapAuth"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "epm_MapAuth"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "epm_MapAuth"); + ndr->depth++; + ndr_print_uint32(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call epmapper_calls[] = { + { + "epm_Insert", + sizeof(struct epm_Insert), + (ndr_push_flags_fn_t) ndr_push_epm_Insert, + (ndr_pull_flags_fn_t) ndr_pull_epm_Insert, + (ndr_print_function_t) ndr_print_epm_Insert, + false, + }, + { + "epm_Delete", + sizeof(struct epm_Delete), + (ndr_push_flags_fn_t) ndr_push_epm_Delete, + (ndr_pull_flags_fn_t) ndr_pull_epm_Delete, + (ndr_print_function_t) ndr_print_epm_Delete, + false, + }, + { + "epm_Lookup", + sizeof(struct epm_Lookup), + (ndr_push_flags_fn_t) ndr_push_epm_Lookup, + (ndr_pull_flags_fn_t) ndr_pull_epm_Lookup, + (ndr_print_function_t) ndr_print_epm_Lookup, + false, + }, + { + "epm_Map", + sizeof(struct epm_Map), + (ndr_push_flags_fn_t) ndr_push_epm_Map, + (ndr_pull_flags_fn_t) ndr_pull_epm_Map, + (ndr_print_function_t) ndr_print_epm_Map, + false, + }, + { + "epm_LookupHandleFree", + sizeof(struct epm_LookupHandleFree), + (ndr_push_flags_fn_t) ndr_push_epm_LookupHandleFree, + (ndr_pull_flags_fn_t) ndr_pull_epm_LookupHandleFree, + (ndr_print_function_t) ndr_print_epm_LookupHandleFree, + false, + }, + { + "epm_InqObject", + sizeof(struct epm_InqObject), + (ndr_push_flags_fn_t) ndr_push_epm_InqObject, + (ndr_pull_flags_fn_t) ndr_pull_epm_InqObject, + (ndr_print_function_t) ndr_print_epm_InqObject, + false, + }, + { + "epm_MgmtDelete", + sizeof(struct epm_MgmtDelete), + (ndr_push_flags_fn_t) ndr_push_epm_MgmtDelete, + (ndr_pull_flags_fn_t) ndr_pull_epm_MgmtDelete, + (ndr_print_function_t) ndr_print_epm_MgmtDelete, + false, + }, + { + "epm_MapAuth", + sizeof(struct epm_MapAuth), + (ndr_push_flags_fn_t) ndr_push_epm_MapAuth, + (ndr_pull_flags_fn_t) ndr_pull_epm_MapAuth, + (ndr_print_function_t) ndr_print_epm_MapAuth, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const epmapper_endpoint_strings[] = { + "ncacn_np:[\\pipe\\epmapper]", + "ncacn_ip_tcp:[135]", + "ncalrpc:[EPMAPPER]", +}; + +static const struct ndr_interface_string_array epmapper_endpoints = { + .count = 3, + .names = epmapper_endpoint_strings +}; + +static const char * const epmapper_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array epmapper_authservices = { + .count = 1, + .names = epmapper_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_epmapper = { + .name = "epmapper", + .syntax_id = { + {0xe1af8308,0x5d1f,0x11c9,{0x91,0xa4},{0x08,0x00,0x2b,0x14,0xa0,0xfa}}, + NDR_EPMAPPER_VERSION + }, + .helpstring = NDR_EPMAPPER_HELPSTRING, + .num_calls = 8, + .calls = epmapper_calls, + .endpoints = &epmapper_endpoints, + .authservices = &epmapper_authservices +}; + diff --git a/librpc/gen_ndr/ndr_epmapper.h b/librpc/gen_ndr/ndr_epmapper.h new file mode 100644 index 0000000000..0fac75e0af --- /dev/null +++ b/librpc/gen_ndr/ndr_epmapper.h @@ -0,0 +1,76 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/epmapper.h" + +#ifndef _HEADER_NDR_epmapper +#define _HEADER_NDR_epmapper + +#define NDR_EPMAPPER_UUID "e1af8308-5d1f-11c9-91a4-08002b14a0fa" +#define NDR_EPMAPPER_VERSION 3.0 +#define NDR_EPMAPPER_NAME "epmapper" +#define NDR_EPMAPPER_HELPSTRING "EndPoint Mapper" +extern const struct ndr_interface_table ndr_table_epmapper; +#define NDR_EPM_INSERT (0x00) + +#define NDR_EPM_DELETE (0x01) + +#define NDR_EPM_LOOKUP (0x02) + +#define NDR_EPM_MAP (0x03) + +#define NDR_EPM_LOOKUPHANDLEFREE (0x04) + +#define NDR_EPM_INQOBJECT (0x05) + +#define NDR_EPM_MGMTDELETE (0x06) + +#define NDR_EPM_MAPAUTH (0x07) + +#define NDR_EPMAPPER_CALL_COUNT (8) +void ndr_print_epm_protocol(struct ndr_print *ndr, const char *name, enum epm_protocol r); +void ndr_print_epm_rhs_dnet_nsp(struct ndr_print *ndr, const char *name, const struct epm_rhs_dnet_nsp *r); +void ndr_print_epm_rhs_osi_tp4(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_tp4 *r); +void ndr_print_epm_rhs_osi_clns(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_clns *r); +void ndr_print_epm_rhs_udp(struct ndr_print *ndr, const char *name, const struct epm_rhs_udp *r); +void ndr_print_epm_rhs_tcp(struct ndr_print *ndr, const char *name, const struct epm_rhs_tcp *r); +void ndr_print_epm_rhs_ip(struct ndr_print *ndr, const char *name, const struct epm_rhs_ip *r); +void ndr_print_epm_rhs_ncadg(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncadg *r); +void ndr_print_epm_rhs_ncacn(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncacn *r); +void ndr_print_epm_rhs_uuid(struct ndr_print *ndr, const char *name, const struct epm_rhs_uuid *r); +void ndr_print_epm_rhs_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_ipx *r); +void ndr_print_epm_rhs_smb(struct ndr_print *ndr, const char *name, const struct epm_rhs_smb *r); +void ndr_print_epm_rhs_pipe(struct ndr_print *ndr, const char *name, const struct epm_rhs_pipe *r); +void ndr_print_epm_rhs_netbios(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbios *r); +void ndr_print_epm_rhs_netbeui(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbeui *r); +void ndr_print_epm_rhs_spx(struct ndr_print *ndr, const char *name, const struct epm_rhs_spx *r); +void ndr_print_epm_rhs_nb_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_nb_ipx *r); +void ndr_print_epm_rhs_http(struct ndr_print *ndr, const char *name, const struct epm_rhs_http *r); +void ndr_print_epm_rhs_unix_ds(struct ndr_print *ndr, const char *name, const struct epm_rhs_unix_ds *r); +void ndr_print_epm_rhs_null(struct ndr_print *ndr, const char *name, const struct epm_rhs_null *r); +void ndr_print_epm_rhs_ncalrpc(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncalrpc *r); +void ndr_print_epm_rhs_appletalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_appletalk *r); +void ndr_print_epm_rhs_atalk_stream(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_stream *r); +void ndr_print_epm_rhs_atalk_datagram(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_datagram *r); +void ndr_print_epm_rhs_vines_spp(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_spp *r); +void ndr_print_epm_rhs_vines_ipc(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_ipc *r); +void ndr_print_epm_rhs_streettalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_streettalk *r); +void ndr_print_epm_rhs(struct ndr_print *ndr, const char *name, const union epm_rhs *r); +void ndr_print_epm_lhs(struct ndr_print *ndr, const char *name, const struct epm_lhs *r); +void ndr_print_epm_floor(struct ndr_print *ndr, const char *name, const struct epm_floor *r); +void ndr_print_epm_tower(struct ndr_print *ndr, const char *name, const struct epm_tower *r); +void ndr_print_epm_twr_t(struct ndr_print *ndr, const char *name, const struct epm_twr_t *r); +void ndr_print_epm_entry_t(struct ndr_print *ndr, const char *name, const struct epm_entry_t *r); +void ndr_print_rpc_if_id_t(struct ndr_print *ndr, const char *name, const struct rpc_if_id_t *r); +void ndr_print_epm_twr_p_t(struct ndr_print *ndr, const char *name, const struct epm_twr_p_t *r); +void ndr_print_epm_Insert(struct ndr_print *ndr, const char *name, int flags, const struct epm_Insert *r); +void ndr_print_epm_Delete(struct ndr_print *ndr, const char *name, int flags, const struct epm_Delete *r); +void ndr_print_epm_Lookup(struct ndr_print *ndr, const char *name, int flags, const struct epm_Lookup *r); +enum ndr_err_code ndr_push_epm_Map(struct ndr_push *ndr, int flags, const struct epm_Map *r); +enum ndr_err_code ndr_pull_epm_Map(struct ndr_pull *ndr, int flags, struct epm_Map *r); +void ndr_print_epm_Map(struct ndr_print *ndr, const char *name, int flags, const struct epm_Map *r); +void ndr_print_epm_LookupHandleFree(struct ndr_print *ndr, const char *name, int flags, const struct epm_LookupHandleFree *r); +void ndr_print_epm_InqObject(struct ndr_print *ndr, const char *name, int flags, const struct epm_InqObject *r); +void ndr_print_epm_MgmtDelete(struct ndr_print *ndr, const char *name, int flags, const struct epm_MgmtDelete *r); +void ndr_print_epm_MapAuth(struct ndr_print *ndr, const char *name, int flags, const struct epm_MapAuth *r); +#endif /* _HEADER_NDR_epmapper */ diff --git a/librpc/gen_ndr/ndr_eventlog.c b/librpc/gen_ndr/ndr_eventlog.c new file mode 100644 index 0000000000..12fa9fcec4 --- /dev/null +++ b/librpc/gen_ndr/ndr_eventlog.c @@ -0,0 +1,1755 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_eventlog.h" + +#include "librpc/gen_ndr/ndr_lsa.h" +#include "librpc/gen_ndr/ndr_security.h" +static enum ndr_err_code ndr_push_eventlogReadFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlogReadFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlogReadFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "EVENTLOG_SEQUENTIAL_READ", EVENTLOG_SEQUENTIAL_READ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "EVENTLOG_SEEK_READ", EVENTLOG_SEEK_READ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "EVENTLOG_FORWARDS_READ", EVENTLOG_FORWARDS_READ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "EVENTLOG_BACKWARDS_READ", EVENTLOG_BACKWARDS_READ, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_OpenUnknown0(struct ndr_push *ndr, int ndr_flags, const struct eventlog_OpenUnknown0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown0)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_OpenUnknown0(struct ndr_pull *ndr, int ndr_flags, struct eventlog_OpenUnknown0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown0)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown1)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_OpenUnknown0(struct ndr_print *ndr, const char *name, const struct eventlog_OpenUnknown0 *r) +{ + ndr_print_struct(ndr, name, "eventlog_OpenUnknown0"); + ndr->depth++; + ndr_print_uint16(ndr, "unknown0", r->unknown0); + ndr_print_uint16(ndr, "unknown1", r->unknown1); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_eventlog_Record(struct ndr_push *ndr, int ndr_flags, const struct eventlog_Record *r) +{ + uint32_t cntr_strings_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->record_number)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_generated)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_written)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->event_id)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->event_type)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_of_strings)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->event_category)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->closing_record_number)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->stringoffset)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_offset)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_offset)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->source_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + for (cntr_strings_0 = 0; cntr_strings_0 < r->num_of_strings; cntr_strings_0++) { + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->strings[cntr_strings_0])); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->raw_data)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_eventlog_Record(struct ndr_pull *ndr, int ndr_flags, struct eventlog_Record *r) +{ + uint32_t cntr_strings_0; + TALLOC_CTX *_mem_save_strings_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->record_number)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_generated)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_written)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->event_id)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->event_type)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_of_strings)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->event_category)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->closing_record_number)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->stringoffset)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_length)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_offset)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_length)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_offset)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->source_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_PULL_ALLOC_N(ndr, r->strings, r->num_of_strings); + _mem_save_strings_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->strings, 0); + for (cntr_strings_0 = 0; cntr_strings_0 < r->num_of_strings; cntr_strings_0++) { + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->strings[cntr_strings_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_strings_0, 0); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->raw_data)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_Record(struct ndr_print *ndr, const char *name, const struct eventlog_Record *r) +{ + uint32_t cntr_strings_0; + ndr_print_struct(ndr, name, "eventlog_Record"); + ndr->depth++; + ndr_print_uint32(ndr, "size", r->size); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr_print_uint32(ndr, "record_number", r->record_number); + ndr_print_uint32(ndr, "time_generated", r->time_generated); + ndr_print_uint32(ndr, "time_written", r->time_written); + ndr_print_uint32(ndr, "event_id", r->event_id); + ndr_print_uint16(ndr, "event_type", r->event_type); + ndr_print_uint16(ndr, "num_of_strings", r->num_of_strings); + ndr_print_uint16(ndr, "event_category", r->event_category); + ndr_print_uint16(ndr, "reserved_flags", r->reserved_flags); + ndr_print_uint32(ndr, "closing_record_number", r->closing_record_number); + ndr_print_uint32(ndr, "stringoffset", r->stringoffset); + ndr_print_uint32(ndr, "sid_length", r->sid_length); + ndr_print_uint32(ndr, "sid_offset", r->sid_offset); + ndr_print_uint32(ndr, "data_length", r->data_length); + ndr_print_uint32(ndr, "data_offset", r->data_offset); + ndr_print_string(ndr, "source_name", r->source_name); + ndr_print_string(ndr, "computer_name", r->computer_name); + ndr->print(ndr, "%s: ARRAY(%d)", "strings", (int)r->num_of_strings); + ndr->depth++; + for (cntr_strings_0=0;cntr_strings_0num_of_strings;cntr_strings_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_strings_0) != -1) { + ndr_print_string(ndr, "strings", r->strings[cntr_strings_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_string(ndr, "raw_data", r->raw_data); + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.backupfile)); + if (r->in.backupfile) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.backupfile)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_ClearEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_ClearEventLogW *r) +{ + uint32_t _ptr_backupfile; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_backupfile_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_backupfile)); + if (_ptr_backupfile) { + NDR_PULL_ALLOC(ndr, r->in.backupfile); + } else { + r->in.backupfile = NULL; + } + if (r->in.backupfile) { + _mem_save_backupfile_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.backupfile, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.backupfile)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_backupfile_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_ClearEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ClearEventLogW *r) +{ + ndr_print_struct(ndr, name, "eventlog_ClearEventLogW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_ClearEventLogW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "backupfile", r->in.backupfile); + ndr->depth++; + if (r->in.backupfile) { + ndr_print_lsa_String(ndr, "backupfile", r->in.backupfile); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_ClearEventLogW"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_BackupEventLogW(struct ndr_push *ndr, int flags, const struct eventlog_BackupEventLogW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_BackupEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_BackupEventLogW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_BackupEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_BackupEventLogW *r) +{ + ndr_print_struct(ndr, name, "eventlog_BackupEventLogW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_BackupEventLogW"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_BackupEventLogW"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_CloseEventLog(struct ndr_pull *ndr, int flags, struct eventlog_CloseEventLog *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.handle); + *r->out.handle = *r->in.handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_CloseEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_CloseEventLog *r) +{ + ndr_print_struct(ndr, name, "eventlog_CloseEventLog"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_CloseEventLog"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_CloseEventLog"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_DeregisterEventSource(struct ndr_push *ndr, int flags, const struct eventlog_DeregisterEventSource *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_DeregisterEventSource(struct ndr_pull *ndr, int flags, struct eventlog_DeregisterEventSource *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_DeregisterEventSource(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_DeregisterEventSource *r) +{ + ndr_print_struct(ndr, name, "eventlog_DeregisterEventSource"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_DeregisterEventSource"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_DeregisterEventSource"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_GetNumRecords(struct ndr_pull *ndr, int flags, struct eventlog_GetNumRecords *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_number_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.number); + ZERO_STRUCTP(r->out.number); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.number); + } + _mem_save_number_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.number, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.number)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_number_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_GetNumRecords(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetNumRecords *r) +{ + ndr_print_struct(ndr, name, "eventlog_GetNumRecords"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_GetNumRecords"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_GetNumRecords"); + ndr->depth++; + ndr_print_ptr(ndr, "number", r->out.number); + ndr->depth++; + ndr_print_uint32(ndr, "number", *r->out.number); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_GetOldestRecord(struct ndr_push *ndr, int flags, const struct eventlog_GetOldestRecord *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + } + if (flags & NDR_OUT) { + if (r->out.oldest_entry == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.oldest_entry)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_GetOldestRecord(struct ndr_pull *ndr, int flags, struct eventlog_GetOldestRecord *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_oldest_entry_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.oldest_entry); + ZERO_STRUCTP(r->out.oldest_entry); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.oldest_entry); + } + _mem_save_oldest_entry_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.oldest_entry, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.oldest_entry)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_oldest_entry_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_GetOldestRecord(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetOldestRecord *r) +{ + ndr_print_struct(ndr, name, "eventlog_GetOldestRecord"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_GetOldestRecord"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_GetOldestRecord"); + ndr->depth++; + ndr_print_ptr(ndr, "oldest_entry", r->out.oldest_entry); + ndr->depth++; + ndr_print_uint32(ndr, "oldest_entry", *r->out.oldest_entry); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_ChangeNotify(struct ndr_push *ndr, int flags, const struct eventlog_ChangeNotify *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_ChangeNotify(struct ndr_pull *ndr, int flags, struct eventlog_ChangeNotify *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_ChangeNotify(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ChangeNotify *r) +{ + ndr_print_struct(ndr, name, "eventlog_ChangeNotify"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_ChangeNotify"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_ChangeNotify"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_OpenEventLogW(struct ndr_push *ndr, int flags, const struct eventlog_OpenEventLogW *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown0)); + if (r->in.unknown0) { + NDR_CHECK(ndr_push_eventlog_OpenUnknown0(ndr, NDR_SCALARS, r->in.unknown0)); + } + if (r->in.logname == 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.logname)); + if (r->in.servername == 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.servername)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.major_version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.minor_version)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_OpenEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_OpenEventLogW *r) +{ + uint32_t _ptr_unknown0; + TALLOC_CTX *_mem_save_unknown0_0; + TALLOC_CTX *_mem_save_logname_0; + TALLOC_CTX *_mem_save_servername_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown0)); + if (_ptr_unknown0) { + NDR_PULL_ALLOC(ndr, r->in.unknown0); + } else { + r->in.unknown0 = NULL; + } + if (r->in.unknown0) { + _mem_save_unknown0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown0, 0); + NDR_CHECK(ndr_pull_eventlog_OpenUnknown0(ndr, NDR_SCALARS, r->in.unknown0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown0_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.logname); + } + _mem_save_logname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logname)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logname_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.servername); + } + _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.servername)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.major_version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.minor_version)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_OpenEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenEventLogW *r) +{ + ndr_print_struct(ndr, name, "eventlog_OpenEventLogW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_OpenEventLogW"); + ndr->depth++; + ndr_print_ptr(ndr, "unknown0", r->in.unknown0); + ndr->depth++; + if (r->in.unknown0) { + ndr_print_eventlog_OpenUnknown0(ndr, "unknown0", r->in.unknown0); + } + ndr->depth--; + ndr_print_ptr(ndr, "logname", r->in.logname); + ndr->depth++; + ndr_print_lsa_String(ndr, "logname", r->in.logname); + ndr->depth--; + ndr_print_ptr(ndr, "servername", r->in.servername); + ndr->depth++; + ndr_print_lsa_String(ndr, "servername", r->in.servername); + ndr->depth--; + ndr_print_uint32(ndr, "major_version", r->in.major_version); + ndr_print_uint32(ndr, "minor_version", r->in.minor_version); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_OpenEventLogW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_RegisterEventSourceW(struct ndr_push *ndr, int flags, const struct eventlog_RegisterEventSourceW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_RegisterEventSourceW(struct ndr_pull *ndr, int flags, struct eventlog_RegisterEventSourceW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_RegisterEventSourceW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterEventSourceW *r) +{ + ndr_print_struct(ndr, name, "eventlog_RegisterEventSourceW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_RegisterEventSourceW"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_RegisterEventSourceW"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_OpenBackupEventLogW(struct ndr_push *ndr, int flags, const struct eventlog_OpenBackupEventLogW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_OpenBackupEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_OpenBackupEventLogW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_OpenBackupEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenBackupEventLogW *r) +{ + ndr_print_struct(ndr, name, "eventlog_OpenBackupEventLogW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_OpenBackupEventLogW"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_OpenBackupEventLogW"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_eventlogReadFlags(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 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_ReadEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_ReadEventLogW *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sent_size_0; + TALLOC_CTX *_mem_save_real_size_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_eventlogReadFlags(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offset)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.number_of_bytes)); + if (r->in.number_of_bytes < 0 || r->in.number_of_bytes > 0x7FFFF) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->out.data, r->in.number_of_bytes); + memset(r->out.data, 0, (r->in.number_of_bytes) * sizeof(*r->out.data)); + NDR_PULL_ALLOC(ndr, r->out.sent_size); + ZERO_STRUCTP(r->out.sent_size); + NDR_PULL_ALLOC(ndr, r->out.real_size); + ZERO_STRUCTP(r->out.real_size); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_size(ndr, &r->out.data))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sent_size); + } + _mem_save_sent_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sent_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sent_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sent_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.real_size); + } + _mem_save_real_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.real_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.real_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_real_size_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.number_of_bytes)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_ReadEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReadEventLogW *r) +{ + ndr_print_struct(ndr, name, "eventlog_ReadEventLogW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_ReadEventLogW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_eventlogReadFlags(ndr, "flags", r->in.flags); + ndr_print_uint32(ndr, "offset", r->in.offset); + ndr_print_uint32(ndr, "number_of_bytes", r->in.number_of_bytes); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_ReadEventLogW"); + ndr->depth++; + ndr_print_ptr(ndr, "data", r->out.data); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->out.data, r->in.number_of_bytes); + ndr->depth--; + ndr_print_ptr(ndr, "sent_size", r->out.sent_size); + ndr->depth++; + ndr_print_uint32(ndr, "sent_size", *r->out.sent_size); + ndr->depth--; + ndr_print_ptr(ndr, "real_size", r->out.real_size); + ndr->depth++; + ndr_print_uint32(ndr, "real_size", *r->out.real_size); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_ReportEventW(struct ndr_push *ndr, int flags, const struct eventlog_ReportEventW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_ReportEventW(struct ndr_pull *ndr, int flags, struct eventlog_ReportEventW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_ReportEventW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReportEventW *r) +{ + ndr_print_struct(ndr, name, "eventlog_ReportEventW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_ReportEventW"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_ReportEventW"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_ClearEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_ClearEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_ClearEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_ClearEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_ClearEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ClearEventLogA *r) +{ + ndr_print_struct(ndr, name, "eventlog_ClearEventLogA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_ClearEventLogA"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_ClearEventLogA"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_BackupEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_BackupEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_BackupEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_BackupEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_BackupEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_BackupEventLogA *r) +{ + ndr_print_struct(ndr, name, "eventlog_BackupEventLogA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_BackupEventLogA"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_BackupEventLogA"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_OpenEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_OpenEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_OpenEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_OpenEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_OpenEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenEventLogA *r) +{ + ndr_print_struct(ndr, name, "eventlog_OpenEventLogA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_OpenEventLogA"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_OpenEventLogA"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_RegisterEventSourceA(struct ndr_push *ndr, int flags, const struct eventlog_RegisterEventSourceA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_RegisterEventSourceA(struct ndr_pull *ndr, int flags, struct eventlog_RegisterEventSourceA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_RegisterEventSourceA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterEventSourceA *r) +{ + ndr_print_struct(ndr, name, "eventlog_RegisterEventSourceA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_RegisterEventSourceA"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_RegisterEventSourceA"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_OpenBackupEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_OpenBackupEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_OpenBackupEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_OpenBackupEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_OpenBackupEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenBackupEventLogA *r) +{ + ndr_print_struct(ndr, name, "eventlog_OpenBackupEventLogA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_OpenBackupEventLogA"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_OpenBackupEventLogA"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_ReadEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_ReadEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_ReadEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_ReadEventLogA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_ReadEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReadEventLogA *r) +{ + ndr_print_struct(ndr, name, "eventlog_ReadEventLogA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_ReadEventLogA"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_ReadEventLogA"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_ReportEventA(struct ndr_push *ndr, int flags, const struct eventlog_ReportEventA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_ReportEventA(struct ndr_pull *ndr, int flags, struct eventlog_ReportEventA *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_ReportEventA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReportEventA *r) +{ + ndr_print_struct(ndr, name, "eventlog_ReportEventA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_ReportEventA"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_ReportEventA"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_RegisterClusterSvc(struct ndr_push *ndr, int flags, const struct eventlog_RegisterClusterSvc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_RegisterClusterSvc(struct ndr_pull *ndr, int flags, struct eventlog_RegisterClusterSvc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_RegisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterClusterSvc *r) +{ + ndr_print_struct(ndr, name, "eventlog_RegisterClusterSvc"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_RegisterClusterSvc"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_RegisterClusterSvc"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_DeregisterClusterSvc(struct ndr_push *ndr, int flags, const struct eventlog_DeregisterClusterSvc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_DeregisterClusterSvc(struct ndr_pull *ndr, int flags, struct eventlog_DeregisterClusterSvc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_DeregisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_DeregisterClusterSvc *r) +{ + ndr_print_struct(ndr, name, "eventlog_DeregisterClusterSvc"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_DeregisterClusterSvc"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_DeregisterClusterSvc"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_WriteClusterEvents(struct ndr_push *ndr, int flags, const struct eventlog_WriteClusterEvents *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_WriteClusterEvents(struct ndr_pull *ndr, int flags, struct eventlog_WriteClusterEvents *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_WriteClusterEvents(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_WriteClusterEvents *r) +{ + ndr_print_struct(ndr, name, "eventlog_WriteClusterEvents"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_WriteClusterEvents"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_WriteClusterEvents"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_eventlog_GetLogIntormation(struct ndr_push *ndr, int flags, const struct eventlog_GetLogIntormation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_GetLogIntormation(struct ndr_pull *ndr, int flags, struct eventlog_GetLogIntormation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_GetLogIntormation(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetLogIntormation *r) +{ + ndr_print_struct(ndr, name, "eventlog_GetLogIntormation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_GetLogIntormation"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_GetLogIntormation"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_eventlog_FlushEventLog(struct ndr_pull *ndr, int flags, struct eventlog_FlushEventLog *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_eventlog_FlushEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_FlushEventLog *r) +{ + ndr_print_struct(ndr, name, "eventlog_FlushEventLog"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "eventlog_FlushEventLog"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "eventlog_FlushEventLog"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call eventlog_calls[] = { + { + "eventlog_ClearEventLogW", + sizeof(struct eventlog_ClearEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_ClearEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ClearEventLogW, + (ndr_print_function_t) ndr_print_eventlog_ClearEventLogW, + false, + }, + { + "eventlog_BackupEventLogW", + sizeof(struct eventlog_BackupEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_BackupEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_BackupEventLogW, + (ndr_print_function_t) ndr_print_eventlog_BackupEventLogW, + false, + }, + { + "eventlog_CloseEventLog", + sizeof(struct eventlog_CloseEventLog), + (ndr_push_flags_fn_t) ndr_push_eventlog_CloseEventLog, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_CloseEventLog, + (ndr_print_function_t) ndr_print_eventlog_CloseEventLog, + false, + }, + { + "eventlog_DeregisterEventSource", + sizeof(struct eventlog_DeregisterEventSource), + (ndr_push_flags_fn_t) ndr_push_eventlog_DeregisterEventSource, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_DeregisterEventSource, + (ndr_print_function_t) ndr_print_eventlog_DeregisterEventSource, + false, + }, + { + "eventlog_GetNumRecords", + sizeof(struct eventlog_GetNumRecords), + (ndr_push_flags_fn_t) ndr_push_eventlog_GetNumRecords, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetNumRecords, + (ndr_print_function_t) ndr_print_eventlog_GetNumRecords, + false, + }, + { + "eventlog_GetOldestRecord", + sizeof(struct eventlog_GetOldestRecord), + (ndr_push_flags_fn_t) ndr_push_eventlog_GetOldestRecord, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetOldestRecord, + (ndr_print_function_t) ndr_print_eventlog_GetOldestRecord, + false, + }, + { + "eventlog_ChangeNotify", + sizeof(struct eventlog_ChangeNotify), + (ndr_push_flags_fn_t) ndr_push_eventlog_ChangeNotify, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ChangeNotify, + (ndr_print_function_t) ndr_print_eventlog_ChangeNotify, + false, + }, + { + "eventlog_OpenEventLogW", + sizeof(struct eventlog_OpenEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_OpenEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenEventLogW, + (ndr_print_function_t) ndr_print_eventlog_OpenEventLogW, + false, + }, + { + "eventlog_RegisterEventSourceW", + sizeof(struct eventlog_RegisterEventSourceW), + (ndr_push_flags_fn_t) ndr_push_eventlog_RegisterEventSourceW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_RegisterEventSourceW, + (ndr_print_function_t) ndr_print_eventlog_RegisterEventSourceW, + false, + }, + { + "eventlog_OpenBackupEventLogW", + sizeof(struct eventlog_OpenBackupEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_OpenBackupEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenBackupEventLogW, + (ndr_print_function_t) ndr_print_eventlog_OpenBackupEventLogW, + false, + }, + { + "eventlog_ReadEventLogW", + sizeof(struct eventlog_ReadEventLogW), + (ndr_push_flags_fn_t) ndr_push_eventlog_ReadEventLogW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReadEventLogW, + (ndr_print_function_t) ndr_print_eventlog_ReadEventLogW, + false, + }, + { + "eventlog_ReportEventW", + sizeof(struct eventlog_ReportEventW), + (ndr_push_flags_fn_t) ndr_push_eventlog_ReportEventW, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReportEventW, + (ndr_print_function_t) ndr_print_eventlog_ReportEventW, + false, + }, + { + "eventlog_ClearEventLogA", + sizeof(struct eventlog_ClearEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_ClearEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ClearEventLogA, + (ndr_print_function_t) ndr_print_eventlog_ClearEventLogA, + false, + }, + { + "eventlog_BackupEventLogA", + sizeof(struct eventlog_BackupEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_BackupEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_BackupEventLogA, + (ndr_print_function_t) ndr_print_eventlog_BackupEventLogA, + false, + }, + { + "eventlog_OpenEventLogA", + sizeof(struct eventlog_OpenEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_OpenEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenEventLogA, + (ndr_print_function_t) ndr_print_eventlog_OpenEventLogA, + false, + }, + { + "eventlog_RegisterEventSourceA", + sizeof(struct eventlog_RegisterEventSourceA), + (ndr_push_flags_fn_t) ndr_push_eventlog_RegisterEventSourceA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_RegisterEventSourceA, + (ndr_print_function_t) ndr_print_eventlog_RegisterEventSourceA, + false, + }, + { + "eventlog_OpenBackupEventLogA", + sizeof(struct eventlog_OpenBackupEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_OpenBackupEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenBackupEventLogA, + (ndr_print_function_t) ndr_print_eventlog_OpenBackupEventLogA, + false, + }, + { + "eventlog_ReadEventLogA", + sizeof(struct eventlog_ReadEventLogA), + (ndr_push_flags_fn_t) ndr_push_eventlog_ReadEventLogA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReadEventLogA, + (ndr_print_function_t) ndr_print_eventlog_ReadEventLogA, + false, + }, + { + "eventlog_ReportEventA", + sizeof(struct eventlog_ReportEventA), + (ndr_push_flags_fn_t) ndr_push_eventlog_ReportEventA, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReportEventA, + (ndr_print_function_t) ndr_print_eventlog_ReportEventA, + false, + }, + { + "eventlog_RegisterClusterSvc", + sizeof(struct eventlog_RegisterClusterSvc), + (ndr_push_flags_fn_t) ndr_push_eventlog_RegisterClusterSvc, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_RegisterClusterSvc, + (ndr_print_function_t) ndr_print_eventlog_RegisterClusterSvc, + false, + }, + { + "eventlog_DeregisterClusterSvc", + sizeof(struct eventlog_DeregisterClusterSvc), + (ndr_push_flags_fn_t) ndr_push_eventlog_DeregisterClusterSvc, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_DeregisterClusterSvc, + (ndr_print_function_t) ndr_print_eventlog_DeregisterClusterSvc, + false, + }, + { + "eventlog_WriteClusterEvents", + sizeof(struct eventlog_WriteClusterEvents), + (ndr_push_flags_fn_t) ndr_push_eventlog_WriteClusterEvents, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_WriteClusterEvents, + (ndr_print_function_t) ndr_print_eventlog_WriteClusterEvents, + false, + }, + { + "eventlog_GetLogIntormation", + sizeof(struct eventlog_GetLogIntormation), + (ndr_push_flags_fn_t) ndr_push_eventlog_GetLogIntormation, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetLogIntormation, + (ndr_print_function_t) ndr_print_eventlog_GetLogIntormation, + false, + }, + { + "eventlog_FlushEventLog", + sizeof(struct eventlog_FlushEventLog), + (ndr_push_flags_fn_t) ndr_push_eventlog_FlushEventLog, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_FlushEventLog, + (ndr_print_function_t) ndr_print_eventlog_FlushEventLog, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const eventlog_endpoint_strings[] = { + "ncacn_np:[\\pipe\\eventlog]", +}; + +static const struct ndr_interface_string_array eventlog_endpoints = { + .count = 1, + .names = eventlog_endpoint_strings +}; + +static const char * const eventlog_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array eventlog_authservices = { + .count = 1, + .names = eventlog_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_eventlog = { + .name = "eventlog", + .syntax_id = { + {0x82273fdc,0xe32a,0x18c3,{0x3f,0x78},{0x82,0x79,0x29,0xdc,0x23,0xea}}, + NDR_EVENTLOG_VERSION + }, + .helpstring = NDR_EVENTLOG_HELPSTRING, + .num_calls = 24, + .calls = eventlog_calls, + .endpoints = &eventlog_endpoints, + .authservices = &eventlog_authservices +}; + diff --git a/librpc/gen_ndr/ndr_eventlog.h b/librpc/gen_ndr/ndr_eventlog.h new file mode 100644 index 0000000000..6002f35a7d --- /dev/null +++ b/librpc/gen_ndr/ndr_eventlog.h @@ -0,0 +1,92 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/eventlog.h" + +#ifndef _HEADER_NDR_eventlog +#define _HEADER_NDR_eventlog + +#define NDR_EVENTLOG_UUID "82273fdc-e32a-18c3-3f78-827929dc23ea" +#define NDR_EVENTLOG_VERSION 0.0 +#define NDR_EVENTLOG_NAME "eventlog" +#define NDR_EVENTLOG_HELPSTRING "Event Logger" +extern const struct ndr_interface_table ndr_table_eventlog; +#define NDR_EVENTLOG_CLEAREVENTLOGW (0x00) + +#define NDR_EVENTLOG_BACKUPEVENTLOGW (0x01) + +#define NDR_EVENTLOG_CLOSEEVENTLOG (0x02) + +#define NDR_EVENTLOG_DEREGISTEREVENTSOURCE (0x03) + +#define NDR_EVENTLOG_GETNUMRECORDS (0x04) + +#define NDR_EVENTLOG_GETOLDESTRECORD (0x05) + +#define NDR_EVENTLOG_CHANGENOTIFY (0x06) + +#define NDR_EVENTLOG_OPENEVENTLOGW (0x07) + +#define NDR_EVENTLOG_REGISTEREVENTSOURCEW (0x08) + +#define NDR_EVENTLOG_OPENBACKUPEVENTLOGW (0x09) + +#define NDR_EVENTLOG_READEVENTLOGW (0x0a) + +#define NDR_EVENTLOG_REPORTEVENTW (0x0b) + +#define NDR_EVENTLOG_CLEAREVENTLOGA (0x0c) + +#define NDR_EVENTLOG_BACKUPEVENTLOGA (0x0d) + +#define NDR_EVENTLOG_OPENEVENTLOGA (0x0e) + +#define NDR_EVENTLOG_REGISTEREVENTSOURCEA (0x0f) + +#define NDR_EVENTLOG_OPENBACKUPEVENTLOGA (0x10) + +#define NDR_EVENTLOG_READEVENTLOGA (0x11) + +#define NDR_EVENTLOG_REPORTEVENTA (0x12) + +#define NDR_EVENTLOG_REGISTERCLUSTERSVC (0x13) + +#define NDR_EVENTLOG_DEREGISTERCLUSTERSVC (0x14) + +#define NDR_EVENTLOG_WRITECLUSTEREVENTS (0x15) + +#define NDR_EVENTLOG_GETLOGINTORMATION (0x16) + +#define NDR_EVENTLOG_FLUSHEVENTLOG (0x17) + +#define NDR_EVENTLOG_CALL_COUNT (24) +void ndr_print_eventlogReadFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_eventlog_OpenUnknown0(struct ndr_print *ndr, const char *name, const struct eventlog_OpenUnknown0 *r); +enum ndr_err_code ndr_push_eventlog_Record(struct ndr_push *ndr, int ndr_flags, const struct eventlog_Record *r); +enum ndr_err_code ndr_pull_eventlog_Record(struct ndr_pull *ndr, int ndr_flags, struct eventlog_Record *r); +void ndr_print_eventlog_Record(struct ndr_print *ndr, const char *name, const struct eventlog_Record *r); +void ndr_print_eventlog_ClearEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ClearEventLogW *r); +void ndr_print_eventlog_BackupEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_BackupEventLogW *r); +void ndr_print_eventlog_CloseEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_CloseEventLog *r); +void ndr_print_eventlog_DeregisterEventSource(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_DeregisterEventSource *r); +void ndr_print_eventlog_GetNumRecords(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetNumRecords *r); +void ndr_print_eventlog_GetOldestRecord(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetOldestRecord *r); +void ndr_print_eventlog_ChangeNotify(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ChangeNotify *r); +void ndr_print_eventlog_OpenEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenEventLogW *r); +void ndr_print_eventlog_RegisterEventSourceW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterEventSourceW *r); +void ndr_print_eventlog_OpenBackupEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenBackupEventLogW *r); +void ndr_print_eventlog_ReadEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReadEventLogW *r); +void ndr_print_eventlog_ReportEventW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReportEventW *r); +void ndr_print_eventlog_ClearEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ClearEventLogA *r); +void ndr_print_eventlog_BackupEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_BackupEventLogA *r); +void ndr_print_eventlog_OpenEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenEventLogA *r); +void ndr_print_eventlog_RegisterEventSourceA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterEventSourceA *r); +void ndr_print_eventlog_OpenBackupEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenBackupEventLogA *r); +void ndr_print_eventlog_ReadEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReadEventLogA *r); +void ndr_print_eventlog_ReportEventA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReportEventA *r); +void ndr_print_eventlog_RegisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterClusterSvc *r); +void ndr_print_eventlog_DeregisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_DeregisterClusterSvc *r); +void ndr_print_eventlog_WriteClusterEvents(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_WriteClusterEvents *r); +void ndr_print_eventlog_GetLogIntormation(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetLogIntormation *r); +void ndr_print_eventlog_FlushEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_FlushEventLog *r); +#endif /* _HEADER_NDR_eventlog */ diff --git a/librpc/gen_ndr/ndr_initshutdown.c b/librpc/gen_ndr/ndr_initshutdown.c new file mode 100644 index 0000000000..62a19af3a2 --- /dev/null +++ b/librpc/gen_ndr/ndr_initshutdown.c @@ -0,0 +1,330 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_initshutdown.h" + +#include "librpc/gen_ndr/ndr_lsa.h" +static enum ndr_err_code ndr_push_initshutdown_Init(struct ndr_push *ndr, int flags, const struct initshutdown_Init *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname)); + if (r->in.hostname) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message)); + if (r->in.message) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_initshutdown_Init(struct ndr_pull *ndr, int flags, struct initshutdown_Init *r) +{ + uint32_t _ptr_hostname; + uint32_t _ptr_message; + TALLOC_CTX *_mem_save_hostname_0; + TALLOC_CTX *_mem_save_message_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname)); + if (_ptr_hostname) { + NDR_PULL_ALLOC(ndr, r->in.hostname); + } else { + r->in.hostname = NULL; + } + if (r->in.hostname) { + _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message)); + if (_ptr_message) { + NDR_PULL_ALLOC(ndr, r->in.message); + } else { + r->in.message = NULL; + } + if (r->in.message) { + _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Init *r) +{ + ndr_print_struct(ndr, name, "initshutdown_Init"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "initshutdown_Init"); + ndr->depth++; + ndr_print_ptr(ndr, "hostname", r->in.hostname); + ndr->depth++; + if (r->in.hostname) { + ndr_print_uint16(ndr, "hostname", *r->in.hostname); + } + ndr->depth--; + ndr_print_ptr(ndr, "message", r->in.message); + ndr->depth++; + if (r->in.message) { + ndr_print_lsa_StringLarge(ndr, "message", r->in.message); + } + ndr->depth--; + ndr_print_uint32(ndr, "timeout", r->in.timeout); + ndr_print_uint8(ndr, "force_apps", r->in.force_apps); + ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "initshutdown_Init"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_initshutdown_Abort(struct ndr_push *ndr, int flags, const struct initshutdown_Abort *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.server)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_initshutdown_Abort(struct ndr_pull *ndr, int flags, struct initshutdown_Abort *r) +{ + uint32_t _ptr_server; + TALLOC_CTX *_mem_save_server_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.server)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_initshutdown_Abort(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Abort *r) +{ + ndr_print_struct(ndr, name, "initshutdown_Abort"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "initshutdown_Abort"); + ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_uint16(ndr, "server", *r->in.server); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "initshutdown_Abort"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_initshutdown_InitEx(struct ndr_push *ndr, int flags, const struct initshutdown_InitEx *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname)); + if (r->in.hostname) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message)); + if (r->in.message) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reason)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_initshutdown_InitEx(struct ndr_pull *ndr, int flags, struct initshutdown_InitEx *r) +{ + uint32_t _ptr_hostname; + uint32_t _ptr_message; + TALLOC_CTX *_mem_save_hostname_0; + TALLOC_CTX *_mem_save_message_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname)); + if (_ptr_hostname) { + NDR_PULL_ALLOC(ndr, r->in.hostname); + } else { + r->in.hostname = NULL; + } + if (r->in.hostname) { + _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message)); + if (_ptr_message) { + NDR_PULL_ALLOC(ndr, r->in.message); + } else { + r->in.message = NULL; + } + if (r->in.message) { + _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reason)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_InitEx *r) +{ + ndr_print_struct(ndr, name, "initshutdown_InitEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "initshutdown_InitEx"); + ndr->depth++; + ndr_print_ptr(ndr, "hostname", r->in.hostname); + ndr->depth++; + if (r->in.hostname) { + ndr_print_uint16(ndr, "hostname", *r->in.hostname); + } + ndr->depth--; + ndr_print_ptr(ndr, "message", r->in.message); + ndr->depth++; + if (r->in.message) { + ndr_print_lsa_StringLarge(ndr, "message", r->in.message); + } + ndr->depth--; + ndr_print_uint32(ndr, "timeout", r->in.timeout); + ndr_print_uint8(ndr, "force_apps", r->in.force_apps); + ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot); + ndr_print_uint32(ndr, "reason", r->in.reason); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "initshutdown_InitEx"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call initshutdown_calls[] = { + { + "initshutdown_Init", + sizeof(struct initshutdown_Init), + (ndr_push_flags_fn_t) ndr_push_initshutdown_Init, + (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Init, + (ndr_print_function_t) ndr_print_initshutdown_Init, + false, + }, + { + "initshutdown_Abort", + sizeof(struct initshutdown_Abort), + (ndr_push_flags_fn_t) ndr_push_initshutdown_Abort, + (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Abort, + (ndr_print_function_t) ndr_print_initshutdown_Abort, + false, + }, + { + "initshutdown_InitEx", + sizeof(struct initshutdown_InitEx), + (ndr_push_flags_fn_t) ndr_push_initshutdown_InitEx, + (ndr_pull_flags_fn_t) ndr_pull_initshutdown_InitEx, + (ndr_print_function_t) ndr_print_initshutdown_InitEx, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const initshutdown_endpoint_strings[] = { + "ncacn_np:[\\pipe\\InitShutdown]", +}; + +static const struct ndr_interface_string_array initshutdown_endpoints = { + .count = 1, + .names = initshutdown_endpoint_strings +}; + +static const char * const initshutdown_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array initshutdown_authservices = { + .count = 1, + .names = initshutdown_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_initshutdown = { + .name = "initshutdown", + .syntax_id = { + {0x894de0c0,0x0d55,0x11d3,{0xa3,0x22},{0x00,0xc0,0x4f,0xa3,0x21,0xa1}}, + NDR_INITSHUTDOWN_VERSION + }, + .helpstring = NDR_INITSHUTDOWN_HELPSTRING, + .num_calls = 3, + .calls = initshutdown_calls, + .endpoints = &initshutdown_endpoints, + .authservices = &initshutdown_authservices +}; + diff --git a/librpc/gen_ndr/ndr_initshutdown.h b/librpc/gen_ndr/ndr_initshutdown.h new file mode 100644 index 0000000000..2cb5a530b0 --- /dev/null +++ b/librpc/gen_ndr/ndr_initshutdown.h @@ -0,0 +1,24 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/initshutdown.h" + +#ifndef _HEADER_NDR_initshutdown +#define _HEADER_NDR_initshutdown + +#define NDR_INITSHUTDOWN_UUID "894de0c0-0d55-11d3-a322-00c04fa321a1" +#define NDR_INITSHUTDOWN_VERSION 1.0 +#define NDR_INITSHUTDOWN_NAME "initshutdown" +#define NDR_INITSHUTDOWN_HELPSTRING "Init shutdown service" +extern const struct ndr_interface_table ndr_table_initshutdown; +#define NDR_INITSHUTDOWN_INIT (0x00) + +#define NDR_INITSHUTDOWN_ABORT (0x01) + +#define NDR_INITSHUTDOWN_INITEX (0x02) + +#define NDR_INITSHUTDOWN_CALL_COUNT (3) +void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Init *r); +void ndr_print_initshutdown_Abort(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Abort *r); +void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_InitEx *r); +#endif /* _HEADER_NDR_initshutdown */ diff --git a/librpc/gen_ndr/ndr_krb5pac.c b/librpc/gen_ndr/ndr_krb5pac.c new file mode 100644 index 0000000000..125fb7eb77 --- /dev/null +++ b/librpc/gen_ndr/ndr_krb5pac.c @@ -0,0 +1,984 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_krb5pac.h" + +#include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/ndr_netlogon.h" +#include "librpc/gen_ndr/ndr_samr.h" +static enum ndr_err_code ndr_push_PAC_LOGON_NAME(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_NAME *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->logon_time)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->account_name))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, 2 * strlen_m(r->account_name), sizeof(uint8_t), CH_UTF16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PAC_LOGON_NAME(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_NAME *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->logon_time)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, r->size, sizeof(uint8_t), CH_UTF16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_LOGON_NAME(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_NAME *r) +{ + ndr_print_struct(ndr, name, "PAC_LOGON_NAME"); + ndr->depth++; + ndr_print_NTTIME(ndr, "logon_time", r->logon_time); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->account_name):r->size); + ndr_print_string(ndr, "account_name", r->account_name); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_SIGNATURE_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_SIGNATURE_DATA *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->type)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->signature)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_SIGNATURE_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_SIGNATURE_DATA *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->type)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->signature)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_SIGNATURE_DATA(struct ndr_print *ndr, const char *name, const struct PAC_SIGNATURE_DATA *r) +{ + ndr_print_struct(ndr, name, "PAC_SIGNATURE_DATA"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint32(ndr, "type", r->type); + ndr_print_DATA_BLOB(ndr, "signature", r->signature); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_PAC_LOGON_INFO(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->res_group_dom_sid)); + NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->res_groups)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); + if (r->res_group_dom_sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->res_group_dom_sid)); + } + NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->res_groups)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PAC_LOGON_INFO(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO *r) +{ + uint32_t _ptr_res_group_dom_sid; + TALLOC_CTX *_mem_save_res_group_dom_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_res_group_dom_sid)); + if (_ptr_res_group_dom_sid) { + NDR_PULL_ALLOC(ndr, r->res_group_dom_sid); + } else { + r->res_group_dom_sid = NULL; + } + NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->res_groups)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); + if (r->res_group_dom_sid) { + _mem_save_res_group_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->res_group_dom_sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->res_group_dom_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_group_dom_sid_0, 0); + } + NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->res_groups)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_LOGON_INFO(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO *r) +{ + ndr_print_struct(ndr, name, "PAC_LOGON_INFO"); + ndr->depth++; + ndr_print_netr_SamInfo3(ndr, "info3", &r->info3); + ndr_print_ptr(ndr, "res_group_dom_sid", r->res_group_dom_sid); + ndr->depth++; + if (r->res_group_dom_sid) { + ndr_print_dom_sid2(ndr, "res_group_dom_sid", r->res_group_dom_sid); + } + ndr->depth--; + ndr_print_samr_RidWithAttributeArray(ndr, "res_groups", &r->res_groups); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_LOGON_INFO_CTR(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO_CTR *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_LOGON_INFO_CTR(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO_CTR *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->info); + } else { + r->info = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_LOGON_INFO_CTR(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO_CTR *r) +{ + ndr_print_struct(ndr, name, "PAC_LOGON_INFO_CTR"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->info); + ndr->depth++; + if (r->info) { + ndr_print_PAC_LOGON_INFO(ndr, "info", r->info); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_TYPE(struct ndr_push *ndr, int ndr_flags, enum PAC_TYPE r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_TYPE(struct ndr_pull *ndr, int ndr_flags, enum PAC_TYPE *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_TYPE(struct ndr_print *ndr, const char *name, enum PAC_TYPE r) +{ + const char *val = NULL; + + switch (r) { + case PAC_TYPE_LOGON_INFO: val = "PAC_TYPE_LOGON_INFO"; break; + case PAC_TYPE_SRV_CHECKSUM: val = "PAC_TYPE_SRV_CHECKSUM"; break; + case PAC_TYPE_KDC_CHECKSUM: val = "PAC_TYPE_KDC_CHECKSUM"; break; + case PAC_TYPE_LOGON_NAME: val = "PAC_TYPE_LOGON_NAME"; break; + case PAC_TYPE_CONSTRAINED_DELEGATION: val = "PAC_TYPE_CONSTRAINED_DELEGATION"; break; + case PAC_TYPE_UNKNOWN_12: val = "PAC_TYPE_UNKNOWN_12"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_DATA_BLOB_REM(struct ndr_push *ndr, int ndr_flags, const struct DATA_BLOB_REM *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DATA_BLOB_REM(struct ndr_pull *ndr, int ndr_flags, struct DATA_BLOB_REM *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DATA_BLOB_REM(struct ndr_print *ndr, const char *name, const struct DATA_BLOB_REM *r) +{ + ndr_print_struct(ndr, name, "DATA_BLOB_REM"); + ndr->depth++; + ndr_print_DATA_BLOB(ndr, "remaining", r->remaining); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_INFO(struct ndr_push *ndr, int ndr_flags, const union PAC_INFO *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case PAC_TYPE_LOGON_INFO: { + { + struct ndr_push *_ndr_logon_info; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_logon_info, 0xFFFFFC01, -1)); + NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(_ndr_logon_info, NDR_SCALARS|NDR_BUFFERS, &r->logon_info)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_logon_info, 0xFFFFFC01, -1)); + } + break; } + + case PAC_TYPE_SRV_CHECKSUM: { + NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum)); + break; } + + case PAC_TYPE_KDC_CHECKSUM: { + NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum)); + break; } + + case PAC_TYPE_LOGON_NAME: { + NDR_CHECK(ndr_push_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name)); + break; } + + default: { + { + struct ndr_push *_ndr_unknown; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_unknown, 0, -1)); + NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_unknown, NDR_SCALARS, &r->unknown)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_unknown, 0, -1)); + } + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case PAC_TYPE_LOGON_INFO: + break; + + case PAC_TYPE_SRV_CHECKSUM: + break; + + case PAC_TYPE_KDC_CHECKSUM: + break; + + case PAC_TYPE_LOGON_NAME: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_INFO(struct ndr_pull *ndr, int ndr_flags, union PAC_INFO *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case PAC_TYPE_LOGON_INFO: { + { + struct ndr_pull *_ndr_logon_info; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_logon_info, 0xFFFFFC01, -1)); + NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(_ndr_logon_info, NDR_SCALARS|NDR_BUFFERS, &r->logon_info)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_logon_info, 0xFFFFFC01, -1)); + } + break; } + + case PAC_TYPE_SRV_CHECKSUM: { + NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum)); + break; } + + case PAC_TYPE_KDC_CHECKSUM: { + NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum)); + break; } + + case PAC_TYPE_LOGON_NAME: { + NDR_CHECK(ndr_pull_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name)); + break; } + + default: { + { + struct ndr_pull *_ndr_unknown; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_unknown, 0, -1)); + NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_unknown, NDR_SCALARS, &r->unknown)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_unknown, 0, -1)); + } + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case PAC_TYPE_LOGON_INFO: + break; + + case PAC_TYPE_SRV_CHECKSUM: + break; + + case PAC_TYPE_KDC_CHECKSUM: + break; + + case PAC_TYPE_LOGON_NAME: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_INFO(struct ndr_print *ndr, const char *name, const union PAC_INFO *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "PAC_INFO"); + switch (level) { + case PAC_TYPE_LOGON_INFO: + ndr_print_PAC_LOGON_INFO_CTR(ndr, "logon_info", &r->logon_info); + break; + + case PAC_TYPE_SRV_CHECKSUM: + ndr_print_PAC_SIGNATURE_DATA(ndr, "srv_cksum", &r->srv_cksum); + break; + + case PAC_TYPE_KDC_CHECKSUM: + ndr_print_PAC_SIGNATURE_DATA(ndr, "kdc_cksum", &r->kdc_cksum); + break; + + case PAC_TYPE_LOGON_NAME: + ndr_print_PAC_LOGON_NAME(ndr, "logon_name", &r->logon_name); + break; + + default: + ndr_print_DATA_BLOB_REM(ndr, "unknown", &r->unknown); + break; + + } +} + +_PUBLIC_ size_t ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags) +{ + return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_PAC_INFO); +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA *r) +{ + uint32_t cntr_buffers_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA *r) +{ + uint32_t cntr_buffers_0; + TALLOC_CTX *_mem_save_buffers_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers); + _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_DATA(struct ndr_print *ndr, const char *name, const struct PAC_DATA *r) +{ + uint32_t cntr_buffers_0; + ndr_print_struct(ndr, name, "PAC_DATA"); + ndr->depth++; + ndr_print_uint32(ndr, "num_buffers", r->num_buffers); + ndr_print_uint32(ndr, "version", r->version); + ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers); + ndr->depth++; + for (cntr_buffers_0=0;cntr_buffers_0num_buffers;cntr_buffers_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) { + ndr_print_PAC_BUFFER(ndr, "buffers", &r->buffers[cntr_buffers_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ndr_size)); + { + uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info)); + ndr->flags = _flags_save_DATA_BLOB_REM; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + if (r->info) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->info)); + { + struct ndr_push *_ndr_info; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); + NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); + } + } + ndr->flags = _flags_save_DATA_BLOB_REM; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_BUFFER_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER_RAW *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_PAC_TYPE(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ndr_size)); + { + uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->info); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info)); + } else { + r->info = NULL; + } + ndr->flags = _flags_save_DATA_BLOB_REM; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + if (r->info) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->info)); + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + { + struct ndr_pull *_ndr_info; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); + NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_DATA_BLOB_REM; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_BUFFER_RAW(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER_RAW *r) +{ + ndr_print_struct(ndr, name, "PAC_BUFFER_RAW"); + ndr->depth++; + ndr_print_PAC_TYPE(ndr, "type", r->type); + ndr_print_uint32(ndr, "ndr_size", r->ndr_size); + ndr_print_ptr(ndr, "info", r->info); + ndr->depth++; + if (r->info) { + ndr_print_DATA_BLOB_REM(ndr, "info", r->info); + } + ndr->depth--; + ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA_RAW *r) +{ + uint32_t cntr_buffers_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA_RAW *r) +{ + uint32_t cntr_buffers_0; + TALLOC_CTX *_mem_save_buffers_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers); + _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_DATA_RAW(struct ndr_print *ndr, const char *name, const struct PAC_DATA_RAW *r) +{ + uint32_t cntr_buffers_0; + ndr_print_struct(ndr, name, "PAC_DATA_RAW"); + ndr->depth++; + ndr_print_uint32(ndr, "num_buffers", r->num_buffers); + ndr_print_uint32(ndr, "version", r->version); + ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers); + ndr->depth++; + for (cntr_buffers_0=0;cntr_buffers_0num_buffers;cntr_buffers_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) { + ndr_print_PAC_BUFFER_RAW(ndr, "buffers", &r->buffers[cntr_buffers_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_Validate(struct ndr_push *ndr, int ndr_flags, const struct PAC_Validate *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NETLOGON_GENERIC_KRB5_PAC_VALIDATE)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ChecksumLength)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->SignatureType)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SignatureLength)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->ChecksumAndSignature)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_Validate(struct ndr_pull *ndr, int ndr_flags, struct PAC_Validate *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MessageType)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ChecksumLength)); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->SignatureType)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SignatureLength)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->ChecksumAndSignature)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_Validate(struct ndr_print *ndr, const char *name, const struct PAC_Validate *r) +{ + ndr_print_struct(ndr, name, "PAC_Validate"); + ndr->depth++; + ndr_print_uint32(ndr, "MessageType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NETLOGON_GENERIC_KRB5_PAC_VALIDATE:r->MessageType); + ndr_print_uint32(ndr, "ChecksumLength", r->ChecksumLength); + ndr_print_int32(ndr, "SignatureType", r->SignatureType); + ndr_print_uint32(ndr, "SignatureLength", r->SignatureLength); + ndr_print_DATA_BLOB(ndr, "ChecksumAndSignature", r->ChecksumAndSignature); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netsamlogoncache_entry(struct ndr_push *ndr, int ndr_flags, const struct netsamlogoncache_entry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp)); + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netsamlogoncache_entry(struct ndr_pull *ndr, int ndr_flags, struct netsamlogoncache_entry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp)); + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netsamlogoncache_entry(struct ndr_print *ndr, const char *name, const struct netsamlogoncache_entry *r) +{ + ndr_print_struct(ndr, name, "netsamlogoncache_entry"); + ndr->depth++; + ndr_print_time_t(ndr, "timestamp", r->timestamp); + ndr_print_netr_SamInfo3(ndr, "info3", &r->info3); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_pac(struct ndr_push *ndr, int flags, const struct decode_pac *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_pac(struct ndr_pull *ndr, int flags, struct decode_pac *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_pac(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac *r) +{ + ndr_print_struct(ndr, name, "decode_pac"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_pac"); + ndr->depth++; + ndr_print_PAC_DATA(ndr, "pac", &r->in.pac); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_pac"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_pac_raw(struct ndr_push *ndr, int flags, const struct decode_pac_raw *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_pac_raw(struct ndr_pull *ndr, int flags, struct decode_pac_raw *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_pac_raw(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_raw *r) +{ + ndr_print_struct(ndr, name, "decode_pac_raw"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_pac_raw"); + ndr->depth++; + ndr_print_PAC_DATA_RAW(ndr, "pac", &r->in.pac); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_pac_raw"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_login_info(struct ndr_push *ndr, int flags, const struct decode_login_info *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_login_info(struct ndr_pull *ndr, int flags, struct decode_login_info *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_login_info(struct ndr_print *ndr, const char *name, int flags, const struct decode_login_info *r) +{ + ndr_print_struct(ndr, name, "decode_login_info"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_login_info"); + ndr->depth++; + ndr_print_PAC_LOGON_INFO(ndr, "logon_info", &r->in.logon_info); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_login_info"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_pac_validate(struct ndr_push *ndr, int flags, const struct decode_pac_validate *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_PAC_Validate(ndr, NDR_SCALARS, &r->in.pac_validate)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_pac_validate(struct ndr_pull *ndr, int flags, struct decode_pac_validate *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_PAC_Validate(ndr, NDR_SCALARS, &r->in.pac_validate)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_pac_validate(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_validate *r) +{ + ndr_print_struct(ndr, name, "decode_pac_validate"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_pac_validate"); + ndr->depth++; + ndr_print_PAC_Validate(ndr, "pac_validate", &r->in.pac_validate); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_pac_validate"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call krb5pac_calls[] = { + { + "decode_pac", + sizeof(struct decode_pac), + (ndr_push_flags_fn_t) ndr_push_decode_pac, + (ndr_pull_flags_fn_t) ndr_pull_decode_pac, + (ndr_print_function_t) ndr_print_decode_pac, + false, + }, + { + "decode_pac_raw", + sizeof(struct decode_pac_raw), + (ndr_push_flags_fn_t) ndr_push_decode_pac_raw, + (ndr_pull_flags_fn_t) ndr_pull_decode_pac_raw, + (ndr_print_function_t) ndr_print_decode_pac_raw, + false, + }, + { + "decode_login_info", + sizeof(struct decode_login_info), + (ndr_push_flags_fn_t) ndr_push_decode_login_info, + (ndr_pull_flags_fn_t) ndr_pull_decode_login_info, + (ndr_print_function_t) ndr_print_decode_login_info, + false, + }, + { + "decode_pac_validate", + sizeof(struct decode_pac_validate), + (ndr_push_flags_fn_t) ndr_push_decode_pac_validate, + (ndr_pull_flags_fn_t) ndr_pull_decode_pac_validate, + (ndr_print_function_t) ndr_print_decode_pac_validate, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const krb5pac_endpoint_strings[] = { + "ncacn_np:[\\pipe\\krb5pac]", +}; + +static const struct ndr_interface_string_array krb5pac_endpoints = { + .count = 1, + .names = krb5pac_endpoint_strings +}; + +static const char * const krb5pac_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array krb5pac_authservices = { + .count = 1, + .names = krb5pac_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_krb5pac = { + .name = "krb5pac", + .syntax_id = { + {0x12345778,0x1234,0xabcd,{0x00,0x00},{0x00,0x00,0x00,0x00}}, + NDR_KRB5PAC_VERSION + }, + .helpstring = NDR_KRB5PAC_HELPSTRING, + .num_calls = 4, + .calls = krb5pac_calls, + .endpoints = &krb5pac_endpoints, + .authservices = &krb5pac_authservices +}; + diff --git a/librpc/gen_ndr/ndr_krb5pac.h b/librpc/gen_ndr/ndr_krb5pac.h new file mode 100644 index 0000000000..bf09e3fad5 --- /dev/null +++ b/librpc/gen_ndr/ndr_krb5pac.h @@ -0,0 +1,61 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/krb5pac.h" + +#ifndef _HEADER_NDR_krb5pac +#define _HEADER_NDR_krb5pac + +#define NDR_KRB5PAC_UUID "12345778-1234-abcd-0000-00000000" +#define NDR_KRB5PAC_VERSION 0.0 +#define NDR_KRB5PAC_NAME "krb5pac" +#define NDR_KRB5PAC_HELPSTRING "Active Directory KRB5 PAC" +extern const struct ndr_interface_table ndr_table_krb5pac; +#define NDR_DECODE_PAC (0x00) + +#define NDR_DECODE_PAC_RAW (0x01) + +#define NDR_DECODE_LOGIN_INFO (0x02) + +#define NDR_DECODE_PAC_VALIDATE (0x03) + +#define NDR_KRB5PAC_CALL_COUNT (4) +void ndr_print_PAC_LOGON_NAME(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_NAME *r); +enum ndr_err_code ndr_push_PAC_SIGNATURE_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_SIGNATURE_DATA *r); +enum ndr_err_code ndr_pull_PAC_SIGNATURE_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_SIGNATURE_DATA *r); +void ndr_print_PAC_SIGNATURE_DATA(struct ndr_print *ndr, const char *name, const struct PAC_SIGNATURE_DATA *r); +void ndr_print_PAC_LOGON_INFO(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO *r); +enum ndr_err_code ndr_push_PAC_LOGON_INFO_CTR(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO_CTR *r); +enum ndr_err_code ndr_pull_PAC_LOGON_INFO_CTR(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO_CTR *r); +void ndr_print_PAC_LOGON_INFO_CTR(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO_CTR *r); +enum ndr_err_code ndr_push_PAC_TYPE(struct ndr_push *ndr, int ndr_flags, enum PAC_TYPE r); +enum ndr_err_code ndr_pull_PAC_TYPE(struct ndr_pull *ndr, int ndr_flags, enum PAC_TYPE *r); +void ndr_print_PAC_TYPE(struct ndr_print *ndr, const char *name, enum PAC_TYPE r); +void ndr_print_DATA_BLOB_REM(struct ndr_print *ndr, const char *name, const struct DATA_BLOB_REM *r); +enum ndr_err_code ndr_push_PAC_INFO(struct ndr_push *ndr, int ndr_flags, const union PAC_INFO *r); +enum ndr_err_code ndr_pull_PAC_INFO(struct ndr_pull *ndr, int ndr_flags, union PAC_INFO *r); +void ndr_print_PAC_INFO(struct ndr_print *ndr, const char *name, const union PAC_INFO *r); +size_t ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags); +enum ndr_err_code ndr_push_PAC_BUFFER(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER *r); +enum ndr_err_code ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER *r); +void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER *r); +enum ndr_err_code ndr_push_PAC_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA *r); +enum ndr_err_code ndr_pull_PAC_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA *r); +void ndr_print_PAC_DATA(struct ndr_print *ndr, const char *name, const struct PAC_DATA *r); +enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r); +enum ndr_err_code ndr_pull_PAC_BUFFER_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER_RAW *r); +void ndr_print_PAC_BUFFER_RAW(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER_RAW *r); +enum ndr_err_code ndr_push_PAC_DATA_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA_RAW *r); +enum ndr_err_code ndr_pull_PAC_DATA_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA_RAW *r); +void ndr_print_PAC_DATA_RAW(struct ndr_print *ndr, const char *name, const struct PAC_DATA_RAW *r); +enum ndr_err_code ndr_push_PAC_Validate(struct ndr_push *ndr, int ndr_flags, const struct PAC_Validate *r); +enum ndr_err_code ndr_pull_PAC_Validate(struct ndr_pull *ndr, int ndr_flags, struct PAC_Validate *r); +void ndr_print_PAC_Validate(struct ndr_print *ndr, const char *name, const struct PAC_Validate *r); +enum ndr_err_code ndr_push_netsamlogoncache_entry(struct ndr_push *ndr, int ndr_flags, const struct netsamlogoncache_entry *r); +enum ndr_err_code ndr_pull_netsamlogoncache_entry(struct ndr_pull *ndr, int ndr_flags, struct netsamlogoncache_entry *r); +void ndr_print_netsamlogoncache_entry(struct ndr_print *ndr, const char *name, const struct netsamlogoncache_entry *r); +void ndr_print_decode_pac(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac *r); +void ndr_print_decode_pac_raw(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_raw *r); +void ndr_print_decode_login_info(struct ndr_print *ndr, const char *name, int flags, const struct decode_login_info *r); +void ndr_print_decode_pac_validate(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_validate *r); +#endif /* _HEADER_NDR_krb5pac */ diff --git a/librpc/gen_ndr/ndr_lsa.c b/librpc/gen_ndr/ndr_lsa.c new file mode 100644 index 0000000000..926903865e --- /dev/null +++ b/librpc/gen_ndr/ndr_lsa.c @@ -0,0 +1,13236 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_lsa.h" + +#include "librpc/gen_ndr/ndr_misc.h" +#include "librpc/gen_ndr/ndr_security.h" +_PUBLIC_ enum ndr_err_code ndr_push_lsa_String(struct ndr_push *ndr, int ndr_flags, const struct lsa_String *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, 2 * strlen_m(r->string) / 2, sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_String(struct ndr_pull *ndr, int ndr_flags, struct lsa_String *r) +{ + uint32_t _ptr_string; + TALLOC_CTX *_mem_save_string_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + } else { + r->string = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); + if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); + } + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + } + if (r->string) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size / 2)); + } + if (r->string) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length / 2)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_String(struct ndr_print *ndr, const char *name, const struct lsa_String *r) +{ + ndr_print_struct(ndr, name, "lsa_String"); + ndr->depth++; + ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->length); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->size); + ndr_print_ptr(ndr, "string", r->string); + ndr->depth++; + if (r->string) { + ndr_print_string(ndr, "string", r->string); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_StringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_StringLarge *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m_term(r->string))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m_term(r->string) / 2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, 2 * strlen_m(r->string) / 2, sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_StringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_StringLarge *r) +{ + uint32_t _ptr_string; + TALLOC_CTX *_mem_save_string_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + } else { + r->string = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); + if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); + } + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + } + if (r->string) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size / 2)); + } + if (r->string) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length / 2)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_StringLarge(struct ndr_print *ndr, const char *name, const struct lsa_StringLarge *r) +{ + ndr_print_struct(ndr, name, "lsa_StringLarge"); + ndr->depth++; + ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->length); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m_term(r->string):r->size); + ndr_print_ptr(ndr, "string", r->string); + ndr->depth++; + if (r->string) { + ndr_print_string(ndr, "string", r->string); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_Strings(struct ndr_push *ndr, int ndr_flags, const struct lsa_Strings *r) +{ + uint32_t cntr_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_Strings(struct ndr_pull *ndr, int ndr_flags, struct lsa_Strings *r) +{ + uint32_t _ptr_names; + uint32_t cntr_names_1; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); + if (_ptr_names) { + NDR_PULL_ALLOC(ndr, r->names); + } else { + r->names = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); + NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); + _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + } + if (r->names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_Strings(struct ndr_print *ndr, const char *name, const struct lsa_Strings *r) +{ + uint32_t cntr_names_1; + ndr_print_struct(ndr, name, "lsa_Strings"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "names", r->names); + ndr->depth++; + if (r->names) { + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); + ndr->depth++; + for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { + ndr_print_lsa_String(ndr, "names", &r->names[cntr_names_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_AsciiString(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiString *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, strlen_m(r->string), sizeof(uint8_t), CH_DOS)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_AsciiString(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiString *r) +{ + uint32_t _ptr_string; + TALLOC_CTX *_mem_save_string_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + } else { + r->string = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); + if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); + } + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint8_t), CH_DOS)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + } + if (r->string) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size)); + } + if (r->string) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_AsciiString(struct ndr_print *ndr, const char *name, const struct lsa_AsciiString *r) +{ + ndr_print_struct(ndr, name, "lsa_AsciiString"); + ndr->depth++; + ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->length); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->size); + ndr_print_ptr(ndr, "string", r->string); + ndr->depth++; + if (r->string) { + ndr_print_string(ndr, "string", r->string); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_AsciiStringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiStringLarge *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->string))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->string))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, strlen_m(r->string), sizeof(uint8_t), CH_DOS)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_AsciiStringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiStringLarge *r) +{ + uint32_t _ptr_string; + TALLOC_CTX *_mem_save_string_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + } else { + r->string = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); + if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); + } + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint8_t), CH_DOS)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + } + if (r->string) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size)); + } + if (r->string) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_AsciiStringLarge(struct ndr_print *ndr, const char *name, const struct lsa_AsciiStringLarge *r) +{ + ndr_print_struct(ndr, name, "lsa_AsciiStringLarge"); + ndr->depth++; + ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->length); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->string):r->size); + ndr_print_ptr(ndr, "string", r->string); + ndr->depth++; + if (r->string) { + ndr_print_string(ndr, "string", r->string); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct lsa_BinaryString *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length / 2)); + for (cntr_array_1 = 0; cntr_array_1 < r->length / 2; cntr_array_1++) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct lsa_BinaryString *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->array)); + if (ndr_get_array_length(ndr, &r->array) > ndr_get_array_size(ndr, &r->array)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->array), ndr_get_array_length(ndr, &r->array)); + } + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->length / 2; cntr_array_1++) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->size / 2)); + } + if (r->array) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->array, r->length / 2)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_BinaryString(struct ndr_print *ndr, const char *name, const struct lsa_BinaryString *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "lsa_BinaryString"); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr_print_uint16(ndr, "size", r->size); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->length / 2); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1length / 2;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_uint16(ndr, "array", r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LUID(struct ndr_push *ndr, int ndr_flags, const struct lsa_LUID *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->low)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->high)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LUID(struct ndr_pull *ndr, int ndr_flags, struct lsa_LUID *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->low)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->high)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LUID(struct ndr_print *ndr, const char *name, const struct lsa_LUID *r) +{ + ndr_print_struct(ndr, name, "lsa_LUID"); + ndr->depth++; + ndr_print_uint32(ndr, "low", r->low); + ndr_print_uint32(ndr, "high", r->high); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_PrivEntry(struct ndr_push *ndr, int ndr_flags, const struct lsa_PrivEntry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_lsa_LUID(ndr, NDR_SCALARS, &r->luid)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_PrivEntry(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivEntry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, &r->luid)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_PrivEntry(struct ndr_print *ndr, const char *name, const struct lsa_PrivEntry *r) +{ + ndr_print_struct(ndr, name, "lsa_PrivEntry"); + ndr->depth++; + ndr_print_lsa_StringLarge(ndr, "name", &r->name); + ndr_print_lsa_LUID(ndr, "luid", &r->luid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_PrivArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_PrivArray *r) +{ + uint32_t cntr_privs_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->privs)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->privs) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) { + NDR_CHECK(ndr_push_lsa_PrivEntry(ndr, NDR_SCALARS, &r->privs[cntr_privs_1])); + } + for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) { + NDR_CHECK(ndr_push_lsa_PrivEntry(ndr, NDR_BUFFERS, &r->privs[cntr_privs_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_PrivArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivArray *r) +{ + uint32_t _ptr_privs; + uint32_t cntr_privs_1; + TALLOC_CTX *_mem_save_privs_0; + TALLOC_CTX *_mem_save_privs_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privs)); + if (_ptr_privs) { + NDR_PULL_ALLOC(ndr, r->privs); + } else { + r->privs = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->privs) { + _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->privs, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->privs)); + NDR_PULL_ALLOC_N(ndr, r->privs, ndr_get_array_size(ndr, &r->privs)); + _mem_save_privs_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->privs, 0); + for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) { + NDR_CHECK(ndr_pull_lsa_PrivEntry(ndr, NDR_SCALARS, &r->privs[cntr_privs_1])); + } + for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) { + NDR_CHECK(ndr_pull_lsa_PrivEntry(ndr, NDR_BUFFERS, &r->privs[cntr_privs_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, 0); + } + if (r->privs) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privs, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_PrivArray(struct ndr_print *ndr, const char *name, const struct lsa_PrivArray *r) +{ + uint32_t cntr_privs_1; + ndr_print_struct(ndr, name, "lsa_PrivArray"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "privs", r->privs); + ndr->depth++; + if (r->privs) { + ndr->print(ndr, "%s: ARRAY(%d)", "privs", (int)r->count); + ndr->depth++; + for (cntr_privs_1=0;cntr_privs_1count;cntr_privs_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_privs_1) != -1) { + ndr_print_lsa_PrivEntry(ndr, "privs", &r->privs[cntr_privs_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_QosInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_QosInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->impersonation_level)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->context_mode)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->effective_only)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_QosInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_QosInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->impersonation_level)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->context_mode)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->effective_only)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_QosInfo(struct ndr_print *ndr, const char *name, const struct lsa_QosInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_QosInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "len", r->len); + ndr_print_uint16(ndr, "impersonation_level", r->impersonation_level); + ndr_print_uint8(ndr, "context_mode", r->context_mode); + ndr_print_uint8(ndr, "effective_only", r->effective_only); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_ObjectAttribute(struct ndr_push *ndr, int ndr_flags, const struct lsa_ObjectAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->root_dir)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sec_desc)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sec_qos)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->root_dir) { + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->root_dir)); + } + if (r->object_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_name, ndr_charset_length(r->object_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->sec_desc) { + NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sec_desc)); + } + if (r->sec_qos) { + NDR_CHECK(ndr_push_lsa_QosInfo(ndr, NDR_SCALARS, r->sec_qos)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ObjectAttribute(struct ndr_pull *ndr, int ndr_flags, struct lsa_ObjectAttribute *r) +{ + uint32_t _ptr_root_dir; + TALLOC_CTX *_mem_save_root_dir_0; + uint32_t _ptr_object_name; + TALLOC_CTX *_mem_save_object_name_0; + uint32_t _ptr_sec_desc; + TALLOC_CTX *_mem_save_sec_desc_0; + uint32_t _ptr_sec_qos; + TALLOC_CTX *_mem_save_sec_qos_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_root_dir)); + if (_ptr_root_dir) { + NDR_PULL_ALLOC(ndr, r->root_dir); + } else { + r->root_dir = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_name)); + if (_ptr_object_name) { + NDR_PULL_ALLOC(ndr, r->object_name); + } else { + r->object_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sec_desc)); + if (_ptr_sec_desc) { + NDR_PULL_ALLOC(ndr, r->sec_desc); + } else { + r->sec_desc = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sec_qos)); + if (_ptr_sec_qos) { + NDR_PULL_ALLOC(ndr, r->sec_qos); + } else { + r->sec_qos = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->root_dir) { + _mem_save_root_dir_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->root_dir, 0); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->root_dir)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_root_dir_0, 0); + } + if (r->object_name) { + _mem_save_object_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->object_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->object_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->object_name)); + if (ndr_get_array_length(ndr, &r->object_name) > ndr_get_array_size(ndr, &r->object_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_name), ndr_get_array_length(ndr, &r->object_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_name, ndr_get_array_length(ndr, &r->object_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_name_0, 0); + } + if (r->sec_desc) { + _mem_save_sec_desc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sec_desc, 0); + NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sec_desc)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_desc_0, 0); + } + if (r->sec_qos) { + _mem_save_sec_qos_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sec_qos, 0); + NDR_CHECK(ndr_pull_lsa_QosInfo(ndr, NDR_SCALARS, r->sec_qos)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_qos_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ObjectAttribute(struct ndr_print *ndr, const char *name, const struct lsa_ObjectAttribute *r) +{ + ndr_print_struct(ndr, name, "lsa_ObjectAttribute"); + ndr->depth++; + ndr_print_uint32(ndr, "len", r->len); + ndr_print_ptr(ndr, "root_dir", r->root_dir); + ndr->depth++; + if (r->root_dir) { + ndr_print_uint8(ndr, "root_dir", *r->root_dir); + } + ndr->depth--; + ndr_print_ptr(ndr, "object_name", r->object_name); + ndr->depth++; + if (r->object_name) { + ndr_print_string(ndr, "object_name", r->object_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "attributes", r->attributes); + ndr_print_ptr(ndr, "sec_desc", r->sec_desc); + ndr->depth++; + if (r->sec_desc) { + ndr_print_security_descriptor(ndr, "sec_desc", r->sec_desc); + } + ndr->depth--; + ndr_print_ptr(ndr, "sec_qos", r->sec_qos); + ndr->depth++; + if (r->sec_qos) { + ndr_print_lsa_QosInfo(ndr, "sec_qos", r->sec_qos); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_PolicyAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_PolicyAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_PolicyAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_VIEW_LOCAL_INFORMATION", LSA_POLICY_VIEW_LOCAL_INFORMATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_VIEW_AUDIT_INFORMATION", LSA_POLICY_VIEW_AUDIT_INFORMATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_GET_PRIVATE_INFORMATION", LSA_POLICY_GET_PRIVATE_INFORMATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_TRUST_ADMIN", LSA_POLICY_TRUST_ADMIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_ACCOUNT", LSA_POLICY_CREATE_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_SECRET", LSA_POLICY_CREATE_SECRET, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_PRIVILEGE", LSA_POLICY_CREATE_PRIVILEGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS", LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SET_AUDIT_REQUIREMENTS", LSA_POLICY_SET_AUDIT_REQUIREMENTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_AUDIT_LOG_ADMIN", LSA_POLICY_AUDIT_LOG_ADMIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SERVER_ADMIN", LSA_POLICY_SERVER_ADMIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_LOOKUP_NAMES", LSA_POLICY_LOOKUP_NAMES, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_AuditLogInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditLogInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->percent_full)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximum_log_size)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->retention_time)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->shutdown_in_progress)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->time_to_shutdown)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->next_audit_record)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_AuditLogInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditLogInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->percent_full)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximum_log_size)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->retention_time)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->shutdown_in_progress)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->time_to_shutdown)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->next_audit_record)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_AuditLogInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditLogInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_AuditLogInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "percent_full", r->percent_full); + ndr_print_uint32(ndr, "maximum_log_size", r->maximum_log_size); + ndr_print_hyper(ndr, "retention_time", r->retention_time); + ndr_print_uint8(ndr, "shutdown_in_progress", r->shutdown_in_progress); + ndr_print_hyper(ndr, "time_to_shutdown", r->time_to_shutdown); + ndr_print_uint32(ndr, "next_audit_record", r->next_audit_record); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_PolicyAuditPolicy(struct ndr_push *ndr, int ndr_flags, enum lsa_PolicyAuditPolicy r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_PolicyAuditPolicy(struct ndr_pull *ndr, int ndr_flags, enum lsa_PolicyAuditPolicy *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_PolicyAuditPolicy(struct ndr_print *ndr, const char *name, enum lsa_PolicyAuditPolicy r) +{ + const char *val = NULL; + + switch (r) { + case LSA_AUDIT_POLICY_NONE: val = "LSA_AUDIT_POLICY_NONE"; break; + case LSA_AUDIT_POLICY_SUCCESS: val = "LSA_AUDIT_POLICY_SUCCESS"; break; + case LSA_AUDIT_POLICY_FAILURE: val = "LSA_AUDIT_POLICY_FAILURE"; break; + case LSA_AUDIT_POLICY_ALL: val = "LSA_AUDIT_POLICY_ALL"; break; + case LSA_AUDIT_POLICY_CLEAR: val = "LSA_AUDIT_POLICY_CLEAR"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_lsa_AuditEventsInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditEventsInfo *r) +{ + uint32_t cntr_settings_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auditing_mode)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->settings)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->settings) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_settings_1 = 0; cntr_settings_1 < r->count; cntr_settings_1++) { + NDR_CHECK(ndr_push_lsa_PolicyAuditPolicy(ndr, NDR_SCALARS, r->settings[cntr_settings_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_AuditEventsInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditEventsInfo *r) +{ + uint32_t _ptr_settings; + uint32_t cntr_settings_1; + TALLOC_CTX *_mem_save_settings_0; + TALLOC_CTX *_mem_save_settings_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auditing_mode)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_settings)); + if (_ptr_settings) { + NDR_PULL_ALLOC(ndr, r->settings); + } else { + r->settings = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->settings) { + _mem_save_settings_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->settings, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->settings)); + NDR_PULL_ALLOC_N(ndr, r->settings, ndr_get_array_size(ndr, &r->settings)); + _mem_save_settings_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->settings, 0); + for (cntr_settings_1 = 0; cntr_settings_1 < r->count; cntr_settings_1++) { + NDR_CHECK(ndr_pull_lsa_PolicyAuditPolicy(ndr, NDR_SCALARS, &r->settings[cntr_settings_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_settings_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_settings_0, 0); + } + if (r->settings) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->settings, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_AuditEventsInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditEventsInfo *r) +{ + uint32_t cntr_settings_1; + ndr_print_struct(ndr, name, "lsa_AuditEventsInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "auditing_mode", r->auditing_mode); + ndr_print_ptr(ndr, "settings", r->settings); + ndr->depth++; + if (r->settings) { + ndr->print(ndr, "%s: ARRAY(%d)", "settings", (int)r->count); + ndr->depth++; + for (cntr_settings_1=0;cntr_settings_1count;cntr_settings_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_settings_1) != -1) { + ndr_print_lsa_PolicyAuditPolicy(ndr, "settings", r->settings[cntr_settings_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_uint32(ndr, "count", r->count); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DomainInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInfo *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_DomainInfo"); + ndr->depth++; + ndr_print_lsa_StringLarge(ndr, "name", &r->name); + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_PDAccountInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_PDAccountInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_PDAccountInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_PDAccountInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_PDAccountInfo(struct ndr_print *ndr, const char *name, const struct lsa_PDAccountInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_PDAccountInfo"); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", &r->name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_Role(struct ndr_push *ndr, int ndr_flags, enum lsa_Role r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_Role(struct ndr_pull *ndr, int ndr_flags, enum lsa_Role *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_Role(struct ndr_print *ndr, const char *name, enum lsa_Role r) +{ + const char *val = NULL; + + switch (r) { + case LSA_ROLE_BACKUP: val = "LSA_ROLE_BACKUP"; break; + case LSA_ROLE_PRIMARY: val = "LSA_ROLE_PRIMARY"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_lsa_ServerRole(struct ndr_push *ndr, int ndr_flags, const struct lsa_ServerRole *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_Role(ndr, NDR_SCALARS, r->role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ServerRole(struct ndr_pull *ndr, int ndr_flags, struct lsa_ServerRole *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_Role(ndr, NDR_SCALARS, &r->role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ServerRole(struct ndr_print *ndr, const char *name, const struct lsa_ServerRole *r) +{ + ndr_print_struct(ndr, name, "lsa_ServerRole"); + ndr->depth++; + ndr_print_lsa_Role(ndr, "role", r->role); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_ReplicaSourceInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_ReplicaSourceInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->source)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->source)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ReplicaSourceInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ReplicaSourceInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->source)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->source)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ReplicaSourceInfo(struct ndr_print *ndr, const char *name, const struct lsa_ReplicaSourceInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_ReplicaSourceInfo"); + ndr->depth++; + ndr_print_lsa_String(ndr, "source", &r->source); + ndr_print_lsa_String(ndr, "account", &r->account); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DefaultQuotaInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_DefaultQuotaInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->paged_pool)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->non_paged_pool)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->min_wss)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_wss)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagefile)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DefaultQuotaInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DefaultQuotaInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->paged_pool)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->non_paged_pool)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->min_wss)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_wss)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagefile)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DefaultQuotaInfo(struct ndr_print *ndr, const char *name, const struct lsa_DefaultQuotaInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_DefaultQuotaInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "paged_pool", r->paged_pool); + ndr_print_uint32(ndr, "non_paged_pool", r->non_paged_pool); + ndr_print_uint32(ndr, "min_wss", r->min_wss); + ndr_print_uint32(ndr, "max_wss", r->max_wss); + ndr_print_uint32(ndr, "pagefile", r->pagefile); + ndr_print_hyper(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_ModificationInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_ModificationInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->modified_id)); + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->db_create_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ModificationInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ModificationInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->modified_id)); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->db_create_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ModificationInfo(struct ndr_print *ndr, const char *name, const struct lsa_ModificationInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_ModificationInfo"); + ndr->depth++; + ndr_print_hyper(ndr, "modified_id", r->modified_id); + ndr_print_NTTIME_hyper(ndr, "db_create_time", r->db_create_time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_AuditFullSetInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditFullSetInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->shutdown_on_full)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_AuditFullSetInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditFullSetInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->shutdown_on_full)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_AuditFullSetInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullSetInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_AuditFullSetInfo"); + ndr->depth++; + ndr_print_uint8(ndr, "shutdown_on_full", r->shutdown_on_full); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_AuditFullQueryInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditFullQueryInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->shutdown_on_full)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->log_is_full)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_AuditFullQueryInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditFullQueryInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->shutdown_on_full)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->log_is_full)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_AuditFullQueryInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullQueryInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_AuditFullQueryInfo"); + ndr->depth++; + ndr_print_uint8(ndr, "shutdown_on_full", r->shutdown_on_full); + ndr_print_uint8(ndr, "log_is_full", r->log_is_full); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DnsDomainInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_DnsDomainInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forest)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forest)); + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DnsDomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DnsDomainInfo *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forest)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forest)); + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DnsDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DnsDomainInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_DnsDomainInfo"); + ndr->depth++; + ndr_print_lsa_StringLarge(ndr, "name", &r->name); + ndr_print_lsa_StringLarge(ndr, "dns_domain", &r->dns_domain); + ndr_print_lsa_StringLarge(ndr, "dns_forest", &r->dns_forest); + ndr_print_GUID(ndr, "domain_guid", &r->domain_guid); + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_PolicyInfo(struct ndr_push *ndr, int ndr_flags, enum lsa_PolicyInfo r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_PolicyInfo(struct ndr_pull *ndr, int ndr_flags, enum lsa_PolicyInfo *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_PolicyInfo(struct ndr_print *ndr, const char *name, enum lsa_PolicyInfo r) +{ + const char *val = NULL; + + switch (r) { + case LSA_POLICY_INFO_AUDIT_LOG: val = "LSA_POLICY_INFO_AUDIT_LOG"; break; + case LSA_POLICY_INFO_AUDIT_EVENTS: val = "LSA_POLICY_INFO_AUDIT_EVENTS"; break; + case LSA_POLICY_INFO_DOMAIN: val = "LSA_POLICY_INFO_DOMAIN"; break; + case LSA_POLICY_INFO_PD: val = "LSA_POLICY_INFO_PD"; break; + case LSA_POLICY_INFO_ACCOUNT_DOMAIN: val = "LSA_POLICY_INFO_ACCOUNT_DOMAIN"; break; + case LSA_POLICY_INFO_ROLE: val = "LSA_POLICY_INFO_ROLE"; break; + case LSA_POLICY_INFO_REPLICA: val = "LSA_POLICY_INFO_REPLICA"; break; + case LSA_POLICY_INFO_QUOTA: val = "LSA_POLICY_INFO_QUOTA"; break; + case LSA_POLICY_INFO_MOD: val = "LSA_POLICY_INFO_MOD"; break; + case LSA_POLICY_INFO_AUDIT_FULL_SET: val = "LSA_POLICY_INFO_AUDIT_FULL_SET"; break; + case LSA_POLICY_INFO_AUDIT_FULL_QUERY: val = "LSA_POLICY_INFO_AUDIT_FULL_QUERY"; break; + case LSA_POLICY_INFO_DNS: val = "LSA_POLICY_INFO_DNS"; break; + case LSA_POLICY_INFO_DNS_INT: val = "LSA_POLICY_INFO_DNS_INT"; break; + case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: val = "LSA_POLICY_INFO_L_ACCOUNT_DOMAIN"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_lsa_PolicyInformation(struct ndr_push *ndr, int ndr_flags, const union lsa_PolicyInformation *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case LSA_POLICY_INFO_AUDIT_LOG: { + NDR_CHECK(ndr_push_lsa_AuditLogInfo(ndr, NDR_SCALARS, &r->audit_log)); + break; } + + case LSA_POLICY_INFO_AUDIT_EVENTS: { + NDR_CHECK(ndr_push_lsa_AuditEventsInfo(ndr, NDR_SCALARS, &r->audit_events)); + break; } + + case LSA_POLICY_INFO_DOMAIN: { + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domain)); + break; } + + case LSA_POLICY_INFO_PD: { + NDR_CHECK(ndr_push_lsa_PDAccountInfo(ndr, NDR_SCALARS, &r->pd)); + break; } + + case LSA_POLICY_INFO_ACCOUNT_DOMAIN: { + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->account_domain)); + break; } + + case LSA_POLICY_INFO_ROLE: { + NDR_CHECK(ndr_push_lsa_ServerRole(ndr, NDR_SCALARS, &r->role)); + break; } + + case LSA_POLICY_INFO_REPLICA: { + NDR_CHECK(ndr_push_lsa_ReplicaSourceInfo(ndr, NDR_SCALARS, &r->replica)); + break; } + + case LSA_POLICY_INFO_QUOTA: { + NDR_CHECK(ndr_push_lsa_DefaultQuotaInfo(ndr, NDR_SCALARS, &r->quota)); + break; } + + case LSA_POLICY_INFO_MOD: { + NDR_CHECK(ndr_push_lsa_ModificationInfo(ndr, NDR_SCALARS, &r->mod)); + break; } + + case LSA_POLICY_INFO_AUDIT_FULL_SET: { + NDR_CHECK(ndr_push_lsa_AuditFullSetInfo(ndr, NDR_SCALARS, &r->auditfullset)); + break; } + + case LSA_POLICY_INFO_AUDIT_FULL_QUERY: { + NDR_CHECK(ndr_push_lsa_AuditFullQueryInfo(ndr, NDR_SCALARS, &r->auditfullquery)); + break; } + + case LSA_POLICY_INFO_DNS: { + NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns)); + break; } + + case LSA_POLICY_INFO_DNS_INT: { + NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns)); + break; } + + case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: { + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->l_account_domain)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case LSA_POLICY_INFO_AUDIT_LOG: + break; + + case LSA_POLICY_INFO_AUDIT_EVENTS: + NDR_CHECK(ndr_push_lsa_AuditEventsInfo(ndr, NDR_BUFFERS, &r->audit_events)); + break; + + case LSA_POLICY_INFO_DOMAIN: + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domain)); + break; + + case LSA_POLICY_INFO_PD: + NDR_CHECK(ndr_push_lsa_PDAccountInfo(ndr, NDR_BUFFERS, &r->pd)); + break; + + case LSA_POLICY_INFO_ACCOUNT_DOMAIN: + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->account_domain)); + break; + + case LSA_POLICY_INFO_ROLE: + break; + + case LSA_POLICY_INFO_REPLICA: + NDR_CHECK(ndr_push_lsa_ReplicaSourceInfo(ndr, NDR_BUFFERS, &r->replica)); + break; + + case LSA_POLICY_INFO_QUOTA: + break; + + case LSA_POLICY_INFO_MOD: + break; + + case LSA_POLICY_INFO_AUDIT_FULL_SET: + break; + + case LSA_POLICY_INFO_AUDIT_FULL_QUERY: + break; + + case LSA_POLICY_INFO_DNS: + NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns)); + break; + + case LSA_POLICY_INFO_DNS_INT: + NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns)); + break; + + case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->l_account_domain)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_PolicyInformation(struct ndr_pull *ndr, int ndr_flags, union lsa_PolicyInformation *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case LSA_POLICY_INFO_AUDIT_LOG: { + NDR_CHECK(ndr_pull_lsa_AuditLogInfo(ndr, NDR_SCALARS, &r->audit_log)); + break; } + + case LSA_POLICY_INFO_AUDIT_EVENTS: { + NDR_CHECK(ndr_pull_lsa_AuditEventsInfo(ndr, NDR_SCALARS, &r->audit_events)); + break; } + + case LSA_POLICY_INFO_DOMAIN: { + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domain)); + break; } + + case LSA_POLICY_INFO_PD: { + NDR_CHECK(ndr_pull_lsa_PDAccountInfo(ndr, NDR_SCALARS, &r->pd)); + break; } + + case LSA_POLICY_INFO_ACCOUNT_DOMAIN: { + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->account_domain)); + break; } + + case LSA_POLICY_INFO_ROLE: { + NDR_CHECK(ndr_pull_lsa_ServerRole(ndr, NDR_SCALARS, &r->role)); + break; } + + case LSA_POLICY_INFO_REPLICA: { + NDR_CHECK(ndr_pull_lsa_ReplicaSourceInfo(ndr, NDR_SCALARS, &r->replica)); + break; } + + case LSA_POLICY_INFO_QUOTA: { + NDR_CHECK(ndr_pull_lsa_DefaultQuotaInfo(ndr, NDR_SCALARS, &r->quota)); + break; } + + case LSA_POLICY_INFO_MOD: { + NDR_CHECK(ndr_pull_lsa_ModificationInfo(ndr, NDR_SCALARS, &r->mod)); + break; } + + case LSA_POLICY_INFO_AUDIT_FULL_SET: { + NDR_CHECK(ndr_pull_lsa_AuditFullSetInfo(ndr, NDR_SCALARS, &r->auditfullset)); + break; } + + case LSA_POLICY_INFO_AUDIT_FULL_QUERY: { + NDR_CHECK(ndr_pull_lsa_AuditFullQueryInfo(ndr, NDR_SCALARS, &r->auditfullquery)); + break; } + + case LSA_POLICY_INFO_DNS: { + NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns)); + break; } + + case LSA_POLICY_INFO_DNS_INT: { + NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns)); + break; } + + case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: { + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->l_account_domain)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case LSA_POLICY_INFO_AUDIT_LOG: + break; + + case LSA_POLICY_INFO_AUDIT_EVENTS: + NDR_CHECK(ndr_pull_lsa_AuditEventsInfo(ndr, NDR_BUFFERS, &r->audit_events)); + break; + + case LSA_POLICY_INFO_DOMAIN: + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domain)); + break; + + case LSA_POLICY_INFO_PD: + NDR_CHECK(ndr_pull_lsa_PDAccountInfo(ndr, NDR_BUFFERS, &r->pd)); + break; + + case LSA_POLICY_INFO_ACCOUNT_DOMAIN: + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->account_domain)); + break; + + case LSA_POLICY_INFO_ROLE: + break; + + case LSA_POLICY_INFO_REPLICA: + NDR_CHECK(ndr_pull_lsa_ReplicaSourceInfo(ndr, NDR_BUFFERS, &r->replica)); + break; + + case LSA_POLICY_INFO_QUOTA: + break; + + case LSA_POLICY_INFO_MOD: + break; + + case LSA_POLICY_INFO_AUDIT_FULL_SET: + break; + + case LSA_POLICY_INFO_AUDIT_FULL_QUERY: + break; + + case LSA_POLICY_INFO_DNS: + NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns)); + break; + + case LSA_POLICY_INFO_DNS_INT: + NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns)); + break; + + case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->l_account_domain)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_PolicyInformation(struct ndr_print *ndr, const char *name, const union lsa_PolicyInformation *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "lsa_PolicyInformation"); + switch (level) { + case LSA_POLICY_INFO_AUDIT_LOG: + ndr_print_lsa_AuditLogInfo(ndr, "audit_log", &r->audit_log); + break; + + case LSA_POLICY_INFO_AUDIT_EVENTS: + ndr_print_lsa_AuditEventsInfo(ndr, "audit_events", &r->audit_events); + break; + + case LSA_POLICY_INFO_DOMAIN: + ndr_print_lsa_DomainInfo(ndr, "domain", &r->domain); + break; + + case LSA_POLICY_INFO_PD: + ndr_print_lsa_PDAccountInfo(ndr, "pd", &r->pd); + break; + + case LSA_POLICY_INFO_ACCOUNT_DOMAIN: + ndr_print_lsa_DomainInfo(ndr, "account_domain", &r->account_domain); + break; + + case LSA_POLICY_INFO_ROLE: + ndr_print_lsa_ServerRole(ndr, "role", &r->role); + break; + + case LSA_POLICY_INFO_REPLICA: + ndr_print_lsa_ReplicaSourceInfo(ndr, "replica", &r->replica); + break; + + case LSA_POLICY_INFO_QUOTA: + ndr_print_lsa_DefaultQuotaInfo(ndr, "quota", &r->quota); + break; + + case LSA_POLICY_INFO_MOD: + ndr_print_lsa_ModificationInfo(ndr, "mod", &r->mod); + break; + + case LSA_POLICY_INFO_AUDIT_FULL_SET: + ndr_print_lsa_AuditFullSetInfo(ndr, "auditfullset", &r->auditfullset); + break; + + case LSA_POLICY_INFO_AUDIT_FULL_QUERY: + ndr_print_lsa_AuditFullQueryInfo(ndr, "auditfullquery", &r->auditfullquery); + break; + + case LSA_POLICY_INFO_DNS: + ndr_print_lsa_DnsDomainInfo(ndr, "dns", &r->dns); + break; + + case LSA_POLICY_INFO_DNS_INT: + ndr_print_lsa_DnsDomainInfo(ndr, "dns", &r->dns); + break; + + case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: + ndr_print_lsa_DomainInfo(ndr, "l_account_domain", &r->l_account_domain); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_lsa_SidPtr(struct ndr_push *ndr, int ndr_flags, const struct lsa_SidPtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SidPtr(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidPtr *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SidPtr(struct ndr_print *ndr, const char *name, const struct lsa_SidPtr *r) +{ + ndr_print_struct(ndr, name, "lsa_SidPtr"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_SidArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_SidArray *r) +{ + uint32_t cntr_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { + NDR_CHECK(ndr_push_lsa_SidPtr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { + NDR_CHECK(ndr_push_lsa_SidPtr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_SidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidArray *r) +{ + uint32_t _ptr_sids; + uint32_t cntr_sids_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids)); + if (r->num_sids < 0 || r->num_sids > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids); + } else { + r->sids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sids) { + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { + NDR_CHECK(ndr_pull_lsa_SidPtr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { + NDR_CHECK(ndr_pull_lsa_SidPtr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + } + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SidArray(struct ndr_print *ndr, const char *name, const struct lsa_SidArray *r) +{ + uint32_t cntr_sids_1; + ndr_print_struct(ndr, name, "lsa_SidArray"); + ndr->depth++; + ndr_print_uint32(ndr, "num_sids", r->num_sids); + ndr_print_ptr(ndr, "sids", r->sids); + ndr->depth++; + if (r->sids) { + ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids); + ndr->depth++; + for (cntr_sids_1=0;cntr_sids_1num_sids;cntr_sids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { + ndr_print_lsa_SidPtr(ndr, "sids", &r->sids[cntr_sids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DomainList(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainList *r) +{ + uint32_t cntr_domains_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domains)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domains) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); + } + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainList *r) +{ + uint32_t _ptr_domains; + uint32_t cntr_domains_1; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, r->domains); + } else { + r->domains = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domains) { + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domains)); + NDR_PULL_ALLOC_N(ndr, r->domains, ndr_get_array_size(ndr, &r->domains)); + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); + } + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + } + if (r->domains) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->domains, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DomainList(struct ndr_print *ndr, const char *name, const struct lsa_DomainList *r) +{ + uint32_t cntr_domains_1; + ndr_print_struct(ndr, name, "lsa_DomainList"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "domains", r->domains); + ndr->depth++; + if (r->domains) { + ndr->print(ndr, "%s: ARRAY(%d)", "domains", (int)r->count); + ndr->depth++; + for (cntr_domains_1=0;cntr_domains_1count;cntr_domains_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) { + ndr_print_lsa_DomainInfo(ndr, "domains", &r->domains[cntr_domains_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_SidType(struct ndr_push *ndr, int ndr_flags, enum lsa_SidType r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_SidType(struct ndr_pull *ndr, int ndr_flags, enum lsa_SidType *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SidType(struct ndr_print *ndr, const char *name, enum lsa_SidType r) +{ + const char *val = NULL; + + switch (r) { + case SID_NAME_USE_NONE: val = "SID_NAME_USE_NONE"; break; + case SID_NAME_USER: val = "SID_NAME_USER"; break; + case SID_NAME_DOM_GRP: val = "SID_NAME_DOM_GRP"; break; + case SID_NAME_DOMAIN: val = "SID_NAME_DOMAIN"; break; + case SID_NAME_ALIAS: val = "SID_NAME_ALIAS"; break; + case SID_NAME_WKN_GRP: val = "SID_NAME_WKN_GRP"; break; + case SID_NAME_DELETED: val = "SID_NAME_DELETED"; break; + case SID_NAME_INVALID: val = "SID_NAME_INVALID"; break; + case SID_NAME_UNKNOWN: val = "SID_NAME_UNKNOWN"; break; + case SID_NAME_COMPUTER: val = "SID_NAME_COMPUTER"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_lsa_TranslatedSid(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedSid *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TranslatedSid(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedSid *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TranslatedSid(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid *r) +{ + ndr_print_struct(ndr, name, "lsa_TranslatedSid"); + ndr->depth++; + ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "sid_index", r->sid_index); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TransSidArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransSidArray *r) +{ + uint32_t cntr_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { + NDR_CHECK(ndr_push_lsa_TranslatedSid(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TransSidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransSidArray *r) +{ + uint32_t _ptr_sids; + uint32_t cntr_sids_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids); + } else { + r->sids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sids) { + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { + NDR_CHECK(ndr_pull_lsa_TranslatedSid(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + } + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TransSidArray(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray *r) +{ + uint32_t cntr_sids_1; + ndr_print_struct(ndr, name, "lsa_TransSidArray"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "sids", r->sids); + ndr->depth++; + if (r->sids) { + ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->count); + ndr->depth++; + for (cntr_sids_1=0;cntr_sids_1count;cntr_sids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { + ndr_print_lsa_TranslatedSid(ndr, "sids", &r->sids[cntr_sids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_RefDomainList(struct ndr_push *ndr, int ndr_flags, const struct lsa_RefDomainList *r) +{ + uint32_t cntr_domains_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domains)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_size)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domains) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); + } + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_RefDomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_RefDomainList *r) +{ + uint32_t _ptr_domains; + uint32_t cntr_domains_1; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, r->domains); + } else { + r->domains = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_size)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domains) { + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domains)); + NDR_PULL_ALLOC_N(ndr, r->domains, ndr_get_array_size(ndr, &r->domains)); + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); + } + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + } + if (r->domains) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->domains, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_RefDomainList(struct ndr_print *ndr, const char *name, const struct lsa_RefDomainList *r) +{ + uint32_t cntr_domains_1; + ndr_print_struct(ndr, name, "lsa_RefDomainList"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "domains", r->domains); + ndr->depth++; + if (r->domains) { + ndr->print(ndr, "%s: ARRAY(%d)", "domains", (int)r->count); + ndr->depth++; + for (cntr_domains_1=0;cntr_domains_1count;cntr_domains_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) { + ndr_print_lsa_DomainInfo(ndr, "domains", &r->domains[cntr_domains_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_uint32(ndr, "max_size", r->max_size); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LookupNamesLevel(struct ndr_push *ndr, int ndr_flags, enum lsa_LookupNamesLevel r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LookupNamesLevel(struct ndr_pull *ndr, int ndr_flags, enum lsa_LookupNamesLevel *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupNamesLevel(struct ndr_print *ndr, const char *name, enum lsa_LookupNamesLevel r) +{ + const char *val = NULL; + + switch (r) { + case LSA_LOOKUP_NAMES_ALL: val = "LSA_LOOKUP_NAMES_ALL"; break; + case LSA_LOOKUP_NAMES_DOMAINS_ONLY: val = "LSA_LOOKUP_NAMES_DOMAINS_ONLY"; break; + case LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY: val = "LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY"; break; + case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY"; break; + case LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY"; break; + case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2"; break; + case LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC: val = "LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_lsa_TranslatedName(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedName *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TranslatedName(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedName *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TranslatedName(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName *r) +{ + ndr_print_struct(ndr, name, "lsa_TranslatedName"); + ndr->depth++; + ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); + ndr_print_lsa_String(ndr, "name", &r->name); + ndr_print_uint32(ndr, "sid_index", r->sid_index); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TransNameArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransNameArray *r) +{ + uint32_t cntr_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_lsa_TranslatedName(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_lsa_TranslatedName(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TransNameArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransNameArray *r) +{ + uint32_t _ptr_names; + uint32_t cntr_names_1; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); + if (_ptr_names) { + NDR_PULL_ALLOC(ndr, r->names); + } else { + r->names = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); + NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); + _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_lsa_TranslatedName(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_lsa_TranslatedName(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + } + if (r->names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TransNameArray(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray *r) +{ + uint32_t cntr_names_1; + ndr_print_struct(ndr, name, "lsa_TransNameArray"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "names", r->names); + ndr->depth++; + if (r->names) { + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); + ndr->depth++; + for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { + ndr_print_lsa_TranslatedName(ndr, "names", &r->names[cntr_names_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LUIDAttribute(struct ndr_push *ndr, int ndr_flags, const struct lsa_LUIDAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_LUID(ndr, NDR_SCALARS, &r->luid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribute)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LUIDAttribute(struct ndr_pull *ndr, int ndr_flags, struct lsa_LUIDAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, &r->luid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribute)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LUIDAttribute(struct ndr_print *ndr, const char *name, const struct lsa_LUIDAttribute *r) +{ + ndr_print_struct(ndr, name, "lsa_LUIDAttribute"); + ndr->depth++; + ndr_print_lsa_LUID(ndr, "luid", &r->luid); + ndr_print_uint32(ndr, "attribute", r->attribute); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_PrivilegeSet(struct ndr_push *ndr, int ndr_flags, const struct lsa_PrivilegeSet *r) +{ + uint32_t cntr_set_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); + for (cntr_set_0 = 0; cntr_set_0 < r->count; cntr_set_0++) { + NDR_CHECK(ndr_push_lsa_LUIDAttribute(ndr, NDR_SCALARS, &r->set[cntr_set_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_PrivilegeSet(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivilegeSet *r) +{ + uint32_t cntr_set_0; + TALLOC_CTX *_mem_save_set_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->set)); + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); + NDR_PULL_ALLOC_N(ndr, r->set, ndr_get_array_size(ndr, &r->set)); + _mem_save_set_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->set, 0); + for (cntr_set_0 = 0; cntr_set_0 < r->count; cntr_set_0++) { + NDR_CHECK(ndr_pull_lsa_LUIDAttribute(ndr, NDR_SCALARS, &r->set[cntr_set_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_set_0, 0); + if (r->set) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->set, r->count)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_PrivilegeSet(struct ndr_print *ndr, const char *name, const struct lsa_PrivilegeSet *r) +{ + uint32_t cntr_set_0; + ndr_print_struct(ndr, name, "lsa_PrivilegeSet"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_uint32(ndr, "unknown", r->unknown); + ndr->print(ndr, "%s: ARRAY(%d)", "set", (int)r->count); + ndr->depth++; + for (cntr_set_0=0;cntr_set_0count;cntr_set_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_set_0) != -1) { + ndr_print_lsa_LUIDAttribute(ndr, "set", &r->set[cntr_set_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DATA_BUF(struct ndr_push *ndr, int ndr_flags, const struct lsa_DATA_BUF *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DATA_BUF(struct ndr_pull *ndr, int ndr_flags, struct lsa_DATA_BUF *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->data)); + if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data)); + } + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size)); + } + if (r->data) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DATA_BUF(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF *r) +{ + ndr_print_struct(ndr, name, "lsa_DATA_BUF"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint32(ndr, "length", r->length); + ndr_print_uint32(ndr, "size", r->size); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_lsa_DATA_BUF2(struct ndr_push *ndr, int ndr_flags, const struct lsa_DATA_BUF2 *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->size)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DATA_BUF2(struct ndr_pull *ndr, int ndr_flags, struct lsa_DATA_BUF2 *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + if (r->size < 0 || r->size > 65536) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DATA_BUF2(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF2 *r) +{ + ndr_print_struct(ndr, name, "lsa_DATA_BUF2"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint32(ndr, "size", r->size); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->size); + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_lsa_TrustDomInfoEnum(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustDomInfoEnum r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustDomInfoEnum *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomInfoEnum(struct ndr_print *ndr, const char *name, enum lsa_TrustDomInfoEnum r) +{ + const char *val = NULL; + + switch (r) { + case LSA_TRUSTED_DOMAIN_INFO_NAME: val = "LSA_TRUSTED_DOMAIN_INFO_NAME"; break; + case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: val = "LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS"; break; + case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: val = "LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET"; break; + case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: val = "LSA_TRUSTED_DOMAIN_INFO_PASSWORD"; break; + case LSA_TRUSTED_DOMAIN_INFO_BASIC: val = "LSA_TRUSTED_DOMAIN_INFO_BASIC"; break; + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_EX"; break; + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: val = "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO"; break; + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO"; break; + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL"; break; + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL"; break; + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL"; break; + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL"; break; + case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: val = "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustDirection(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustDirection(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDirection(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_DIRECTION_INBOUND", LSA_TRUST_DIRECTION_INBOUND, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_DIRECTION_OUTBOUND", LSA_TRUST_DIRECTION_OUTBOUND, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustType(struct ndr_print *ndr, const char *name, enum lsa_TrustType r) +{ + const char *val = NULL; + + switch (r) { + case LSA_TRUST_TYPE_DOWNLEVEL: val = "LSA_TRUST_TYPE_DOWNLEVEL"; break; + case LSA_TRUST_TYPE_UPLEVEL: val = "LSA_TRUST_TYPE_UPLEVEL"; break; + case LSA_TRUST_TYPE_MIT: val = "LSA_TRUST_TYPE_MIT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE", LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY", LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_WITHIN_FOREST", LSA_TRUST_ATTRIBUTE_WITHIN_FOREST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION", LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoName(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoName *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoName(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoName *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoName(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoName *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoName"); + ndr->depth++; + ndr_print_lsa_StringLarge(ndr, "netbios_name", &r->netbios_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoControllers(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoControllers *r) +{ + uint32_t cntr_netbios_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_names)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_names) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries)); + for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_names[cntr_netbios_names_1])); + } + for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_names[cntr_netbios_names_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoControllers(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoControllers *r) +{ + uint32_t _ptr_netbios_names; + uint32_t cntr_netbios_names_1; + TALLOC_CTX *_mem_save_netbios_names_0; + TALLOC_CTX *_mem_save_netbios_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entries)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_names)); + if (_ptr_netbios_names) { + NDR_PULL_ALLOC(ndr, r->netbios_names); + } else { + r->netbios_names = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_names) { + _mem_save_netbios_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->netbios_names, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_names)); + NDR_PULL_ALLOC_N(ndr, r->netbios_names, ndr_get_array_size(ndr, &r->netbios_names)); + _mem_save_netbios_names_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->netbios_names, 0); + for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_names[cntr_netbios_names_1])); + } + for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_names[cntr_netbios_names_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_names_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_names_0, 0); + } + if (r->netbios_names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->netbios_names, r->entries)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoControllers(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoControllers *r) +{ + uint32_t cntr_netbios_names_1; + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoControllers"); + ndr->depth++; + ndr_print_uint32(ndr, "entries", r->entries); + ndr_print_ptr(ndr, "netbios_names", r->netbios_names); + ndr->depth++; + if (r->netbios_names) { + ndr->print(ndr, "%s: ARRAY(%d)", "netbios_names", (int)r->entries); + ndr->depth++; + for (cntr_netbios_names_1=0;cntr_netbios_names_1entries;cntr_netbios_names_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_netbios_names_1) != -1) { + ndr_print_lsa_StringLarge(ndr, "netbios_names", &r->netbios_names[cntr_netbios_names_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoPosixOffset(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoPosixOffset *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->posix_offset)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoPosixOffset(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoPosixOffset *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->posix_offset)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoPosixOffset(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPosixOffset *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoPosixOffset"); + ndr->depth++; + ndr_print_uint32(ndr, "posix_offset", r->posix_offset); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoPassword(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoPassword *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->old_password)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->password) { + NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + } + if (r->old_password) { + NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->old_password)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoPassword(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoPassword *r) +{ + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_password_0; + uint32_t _ptr_old_password; + TALLOC_CTX *_mem_save_old_password_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->password); + } else { + r->password = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_password)); + if (_ptr_old_password) { + NDR_PULL_ALLOC(ndr, r->old_password); + } else { + r->old_password = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); + NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + if (r->old_password) { + _mem_save_old_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->old_password, 0); + NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->old_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_password_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoPassword(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPassword *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoPassword"); + ndr->depth++; + ndr_print_ptr(ndr, "password", r->password); + ndr->depth++; + if (r->password) { + ndr_print_lsa_DATA_BUF(ndr, "password", r->password); + } + ndr->depth--; + ndr_print_ptr(ndr, "old_password", r->old_password); + ndr->depth++; + if (r->old_password) { + ndr_print_lsa_DATA_BUF(ndr, "old_password", r->old_password); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoBasic(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoBasic *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->netbios_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->netbios_name)); + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoBasic(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoBasic *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->netbios_name)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->netbios_name)); + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoBasic(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBasic *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoBasic"); + ndr->depth++; + ndr_print_lsa_String(ndr, "netbios_name", &r->netbios_name); + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoInfoEx(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoInfoEx *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + NDR_CHECK(ndr_push_lsa_TrustDirection(ndr, NDR_SCALARS, r->trust_direction)); + NDR_CHECK(ndr_push_lsa_TrustType(ndr, NDR_SCALARS, r->trust_type)); + NDR_CHECK(ndr_push_lsa_TrustAttributes(ndr, NDR_SCALARS, r->trust_attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name)); + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoInfoEx(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoInfoEx *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + NDR_CHECK(ndr_pull_lsa_TrustDirection(ndr, NDR_SCALARS, &r->trust_direction)); + NDR_CHECK(ndr_pull_lsa_TrustType(ndr, NDR_SCALARS, &r->trust_type)); + NDR_CHECK(ndr_pull_lsa_TrustAttributes(ndr, NDR_SCALARS, &r->trust_attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name)); + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoEx(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoInfoEx"); + ndr->depth++; + ndr_print_lsa_StringLarge(ndr, "domain_name", &r->domain_name); + ndr_print_lsa_StringLarge(ndr, "netbios_name", &r->netbios_name); + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr_print_lsa_TrustDirection(ndr, "trust_direction", r->trust_direction); + ndr_print_lsa_TrustType(ndr, "trust_type", r->trust_type); + ndr_print_lsa_TrustAttributes(ndr, "trust_attributes", r->trust_attributes); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustAuthType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustAuthType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustAuthType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustAuthType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustAuthType(struct ndr_print *ndr, const char *name, enum lsa_TrustAuthType r) +{ + const char *val = NULL; + + switch (r) { + case TRUST_AUTH_TYPE_NONE: val = "TRUST_AUTH_TYPE_NONE"; break; + case TRUST_AUTH_TYPE_NT4OWF: val = "TRUST_AUTH_TYPE_NT4OWF"; break; + case TRUST_AUTH_TYPE_CLEAR: val = "TRUST_AUTH_TYPE_CLEAR"; break; + case TRUST_AUTH_TYPE_VERSION: val = "TRUST_AUTH_TYPE_VERSION"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoBuffer(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoBuffer *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->last_update_time)); + NDR_CHECK(ndr_push_lsa_TrustAuthType(ndr, NDR_SCALARS, r->AuthType)); + NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->data)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoBuffer(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoBuffer *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->last_update_time)); + NDR_CHECK(ndr_pull_lsa_TrustAuthType(ndr, NDR_SCALARS, &r->AuthType)); + NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->data)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoBuffer(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBuffer *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoBuffer"); + ndr->depth++; + ndr_print_NTTIME_hyper(ndr, "last_update_time", r->last_update_time); + ndr_print_lsa_TrustAuthType(ndr, "AuthType", r->AuthType); + ndr_print_lsa_DATA_BUF2(ndr, "data", &r->data); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoAuthInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoAuthInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->incoming_count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->incoming_current_auth_info)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->incoming_previous_auth_info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->outgoing_count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->outgoing_current_auth_info)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->outgoing_previous_auth_info)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->incoming_current_auth_info) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->incoming_current_auth_info)); + } + if (r->incoming_previous_auth_info) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->incoming_previous_auth_info)); + } + if (r->outgoing_current_auth_info) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->outgoing_current_auth_info)); + } + if (r->outgoing_previous_auth_info) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->outgoing_previous_auth_info)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoAuthInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoAuthInfo *r) +{ + uint32_t _ptr_incoming_current_auth_info; + TALLOC_CTX *_mem_save_incoming_current_auth_info_0; + uint32_t _ptr_incoming_previous_auth_info; + TALLOC_CTX *_mem_save_incoming_previous_auth_info_0; + uint32_t _ptr_outgoing_current_auth_info; + TALLOC_CTX *_mem_save_outgoing_current_auth_info_0; + uint32_t _ptr_outgoing_previous_auth_info; + TALLOC_CTX *_mem_save_outgoing_previous_auth_info_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->incoming_count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_incoming_current_auth_info)); + if (_ptr_incoming_current_auth_info) { + NDR_PULL_ALLOC(ndr, r->incoming_current_auth_info); + } else { + r->incoming_current_auth_info = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_incoming_previous_auth_info)); + if (_ptr_incoming_previous_auth_info) { + NDR_PULL_ALLOC(ndr, r->incoming_previous_auth_info); + } else { + r->incoming_previous_auth_info = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->outgoing_count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_outgoing_current_auth_info)); + if (_ptr_outgoing_current_auth_info) { + NDR_PULL_ALLOC(ndr, r->outgoing_current_auth_info); + } else { + r->outgoing_current_auth_info = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_outgoing_previous_auth_info)); + if (_ptr_outgoing_previous_auth_info) { + NDR_PULL_ALLOC(ndr, r->outgoing_previous_auth_info); + } else { + r->outgoing_previous_auth_info = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->incoming_current_auth_info) { + _mem_save_incoming_current_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->incoming_current_auth_info, 0); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->incoming_current_auth_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_incoming_current_auth_info_0, 0); + } + if (r->incoming_previous_auth_info) { + _mem_save_incoming_previous_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->incoming_previous_auth_info, 0); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->incoming_previous_auth_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_incoming_previous_auth_info_0, 0); + } + if (r->outgoing_current_auth_info) { + _mem_save_outgoing_current_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->outgoing_current_auth_info, 0); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->outgoing_current_auth_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_outgoing_current_auth_info_0, 0); + } + if (r->outgoing_previous_auth_info) { + _mem_save_outgoing_previous_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->outgoing_previous_auth_info, 0); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->outgoing_previous_auth_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_outgoing_previous_auth_info_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoAuthInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoAuthInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "incoming_count", r->incoming_count); + ndr_print_ptr(ndr, "incoming_current_auth_info", r->incoming_current_auth_info); + ndr->depth++; + if (r->incoming_current_auth_info) { + ndr_print_lsa_TrustDomainInfoBuffer(ndr, "incoming_current_auth_info", r->incoming_current_auth_info); + } + ndr->depth--; + ndr_print_ptr(ndr, "incoming_previous_auth_info", r->incoming_previous_auth_info); + ndr->depth++; + if (r->incoming_previous_auth_info) { + ndr_print_lsa_TrustDomainInfoBuffer(ndr, "incoming_previous_auth_info", r->incoming_previous_auth_info); + } + ndr->depth--; + ndr_print_uint32(ndr, "outgoing_count", r->outgoing_count); + ndr_print_ptr(ndr, "outgoing_current_auth_info", r->outgoing_current_auth_info); + ndr->depth++; + if (r->outgoing_current_auth_info) { + ndr_print_lsa_TrustDomainInfoBuffer(ndr, "outgoing_current_auth_info", r->outgoing_current_auth_info); + } + ndr->depth--; + ndr_print_ptr(ndr, "outgoing_previous_auth_info", r->outgoing_previous_auth_info); + ndr->depth++; + if (r->outgoing_previous_auth_info) { + ndr_print_lsa_TrustDomainInfoBuffer(ndr, "outgoing_previous_auth_info", r->outgoing_previous_auth_info); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoFullInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoFullInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoFullInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoFullInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoFullInfo"); + ndr->depth++; + ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex); + ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset); + ndr_print_lsa_TrustDomainInfoAuthInfo(ndr, "auth_info", &r->auth_info); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoAuthInfoInternal *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->auth_blob)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->auth_blob)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoAuthInfoInternal *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->auth_blob)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->auth_blob)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfoInternal *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoAuthInfoInternal"); + ndr->depth++; + ndr_print_lsa_DATA_BUF2(ndr, "auth_blob", &r->auth_blob); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoFullInfoInternal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoFullInfoInternal *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoFullInfoInternal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoFullInfoInternal *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfoInternal *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoFullInfoInternal"); + ndr->depth++; + ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex); + ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset); + ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info", &r->auth_info); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoInfoEx2Internal *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->forest_trust_length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest_trust_data)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); + if (r->forest_trust_data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->forest_trust_length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->forest_trust_data, r->forest_trust_length)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoInfoEx2Internal *r) +{ + uint32_t _ptr_forest_trust_data; + TALLOC_CTX *_mem_save_forest_trust_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->forest_trust_length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_data)); + if (_ptr_forest_trust_data) { + NDR_PULL_ALLOC(ndr, r->forest_trust_data); + } else { + r->forest_trust_data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); + if (r->forest_trust_data) { + _mem_save_forest_trust_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->forest_trust_data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->forest_trust_data)); + NDR_PULL_ALLOC_N(ndr, r->forest_trust_data, ndr_get_array_size(ndr, &r->forest_trust_data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->forest_trust_data, ndr_get_array_size(ndr, &r->forest_trust_data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_data_0, 0); + } + if (r->forest_trust_data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->forest_trust_data, r->forest_trust_length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx2Internal *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoInfoEx2Internal"); + ndr->depth++; + ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex); + ndr_print_uint32(ndr, "forest_trust_length", r->forest_trust_length); + ndr_print_ptr(ndr, "forest_trust_data", r->forest_trust_data); + ndr->depth++; + if (r->forest_trust_data) { + ndr_print_array_uint8(ndr, "forest_trust_data", r->forest_trust_data, r->forest_trust_length); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoFullInfo2Internal *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoFullInfo2Internal *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo2Internal *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoFullInfo2Internal"); + ndr->depth++; + ndr_print_lsa_TrustDomainInfoInfoEx2Internal(ndr, "info", &r->info); + ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset); + ndr_print_lsa_TrustDomainInfoAuthInfo(ndr, "auth_info", &r->auth_info); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoSupportedEncTypes *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_kerb_EncTypes(ndr, NDR_SCALARS, r->enc_types)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoSupportedEncTypes *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_kerb_EncTypes(ndr, NDR_SCALARS, &r->enc_types)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoSupportedEncTypes *r) +{ + ndr_print_struct(ndr, name, "lsa_TrustDomainInfoSupportedEncTypes"); + ndr->depth++; + ndr_print_kerb_EncTypes(ndr, "enc_types", r->enc_types); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, int ndr_flags, const union lsa_TrustedDomainInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, level)); + switch (level) { + case LSA_TRUSTED_DOMAIN_INFO_NAME: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoName(ndr, NDR_SCALARS, &r->name)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoControllers(ndr, NDR_SCALARS, &r->controllers)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoPassword(ndr, NDR_SCALARS, &r->password)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_BASIC: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoBasic(ndr, NDR_SCALARS, &r->info_basic)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo(ndr, NDR_SCALARS, &r->full_info)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info_internal)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_SCALARS, &r->full_info_internal)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info_ex2_internal)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_SCALARS, &r->full_info2_internal)); + break; } + + case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoSupportedEncTypes(ndr, NDR_SCALARS, &r->enc_types)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case LSA_TRUSTED_DOMAIN_INFO_NAME: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoName(ndr, NDR_BUFFERS, &r->name)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoControllers(ndr, NDR_BUFFERS, &r->controllers)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: + break; + + case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoPassword(ndr, NDR_BUFFERS, &r->password)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_BASIC: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoBasic(ndr, NDR_BUFFERS, &r->info_basic)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo(ndr, NDR_BUFFERS, &r->full_info)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info_internal)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_BUFFERS, &r->full_info_internal)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info_ex2_internal)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: + NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_BUFFERS, &r->full_info2_internal)); + break; + + case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TrustedDomainInfo(struct ndr_pull *ndr, int ndr_flags, union lsa_TrustedDomainInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case LSA_TRUSTED_DOMAIN_INFO_NAME: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoName(ndr, NDR_SCALARS, &r->name)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoControllers(ndr, NDR_SCALARS, &r->controllers)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPassword(ndr, NDR_SCALARS, &r->password)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_BASIC: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBasic(ndr, NDR_SCALARS, &r->info_basic)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo(ndr, NDR_SCALARS, &r->full_info)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info_internal)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_SCALARS, &r->full_info_internal)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info_ex2_internal)); + break; } + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_SCALARS, &r->full_info2_internal)); + break; } + + case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoSupportedEncTypes(ndr, NDR_SCALARS, &r->enc_types)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case LSA_TRUSTED_DOMAIN_INFO_NAME: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoName(ndr, NDR_BUFFERS, &r->name)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoControllers(ndr, NDR_BUFFERS, &r->controllers)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: + break; + + case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPassword(ndr, NDR_BUFFERS, &r->password)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_BASIC: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBasic(ndr, NDR_BUFFERS, &r->info_basic)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo(ndr, NDR_BUFFERS, &r->full_info)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info_internal)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_BUFFERS, &r->full_info_internal)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info_ex2_internal)); + break; + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_BUFFERS, &r->full_info2_internal)); + break; + + case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char *name, const union lsa_TrustedDomainInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "lsa_TrustedDomainInfo"); + switch (level) { + case LSA_TRUSTED_DOMAIN_INFO_NAME: + ndr_print_lsa_TrustDomainInfoName(ndr, "name", &r->name); + break; + + case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: + ndr_print_lsa_TrustDomainInfoControllers(ndr, "controllers", &r->controllers); + break; + + case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: + ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset); + break; + + case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: + ndr_print_lsa_TrustDomainInfoPassword(ndr, "password", &r->password); + break; + + case LSA_TRUSTED_DOMAIN_INFO_BASIC: + ndr_print_lsa_TrustDomainInfoBasic(ndr, "info_basic", &r->info_basic); + break; + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: + ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex); + break; + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: + ndr_print_lsa_TrustDomainInfoAuthInfo(ndr, "auth_info", &r->auth_info); + break; + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: + ndr_print_lsa_TrustDomainInfoFullInfo(ndr, "full_info", &r->full_info); + break; + + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: + ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info_internal", &r->auth_info_internal); + break; + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: + ndr_print_lsa_TrustDomainInfoFullInfoInternal(ndr, "full_info_internal", &r->full_info_internal); + break; + + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: + ndr_print_lsa_TrustDomainInfoInfoEx2Internal(ndr, "info_ex2_internal", &r->info_ex2_internal); + break; + + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: + ndr_print_lsa_TrustDomainInfoFullInfo2Internal(ndr, "full_info2_internal", &r->full_info2_internal); + break; + + case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: + ndr_print_lsa_TrustDomainInfoSupportedEncTypes(ndr, "enc_types", &r->enc_types); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_lsa_DATA_BUF_PTR(struct ndr_push *ndr, int ndr_flags, const struct lsa_DATA_BUF_PTR *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->buf)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->buf) { + NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->buf)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DATA_BUF_PTR(struct ndr_pull *ndr, int ndr_flags, struct lsa_DATA_BUF_PTR *r) +{ + uint32_t _ptr_buf; + TALLOC_CTX *_mem_save_buf_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buf)); + if (_ptr_buf) { + NDR_PULL_ALLOC(ndr, r->buf); + } else { + r->buf = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->buf) { + _mem_save_buf_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buf, 0); + NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->buf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buf_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DATA_BUF_PTR(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF_PTR *r) +{ + ndr_print_struct(ndr, name, "lsa_DATA_BUF_PTR"); + ndr->depth++; + ndr_print_ptr(ndr, "buf", r->buf); + ndr->depth++; + if (r->buf) { + ndr_print_lsa_DATA_BUF(ndr, "buf", r->buf); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_RightSet(struct ndr_push *ndr, int ndr_flags, const struct lsa_RightSet *r) +{ + uint32_t cntr_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_RightSet(struct ndr_pull *ndr, int ndr_flags, struct lsa_RightSet *r) +{ + uint32_t _ptr_names; + uint32_t cntr_names_1; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 256) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); + if (_ptr_names) { + NDR_PULL_ALLOC(ndr, r->names); + } else { + r->names = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); + NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); + _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + } + if (r->names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, const struct lsa_RightSet *r) +{ + uint32_t cntr_names_1; + ndr_print_struct(ndr, name, "lsa_RightSet"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "names", r->names); + ndr->depth++; + if (r->names) { + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); + ndr->depth++; + for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { + ndr_print_lsa_StringLarge(ndr, "names", &r->names[cntr_names_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DomainListEx(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainListEx *r) +{ + uint32_t cntr_domains_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domains)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domains) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); + } + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DomainListEx(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainListEx *r) +{ + uint32_t _ptr_domains; + uint32_t cntr_domains_1; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, r->domains); + } else { + r->domains = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domains) { + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domains)); + NDR_PULL_ALLOC_N(ndr, r->domains, ndr_get_array_size(ndr, &r->domains)); + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); + } + for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + } + if (r->domains) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->domains, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DomainListEx(struct ndr_print *ndr, const char *name, const struct lsa_DomainListEx *r) +{ + uint32_t cntr_domains_1; + ndr_print_struct(ndr, name, "lsa_DomainListEx"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "domains", r->domains); + ndr->depth++; + if (r->domains) { + ndr->print(ndr, "%s: ARRAY(%d)", "domains", (int)r->count); + ndr->depth++; + for (cntr_domains_1=0;cntr_domains_1count;cntr_domains_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) { + ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "domains", &r->domains[cntr_domains_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DomainInfoKerberos(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainInfoKerberos *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enforce_restrictions)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->service_tkt_lifetime)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->user_tkt_lifetime)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->user_tkt_renewaltime)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->clock_skew)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown6)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DomainInfoKerberos(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInfoKerberos *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enforce_restrictions)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->service_tkt_lifetime)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->user_tkt_lifetime)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->user_tkt_renewaltime)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->clock_skew)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown6)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DomainInfoKerberos(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoKerberos *r) +{ + ndr_print_struct(ndr, name, "lsa_DomainInfoKerberos"); + ndr->depth++; + ndr_print_uint32(ndr, "enforce_restrictions", r->enforce_restrictions); + ndr_print_hyper(ndr, "service_tkt_lifetime", r->service_tkt_lifetime); + ndr_print_hyper(ndr, "user_tkt_lifetime", r->user_tkt_lifetime); + ndr_print_hyper(ndr, "user_tkt_renewaltime", r->user_tkt_renewaltime); + ndr_print_hyper(ndr, "clock_skew", r->clock_skew); + ndr_print_hyper(ndr, "unknown6", r->unknown6); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DomainInfoEfs(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainInfoEfs *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->blob_size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->efs_blob)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->efs_blob) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->blob_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->efs_blob, r->blob_size)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DomainInfoEfs(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInfoEfs *r) +{ + uint32_t _ptr_efs_blob; + TALLOC_CTX *_mem_save_efs_blob_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->blob_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_efs_blob)); + if (_ptr_efs_blob) { + NDR_PULL_ALLOC(ndr, r->efs_blob); + } else { + r->efs_blob = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->efs_blob) { + _mem_save_efs_blob_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->efs_blob, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->efs_blob)); + NDR_PULL_ALLOC_N(ndr, r->efs_blob, ndr_get_array_size(ndr, &r->efs_blob)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->efs_blob, ndr_get_array_size(ndr, &r->efs_blob))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_efs_blob_0, 0); + } + if (r->efs_blob) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->efs_blob, r->blob_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DomainInfoEfs(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoEfs *r) +{ + ndr_print_struct(ndr, name, "lsa_DomainInfoEfs"); + ndr->depth++; + ndr_print_uint32(ndr, "blob_size", r->blob_size); + ndr_print_ptr(ndr, "efs_blob", r->efs_blob); + ndr->depth++; + if (r->efs_blob) { + ndr_print_array_uint8(ndr, "efs_blob", r->efs_blob, r->blob_size); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DomainInformationPolicy(struct ndr_push *ndr, int ndr_flags, const union lsa_DomainInformationPolicy *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case LSA_DOMAIN_INFO_POLICY_EFS: { + NDR_CHECK(ndr_push_lsa_DomainInfoEfs(ndr, NDR_SCALARS, &r->efs_info)); + break; } + + case LSA_DOMAIN_INFO_POLICY_KERBEROS: { + NDR_CHECK(ndr_push_lsa_DomainInfoKerberos(ndr, NDR_SCALARS, &r->kerberos_info)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case LSA_DOMAIN_INFO_POLICY_EFS: + NDR_CHECK(ndr_push_lsa_DomainInfoEfs(ndr, NDR_BUFFERS, &r->efs_info)); + break; + + case LSA_DOMAIN_INFO_POLICY_KERBEROS: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DomainInformationPolicy(struct ndr_pull *ndr, int ndr_flags, union lsa_DomainInformationPolicy *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case LSA_DOMAIN_INFO_POLICY_EFS: { + NDR_CHECK(ndr_pull_lsa_DomainInfoEfs(ndr, NDR_SCALARS, &r->efs_info)); + break; } + + case LSA_DOMAIN_INFO_POLICY_KERBEROS: { + NDR_CHECK(ndr_pull_lsa_DomainInfoKerberos(ndr, NDR_SCALARS, &r->kerberos_info)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case LSA_DOMAIN_INFO_POLICY_EFS: + NDR_CHECK(ndr_pull_lsa_DomainInfoEfs(ndr, NDR_BUFFERS, &r->efs_info)); + break; + + case LSA_DOMAIN_INFO_POLICY_KERBEROS: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DomainInformationPolicy(struct ndr_print *ndr, const char *name, const union lsa_DomainInformationPolicy *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "lsa_DomainInformationPolicy"); + switch (level) { + case LSA_DOMAIN_INFO_POLICY_EFS: + ndr_print_lsa_DomainInfoEfs(ndr, "efs_info", &r->efs_info); + break; + + case LSA_DOMAIN_INFO_POLICY_KERBEROS: + ndr_print_lsa_DomainInfoKerberos(ndr, "kerberos_info", &r->kerberos_info); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_lsa_TranslatedName2(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedName2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TranslatedName2(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedName2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TranslatedName2(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName2 *r) +{ + ndr_print_struct(ndr, name, "lsa_TranslatedName2"); + ndr->depth++; + ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); + ndr_print_lsa_String(ndr, "name", &r->name); + ndr_print_uint32(ndr, "sid_index", r->sid_index); + ndr_print_uint32(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TransNameArray2(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransNameArray2 *r) +{ + uint32_t cntr_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_lsa_TranslatedName2(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_push_lsa_TranslatedName2(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TransNameArray2(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransNameArray2 *r) +{ + uint32_t _ptr_names; + uint32_t cntr_names_1; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); + if (_ptr_names) { + NDR_PULL_ALLOC(ndr, r->names); + } else { + r->names = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->names) { + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); + NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); + _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_lsa_TranslatedName2(ndr, NDR_SCALARS, &r->names[cntr_names_1])); + } + for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { + NDR_CHECK(ndr_pull_lsa_TranslatedName2(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + } + if (r->names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TransNameArray2(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray2 *r) +{ + uint32_t cntr_names_1; + ndr_print_struct(ndr, name, "lsa_TransNameArray2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "names", r->names); + ndr->depth++; + if (r->names) { + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); + ndr->depth++; + for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { + ndr_print_lsa_TranslatedName2(ndr, "names", &r->names[cntr_names_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TranslatedSid2(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedSid2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TranslatedSid2(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedSid2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TranslatedSid2(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid2 *r) +{ + ndr_print_struct(ndr, name, "lsa_TranslatedSid2"); + ndr->depth++; + ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "sid_index", r->sid_index); + ndr_print_uint32(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TransSidArray2(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransSidArray2 *r) +{ + uint32_t cntr_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { + NDR_CHECK(ndr_push_lsa_TranslatedSid2(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TransSidArray2(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransSidArray2 *r) +{ + uint32_t _ptr_sids; + uint32_t cntr_sids_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids); + } else { + r->sids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sids) { + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { + NDR_CHECK(ndr_pull_lsa_TranslatedSid2(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + } + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TransSidArray2(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray2 *r) +{ + uint32_t cntr_sids_1; + ndr_print_struct(ndr, name, "lsa_TransSidArray2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "sids", r->sids); + ndr->depth++; + if (r->sids) { + ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->count); + ndr->depth++; + for (cntr_sids_1=0;cntr_sids_1count;cntr_sids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { + ndr_print_lsa_TranslatedSid2(ndr, "sids", &r->sids[cntr_sids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TranslatedSid3(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedSid3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TranslatedSid3(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedSid3 *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TranslatedSid3(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid3 *r) +{ + ndr_print_struct(ndr, name, "lsa_TranslatedSid3"); + ndr->depth++; + ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr_print_uint32(ndr, "sid_index", r->sid_index); + ndr_print_uint32(ndr, "flags", r->flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TransSidArray3(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransSidArray3 *r) +{ + uint32_t cntr_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { + NDR_CHECK(ndr_push_lsa_TranslatedSid3(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { + NDR_CHECK(ndr_push_lsa_TranslatedSid3(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TransSidArray3(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransSidArray3 *r) +{ + uint32_t _ptr_sids; + uint32_t cntr_sids_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids); + } else { + r->sids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sids) { + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { + NDR_CHECK(ndr_pull_lsa_TranslatedSid3(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { + NDR_CHECK(ndr_pull_lsa_TranslatedSid3(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + } + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TransSidArray3(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray3 *r) +{ + uint32_t cntr_sids_1; + ndr_print_struct(ndr, name, "lsa_TransSidArray3"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "sids", r->sids); + ndr->depth++; + if (r->sids) { + ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->count); + ndr->depth++; + for (cntr_sids_1=0;cntr_sids_1count;cntr_sids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { + ndr_print_lsa_TranslatedSid3(ndr, "sids", &r->sids[cntr_sids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_ForestTrustBinaryData(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustBinaryData *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ForestTrustBinaryData(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustBinaryData *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + if (r->length < 0 || r->length > 131072) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustBinaryData(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustBinaryData *r) +{ + ndr_print_struct(ndr, name, "lsa_ForestTrustBinaryData"); + ndr->depth++; + ndr_print_uint32(ndr, "length", r->length); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_ForestTrustDomainInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustDomainInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain_name)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain_sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); + } + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain_name)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_domain_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ForestTrustDomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustDomainInfo *r) +{ + uint32_t _ptr_domain_sid; + TALLOC_CTX *_mem_save_domain_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid)); + if (_ptr_domain_sid) { + NDR_PULL_ALLOC(ndr, r->domain_sid); + } else { + r->domain_sid = NULL; + } + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain_name)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain_sid) { + _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0); + } + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain_name)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_domain_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustDomainInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_ForestTrustDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_sid", r->domain_sid); + ndr->depth++; + if (r->domain_sid) { + ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid); + } + ndr->depth--; + ndr_print_lsa_StringLarge(ndr, "dns_domain_name", &r->dns_domain_name); + ndr_print_lsa_StringLarge(ndr, "netbios_domain_name", &r->netbios_domain_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_ForestTrustData(struct ndr_push *ndr, int ndr_flags, const union lsa_ForestTrustData *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->top_level_name)); + break; } + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->top_level_name_ex)); + break; } + + case LSA_FOREST_TRUST_DOMAIN_INFO: { + NDR_CHECK(ndr_push_lsa_ForestTrustDomainInfo(ndr, NDR_SCALARS, &r->domain_info)); + break; } + + default: { + NDR_CHECK(ndr_push_lsa_ForestTrustBinaryData(ndr, NDR_SCALARS, &r->data)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->top_level_name)); + break; + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->top_level_name_ex)); + break; + + case LSA_FOREST_TRUST_DOMAIN_INFO: + NDR_CHECK(ndr_push_lsa_ForestTrustDomainInfo(ndr, NDR_BUFFERS, &r->domain_info)); + break; + + default: + NDR_CHECK(ndr_push_lsa_ForestTrustBinaryData(ndr, NDR_BUFFERS, &r->data)); + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ForestTrustData(struct ndr_pull *ndr, int ndr_flags, union lsa_ForestTrustData *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->top_level_name)); + break; } + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->top_level_name_ex)); + break; } + + case LSA_FOREST_TRUST_DOMAIN_INFO: { + NDR_CHECK(ndr_pull_lsa_ForestTrustDomainInfo(ndr, NDR_SCALARS, &r->domain_info)); + break; } + + default: { + NDR_CHECK(ndr_pull_lsa_ForestTrustBinaryData(ndr, NDR_SCALARS, &r->data)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->top_level_name)); + break; + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->top_level_name_ex)); + break; + + case LSA_FOREST_TRUST_DOMAIN_INFO: + NDR_CHECK(ndr_pull_lsa_ForestTrustDomainInfo(ndr, NDR_BUFFERS, &r->domain_info)); + break; + + default: + NDR_CHECK(ndr_pull_lsa_ForestTrustBinaryData(ndr, NDR_BUFFERS, &r->data)); + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustData(struct ndr_print *ndr, const char *name, const union lsa_ForestTrustData *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "lsa_ForestTrustData"); + switch (level) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: + ndr_print_lsa_String(ndr, "top_level_name", &r->top_level_name); + break; + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: + ndr_print_lsa_StringLarge(ndr, "top_level_name_ex", &r->top_level_name_ex); + break; + + case LSA_FOREST_TRUST_DOMAIN_INFO: + ndr_print_lsa_ForestTrustDomainInfo(ndr, "domain_info", &r->domain_info); + break; + + default: + ndr_print_lsa_ForestTrustBinaryData(ndr, "data", &r->data); + break; + + } +} + +static enum ndr_err_code ndr_push_lsa_ForestTrustRecordType(struct ndr_push *ndr, int ndr_flags, enum lsa_ForestTrustRecordType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ForestTrustRecordType(struct ndr_pull *ndr, int ndr_flags, enum lsa_ForestTrustRecordType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustRecordType(struct ndr_print *ndr, const char *name, enum lsa_ForestTrustRecordType r) +{ + const char *val = NULL; + + switch (r) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: val = "LSA_FOREST_TRUST_TOP_LEVEL_NAME"; break; + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: val = "LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX"; break; + case LSA_FOREST_TRUST_DOMAIN_INFO: val = "LSA_FOREST_TRUST_DOMAIN_INFO"; break; + case LSA_FOREST_TRUST_RECORD_TYPE_LAST: val = "LSA_FOREST_TRUST_RECORD_TYPE_LAST"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_lsa_ForestTrustRecord(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustRecord *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_lsa_ForestTrustRecordType(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->forest_trust_data, r->level)); + NDR_CHECK(ndr_push_lsa_ForestTrustData(ndr, NDR_SCALARS, &r->forest_trust_data)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_ForestTrustData(ndr, NDR_BUFFERS, &r->forest_trust_data)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ForestTrustRecord(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustRecord *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_lsa_ForestTrustRecordType(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->forest_trust_data, r->level)); + NDR_CHECK(ndr_pull_lsa_ForestTrustData(ndr, NDR_SCALARS, &r->forest_trust_data)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_ForestTrustData(ndr, NDR_BUFFERS, &r->forest_trust_data)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustRecord(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustRecord *r) +{ + ndr_print_struct(ndr, name, "lsa_ForestTrustRecord"); + ndr->depth++; + ndr_print_uint32(ndr, "flags", r->flags); + ndr_print_lsa_ForestTrustRecordType(ndr, "level", r->level); + ndr_print_hyper(ndr, "unknown", r->unknown); + ndr_print_set_switch_value(ndr, &r->forest_trust_data, r->level); + ndr_print_lsa_ForestTrustData(ndr, "forest_trust_data", &r->forest_trust_data); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_ForestTrustInformation(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustInformation *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + if (r->entries[cntr_entries_1]) { + NDR_CHECK(ndr_push_lsa_ForestTrustRecord(ndr, NDR_SCALARS|NDR_BUFFERS, r->entries[cntr_entries_1])); + } + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_ForestTrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustInformation *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + TALLOC_CTX *_mem_save_entries_2; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 4000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries[cntr_entries_1]); + } else { + r->entries[cntr_entries_1] = NULL; + } + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + if (r->entries[cntr_entries_1]) { + _mem_save_entries_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries[cntr_entries_1], 0); + NDR_CHECK(ndr_pull_lsa_ForestTrustRecord(ndr, NDR_SCALARS|NDR_BUFFERS, r->entries[cntr_entries_1])); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_2, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustInformation(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustInformation *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "lsa_ForestTrustInformation"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { + ndr_print_ptr(ndr, "entries", r->entries[cntr_entries_1]); + ndr->depth++; + if (r->entries[cntr_entries_1]) { + ndr_print_lsa_ForestTrustRecord(ndr, "entries", r->entries[cntr_entries_1]); + } + ndr->depth--; + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_Close(struct ndr_pull *ndr, int flags, struct lsa_Close *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.handle); + *r->out.handle = *r->in.handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_Close(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Close *r) +{ + ndr_print_struct(ndr, name, "lsa_Close"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_Close"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_Close"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_Delete(struct ndr_pull *ndr, int flags, struct lsa_Delete *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_Delete(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Delete *r) +{ + ndr_print_struct(ndr, name, "lsa_Delete"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_Delete"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_Delete"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_EnumPrivs(struct ndr_pull *ndr, int flags, struct lsa_EnumPrivs *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_privs_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_count)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.privs); + ZERO_STRUCTP(r->out.privs); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.privs); + } + _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.privs, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_PrivArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.privs)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_EnumPrivs(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivs *r) +{ + ndr_print_struct(ndr, name, "lsa_EnumPrivs"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_EnumPrivs"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_uint32(ndr, "max_count", r->in.max_count); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_EnumPrivs"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "privs", r->out.privs); + ndr->depth++; + ndr_print_lsa_PrivArray(ndr, "privs", r->out.privs); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); + } + if (flags & NDR_OUT) { + if (r->out.sdbuf == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sdbuf)); + if (*r->out.sdbuf) { + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_QuerySecurity(struct ndr_pull *ndr, int flags, struct lsa_QuerySecurity *r) +{ + uint32_t _ptr_sdbuf; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sdbuf_0; + TALLOC_CTX *_mem_save_sdbuf_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); + NDR_PULL_ALLOC(ndr, r->out.sdbuf); + ZERO_STRUCTP(r->out.sdbuf); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sdbuf); + } + _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sdbuf, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sdbuf)); + if (_ptr_sdbuf) { + NDR_PULL_ALLOC(ndr, *r->out.sdbuf); + } else { + *r->out.sdbuf = NULL; + } + if (*r->out.sdbuf) { + _mem_save_sdbuf_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sdbuf, 0); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecurity *r) +{ + ndr_print_struct(ndr, name, "lsa_QuerySecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_QuerySecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_QuerySecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "sdbuf", r->out.sdbuf); + ndr->depth++; + ndr_print_ptr(ndr, "sdbuf", *r->out.sdbuf); + ndr->depth++; + if (*r->out.sdbuf) { + ndr_print_sec_desc_buf(ndr, "sdbuf", *r->out.sdbuf); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_SetSecObj(struct ndr_push *ndr, int flags, const struct lsa_SetSecObj *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); + if (r->in.sdbuf == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SetSecObj(struct ndr_pull *ndr, int flags, struct lsa_SetSecObj *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sdbuf_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sdbuf); + } + _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sdbuf, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetSecObj(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecObj *r) +{ + ndr_print_struct(ndr, name, "lsa_SetSecObj"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetSecObj"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); + ndr_print_ptr(ndr, "sdbuf", r->in.sdbuf); + ndr->depth++; + ndr_print_sec_desc_buf(ndr, "sdbuf", r->in.sdbuf); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetSecObj"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_ChangePassword(struct ndr_push *ndr, int flags, const struct lsa_ChangePassword *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ChangePassword(struct ndr_pull *ndr, int flags, struct lsa_ChangePassword *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ChangePassword(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ChangePassword *r) +{ + ndr_print_struct(ndr, name, "lsa_ChangePassword"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_ChangePassword"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_ChangePassword"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + 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_lsa_PolicyAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_OpenPolicy(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_attr_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.attr); + } + _mem_save_attr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.attr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_PolicyAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_OpenPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy *r) +{ + ndr_print_struct(ndr, name, "lsa_OpenPolicy"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_OpenPolicy"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "attr", r->in.attr); + ndr->depth++; + ndr_print_lsa_ObjectAttribute(ndr, "attr", r->in.attr); + ndr->depth--; + ndr_print_lsa_PolicyAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_OpenPolicy"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_QueryInfoPolicy(struct ndr_pull *ndr, int flags, struct lsa_QueryInfoPolicy *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_PolicyInfo(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_QueryInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy *r) +{ + ndr_print_struct(ndr, name, "lsa_QueryInfoPolicy"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_QueryInfoPolicy"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_lsa_PolicyInfo(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_QueryInfoPolicy"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_lsa_PolicyInformation(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_SetInfoPolicy(struct ndr_push *ndr, int flags, const struct lsa_SetInfoPolicy *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); + 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_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SetInfoPolicy(struct ndr_pull *ndr, int flags, struct lsa_SetInfoPolicy *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_PolicyInfo(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInfoPolicy *r) +{ + ndr_print_struct(ndr, name, "lsa_SetInfoPolicy"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetInfoPolicy"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_lsa_PolicyInfo(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_lsa_PolicyInformation(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetInfoPolicy"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_ClearAuditLog(struct ndr_push *ndr, int flags, const struct lsa_ClearAuditLog *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ClearAuditLog(struct ndr_pull *ndr, int flags, struct lsa_ClearAuditLog *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ClearAuditLog(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ClearAuditLog *r) +{ + ndr_print_struct(ndr, name, "lsa_ClearAuditLog"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_ClearAuditLog"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_ClearAuditLog"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.acct_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, int flags, struct lsa_CreateAccount *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_acct_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.acct_handle); + ZERO_STRUCTP(r->out.acct_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.acct_handle); + } + _mem_save_acct_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.acct_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.acct_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CreateAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateAccount *r) +{ + ndr_print_struct(ndr, name, "lsa_CreateAccount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CreateAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CreateAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "acct_handle", r->out.acct_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "acct_handle", r->out.acct_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_EnumAccounts(struct ndr_pull *ndr, int flags, struct lsa_EnumAccounts *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_entries)); + if (r->in.num_entries < 0 || r->in.num_entries > 8192) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.sids); + ZERO_STRUCTP(r->out.sids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_EnumAccounts(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccounts *r) +{ + ndr_print_struct(ndr, name, "lsa_EnumAccounts"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_EnumAccounts"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_uint32(ndr, "num_entries", r->in.num_entries); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_EnumAccounts"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_CreateTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomain *r) +{ + if (flags & NDR_IN) { + if (r->in.policy_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); + 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomain *r) +{ + TALLOC_CTX *_mem_save_policy_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_trustdom_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.policy_handle); + } + _mem_save_policy_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.policy_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + ZERO_STRUCTP(r->out.trustdom_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + } + _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CreateTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomain *r) +{ + ndr_print_struct(ndr, name, "lsa_CreateTrustedDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CreateTrustedDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "policy_handle", r->in.policy_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "policy_handle", r->in.policy_handle); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_lsa_DomainInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CreateTrustedDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_EnumTrustDom(struct ndr_pull *ndr, int flags, struct lsa_EnumTrustDom *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_domains_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_DomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_EnumTrustDom(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumTrustDom *r) +{ + ndr_print_struct(ndr, name, "lsa_EnumTrustDom"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_EnumTrustDom"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_uint32(ndr, "max_size", r->in.max_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_EnumTrustDom"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "domains", r->out.domains); + ndr->depth++; + ndr_print_lsa_DomainList(ndr, "domains", r->out.domains); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const struct lsa_LookupNames *r) +{ + uint32_t cntr_names_0; + if (flags & NDR_IN) { + 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, 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)); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + 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 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_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); + 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) { + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + } + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flags, struct lsa_LookupNames *r) +{ + uint32_t cntr_names_0; + uint32_t _ptr_domains; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_count_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); + if (r->in.num_names < 0 || r->in.num_names > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); + NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransSidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); + NDR_PULL_ALLOC(ndr, r->out.sids); + *r->out.sids = *r->in.sids; + NDR_PULL_ALLOC(ndr, r->out.count); + *r->out.count = *r->in.count; + if (r->in.names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, r->in.num_names)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, *r->out.domains); + } else { + *r->out.domains = NULL; + } + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransSidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames *r) +{ + uint32_t cntr_names_0; + ndr_print_struct(ndr, name, "lsa_LookupNames"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupNames"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "num_names", r->in.num_names); + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); + ndr->depth++; + for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { + ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_TransSidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "count", r->in.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->in.count); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupNames"); + ndr->depth++; + ndr_print_ptr(ndr, "domains", r->out.domains); + ndr->depth++; + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_lsa_TransSidArray(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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 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) { + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + } + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupSids(struct ndr_pull *ndr, int flags, struct lsa_LookupSids *r) +{ + uint32_t _ptr_domains; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_count_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.names); + } + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.names, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransNameArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.names)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); + NDR_PULL_ALLOC(ndr, r->out.names); + *r->out.names = *r->in.names; + NDR_PULL_ALLOC(ndr, r->out.count); + *r->out.count = *r->in.count; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, *r->out.domains); + } else { + *r->out.domains = NULL; + } + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.names); + } + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransNameArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupSids(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids *r) +{ + ndr_print_struct(ndr, name, "lsa_LookupSids"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupSids"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr_print_ptr(ndr, "names", r->in.names); + ndr->depth++; + ndr_print_lsa_TransNameArray(ndr, "names", r->in.names); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "count", r->in.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->in.count); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupSids"); + ndr->depth++; + ndr_print_ptr(ndr, "domains", r->out.domains); + ndr->depth++; + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "names", r->out.names); + ndr->depth++; + ndr_print_lsa_TransNameArray(ndr, "names", r->out.names); + ndr->depth--; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.sec_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateSecret(struct ndr_pull *ndr, int flags, struct lsa_CreateSecret *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sec_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.sec_handle); + ZERO_STRUCTP(r->out.sec_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sec_handle); + } + _mem_save_sec_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sec_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.sec_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CreateSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateSecret *r) +{ + ndr_print_struct(ndr, name, "lsa_CreateSecret"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CreateSecret"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_lsa_String(ndr, "name", &r->in.name); + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CreateSecret"); + ndr->depth++; + ndr_print_ptr(ndr, "sec_handle", r->out.sec_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "sec_handle", r->out.sec_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.acct_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_OpenAccount(struct ndr_pull *ndr, int flags, struct lsa_OpenAccount *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_acct_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.acct_handle); + ZERO_STRUCTP(r->out.acct_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.acct_handle); + } + _mem_save_acct_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.acct_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.acct_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_OpenAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenAccount *r) +{ + ndr_print_struct(ndr, name, "lsa_OpenAccount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_OpenAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_OpenAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "acct_handle", r->out.acct_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "acct_handle", r->out.acct_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + if (r->out.privs == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.privs)); + if (*r->out.privs) { + NDR_CHECK(ndr_push_lsa_PrivilegeSet(ndr, NDR_SCALARS, *r->out.privs)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_EnumPrivsAccount(struct ndr_pull *ndr, int flags, struct lsa_EnumPrivsAccount *r) +{ + uint32_t _ptr_privs; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_privs_0; + TALLOC_CTX *_mem_save_privs_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.privs); + ZERO_STRUCTP(r->out.privs); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.privs); + } + _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.privs, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privs)); + if (_ptr_privs) { + NDR_PULL_ALLOC(ndr, *r->out.privs); + } else { + *r->out.privs = NULL; + } + if (*r->out.privs) { + _mem_save_privs_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.privs, 0); + NDR_CHECK(ndr_pull_lsa_PrivilegeSet(ndr, NDR_SCALARS, *r->out.privs)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_EnumPrivsAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivsAccount *r) +{ + ndr_print_struct(ndr, name, "lsa_EnumPrivsAccount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_EnumPrivsAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_EnumPrivsAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "privs", r->out.privs); + ndr->depth++; + ndr_print_ptr(ndr, "privs", *r->out.privs); + ndr->depth++; + if (*r->out.privs) { + ndr_print_lsa_PrivilegeSet(ndr, "privs", *r->out.privs); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_AddPrivilegesToAccount(struct ndr_pull *ndr, int flags, struct lsa_AddPrivilegesToAccount *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_privs_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.privs); + } + _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.privs, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_PrivilegeSet(ndr, NDR_SCALARS, r->in.privs)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_AddPrivilegesToAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_AddPrivilegesToAccount *r) +{ + ndr_print_struct(ndr, name, "lsa_AddPrivilegesToAccount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_AddPrivilegesToAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "privs", r->in.privs); + ndr->depth++; + ndr_print_lsa_PrivilegeSet(ndr, "privs", r->in.privs); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_AddPrivilegesToAccount"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + if (r->in.privs) { + NDR_CHECK(ndr_push_lsa_PrivilegeSet(ndr, NDR_SCALARS, r->in.privs)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_RemovePrivilegesFromAccount(struct ndr_pull *ndr, int flags, struct lsa_RemovePrivilegesFromAccount *r) +{ + uint32_t _ptr_privs; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_privs_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.remove_all)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privs)); + if (_ptr_privs) { + NDR_PULL_ALLOC(ndr, r->in.privs); + } else { + r->in.privs = NULL; + } + if (r->in.privs) { + _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.privs, 0); + NDR_CHECK(ndr_pull_lsa_PrivilegeSet(ndr, NDR_SCALARS, r->in.privs)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_RemovePrivilegesFromAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RemovePrivilegesFromAccount *r) +{ + ndr_print_struct(ndr, name, "lsa_RemovePrivilegesFromAccount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_RemovePrivilegesFromAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint8(ndr, "remove_all", r->in.remove_all); + ndr_print_ptr(ndr, "privs", r->in.privs); + ndr->depth++; + if (r->in.privs) { + ndr_print_lsa_PrivilegeSet(ndr, "privs", r->in.privs); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_RemovePrivilegesFromAccount"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_GetQuotasForAccount(struct ndr_push *ndr, int flags, const struct lsa_GetQuotasForAccount *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_GetQuotasForAccount(struct ndr_pull *ndr, int flags, struct lsa_GetQuotasForAccount *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_GetQuotasForAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetQuotasForAccount *r) +{ + ndr_print_struct(ndr, name, "lsa_GetQuotasForAccount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_GetQuotasForAccount"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_GetQuotasForAccount"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_SetQuotasForAccount(struct ndr_push *ndr, int flags, const struct lsa_SetQuotasForAccount *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SetQuotasForAccount(struct ndr_pull *ndr, int flags, struct lsa_SetQuotasForAccount *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetQuotasForAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetQuotasForAccount *r) +{ + ndr_print_struct(ndr, name, "lsa_SetQuotasForAccount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetQuotasForAccount"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetQuotasForAccount"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_GetSystemAccessAccount(struct ndr_push *ndr, int flags, const struct lsa_GetSystemAccessAccount *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + } + if (flags & NDR_OUT) { + if (r->out.access_mask == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.access_mask)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_GetSystemAccessAccount(struct ndr_pull *ndr, int flags, struct lsa_GetSystemAccessAccount *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_access_mask_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.access_mask); + ZERO_STRUCTP(r->out.access_mask); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.access_mask); + } + _mem_save_access_mask_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.access_mask, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.access_mask)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_access_mask_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_GetSystemAccessAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetSystemAccessAccount *r) +{ + ndr_print_struct(ndr, name, "lsa_GetSystemAccessAccount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_GetSystemAccessAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_GetSystemAccessAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "access_mask", r->out.access_mask); + ndr->depth++; + ndr_print_uint32(ndr, "access_mask", *r->out.access_mask); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_SetSystemAccessAccount(struct ndr_push *ndr, int flags, const struct lsa_SetSystemAccessAccount *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SetSystemAccessAccount(struct ndr_pull *ndr, int flags, struct lsa_SetSystemAccessAccount *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetSystemAccessAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSystemAccessAccount *r) +{ + ndr_print_struct(ndr, name, "lsa_SetSystemAccessAccount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetSystemAccessAccount"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetSystemAccessAccount"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_OpenTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_OpenTrustedDomain *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_trustdom_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + ZERO_STRUCTP(r->out.trustdom_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + } + _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_OpenTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomain *r) +{ + ndr_print_struct(ndr, name, "lsa_OpenTrustedDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_OpenTrustedDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_OpenTrustedDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.trustdom_handle)); + NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_QueryTrustedDomainInfo(struct ndr_pull *ndr, int flags, struct lsa_QueryTrustedDomainInfo *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_trustdom_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.trustdom_handle); + } + _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.trustdom_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_QueryTrustedDomainInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_QueryTrustedDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "trustdom_handle", r->in.trustdom_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "trustdom_handle", r->in.trustdom_handle); + ndr->depth--; + ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_QueryTrustedDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_lsa_TrustedDomainInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_SetInformationTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_SetInformationTrustedDomain *r) +{ + if (flags & NDR_IN) { + 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, r->in.trustdom_handle)); + NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); + 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_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SetInformationTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_SetInformationTrustedDomain *r) +{ + TALLOC_CTX *_mem_save_trustdom_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.trustdom_handle); + } + _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.trustdom_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetInformationTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInformationTrustedDomain *r) +{ + ndr_print_struct(ndr, name, "lsa_SetInformationTrustedDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetInformationTrustedDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "trustdom_handle", r->in.trustdom_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "trustdom_handle", r->in.trustdom_handle); + ndr->depth--; + ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetInformationTrustedDomain"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.sec_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_OpenSecret(struct ndr_pull *ndr, int flags, struct lsa_OpenSecret *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sec_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.sec_handle); + ZERO_STRUCTP(r->out.sec_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sec_handle); + } + _mem_save_sec_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sec_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.sec_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_OpenSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenSecret *r) +{ + ndr_print_struct(ndr, name, "lsa_OpenSecret"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_OpenSecret"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_lsa_String(ndr, "name", &r->in.name); + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_OpenSecret"); + ndr->depth++; + ndr_print_ptr(ndr, "sec_handle", r->out.sec_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "sec_handle", r->out.sec_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.sec_handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_val)); + if (r->in.new_val) { + NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_val)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_val)); + if (r->in.old_val) { + NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.old_val)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_SetSecret(struct ndr_pull *ndr, int flags, struct lsa_SetSecret *r) +{ + uint32_t _ptr_new_val; + uint32_t _ptr_old_val; + TALLOC_CTX *_mem_save_sec_handle_0; + TALLOC_CTX *_mem_save_new_val_0; + TALLOC_CTX *_mem_save_old_val_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sec_handle); + } + _mem_save_sec_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sec_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.sec_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_val)); + if (_ptr_new_val) { + NDR_PULL_ALLOC(ndr, r->in.new_val); + } else { + r->in.new_val = NULL; + } + if (r->in.new_val) { + _mem_save_new_val_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_val, 0); + NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_val)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_val_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_val)); + if (_ptr_old_val) { + NDR_PULL_ALLOC(ndr, r->in.old_val); + } else { + r->in.old_val = NULL; + } + if (r->in.old_val) { + _mem_save_old_val_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.old_val, 0); + NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.old_val)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_val_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecret *r) +{ + ndr_print_struct(ndr, name, "lsa_SetSecret"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetSecret"); + ndr->depth++; + ndr_print_ptr(ndr, "sec_handle", r->in.sec_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "sec_handle", r->in.sec_handle); + ndr->depth--; + ndr_print_ptr(ndr, "new_val", r->in.new_val); + ndr->depth++; + if (r->in.new_val) { + ndr_print_lsa_DATA_BUF(ndr, "new_val", r->in.new_val); + } + ndr->depth--; + ndr_print_ptr(ndr, "old_val", r->in.old_val); + ndr->depth++; + if (r->in.old_val) { + ndr_print_lsa_DATA_BUF(ndr, "old_val", r->in.old_val); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetSecret"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.sec_handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_val)); + if (r->in.new_val) { + NDR_CHECK(ndr_push_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_val)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_mtime)); + if (r->in.new_mtime) { + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, *r->in.new_mtime)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_val)); + if (r->in.old_val) { + NDR_CHECK(ndr_push_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.old_val)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_mtime)); + if (r->in.old_mtime) { + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, *r->in.old_mtime)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.new_val)); + if (r->out.new_val) { + NDR_CHECK(ndr_push_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.new_val)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.new_mtime)); + if (r->out.new_mtime) { + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, *r->out.new_mtime)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.old_val)); + if (r->out.old_val) { + NDR_CHECK(ndr_push_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.old_val)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.old_mtime)); + if (r->out.old_mtime) { + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, *r->out.old_mtime)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_QuerySecret(struct ndr_pull *ndr, int flags, struct lsa_QuerySecret *r) +{ + uint32_t _ptr_new_val; + uint32_t _ptr_new_mtime; + uint32_t _ptr_old_val; + uint32_t _ptr_old_mtime; + TALLOC_CTX *_mem_save_sec_handle_0; + TALLOC_CTX *_mem_save_new_val_0; + TALLOC_CTX *_mem_save_new_mtime_0; + TALLOC_CTX *_mem_save_old_val_0; + TALLOC_CTX *_mem_save_old_mtime_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sec_handle); + } + _mem_save_sec_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sec_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.sec_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_val)); + if (_ptr_new_val) { + NDR_PULL_ALLOC(ndr, r->in.new_val); + } else { + r->in.new_val = NULL; + } + if (r->in.new_val) { + _mem_save_new_val_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_val, 0); + NDR_CHECK(ndr_pull_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_val)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_val_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_mtime)); + if (_ptr_new_mtime) { + NDR_PULL_ALLOC(ndr, r->in.new_mtime); + } else { + r->in.new_mtime = NULL; + } + if (r->in.new_mtime) { + _mem_save_new_mtime_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_mtime, 0); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, r->in.new_mtime)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_mtime_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_val)); + if (_ptr_old_val) { + NDR_PULL_ALLOC(ndr, r->in.old_val); + } else { + r->in.old_val = NULL; + } + if (r->in.old_val) { + _mem_save_old_val_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.old_val, 0); + NDR_CHECK(ndr_pull_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.old_val)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_val_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_mtime)); + if (_ptr_old_mtime) { + NDR_PULL_ALLOC(ndr, r->in.old_mtime); + } else { + r->in.old_mtime = NULL; + } + if (r->in.old_mtime) { + _mem_save_old_mtime_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.old_mtime, 0); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, r->in.old_mtime)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_mtime_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_val)); + if (_ptr_new_val) { + NDR_PULL_ALLOC(ndr, r->out.new_val); + } else { + r->out.new_val = NULL; + } + if (r->out.new_val) { + _mem_save_new_val_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.new_val, 0); + NDR_CHECK(ndr_pull_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.new_val)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_val_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_mtime)); + if (_ptr_new_mtime) { + NDR_PULL_ALLOC(ndr, r->out.new_mtime); + } else { + r->out.new_mtime = NULL; + } + if (r->out.new_mtime) { + _mem_save_new_mtime_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.new_mtime, 0); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, r->out.new_mtime)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_mtime_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_val)); + if (_ptr_old_val) { + NDR_PULL_ALLOC(ndr, r->out.old_val); + } else { + r->out.old_val = NULL; + } + if (r->out.old_val) { + _mem_save_old_val_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.old_val, 0); + NDR_CHECK(ndr_pull_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.old_val)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_val_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_mtime)); + if (_ptr_old_mtime) { + NDR_PULL_ALLOC(ndr, r->out.old_mtime); + } else { + r->out.old_mtime = NULL; + } + if (r->out.old_mtime) { + _mem_save_old_mtime_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.old_mtime, 0); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, r->out.old_mtime)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_mtime_0, 0); + } + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_QuerySecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecret *r) +{ + ndr_print_struct(ndr, name, "lsa_QuerySecret"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_QuerySecret"); + ndr->depth++; + ndr_print_ptr(ndr, "sec_handle", r->in.sec_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "sec_handle", r->in.sec_handle); + ndr->depth--; + ndr_print_ptr(ndr, "new_val", r->in.new_val); + ndr->depth++; + if (r->in.new_val) { + ndr_print_lsa_DATA_BUF_PTR(ndr, "new_val", r->in.new_val); + } + ndr->depth--; + ndr_print_ptr(ndr, "new_mtime", r->in.new_mtime); + ndr->depth++; + if (r->in.new_mtime) { + ndr_print_NTTIME_hyper(ndr, "new_mtime", *r->in.new_mtime); + } + ndr->depth--; + ndr_print_ptr(ndr, "old_val", r->in.old_val); + ndr->depth++; + if (r->in.old_val) { + ndr_print_lsa_DATA_BUF_PTR(ndr, "old_val", r->in.old_val); + } + ndr->depth--; + ndr_print_ptr(ndr, "old_mtime", r->in.old_mtime); + ndr->depth++; + if (r->in.old_mtime) { + ndr_print_NTTIME_hyper(ndr, "old_mtime", *r->in.old_mtime); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_QuerySecret"); + ndr->depth++; + ndr_print_ptr(ndr, "new_val", r->out.new_val); + ndr->depth++; + if (r->out.new_val) { + ndr_print_lsa_DATA_BUF_PTR(ndr, "new_val", r->out.new_val); + } + ndr->depth--; + ndr_print_ptr(ndr, "new_mtime", r->out.new_mtime); + ndr->depth++; + if (r->out.new_mtime) { + ndr_print_NTTIME_hyper(ndr, "new_mtime", *r->out.new_mtime); + } + ndr->depth--; + ndr_print_ptr(ndr, "old_val", r->out.old_val); + ndr->depth++; + if (r->out.old_val) { + ndr_print_lsa_DATA_BUF_PTR(ndr, "old_val", r->out.old_val); + } + ndr->depth--; + ndr_print_ptr(ndr, "old_mtime", r->out.old_mtime); + ndr->depth++; + if (r->out.old_mtime) { + ndr_print_NTTIME_hyper(ndr, "old_mtime", *r->out.old_mtime); + } + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LookupPrivValue(struct ndr_pull *ndr, int flags, struct lsa_LookupPrivValue *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_luid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.luid); + ZERO_STRUCTP(r->out.luid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.luid); + } + _mem_save_luid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.luid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, r->out.luid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_luid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupPrivValue(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivValue *r) +{ + ndr_print_struct(ndr, name, "lsa_LookupPrivValue"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupPrivValue"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", r->in.name); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupPrivValue"); + ndr->depth++; + ndr_print_ptr(ndr, "luid", r->out.luid); + ndr->depth++; + ndr_print_lsa_LUID(ndr, "luid", r->out.luid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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) { + if (r->out.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name)); + if (*r->out.name) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.name)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LookupPrivName(struct ndr_pull *ndr, int flags, struct lsa_LookupPrivName *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_luid_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_name_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.luid); + } + _mem_save_luid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.luid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, r->in.luid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_luid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.name); + ZERO_STRUCTP(r->out.name); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, *r->out.name); + } else { + *r->out.name = NULL; + } + if (*r->out.name) { + _mem_save_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.name, 0); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupPrivName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivName *r) +{ + ndr_print_struct(ndr, name, "lsa_LookupPrivName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupPrivName"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "luid", r->in.luid); + ndr->depth++; + ndr_print_lsa_LUID(ndr, "luid", r->in.luid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupPrivName"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->out.name); + ndr->depth++; + ndr_print_ptr(ndr, "name", *r->out.name); + ndr->depth++; + if (*r->out.name) { + ndr_print_lsa_StringLarge(ndr, "name", *r->out.name); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.language_id)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.language_id_sys)); + } + if (flags & NDR_OUT) { + if (r->out.disp_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.disp_name)); + if (*r->out.disp_name) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.disp_name)); + } + if (r->out.returned_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.returned_language_id)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LookupPrivDisplayName(struct ndr_pull *ndr, int flags, struct lsa_LookupPrivDisplayName *r) +{ + uint32_t _ptr_disp_name; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_disp_name_0; + TALLOC_CTX *_mem_save_disp_name_1; + TALLOC_CTX *_mem_save_returned_language_id_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.language_id)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.language_id_sys)); + NDR_PULL_ALLOC(ndr, r->out.disp_name); + ZERO_STRUCTP(r->out.disp_name); + NDR_PULL_ALLOC(ndr, r->out.returned_language_id); + ZERO_STRUCTP(r->out.returned_language_id); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.disp_name); + } + _mem_save_disp_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.disp_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_disp_name)); + if (_ptr_disp_name) { + NDR_PULL_ALLOC(ndr, *r->out.disp_name); + } else { + *r->out.disp_name = NULL; + } + if (*r->out.disp_name) { + _mem_save_disp_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.disp_name, 0); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.disp_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disp_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disp_name_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.returned_language_id); + } + _mem_save_returned_language_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_language_id, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.returned_language_id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_language_id_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupPrivDisplayName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivDisplayName *r) +{ + ndr_print_struct(ndr, name, "lsa_LookupPrivDisplayName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupPrivDisplayName"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", r->in.name); + ndr->depth--; + ndr_print_uint16(ndr, "language_id", r->in.language_id); + ndr_print_uint16(ndr, "language_id_sys", r->in.language_id_sys); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupPrivDisplayName"); + ndr->depth++; + ndr_print_ptr(ndr, "disp_name", r->out.disp_name); + ndr->depth++; + ndr_print_ptr(ndr, "disp_name", *r->out.disp_name); + ndr->depth++; + if (*r->out.disp_name) { + ndr_print_lsa_StringLarge(ndr, "disp_name", *r->out.disp_name); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "returned_language_id", r->out.returned_language_id); + ndr->depth++; + ndr_print_uint16(ndr, "returned_language_id", *r->out.returned_language_id); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_DeleteObject(struct ndr_push *ndr, int flags, const struct lsa_DeleteObject *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DeleteObject(struct ndr_pull *ndr, int flags, struct lsa_DeleteObject *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.handle); + *r->out.handle = *r->in.handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DeleteObject(struct ndr_print *ndr, const char *name, int flags, const struct lsa_DeleteObject *r) +{ + ndr_print_struct(ndr, name, "lsa_DeleteObject"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_DeleteObject"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_DeleteObject"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.name)); + if (r->in.name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + } + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_EnumAccountsWithUserRight(struct ndr_pull *ndr, int flags, struct lsa_EnumAccountsWithUserRight *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->in.name); + } else { + r->in.name = NULL; + } + if (r->in.name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.sids); + ZERO_STRUCTP(r->out.sids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_EnumAccountsWithUserRight(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccountsWithUserRight *r) +{ + ndr_print_struct(ndr, name, "lsa_EnumAccountsWithUserRight"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_EnumAccountsWithUserRight"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + if (r->in.name) { + ndr_print_lsa_String(ndr, "name", r->in.name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_EnumAccountsWithUserRight"); + ndr->depth++; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_EnumAccountRights(struct ndr_pull *ndr, int flags, struct lsa_EnumAccountRights *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_rights_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.rights); + ZERO_STRUCTP(r->out.rights); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rights); + } + _mem_save_rights_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rights, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rights)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rights_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_EnumAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccountRights *r) +{ + ndr_print_struct(ndr, name, "lsa_EnumAccountRights"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_EnumAccountRights"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_EnumAccountRights"); + ndr->depth++; + ndr_print_ptr(ndr, "rights", r->out.rights); + ndr->depth++; + ndr_print_lsa_RightSet(ndr, "rights", r->out.rights); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_AddAccountRights(struct ndr_pull *ndr, int flags, struct lsa_AddAccountRights *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_rights_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.rights); + } + _mem_save_rights_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.rights, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.rights)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rights_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_AddAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_AddAccountRights *r) +{ + ndr_print_struct(ndr, name, "lsa_AddAccountRights"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_AddAccountRights"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr_print_ptr(ndr, "rights", r->in.rights); + ndr->depth++; + ndr_print_lsa_RightSet(ndr, "rights", r->in.rights); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_AddAccountRights"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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_uint8(ndr, NDR_SCALARS, r->in.remove_all)); + 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) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_RemoveAccountRights(struct ndr_pull *ndr, int flags, struct lsa_RemoveAccountRights *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_rights_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.remove_all)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.rights); + } + _mem_save_rights_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.rights, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.rights)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rights_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_RemoveAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RemoveAccountRights *r) +{ + ndr_print_struct(ndr, name, "lsa_RemoveAccountRights"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_RemoveAccountRights"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr_print_uint8(ndr, "remove_all", r->in.remove_all); + ndr_print_ptr(ndr, "rights", r->in.rights); + ndr->depth++; + ndr_print_lsa_RightSet(ndr, "rights", r->in.rights); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_RemoveAccountRights"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_QueryTrustedDomainInfoBySid(struct ndr_pull *ndr, int flags, struct lsa_QueryTrustedDomainInfoBySid *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_dom_sid_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.dom_sid); + } + _mem_save_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfoBySid(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfoBySid *r) +{ + ndr_print_struct(ndr, name, "lsa_QueryTrustedDomainInfoBySid"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_QueryTrustedDomainInfoBySid"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "dom_sid", r->in.dom_sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "dom_sid", r->in.dom_sid); + ndr->depth--; + ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_QueryTrustedDomainInfoBySid"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_lsa_TrustedDomainInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_SetTrustedDomainInfo(struct ndr_push *ndr, int flags, const struct lsa_SetTrustedDomainInfo *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + 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)); + 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_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SetTrustedDomainInfo(struct ndr_pull *ndr, int flags, struct lsa_SetTrustedDomainInfo *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_dom_sid_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.dom_sid); + } + _mem_save_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetTrustedDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetTrustedDomainInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_SetTrustedDomainInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetTrustedDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "dom_sid", r->in.dom_sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "dom_sid", r->in.dom_sid); + ndr->depth--; + ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetTrustedDomainInfo"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_DeleteTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_DeleteTrustedDomain *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_dom_sid_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.dom_sid); + } + _mem_save_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_sid_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_DeleteTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_DeleteTrustedDomain *r) +{ + ndr_print_struct(ndr, name, "lsa_DeleteTrustedDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_DeleteTrustedDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "dom_sid", r->in.dom_sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "dom_sid", r->in.dom_sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_DeleteTrustedDomain"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_StorePrivateData(struct ndr_push *ndr, int flags, const struct lsa_StorePrivateData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_StorePrivateData(struct ndr_pull *ndr, int flags, struct lsa_StorePrivateData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_StorePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_StorePrivateData *r) +{ + ndr_print_struct(ndr, name, "lsa_StorePrivateData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_StorePrivateData"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_StorePrivateData"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_RetrievePrivateData(struct ndr_push *ndr, int flags, const struct lsa_RetrievePrivateData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_RetrievePrivateData(struct ndr_pull *ndr, int flags, struct lsa_RetrievePrivateData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_RetrievePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RetrievePrivateData *r) +{ + ndr_print_struct(ndr, name, "lsa_RetrievePrivateData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_RetrievePrivateData"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_RetrievePrivateData"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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 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_lsa_PolicyAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_OpenPolicy2(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy2 *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_attr_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.attr); + } + _mem_save_attr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.attr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_PolicyAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_OpenPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy2 *r) +{ + ndr_print_struct(ndr, name, "lsa_OpenPolicy2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_OpenPolicy2"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "attr", r->in.attr); + ndr->depth++; + ndr_print_lsa_ObjectAttribute(ndr, "attr", r->in.attr); + ndr->depth--; + ndr_print_lsa_PolicyAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_OpenPolicy2"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_GetUserName(struct ndr_push *ndr, int flags, const struct lsa_GetUserName *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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.account_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.account_name)); + if (*r->in.account_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.account_name)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.authority_name)); + if (r->in.authority_name) { + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.authority_name)); + if (*r->in.authority_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.authority_name)); + } + } + } + if (flags & NDR_OUT) { + if (r->out.account_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.account_name)); + if (*r->out.account_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.account_name)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.authority_name)); + if (r->out.authority_name) { + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.authority_name)); + if (*r->out.authority_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.authority_name)); + } + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_GetUserName(struct ndr_pull *ndr, int flags, struct lsa_GetUserName *r) +{ + uint32_t _ptr_system_name; + uint32_t _ptr_account_name; + uint32_t _ptr_authority_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_account_name_0; + TALLOC_CTX *_mem_save_account_name_1; + TALLOC_CTX *_mem_save_authority_name_0; + TALLOC_CTX *_mem_save_authority_name_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account_name); + } + _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name)); + if (_ptr_account_name) { + NDR_PULL_ALLOC(ndr, *r->in.account_name); + } else { + *r->in.account_name = NULL; + } + if (*r->in.account_name) { + _mem_save_account_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.account_name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.account_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); + if (_ptr_authority_name) { + NDR_PULL_ALLOC(ndr, r->in.authority_name); + } else { + r->in.authority_name = NULL; + } + if (r->in.authority_name) { + _mem_save_authority_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.authority_name, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); + if (_ptr_authority_name) { + NDR_PULL_ALLOC(ndr, *r->in.authority_name); + } else { + *r->in.authority_name = NULL; + } + if (*r->in.authority_name) { + _mem_save_authority_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.authority_name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.authority_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.account_name); + *r->out.account_name = *r->in.account_name; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.account_name); + } + _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.account_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name)); + if (_ptr_account_name) { + NDR_PULL_ALLOC(ndr, *r->out.account_name); + } else { + *r->out.account_name = NULL; + } + if (*r->out.account_name) { + _mem_save_account_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.account_name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.account_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); + if (_ptr_authority_name) { + NDR_PULL_ALLOC(ndr, r->out.authority_name); + } else { + r->out.authority_name = NULL; + } + if (r->out.authority_name) { + _mem_save_authority_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.authority_name, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); + if (_ptr_authority_name) { + NDR_PULL_ALLOC(ndr, *r->out.authority_name); + } else { + *r->out.authority_name = NULL; + } + if (*r->out.authority_name) { + _mem_save_authority_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.authority_name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.authority_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_0, 0); + } + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_GetUserName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetUserName *r) +{ + ndr_print_struct(ndr, name, "lsa_GetUserName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_GetUserName"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "account_name", r->in.account_name); + ndr->depth++; + ndr_print_ptr(ndr, "account_name", *r->in.account_name); + ndr->depth++; + if (*r->in.account_name) { + ndr_print_lsa_String(ndr, "account_name", *r->in.account_name); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "authority_name", r->in.authority_name); + ndr->depth++; + if (r->in.authority_name) { + ndr_print_ptr(ndr, "authority_name", *r->in.authority_name); + ndr->depth++; + if (*r->in.authority_name) { + ndr_print_lsa_String(ndr, "authority_name", *r->in.authority_name); + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_GetUserName"); + ndr->depth++; + ndr_print_ptr(ndr, "account_name", r->out.account_name); + ndr->depth++; + ndr_print_ptr(ndr, "account_name", *r->out.account_name); + ndr->depth++; + if (*r->out.account_name) { + ndr_print_lsa_String(ndr, "account_name", *r->out.account_name); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "authority_name", r->out.authority_name); + ndr->depth++; + if (r->out.authority_name) { + ndr_print_ptr(ndr, "authority_name", *r->out.authority_name); + ndr->depth++; + if (*r->out.authority_name) { + ndr_print_lsa_String(ndr, "authority_name", *r->out.authority_name); + } + ndr->depth--; + } + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_QueryInfoPolicy2(struct ndr_pull *ndr, int flags, struct lsa_QueryInfoPolicy2 *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_PolicyInfo(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_QueryInfoPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy2 *r) +{ + ndr_print_struct(ndr, name, "lsa_QueryInfoPolicy2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_QueryInfoPolicy2"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_lsa_PolicyInfo(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_QueryInfoPolicy2"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_lsa_PolicyInformation(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_SetInfoPolicy2(struct ndr_push *ndr, int flags, const struct lsa_SetInfoPolicy2 *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); + 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_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SetInfoPolicy2(struct ndr_pull *ndr, int flags, struct lsa_SetInfoPolicy2 *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_PolicyInfo(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetInfoPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInfoPolicy2 *r) +{ + ndr_print_struct(ndr, name, "lsa_SetInfoPolicy2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetInfoPolicy2"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_lsa_PolicyInfo(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_lsa_PolicyInformation(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetInfoPolicy2"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + if (r->in.trusted_domain == 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.trusted_domain)); + NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_QueryTrustedDomainInfoByName(struct ndr_pull *ndr, int flags, struct lsa_QueryTrustedDomainInfoByName *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_trusted_domain_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.trusted_domain); + } + _mem_save_trusted_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.trusted_domain)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfoByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfoByName *r) +{ + ndr_print_struct(ndr, name, "lsa_QueryTrustedDomainInfoByName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_QueryTrustedDomainInfoByName"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "trusted_domain", r->in.trusted_domain); + ndr->depth++; + ndr_print_lsa_String(ndr, "trusted_domain", r->in.trusted_domain); + ndr->depth--; + ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_QueryTrustedDomainInfoByName"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_lsa_TrustedDomainInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); + if (r->in.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SetTrustedDomainInfoByName(struct ndr_pull *ndr, int flags, struct lsa_SetTrustedDomainInfoByName *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.trusted_domain)); + NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->in.info); + } else { + r->in.info = NULL; + } + if (r->in.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetTrustedDomainInfoByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetTrustedDomainInfoByName *r) +{ + ndr_print_struct(ndr, name, "lsa_SetTrustedDomainInfoByName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetTrustedDomainInfoByName"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_lsa_String(ndr, "trusted_domain", &r->in.trusted_domain); + ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + if (r->in.info) { + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->in.info); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetTrustedDomainInfoByName"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_EnumTrustedDomainsEx(struct ndr_pull *ndr, int flags, struct lsa_EnumTrustedDomainsEx *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_domains_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_DomainListEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_EnumTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumTrustedDomainsEx *r) +{ + ndr_print_struct(ndr, name, "lsa_EnumTrustedDomainsEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_EnumTrustedDomainsEx"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_uint32(ndr, "max_size", r->in.max_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_EnumTrustedDomainsEx"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "domains", r->out.domains); + ndr->depth++; + ndr_print_lsa_DomainListEx(ndr, "domains", r->out.domains); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CreateTrustedDomainEx(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomainEx *r) +{ + if (flags & NDR_IN) { + if (r->in.policy_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + if (r->in.auth_info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.trustdom_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CreateTrustedDomainEx(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomainEx *r) +{ + TALLOC_CTX *_mem_save_policy_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_auth_info_0; + TALLOC_CTX *_mem_save_trustdom_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.policy_handle); + } + _mem_save_policy_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.policy_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.auth_info); + } + _mem_save_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.auth_info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + ZERO_STRUCTP(r->out.trustdom_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + } + _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CreateTrustedDomainEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomainEx *r) +{ + ndr_print_struct(ndr, name, "lsa_CreateTrustedDomainEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CreateTrustedDomainEx"); + ndr->depth++; + ndr_print_ptr(ndr, "policy_handle", r->in.policy_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "policy_handle", r->in.policy_handle); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_ptr(ndr, "auth_info", r->in.auth_info); + ndr->depth++; + ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info", r->in.auth_info); + ndr->depth--; + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CreateTrustedDomainEx"); + ndr->depth++; + ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CloseTrustedDomainEx(struct ndr_pull *ndr, int flags, struct lsa_CloseTrustedDomainEx *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.handle); + *r->out.handle = *r->in.handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CloseTrustedDomainEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CloseTrustedDomainEx *r) +{ + ndr_print_struct(ndr, name, "lsa_CloseTrustedDomainEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CloseTrustedDomainEx"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CloseTrustedDomainEx"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_DomainInformationPolicy(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_QueryDomainInformationPolicy(struct ndr_pull *ndr, int flags, struct lsa_QueryDomainInformationPolicy *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_DomainInformationPolicy(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_QueryDomainInformationPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryDomainInformationPolicy *r) +{ + ndr_print_struct(ndr, name, "lsa_QueryDomainInformationPolicy"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_QueryDomainInformationPolicy"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_QueryDomainInformationPolicy"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_lsa_DomainInformationPolicy(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); + if (r->in.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_DomainInformationPolicy(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_SetDomainInformationPolicy(struct ndr_pull *ndr, int flags, struct lsa_SetDomainInformationPolicy *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->in.info); + } else { + r->in.info = NULL; + } + if (r->in.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_DomainInformationPolicy(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_SetDomainInformationPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetDomainInformationPolicy *r) +{ + ndr_print_struct(ndr, name, "lsa_SetDomainInformationPolicy"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_SetDomainInformationPolicy"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + if (r->in.info) { + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_lsa_DomainInformationPolicy(ndr, "info", r->in.info); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_SetDomainInformationPolicy"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_OpenTrustedDomainByName(struct ndr_pull *ndr, int flags, struct lsa_OpenTrustedDomainByName *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_trustdom_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + ZERO_STRUCTP(r->out.trustdom_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + } + _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_OpenTrustedDomainByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomainByName *r) +{ + ndr_print_struct(ndr, name, "lsa_OpenTrustedDomainByName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_OpenTrustedDomainByName"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_lsa_String(ndr, "name", &r->in.name); + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_OpenTrustedDomainByName"); + ndr->depth++; + ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_TestCall(struct ndr_push *ndr, int flags, const struct lsa_TestCall *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_TestCall(struct ndr_pull *ndr, int flags, struct lsa_TestCall *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct lsa_TestCall *r) +{ + ndr_print_struct(ndr, name, "lsa_TestCall"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_TestCall"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_TestCall"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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 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)); + } + if (flags & NDR_OUT) { + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + } + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupSids2(struct ndr_pull *ndr, int flags, struct lsa_LookupSids2 *r) +{ + uint32_t _ptr_domains; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_count_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.names); + } + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.names, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.names)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); + NDR_PULL_ALLOC(ndr, r->out.names); + *r->out.names = *r->in.names; + NDR_PULL_ALLOC(ndr, r->out.count); + *r->out.count = *r->in.count; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, *r->out.domains); + } else { + *r->out.domains = NULL; + } + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.names); + } + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupSids2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids2 *r) +{ + ndr_print_struct(ndr, name, "lsa_LookupSids2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupSids2"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr_print_ptr(ndr, "names", r->in.names); + ndr->depth++; + ndr_print_lsa_TransNameArray2(ndr, "names", r->in.names); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "count", r->in.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->in.count); + ndr->depth--; + ndr_print_uint32(ndr, "unknown1", r->in.unknown1); + ndr_print_uint32(ndr, "unknown2", r->in.unknown2); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupSids2"); + ndr->depth++; + ndr_print_ptr(ndr, "domains", r->out.domains); + ndr->depth++; + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "names", r->out.names); + ndr->depth++; + ndr_print_lsa_TransNameArray2(ndr, "names", r->out.names); + ndr->depth--; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const struct lsa_LookupNames2 *r) +{ + uint32_t cntr_names_0; + if (flags & NDR_IN) { + 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, 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)); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + 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 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_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); + 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.lookup_options)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.client_revision)); + } + if (flags & NDR_OUT) { + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + } + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int flags, struct lsa_LookupNames2 *r) +{ + uint32_t cntr_names_0; + uint32_t _ptr_domains; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_count_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); + if (r->in.num_names < 0 || r->in.num_names > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); + NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransSidArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.lookup_options)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_revision)); + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); + NDR_PULL_ALLOC(ndr, r->out.sids); + *r->out.sids = *r->in.sids; + NDR_PULL_ALLOC(ndr, r->out.count); + *r->out.count = *r->in.count; + if (r->in.names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, r->in.num_names)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, *r->out.domains); + } else { + *r->out.domains = NULL; + } + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransSidArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames2 *r) +{ + uint32_t cntr_names_0; + ndr_print_struct(ndr, name, "lsa_LookupNames2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupNames2"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "num_names", r->in.num_names); + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); + ndr->depth++; + for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { + ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_TransSidArray2(ndr, "sids", r->in.sids); + ndr->depth--; + ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "count", r->in.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->in.count); + ndr->depth--; + ndr_print_uint32(ndr, "lookup_options", r->in.lookup_options); + ndr_print_uint32(ndr, "client_revision", r->in.client_revision); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupNames2"); + ndr->depth++; + ndr_print_ptr(ndr, "domains", r->out.domains); + ndr->depth++; + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_lsa_TransSidArray2(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CreateTrustedDomainEx2(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomainEx2 *r) +{ + if (flags & NDR_IN) { + if (r->in.policy_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + if (r->in.auth_info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.trustdom_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CreateTrustedDomainEx2(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomainEx2 *r) +{ + TALLOC_CTX *_mem_save_policy_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_auth_info_0; + TALLOC_CTX *_mem_save_trustdom_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.policy_handle); + } + _mem_save_policy_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.policy_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.auth_info); + } + _mem_save_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.auth_info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + ZERO_STRUCTP(r->out.trustdom_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); + } + _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CreateTrustedDomainEx2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomainEx2 *r) +{ + ndr_print_struct(ndr, name, "lsa_CreateTrustedDomainEx2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CreateTrustedDomainEx2"); + ndr->depth++; + ndr_print_ptr(ndr, "policy_handle", r->in.policy_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "policy_handle", r->in.policy_handle); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_ptr(ndr, "auth_info", r->in.auth_info); + ndr->depth++; + ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info", r->in.auth_info); + ndr->depth--; + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CreateTrustedDomainEx2"); + ndr->depth++; + ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRWRITE(struct ndr_push *ndr, int flags, const struct lsa_CREDRWRITE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRWRITE(struct ndr_pull *ndr, int flags, struct lsa_CREDRWRITE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRWRITE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRWRITE *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRWRITE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRWRITE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRWRITE"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRREAD(struct ndr_push *ndr, int flags, const struct lsa_CREDRREAD *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRREAD(struct ndr_pull *ndr, int flags, struct lsa_CREDRREAD *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRREAD(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRREAD *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRREAD"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRREAD"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRREAD"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRENUMERATE(struct ndr_push *ndr, int flags, const struct lsa_CREDRENUMERATE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRENUMERATE(struct ndr_pull *ndr, int flags, struct lsa_CREDRENUMERATE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRENUMERATE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRENUMERATE *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRENUMERATE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRENUMERATE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRENUMERATE"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRWRITEDOMAINCREDENTIALS(struct ndr_push *ndr, int flags, const struct lsa_CREDRWRITEDOMAINCREDENTIALS *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRWRITEDOMAINCREDENTIALS(struct ndr_pull *ndr, int flags, struct lsa_CREDRWRITEDOMAINCREDENTIALS *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRWRITEDOMAINCREDENTIALS(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRWRITEDOMAINCREDENTIALS *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRWRITEDOMAINCREDENTIALS"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRWRITEDOMAINCREDENTIALS"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRWRITEDOMAINCREDENTIALS"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRREADDOMAINCREDENTIALS(struct ndr_push *ndr, int flags, const struct lsa_CREDRREADDOMAINCREDENTIALS *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRREADDOMAINCREDENTIALS(struct ndr_pull *ndr, int flags, struct lsa_CREDRREADDOMAINCREDENTIALS *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRREADDOMAINCREDENTIALS(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRREADDOMAINCREDENTIALS *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRREADDOMAINCREDENTIALS"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRREADDOMAINCREDENTIALS"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRREADDOMAINCREDENTIALS"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRDELETE(struct ndr_push *ndr, int flags, const struct lsa_CREDRDELETE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRDELETE(struct ndr_pull *ndr, int flags, struct lsa_CREDRDELETE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRDELETE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRDELETE *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRDELETE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRDELETE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRDELETE"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRGETTARGETINFO(struct ndr_push *ndr, int flags, const struct lsa_CREDRGETTARGETINFO *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRGETTARGETINFO(struct ndr_pull *ndr, int flags, struct lsa_CREDRGETTARGETINFO *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRGETTARGETINFO(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETTARGETINFO *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRGETTARGETINFO"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRGETTARGETINFO"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRGETTARGETINFO"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRPROFILELOADED(struct ndr_push *ndr, int flags, const struct lsa_CREDRPROFILELOADED *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRPROFILELOADED(struct ndr_pull *ndr, int flags, struct lsa_CREDRPROFILELOADED *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRPROFILELOADED(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRPROFILELOADED *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRPROFILELOADED"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRPROFILELOADED"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRPROFILELOADED"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const struct lsa_LookupNames3 *r) +{ + uint32_t cntr_names_0; + if (flags & NDR_IN) { + 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, 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)); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + 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 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_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); + 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.lookup_options)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.client_revision)); + } + if (flags & NDR_OUT) { + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + } + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int flags, struct lsa_LookupNames3 *r) +{ + uint32_t cntr_names_0; + uint32_t _ptr_domains; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_count_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); + if (r->in.num_names < 0 || r->in.num_names > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); + NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.lookup_options)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_revision)); + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); + NDR_PULL_ALLOC(ndr, r->out.sids); + *r->out.sids = *r->in.sids; + NDR_PULL_ALLOC(ndr, r->out.count); + *r->out.count = *r->in.count; + if (r->in.names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, r->in.num_names)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, *r->out.domains); + } else { + *r->out.domains = NULL; + } + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupNames3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames3 *r) +{ + uint32_t cntr_names_0; + ndr_print_struct(ndr, name, "lsa_LookupNames3"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupNames3"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "num_names", r->in.num_names); + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); + ndr->depth++; + for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { + ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_TransSidArray3(ndr, "sids", r->in.sids); + ndr->depth--; + ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "count", r->in.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->in.count); + ndr->depth--; + ndr_print_uint32(ndr, "lookup_options", r->in.lookup_options); + ndr_print_uint32(ndr, "client_revision", r->in.client_revision); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupNames3"); + ndr->depth++; + ndr_print_ptr(ndr, "domains", r->out.domains); + ndr->depth++; + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_lsa_TransSidArray3(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRGETSESSIONTYPES(struct ndr_push *ndr, int flags, const struct lsa_CREDRGETSESSIONTYPES *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRGETSESSIONTYPES(struct ndr_pull *ndr, int flags, struct lsa_CREDRGETSESSIONTYPES *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRGETSESSIONTYPES(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETSESSIONTYPES *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRGETSESSIONTYPES"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRGETSESSIONTYPES"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRGETSESSIONTYPES"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LSARREGISTERAUDITEVENT(struct ndr_push *ndr, int flags, const struct lsa_LSARREGISTERAUDITEVENT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LSARREGISTERAUDITEVENT(struct ndr_pull *ndr, int flags, struct lsa_LSARREGISTERAUDITEVENT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LSARREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARREGISTERAUDITEVENT *r) +{ + ndr_print_struct(ndr, name, "lsa_LSARREGISTERAUDITEVENT"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LSARREGISTERAUDITEVENT"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LSARREGISTERAUDITEVENT"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LSARGENAUDITEVENT(struct ndr_push *ndr, int flags, const struct lsa_LSARGENAUDITEVENT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LSARGENAUDITEVENT(struct ndr_pull *ndr, int flags, struct lsa_LSARGENAUDITEVENT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LSARGENAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARGENAUDITEVENT *r) +{ + ndr_print_struct(ndr, name, "lsa_LSARGENAUDITEVENT"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LSARGENAUDITEVENT"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LSARGENAUDITEVENT"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_push *ndr, int flags, const struct lsa_LSARUNREGISTERAUDITEVENT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_pull *ndr, int flags, struct lsa_LSARUNREGISTERAUDITEVENT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARUNREGISTERAUDITEVENT *r) +{ + ndr_print_struct(ndr, name, "lsa_LSARUNREGISTERAUDITEVENT"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LSARUNREGISTERAUDITEVENT"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LSARUNREGISTERAUDITEVENT"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_lsaRQueryForestTrustInformation(struct ndr_push *ndr, int flags, const struct lsa_lsaRQueryForestTrustInformation *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + if (r->in.trusted_domain_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.trusted_domain_name)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.unknown)); + } + if (flags & NDR_OUT) { + if (r->out.forest_trust_info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info)); + if (*r->out.forest_trust_info) { + NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_lsaRQueryForestTrustInformation(struct ndr_pull *ndr, int flags, struct lsa_lsaRQueryForestTrustInformation *r) +{ + uint32_t _ptr_forest_trust_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_trusted_domain_name_0; + TALLOC_CTX *_mem_save_forest_trust_info_0; + TALLOC_CTX *_mem_save_forest_trust_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.trusted_domain_name); + } + _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.trusted_domain_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + ZERO_STRUCTP(r->out.forest_trust_info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + } + _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info)); + if (_ptr_forest_trust_info) { + NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info); + } else { + *r->out.forest_trust_info = NULL; + } + if (*r->out.forest_trust_info) { + _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0); + NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_lsaRQueryForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct lsa_lsaRQueryForestTrustInformation *r) +{ + ndr_print_struct(ndr, name, "lsa_lsaRQueryForestTrustInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_lsaRQueryForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth--; + ndr_print_uint16(ndr, "unknown", r->in.unknown); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_lsaRQueryForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info); + ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info); + ndr->depth++; + if (*r->out.forest_trust_info) { + ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LSARSETFORESTTRUSTINFORMATION(struct ndr_push *ndr, int flags, const struct lsa_LSARSETFORESTTRUSTINFORMATION *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LSARSETFORESTTRUSTINFORMATION(struct ndr_pull *ndr, int flags, struct lsa_LSARSETFORESTTRUSTINFORMATION *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LSARSETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARSETFORESTTRUSTINFORMATION *r) +{ + ndr_print_struct(ndr, name, "lsa_LSARSETFORESTTRUSTINFORMATION"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LSARSETFORESTTRUSTINFORMATION"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LSARSETFORESTTRUSTINFORMATION"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_CREDRRENAME(struct ndr_push *ndr, int flags, const struct lsa_CREDRRENAME *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_CREDRRENAME(struct ndr_pull *ndr, int flags, struct lsa_CREDRRENAME *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_CREDRRENAME(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRRENAME *r) +{ + ndr_print_struct(ndr, name, "lsa_CREDRRENAME"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_CREDRRENAME"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_CREDRRENAME"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 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 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 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)); + } + if (flags & NDR_OUT) { + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + } + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupSids3(struct ndr_pull *ndr, int flags, struct lsa_LookupSids3 *r) +{ + uint32_t _ptr_domains; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_count_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.names); + } + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.names, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.names)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); + NDR_PULL_ALLOC(ndr, r->out.names); + *r->out.names = *r->in.names; + NDR_PULL_ALLOC(ndr, r->out.count); + *r->out.count = *r->in.count; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, *r->out.domains); + } else { + *r->out.domains = NULL; + } + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.names); + } + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupSids3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids3 *r) +{ + ndr_print_struct(ndr, name, "lsa_LookupSids3"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupSids3"); + ndr->depth++; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr_print_ptr(ndr, "names", r->in.names); + ndr->depth++; + ndr_print_lsa_TransNameArray2(ndr, "names", r->in.names); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "count", r->in.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->in.count); + ndr->depth--; + ndr_print_uint32(ndr, "unknown1", r->in.unknown1); + ndr_print_uint32(ndr, "unknown2", r->in.unknown2); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupSids3"); + ndr->depth++; + ndr_print_ptr(ndr, "domains", r->out.domains); + ndr->depth++; + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "names", r->out.names); + ndr->depth++; + ndr_print_lsa_TransNameArray2(ndr, "names", r->out.names); + ndr->depth--; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LookupNames4(struct ndr_push *ndr, int flags, const struct lsa_LookupNames4 *r) +{ + uint32_t cntr_names_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + 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 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_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); + 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.lookup_options)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.client_revision)); + } + if (flags & NDR_OUT) { + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + } + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LookupNames4(struct ndr_pull *ndr, int flags, struct lsa_LookupNames4 *r) +{ + uint32_t cntr_names_0; + uint32_t _ptr_domains; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_count_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); + if (r->in.num_names < 0 || r->in.num_names > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); + NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.lookup_options)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_revision)); + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); + NDR_PULL_ALLOC(ndr, r->out.sids); + *r->out.sids = *r->in.sids; + NDR_PULL_ALLOC(ndr, r->out.count); + *r->out.count = *r->in.count; + if (r->in.names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, r->in.num_names)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); + if (_ptr_domains) { + NDR_PULL_ALLOC(ndr, *r->out.domains); + } else { + *r->out.domains = NULL; + } + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupNames4(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames4 *r) +{ + uint32_t cntr_names_0; + ndr_print_struct(ndr, name, "lsa_LookupNames4"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LookupNames4"); + ndr->depth++; + ndr_print_uint32(ndr, "num_names", r->in.num_names); + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); + ndr->depth++; + for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { + ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_TransSidArray3(ndr, "sids", r->in.sids); + ndr->depth--; + ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "count", r->in.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->in.count); + ndr->depth--; + ndr_print_uint32(ndr, "lookup_options", r->in.lookup_options); + ndr_print_uint32(ndr, "client_revision", r->in.client_revision); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LookupNames4"); + ndr->depth++; + ndr_print_ptr(ndr, "domains", r->out.domains); + ndr->depth++; + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_lsa_TransSidArray3(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LSAROPENPOLICYSCE(struct ndr_push *ndr, int flags, const struct lsa_LSAROPENPOLICYSCE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LSAROPENPOLICYSCE(struct ndr_pull *ndr, int flags, struct lsa_LSAROPENPOLICYSCE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LSAROPENPOLICYSCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSAROPENPOLICYSCE *r) +{ + ndr_print_struct(ndr, name, "lsa_LSAROPENPOLICYSCE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LSAROPENPOLICYSCE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LSAROPENPOLICYSCE"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct ndr_push *ndr, int flags, const struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct ndr_pull *ndr, int flags, struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r) +{ + ndr_print_struct(ndr, name, "lsa_LSARADTREGISTERSECURITYEVENTSOURCE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LSARADTREGISTERSECURITYEVENTSOURCE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LSARADTREGISTERSECURITYEVENTSOURCE"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct ndr_push *ndr, int flags, const struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct ndr_pull *ndr, int flags, struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r) +{ + ndr_print_struct(ndr, name, "lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_LSARADTREPORTSECURITYEVENT(struct ndr_push *ndr, int flags, const struct lsa_LSARADTREPORTSECURITYEVENT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LSARADTREPORTSECURITYEVENT(struct ndr_pull *ndr, int flags, struct lsa_LSARADTREPORTSECURITYEVENT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LSARADTREPORTSECURITYEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTREPORTSECURITYEVENT *r) +{ + ndr_print_struct(ndr, name, "lsa_LSARADTREPORTSECURITYEVENT"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "lsa_LSARADTREPORTSECURITYEVENT"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "lsa_LSARADTREPORTSECURITYEVENT"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call lsarpc_calls[] = { + { + "lsa_Close", + sizeof(struct lsa_Close), + (ndr_push_flags_fn_t) ndr_push_lsa_Close, + (ndr_pull_flags_fn_t) ndr_pull_lsa_Close, + (ndr_print_function_t) ndr_print_lsa_Close, + false, + }, + { + "lsa_Delete", + sizeof(struct lsa_Delete), + (ndr_push_flags_fn_t) ndr_push_lsa_Delete, + (ndr_pull_flags_fn_t) ndr_pull_lsa_Delete, + (ndr_print_function_t) ndr_print_lsa_Delete, + false, + }, + { + "lsa_EnumPrivs", + sizeof(struct lsa_EnumPrivs), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumPrivs, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumPrivs, + (ndr_print_function_t) ndr_print_lsa_EnumPrivs, + false, + }, + { + "lsa_QuerySecurity", + sizeof(struct lsa_QuerySecurity), + (ndr_push_flags_fn_t) ndr_push_lsa_QuerySecurity, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QuerySecurity, + (ndr_print_function_t) ndr_print_lsa_QuerySecurity, + false, + }, + { + "lsa_SetSecObj", + sizeof(struct lsa_SetSecObj), + (ndr_push_flags_fn_t) ndr_push_lsa_SetSecObj, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetSecObj, + (ndr_print_function_t) ndr_print_lsa_SetSecObj, + false, + }, + { + "lsa_ChangePassword", + sizeof(struct lsa_ChangePassword), + (ndr_push_flags_fn_t) ndr_push_lsa_ChangePassword, + (ndr_pull_flags_fn_t) ndr_pull_lsa_ChangePassword, + (ndr_print_function_t) ndr_print_lsa_ChangePassword, + false, + }, + { + "lsa_OpenPolicy", + sizeof(struct lsa_OpenPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenPolicy, + (ndr_print_function_t) ndr_print_lsa_OpenPolicy, + false, + }, + { + "lsa_QueryInfoPolicy", + sizeof(struct lsa_QueryInfoPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryInfoPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryInfoPolicy, + (ndr_print_function_t) ndr_print_lsa_QueryInfoPolicy, + false, + }, + { + "lsa_SetInfoPolicy", + sizeof(struct lsa_SetInfoPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_SetInfoPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetInfoPolicy, + (ndr_print_function_t) ndr_print_lsa_SetInfoPolicy, + false, + }, + { + "lsa_ClearAuditLog", + sizeof(struct lsa_ClearAuditLog), + (ndr_push_flags_fn_t) ndr_push_lsa_ClearAuditLog, + (ndr_pull_flags_fn_t) ndr_pull_lsa_ClearAuditLog, + (ndr_print_function_t) ndr_print_lsa_ClearAuditLog, + false, + }, + { + "lsa_CreateAccount", + sizeof(struct lsa_CreateAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateAccount, + (ndr_print_function_t) ndr_print_lsa_CreateAccount, + false, + }, + { + "lsa_EnumAccounts", + sizeof(struct lsa_EnumAccounts), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumAccounts, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumAccounts, + (ndr_print_function_t) ndr_print_lsa_EnumAccounts, + false, + }, + { + "lsa_CreateTrustedDomain", + sizeof(struct lsa_CreateTrustedDomain), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateTrustedDomain, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateTrustedDomain, + (ndr_print_function_t) ndr_print_lsa_CreateTrustedDomain, + false, + }, + { + "lsa_EnumTrustDom", + sizeof(struct lsa_EnumTrustDom), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumTrustDom, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumTrustDom, + (ndr_print_function_t) ndr_print_lsa_EnumTrustDom, + false, + }, + { + "lsa_LookupNames", + sizeof(struct lsa_LookupNames), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames, + (ndr_print_function_t) ndr_print_lsa_LookupNames, + false, + }, + { + "lsa_LookupSids", + sizeof(struct lsa_LookupSids), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupSids, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupSids, + (ndr_print_function_t) ndr_print_lsa_LookupSids, + false, + }, + { + "lsa_CreateSecret", + sizeof(struct lsa_CreateSecret), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateSecret, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateSecret, + (ndr_print_function_t) ndr_print_lsa_CreateSecret, + false, + }, + { + "lsa_OpenAccount", + sizeof(struct lsa_OpenAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenAccount, + (ndr_print_function_t) ndr_print_lsa_OpenAccount, + false, + }, + { + "lsa_EnumPrivsAccount", + sizeof(struct lsa_EnumPrivsAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumPrivsAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumPrivsAccount, + (ndr_print_function_t) ndr_print_lsa_EnumPrivsAccount, + false, + }, + { + "lsa_AddPrivilegesToAccount", + sizeof(struct lsa_AddPrivilegesToAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_AddPrivilegesToAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_AddPrivilegesToAccount, + (ndr_print_function_t) ndr_print_lsa_AddPrivilegesToAccount, + false, + }, + { + "lsa_RemovePrivilegesFromAccount", + sizeof(struct lsa_RemovePrivilegesFromAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_RemovePrivilegesFromAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_RemovePrivilegesFromAccount, + (ndr_print_function_t) ndr_print_lsa_RemovePrivilegesFromAccount, + false, + }, + { + "lsa_GetQuotasForAccount", + sizeof(struct lsa_GetQuotasForAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_GetQuotasForAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_GetQuotasForAccount, + (ndr_print_function_t) ndr_print_lsa_GetQuotasForAccount, + false, + }, + { + "lsa_SetQuotasForAccount", + sizeof(struct lsa_SetQuotasForAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_SetQuotasForAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetQuotasForAccount, + (ndr_print_function_t) ndr_print_lsa_SetQuotasForAccount, + false, + }, + { + "lsa_GetSystemAccessAccount", + sizeof(struct lsa_GetSystemAccessAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_GetSystemAccessAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_GetSystemAccessAccount, + (ndr_print_function_t) ndr_print_lsa_GetSystemAccessAccount, + false, + }, + { + "lsa_SetSystemAccessAccount", + sizeof(struct lsa_SetSystemAccessAccount), + (ndr_push_flags_fn_t) ndr_push_lsa_SetSystemAccessAccount, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetSystemAccessAccount, + (ndr_print_function_t) ndr_print_lsa_SetSystemAccessAccount, + false, + }, + { + "lsa_OpenTrustedDomain", + sizeof(struct lsa_OpenTrustedDomain), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenTrustedDomain, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenTrustedDomain, + (ndr_print_function_t) ndr_print_lsa_OpenTrustedDomain, + false, + }, + { + "lsa_QueryTrustedDomainInfo", + sizeof(struct lsa_QueryTrustedDomainInfo), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryTrustedDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryTrustedDomainInfo, + (ndr_print_function_t) ndr_print_lsa_QueryTrustedDomainInfo, + false, + }, + { + "lsa_SetInformationTrustedDomain", + sizeof(struct lsa_SetInformationTrustedDomain), + (ndr_push_flags_fn_t) ndr_push_lsa_SetInformationTrustedDomain, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetInformationTrustedDomain, + (ndr_print_function_t) ndr_print_lsa_SetInformationTrustedDomain, + false, + }, + { + "lsa_OpenSecret", + sizeof(struct lsa_OpenSecret), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenSecret, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenSecret, + (ndr_print_function_t) ndr_print_lsa_OpenSecret, + false, + }, + { + "lsa_SetSecret", + sizeof(struct lsa_SetSecret), + (ndr_push_flags_fn_t) ndr_push_lsa_SetSecret, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetSecret, + (ndr_print_function_t) ndr_print_lsa_SetSecret, + false, + }, + { + "lsa_QuerySecret", + sizeof(struct lsa_QuerySecret), + (ndr_push_flags_fn_t) ndr_push_lsa_QuerySecret, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QuerySecret, + (ndr_print_function_t) ndr_print_lsa_QuerySecret, + false, + }, + { + "lsa_LookupPrivValue", + sizeof(struct lsa_LookupPrivValue), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupPrivValue, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupPrivValue, + (ndr_print_function_t) ndr_print_lsa_LookupPrivValue, + false, + }, + { + "lsa_LookupPrivName", + sizeof(struct lsa_LookupPrivName), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupPrivName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupPrivName, + (ndr_print_function_t) ndr_print_lsa_LookupPrivName, + false, + }, + { + "lsa_LookupPrivDisplayName", + sizeof(struct lsa_LookupPrivDisplayName), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupPrivDisplayName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupPrivDisplayName, + (ndr_print_function_t) ndr_print_lsa_LookupPrivDisplayName, + false, + }, + { + "lsa_DeleteObject", + sizeof(struct lsa_DeleteObject), + (ndr_push_flags_fn_t) ndr_push_lsa_DeleteObject, + (ndr_pull_flags_fn_t) ndr_pull_lsa_DeleteObject, + (ndr_print_function_t) ndr_print_lsa_DeleteObject, + false, + }, + { + "lsa_EnumAccountsWithUserRight", + sizeof(struct lsa_EnumAccountsWithUserRight), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumAccountsWithUserRight, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumAccountsWithUserRight, + (ndr_print_function_t) ndr_print_lsa_EnumAccountsWithUserRight, + false, + }, + { + "lsa_EnumAccountRights", + sizeof(struct lsa_EnumAccountRights), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumAccountRights, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumAccountRights, + (ndr_print_function_t) ndr_print_lsa_EnumAccountRights, + false, + }, + { + "lsa_AddAccountRights", + sizeof(struct lsa_AddAccountRights), + (ndr_push_flags_fn_t) ndr_push_lsa_AddAccountRights, + (ndr_pull_flags_fn_t) ndr_pull_lsa_AddAccountRights, + (ndr_print_function_t) ndr_print_lsa_AddAccountRights, + false, + }, + { + "lsa_RemoveAccountRights", + sizeof(struct lsa_RemoveAccountRights), + (ndr_push_flags_fn_t) ndr_push_lsa_RemoveAccountRights, + (ndr_pull_flags_fn_t) ndr_pull_lsa_RemoveAccountRights, + (ndr_print_function_t) ndr_print_lsa_RemoveAccountRights, + false, + }, + { + "lsa_QueryTrustedDomainInfoBySid", + sizeof(struct lsa_QueryTrustedDomainInfoBySid), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryTrustedDomainInfoBySid, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryTrustedDomainInfoBySid, + (ndr_print_function_t) ndr_print_lsa_QueryTrustedDomainInfoBySid, + false, + }, + { + "lsa_SetTrustedDomainInfo", + sizeof(struct lsa_SetTrustedDomainInfo), + (ndr_push_flags_fn_t) ndr_push_lsa_SetTrustedDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetTrustedDomainInfo, + (ndr_print_function_t) ndr_print_lsa_SetTrustedDomainInfo, + false, + }, + { + "lsa_DeleteTrustedDomain", + sizeof(struct lsa_DeleteTrustedDomain), + (ndr_push_flags_fn_t) ndr_push_lsa_DeleteTrustedDomain, + (ndr_pull_flags_fn_t) ndr_pull_lsa_DeleteTrustedDomain, + (ndr_print_function_t) ndr_print_lsa_DeleteTrustedDomain, + false, + }, + { + "lsa_StorePrivateData", + sizeof(struct lsa_StorePrivateData), + (ndr_push_flags_fn_t) ndr_push_lsa_StorePrivateData, + (ndr_pull_flags_fn_t) ndr_pull_lsa_StorePrivateData, + (ndr_print_function_t) ndr_print_lsa_StorePrivateData, + false, + }, + { + "lsa_RetrievePrivateData", + sizeof(struct lsa_RetrievePrivateData), + (ndr_push_flags_fn_t) ndr_push_lsa_RetrievePrivateData, + (ndr_pull_flags_fn_t) ndr_pull_lsa_RetrievePrivateData, + (ndr_print_function_t) ndr_print_lsa_RetrievePrivateData, + false, + }, + { + "lsa_OpenPolicy2", + sizeof(struct lsa_OpenPolicy2), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenPolicy2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenPolicy2, + (ndr_print_function_t) ndr_print_lsa_OpenPolicy2, + false, + }, + { + "lsa_GetUserName", + sizeof(struct lsa_GetUserName), + (ndr_push_flags_fn_t) ndr_push_lsa_GetUserName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_GetUserName, + (ndr_print_function_t) ndr_print_lsa_GetUserName, + false, + }, + { + "lsa_QueryInfoPolicy2", + sizeof(struct lsa_QueryInfoPolicy2), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryInfoPolicy2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryInfoPolicy2, + (ndr_print_function_t) ndr_print_lsa_QueryInfoPolicy2, + false, + }, + { + "lsa_SetInfoPolicy2", + sizeof(struct lsa_SetInfoPolicy2), + (ndr_push_flags_fn_t) ndr_push_lsa_SetInfoPolicy2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetInfoPolicy2, + (ndr_print_function_t) ndr_print_lsa_SetInfoPolicy2, + false, + }, + { + "lsa_QueryTrustedDomainInfoByName", + sizeof(struct lsa_QueryTrustedDomainInfoByName), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryTrustedDomainInfoByName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryTrustedDomainInfoByName, + (ndr_print_function_t) ndr_print_lsa_QueryTrustedDomainInfoByName, + false, + }, + { + "lsa_SetTrustedDomainInfoByName", + sizeof(struct lsa_SetTrustedDomainInfoByName), + (ndr_push_flags_fn_t) ndr_push_lsa_SetTrustedDomainInfoByName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetTrustedDomainInfoByName, + (ndr_print_function_t) ndr_print_lsa_SetTrustedDomainInfoByName, + false, + }, + { + "lsa_EnumTrustedDomainsEx", + sizeof(struct lsa_EnumTrustedDomainsEx), + (ndr_push_flags_fn_t) ndr_push_lsa_EnumTrustedDomainsEx, + (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumTrustedDomainsEx, + (ndr_print_function_t) ndr_print_lsa_EnumTrustedDomainsEx, + false, + }, + { + "lsa_CreateTrustedDomainEx", + sizeof(struct lsa_CreateTrustedDomainEx), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateTrustedDomainEx, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateTrustedDomainEx, + (ndr_print_function_t) ndr_print_lsa_CreateTrustedDomainEx, + false, + }, + { + "lsa_CloseTrustedDomainEx", + sizeof(struct lsa_CloseTrustedDomainEx), + (ndr_push_flags_fn_t) ndr_push_lsa_CloseTrustedDomainEx, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CloseTrustedDomainEx, + (ndr_print_function_t) ndr_print_lsa_CloseTrustedDomainEx, + false, + }, + { + "lsa_QueryDomainInformationPolicy", + sizeof(struct lsa_QueryDomainInformationPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_QueryDomainInformationPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryDomainInformationPolicy, + (ndr_print_function_t) ndr_print_lsa_QueryDomainInformationPolicy, + false, + }, + { + "lsa_SetDomainInformationPolicy", + sizeof(struct lsa_SetDomainInformationPolicy), + (ndr_push_flags_fn_t) ndr_push_lsa_SetDomainInformationPolicy, + (ndr_pull_flags_fn_t) ndr_pull_lsa_SetDomainInformationPolicy, + (ndr_print_function_t) ndr_print_lsa_SetDomainInformationPolicy, + false, + }, + { + "lsa_OpenTrustedDomainByName", + sizeof(struct lsa_OpenTrustedDomainByName), + (ndr_push_flags_fn_t) ndr_push_lsa_OpenTrustedDomainByName, + (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenTrustedDomainByName, + (ndr_print_function_t) ndr_print_lsa_OpenTrustedDomainByName, + false, + }, + { + "lsa_TestCall", + sizeof(struct lsa_TestCall), + (ndr_push_flags_fn_t) ndr_push_lsa_TestCall, + (ndr_pull_flags_fn_t) ndr_pull_lsa_TestCall, + (ndr_print_function_t) ndr_print_lsa_TestCall, + false, + }, + { + "lsa_LookupSids2", + sizeof(struct lsa_LookupSids2), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupSids2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupSids2, + (ndr_print_function_t) ndr_print_lsa_LookupSids2, + false, + }, + { + "lsa_LookupNames2", + sizeof(struct lsa_LookupNames2), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames2, + (ndr_print_function_t) ndr_print_lsa_LookupNames2, + false, + }, + { + "lsa_CreateTrustedDomainEx2", + sizeof(struct lsa_CreateTrustedDomainEx2), + (ndr_push_flags_fn_t) ndr_push_lsa_CreateTrustedDomainEx2, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateTrustedDomainEx2, + (ndr_print_function_t) ndr_print_lsa_CreateTrustedDomainEx2, + false, + }, + { + "lsa_CREDRWRITE", + sizeof(struct lsa_CREDRWRITE), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRWRITE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRWRITE, + (ndr_print_function_t) ndr_print_lsa_CREDRWRITE, + false, + }, + { + "lsa_CREDRREAD", + sizeof(struct lsa_CREDRREAD), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRREAD, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRREAD, + (ndr_print_function_t) ndr_print_lsa_CREDRREAD, + false, + }, + { + "lsa_CREDRENUMERATE", + sizeof(struct lsa_CREDRENUMERATE), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRENUMERATE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRENUMERATE, + (ndr_print_function_t) ndr_print_lsa_CREDRENUMERATE, + false, + }, + { + "lsa_CREDRWRITEDOMAINCREDENTIALS", + sizeof(struct lsa_CREDRWRITEDOMAINCREDENTIALS), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRWRITEDOMAINCREDENTIALS, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRWRITEDOMAINCREDENTIALS, + (ndr_print_function_t) ndr_print_lsa_CREDRWRITEDOMAINCREDENTIALS, + false, + }, + { + "lsa_CREDRREADDOMAINCREDENTIALS", + sizeof(struct lsa_CREDRREADDOMAINCREDENTIALS), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRREADDOMAINCREDENTIALS, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRREADDOMAINCREDENTIALS, + (ndr_print_function_t) ndr_print_lsa_CREDRREADDOMAINCREDENTIALS, + false, + }, + { + "lsa_CREDRDELETE", + sizeof(struct lsa_CREDRDELETE), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRDELETE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRDELETE, + (ndr_print_function_t) ndr_print_lsa_CREDRDELETE, + false, + }, + { + "lsa_CREDRGETTARGETINFO", + sizeof(struct lsa_CREDRGETTARGETINFO), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRGETTARGETINFO, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRGETTARGETINFO, + (ndr_print_function_t) ndr_print_lsa_CREDRGETTARGETINFO, + false, + }, + { + "lsa_CREDRPROFILELOADED", + sizeof(struct lsa_CREDRPROFILELOADED), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRPROFILELOADED, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRPROFILELOADED, + (ndr_print_function_t) ndr_print_lsa_CREDRPROFILELOADED, + false, + }, + { + "lsa_LookupNames3", + sizeof(struct lsa_LookupNames3), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames3, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames3, + (ndr_print_function_t) ndr_print_lsa_LookupNames3, + false, + }, + { + "lsa_CREDRGETSESSIONTYPES", + sizeof(struct lsa_CREDRGETSESSIONTYPES), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRGETSESSIONTYPES, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRGETSESSIONTYPES, + (ndr_print_function_t) ndr_print_lsa_CREDRGETSESSIONTYPES, + false, + }, + { + "lsa_LSARREGISTERAUDITEVENT", + sizeof(struct lsa_LSARREGISTERAUDITEVENT), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARREGISTERAUDITEVENT, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARREGISTERAUDITEVENT, + (ndr_print_function_t) ndr_print_lsa_LSARREGISTERAUDITEVENT, + false, + }, + { + "lsa_LSARGENAUDITEVENT", + sizeof(struct lsa_LSARGENAUDITEVENT), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARGENAUDITEVENT, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARGENAUDITEVENT, + (ndr_print_function_t) ndr_print_lsa_LSARGENAUDITEVENT, + false, + }, + { + "lsa_LSARUNREGISTERAUDITEVENT", + sizeof(struct lsa_LSARUNREGISTERAUDITEVENT), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARUNREGISTERAUDITEVENT, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARUNREGISTERAUDITEVENT, + (ndr_print_function_t) ndr_print_lsa_LSARUNREGISTERAUDITEVENT, + false, + }, + { + "lsa_lsaRQueryForestTrustInformation", + sizeof(struct lsa_lsaRQueryForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_lsa_lsaRQueryForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_lsa_lsaRQueryForestTrustInformation, + (ndr_print_function_t) ndr_print_lsa_lsaRQueryForestTrustInformation, + false, + }, + { + "lsa_LSARSETFORESTTRUSTINFORMATION", + sizeof(struct lsa_LSARSETFORESTTRUSTINFORMATION), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARSETFORESTTRUSTINFORMATION, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARSETFORESTTRUSTINFORMATION, + (ndr_print_function_t) ndr_print_lsa_LSARSETFORESTTRUSTINFORMATION, + false, + }, + { + "lsa_CREDRRENAME", + sizeof(struct lsa_CREDRRENAME), + (ndr_push_flags_fn_t) ndr_push_lsa_CREDRRENAME, + (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRRENAME, + (ndr_print_function_t) ndr_print_lsa_CREDRRENAME, + false, + }, + { + "lsa_LookupSids3", + sizeof(struct lsa_LookupSids3), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupSids3, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupSids3, + (ndr_print_function_t) ndr_print_lsa_LookupSids3, + false, + }, + { + "lsa_LookupNames4", + sizeof(struct lsa_LookupNames4), + (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames4, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames4, + (ndr_print_function_t) ndr_print_lsa_LookupNames4, + false, + }, + { + "lsa_LSAROPENPOLICYSCE", + sizeof(struct lsa_LSAROPENPOLICYSCE), + (ndr_push_flags_fn_t) ndr_push_lsa_LSAROPENPOLICYSCE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSAROPENPOLICYSCE, + (ndr_print_function_t) ndr_print_lsa_LSAROPENPOLICYSCE, + false, + }, + { + "lsa_LSARADTREGISTERSECURITYEVENTSOURCE", + sizeof(struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARADTREGISTERSECURITYEVENTSOURCE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARADTREGISTERSECURITYEVENTSOURCE, + (ndr_print_function_t) ndr_print_lsa_LSARADTREGISTERSECURITYEVENTSOURCE, + false, + }, + { + "lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE", + sizeof(struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, + (ndr_print_function_t) ndr_print_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, + false, + }, + { + "lsa_LSARADTREPORTSECURITYEVENT", + sizeof(struct lsa_LSARADTREPORTSECURITYEVENT), + (ndr_push_flags_fn_t) ndr_push_lsa_LSARADTREPORTSECURITYEVENT, + (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARADTREPORTSECURITYEVENT, + (ndr_print_function_t) ndr_print_lsa_LSARADTREPORTSECURITYEVENT, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const lsarpc_endpoint_strings[] = { + "ncacn_np:[\\pipe\\lsarpc]", + "ncacn_np:[\\pipe\\netlogon]", + "ncacn_np:[\\pipe\\lsass]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array lsarpc_endpoints = { + .count = 5, + .names = lsarpc_endpoint_strings +}; + +static const char * const lsarpc_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array lsarpc_authservices = { + .count = 1, + .names = lsarpc_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_lsarpc = { + .name = "lsarpc", + .syntax_id = { + {0x12345778,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xab}}, + NDR_LSARPC_VERSION + }, + .helpstring = NDR_LSARPC_HELPSTRING, + .num_calls = 82, + .calls = lsarpc_calls, + .endpoints = &lsarpc_endpoints, + .authservices = &lsarpc_authservices +}; + diff --git a/librpc/gen_ndr/ndr_lsa.h b/librpc/gen_ndr/ndr_lsa.h new file mode 100644 index 0000000000..2f623c2ba9 --- /dev/null +++ b/librpc/gen_ndr/ndr_lsa.h @@ -0,0 +1,400 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/lsa.h" + +#ifndef _HEADER_NDR_lsarpc +#define _HEADER_NDR_lsarpc + +#define NDR_LSARPC_UUID "12345778-1234-abcd-ef00-0123456789ab" +#define NDR_LSARPC_VERSION 0.0 +#define NDR_LSARPC_NAME "lsarpc" +#define NDR_LSARPC_HELPSTRING "Local Security Authority" +extern const struct ndr_interface_table ndr_table_lsarpc; +#define NDR_LSA_CLOSE (0x00) + +#define NDR_LSA_DELETE (0x01) + +#define NDR_LSA_ENUMPRIVS (0x02) + +#define NDR_LSA_QUERYSECURITY (0x03) + +#define NDR_LSA_SETSECOBJ (0x04) + +#define NDR_LSA_CHANGEPASSWORD (0x05) + +#define NDR_LSA_OPENPOLICY (0x06) + +#define NDR_LSA_QUERYINFOPOLICY (0x07) + +#define NDR_LSA_SETINFOPOLICY (0x08) + +#define NDR_LSA_CLEARAUDITLOG (0x09) + +#define NDR_LSA_CREATEACCOUNT (0x0a) + +#define NDR_LSA_ENUMACCOUNTS (0x0b) + +#define NDR_LSA_CREATETRUSTEDDOMAIN (0x0c) + +#define NDR_LSA_ENUMTRUSTDOM (0x0d) + +#define NDR_LSA_LOOKUPNAMES (0x0e) + +#define NDR_LSA_LOOKUPSIDS (0x0f) + +#define NDR_LSA_CREATESECRET (0x10) + +#define NDR_LSA_OPENACCOUNT (0x11) + +#define NDR_LSA_ENUMPRIVSACCOUNT (0x12) + +#define NDR_LSA_ADDPRIVILEGESTOACCOUNT (0x13) + +#define NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT (0x14) + +#define NDR_LSA_GETQUOTASFORACCOUNT (0x15) + +#define NDR_LSA_SETQUOTASFORACCOUNT (0x16) + +#define NDR_LSA_GETSYSTEMACCESSACCOUNT (0x17) + +#define NDR_LSA_SETSYSTEMACCESSACCOUNT (0x18) + +#define NDR_LSA_OPENTRUSTEDDOMAIN (0x19) + +#define NDR_LSA_QUERYTRUSTEDDOMAININFO (0x1a) + +#define NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN (0x1b) + +#define NDR_LSA_OPENSECRET (0x1c) + +#define NDR_LSA_SETSECRET (0x1d) + +#define NDR_LSA_QUERYSECRET (0x1e) + +#define NDR_LSA_LOOKUPPRIVVALUE (0x1f) + +#define NDR_LSA_LOOKUPPRIVNAME (0x20) + +#define NDR_LSA_LOOKUPPRIVDISPLAYNAME (0x21) + +#define NDR_LSA_DELETEOBJECT (0x22) + +#define NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT (0x23) + +#define NDR_LSA_ENUMACCOUNTRIGHTS (0x24) + +#define NDR_LSA_ADDACCOUNTRIGHTS (0x25) + +#define NDR_LSA_REMOVEACCOUNTRIGHTS (0x26) + +#define NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID (0x27) + +#define NDR_LSA_SETTRUSTEDDOMAININFO (0x28) + +#define NDR_LSA_DELETETRUSTEDDOMAIN (0x29) + +#define NDR_LSA_STOREPRIVATEDATA (0x2a) + +#define NDR_LSA_RETRIEVEPRIVATEDATA (0x2b) + +#define NDR_LSA_OPENPOLICY2 (0x2c) + +#define NDR_LSA_GETUSERNAME (0x2d) + +#define NDR_LSA_QUERYINFOPOLICY2 (0x2e) + +#define NDR_LSA_SETINFOPOLICY2 (0x2f) + +#define NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME (0x30) + +#define NDR_LSA_SETTRUSTEDDOMAININFOBYNAME (0x31) + +#define NDR_LSA_ENUMTRUSTEDDOMAINSEX (0x32) + +#define NDR_LSA_CREATETRUSTEDDOMAINEX (0x33) + +#define NDR_LSA_CLOSETRUSTEDDOMAINEX (0x34) + +#define NDR_LSA_QUERYDOMAININFORMATIONPOLICY (0x35) + +#define NDR_LSA_SETDOMAININFORMATIONPOLICY (0x36) + +#define NDR_LSA_OPENTRUSTEDDOMAINBYNAME (0x37) + +#define NDR_LSA_TESTCALL (0x38) + +#define NDR_LSA_LOOKUPSIDS2 (0x39) + +#define NDR_LSA_LOOKUPNAMES2 (0x3a) + +#define NDR_LSA_CREATETRUSTEDDOMAINEX2 (0x3b) + +#define NDR_LSA_CREDRWRITE (0x3c) + +#define NDR_LSA_CREDRREAD (0x3d) + +#define NDR_LSA_CREDRENUMERATE (0x3e) + +#define NDR_LSA_CREDRWRITEDOMAINCREDENTIALS (0x3f) + +#define NDR_LSA_CREDRREADDOMAINCREDENTIALS (0x40) + +#define NDR_LSA_CREDRDELETE (0x41) + +#define NDR_LSA_CREDRGETTARGETINFO (0x42) + +#define NDR_LSA_CREDRPROFILELOADED (0x43) + +#define NDR_LSA_LOOKUPNAMES3 (0x44) + +#define NDR_LSA_CREDRGETSESSIONTYPES (0x45) + +#define NDR_LSA_LSARREGISTERAUDITEVENT (0x46) + +#define NDR_LSA_LSARGENAUDITEVENT (0x47) + +#define NDR_LSA_LSARUNREGISTERAUDITEVENT (0x48) + +#define NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION (0x49) + +#define NDR_LSA_LSARSETFORESTTRUSTINFORMATION (0x4a) + +#define NDR_LSA_CREDRRENAME (0x4b) + +#define NDR_LSA_LOOKUPSIDS3 (0x4c) + +#define NDR_LSA_LOOKUPNAMES4 (0x4d) + +#define NDR_LSA_LSAROPENPOLICYSCE (0x4e) + +#define NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE (0x4f) + +#define NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE (0x50) + +#define NDR_LSA_LSARADTREPORTSECURITYEVENT (0x51) + +#define NDR_LSARPC_CALL_COUNT (82) +enum ndr_err_code ndr_push_lsa_String(struct ndr_push *ndr, int ndr_flags, const struct lsa_String *r); +enum ndr_err_code ndr_pull_lsa_String(struct ndr_pull *ndr, int ndr_flags, struct lsa_String *r); +void ndr_print_lsa_String(struct ndr_print *ndr, const char *name, const struct lsa_String *r); +enum ndr_err_code ndr_push_lsa_StringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_StringLarge *r); +enum ndr_err_code ndr_pull_lsa_StringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_StringLarge *r); +void ndr_print_lsa_StringLarge(struct ndr_print *ndr, const char *name, const struct lsa_StringLarge *r); +enum ndr_err_code ndr_push_lsa_Strings(struct ndr_push *ndr, int ndr_flags, const struct lsa_Strings *r); +enum ndr_err_code ndr_pull_lsa_Strings(struct ndr_pull *ndr, int ndr_flags, struct lsa_Strings *r); +void ndr_print_lsa_Strings(struct ndr_print *ndr, const char *name, const struct lsa_Strings *r); +enum ndr_err_code ndr_push_lsa_AsciiString(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiString *r); +enum ndr_err_code ndr_pull_lsa_AsciiString(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiString *r); +void ndr_print_lsa_AsciiString(struct ndr_print *ndr, const char *name, const struct lsa_AsciiString *r); +enum ndr_err_code ndr_push_lsa_AsciiStringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiStringLarge *r); +enum ndr_err_code ndr_pull_lsa_AsciiStringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiStringLarge *r); +void ndr_print_lsa_AsciiStringLarge(struct ndr_print *ndr, const char *name, const struct lsa_AsciiStringLarge *r); +enum ndr_err_code ndr_push_lsa_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct lsa_BinaryString *r); +enum ndr_err_code ndr_pull_lsa_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct lsa_BinaryString *r); +void ndr_print_lsa_BinaryString(struct ndr_print *ndr, const char *name, const struct lsa_BinaryString *r); +void ndr_print_lsa_LUID(struct ndr_print *ndr, const char *name, const struct lsa_LUID *r); +void ndr_print_lsa_PrivEntry(struct ndr_print *ndr, const char *name, const struct lsa_PrivEntry *r); +void ndr_print_lsa_PrivArray(struct ndr_print *ndr, const char *name, const struct lsa_PrivArray *r); +void ndr_print_lsa_QosInfo(struct ndr_print *ndr, const char *name, const struct lsa_QosInfo *r); +void ndr_print_lsa_ObjectAttribute(struct ndr_print *ndr, const char *name, const struct lsa_ObjectAttribute *r); +enum ndr_err_code ndr_push_lsa_PolicyAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_lsa_PolicyAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_lsa_PolicyAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_lsa_AuditLogInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditLogInfo *r); +void ndr_print_lsa_PolicyAuditPolicy(struct ndr_print *ndr, const char *name, enum lsa_PolicyAuditPolicy r); +void ndr_print_lsa_AuditEventsInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditEventsInfo *r); +void ndr_print_lsa_DomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfo *r); +void ndr_print_lsa_PDAccountInfo(struct ndr_print *ndr, const char *name, const struct lsa_PDAccountInfo *r); +void ndr_print_lsa_Role(struct ndr_print *ndr, const char *name, enum lsa_Role r); +void ndr_print_lsa_ServerRole(struct ndr_print *ndr, const char *name, const struct lsa_ServerRole *r); +void ndr_print_lsa_ReplicaSourceInfo(struct ndr_print *ndr, const char *name, const struct lsa_ReplicaSourceInfo *r); +void ndr_print_lsa_DefaultQuotaInfo(struct ndr_print *ndr, const char *name, const struct lsa_DefaultQuotaInfo *r); +void ndr_print_lsa_ModificationInfo(struct ndr_print *ndr, const char *name, const struct lsa_ModificationInfo *r); +void ndr_print_lsa_AuditFullSetInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullSetInfo *r); +void ndr_print_lsa_AuditFullQueryInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullQueryInfo *r); +void ndr_print_lsa_DnsDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DnsDomainInfo *r); +void ndr_print_lsa_PolicyInfo(struct ndr_print *ndr, const char *name, enum lsa_PolicyInfo r); +void ndr_print_lsa_PolicyInformation(struct ndr_print *ndr, const char *name, const union lsa_PolicyInformation *r); +void ndr_print_lsa_SidPtr(struct ndr_print *ndr, const char *name, const struct lsa_SidPtr *r); +enum ndr_err_code ndr_push_lsa_SidArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_SidArray *r); +enum ndr_err_code ndr_pull_lsa_SidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidArray *r); +void ndr_print_lsa_SidArray(struct ndr_print *ndr, const char *name, const struct lsa_SidArray *r); +void ndr_print_lsa_DomainList(struct ndr_print *ndr, const char *name, const struct lsa_DomainList *r); +enum ndr_err_code ndr_push_lsa_SidType(struct ndr_push *ndr, int ndr_flags, enum lsa_SidType r); +enum ndr_err_code ndr_pull_lsa_SidType(struct ndr_pull *ndr, int ndr_flags, enum lsa_SidType *r); +void ndr_print_lsa_SidType(struct ndr_print *ndr, const char *name, enum lsa_SidType r); +void ndr_print_lsa_TranslatedSid(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid *r); +void ndr_print_lsa_TransSidArray(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray *r); +void ndr_print_lsa_RefDomainList(struct ndr_print *ndr, const char *name, const struct lsa_RefDomainList *r); +void ndr_print_lsa_LookupNamesLevel(struct ndr_print *ndr, const char *name, enum lsa_LookupNamesLevel r); +void ndr_print_lsa_TranslatedName(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName *r); +void ndr_print_lsa_TransNameArray(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray *r); +void ndr_print_lsa_LUIDAttribute(struct ndr_print *ndr, const char *name, const struct lsa_LUIDAttribute *r); +void ndr_print_lsa_PrivilegeSet(struct ndr_print *ndr, const char *name, const struct lsa_PrivilegeSet *r); +void ndr_print_lsa_DATA_BUF(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF *r); +void ndr_print_lsa_DATA_BUF2(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF2 *r); +void ndr_print_lsa_TrustDomInfoEnum(struct ndr_print *ndr, const char *name, enum lsa_TrustDomInfoEnum r); +enum ndr_err_code ndr_push_lsa_TrustDirection(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_lsa_TrustDirection(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_lsa_TrustDirection(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_lsa_TrustType(struct ndr_print *ndr, const char *name, enum lsa_TrustType r); +enum ndr_err_code ndr_push_lsa_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_lsa_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_lsa_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_lsa_TrustDomainInfoName(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoName *r); +void ndr_print_lsa_TrustDomainInfoControllers(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoControllers *r); +void ndr_print_lsa_TrustDomainInfoPosixOffset(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPosixOffset *r); +void ndr_print_lsa_TrustDomainInfoPassword(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPassword *r); +void ndr_print_lsa_TrustDomainInfoBasic(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBasic *r); +void ndr_print_lsa_TrustDomainInfoInfoEx(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx *r); +enum ndr_err_code ndr_push_lsa_TrustAuthType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustAuthType r); +enum ndr_err_code ndr_pull_lsa_TrustAuthType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustAuthType *r); +void ndr_print_lsa_TrustAuthType(struct ndr_print *ndr, const char *name, enum lsa_TrustAuthType r); +void ndr_print_lsa_TrustDomainInfoBuffer(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBuffer *r); +void ndr_print_lsa_TrustDomainInfoAuthInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfo *r); +void ndr_print_lsa_TrustDomainInfoFullInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo *r); +void ndr_print_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfoInternal *r); +void ndr_print_lsa_TrustDomainInfoFullInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfoInternal *r); +void ndr_print_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx2Internal *r); +void ndr_print_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo2Internal *r); +void ndr_print_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoSupportedEncTypes *r); +void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char *name, const union lsa_TrustedDomainInfo *r); +void ndr_print_lsa_DATA_BUF_PTR(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF_PTR *r); +void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, const struct lsa_RightSet *r); +void ndr_print_lsa_DomainListEx(struct ndr_print *ndr, const char *name, const struct lsa_DomainListEx *r); +void ndr_print_lsa_DomainInfoKerberos(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoKerberos *r); +void ndr_print_lsa_DomainInfoEfs(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoEfs *r); +void ndr_print_lsa_DomainInformationPolicy(struct ndr_print *ndr, const char *name, const union lsa_DomainInformationPolicy *r); +void ndr_print_lsa_TranslatedName2(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName2 *r); +void ndr_print_lsa_TransNameArray2(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray2 *r); +void ndr_print_lsa_TranslatedSid2(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid2 *r); +void ndr_print_lsa_TransSidArray2(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray2 *r); +void ndr_print_lsa_TranslatedSid3(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid3 *r); +void ndr_print_lsa_TransSidArray3(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray3 *r); +void ndr_print_lsa_ForestTrustBinaryData(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustBinaryData *r); +void ndr_print_lsa_ForestTrustDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustDomainInfo *r); +void ndr_print_lsa_ForestTrustData(struct ndr_print *ndr, const char *name, const union lsa_ForestTrustData *r); +void ndr_print_lsa_ForestTrustRecordType(struct ndr_print *ndr, const char *name, enum lsa_ForestTrustRecordType r); +void ndr_print_lsa_ForestTrustRecord(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustRecord *r); +enum ndr_err_code ndr_push_lsa_ForestTrustInformation(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustInformation *r); +enum ndr_err_code ndr_pull_lsa_ForestTrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustInformation *r); +void ndr_print_lsa_ForestTrustInformation(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustInformation *r); +void ndr_print_lsa_Close(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Close *r); +enum ndr_err_code ndr_push_lsa_Delete(struct ndr_push *ndr, int flags, const struct lsa_Delete *r); +enum ndr_err_code ndr_pull_lsa_Delete(struct ndr_pull *ndr, int flags, struct lsa_Delete *r); +void ndr_print_lsa_Delete(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Delete *r); +enum ndr_err_code ndr_push_lsa_EnumPrivs(struct ndr_push *ndr, int flags, const struct lsa_EnumPrivs *r); +enum ndr_err_code ndr_pull_lsa_EnumPrivs(struct ndr_pull *ndr, int flags, struct lsa_EnumPrivs *r); +void ndr_print_lsa_EnumPrivs(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivs *r); +void ndr_print_lsa_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecurity *r); +void ndr_print_lsa_SetSecObj(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecObj *r); +void ndr_print_lsa_ChangePassword(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ChangePassword *r); +enum ndr_err_code ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy *r); +enum ndr_err_code ndr_pull_lsa_OpenPolicy(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy *r); +void ndr_print_lsa_OpenPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy *r); +void ndr_print_lsa_QueryInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy *r); +void ndr_print_lsa_SetInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInfoPolicy *r); +void ndr_print_lsa_ClearAuditLog(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ClearAuditLog *r); +enum ndr_err_code ndr_push_lsa_CreateAccount(struct ndr_push *ndr, int flags, const struct lsa_CreateAccount *r); +enum ndr_err_code ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, int flags, struct lsa_CreateAccount *r); +void ndr_print_lsa_CreateAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateAccount *r); +enum ndr_err_code ndr_push_lsa_EnumAccounts(struct ndr_push *ndr, int flags, const struct lsa_EnumAccounts *r); +enum ndr_err_code ndr_pull_lsa_EnumAccounts(struct ndr_pull *ndr, int flags, struct lsa_EnumAccounts *r); +void ndr_print_lsa_EnumAccounts(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccounts *r); +enum ndr_err_code ndr_push_lsa_CreateTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomain *r); +enum ndr_err_code ndr_pull_lsa_CreateTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomain *r); +void ndr_print_lsa_CreateTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomain *r); +void ndr_print_lsa_EnumTrustDom(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumTrustDom *r); +enum ndr_err_code ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const struct lsa_LookupNames *r); +enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flags, struct lsa_LookupNames *r); +void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames *r); +enum ndr_err_code ndr_push_lsa_LookupSids(struct ndr_push *ndr, int flags, const struct lsa_LookupSids *r); +enum ndr_err_code ndr_pull_lsa_LookupSids(struct ndr_pull *ndr, int flags, struct lsa_LookupSids *r); +void ndr_print_lsa_LookupSids(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids *r); +enum ndr_err_code ndr_push_lsa_CreateSecret(struct ndr_push *ndr, int flags, const struct lsa_CreateSecret *r); +enum ndr_err_code ndr_pull_lsa_CreateSecret(struct ndr_pull *ndr, int flags, struct lsa_CreateSecret *r); +void ndr_print_lsa_CreateSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateSecret *r); +void ndr_print_lsa_OpenAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenAccount *r); +void ndr_print_lsa_EnumPrivsAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivsAccount *r); +void ndr_print_lsa_AddPrivilegesToAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_AddPrivilegesToAccount *r); +void ndr_print_lsa_RemovePrivilegesFromAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RemovePrivilegesFromAccount *r); +void ndr_print_lsa_GetQuotasForAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetQuotasForAccount *r); +void ndr_print_lsa_SetQuotasForAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetQuotasForAccount *r); +void ndr_print_lsa_GetSystemAccessAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetSystemAccessAccount *r); +void ndr_print_lsa_SetSystemAccessAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSystemAccessAccount *r); +void ndr_print_lsa_OpenTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomain *r); +void ndr_print_lsa_QueryTrustedDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfo *r); +void ndr_print_lsa_SetInformationTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInformationTrustedDomain *r); +enum ndr_err_code ndr_push_lsa_OpenSecret(struct ndr_push *ndr, int flags, const struct lsa_OpenSecret *r); +enum ndr_err_code ndr_pull_lsa_OpenSecret(struct ndr_pull *ndr, int flags, struct lsa_OpenSecret *r); +void ndr_print_lsa_OpenSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenSecret *r); +enum ndr_err_code ndr_push_lsa_SetSecret(struct ndr_push *ndr, int flags, const struct lsa_SetSecret *r); +enum ndr_err_code ndr_pull_lsa_SetSecret(struct ndr_pull *ndr, int flags, struct lsa_SetSecret *r); +void ndr_print_lsa_SetSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecret *r); +enum ndr_err_code ndr_push_lsa_QuerySecret(struct ndr_push *ndr, int flags, const struct lsa_QuerySecret *r); +enum ndr_err_code ndr_pull_lsa_QuerySecret(struct ndr_pull *ndr, int flags, struct lsa_QuerySecret *r); +void ndr_print_lsa_QuerySecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecret *r); +void ndr_print_lsa_LookupPrivValue(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivValue *r); +void ndr_print_lsa_LookupPrivName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivName *r); +void ndr_print_lsa_LookupPrivDisplayName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivDisplayName *r); +void ndr_print_lsa_DeleteObject(struct ndr_print *ndr, const char *name, int flags, const struct lsa_DeleteObject *r); +void ndr_print_lsa_EnumAccountsWithUserRight(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccountsWithUserRight *r); +void ndr_print_lsa_EnumAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccountRights *r); +void ndr_print_lsa_AddAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_AddAccountRights *r); +void ndr_print_lsa_RemoveAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RemoveAccountRights *r); +void ndr_print_lsa_QueryTrustedDomainInfoBySid(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfoBySid *r); +void ndr_print_lsa_SetTrustedDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetTrustedDomainInfo *r); +void ndr_print_lsa_DeleteTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_DeleteTrustedDomain *r); +void ndr_print_lsa_StorePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_StorePrivateData *r); +void ndr_print_lsa_RetrievePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RetrievePrivateData *r); +enum ndr_err_code ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy2 *r); +enum ndr_err_code ndr_pull_lsa_OpenPolicy2(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy2 *r); +void ndr_print_lsa_OpenPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy2 *r); +void ndr_print_lsa_GetUserName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetUserName *r); +void ndr_print_lsa_QueryInfoPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy2 *r); +void ndr_print_lsa_SetInfoPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInfoPolicy2 *r); +void ndr_print_lsa_QueryTrustedDomainInfoByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfoByName *r); +void ndr_print_lsa_SetTrustedDomainInfoByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetTrustedDomainInfoByName *r); +void ndr_print_lsa_EnumTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumTrustedDomainsEx *r); +void ndr_print_lsa_CreateTrustedDomainEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomainEx *r); +void ndr_print_lsa_CloseTrustedDomainEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CloseTrustedDomainEx *r); +void ndr_print_lsa_QueryDomainInformationPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryDomainInformationPolicy *r); +void ndr_print_lsa_SetDomainInformationPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetDomainInformationPolicy *r); +void ndr_print_lsa_OpenTrustedDomainByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomainByName *r); +void ndr_print_lsa_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct lsa_TestCall *r); +enum ndr_err_code ndr_push_lsa_LookupSids2(struct ndr_push *ndr, int flags, const struct lsa_LookupSids2 *r); +enum ndr_err_code ndr_pull_lsa_LookupSids2(struct ndr_pull *ndr, int flags, struct lsa_LookupSids2 *r); +void ndr_print_lsa_LookupSids2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids2 *r); +enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const struct lsa_LookupNames2 *r); +enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int flags, struct lsa_LookupNames2 *r); +void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames2 *r); +void ndr_print_lsa_CreateTrustedDomainEx2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomainEx2 *r); +void ndr_print_lsa_CREDRWRITE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRWRITE *r); +void ndr_print_lsa_CREDRREAD(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRREAD *r); +void ndr_print_lsa_CREDRENUMERATE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRENUMERATE *r); +void ndr_print_lsa_CREDRWRITEDOMAINCREDENTIALS(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRWRITEDOMAINCREDENTIALS *r); +void ndr_print_lsa_CREDRREADDOMAINCREDENTIALS(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRREADDOMAINCREDENTIALS *r); +void ndr_print_lsa_CREDRDELETE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRDELETE *r); +void ndr_print_lsa_CREDRGETTARGETINFO(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETTARGETINFO *r); +void ndr_print_lsa_CREDRPROFILELOADED(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRPROFILELOADED *r); +enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const struct lsa_LookupNames3 *r); +enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int flags, struct lsa_LookupNames3 *r); +void ndr_print_lsa_LookupNames3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames3 *r); +void ndr_print_lsa_CREDRGETSESSIONTYPES(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETSESSIONTYPES *r); +void ndr_print_lsa_LSARREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARREGISTERAUDITEVENT *r); +void ndr_print_lsa_LSARGENAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARGENAUDITEVENT *r); +void ndr_print_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARUNREGISTERAUDITEVENT *r); +void ndr_print_lsa_lsaRQueryForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct lsa_lsaRQueryForestTrustInformation *r); +void ndr_print_lsa_LSARSETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARSETFORESTTRUSTINFORMATION *r); +void ndr_print_lsa_CREDRRENAME(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRRENAME *r); +enum ndr_err_code ndr_push_lsa_LookupSids3(struct ndr_push *ndr, int flags, const struct lsa_LookupSids3 *r); +enum ndr_err_code ndr_pull_lsa_LookupSids3(struct ndr_pull *ndr, int flags, struct lsa_LookupSids3 *r); +void ndr_print_lsa_LookupSids3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids3 *r); +void ndr_print_lsa_LookupNames4(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames4 *r); +void ndr_print_lsa_LSAROPENPOLICYSCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSAROPENPOLICYSCE *r); +void ndr_print_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r); +void ndr_print_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r); +void ndr_print_lsa_LSARADTREPORTSECURITYEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTREPORTSECURITYEVENT *r); +#endif /* _HEADER_NDR_lsarpc */ diff --git a/librpc/gen_ndr/ndr_misc.c b/librpc/gen_ndr/ndr_misc.c new file mode 100644 index 0000000000..971cbdac24 --- /dev/null +++ b/librpc/gen_ndr/ndr_misc.c @@ -0,0 +1,134 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_misc.h" + +_PUBLIC_ enum ndr_err_code ndr_push_GUID(struct ndr_push *ndr, int ndr_flags, const struct GUID *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_low)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_mid)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_hi_and_version)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->node, 6)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_low)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_mid)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_hi_and_version)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->node, 6)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ size_t ndr_size_GUID(const struct GUID *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_GUID); +} + +_PUBLIC_ enum ndr_err_code ndr_push_ndr_syntax_id(struct ndr_push *ndr, int ndr_flags, const struct ndr_syntax_id *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->if_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_ndr_syntax_id(struct ndr_pull *ndr, int ndr_flags, struct ndr_syntax_id *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->if_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ndr_syntax_id(struct ndr_print *ndr, const char *name, const struct ndr_syntax_id *r) +{ + ndr_print_struct(ndr, name, "ndr_syntax_id"); + ndr->depth++; + ndr_print_GUID(ndr, "uuid", &r->uuid); + ndr_print_uint32(ndr, "if_version", r->if_version); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->handle_type)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->handle_type)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r) +{ + ndr_print_struct(ndr, name, "policy_handle"); + ndr->depth++; + ndr_print_uint32(ndr, "handle_type", r->handle_type); + ndr_print_GUID(ndr, "uuid", &r->uuid); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r) +{ + const char *val = NULL; + + switch (r) { + case SEC_CHAN_NULL: val = "SEC_CHAN_NULL"; break; + case SEC_CHAN_WKSTA: val = "SEC_CHAN_WKSTA"; break; + case SEC_CHAN_DNS_DOMAIN: val = "SEC_CHAN_DNS_DOMAIN"; break; + case SEC_CHAN_DOMAIN: val = "SEC_CHAN_DOMAIN"; break; + case SEC_CHAN_BDC: val = "SEC_CHAN_BDC"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + diff --git a/librpc/gen_ndr/ndr_misc.h b/librpc/gen_ndr/ndr_misc.h new file mode 100644 index 0000000000..b907af0605 --- /dev/null +++ b/librpc/gen_ndr/ndr_misc.h @@ -0,0 +1,23 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/misc.h" + +#ifndef _HEADER_NDR_misc +#define _HEADER_NDR_misc + +#define NDR_MISC_CALL_COUNT (0) +enum ndr_err_code ndr_push_GUID(struct ndr_push *ndr, int ndr_flags, const struct GUID *r); +enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r); +void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *r); +size_t ndr_size_GUID(const struct GUID *r, int flags); +enum ndr_err_code ndr_push_ndr_syntax_id(struct ndr_push *ndr, int ndr_flags, const struct ndr_syntax_id *r); +enum ndr_err_code ndr_pull_ndr_syntax_id(struct ndr_pull *ndr, int ndr_flags, struct ndr_syntax_id *r); +void ndr_print_ndr_syntax_id(struct ndr_print *ndr, const char *name, const struct ndr_syntax_id *r); +enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r); +enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r); +void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r); +enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r); +enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r); +void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r); +#endif /* _HEADER_NDR_misc */ diff --git a/librpc/gen_ndr/ndr_named_pipe_auth.c b/librpc/gen_ndr/ndr_named_pipe_auth.c new file mode 100644 index 0000000000..69412bf427 --- /dev/null +++ b/librpc/gen_ndr/ndr_named_pipe_auth.c @@ -0,0 +1,302 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_named_pipe_auth.h" + +#include "librpc/gen_ndr/ndr_netlogon.h" +static enum ndr_err_code ndr_push_named_pipe_auth_req_info(struct ndr_push *ndr, int ndr_flags, const union named_pipe_auth_req_info *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + break; } + + case 1: { + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + break; + + case 1: + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_named_pipe_auth_req_info(struct ndr_pull *ndr, int ndr_flags, union named_pipe_auth_req_info *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + break; } + + case 1: { + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + break; + + case 1: + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info1)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_named_pipe_auth_req_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_req_info *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "named_pipe_auth_req_info"); + switch (level) { + case 0: + break; + + case 1: + ndr_print_netr_SamInfo3(ndr, "info1", &r->info1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_req(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_req *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_uint32 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_req(r, ndr->flags) - 4)); + ndr->flags = _flags_save_uint32; + } + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level)); + NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_req(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_req *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_uint32 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + ndr->flags = _flags_save_uint32; + } + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, 4, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level)); + NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_named_pipe_auth_req(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req *r) +{ + ndr_print_struct(ndr, name, "named_pipe_auth_req"); + ndr->depth++; + ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_req(r, ndr->flags) - 4:r->length); + ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic); + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->info, r->level); + ndr_print_named_pipe_auth_req_info(ndr, "info", &r->info); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_named_pipe_auth_req(const struct named_pipe_auth_req *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_req); +} + +static enum ndr_err_code ndr_push_named_pipe_auth_rep_info(struct ndr_push *ndr, int ndr_flags, const union named_pipe_auth_rep_info *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + break; } + + case 1: { + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + break; + + case 1: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_named_pipe_auth_rep_info(struct ndr_pull *ndr, int ndr_flags, union named_pipe_auth_rep_info *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + break; } + + case 1: { + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + break; + + case 1: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_named_pipe_auth_rep_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_rep_info *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "named_pipe_auth_rep_info"); + switch (level) { + case 0: + break; + + case 1: + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_rep(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_rep *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_uint32 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_rep(r, ndr->flags) - 4)); + ndr->flags = _flags_save_uint32; + } + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level)); + NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_rep(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_rep *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_uint32 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + ndr->flags = _flags_save_uint32; + } + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, 4, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level)); + NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_named_pipe_auth_rep(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep *r) +{ + ndr_print_struct(ndr, name, "named_pipe_auth_rep"); + ndr->depth++; + ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_rep(r, ndr->flags) - 4:r->length); + ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic); + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->info, r->level); + ndr_print_named_pipe_auth_rep_info(ndr, "info", &r->info); + ndr_print_NTSTATUS(ndr, "status", r->status); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_named_pipe_auth_rep(const struct named_pipe_auth_rep *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_rep); +} + diff --git a/librpc/gen_ndr/ndr_named_pipe_auth.h b/librpc/gen_ndr/ndr_named_pipe_auth.h new file mode 100644 index 0000000000..fbef9d5f1c --- /dev/null +++ b/librpc/gen_ndr/ndr_named_pipe_auth.h @@ -0,0 +1,20 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/named_pipe_auth.h" + +#ifndef _HEADER_NDR_named_pipe_auth +#define _HEADER_NDR_named_pipe_auth + +#define NDR_NAMED_PIPE_AUTH_CALL_COUNT (0) +void ndr_print_named_pipe_auth_req_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_req_info *r); +enum ndr_err_code ndr_push_named_pipe_auth_req(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_req *r); +enum ndr_err_code ndr_pull_named_pipe_auth_req(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_req *r); +void ndr_print_named_pipe_auth_req(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req *r); +size_t ndr_size_named_pipe_auth_req(const struct named_pipe_auth_req *r, int flags); +void ndr_print_named_pipe_auth_rep_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_rep_info *r); +enum ndr_err_code ndr_push_named_pipe_auth_rep(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_rep *r); +enum ndr_err_code ndr_pull_named_pipe_auth_rep(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_rep *r); +void ndr_print_named_pipe_auth_rep(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep *r); +size_t ndr_size_named_pipe_auth_rep(const struct named_pipe_auth_rep *r, int flags); +#endif /* _HEADER_NDR_named_pipe_auth */ diff --git a/librpc/gen_ndr/ndr_nbt.c b/librpc/gen_ndr/ndr_nbt.c new file mode 100644 index 0000000000..c02b539da5 --- /dev/null +++ b/librpc/gen_ndr/ndr_nbt.c @@ -0,0 +1,3364 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_nbt.h" + +#include "librpc/gen_ndr/ndr_misc.h" +#include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/ndr_svcctl.h" +#include "librpc/gen_ndr/ndr_samr.h" +static enum ndr_err_code ndr_push_nbt_operation(struct ndr_push *ndr, int ndr_flags, uint16_t r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_operation(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r) +{ + ndr_print_uint16(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_RCODE", NBT_RCODE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_BROADCAST", NBT_FLAG_BROADCAST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_RECURSION_AVAIL", NBT_FLAG_RECURSION_AVAIL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_RECURSION_DESIRED", NBT_FLAG_RECURSION_DESIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_TRUNCATION", NBT_FLAG_TRUNCATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_AUTHORITIVE", NBT_FLAG_AUTHORITIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_OPCODE", NBT_OPCODE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_REPLY", NBT_FLAG_REPLY, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_name_type(struct ndr_push *ndr, int ndr_flags, enum nbt_name_type r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_name_type(struct ndr_pull *ndr, int ndr_flags, enum nbt_name_type *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_name_type(struct ndr_print *ndr, const char *name, enum nbt_name_type r) +{ + const char *val = NULL; + + switch (r) { + case NBT_NAME_CLIENT: val = "NBT_NAME_CLIENT"; break; + case NBT_NAME_MS: val = "NBT_NAME_MS"; break; + case NBT_NAME_USER: val = "NBT_NAME_USER"; break; + case NBT_NAME_SERVER: val = "NBT_NAME_SERVER"; break; + case NBT_NAME_PDC: val = "NBT_NAME_PDC"; break; + case NBT_NAME_LOGON: val = "NBT_NAME_LOGON"; break; + case NBT_NAME_MASTER: val = "NBT_NAME_MASTER"; break; + case NBT_NAME_BROWSER: val = "NBT_NAME_BROWSER"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ void ndr_print_nbt_name(struct ndr_print *ndr, const char *name, const struct nbt_name *r) +{ + ndr_print_struct(ndr, name, "nbt_name"); + ndr->depth++; + ndr_print_string(ndr, "name", r->name); + ndr_print_string(ndr, "scope", r->scope); + ndr_print_nbt_name_type(ndr, "type", r->type); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_qclass(struct ndr_push *ndr, int ndr_flags, enum nbt_qclass r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_qclass(struct ndr_pull *ndr, int ndr_flags, enum nbt_qclass *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_qclass(struct ndr_print *ndr, const char *name, enum nbt_qclass r) +{ + const char *val = NULL; + + switch (r) { + case NBT_QCLASS_IP: val = "NBT_QCLASS_IP"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_qtype(struct ndr_push *ndr, int ndr_flags, enum nbt_qtype r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_qtype(struct ndr_pull *ndr, int ndr_flags, enum nbt_qtype *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_qtype(struct ndr_print *ndr, const char *name, enum nbt_qtype r) +{ + const char *val = NULL; + + switch (r) { + case NBT_QTYPE_ADDRESS: val = "NBT_QTYPE_ADDRESS"; break; + case NBT_QTYPE_NAMESERVICE: val = "NBT_QTYPE_NAMESERVICE"; break; + case NBT_QTYPE_NULL: val = "NBT_QTYPE_NULL"; break; + case NBT_QTYPE_NETBIOS: val = "NBT_QTYPE_NETBIOS"; break; + case NBT_QTYPE_STATUS: val = "NBT_QTYPE_STATUS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_nbt_name_question(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_question *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_nbt_qtype(ndr, NDR_SCALARS, r->question_type)); + NDR_CHECK(ndr_push_nbt_qclass(ndr, NDR_SCALARS, r->question_class)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_name_question(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_question *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_nbt_qtype(ndr, NDR_SCALARS, &r->question_type)); + NDR_CHECK(ndr_pull_nbt_qclass(ndr, NDR_SCALARS, &r->question_class)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_name_question(struct ndr_print *ndr, const char *name, const struct nbt_name_question *r) +{ + ndr_print_struct(ndr, name, "nbt_name_question"); + ndr->depth++; + ndr_print_nbt_name(ndr, "name", &r->name); + ndr_print_nbt_qtype(ndr, "question_type", r->question_type); + ndr_print_nbt_qclass(ndr, "question_class", r->question_class); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nb_flags(struct ndr_push *ndr, int ndr_flags, uint16_t r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nb_flags(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nb_flags(struct ndr_print *ndr, const char *name, uint16_t r) +{ + ndr_print_uint16(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_PERMANENT", NBT_NM_PERMANENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_ACTIVE", NBT_NM_ACTIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_CONFLICT", NBT_NM_CONFLICT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_DEREGISTER", NBT_NM_DEREGISTER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_OWNER_TYPE", NBT_NM_OWNER_TYPE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_GROUP", NBT_NM_GROUP, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_rdata_address(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_address *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_nb_flags(ndr, NDR_SCALARS, r->nb_flags)); + NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipaddr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_rdata_address(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_address *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_nb_flags(ndr, NDR_SCALARS, &r->nb_flags)); + NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipaddr)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_rdata_address(struct ndr_print *ndr, const char *name, const struct nbt_rdata_address *r) +{ + ndr_print_struct(ndr, name, "nbt_rdata_address"); + ndr->depth++; + ndr_print_nb_flags(ndr, "nb_flags", r->nb_flags); + ndr_print_ipv4address(ndr, "ipaddr", r->ipaddr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_rdata_netbios(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_netbios *r) +{ + uint32_t cntr_addresses_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + for (cntr_addresses_0 = 0; cntr_addresses_0 < r->length / 6; cntr_addresses_0++) { + NDR_CHECK(ndr_push_nbt_rdata_address(ndr, NDR_SCALARS, &r->addresses[cntr_addresses_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_rdata_netbios(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_netbios *r) +{ + uint32_t cntr_addresses_0; + TALLOC_CTX *_mem_save_addresses_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_PULL_ALLOC_N(ndr, r->addresses, r->length / 6); + _mem_save_addresses_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->addresses, 0); + for (cntr_addresses_0 = 0; cntr_addresses_0 < r->length / 6; cntr_addresses_0++) { + NDR_CHECK(ndr_pull_nbt_rdata_address(ndr, NDR_SCALARS, &r->addresses[cntr_addresses_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_rdata_netbios(struct ndr_print *ndr, const char *name, const struct nbt_rdata_netbios *r) +{ + uint32_t cntr_addresses_0; + ndr_print_struct(ndr, name, "nbt_rdata_netbios"); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->length / 6); + ndr->depth++; + for (cntr_addresses_0=0;cntr_addresses_0length / 6;cntr_addresses_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_addresses_0) != -1) { + ndr_print_nbt_rdata_address(ndr, "addresses", &r->addresses[cntr_addresses_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_statistics(struct ndr_push *ndr, int ndr_flags, const struct nbt_statistics *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->unit_id, 6)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->jumpers)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->test_result)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version_number)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->period_of_statistics)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_of_crcs)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_alignment_errors)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_of_collisions)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_send_aborts)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_good_sends)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_good_receives)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_retransmits)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_no_resource_conditions)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_free_command_blocks)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_number_command_blocks)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_total_number_command_blocks)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_pending_sessions)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_number_pending_sessions)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_total_sessions_possible)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->session_data_packet_size)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_statistics(struct ndr_pull *ndr, int ndr_flags, struct nbt_statistics *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->unit_id, 6)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->jumpers)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->test_result)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version_number)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->period_of_statistics)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_of_crcs)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_alignment_errors)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_of_collisions)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_send_aborts)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_good_sends)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_good_receives)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_retransmits)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_no_resource_conditions)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_free_command_blocks)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_number_command_blocks)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_total_number_command_blocks)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_pending_sessions)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_number_pending_sessions)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_total_sessions_possible)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->session_data_packet_size)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_statistics(struct ndr_print *ndr, const char *name, const struct nbt_statistics *r) +{ + ndr_print_struct(ndr, name, "nbt_statistics"); + ndr->depth++; + ndr_print_array_uint8(ndr, "unit_id", r->unit_id, 6); + ndr_print_uint8(ndr, "jumpers", r->jumpers); + ndr_print_uint8(ndr, "test_result", r->test_result); + ndr_print_uint16(ndr, "version_number", r->version_number); + ndr_print_uint16(ndr, "period_of_statistics", r->period_of_statistics); + ndr_print_uint16(ndr, "number_of_crcs", r->number_of_crcs); + ndr_print_uint16(ndr, "number_alignment_errors", r->number_alignment_errors); + ndr_print_uint16(ndr, "number_of_collisions", r->number_of_collisions); + ndr_print_uint16(ndr, "number_send_aborts", r->number_send_aborts); + ndr_print_uint32(ndr, "number_good_sends", r->number_good_sends); + ndr_print_uint32(ndr, "number_good_receives", r->number_good_receives); + ndr_print_uint16(ndr, "number_retransmits", r->number_retransmits); + ndr_print_uint16(ndr, "number_no_resource_conditions", r->number_no_resource_conditions); + ndr_print_uint16(ndr, "number_free_command_blocks", r->number_free_command_blocks); + ndr_print_uint16(ndr, "total_number_command_blocks", r->total_number_command_blocks); + ndr_print_uint16(ndr, "max_total_number_command_blocks", r->max_total_number_command_blocks); + ndr_print_uint16(ndr, "number_pending_sessions", r->number_pending_sessions); + ndr_print_uint16(ndr, "max_number_pending_sessions", r->max_number_pending_sessions); + ndr_print_uint16(ndr, "max_total_sessions_possible", r->max_total_sessions_possible); + ndr_print_uint16(ndr, "session_data_packet_size", r->session_data_packet_size); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_status_name(struct ndr_push *ndr, int ndr_flags, const struct nbt_status_name *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, 15, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_nbt_name_type(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_nb_flags(ndr, NDR_SCALARS, r->nb_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_status_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_status_name *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, 15, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_nbt_name_type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_nb_flags(ndr, NDR_SCALARS, &r->nb_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_status_name(struct ndr_print *ndr, const char *name, const struct nbt_status_name *r) +{ + ndr_print_struct(ndr, name, "nbt_status_name"); + ndr->depth++; + ndr_print_string(ndr, "name", r->name); + ndr_print_nbt_name_type(ndr, "type", r->type); + ndr_print_nb_flags(ndr, "nb_flags", r->nb_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_rdata_status(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_status *r) +{ + uint32_t cntr_names_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_names * 18 + 47)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_names)); + for (cntr_names_0 = 0; cntr_names_0 < r->num_names; cntr_names_0++) { + NDR_CHECK(ndr_push_nbt_status_name(ndr, NDR_SCALARS, &r->names[cntr_names_0])); + } + NDR_CHECK(ndr_push_nbt_statistics(ndr, NDR_SCALARS, &r->statistics)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_rdata_status(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_status *r) +{ + uint32_t cntr_names_0; + TALLOC_CTX *_mem_save_names_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_names)); + NDR_PULL_ALLOC_N(ndr, r->names, r->num_names); + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); + for (cntr_names_0 = 0; cntr_names_0 < r->num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_nbt_status_name(ndr, NDR_SCALARS, &r->names[cntr_names_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + NDR_CHECK(ndr_pull_nbt_statistics(ndr, NDR_SCALARS, &r->statistics)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_rdata_status(struct ndr_print *ndr, const char *name, const struct nbt_rdata_status *r) +{ + uint32_t cntr_names_0; + ndr_print_struct(ndr, name, "nbt_rdata_status"); + ndr->depth++; + ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->num_names * 18 + 47:r->length); + ndr_print_uint8(ndr, "num_names", r->num_names); + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->num_names); + ndr->depth++; + for (cntr_names_0=0;cntr_names_0num_names;cntr_names_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { + ndr_print_nbt_status_name(ndr, "names", &r->names[cntr_names_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_nbt_statistics(ndr, "statistics", &r->statistics); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_rdata_data(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_data *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_rdata_data(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_data *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_PULL_ALLOC_N(ndr, r->data, r->length); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const struct nbt_rdata_data *r) +{ + ndr_print_struct(ndr, name, "nbt_rdata_data"); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr_print_array_uint8(ndr, "data", r->data, r->length); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_rdata(struct ndr_push *ndr, int ndr_flags, const union nbt_rdata *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NBT_QTYPE_NETBIOS: { + NDR_CHECK(ndr_push_nbt_rdata_netbios(ndr, NDR_SCALARS, &r->netbios)); + break; } + + case NBT_QTYPE_STATUS: { + NDR_CHECK(ndr_push_nbt_rdata_status(ndr, NDR_SCALARS, &r->status)); + break; } + + default: { + NDR_CHECK(ndr_push_nbt_rdata_data(ndr, NDR_SCALARS, &r->data)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NBT_QTYPE_NETBIOS: + break; + + case NBT_QTYPE_STATUS: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_rdata(struct ndr_pull *ndr, int ndr_flags, union nbt_rdata *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case NBT_QTYPE_NETBIOS: { + NDR_CHECK(ndr_pull_nbt_rdata_netbios(ndr, NDR_SCALARS, &r->netbios)); + break; } + + case NBT_QTYPE_STATUS: { + NDR_CHECK(ndr_pull_nbt_rdata_status(ndr, NDR_SCALARS, &r->status)); + break; } + + default: { + NDR_CHECK(ndr_pull_nbt_rdata_data(ndr, NDR_SCALARS, &r->data)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case NBT_QTYPE_NETBIOS: + break; + + case NBT_QTYPE_STATUS: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "nbt_rdata"); + switch (level) { + case NBT_QTYPE_NETBIOS: + ndr_print_nbt_rdata_netbios(ndr, "netbios", &r->netbios); + break; + + case NBT_QTYPE_STATUS: + ndr_print_nbt_rdata_status(ndr, "status", &r->status); + break; + + default: + ndr_print_nbt_rdata_data(ndr, "data", &r->data); + break; + + } +} + +static enum ndr_err_code ndr_pull_nbt_res_rec(struct ndr_pull *ndr, int ndr_flags, struct nbt_res_rec *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_nbt_qtype(ndr, NDR_SCALARS, &r->rr_type)); + NDR_CHECK(ndr_pull_nbt_qclass(ndr, NDR_SCALARS, &r->rr_class)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ttl)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->rdata, r->rr_type)); + NDR_CHECK(ndr_pull_nbt_rdata(ndr, NDR_SCALARS, &r->rdata)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r) +{ + ndr_print_struct(ndr, name, "nbt_res_rec"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_nbt_name(ndr, "name", &r->name); + ndr_print_nbt_qtype(ndr, "rr_type", r->rr_type); + ndr_print_nbt_qclass(ndr, "rr_class", r->rr_class); + ndr_print_uint32(ndr, "ttl", r->ttl); + ndr_print_set_switch_value(ndr, &r->rdata, r->rr_type); + ndr_print_nbt_rdata(ndr, "rdata", &r->rdata); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r) +{ + uint32_t cntr_questions_0; + uint32_t cntr_answers_0; + uint32_t cntr_nsrecs_0; + uint32_t cntr_additional_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->name_trn_id)); + NDR_CHECK(ndr_push_nbt_operation(ndr, NDR_SCALARS, r->operation)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->qdcount)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ancount)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nscount)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->arcount)); + for (cntr_questions_0 = 0; cntr_questions_0 < r->qdcount; cntr_questions_0++) { + NDR_CHECK(ndr_push_nbt_name_question(ndr, NDR_SCALARS, &r->questions[cntr_questions_0])); + } + for (cntr_answers_0 = 0; cntr_answers_0 < r->ancount; cntr_answers_0++) { + NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->answers[cntr_answers_0])); + } + for (cntr_nsrecs_0 = 0; cntr_nsrecs_0 < r->nscount; cntr_nsrecs_0++) { + NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->nsrecs[cntr_nsrecs_0])); + } + for (cntr_additional_0 = 0; cntr_additional_0 < r->arcount; cntr_additional_0++) { + NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->additional[cntr_additional_0])); + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->padding)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r) +{ + uint32_t cntr_questions_0; + TALLOC_CTX *_mem_save_questions_0; + uint32_t cntr_answers_0; + TALLOC_CTX *_mem_save_answers_0; + uint32_t cntr_nsrecs_0; + TALLOC_CTX *_mem_save_nsrecs_0; + uint32_t cntr_additional_0; + TALLOC_CTX *_mem_save_additional_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_trn_id)); + NDR_CHECK(ndr_pull_nbt_operation(ndr, NDR_SCALARS, &r->operation)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->qdcount)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ancount)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nscount)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->arcount)); + NDR_PULL_ALLOC_N(ndr, r->questions, r->qdcount); + _mem_save_questions_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->questions, 0); + for (cntr_questions_0 = 0; cntr_questions_0 < r->qdcount; cntr_questions_0++) { + NDR_CHECK(ndr_pull_nbt_name_question(ndr, NDR_SCALARS, &r->questions[cntr_questions_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_questions_0, 0); + NDR_PULL_ALLOC_N(ndr, r->answers, r->ancount); + _mem_save_answers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->answers, 0); + for (cntr_answers_0 = 0; cntr_answers_0 < r->ancount; cntr_answers_0++) { + NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->answers[cntr_answers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_answers_0, 0); + NDR_PULL_ALLOC_N(ndr, r->nsrecs, r->nscount); + _mem_save_nsrecs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->nsrecs, 0); + for (cntr_nsrecs_0 = 0; cntr_nsrecs_0 < r->nscount; cntr_nsrecs_0++) { + NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->nsrecs[cntr_nsrecs_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nsrecs_0, 0); + NDR_PULL_ALLOC_N(ndr, r->additional, r->arcount); + _mem_save_additional_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->additional, 0); + for (cntr_additional_0 = 0; cntr_additional_0 < r->arcount; cntr_additional_0++) { + NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->additional[cntr_additional_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_additional_0, 0); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->padding)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_name_packet(struct ndr_print *ndr, const char *name, const struct nbt_name_packet *r) +{ + uint32_t cntr_questions_0; + uint32_t cntr_answers_0; + uint32_t cntr_nsrecs_0; + uint32_t cntr_additional_0; + ndr_print_struct(ndr, name, "nbt_name_packet"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint16(ndr, "name_trn_id", r->name_trn_id); + ndr_print_nbt_operation(ndr, "operation", r->operation); + ndr_print_uint16(ndr, "qdcount", r->qdcount); + ndr_print_uint16(ndr, "ancount", r->ancount); + ndr_print_uint16(ndr, "nscount", r->nscount); + ndr_print_uint16(ndr, "arcount", r->arcount); + ndr->print(ndr, "%s: ARRAY(%d)", "questions", (int)r->qdcount); + ndr->depth++; + for (cntr_questions_0=0;cntr_questions_0qdcount;cntr_questions_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_questions_0) != -1) { + ndr_print_nbt_name_question(ndr, "questions", &r->questions[cntr_questions_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "answers", (int)r->ancount); + ndr->depth++; + for (cntr_answers_0=0;cntr_answers_0ancount;cntr_answers_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_answers_0) != -1) { + ndr_print_nbt_res_rec(ndr, "answers", &r->answers[cntr_answers_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "nsrecs", (int)r->nscount); + ndr->depth++; + for (cntr_nsrecs_0=0;cntr_nsrecs_0nscount;cntr_nsrecs_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_nsrecs_0) != -1) { + ndr_print_nbt_res_rec(ndr, "nsrecs", &r->nsrecs[cntr_nsrecs_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "additional", (int)r->arcount); + ndr->depth++; + for (cntr_additional_0=0;cntr_additional_0arcount;cntr_additional_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_additional_0) != -1) { + ndr_print_nbt_res_rec(ndr, "additional", &r->additional[cntr_additional_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_DATA_BLOB(ndr, "padding", r->padding); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_dgram_msg_type(struct ndr_push *ndr, int ndr_flags, enum dgram_msg_type r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dgram_msg_type(struct ndr_pull *ndr, int ndr_flags, enum dgram_msg_type *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dgram_msg_type(struct ndr_print *ndr, const char *name, enum dgram_msg_type r) +{ + const char *val = NULL; + + switch (r) { + case DGRAM_DIRECT_UNIQUE: val = "DGRAM_DIRECT_UNIQUE"; break; + case DGRAM_DIRECT_GROUP: val = "DGRAM_DIRECT_GROUP"; break; + case DGRAM_BCAST: val = "DGRAM_BCAST"; break; + case DGRAM_ERROR: val = "DGRAM_ERROR"; break; + case DGRAM_QUERY: val = "DGRAM_QUERY"; break; + case DGRAM_QUERY_POSITIVE: val = "DGRAM_QUERY_POSITIVE"; break; + case DGRAM_QUERY_NEGATIVE: val = "DGRAM_QUERY_NEGATIVE"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dgram_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dgram_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dgram_flags(struct ndr_print *ndr, const char *name, uint8_t r) +{ + ndr_print_uint8(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_MORE", DGRAM_FLAG_MORE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_FIRST", DGRAM_FLAG_FIRST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_NODE_TYPE", DGRAM_FLAG_NODE_TYPE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_smb_command(struct ndr_push *ndr, int ndr_flags, enum smb_command r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_smb_command(struct ndr_pull *ndr, int ndr_flags, enum smb_command *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_smb_command(struct ndr_print *ndr, const char *name, enum smb_command r) +{ + const char *val = NULL; + + switch (r) { + case SMB_TRANSACTION: val = "SMB_TRANSACTION"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_smb_trans_body(struct ndr_push *ndr, int ndr_flags, const struct smb_trans_body *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 17)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_param_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_data_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_param_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_data_count)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->max_setup_count)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->trans_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->param_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->param_offset)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data_offset)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 3)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opcode)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->priority)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->_class)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->mailslot_name) + 1 + r->data.length)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_smb_trans_body(struct ndr_pull *ndr, int ndr_flags, struct smb_trans_body *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->wct)); + if (r->wct < 17 || r->wct > 17) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_param_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_data_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_param_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_data_count)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->max_setup_count)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->trans_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->param_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->param_offset)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_offset)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->setup_count)); + if (r->setup_count < 3 || r->setup_count > 3) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opcode)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->priority)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->_class)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->byte_count)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_smb_trans_body(struct ndr_print *ndr, const char *name, const struct smb_trans_body *r) +{ + ndr_print_struct(ndr, name, "smb_trans_body"); + ndr->depth++; + ndr_print_uint8(ndr, "wct", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?17:r->wct); + ndr_print_uint16(ndr, "total_param_count", r->total_param_count); + ndr_print_uint16(ndr, "total_data_count", r->total_data_count); + ndr_print_uint16(ndr, "max_param_count", r->max_param_count); + ndr_print_uint16(ndr, "max_data_count", r->max_data_count); + ndr_print_uint8(ndr, "max_setup_count", r->max_setup_count); + ndr_print_uint8(ndr, "pad", r->pad); + ndr_print_uint16(ndr, "trans_flags", r->trans_flags); + ndr_print_uint32(ndr, "timeout", r->timeout); + ndr_print_uint16(ndr, "reserved", r->reserved); + ndr_print_uint16(ndr, "param_count", r->param_count); + ndr_print_uint16(ndr, "param_offset", r->param_offset); + ndr_print_uint16(ndr, "data_count", r->data_count); + ndr_print_uint16(ndr, "data_offset", r->data_offset); + ndr_print_uint8(ndr, "setup_count", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?3:r->setup_count); + ndr_print_uint8(ndr, "pad2", r->pad2); + ndr_print_uint16(ndr, "opcode", r->opcode); + ndr_print_uint16(ndr, "priority", r->priority); + ndr_print_uint16(ndr, "_class", r->_class); + ndr_print_uint16(ndr, "byte_count", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->mailslot_name) + 1 + r->data.length:r->byte_count); + ndr_print_string(ndr, "mailslot_name", r->mailslot_name); + ndr_print_DATA_BLOB(ndr, "data", r->data); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_smb_body(struct ndr_push *ndr, int ndr_flags, const union smb_body *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SMB_TRANSACTION: { + NDR_CHECK(ndr_push_smb_trans_body(ndr, NDR_SCALARS, &r->trans)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SMB_TRANSACTION: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_smb_body(struct ndr_pull *ndr, int ndr_flags, union smb_body *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case SMB_TRANSACTION: { + NDR_CHECK(ndr_pull_smb_trans_body(ndr, NDR_SCALARS, &r->trans)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case SMB_TRANSACTION: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_smb_body(struct ndr_print *ndr, const char *name, const union smb_body *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "smb_body"); + switch (level) { + case SMB_TRANSACTION: + ndr_print_smb_trans_body(ndr, "trans", &r->trans); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_dgram_smb_packet(struct ndr_push *ndr, int ndr_flags, const struct dgram_smb_packet *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_smb_command(ndr, NDR_SCALARS, r->smb_command)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->err_class)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->err_code)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->flags2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->pid_high)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->signature, 8)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->tid)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->pid)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->vuid)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->mid)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->body, r->smb_command)); + NDR_CHECK(ndr_push_smb_body(ndr, NDR_SCALARS, &r->body)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_dgram_smb_packet(struct ndr_pull *ndr, int ndr_flags, struct dgram_smb_packet *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_smb_command(ndr, NDR_SCALARS, &r->smb_command)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->err_class)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->err_code)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->pid_high)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->signature, 8)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->tid)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->pid)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->vuid)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->mid)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->body, r->smb_command)); + NDR_CHECK(ndr_pull_smb_body(ndr, NDR_SCALARS, &r->body)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dgram_smb_packet(struct ndr_print *ndr, const char *name, const struct dgram_smb_packet *r) +{ + ndr_print_struct(ndr, name, "dgram_smb_packet"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_smb_command(ndr, "smb_command", r->smb_command); + ndr_print_uint8(ndr, "err_class", r->err_class); + ndr_print_uint8(ndr, "pad", r->pad); + ndr_print_uint16(ndr, "err_code", r->err_code); + ndr_print_uint8(ndr, "flags", r->flags); + ndr_print_uint16(ndr, "flags2", r->flags2); + ndr_print_uint16(ndr, "pid_high", r->pid_high); + ndr_print_array_uint8(ndr, "signature", r->signature, 8); + ndr_print_uint16(ndr, "reserved", r->reserved); + ndr_print_uint16(ndr, "tid", r->tid); + ndr_print_uint16(ndr, "pid", r->pid); + ndr_print_uint16(ndr, "vuid", r->vuid); + ndr_print_uint16(ndr, "mid", r->mid); + ndr_print_set_switch_value(ndr, &r->body, r->smb_command); + ndr_print_smb_body(ndr, "body", &r->body); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_dgram_message_body(struct ndr_push *ndr, int ndr_flags, const union dgram_message_body *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case DGRAM_SMB: { + NDR_CHECK(ndr_push_dgram_smb_packet(ndr, NDR_SCALARS, &r->smb)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case DGRAM_SMB: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dgram_message_body(struct ndr_pull *ndr, int ndr_flags, union dgram_message_body *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case DGRAM_SMB: { + NDR_CHECK(ndr_pull_dgram_smb_packet(ndr, NDR_SCALARS, &r->smb)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case DGRAM_SMB: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dgram_message_body(struct ndr_print *ndr, const char *name, const union dgram_message_body *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "dgram_message_body"); + switch (level) { + case DGRAM_SMB: + ndr_print_dgram_smb_packet(ndr, "smb", &r->smb); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_dgram_message(struct ndr_push *ndr, int ndr_flags, const struct dgram_message *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->offset)); + NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->source_name)); + NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dgram_body_type)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->body, r->dgram_body_type)); + NDR_CHECK(ndr_push_dgram_message_body(ndr, NDR_SCALARS, &r->body)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dgram_message(struct ndr_pull *ndr, int ndr_flags, struct dgram_message *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->offset)); + NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->source_name)); + NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dgram_body_type)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->body, r->dgram_body_type)); + NDR_CHECK(ndr_pull_dgram_message_body(ndr, NDR_SCALARS, &r->body)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dgram_message(struct ndr_print *ndr, const char *name, const struct dgram_message *r) +{ + ndr_print_struct(ndr, name, "dgram_message"); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr_print_uint16(ndr, "offset", r->offset); + ndr_print_nbt_name(ndr, "source_name", &r->source_name); + ndr_print_nbt_name(ndr, "dest_name", &r->dest_name); + ndr_print_uint32(ndr, "dgram_body_type", r->dgram_body_type); + ndr_print_set_switch_value(ndr, &r->body, r->dgram_body_type); + ndr_print_dgram_message_body(ndr, "body", &r->body); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dgram_err_code(struct ndr_push *ndr, int ndr_flags, enum dgram_err_code r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dgram_err_code(struct ndr_pull *ndr, int ndr_flags, enum dgram_err_code *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dgram_err_code(struct ndr_print *ndr, const char *name, enum dgram_err_code r) +{ + const char *val = NULL; + + switch (r) { + case DGRAM_ERROR_NAME_NOT_PRESENT: val = "DGRAM_ERROR_NAME_NOT_PRESENT"; break; + case DGRAM_ERROR_INVALID_SOURCE: val = "DGRAM_ERROR_INVALID_SOURCE"; break; + case DGRAM_ERROR_INVALID_DEST: val = "DGRAM_ERROR_INVALID_DEST"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dgram_data(struct ndr_push *ndr, int ndr_flags, const union dgram_data *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case DGRAM_DIRECT_UNIQUE: { + NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg)); + break; } + + case DGRAM_DIRECT_GROUP: { + NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg)); + break; } + + case DGRAM_BCAST: { + NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg)); + break; } + + case DGRAM_ERROR: { + NDR_CHECK(ndr_push_dgram_err_code(ndr, NDR_SCALARS, r->error)); + break; } + + case DGRAM_QUERY: { + NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); + break; } + + case DGRAM_QUERY_POSITIVE: { + NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); + break; } + + case DGRAM_QUERY_NEGATIVE: { + NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case DGRAM_DIRECT_UNIQUE: + break; + + case DGRAM_DIRECT_GROUP: + break; + + case DGRAM_BCAST: + break; + + case DGRAM_ERROR: + break; + + case DGRAM_QUERY: + break; + + case DGRAM_QUERY_POSITIVE: + break; + + case DGRAM_QUERY_NEGATIVE: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dgram_data(struct ndr_pull *ndr, int ndr_flags, union dgram_data *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case DGRAM_DIRECT_UNIQUE: { + NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg)); + break; } + + case DGRAM_DIRECT_GROUP: { + NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg)); + break; } + + case DGRAM_BCAST: { + NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg)); + break; } + + case DGRAM_ERROR: { + NDR_CHECK(ndr_pull_dgram_err_code(ndr, NDR_SCALARS, &r->error)); + break; } + + case DGRAM_QUERY: { + NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); + break; } + + case DGRAM_QUERY_POSITIVE: { + NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); + break; } + + case DGRAM_QUERY_NEGATIVE: { + NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case DGRAM_DIRECT_UNIQUE: + break; + + case DGRAM_DIRECT_GROUP: + break; + + case DGRAM_BCAST: + break; + + case DGRAM_ERROR: + break; + + case DGRAM_QUERY: + break; + + case DGRAM_QUERY_POSITIVE: + break; + + case DGRAM_QUERY_NEGATIVE: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union dgram_data *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "dgram_data"); + switch (level) { + case DGRAM_DIRECT_UNIQUE: + ndr_print_dgram_message(ndr, "msg", &r->msg); + break; + + case DGRAM_DIRECT_GROUP: + ndr_print_dgram_message(ndr, "msg", &r->msg); + break; + + case DGRAM_BCAST: + ndr_print_dgram_message(ndr, "msg", &r->msg); + break; + + case DGRAM_ERROR: + ndr_print_dgram_err_code(ndr, "error", r->error); + break; + + case DGRAM_QUERY: + ndr_print_nbt_name(ndr, "dest_name", &r->dest_name); + break; + + case DGRAM_QUERY_POSITIVE: + ndr_print_nbt_name(ndr, "dest_name", &r->dest_name); + break; + + case DGRAM_QUERY_NEGATIVE: + ndr_print_nbt_name(ndr, "dest_name", &r->dest_name); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dgram_msg_type(ndr, NDR_SCALARS, r->msg_type)); + NDR_CHECK(ndr_push_dgram_flags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->dgram_id)); + NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->src_addr)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->src_port)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->data, r->msg_type)); + NDR_CHECK(ndr_push_dgram_data(ndr, NDR_SCALARS, &r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dgram_msg_type(ndr, NDR_SCALARS, &r->msg_type)); + NDR_CHECK(ndr_pull_dgram_flags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->dgram_id)); + NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->src_addr)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->src_port)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->data, r->msg_type)); + NDR_CHECK(ndr_pull_dgram_data(ndr, NDR_SCALARS, &r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r) +{ + ndr_print_struct(ndr, name, "nbt_dgram_packet"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_dgram_msg_type(ndr, "msg_type", r->msg_type); + ndr_print_dgram_flags(ndr, "flags", r->flags); + ndr_print_uint16(ndr, "dgram_id", r->dgram_id); + ndr_print_ipv4address(ndr, "src_addr", r->src_addr); + ndr_print_uint16(ndr, "src_port", r->src_port); + ndr_print_set_switch_value(ndr, &r->data, r->msg_type); + ndr_print_dgram_data(ndr, "data", &r->data); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_sockaddr(struct ndr_push *ndr, int ndr_flags, const struct nbt_sockaddr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sockaddr_family)); + { + uint32_t _flags_save_ipv4address = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip)); + ndr->flags = _flags_save_ipv4address; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_sockaddr(struct ndr_pull *ndr, int ndr_flags, struct nbt_sockaddr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sockaddr_family)); + { + uint32_t _flags_save_ipv4address = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); + NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip)); + ndr->flags = _flags_save_ipv4address; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_sockaddr(struct ndr_print *ndr, const char *name, const struct nbt_sockaddr *r) +{ + ndr_print_struct(ndr, name, "nbt_sockaddr"); + ndr->depth++; + ndr_print_uint32(ndr, "sockaddr_family", r->sockaddr_family); + ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip); + ndr_print_DATA_BLOB(ndr, "remaining", r->remaining); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_nbt_sockaddr(const struct nbt_sockaddr *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_nbt_sockaddr); +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_server_type(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_server_type(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_PDC", NBT_SERVER_PDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GC", NBT_SERVER_GC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_LDAP", NBT_SERVER_LDAP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_DS", NBT_SERVER_DS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_KDC", NBT_SERVER_KDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_TIMESERV", NBT_SERVER_TIMESERV, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_CLOSEST", NBT_SERVER_CLOSEST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_WRITABLE", NBT_SERVER_WRITABLE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GOOD_TIMESERV", NBT_SERVER_GOOD_TIMESERV, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_NDNC", NBT_SERVER_NDNC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_SELECT_SECRET_DOMAIN_6", NBT_SERVER_SELECT_SECRET_DOMAIN_6, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_FULL_SECRET_DOMAIN_6", NBT_SERVER_FULL_SECRET_DOMAIN_6, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netlogon_nt_version_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netlogon_nt_version_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netlogon_nt_version_flags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_1", NETLOGON_NT_VERSION_1, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5", NETLOGON_NT_VERSION_5, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX", NETLOGON_NT_VERSION_5EX, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX_WITH_IP", NETLOGON_NT_VERSION_5EX_WITH_IP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", NETLOGON_NT_VERSION_WITH_CLOSEST_SITE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_AVIOD_NT4EMUL", NETLOGON_NT_VERSION_AVIOD_NT4EMUL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_PDC", NETLOGON_NT_VERSION_PDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_IP", NETLOGON_NT_VERSION_IP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_LOCAL", NETLOGON_NT_VERSION_LOCAL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_GC", NETLOGON_NT_VERSION_GC, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netlogon_command(struct ndr_push *ndr, int ndr_flags, enum netlogon_command r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netlogon_command(struct ndr_pull *ndr, int ndr_flags, enum netlogon_command *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netlogon_command(struct ndr_print *ndr, const char *name, enum netlogon_command r) +{ + const char *val = NULL; + + switch (r) { + case LOGON_PRIMARY_QUERY: val = "LOGON_PRIMARY_QUERY"; break; + case NETLOGON_ANNOUNCE_UAS: val = "NETLOGON_ANNOUNCE_UAS"; break; + case NETLOGON_RESPONSE_FROM_PDC: val = "NETLOGON_RESPONSE_FROM_PDC"; break; + case LOGON_SAM_LOGON_REQUEST: val = "LOGON_SAM_LOGON_REQUEST"; break; + case LOGON_SAM_LOGON_RESPONSE: val = "LOGON_SAM_LOGON_RESPONSE"; break; + case LOGON_SAM_LOGON_PAUSE_RESPONSE: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE"; break; + case LOGON_SAM_LOGON_USER_UNKNOWN: val = "LOGON_SAM_LOGON_USER_UNKNOWN"; break; + case LOGON_SAM_LOGON_RESPONSE_EX: val = "LOGON_SAM_LOGON_RESPONSE_EX"; break; + case LOGON_SAM_LOGON_PAUSE_RESPONSE_EX: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE_EX"; break; + case LOGON_SAM_LOGON_USER_UNKNOWN_EX: val = "LOGON_SAM_LOGON_USER_UNKNOWN_EX"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_REQUEST(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_REQUEST *r) +{ + ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_REQUEST"); + ndr->depth++; + ndr_print_uint16(ndr, "request_count", r->request_count); + ndr_print_string(ndr, "computer_name", r->computer_name); + ndr_print_string(ndr, "user_name", r->user_name); + ndr_print_string(ndr, "mailslot_name", r->mailslot_name); + ndr_print_samr_AcctFlags(ndr, "acct_control", r->acct_control); + ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size); + ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); + ndr_print_dom_sid0(ndr, "sid", &r->sid); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r) +{ + ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_NT40"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_netlogon_command(ndr, "command", r->command); + ndr_print_string(ndr, "server", r->server); + ndr_print_string(ndr, "user_name", r->user_name); + ndr_print_string(ndr, "domain", r->domain); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->zero_uuid)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); + NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip)); + NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->zero_uuid)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); + NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip)); + NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE *r) +{ + ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_netlogon_command(ndr, "command", r->command); + ndr_print_string(ndr, "pdc_name", r->pdc_name); + ndr_print_string(ndr, "user_name", r->user_name); + ndr_print_string(ndr, "domain_name", r->domain_name); + ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); + ndr_print_GUID(ndr, "zero_uuid", &r->zero_uuid); + ndr_print_nbt_string(ndr, "forest", r->forest); + ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); + ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); + ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip); + ndr_print_nbt_server_type(ndr, "server_type", r->server_type); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz)); + NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site)); + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); + { + struct ndr_push *_ndr_sockaddr; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); + NDR_CHECK(ndr_push_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); + } + NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->next_closest_site)); + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz)); + NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site)); + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sockaddr_size)); + { + struct ndr_pull *_ndr_sockaddr; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sockaddr, 0, r->sockaddr_size)); + NDR_CHECK(ndr_pull_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sockaddr, 0, r->sockaddr_size)); + } + NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->next_closest_site)); + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) +{ + ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_EX"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_netlogon_command(ndr, "command", r->command); + ndr_print_uint16(ndr, "sbz", r->sbz); + ndr_print_nbt_server_type(ndr, "server_type", r->server_type); + ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); + ndr_print_nbt_string(ndr, "forest", r->forest); + ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); + ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); + ndr_print_nbt_string(ndr, "domain", r->domain); + ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name); + ndr_print_nbt_string(ndr, "user_name", r->user_name); + ndr_print_nbt_string(ndr, "server_site", r->server_site); + ndr_print_nbt_string(ndr, "client_site", r->client_site); + ndr_print_uint8(ndr, "sockaddr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags):r->sockaddr_size); + ndr_print_nbt_sockaddr(ndr, "sockaddr", &r->sockaddr); + ndr_print_nbt_string(ndr, "next_closest_site", r->next_closest_site); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_nbt_netlogon_query_for_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_query_for_pdc *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_netlogon_query_for_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_query_for_pdc *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r) +{ + ndr_print_struct(ndr, name, "nbt_netlogon_query_for_pdc"); + ndr->depth++; + ndr_print_string(ndr, "computer_name", r->computer_name); + ndr_print_string(ndr, "mailslot_name", r->mailslot_name); + ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); + ndr_print_string(ndr, "unicode_name", r->unicode_name); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_response_from_pdc *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_response_from_pdc *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r) +{ + ndr_print_struct(ndr, name, "nbt_netlogon_response_from_pdc"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_netlogon_command(ndr, "command", r->command); + ndr_print_string(ndr, "pdc_name", r->pdc_name); + ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); + ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name); + ndr_print_string(ndr, "domain_name", r->domain_name); + ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); + ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); + ndr_print_uint16(ndr, "lm20_token", r->lm20_token); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_nbt_db_change_info(struct ndr_push *ndr, int ndr_flags, const struct nbt_db_change_info *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->db_index)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->serial)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->timestamp)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_db_change_info(struct ndr_pull *ndr, int ndr_flags, struct nbt_db_change_info *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->db_index)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->serial)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->timestamp)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_db_change_info(struct ndr_print *ndr, const char *name, const struct nbt_db_change_info *r) +{ + ndr_print_struct(ndr, name, "nbt_db_change_info"); + ndr->depth++; + ndr_print_netr_SamDatabaseID(ndr, "db_index", r->db_index); + ndr_print_hyper(ndr, "serial", r->serial); + ndr_print_NTTIME(ndr, "timestamp", r->timestamp); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_NETLOGON_DB_CHANGE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_DB_CHANGE *r) +{ + uint32_t cntr_dbchange_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_lo)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pulse)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->random)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_domain)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->db_count)); + for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) { + NDR_CHECK(ndr_push_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0])); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags))); + { + struct ndr_push *_ndr_sid; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags))); + NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags))); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_format_version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_NETLOGON_DB_CHANGE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_DB_CHANGE *r) +{ + uint32_t cntr_dbchange_0; + TALLOC_CTX *_mem_save_dbchange_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_lo)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pulse)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->random)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); + ndr->flags = _flags_save_DATA_BLOB; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_domain)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->db_count)); + NDR_PULL_ALLOC_N(ndr, r->dbchange, r->db_count); + _mem_save_dbchange_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dbchange, 0); + for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) { + NDR_CHECK(ndr_pull_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dbchange_0, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size)); + { + struct ndr_pull *_ndr_sid; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size)); + NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size)); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_format_version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NETLOGON_DB_CHANGE(struct ndr_print *ndr, const char *name, const struct NETLOGON_DB_CHANGE *r) +{ + uint32_t cntr_dbchange_0; + ndr_print_struct(ndr, name, "NETLOGON_DB_CHANGE"); + ndr->depth++; + ndr_print_uint32(ndr, "serial_lo", r->serial_lo); + ndr_print_time_t(ndr, "timestamp", r->timestamp); + ndr_print_uint32(ndr, "pulse", r->pulse); + ndr_print_uint32(ndr, "random", r->random); + ndr_print_string(ndr, "pdc_name", r->pdc_name); + ndr_print_string(ndr, "domain", r->domain); + ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); + ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name); + ndr_print_string(ndr, "unicode_domain", r->unicode_domain); + ndr_print_uint32(ndr, "db_count", r->db_count); + ndr->print(ndr, "%s: ARRAY(%d)", "dbchange", (int)r->db_count); + ndr->depth++; + for (cntr_dbchange_0=0;cntr_dbchange_0db_count;cntr_dbchange_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_dbchange_0) != -1) { + ndr_print_nbt_db_change_info(ndr, "dbchange", &r->dbchange[cntr_dbchange_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size); + ndr_print_dom_sid0(ndr, "sid", &r->sid); + ndr_print_uint32(ndr, "message_format_version", r->message_format_version); + ndr_print_uint32(ndr, "message_token", r->message_token); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_netlogon_request(struct ndr_push *ndr, int ndr_flags, const union nbt_netlogon_request *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case LOGON_SAM_LOGON_REQUEST: { + NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon)); + break; } + + case LOGON_PRIMARY_QUERY: { + NDR_CHECK(ndr_push_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc)); + break; } + + case NETLOGON_ANNOUNCE_UAS: { + NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case LOGON_SAM_LOGON_REQUEST: + NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon)); + break; + + case LOGON_PRIMARY_QUERY: + break; + + case NETLOGON_ANNOUNCE_UAS: + NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_netlogon_request(struct ndr_pull *ndr, int ndr_flags, union nbt_netlogon_request *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case LOGON_SAM_LOGON_REQUEST: { + NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon)); + break; } + + case LOGON_PRIMARY_QUERY: { + NDR_CHECK(ndr_pull_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc)); + break; } + + case NETLOGON_ANNOUNCE_UAS: { + NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case LOGON_SAM_LOGON_REQUEST: + NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon)); + break; + + case LOGON_PRIMARY_QUERY: + break; + + case NETLOGON_ANNOUNCE_UAS: + NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "nbt_netlogon_request"); + switch (level) { + case LOGON_SAM_LOGON_REQUEST: + ndr_print_NETLOGON_SAM_LOGON_REQUEST(ndr, "logon", &r->logon); + break; + + case LOGON_PRIMARY_QUERY: + ndr_print_nbt_netlogon_query_for_pdc(ndr, "pdc", &r->pdc); + break; + + case NETLOGON_ANNOUNCE_UAS: + ndr_print_NETLOGON_DB_CHANGE(ndr, "uas", &r->uas); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->req, r->command)); + NDR_CHECK(ndr_push_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_nbt_netlogon_request(ndr, NDR_BUFFERS, &r->req)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->req, r->command)); + NDR_CHECK(ndr_pull_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_nbt_netlogon_request(ndr, NDR_BUFFERS, &r->req)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r) +{ + ndr_print_struct(ndr, name, "nbt_netlogon_packet"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_netlogon_command(ndr, "command", r->command); + ndr_print_set_switch_value(ndr, &r->req, r->command); + ndr_print_nbt_netlogon_request(ndr, "req", &r->req); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_nbt_browse_opcode(struct ndr_push *ndr, int ndr_flags, enum nbt_browse_opcode r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_opcode(struct ndr_pull *ndr, int ndr_flags, enum nbt_browse_opcode *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r) +{ + const char *val = NULL; + + switch (r) { + case HostAnnouncement: val = "HostAnnouncement"; break; + case AnnouncementRequest: val = "AnnouncementRequest"; break; + case Election: val = "Election"; break; + case GetBackupListReq: val = "GetBackupListReq"; break; + case GetBackupListResp: val = "GetBackupListResp"; break; + case BecomeBackup: val = "BecomeBackup"; break; + case DomainAnnouncement: val = "DomainAnnouncement"; break; + case MasterAnnouncement: val = "MasterAnnouncement"; break; + case ResetBrowserState: val = "ResetBrowserState"; break; + case LocalMasterAnnouncement: val = "LocalMasterAnnouncement"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_nbt_browse_host_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_host_announcement *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor)); + NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMajorVer)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMinorVer)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Signature)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_host_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_host_announcement *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, 16, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor)); + NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMajorVer)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMinorVer)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Signature)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_host_announcement"); + ndr->depth++; + ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount); + ndr_print_uint32(ndr, "Periodicity", r->Periodicity); + ndr_print_string(ndr, "ServerName", r->ServerName); + ndr_print_uint8(ndr, "OSMajor", r->OSMajor); + ndr_print_uint8(ndr, "OSMinor", r->OSMinor); + ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType); + ndr_print_uint8(ndr, "BroMajorVer", r->BroMajorVer); + ndr_print_uint8(ndr, "BroMinorVer", r->BroMinorVer); + ndr_print_uint16(ndr, "Signature", r->Signature); + ndr_print_string(ndr, "Comment", r->Comment); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_announcement_request(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_announcement_request *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Unused)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ResponseName)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_announcement_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_announcement_request *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Unused)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ResponseName)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_announcement_request"); + ndr->depth++; + ndr_print_uint8(ndr, "Unused", r->Unused); + ndr_print_string(ndr, "ResponseName", r->ResponseName); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_election_request(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_election_request *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Criteria)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->UpTime)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Reserved)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ServerName)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_election_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_election_request *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Criteria)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->UpTime)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Reserved)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ServerName)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_election_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_election_request *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_election_request"); + ndr->depth++; + ndr_print_uint8(ndr, "Version", r->Version); + ndr_print_uint32(ndr, "Criteria", r->Criteria); + ndr_print_uint32(ndr, "UpTime", r->UpTime); + ndr_print_uint32(ndr, "Reserved", r->Reserved); + ndr_print_string(ndr, "ServerName", r->ServerName); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_backup_list_request(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_backup_list_request *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ReqCount)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_backup_list_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_backup_list_request *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ReqCount)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Token)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_backup_list_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_request *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_backup_list_request"); + ndr->depth++; + ndr_print_uint8(ndr, "ReqCount", r->ReqCount); + ndr_print_uint32(ndr, "Token", r->Token); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_backup_list_response(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_backup_list_response *r) +{ + uint32_t cntr_BackupServerList_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BackupCount)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Token)); + for (cntr_BackupServerList_0 = 0; cntr_BackupServerList_0 < r->BackupCount; cntr_BackupServerList_0++) { + NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->BackupServerList[cntr_BackupServerList_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_backup_list_response(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_backup_list_response *r) +{ + uint32_t cntr_BackupServerList_0; + TALLOC_CTX *_mem_save_BackupServerList_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BackupCount)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Token)); + NDR_PULL_ALLOC_N(ndr, r->BackupServerList, r->BackupCount); + _mem_save_BackupServerList_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->BackupServerList, 0); + for (cntr_BackupServerList_0 = 0; cntr_BackupServerList_0 < r->BackupCount; cntr_BackupServerList_0++) { + NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->BackupServerList[cntr_BackupServerList_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_BackupServerList_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_backup_list_response(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_response *r) +{ + uint32_t cntr_BackupServerList_0; + ndr_print_struct(ndr, name, "nbt_browse_backup_list_response"); + ndr->depth++; + ndr_print_uint8(ndr, "BackupCount", r->BackupCount); + ndr_print_uint32(ndr, "Token", r->Token); + ndr->print(ndr, "%s: ARRAY(%d)", "BackupServerList", (int)r->BackupCount); + ndr->depth++; + for (cntr_BackupServerList_0=0;cntr_BackupServerList_0BackupCount;cntr_BackupServerList_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_BackupServerList_0) != -1) { + ndr_print_nbt_name(ndr, "BackupServerList", &r->BackupServerList[cntr_BackupServerList_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_become_backup(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_become_backup *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->BrowserName)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_become_backup(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_become_backup *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->BrowserName)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_become_backup(struct ndr_print *ndr, const char *name, const struct nbt_browse_become_backup *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_become_backup"); + ndr->depth++; + ndr_print_string(ndr, "BrowserName", r->BrowserName); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_domain_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_domain_announcement *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor)); + NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->MysteriousField)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_domain_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_domain_announcement *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, 16, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor)); + NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MysteriousField)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_domain_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_domain_announcement *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_domain_announcement"); + ndr->depth++; + ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount); + ndr_print_uint32(ndr, "Periodicity", r->Periodicity); + ndr_print_string(ndr, "ServerName", r->ServerName); + ndr_print_uint8(ndr, "OSMajor", r->OSMajor); + ndr_print_uint8(ndr, "OSMinor", r->OSMinor); + ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType); + ndr_print_uint32(ndr, "MysteriousField", r->MysteriousField); + ndr_print_string(ndr, "Comment", r->Comment); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_master_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_master_announcement *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ServerName)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_master_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_master_announcement *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ServerName)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_master_announcement *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_master_announcement"); + ndr->depth++; + ndr_print_string(ndr, "ServerName", r->ServerName); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_reset_state(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_reset_state *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Command)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_reset_state(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_reset_state *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Command)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_reset_state(struct ndr_print *ndr, const char *name, const struct nbt_browse_reset_state *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_reset_state"); + ndr->depth++; + ndr_print_uint8(ndr, "Command", r->Command); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_local_master_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_local_master_announcement *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor)); + NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMajorVer)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMinorVer)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Signature)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_local_master_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_local_master_announcement *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, 16, sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor)); + NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMajorVer)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMinorVer)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Signature)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_local_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_local_master_announcement *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_local_master_announcement"); + ndr->depth++; + ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount); + ndr_print_uint32(ndr, "Periodicity", r->Periodicity); + ndr_print_string(ndr, "ServerName", r->ServerName); + ndr_print_uint8(ndr, "OSMajor", r->OSMajor); + ndr_print_uint8(ndr, "OSMinor", r->OSMinor); + ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType); + ndr_print_uint8(ndr, "BroMajorVer", r->BroMajorVer); + ndr_print_uint8(ndr, "BroMinorVer", r->BroMinorVer); + ndr_print_uint16(ndr, "Signature", r->Signature); + ndr_print_string(ndr, "Comment", r->Comment); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_nbt_browse_payload(struct ndr_push *ndr, int ndr_flags, const union nbt_browse_payload *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case HostAnnouncement: { + NDR_CHECK(ndr_push_nbt_browse_host_announcement(ndr, NDR_SCALARS, &r->host_annoucement)); + break; } + + case AnnouncementRequest: { + NDR_CHECK(ndr_push_nbt_browse_announcement_request(ndr, NDR_SCALARS, &r->announcement_request)); + break; } + + case Election: { + NDR_CHECK(ndr_push_nbt_browse_election_request(ndr, NDR_SCALARS, &r->election_request)); + break; } + + case GetBackupListReq: { + NDR_CHECK(ndr_push_nbt_browse_backup_list_request(ndr, NDR_SCALARS, &r->backup_list_request)); + break; } + + case GetBackupListResp: { + NDR_CHECK(ndr_push_nbt_browse_backup_list_response(ndr, NDR_SCALARS, &r->backup_list_response)); + break; } + + case BecomeBackup: { + NDR_CHECK(ndr_push_nbt_browse_become_backup(ndr, NDR_SCALARS, &r->become_backup)); + break; } + + case DomainAnnouncement: { + NDR_CHECK(ndr_push_nbt_browse_domain_announcement(ndr, NDR_SCALARS, &r->domain_announcement)); + break; } + + case MasterAnnouncement: { + NDR_CHECK(ndr_push_nbt_browse_master_announcement(ndr, NDR_SCALARS, &r->master_announcement)); + break; } + + case ResetBrowserState: { + NDR_CHECK(ndr_push_nbt_browse_reset_state(ndr, NDR_SCALARS, &r->reset_browser_state)); + break; } + + case LocalMasterAnnouncement: { + NDR_CHECK(ndr_push_nbt_browse_local_master_announcement(ndr, NDR_SCALARS, &r->local_master_announcement)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case HostAnnouncement: + break; + + case AnnouncementRequest: + break; + + case Election: + break; + + case GetBackupListReq: + break; + + case GetBackupListResp: + break; + + case BecomeBackup: + break; + + case DomainAnnouncement: + break; + + case MasterAnnouncement: + break; + + case ResetBrowserState: + break; + + case LocalMasterAnnouncement: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_nbt_browse_payload(struct ndr_pull *ndr, int ndr_flags, union nbt_browse_payload *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case HostAnnouncement: { + NDR_CHECK(ndr_pull_nbt_browse_host_announcement(ndr, NDR_SCALARS, &r->host_annoucement)); + break; } + + case AnnouncementRequest: { + NDR_CHECK(ndr_pull_nbt_browse_announcement_request(ndr, NDR_SCALARS, &r->announcement_request)); + break; } + + case Election: { + NDR_CHECK(ndr_pull_nbt_browse_election_request(ndr, NDR_SCALARS, &r->election_request)); + break; } + + case GetBackupListReq: { + NDR_CHECK(ndr_pull_nbt_browse_backup_list_request(ndr, NDR_SCALARS, &r->backup_list_request)); + break; } + + case GetBackupListResp: { + NDR_CHECK(ndr_pull_nbt_browse_backup_list_response(ndr, NDR_SCALARS, &r->backup_list_response)); + break; } + + case BecomeBackup: { + NDR_CHECK(ndr_pull_nbt_browse_become_backup(ndr, NDR_SCALARS, &r->become_backup)); + break; } + + case DomainAnnouncement: { + NDR_CHECK(ndr_pull_nbt_browse_domain_announcement(ndr, NDR_SCALARS, &r->domain_announcement)); + break; } + + case MasterAnnouncement: { + NDR_CHECK(ndr_pull_nbt_browse_master_announcement(ndr, NDR_SCALARS, &r->master_announcement)); + break; } + + case ResetBrowserState: { + NDR_CHECK(ndr_pull_nbt_browse_reset_state(ndr, NDR_SCALARS, &r->reset_browser_state)); + break; } + + case LocalMasterAnnouncement: { + NDR_CHECK(ndr_pull_nbt_browse_local_master_announcement(ndr, NDR_SCALARS, &r->local_master_announcement)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case HostAnnouncement: + break; + + case AnnouncementRequest: + break; + + case Election: + break; + + case GetBackupListReq: + break; + + case GetBackupListResp: + break; + + case BecomeBackup: + break; + + case DomainAnnouncement: + break; + + case MasterAnnouncement: + break; + + case ResetBrowserState: + break; + + case LocalMasterAnnouncement: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_payload(struct ndr_print *ndr, const char *name, const union nbt_browse_payload *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "nbt_browse_payload"); + switch (level) { + case HostAnnouncement: + ndr_print_nbt_browse_host_announcement(ndr, "host_annoucement", &r->host_annoucement); + break; + + case AnnouncementRequest: + ndr_print_nbt_browse_announcement_request(ndr, "announcement_request", &r->announcement_request); + break; + + case Election: + ndr_print_nbt_browse_election_request(ndr, "election_request", &r->election_request); + break; + + case GetBackupListReq: + ndr_print_nbt_browse_backup_list_request(ndr, "backup_list_request", &r->backup_list_request); + break; + + case GetBackupListResp: + ndr_print_nbt_browse_backup_list_response(ndr, "backup_list_response", &r->backup_list_response); + break; + + case BecomeBackup: + ndr_print_nbt_browse_become_backup(ndr, "become_backup", &r->become_backup); + break; + + case DomainAnnouncement: + ndr_print_nbt_browse_domain_announcement(ndr, "domain_announcement", &r->domain_announcement); + break; + + case MasterAnnouncement: + ndr_print_nbt_browse_master_announcement(ndr, "master_announcement", &r->master_announcement); + break; + + case ResetBrowserState: + ndr_print_nbt_browse_reset_state(ndr, "reset_browser_state", &r->reset_browser_state); + break; + + case LocalMasterAnnouncement: + ndr_print_nbt_browse_local_master_announcement(ndr, "local_master_announcement", &r->local_master_announcement); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_nbt_browse_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_packet *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_nbt_browse_opcode(ndr, NDR_SCALARS, r->opcode)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->payload, r->opcode)); + NDR_CHECK(ndr_push_nbt_browse_payload(ndr, NDR_SCALARS, &r->payload)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_browse_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_packet *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_nbt_browse_opcode(ndr, NDR_SCALARS, &r->opcode)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->payload, r->opcode)); + NDR_CHECK(ndr_pull_nbt_browse_payload(ndr, NDR_SCALARS, &r->payload)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_nbt_browse_packet(struct ndr_print *ndr, const char *name, const struct nbt_browse_packet *r) +{ + ndr_print_struct(ndr, name, "nbt_browse_packet"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); + ndr->depth++; + ndr_print_nbt_browse_opcode(ndr, "opcode", r->opcode); + ndr_print_set_switch_value(ndr, &r->payload, r->opcode); + ndr_print_nbt_browse_payload(ndr, "payload", &r->payload); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + diff --git a/librpc/gen_ndr/ndr_nbt.h b/librpc/gen_ndr/ndr_nbt.h new file mode 100644 index 0000000000..1a0ca0c302 --- /dev/null +++ b/librpc/gen_ndr/ndr_nbt.h @@ -0,0 +1,104 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/nbt.h" + +#ifndef _HEADER_NDR_nbt +#define _HEADER_NDR_nbt + +#include "../libcli/netlogon.h" +#include "../libcli/nbt/libnbt.h" +#define NDR_NBT_CALL_COUNT (0) +void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r); +void ndr_print_nbt_name_type(struct ndr_print *ndr, const char *name, enum nbt_name_type r); +enum ndr_err_code ndr_push_nbt_name(struct ndr_push *ndr, int ndr_flags, const struct nbt_name *r); +enum ndr_err_code ndr_pull_nbt_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_name *r); +void ndr_print_nbt_name(struct ndr_print *ndr, const char *name, const struct nbt_name *r); +enum ndr_err_code ndr_push_nbt_qclass(struct ndr_push *ndr, int ndr_flags, enum nbt_qclass r); +enum ndr_err_code ndr_pull_nbt_qclass(struct ndr_pull *ndr, int ndr_flags, enum nbt_qclass *r); +void ndr_print_nbt_qclass(struct ndr_print *ndr, const char *name, enum nbt_qclass r); +enum ndr_err_code ndr_push_nbt_qtype(struct ndr_push *ndr, int ndr_flags, enum nbt_qtype r); +enum ndr_err_code ndr_pull_nbt_qtype(struct ndr_pull *ndr, int ndr_flags, enum nbt_qtype *r); +void ndr_print_nbt_qtype(struct ndr_print *ndr, const char *name, enum nbt_qtype r); +void ndr_print_nbt_name_question(struct ndr_print *ndr, const char *name, const struct nbt_name_question *r); +void ndr_print_nb_flags(struct ndr_print *ndr, const char *name, uint16_t r); +void ndr_print_nbt_rdata_address(struct ndr_print *ndr, const char *name, const struct nbt_rdata_address *r); +void ndr_print_nbt_rdata_netbios(struct ndr_print *ndr, const char *name, const struct nbt_rdata_netbios *r); +void ndr_print_nbt_statistics(struct ndr_print *ndr, const char *name, const struct nbt_statistics *r); +void ndr_print_nbt_status_name(struct ndr_print *ndr, const char *name, const struct nbt_status_name *r); +void ndr_print_nbt_rdata_status(struct ndr_print *ndr, const char *name, const struct nbt_rdata_status *r); +void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const struct nbt_rdata_data *r); +enum ndr_err_code ndr_push_nbt_rdata(struct ndr_push *ndr, int ndr_flags, const union nbt_rdata *r); +enum ndr_err_code ndr_pull_nbt_rdata(struct ndr_pull *ndr, int ndr_flags, union nbt_rdata *r); +void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r); +enum ndr_err_code ndr_push_nbt_res_rec(struct ndr_push *ndr, int ndr_flags, const struct nbt_res_rec *r); +void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r); +enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r); +enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r); +void ndr_print_nbt_name_packet(struct ndr_print *ndr, const char *name, const struct nbt_name_packet *r); +void ndr_print_dgram_msg_type(struct ndr_print *ndr, const char *name, enum dgram_msg_type r); +void ndr_print_dgram_flags(struct ndr_print *ndr, const char *name, uint8_t r); +void ndr_print_smb_command(struct ndr_print *ndr, const char *name, enum smb_command r); +void ndr_print_smb_trans_body(struct ndr_print *ndr, const char *name, const struct smb_trans_body *r); +void ndr_print_smb_body(struct ndr_print *ndr, const char *name, const union smb_body *r); +enum ndr_err_code ndr_push_dgram_smb_packet(struct ndr_push *ndr, int ndr_flags, const struct dgram_smb_packet *r); +enum ndr_err_code ndr_pull_dgram_smb_packet(struct ndr_pull *ndr, int ndr_flags, struct dgram_smb_packet *r); +void ndr_print_dgram_smb_packet(struct ndr_print *ndr, const char *name, const struct dgram_smb_packet *r); +void ndr_print_dgram_message_body(struct ndr_print *ndr, const char *name, const union dgram_message_body *r); +void ndr_print_dgram_message(struct ndr_print *ndr, const char *name, const struct dgram_message *r); +void ndr_print_dgram_err_code(struct ndr_print *ndr, const char *name, enum dgram_err_code r); +void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union dgram_data *r); +enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r); +enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r); +void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r); +enum ndr_err_code ndr_push_nbt_sockaddr(struct ndr_push *ndr, int ndr_flags, const struct nbt_sockaddr *r); +enum ndr_err_code ndr_pull_nbt_sockaddr(struct ndr_pull *ndr, int ndr_flags, struct nbt_sockaddr *r); +void ndr_print_nbt_sockaddr(struct ndr_print *ndr, const char *name, const struct nbt_sockaddr *r); +size_t ndr_size_nbt_sockaddr(const struct nbt_sockaddr *r, int flags); +enum ndr_err_code ndr_push_nbt_server_type(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_nbt_server_type(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_netlogon_nt_version_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_netlogon_nt_version_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_netlogon_nt_version_flags(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_netlogon_command(struct ndr_push *ndr, int ndr_flags, enum netlogon_command r); +enum ndr_err_code ndr_pull_netlogon_command(struct ndr_pull *ndr, int ndr_flags, enum netlogon_command *r); +void ndr_print_netlogon_command(struct ndr_print *ndr, const char *name, enum netlogon_command r); +enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r); +enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_REQUEST(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_REQUEST *r); +void ndr_print_NETLOGON_SAM_LOGON_REQUEST(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_REQUEST *r); +enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r); +enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r); +void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r); +enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE *r); +enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE *r); +void ndr_print_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE *r); +enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r); +enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r); +void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r); +void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r); +enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_response_from_pdc *r); +enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_response_from_pdc *r); +void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r); +void ndr_print_nbt_db_change_info(struct ndr_print *ndr, const char *name, const struct nbt_db_change_info *r); +void ndr_print_NETLOGON_DB_CHANGE(struct ndr_print *ndr, const char *name, const struct NETLOGON_DB_CHANGE *r); +void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r); +enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r); +enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r); +void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r); +void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r); +void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r); +void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r); +void ndr_print_nbt_browse_election_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_election_request *r); +void ndr_print_nbt_browse_backup_list_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_request *r); +void ndr_print_nbt_browse_backup_list_response(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_response *r); +void ndr_print_nbt_browse_become_backup(struct ndr_print *ndr, const char *name, const struct nbt_browse_become_backup *r); +void ndr_print_nbt_browse_domain_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_domain_announcement *r); +void ndr_print_nbt_browse_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_master_announcement *r); +void ndr_print_nbt_browse_reset_state(struct ndr_print *ndr, const char *name, const struct nbt_browse_reset_state *r); +void ndr_print_nbt_browse_local_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_local_master_announcement *r); +void ndr_print_nbt_browse_payload(struct ndr_print *ndr, const char *name, const union nbt_browse_payload *r); +enum ndr_err_code ndr_push_nbt_browse_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_packet *r); +enum ndr_err_code ndr_pull_nbt_browse_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_packet *r); +void ndr_print_nbt_browse_packet(struct ndr_print *ndr, const char *name, const struct nbt_browse_packet *r); +#endif /* _HEADER_NDR_nbt */ diff --git a/librpc/gen_ndr/ndr_netlogon.c b/librpc/gen_ndr/ndr_netlogon.c new file mode 100644 index 0000000000..81f8ddcab9 --- /dev/null +++ b/librpc/gen_ndr/ndr_netlogon.c @@ -0,0 +1,16203 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_netlogon.h" + +#include "librpc/gen_ndr/ndr_misc.h" +#include "librpc/gen_ndr/ndr_lsa.h" +#include "librpc/gen_ndr/ndr_samr.h" +#include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/ndr_nbt.h" +static enum ndr_err_code ndr_push_netr_UasInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priv)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_pw_count)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->last_logon)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->last_logoff)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->logoff_time)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->kickoff_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->password_age)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->pw_can_change)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->pw_must_change)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->script_path)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->account_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->computer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer, ndr_charset_length(r->computer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->script_path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->script_path, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->script_path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->script_path, ndr_charset_length(r->script_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_UasInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasInfo *r) +{ + uint32_t _ptr_account_name; + TALLOC_CTX *_mem_save_account_name_0; + uint32_t _ptr_computer; + TALLOC_CTX *_mem_save_computer_0; + uint32_t _ptr_domain; + TALLOC_CTX *_mem_save_domain_0; + uint32_t _ptr_script_path; + TALLOC_CTX *_mem_save_script_path_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name)); + if (_ptr_account_name) { + NDR_PULL_ALLOC(ndr, r->account_name); + } else { + r->account_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priv)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_pw_count)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logon)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logoff)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->logoff_time)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->kickoff_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->password_age)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_can_change)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_must_change)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer)); + if (_ptr_computer) { + NDR_PULL_ALLOC(ndr, r->computer); + } else { + r->computer = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_script_path)); + if (_ptr_script_path) { + NDR_PULL_ALLOC(ndr, r->script_path); + } else { + r->script_path = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->account_name) { + _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name)); + if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->account_name), ndr_get_array_length(ndr, &r->account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0); + } + if (r->computer) { + _mem_save_computer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->computer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->computer)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->computer)); + if (ndr_get_array_length(ndr, &r->computer) > ndr_get_array_size(ndr, &r->computer)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer), ndr_get_array_length(ndr, &r->computer)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer, ndr_get_array_length(ndr, &r->computer), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_0, 0); + } + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + if (r->script_path) { + _mem_save_script_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->script_path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->script_path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->script_path)); + if (ndr_get_array_length(ndr, &r->script_path) > ndr_get_array_size(ndr, &r->script_path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->script_path), ndr_get_array_length(ndr, &r->script_path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->script_path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->script_path, ndr_get_array_length(ndr, &r->script_path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_script_path_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r) +{ + ndr_print_struct(ndr, name, "netr_UasInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "account_name", r->account_name); + ndr->depth++; + if (r->account_name) { + ndr_print_string(ndr, "account_name", r->account_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "priv", r->priv); + ndr_print_uint32(ndr, "auth_flags", r->auth_flags); + ndr_print_uint32(ndr, "logon_count", r->logon_count); + ndr_print_uint32(ndr, "bad_pw_count", r->bad_pw_count); + ndr_print_time_t(ndr, "last_logon", r->last_logon); + ndr_print_time_t(ndr, "last_logoff", r->last_logoff); + ndr_print_time_t(ndr, "logoff_time", r->logoff_time); + ndr_print_time_t(ndr, "kickoff_time", r->kickoff_time); + ndr_print_uint32(ndr, "password_age", r->password_age); + ndr_print_time_t(ndr, "pw_can_change", r->pw_can_change); + ndr_print_time_t(ndr, "pw_must_change", r->pw_must_change); + ndr_print_ptr(ndr, "computer", r->computer); + ndr->depth++; + if (r->computer) { + ndr_print_string(ndr, "computer", r->computer); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + ndr_print_ptr(ndr, "script_path", r->script_path); + ndr->depth++; + if (r->script_path) { + ndr_print_string(ndr, "script_path", r->script_path); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_UasLogoffInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasLogoffInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->duration)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_UasLogoffInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasLogoffInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->duration)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r) +{ + ndr_print_struct(ndr, name, "netr_UasLogoffInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "duration", r->duration); + ndr_print_uint16(ndr, "logon_count", r->logon_count); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->lockout_duration)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->reset_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_attempt_lockout)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->lockout_duration)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->reset_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_attempt_lockout)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r) +{ + ndr_print_struct(ndr, name, "netr_AcctLockStr"); + ndr->depth++; + ndr_print_dlong(ndr, "lockout_duration", r->lockout_duration); + ndr_print_udlong(ndr, "reset_count", r->reset_count); + ndr_print_uint32(ndr, "bad_attempt_lockout", r->bad_attempt_lockout); + ndr_print_uint32(ndr, "dummy", r->dummy); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonParameterControl(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", MSV1_0_CLEARTEXT_PASSWORD_ALLOWED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_UPDATE_LOGON_STATISTICS", MSV1_0_UPDATE_LOGON_STATISTICS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_USER_PARAMETERS", MSV1_0_RETURN_USER_PARAMETERS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PROFILE_PATH", MSV1_0_RETURN_PROFILE_PATH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_IdentityInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_push_netr_LogonParameterControl(ndr, NDR_SCALARS, r->parameter_control)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_low)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_high)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstation)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstation)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_IdentityInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_pull_netr_LogonParameterControl(ndr, NDR_SCALARS, &r->parameter_control)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_low)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_high)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstation)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstation)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r) +{ + ndr_print_struct(ndr, name, "netr_IdentityInfo"); + ndr->depth++; + ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); + ndr_print_netr_LogonParameterControl(ndr, "parameter_control", r->parameter_control); + ndr_print_uint32(ndr, "logon_id_low", r->logon_id_low); + ndr_print_uint32(ndr, "logon_id_high", r->logon_id_high); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "workstation", &r->workstation); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_PasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_PasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r) +{ + ndr_print_struct(ndr, name, "netr_PasswordInfo"); + ndr->depth++; + ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info); + ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword); + ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ChallengeResponse(struct ndr_push *ndr, int ndr_flags, const struct netr_ChallengeResponse *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ChallengeResponse(struct ndr_pull *ndr, int ndr_flags, struct netr_ChallengeResponse *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->data)); + if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data)); + } + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); + } + if (r->data) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r) +{ + ndr_print_struct(ndr, name, "netr_ChallengeResponse"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_netr_NetworkInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_NetworkInfo *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->challenge, 8)); + NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt)); + NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); + NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt)); + NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NetworkInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_NetworkInfo *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->challenge, 8)); + NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt)); + NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); + NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt)); + NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm)); + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r) +{ + ndr_print_struct(ndr, name, "netr_NetworkInfo"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info); + ndr_print_array_uint8(ndr, "challenge", r->challenge, 8); + ndr_print_netr_ChallengeResponse(ndr, "nt", &r->nt); + ndr_print_netr_ChallengeResponse(ndr, "lm", &r->lm); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_netr_GenericInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->package_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->package_name)); + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_GenericInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->package_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->package_name)); + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r) +{ + ndr_print_struct(ndr, name, "netr_GenericInfo"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info); + ndr_print_lsa_String(ndr, "package_name", &r->package_name); + ndr_print_uint32(ndr, "length", r->length); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_netr_LogonInfoClass(struct ndr_push *ndr, int ndr_flags, enum netr_LogonInfoClass r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonInfoClass(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonInfoClass *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r) +{ + const char *val = NULL; + + switch (r) { + case NetlogonInteractiveInformation: val = "NetlogonInteractiveInformation"; break; + case NetlogonNetworkInformation: val = "NetlogonNetworkInformation"; break; + case NetlogonServiceInformation: val = "NetlogonServiceInformation"; break; + case NetlogonGenericInformation: val = "NetlogonGenericInformation"; break; + case NetlogonInteractiveTransitiveInformation: val = "NetlogonInteractiveTransitiveInformation"; break; + case NetlogonNetworkTransitiveInformation: val = "NetlogonNetworkTransitiveInformation"; break; + case NetlogonServiceTransitiveInformation: val = "NetlogonServiceTransitiveInformation"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, level)); + switch (level) { + case NetlogonInteractiveInformation: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); + break; } + + case NetlogonNetworkInformation: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->network)); + break; } + + case NetlogonServiceInformation: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); + break; } + + case NetlogonGenericInformation: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic)); + break; } + + case NetlogonInteractiveTransitiveInformation: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); + break; } + + case NetlogonNetworkTransitiveInformation: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->network)); + break; } + + case NetlogonServiceTransitiveInformation: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NetlogonInteractiveInformation: + if (r->password) { + NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + } + break; + + case NetlogonNetworkInformation: + if (r->network) { + NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network)); + } + break; + + case NetlogonServiceInformation: + if (r->password) { + NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + } + break; + + case NetlogonGenericInformation: + if (r->generic) { + NDR_CHECK(ndr_push_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic)); + } + break; + + case NetlogonInteractiveTransitiveInformation: + if (r->password) { + NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + } + break; + + case NetlogonNetworkTransitiveInformation: + if (r->network) { + NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network)); + } + break; + + case NetlogonServiceTransitiveInformation: + if (r->password) { + NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r) +{ + int level; + uint16_t _level; + TALLOC_CTX *_mem_save_password_0; + TALLOC_CTX *_mem_save_network_0; + TALLOC_CTX *_mem_save_generic_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case NetlogonInteractiveInformation: { + uint32_t _ptr_password; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->password); + } else { + r->password = NULL; + } + break; } + + case NetlogonNetworkInformation: { + uint32_t _ptr_network; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network)); + if (_ptr_network) { + NDR_PULL_ALLOC(ndr, r->network); + } else { + r->network = NULL; + } + break; } + + case NetlogonServiceInformation: { + uint32_t _ptr_password; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->password); + } else { + r->password = NULL; + } + break; } + + case NetlogonGenericInformation: { + uint32_t _ptr_generic; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic)); + if (_ptr_generic) { + NDR_PULL_ALLOC(ndr, r->generic); + } else { + r->generic = NULL; + } + break; } + + case NetlogonInteractiveTransitiveInformation: { + uint32_t _ptr_password; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->password); + } else { + r->password = NULL; + } + break; } + + case NetlogonNetworkTransitiveInformation: { + uint32_t _ptr_network; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network)); + if (_ptr_network) { + NDR_PULL_ALLOC(ndr, r->network); + } else { + r->network = NULL; + } + break; } + + case NetlogonServiceTransitiveInformation: { + uint32_t _ptr_password; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->password); + } else { + r->password = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case NetlogonInteractiveInformation: + if (r->password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); + NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + break; + + case NetlogonNetworkInformation: + if (r->network) { + _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->network, 0); + NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0); + } + break; + + case NetlogonServiceInformation: + if (r->password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); + NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + break; + + case NetlogonGenericInformation: + if (r->generic) { + _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0); + NDR_CHECK(ndr_pull_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0); + } + break; + + case NetlogonInteractiveTransitiveInformation: + if (r->password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); + NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + break; + + case NetlogonNetworkTransitiveInformation: + if (r->network) { + _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->network, 0); + NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0); + } + break; + + case NetlogonServiceTransitiveInformation: + if (r->password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); + NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_LogonLevel"); + switch (level) { + case NetlogonInteractiveInformation: + ndr_print_ptr(ndr, "password", r->password); + ndr->depth++; + if (r->password) { + ndr_print_netr_PasswordInfo(ndr, "password", r->password); + } + ndr->depth--; + break; + + case NetlogonNetworkInformation: + ndr_print_ptr(ndr, "network", r->network); + ndr->depth++; + if (r->network) { + ndr_print_netr_NetworkInfo(ndr, "network", r->network); + } + ndr->depth--; + break; + + case NetlogonServiceInformation: + ndr_print_ptr(ndr, "password", r->password); + ndr->depth++; + if (r->password) { + ndr_print_netr_PasswordInfo(ndr, "password", r->password); + } + ndr->depth--; + break; + + case NetlogonGenericInformation: + ndr_print_ptr(ndr, "generic", r->generic); + ndr->depth++; + if (r->generic) { + ndr_print_netr_GenericInfo(ndr, "generic", r->generic); + } + ndr->depth--; + break; + + case NetlogonInteractiveTransitiveInformation: + ndr_print_ptr(ndr, "password", r->password); + ndr->depth++; + if (r->password) { + ndr_print_netr_PasswordInfo(ndr, "password", r->password); + } + ndr->depth--; + break; + + case NetlogonNetworkTransitiveInformation: + ndr_print_ptr(ndr, "network", r->network); + ndr->depth++; + if (r->network) { + ndr_print_netr_NetworkInfo(ndr, "network", r->network); + } + ndr->depth--; + break; + + case NetlogonServiceTransitiveInformation: + ndr_print_ptr(ndr, "password", r->password); + ndr->depth++; + if (r->password) { + ndr_print_netr_PasswordInfo(ndr, "password", r->password); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r) +{ + ndr_print_struct(ndr, name, "netr_UserSessionKey"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "key", r->key, 16); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 8)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 8)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *name, const struct netr_LMSessionKey *r) +{ + ndr_print_struct(ndr, name, "netr_LMSessionKey"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "key", r->key, 8); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GUEST", NETLOGON_GUEST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NOENCRYPTION", NETLOGON_NOENCRYPTION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CACHED_ACCOUNT", NETLOGON_CACHED_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_USED_LM_PASSWORD", NETLOGON_USED_LM_PASSWORD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_EXTRA_SIDS", NETLOGON_EXTRA_SIDS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SUBAUTH_SESSION_KEY", NETLOGON_SUBAUTH_SESSION_KEY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SERVER_TRUST_ACCOUNT", NETLOGON_SERVER_TRUST_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GRACE_LOGON", NETLOGON_GRACE_LOGON, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_SamBaseInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_SamBaseInfo *r) +{ + uint32_t cntr_unknown_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups)); + NDR_CHECK(ndr_push_netr_UserFlags(ndr, NDR_SCALARS, r->user_flags)); + NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid)); + NDR_CHECK(ndr_push_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown[cntr_unknown_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain)); + if (r->domain_sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_SamBaseInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_SamBaseInfo *r) +{ + uint32_t _ptr_domain_sid; + TALLOC_CTX *_mem_save_domain_sid_0; + uint32_t cntr_unknown_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups)); + NDR_CHECK(ndr_pull_netr_UserFlags(ndr, NDR_SCALARS, &r->user_flags)); + NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid)); + if (_ptr_domain_sid) { + NDR_PULL_ALLOC(ndr, r->domain_sid); + } else { + r->domain_sid = NULL; + } + NDR_CHECK(ndr_pull_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown[cntr_unknown_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain)); + if (r->domain_sid) { + _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name, const struct netr_SamBaseInfo *r) +{ + uint32_t cntr_unknown_0; + ndr_print_struct(ndr, name, "netr_SamBaseInfo"); + ndr->depth++; + ndr_print_NTTIME(ndr, "last_logon", r->last_logon); + ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); + ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); + ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change); + ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr_print_uint16(ndr, "logon_count", r->logon_count); + ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_samr_RidWithAttributeArray(ndr, "groups", &r->groups); + ndr_print_netr_UserFlags(ndr, "user_flags", r->user_flags); + ndr_print_netr_UserSessionKey(ndr, "key", &r->key); + ndr_print_lsa_StringLarge(ndr, "logon_server", &r->logon_server); + ndr_print_lsa_StringLarge(ndr, "domain", &r->domain); + ndr_print_ptr(ndr, "domain_sid", r->domain_sid); + ndr->depth++; + if (r->domain_sid) { + ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid); + } + ndr->depth--; + ndr_print_netr_LMSessionKey(ndr, "LMSessKey", &r->LMSessKey); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr->print(ndr, "%s: ARRAY(%d)", "unknown", (int)7); + ndr->depth++; + for (cntr_unknown_0=0;cntr_unknown_0<7;cntr_unknown_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) { + ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_SamInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_SamInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, const struct netr_SamInfo2 *r) +{ + ndr_print_struct(ndr, name, "netr_SamInfo2"); + ndr->depth++; + ndr_print_netr_SamBaseInfo(ndr, "base", &r->base); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_SidAttr(struct ndr_push *ndr, int ndr_flags, const struct netr_SidAttr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struct netr_SidAttr *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, const struct netr_SidAttr *r) +{ + ndr_print_struct(ndr, name, "netr_SidAttr"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r) +{ + uint32_t cntr_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); + if (r->sids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount)); + for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { + NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { + NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r) +{ + uint32_t _ptr_sids; + uint32_t cntr_sids_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids); + } else { + r->sids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); + if (r->sids) { + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { + NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { + NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + } + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r) +{ + uint32_t cntr_sids_1; + ndr_print_struct(ndr, name, "netr_SamInfo3"); + ndr->depth++; + ndr_print_netr_SamBaseInfo(ndr, "base", &r->base); + ndr_print_uint32(ndr, "sidcount", r->sidcount); + ndr_print_ptr(ndr, "sids", r->sids); + ndr->depth++; + if (r->sids) { + ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount); + ndr->depth++; + for (cntr_sids_1=0;cntr_sids_1sidcount;cntr_sids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { + ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo6 *r) +{ + uint32_t cntr_sids_1; + uint32_t cntr_unknown4_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principle)); + for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4[cntr_unknown4_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); + if (r->sids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount)); + for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { + NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { + NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); + } + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principle)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo6 *r) +{ + uint32_t _ptr_sids; + uint32_t cntr_sids_1; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_sids_1; + uint32_t cntr_unknown4_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids); + } else { + r->sids = NULL; + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->forest)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principle)); + for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4[cntr_unknown4_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); + if (r->sids) { + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { + NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); + } + for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { + NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->forest)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principle)); + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r) +{ + uint32_t cntr_sids_1; + uint32_t cntr_unknown4_0; + ndr_print_struct(ndr, name, "netr_SamInfo6"); + ndr->depth++; + ndr_print_netr_SamBaseInfo(ndr, "base", &r->base); + ndr_print_uint32(ndr, "sidcount", r->sidcount); + ndr_print_ptr(ndr, "sids", r->sids); + ndr->depth++; + if (r->sids) { + ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount); + ndr->depth++; + for (cntr_sids_1=0;cntr_sids_1sidcount;cntr_sids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { + ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_lsa_String(ndr, "forest", &r->forest); + ndr_print_lsa_String(ndr, "principle", &r->principle); + ndr->print(ndr, "%s: ARRAY(%d)", "unknown4", (int)20); + ndr->depth++; + for (cntr_unknown4_0=0;cntr_unknown4_0<20;cntr_unknown4_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_unknown4_0) != -1) { + ndr_print_uint32(ndr, "unknown4", r->unknown4[cntr_unknown4_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_PacInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PacInfo *r) +{ + uint32_t cntr_expansionroom_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_domain)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_server)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principal_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->auth)); + NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key)); + for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->expansionroom[cntr_expansionroom_0])); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->pac) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->pac, r->pac_size)); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_server)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principal_name)); + if (r->auth) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->auth, r->auth_size)); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_PacInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PacInfo *r) +{ + uint32_t _ptr_pac; + TALLOC_CTX *_mem_save_pac_0; + uint32_t _ptr_auth; + TALLOC_CTX *_mem_save_auth_0; + uint32_t cntr_expansionroom_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pac_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac)); + if (_ptr_pac) { + NDR_PULL_ALLOC(ndr, r->pac); + } else { + r->pac = NULL; + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_domain)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_server)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principal_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_auth)); + if (_ptr_auth) { + NDR_PULL_ALLOC(ndr, r->auth); + } else { + r->auth = NULL; + } + NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key)); + for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->expansionroom[cntr_expansionroom_0])); + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->pac) { + _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->pac)); + NDR_PULL_ALLOC_N(ndr, r->pac, ndr_get_array_size(ndr, &r->pac)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->pac, ndr_get_array_size(ndr, &r->pac))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0); + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_server)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principal_name)); + if (r->auth) { + _mem_save_auth_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->auth, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->auth)); + NDR_PULL_ALLOC_N(ndr, r->auth, ndr_get_array_size(ndr, &r->auth)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->auth, ndr_get_array_size(ndr, &r->auth))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_0, 0); + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + if (r->pac) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->pac, r->pac_size)); + } + if (r->auth) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->auth, r->auth_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r) +{ + uint32_t cntr_expansionroom_0; + ndr_print_struct(ndr, name, "netr_PacInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "pac_size", r->pac_size); + ndr_print_ptr(ndr, "pac", r->pac); + ndr->depth++; + if (r->pac) { + ndr_print_array_uint8(ndr, "pac", r->pac, r->pac_size); + } + ndr->depth--; + ndr_print_lsa_String(ndr, "logon_domain", &r->logon_domain); + ndr_print_lsa_String(ndr, "logon_server", &r->logon_server); + ndr_print_lsa_String(ndr, "principal_name", &r->principal_name); + ndr_print_uint32(ndr, "auth_size", r->auth_size); + ndr_print_ptr(ndr, "auth", r->auth); + ndr->depth++; + if (r->auth) { + ndr_print_array_uint8(ndr, "auth", r->auth, r->auth_size); + } + ndr->depth--; + ndr_print_netr_UserSessionKey(ndr, "user_session_key", &r->user_session_key); + ndr->print(ndr, "%s: ARRAY(%d)", "expansionroom", (int)10); + ndr->depth++; + for (cntr_expansionroom_0=0;cntr_expansionroom_0<10;cntr_expansionroom_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_expansionroom_0) != -1) { + ndr_print_uint32(ndr, "expansionroom", r->expansionroom[cntr_expansionroom_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_GenericInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo2 *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_GenericInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo2 *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r) +{ + ndr_print_struct(ndr, name, "netr_GenericInfo2"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint32(ndr, "length", r->length); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case NetlogonValidationSamInfo: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam2)); + break; } + + case NetlogonValidationSamInfo2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac)); + break; } + + case NetlogonValidationGenericInfo2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic)); + break; } + + case NetlogonValidationSamInfo4: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam6)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NetlogonValidationSamInfo: + if (r->sam2) { + NDR_CHECK(ndr_push_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2)); + } + break; + + case NetlogonValidationSamInfo2: + if (r->sam3) { + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3)); + } + break; + + case 4: + if (r->pac) { + NDR_CHECK(ndr_push_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac)); + } + break; + + case NetlogonValidationGenericInfo2: + if (r->generic) { + NDR_CHECK(ndr_push_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic)); + } + break; + + case NetlogonValidationSamInfo4: + if (r->sam6) { + NDR_CHECK(ndr_push_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r) +{ + int level; + uint16_t _level; + TALLOC_CTX *_mem_save_sam2_0; + TALLOC_CTX *_mem_save_sam3_0; + TALLOC_CTX *_mem_save_pac_0; + TALLOC_CTX *_mem_save_generic_0; + TALLOC_CTX *_mem_save_sam6_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case NetlogonValidationSamInfo: { + uint32_t _ptr_sam2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam2)); + if (_ptr_sam2) { + NDR_PULL_ALLOC(ndr, r->sam2); + } else { + r->sam2 = NULL; + } + break; } + + case NetlogonValidationSamInfo2: { + uint32_t _ptr_sam3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam3)); + if (_ptr_sam3) { + NDR_PULL_ALLOC(ndr, r->sam3); + } else { + r->sam3 = NULL; + } + break; } + + case 4: { + uint32_t _ptr_pac; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac)); + if (_ptr_pac) { + NDR_PULL_ALLOC(ndr, r->pac); + } else { + r->pac = NULL; + } + break; } + + case NetlogonValidationGenericInfo2: { + uint32_t _ptr_generic; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic)); + if (_ptr_generic) { + NDR_PULL_ALLOC(ndr, r->generic); + } else { + r->generic = NULL; + } + break; } + + case NetlogonValidationSamInfo4: { + uint32_t _ptr_sam6; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam6)); + if (_ptr_sam6) { + NDR_PULL_ALLOC(ndr, r->sam6); + } else { + r->sam6 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case NetlogonValidationSamInfo: + if (r->sam2) { + _mem_save_sam2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sam2, 0); + NDR_CHECK(ndr_pull_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam2_0, 0); + } + break; + + case NetlogonValidationSamInfo2: + if (r->sam3) { + _mem_save_sam3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sam3, 0); + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam3_0, 0); + } + break; + + case 4: + if (r->pac) { + _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0); + NDR_CHECK(ndr_pull_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0); + } + break; + + case NetlogonValidationGenericInfo2: + if (r->generic) { + _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0); + NDR_CHECK(ndr_pull_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0); + } + break; + + case NetlogonValidationSamInfo4: + if (r->sam6) { + _mem_save_sam6_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sam6, 0); + NDR_CHECK(ndr_pull_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam6_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_Validation"); + switch (level) { + case NetlogonValidationSamInfo: + ndr_print_ptr(ndr, "sam2", r->sam2); + ndr->depth++; + if (r->sam2) { + ndr_print_netr_SamInfo2(ndr, "sam2", r->sam2); + } + ndr->depth--; + break; + + case NetlogonValidationSamInfo2: + ndr_print_ptr(ndr, "sam3", r->sam3); + ndr->depth++; + if (r->sam3) { + ndr_print_netr_SamInfo3(ndr, "sam3", r->sam3); + } + ndr->depth--; + break; + + case 4: + ndr_print_ptr(ndr, "pac", r->pac); + ndr->depth++; + if (r->pac) { + ndr_print_netr_PacInfo(ndr, "pac", r->pac); + } + ndr->depth--; + break; + + case NetlogonValidationGenericInfo2: + ndr_print_ptr(ndr, "generic", r->generic); + ndr->depth++; + if (r->generic) { + ndr_print_netr_GenericInfo2(ndr, "generic", r->generic); + } + ndr->depth--; + break; + + case NetlogonValidationSamInfo4: + ndr_print_ptr(ndr, "sam6", r->sam6); + ndr->depth++; + if (r->sam6) { + ndr_print_netr_SamInfo6(ndr, "sam6", r->sam6); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 8)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 8)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const struct netr_Credential *r) +{ + ndr_print_struct(ndr, name, "netr_Credential"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->data, 8); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, &r->cred)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, &r->cred)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r) +{ + ndr_print_struct(ndr, name, "netr_Authenticator"); + ndr->depth++; + ndr_print_netr_Credential(ndr, "cred", &r->cred); + ndr_print_time_t(ndr, "timestamp", r->timestamp); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_DELETE_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_USER *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->account_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_USER *r) +{ + uint32_t _ptr_account_name; + TALLOC_CTX *_mem_save_account_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name)); + if (_ptr_account_name) { + NDR_PULL_ALLOC(ndr, r->account_name); + } else { + r->account_name = NULL; + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->account_name) { + _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name)); + if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->account_name), ndr_get_array_length(ndr, &r->account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0); + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_DELETE_USER"); + ndr->depth++; + ndr_print_ptr(ndr, "account_name", r->account_name); + ndr->depth++; + if (r->account_name) { + ndr_print_string(ndr, "account_name", r->account_name); + } + ndr->depth--; + ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_USER_KEY16(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY16 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->pwd)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_USER_KEY16(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY16 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->pwd)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r) +{ + ndr_print_struct(ndr, name, "netr_USER_KEY16"); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size); + ndr_print_uint32(ndr, "flags", r->flags); + ndr_print_samr_Password(ndr, "pwd", &r->pwd); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_PasswordHistory(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordHistory *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_flags)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lm_flags)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_PasswordHistory(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordHistory *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nt_flags)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lm_flags)); + NDR_PULL_ALLOC_N(ndr, r->nt_history, r->nt_length); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length)); + NDR_PULL_ALLOC_N(ndr, r->lm_history, r->lm_length); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r) +{ + ndr_print_struct(ndr, name, "netr_PasswordHistory"); + ndr->depth++; + ndr_print_uint16(ndr, "nt_length", r->nt_length); + ndr_print_uint16(ndr, "nt_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->nt_length:r->nt_size); + ndr_print_uint32(ndr, "nt_flags", r->nt_flags); + ndr_print_uint16(ndr, "lm_length", r->lm_length); + ndr_print_uint16(ndr, "lm_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->lm_length:r->lm_size); + ndr_print_uint32(ndr, "lm_flags", r->lm_flags); + ndr_print_array_uint8(ndr, "nt_history", r->nt_history, r->nt_length); + ndr_print_array_uint8(ndr, "lm_history", r->lm_history, r->lm_length); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_USER_KEYS2(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword)); + NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword)); + NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_USER_KEYS2(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword)); + NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword)); + NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS2 *r) +{ + ndr_print_struct(ndr, name, "netr_USER_KEYS2"); + ndr->depth++; + ndr_print_netr_USER_KEY16(ndr, "lmpassword", &r->lmpassword); + ndr_print_netr_USER_KEY16(ndr, "ntpassword", &r->ntpassword); + ndr_print_netr_PasswordHistory(ndr, "history", &r->history); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_USER_KEY_UNION(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY_UNION *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_USER_KEY_UNION(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY_UNION *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY_UNION *r) +{ + ndr_print_struct(ndr, name, "netr_USER_KEY_UNION"); + ndr->depth++; + ndr_print_netr_USER_KEYS2(ndr, "keys2", &r->keys2); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS *r) +{ + ndr_print_struct(ndr, name, "netr_USER_KEYS"); + ndr->depth++; + ndr_print_uint32(ndr, "version", r->version); + ndr_print_netr_USER_KEY_UNION(ndr, "keys", &r->keys); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_USER_PRIVATE_INFO(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_PRIVATE_INFO *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->SensitiveDataFlag)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength)); + { + uint32_t _flags_save_uint8 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->SensitiveData)); + ndr->flags = _flags_save_uint8; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_uint8 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (r->SensitiveData) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, r->DataLength)); + } + ndr->flags = _flags_save_uint8; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_PRIVATE_INFO *r) +{ + uint32_t _ptr_SensitiveData; + TALLOC_CTX *_mem_save_SensitiveData_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->SensitiveDataFlag)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->DataLength)); + { + uint32_t _flags_save_uint8 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_SensitiveData)); + if (_ptr_SensitiveData) { + NDR_PULL_ALLOC(ndr, r->SensitiveData); + } else { + r->SensitiveData = NULL; + } + ndr->flags = _flags_save_uint8; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_uint8 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (r->SensitiveData) { + _mem_save_SensitiveData_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->SensitiveData, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->SensitiveData)); + NDR_PULL_ALLOC_N(ndr, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_SensitiveData_0, 0); + } + ndr->flags = _flags_save_uint8; + } + if (r->SensitiveData) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->SensitiveData, r->DataLength)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char *name, const struct netr_USER_PRIVATE_INFO *r) +{ + ndr_print_struct(ndr, name, "netr_USER_PRIVATE_INFO"); + ndr->depth++; + ndr_print_uint8(ndr, "SensitiveDataFlag", r->SensitiveDataFlag); + ndr_print_uint32(ndr, "DataLength", r->DataLength); + ndr_print_ptr(ndr, "SensitiveData", r->SensitiveData); + ndr->depth++; + if (r->SensitiveData) { + ndr_print_array_uint8(ndr, "SensitiveData", r->SensitiveData, r->DataLength); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_USER *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_present)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_present)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page)); + NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); + NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_USER *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_present)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_present)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page)); + NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); + NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_USER *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_USER"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "workstations", &r->workstations); + ndr_print_NTTIME(ndr, "last_logon", r->last_logon); + ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); + ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); + ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); + ndr_print_uint16(ndr, "logon_count", r->logon_count); + ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword); + ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword); + ndr_print_uint8(ndr, "nt_password_present", r->nt_password_present); + ndr_print_uint8(ndr, "lm_password_present", r->lm_password_present); + ndr_print_uint8(ndr, "password_expired", r->password_expired); + ndr_print_lsa_String(ndr, "comment", &r->comment); + ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters); + ndr_print_uint16(ndr, "country_code", r->country_code); + ndr_print_uint16(ndr, "code_page", r->code_page); + ndr_print_netr_USER_PRIVATE_INFO(ndr, "user_private_info", &r->user_private_info); + ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); + ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DOMAIN *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); + NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->force_logoff_time)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length)); + NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age)); + NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_to_chgpass)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DOMAIN *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); + NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->force_logoff_time)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length)); + NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age)); + NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_to_chgpass)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DOMAIN *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_DOMAIN"); + ndr->depth++; + ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); + ndr_print_lsa_String(ndr, "oem_information", &r->oem_information); + ndr_print_dlong(ndr, "force_logoff_time", r->force_logoff_time); + ndr_print_uint16(ndr, "min_password_length", r->min_password_length); + ndr_print_uint16(ndr, "password_history_length", r->password_history_length); + ndr_print_dlong(ndr, "max_password_age", r->max_password_age); + ndr_print_dlong(ndr, "min_password_age", r->min_password_age); + ndr_print_udlong(ndr, "sequence_num", r->sequence_num); + ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time); + ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); + ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); + ndr_print_lsa_BinaryString(ndr, "account_lockout", &r->account_lockout); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "logon_to_chgpass", r->logon_to_chgpass); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_GROUP(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->group_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->group_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_GROUP(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->group_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->group_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_GROUP"); + ndr->depth++; + ndr_print_lsa_String(ndr, "group_name", &r->group_name); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "attributes", r->attributes); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); + ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); + ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_RENAME(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_RENAME *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->OldName)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->NewName)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->OldName)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->NewName)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_RENAME(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_RENAME *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->OldName)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->NewName)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->OldName)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->NewName)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *name, const struct netr_DELTA_RENAME *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_RENAME"); + ndr->depth++; + ndr_print_lsa_String(ndr, "OldName", &r->OldName); + ndr_print_lsa_String(ndr, "NewName", &r->NewName); + ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_GROUP_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP_MEMBER *r) +{ + uint32_t cntr_rids_1; + uint32_t cntr_attribs_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids)); + for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1])); + } + } + if (r->attribs) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids)); + for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribs[cntr_attribs_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP_MEMBER *r) +{ + uint32_t _ptr_rids; + uint32_t cntr_rids_1; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_rids_1; + uint32_t _ptr_attribs; + uint32_t cntr_attribs_1; + TALLOC_CTX *_mem_save_attribs_0; + TALLOC_CTX *_mem_save_attribs_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); + if (_ptr_rids) { + NDR_PULL_ALLOC(ndr, r->rids); + } else { + r->rids = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribs)); + if (_ptr_attribs) { + NDR_PULL_ALLOC(ndr, r->attribs); + } else { + r->attribs = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->rids)); + NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids)); + _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); + } + if (r->attribs) { + _mem_save_attribs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->attribs)); + NDR_PULL_ALLOC_N(ndr, r->attribs, ndr_get_array_size(ndr, &r->attribs)); + _mem_save_attribs_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0); + for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribs[cntr_attribs_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_0, 0); + } + if (r->rids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids)); + } + if (r->attribs) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attribs, r->num_rids)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP_MEMBER *r) +{ + uint32_t cntr_rids_1; + uint32_t cntr_attribs_1; + ndr_print_struct(ndr, name, "netr_DELTA_GROUP_MEMBER"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->rids); + ndr->depth++; + if (r->rids) { + ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->num_rids); + ndr->depth++; + for (cntr_rids_1=0;cntr_rids_1num_rids;cntr_rids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) { + ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_ptr(ndr, "attribs", r->attribs); + ndr->depth++; + if (r->attribs) { + ndr->print(ndr, "%s: ARRAY(%d)", "attribs", (int)r->num_rids); + ndr->depth++; + for (cntr_attribs_1=0;cntr_attribs_1num_rids;cntr_attribs_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_attribs_1) != -1) { + ndr_print_uint32(ndr, "attribs", r->attribs[cntr_attribs_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_uint32(ndr, "num_rids", r->num_rids); + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr_print_uint32(ndr, "unknown3", r->unknown3); + ndr_print_uint32(ndr, "unknown4", r->unknown4); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_ALIAS(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->alias_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->alias_name)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->alias_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->alias_name)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_ALIAS(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_ALIAS"); + ndr->depth++; + ndr_print_lsa_String(ndr, "alias_name", &r->alias_name); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); + ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_ALIAS_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS_MEMBER *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS, &r->sids)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS_MEMBER *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS, &r->sids)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS_MEMBER *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_ALIAS_MEMBER"); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", &r->sids); + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr_print_uint32(ndr, "unknown3", r->unknown3); + ndr_print_uint32(ndr, "unknown4", r->unknown4); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_QUOTA_LIMITS(struct ndr_push *ndr, int ndr_flags, const struct netr_QUOTA_LIMITS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagedpoollimit)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nonpagedpoollimit)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minimumworkingsetsize)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximumworkingsetsize)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagefilelimit)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->timelimit)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull *ndr, int ndr_flags, struct netr_QUOTA_LIMITS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagedpoollimit)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nonpagedpoollimit)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minimumworkingsetsize)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximumworkingsetsize)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagefilelimit)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->timelimit)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_QUOTA_LIMITS(struct ndr_print *ndr, const char *name, const struct netr_QUOTA_LIMITS *r) +{ + ndr_print_struct(ndr, name, "netr_QUOTA_LIMITS"); + ndr->depth++; + ndr_print_uint32(ndr, "pagedpoollimit", r->pagedpoollimit); + ndr_print_uint32(ndr, "nonpagedpoollimit", r->nonpagedpoollimit); + ndr_print_uint32(ndr, "minimumworkingsetsize", r->minimumworkingsetsize); + ndr_print_uint32(ndr, "maximumworkingsetsize", r->maximumworkingsetsize); + ndr_print_uint32(ndr, "pagefilelimit", r->pagefilelimit); + ndr_print_NTTIME(ndr, "timelimit", r->timelimit); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_POLICY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_POLICY *r) +{ + uint32_t cntr_eventauditoptions_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlogsize)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->auditretentionperiod)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auditingmode)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxauditeventcount)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->eventauditoptions)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->db_create_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->eventauditoptions) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxauditeventcount + 1)); + for (cntr_eventauditoptions_1 = 0; cntr_eventauditoptions_1 < r->maxauditeventcount + 1; cntr_eventauditoptions_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->eventauditoptions[cntr_eventauditoptions_1])); + } + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary_domain_name)); + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_POLICY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_POLICY *r) +{ + uint32_t _ptr_eventauditoptions; + uint32_t cntr_eventauditoptions_1; + TALLOC_CTX *_mem_save_eventauditoptions_0; + TALLOC_CTX *_mem_save_eventauditoptions_1; + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlogsize)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->auditretentionperiod)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auditingmode)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxauditeventcount)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_eventauditoptions)); + if (_ptr_eventauditoptions) { + NDR_PULL_ALLOC(ndr, r->eventauditoptions); + } else { + r->eventauditoptions = NULL; + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->db_create_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->eventauditoptions) { + _mem_save_eventauditoptions_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->eventauditoptions, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->eventauditoptions)); + NDR_PULL_ALLOC_N(ndr, r->eventauditoptions, ndr_get_array_size(ndr, &r->eventauditoptions)); + _mem_save_eventauditoptions_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->eventauditoptions, 0); + for (cntr_eventauditoptions_1 = 0; cntr_eventauditoptions_1 < r->maxauditeventcount + 1; cntr_eventauditoptions_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->eventauditoptions[cntr_eventauditoptions_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eventauditoptions_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eventauditoptions_0, 0); + } + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary_domain_name)); + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + if (r->eventauditoptions) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->eventauditoptions, r->maxauditeventcount + 1)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_POLICY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_POLICY *r) +{ + uint32_t cntr_eventauditoptions_1; + ndr_print_struct(ndr, name, "netr_DELTA_POLICY"); + ndr->depth++; + ndr_print_uint32(ndr, "maxlogsize", r->maxlogsize); + ndr_print_NTTIME(ndr, "auditretentionperiod", r->auditretentionperiod); + ndr_print_uint8(ndr, "auditingmode", r->auditingmode); + ndr_print_uint32(ndr, "maxauditeventcount", r->maxauditeventcount); + ndr_print_ptr(ndr, "eventauditoptions", r->eventauditoptions); + ndr->depth++; + if (r->eventauditoptions) { + ndr->print(ndr, "%s: ARRAY(%d)", "eventauditoptions", (int)r->maxauditeventcount + 1); + ndr->depth++; + for (cntr_eventauditoptions_1=0;cntr_eventauditoptions_1maxauditeventcount + 1;cntr_eventauditoptions_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_eventauditoptions_1) != -1) { + ndr_print_uint32(ndr, "eventauditoptions", r->eventauditoptions[cntr_eventauditoptions_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_lsa_String(ndr, "primary_domain_name", &r->primary_domain_name); + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr_print_netr_QUOTA_LIMITS(ndr, "quota_limits", &r->quota_limits); + ndr_print_udlong(ndr, "sequence_num", r->sequence_num); + ndr_print_NTTIME(ndr, "db_create_time", r->db_create_time); + ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); + ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); + ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_TRUSTED_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_TRUSTED_DOMAIN *r) +{ + uint32_t cntr_controller_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_controllers)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->controller_names)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->posix_offset)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + if (r->controller_names) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_controllers)); + for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->controller_names[cntr_controller_names_1])); + } + for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->controller_names[cntr_controller_names_1])); + } + } + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_TRUSTED_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_TRUSTED_DOMAIN *r) +{ + uint32_t _ptr_controller_names; + uint32_t cntr_controller_names_1; + TALLOC_CTX *_mem_save_controller_names_0; + TALLOC_CTX *_mem_save_controller_names_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_controllers)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_controller_names)); + if (_ptr_controller_names) { + NDR_PULL_ALLOC(ndr, r->controller_names); + } else { + r->controller_names = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->posix_offset)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + if (r->controller_names) { + _mem_save_controller_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->controller_names, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->controller_names)); + NDR_PULL_ALLOC_N(ndr, r->controller_names, ndr_get_array_size(ndr, &r->controller_names)); + _mem_save_controller_names_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->controller_names, 0); + for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->controller_names[cntr_controller_names_1])); + } + for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->controller_names[cntr_controller_names_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_controller_names_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_controller_names_0, 0); + } + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + if (r->controller_names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->controller_names, r->num_controllers)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_TRUSTED_DOMAIN *r) +{ + uint32_t cntr_controller_names_1; + ndr_print_struct(ndr, name, "netr_DELTA_TRUSTED_DOMAIN"); + ndr->depth++; + ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); + ndr_print_uint32(ndr, "num_controllers", r->num_controllers); + ndr_print_ptr(ndr, "controller_names", r->controller_names); + ndr->depth++; + if (r->controller_names) { + ndr->print(ndr, "%s: ARRAY(%d)", "controller_names", (int)r->num_controllers); + ndr->depth++; + for (cntr_controller_names_1=0;cntr_controller_names_1num_controllers;cntr_controller_names_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_controller_names_1) != -1) { + ndr_print_lsa_String(ndr, "controller_names", &r->controller_names[cntr_controller_names_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); + ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); + ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "posix_offset", r->posix_offset); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_DELETE_TRUST(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_TRUST *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_TRUST(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_TRUST *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_TRUST *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_DELETE_TRUST"); + ndr->depth++; + ndr_print_uint16(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ACCOUNT *r) +{ + uint32_t cntr_privilege_attrib_1; + uint32_t cntr_privilege_name_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_entries)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_control)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->privilege_attrib)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->privilege_name)); + NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quotalimits)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->system_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->privilege_attrib) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_entries)); + for (cntr_privilege_attrib_1 = 0; cntr_privilege_attrib_1 < r->privilege_entries; cntr_privilege_attrib_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_attrib[cntr_privilege_attrib_1])); + } + } + if (r->privilege_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_entries)); + for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->privilege_name[cntr_privilege_name_1])); + } + for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->privilege_name[cntr_privilege_name_1])); + } + } + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ACCOUNT *r) +{ + uint32_t _ptr_privilege_attrib; + uint32_t cntr_privilege_attrib_1; + TALLOC_CTX *_mem_save_privilege_attrib_0; + TALLOC_CTX *_mem_save_privilege_attrib_1; + uint32_t _ptr_privilege_name; + uint32_t cntr_privilege_name_1; + TALLOC_CTX *_mem_save_privilege_name_0; + TALLOC_CTX *_mem_save_privilege_name_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_entries)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_control)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privilege_attrib)); + if (_ptr_privilege_attrib) { + NDR_PULL_ALLOC(ndr, r->privilege_attrib); + } else { + r->privilege_attrib = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privilege_name)); + if (_ptr_privilege_name) { + NDR_PULL_ALLOC(ndr, r->privilege_name); + } else { + r->privilege_name = NULL; + } + NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quotalimits)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->system_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->privilege_attrib) { + _mem_save_privilege_attrib_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->privilege_attrib, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->privilege_attrib)); + NDR_PULL_ALLOC_N(ndr, r->privilege_attrib, ndr_get_array_size(ndr, &r->privilege_attrib)); + _mem_save_privilege_attrib_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->privilege_attrib, 0); + for (cntr_privilege_attrib_1 = 0; cntr_privilege_attrib_1 < r->privilege_entries; cntr_privilege_attrib_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_attrib[cntr_privilege_attrib_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_attrib_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_attrib_0, 0); + } + if (r->privilege_name) { + _mem_save_privilege_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->privilege_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->privilege_name)); + NDR_PULL_ALLOC_N(ndr, r->privilege_name, ndr_get_array_size(ndr, &r->privilege_name)); + _mem_save_privilege_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->privilege_name, 0); + for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->privilege_name[cntr_privilege_name_1])); + } + for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->privilege_name[cntr_privilege_name_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_name_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_name_0, 0); + } + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + if (r->privilege_attrib) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privilege_attrib, r->privilege_entries)); + } + if (r->privilege_name) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privilege_name, r->privilege_entries)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ACCOUNT *r) +{ + uint32_t cntr_privilege_attrib_1; + uint32_t cntr_privilege_name_1; + ndr_print_struct(ndr, name, "netr_DELTA_ACCOUNT"); + ndr->depth++; + ndr_print_uint32(ndr, "privilege_entries", r->privilege_entries); + ndr_print_uint32(ndr, "privilege_control", r->privilege_control); + ndr_print_ptr(ndr, "privilege_attrib", r->privilege_attrib); + ndr->depth++; + if (r->privilege_attrib) { + ndr->print(ndr, "%s: ARRAY(%d)", "privilege_attrib", (int)r->privilege_entries); + ndr->depth++; + for (cntr_privilege_attrib_1=0;cntr_privilege_attrib_1privilege_entries;cntr_privilege_attrib_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_privilege_attrib_1) != -1) { + ndr_print_uint32(ndr, "privilege_attrib", r->privilege_attrib[cntr_privilege_attrib_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_ptr(ndr, "privilege_name", r->privilege_name); + ndr->depth++; + if (r->privilege_name) { + ndr->print(ndr, "%s: ARRAY(%d)", "privilege_name", (int)r->privilege_entries); + ndr->depth++; + for (cntr_privilege_name_1=0;cntr_privilege_name_1privilege_entries;cntr_privilege_name_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_privilege_name_1) != -1) { + ndr_print_lsa_String(ndr, "privilege_name", &r->privilege_name[cntr_privilege_name_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_netr_QUOTA_LIMITS(ndr, "quotalimits", &r->quotalimits); + ndr_print_uint32(ndr, "system_flags", r->system_flags); + ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); + ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); + ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_DELETE_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_ACCOUNT *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_ACCOUNT *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_ACCOUNT *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_DELETE_ACCOUNT"); + ndr->depth++; + ndr_print_uint16(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_DELETE_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_SECRET *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_SECRET *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_SECRET *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_DELETE_SECRET"); + ndr->depth++; + ndr_print_uint16(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_CIPHER_VALUE(struct ndr_push *ndr, int ndr_flags, const struct netr_CIPHER_VALUE *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlen)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->cipher_data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->cipher_data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->cipher_data, r->len)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_CIPHER_VALUE(struct ndr_pull *ndr, int ndr_flags, struct netr_CIPHER_VALUE *r) +{ + uint32_t _ptr_cipher_data; + TALLOC_CTX *_mem_save_cipher_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlen)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cipher_data)); + if (_ptr_cipher_data) { + NDR_PULL_ALLOC(ndr, r->cipher_data); + } else { + r->cipher_data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->cipher_data) { + _mem_save_cipher_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->cipher_data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->cipher_data)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->cipher_data)); + if (ndr_get_array_length(ndr, &r->cipher_data) > ndr_get_array_size(ndr, &r->cipher_data)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->cipher_data), ndr_get_array_length(ndr, &r->cipher_data)); + } + NDR_PULL_ALLOC_N(ndr, r->cipher_data, ndr_get_array_size(ndr, &r->cipher_data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->cipher_data, ndr_get_array_length(ndr, &r->cipher_data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cipher_data_0, 0); + } + if (r->cipher_data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cipher_data, r->maxlen)); + } + if (r->cipher_data) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->cipher_data, r->len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_CIPHER_VALUE(struct ndr_print *ndr, const char *name, const struct netr_CIPHER_VALUE *r) +{ + ndr_print_struct(ndr, name, "netr_CIPHER_VALUE"); + ndr->depth++; + ndr_print_uint32(ndr, "len", r->len); + ndr_print_uint32(ndr, "maxlen", r->maxlen); + ndr_print_ptr(ndr, "cipher_data", r->cipher_data); + ndr->depth++; + if (r->cipher_data) { + ndr_print_array_uint8(ndr, "cipher_data", r->cipher_data, r->len); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_SECRET *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->current_cipher)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->current_cipher_set_time)); + NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->old_cipher)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->old_cipher_set_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->current_cipher)); + NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->old_cipher)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_SECRET *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->current_cipher)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->current_cipher_set_time)); + NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->old_cipher)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->old_cipher_set_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->current_cipher)); + NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->old_cipher)); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_SECRET *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_SECRET"); + ndr->depth++; + ndr_print_netr_CIPHER_VALUE(ndr, "current_cipher", &r->current_cipher); + ndr_print_NTTIME(ndr, "current_cipher_set_time", r->current_cipher_set_time); + ndr_print_netr_CIPHER_VALUE(ndr, "old_cipher", &r->old_cipher); + ndr_print_NTTIME(ndr, "old_cipher_set_time", r->old_cipher_set_time); + ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); + ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); + ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr_print_uint32(ndr, "unknown6", r->unknown6); + ndr_print_uint32(ndr, "unknown7", r->unknown7); + ndr_print_uint32(ndr, "unknown8", r->unknown8); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DeltaEnum(struct ndr_push *ndr, int ndr_flags, enum netr_DeltaEnum r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DeltaEnum(struct ndr_pull *ndr, int ndr_flags, enum netr_DeltaEnum *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DeltaEnum(struct ndr_print *ndr, const char *name, enum netr_DeltaEnum r) +{ + const char *val = NULL; + + switch (r) { + case NETR_DELTA_DOMAIN: val = "NETR_DELTA_DOMAIN"; break; + case NETR_DELTA_GROUP: val = "NETR_DELTA_GROUP"; break; + case NETR_DELTA_DELETE_GROUP: val = "NETR_DELTA_DELETE_GROUP"; break; + case NETR_DELTA_RENAME_GROUP: val = "NETR_DELTA_RENAME_GROUP"; break; + case NETR_DELTA_USER: val = "NETR_DELTA_USER"; break; + case NETR_DELTA_DELETE_USER: val = "NETR_DELTA_DELETE_USER"; break; + case NETR_DELTA_RENAME_USER: val = "NETR_DELTA_RENAME_USER"; break; + case NETR_DELTA_GROUP_MEMBER: val = "NETR_DELTA_GROUP_MEMBER"; break; + case NETR_DELTA_ALIAS: val = "NETR_DELTA_ALIAS"; break; + case NETR_DELTA_DELETE_ALIAS: val = "NETR_DELTA_DELETE_ALIAS"; break; + case NETR_DELTA_RENAME_ALIAS: val = "NETR_DELTA_RENAME_ALIAS"; break; + case NETR_DELTA_ALIAS_MEMBER: val = "NETR_DELTA_ALIAS_MEMBER"; break; + case NETR_DELTA_POLICY: val = "NETR_DELTA_POLICY"; break; + case NETR_DELTA_TRUSTED_DOMAIN: val = "NETR_DELTA_TRUSTED_DOMAIN"; break; + case NETR_DELTA_DELETE_TRUST: val = "NETR_DELTA_DELETE_TRUST"; break; + case NETR_DELTA_ACCOUNT: val = "NETR_DELTA_ACCOUNT"; break; + case NETR_DELTA_DELETE_ACCOUNT: val = "NETR_DELTA_DELETE_ACCOUNT"; break; + case NETR_DELTA_SECRET: val = "NETR_DELTA_SECRET"; break; + case NETR_DELTA_DELETE_SECRET: val = "NETR_DELTA_DELETE_SECRET"; break; + case NETR_DELTA_DELETE_GROUP2: val = "NETR_DELTA_DELETE_GROUP2"; break; + case NETR_DELTA_DELETE_USER2: val = "NETR_DELTA_DELETE_USER2"; break; + case NETR_DELTA_MODIFY_COUNT: val = "NETR_DELTA_MODIFY_COUNT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_netr_DELTA_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_UNION *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level)); + switch (level) { + case NETR_DELTA_DOMAIN: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + break; } + + case NETR_DELTA_GROUP: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->group)); + break; } + + case NETR_DELTA_DELETE_GROUP: { + break; } + + case NETR_DELTA_RENAME_GROUP: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_group)); + break; } + + case NETR_DELTA_USER: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); + break; } + + case NETR_DELTA_DELETE_USER: { + break; } + + case NETR_DELTA_RENAME_USER: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_user)); + break; } + + case NETR_DELTA_GROUP_MEMBER: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_member)); + break; } + + case NETR_DELTA_ALIAS: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias)); + break; } + + case NETR_DELTA_DELETE_ALIAS: { + break; } + + case NETR_DELTA_RENAME_ALIAS: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_alias)); + break; } + + case NETR_DELTA_ALIAS_MEMBER: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias_member)); + break; } + + case NETR_DELTA_POLICY: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy)); + break; } + + case NETR_DELTA_TRUSTED_DOMAIN: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domain)); + break; } + + case NETR_DELTA_DELETE_TRUST: { + NDR_CHECK(ndr_push_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust)); + break; } + + case NETR_DELTA_ACCOUNT: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->account)); + break; } + + case NETR_DELTA_DELETE_ACCOUNT: { + NDR_CHECK(ndr_push_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account)); + break; } + + case NETR_DELTA_SECRET: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->secret)); + break; } + + case NETR_DELTA_DELETE_SECRET: { + NDR_CHECK(ndr_push_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret)); + break; } + + case NETR_DELTA_DELETE_GROUP2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_group)); + break; } + + case NETR_DELTA_DELETE_USER2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_user)); + break; } + + case NETR_DELTA_MODIFY_COUNT: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->modified_count)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NETR_DELTA_DOMAIN: + if (r->domain) { + NDR_CHECK(ndr_push_netr_DELTA_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain)); + } + break; + + case NETR_DELTA_GROUP: + if (r->group) { + NDR_CHECK(ndr_push_netr_DELTA_GROUP(ndr, NDR_SCALARS|NDR_BUFFERS, r->group)); + } + break; + + case NETR_DELTA_DELETE_GROUP: + break; + + case NETR_DELTA_RENAME_GROUP: + if (r->rename_group) { + NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_group)); + } + break; + + case NETR_DELTA_USER: + if (r->user) { + NDR_CHECK(ndr_push_netr_DELTA_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->user)); + } + break; + + case NETR_DELTA_DELETE_USER: + break; + + case NETR_DELTA_RENAME_USER: + if (r->rename_user) { + NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_user)); + } + break; + + case NETR_DELTA_GROUP_MEMBER: + if (r->group_member) { + NDR_CHECK(ndr_push_netr_DELTA_GROUP_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_member)); + } + break; + + case NETR_DELTA_ALIAS: + if (r->alias) { + NDR_CHECK(ndr_push_netr_DELTA_ALIAS(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias)); + } + break; + + case NETR_DELTA_DELETE_ALIAS: + break; + + case NETR_DELTA_RENAME_ALIAS: + if (r->rename_alias) { + NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_alias)); + } + break; + + case NETR_DELTA_ALIAS_MEMBER: + if (r->alias_member) { + NDR_CHECK(ndr_push_netr_DELTA_ALIAS_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias_member)); + } + break; + + case NETR_DELTA_POLICY: + if (r->policy) { + NDR_CHECK(ndr_push_netr_DELTA_POLICY(ndr, NDR_SCALARS|NDR_BUFFERS, r->policy)); + } + break; + + case NETR_DELTA_TRUSTED_DOMAIN: + if (r->trusted_domain) { + NDR_CHECK(ndr_push_netr_DELTA_TRUSTED_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->trusted_domain)); + } + break; + + case NETR_DELTA_DELETE_TRUST: + break; + + case NETR_DELTA_ACCOUNT: + if (r->account) { + NDR_CHECK(ndr_push_netr_DELTA_ACCOUNT(ndr, NDR_SCALARS|NDR_BUFFERS, r->account)); + } + break; + + case NETR_DELTA_DELETE_ACCOUNT: + break; + + case NETR_DELTA_SECRET: + if (r->secret) { + NDR_CHECK(ndr_push_netr_DELTA_SECRET(ndr, NDR_SCALARS|NDR_BUFFERS, r->secret)); + } + break; + + case NETR_DELTA_DELETE_SECRET: + break; + + case NETR_DELTA_DELETE_GROUP2: + if (r->delete_group) { + NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_group)); + } + break; + + case NETR_DELTA_DELETE_USER2: + if (r->delete_user) { + NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_user)); + } + break; + + case NETR_DELTA_MODIFY_COUNT: + if (r->modified_count) { + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->modified_count)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_UNION *r) +{ + int level; + uint16_t _level; + TALLOC_CTX *_mem_save_domain_0; + TALLOC_CTX *_mem_save_group_0; + TALLOC_CTX *_mem_save_rename_group_0; + TALLOC_CTX *_mem_save_user_0; + TALLOC_CTX *_mem_save_rename_user_0; + TALLOC_CTX *_mem_save_group_member_0; + TALLOC_CTX *_mem_save_alias_0; + TALLOC_CTX *_mem_save_rename_alias_0; + TALLOC_CTX *_mem_save_alias_member_0; + TALLOC_CTX *_mem_save_policy_0; + TALLOC_CTX *_mem_save_trusted_domain_0; + TALLOC_CTX *_mem_save_account_0; + TALLOC_CTX *_mem_save_secret_0; + TALLOC_CTX *_mem_save_delete_group_0; + TALLOC_CTX *_mem_save_delete_user_0; + TALLOC_CTX *_mem_save_modified_count_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case NETR_DELTA_DOMAIN: { + uint32_t _ptr_domain; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + break; } + + case NETR_DELTA_GROUP: { + uint32_t _ptr_group; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group)); + if (_ptr_group) { + NDR_PULL_ALLOC(ndr, r->group); + } else { + r->group = NULL; + } + break; } + + case NETR_DELTA_DELETE_GROUP: { + break; } + + case NETR_DELTA_RENAME_GROUP: { + uint32_t _ptr_rename_group; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_group)); + if (_ptr_rename_group) { + NDR_PULL_ALLOC(ndr, r->rename_group); + } else { + r->rename_group = NULL; + } + break; } + + case NETR_DELTA_USER: { + uint32_t _ptr_user; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->user); + } else { + r->user = NULL; + } + break; } + + case NETR_DELTA_DELETE_USER: { + break; } + + case NETR_DELTA_RENAME_USER: { + uint32_t _ptr_rename_user; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_user)); + if (_ptr_rename_user) { + NDR_PULL_ALLOC(ndr, r->rename_user); + } else { + r->rename_user = NULL; + } + break; } + + case NETR_DELTA_GROUP_MEMBER: { + uint32_t _ptr_group_member; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_member)); + if (_ptr_group_member) { + NDR_PULL_ALLOC(ndr, r->group_member); + } else { + r->group_member = NULL; + } + break; } + + case NETR_DELTA_ALIAS: { + uint32_t _ptr_alias; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alias)); + if (_ptr_alias) { + NDR_PULL_ALLOC(ndr, r->alias); + } else { + r->alias = NULL; + } + break; } + + case NETR_DELTA_DELETE_ALIAS: { + break; } + + case NETR_DELTA_RENAME_ALIAS: { + uint32_t _ptr_rename_alias; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_alias)); + if (_ptr_rename_alias) { + NDR_PULL_ALLOC(ndr, r->rename_alias); + } else { + r->rename_alias = NULL; + } + break; } + + case NETR_DELTA_ALIAS_MEMBER: { + uint32_t _ptr_alias_member; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alias_member)); + if (_ptr_alias_member) { + NDR_PULL_ALLOC(ndr, r->alias_member); + } else { + r->alias_member = NULL; + } + break; } + + case NETR_DELTA_POLICY: { + uint32_t _ptr_policy; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_policy)); + if (_ptr_policy) { + NDR_PULL_ALLOC(ndr, r->policy); + } else { + r->policy = NULL; + } + break; } + + case NETR_DELTA_TRUSTED_DOMAIN: { + uint32_t _ptr_trusted_domain; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain)); + if (_ptr_trusted_domain) { + NDR_PULL_ALLOC(ndr, r->trusted_domain); + } else { + r->trusted_domain = NULL; + } + break; } + + case NETR_DELTA_DELETE_TRUST: { + NDR_CHECK(ndr_pull_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust)); + break; } + + case NETR_DELTA_ACCOUNT: { + uint32_t _ptr_account; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account)); + if (_ptr_account) { + NDR_PULL_ALLOC(ndr, r->account); + } else { + r->account = NULL; + } + break; } + + case NETR_DELTA_DELETE_ACCOUNT: { + NDR_CHECK(ndr_pull_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account)); + break; } + + case NETR_DELTA_SECRET: { + uint32_t _ptr_secret; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secret)); + if (_ptr_secret) { + NDR_PULL_ALLOC(ndr, r->secret); + } else { + r->secret = NULL; + } + break; } + + case NETR_DELTA_DELETE_SECRET: { + NDR_CHECK(ndr_pull_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret)); + break; } + + case NETR_DELTA_DELETE_GROUP2: { + uint32_t _ptr_delete_group; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delete_group)); + if (_ptr_delete_group) { + NDR_PULL_ALLOC(ndr, r->delete_group); + } else { + r->delete_group = NULL; + } + break; } + + case NETR_DELTA_DELETE_USER2: { + uint32_t _ptr_delete_user; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delete_user)); + if (_ptr_delete_user) { + NDR_PULL_ALLOC(ndr, r->delete_user); + } else { + r->delete_user = NULL; + } + break; } + + case NETR_DELTA_MODIFY_COUNT: { + uint32_t _ptr_modified_count; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_modified_count)); + if (_ptr_modified_count) { + NDR_PULL_ALLOC(ndr, r->modified_count); + } else { + r->modified_count = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case NETR_DELTA_DOMAIN: + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_netr_DELTA_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + break; + + case NETR_DELTA_GROUP: + if (r->group) { + _mem_save_group_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->group, 0); + NDR_CHECK(ndr_pull_netr_DELTA_GROUP(ndr, NDR_SCALARS|NDR_BUFFERS, r->group)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_0, 0); + } + break; + + case NETR_DELTA_DELETE_GROUP: + break; + + case NETR_DELTA_RENAME_GROUP: + if (r->rename_group) { + _mem_save_rename_group_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rename_group, 0); + NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_group)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_group_0, 0); + } + break; + + case NETR_DELTA_USER: + if (r->user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); + NDR_CHECK(ndr_pull_netr_DELTA_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->user)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + break; + + case NETR_DELTA_DELETE_USER: + break; + + case NETR_DELTA_RENAME_USER: + if (r->rename_user) { + _mem_save_rename_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rename_user, 0); + NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_user)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_user_0, 0); + } + break; + + case NETR_DELTA_GROUP_MEMBER: + if (r->group_member) { + _mem_save_group_member_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->group_member, 0); + NDR_CHECK(ndr_pull_netr_DELTA_GROUP_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_member)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_member_0, 0); + } + break; + + case NETR_DELTA_ALIAS: + if (r->alias) { + _mem_save_alias_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->alias, 0); + NDR_CHECK(ndr_pull_netr_DELTA_ALIAS(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_0, 0); + } + break; + + case NETR_DELTA_DELETE_ALIAS: + break; + + case NETR_DELTA_RENAME_ALIAS: + if (r->rename_alias) { + _mem_save_rename_alias_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rename_alias, 0); + NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_alias)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_alias_0, 0); + } + break; + + case NETR_DELTA_ALIAS_MEMBER: + if (r->alias_member) { + _mem_save_alias_member_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->alias_member, 0); + NDR_CHECK(ndr_pull_netr_DELTA_ALIAS_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias_member)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_member_0, 0); + } + break; + + case NETR_DELTA_POLICY: + if (r->policy) { + _mem_save_policy_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->policy, 0); + NDR_CHECK(ndr_pull_netr_DELTA_POLICY(ndr, NDR_SCALARS|NDR_BUFFERS, r->policy)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_0, 0); + } + break; + + case NETR_DELTA_TRUSTED_DOMAIN: + if (r->trusted_domain) { + _mem_save_trusted_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domain, 0); + NDR_CHECK(ndr_pull_netr_DELTA_TRUSTED_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->trusted_domain)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_0, 0); + } + break; + + case NETR_DELTA_DELETE_TRUST: + break; + + case NETR_DELTA_ACCOUNT: + if (r->account) { + _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->account, 0); + NDR_CHECK(ndr_pull_netr_DELTA_ACCOUNT(ndr, NDR_SCALARS|NDR_BUFFERS, r->account)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, 0); + } + break; + + case NETR_DELTA_DELETE_ACCOUNT: + break; + + case NETR_DELTA_SECRET: + if (r->secret) { + _mem_save_secret_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->secret, 0); + NDR_CHECK(ndr_pull_netr_DELTA_SECRET(ndr, NDR_SCALARS|NDR_BUFFERS, r->secret)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secret_0, 0); + } + break; + + case NETR_DELTA_DELETE_SECRET: + break; + + case NETR_DELTA_DELETE_GROUP2: + if (r->delete_group) { + _mem_save_delete_group_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->delete_group, 0); + NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_group)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delete_group_0, 0); + } + break; + + case NETR_DELTA_DELETE_USER2: + if (r->delete_user) { + _mem_save_delete_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->delete_user, 0); + NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_user)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delete_user_0, 0); + } + break; + + case NETR_DELTA_MODIFY_COUNT: + if (r->modified_count) { + _mem_save_modified_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->modified_count, 0); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->modified_count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_modified_count_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_UNION *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_DELTA_UNION"); + switch (level) { + case NETR_DELTA_DOMAIN: + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_netr_DELTA_DOMAIN(ndr, "domain", r->domain); + } + ndr->depth--; + break; + + case NETR_DELTA_GROUP: + ndr_print_ptr(ndr, "group", r->group); + ndr->depth++; + if (r->group) { + ndr_print_netr_DELTA_GROUP(ndr, "group", r->group); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_GROUP: + break; + + case NETR_DELTA_RENAME_GROUP: + ndr_print_ptr(ndr, "rename_group", r->rename_group); + ndr->depth++; + if (r->rename_group) { + ndr_print_netr_DELTA_RENAME(ndr, "rename_group", r->rename_group); + } + ndr->depth--; + break; + + case NETR_DELTA_USER: + ndr_print_ptr(ndr, "user", r->user); + ndr->depth++; + if (r->user) { + ndr_print_netr_DELTA_USER(ndr, "user", r->user); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_USER: + break; + + case NETR_DELTA_RENAME_USER: + ndr_print_ptr(ndr, "rename_user", r->rename_user); + ndr->depth++; + if (r->rename_user) { + ndr_print_netr_DELTA_RENAME(ndr, "rename_user", r->rename_user); + } + ndr->depth--; + break; + + case NETR_DELTA_GROUP_MEMBER: + ndr_print_ptr(ndr, "group_member", r->group_member); + ndr->depth++; + if (r->group_member) { + ndr_print_netr_DELTA_GROUP_MEMBER(ndr, "group_member", r->group_member); + } + ndr->depth--; + break; + + case NETR_DELTA_ALIAS: + ndr_print_ptr(ndr, "alias", r->alias); + ndr->depth++; + if (r->alias) { + ndr_print_netr_DELTA_ALIAS(ndr, "alias", r->alias); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_ALIAS: + break; + + case NETR_DELTA_RENAME_ALIAS: + ndr_print_ptr(ndr, "rename_alias", r->rename_alias); + ndr->depth++; + if (r->rename_alias) { + ndr_print_netr_DELTA_RENAME(ndr, "rename_alias", r->rename_alias); + } + ndr->depth--; + break; + + case NETR_DELTA_ALIAS_MEMBER: + ndr_print_ptr(ndr, "alias_member", r->alias_member); + ndr->depth++; + if (r->alias_member) { + ndr_print_netr_DELTA_ALIAS_MEMBER(ndr, "alias_member", r->alias_member); + } + ndr->depth--; + break; + + case NETR_DELTA_POLICY: + ndr_print_ptr(ndr, "policy", r->policy); + ndr->depth++; + if (r->policy) { + ndr_print_netr_DELTA_POLICY(ndr, "policy", r->policy); + } + ndr->depth--; + break; + + case NETR_DELTA_TRUSTED_DOMAIN: + ndr_print_ptr(ndr, "trusted_domain", r->trusted_domain); + ndr->depth++; + if (r->trusted_domain) { + ndr_print_netr_DELTA_TRUSTED_DOMAIN(ndr, "trusted_domain", r->trusted_domain); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_TRUST: + ndr_print_netr_DELTA_DELETE_TRUST(ndr, "delete_trust", &r->delete_trust); + break; + + case NETR_DELTA_ACCOUNT: + ndr_print_ptr(ndr, "account", r->account); + ndr->depth++; + if (r->account) { + ndr_print_netr_DELTA_ACCOUNT(ndr, "account", r->account); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_ACCOUNT: + ndr_print_netr_DELTA_DELETE_ACCOUNT(ndr, "delete_account", &r->delete_account); + break; + + case NETR_DELTA_SECRET: + ndr_print_ptr(ndr, "secret", r->secret); + ndr->depth++; + if (r->secret) { + ndr_print_netr_DELTA_SECRET(ndr, "secret", r->secret); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_SECRET: + ndr_print_netr_DELTA_DELETE_SECRET(ndr, "delete_secret", &r->delete_secret); + break; + + case NETR_DELTA_DELETE_GROUP2: + ndr_print_ptr(ndr, "delete_group", r->delete_group); + ndr->depth++; + if (r->delete_group) { + ndr_print_netr_DELTA_DELETE_USER(ndr, "delete_group", r->delete_group); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_USER2: + ndr_print_ptr(ndr, "delete_user", r->delete_user); + ndr->depth++; + if (r->delete_user) { + ndr_print_netr_DELTA_DELETE_USER(ndr, "delete_user", r->delete_user); + } + ndr->depth--; + break; + + case NETR_DELTA_MODIFY_COUNT: + ndr_print_ptr(ndr, "modified_count", r->modified_count); + ndr->depth++; + if (r->modified_count) { + ndr_print_udlong(ndr, "modified_count", *r->modified_count); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_netr_DELTA_ID_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_ID_UNION *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level)); + switch (level) { + case NETR_DELTA_DOMAIN: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_GROUP: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_DELETE_GROUP: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_RENAME_GROUP: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_USER: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_DELETE_USER: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_RENAME_USER: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_GROUP_MEMBER: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_ALIAS: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_DELETE_ALIAS: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_RENAME_ALIAS: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_ALIAS_MEMBER: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_POLICY: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + break; } + + case NETR_DELTA_TRUSTED_DOMAIN: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + break; } + + case NETR_DELTA_DELETE_TRUST: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + break; } + + case NETR_DELTA_ACCOUNT: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + break; } + + case NETR_DELTA_DELETE_ACCOUNT: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + break; } + + case NETR_DELTA_SECRET: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + break; } + + case NETR_DELTA_DELETE_SECRET: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + break; } + + case NETR_DELTA_DELETE_GROUP2: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_DELETE_USER2: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + break; } + + case NETR_DELTA_MODIFY_COUNT: { + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NETR_DELTA_DOMAIN: + break; + + case NETR_DELTA_GROUP: + break; + + case NETR_DELTA_DELETE_GROUP: + break; + + case NETR_DELTA_RENAME_GROUP: + break; + + case NETR_DELTA_USER: + break; + + case NETR_DELTA_DELETE_USER: + break; + + case NETR_DELTA_RENAME_USER: + break; + + case NETR_DELTA_GROUP_MEMBER: + break; + + case NETR_DELTA_ALIAS: + break; + + case NETR_DELTA_DELETE_ALIAS: + break; + + case NETR_DELTA_RENAME_ALIAS: + break; + + case NETR_DELTA_ALIAS_MEMBER: + break; + + case NETR_DELTA_POLICY: + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + break; + + case NETR_DELTA_TRUSTED_DOMAIN: + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + break; + + case NETR_DELTA_DELETE_TRUST: + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + break; + + case NETR_DELTA_ACCOUNT: + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + break; + + case NETR_DELTA_DELETE_ACCOUNT: + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + break; + + case NETR_DELTA_SECRET: + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + break; + + case NETR_DELTA_DELETE_SECRET: + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + break; + + case NETR_DELTA_DELETE_GROUP2: + break; + + case NETR_DELTA_DELETE_USER2: + break; + + case NETR_DELTA_MODIFY_COUNT: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_ID_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_ID_UNION *r) +{ + int level; + uint16_t _level; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_name_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case NETR_DELTA_DOMAIN: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_GROUP: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_DELETE_GROUP: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_RENAME_GROUP: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_USER: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_DELETE_USER: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_RENAME_USER: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_GROUP_MEMBER: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_ALIAS: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_DELETE_ALIAS: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_RENAME_ALIAS: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_ALIAS_MEMBER: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_POLICY: { + uint32_t _ptr_sid; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + break; } + + case NETR_DELTA_TRUSTED_DOMAIN: { + uint32_t _ptr_sid; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + break; } + + case NETR_DELTA_DELETE_TRUST: { + uint32_t _ptr_sid; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + break; } + + case NETR_DELTA_ACCOUNT: { + uint32_t _ptr_sid; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + break; } + + case NETR_DELTA_DELETE_ACCOUNT: { + uint32_t _ptr_sid; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + break; } + + case NETR_DELTA_SECRET: { + uint32_t _ptr_name; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + break; } + + case NETR_DELTA_DELETE_SECRET: { + uint32_t _ptr_name; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + break; } + + case NETR_DELTA_DELETE_GROUP2: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_DELETE_USER2: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + break; } + + case NETR_DELTA_MODIFY_COUNT: { + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case NETR_DELTA_DOMAIN: + break; + + case NETR_DELTA_GROUP: + break; + + case NETR_DELTA_DELETE_GROUP: + break; + + case NETR_DELTA_RENAME_GROUP: + break; + + case NETR_DELTA_USER: + break; + + case NETR_DELTA_DELETE_USER: + break; + + case NETR_DELTA_RENAME_USER: + break; + + case NETR_DELTA_GROUP_MEMBER: + break; + + case NETR_DELTA_ALIAS: + break; + + case NETR_DELTA_DELETE_ALIAS: + break; + + case NETR_DELTA_RENAME_ALIAS: + break; + + case NETR_DELTA_ALIAS_MEMBER: + break; + + case NETR_DELTA_POLICY: + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + break; + + case NETR_DELTA_TRUSTED_DOMAIN: + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + break; + + case NETR_DELTA_DELETE_TRUST: + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + break; + + case NETR_DELTA_ACCOUNT: + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + break; + + case NETR_DELTA_DELETE_ACCOUNT: + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + break; + + case NETR_DELTA_SECRET: + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + break; + + case NETR_DELTA_DELETE_SECRET: + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + break; + + case NETR_DELTA_DELETE_GROUP2: + break; + + case NETR_DELTA_DELETE_USER2: + break; + + case NETR_DELTA_MODIFY_COUNT: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_ID_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_ID_UNION *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_DELTA_ID_UNION"); + switch (level) { + case NETR_DELTA_DOMAIN: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_GROUP: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_DELETE_GROUP: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_RENAME_GROUP: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_USER: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_DELETE_USER: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_RENAME_USER: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_GROUP_MEMBER: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_ALIAS: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_DELETE_ALIAS: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_RENAME_ALIAS: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_ALIAS_MEMBER: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_POLICY: + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + break; + + case NETR_DELTA_TRUSTED_DOMAIN: + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_TRUST: + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + break; + + case NETR_DELTA_ACCOUNT: + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_ACCOUNT: + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + break; + + case NETR_DELTA_SECRET: + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_SECRET: + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + break; + + case NETR_DELTA_DELETE_GROUP2: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_DELETE_USER2: + ndr_print_uint32(ndr, "rid", r->rid); + break; + + case NETR_DELTA_MODIFY_COUNT: + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_netr_DELTA_ENUM(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, r->delta_type)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->delta_id_union, r->delta_type)); + NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr, NDR_SCALARS, &r->delta_id_union)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->delta_union, r->delta_type)); + NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr, NDR_SCALARS, &r->delta_union)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union)); + NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_ENUM(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_DeltaEnum(ndr, NDR_SCALARS, &r->delta_type)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->delta_id_union, r->delta_type)); + NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr, NDR_SCALARS, &r->delta_id_union)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->delta_union, r->delta_type)); + NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr, NDR_SCALARS, &r->delta_union)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union)); + NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_ENUM(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM *r) +{ + ndr_print_struct(ndr, name, "netr_DELTA_ENUM"); + ndr->depth++; + ndr_print_netr_DeltaEnum(ndr, "delta_type", r->delta_type); + ndr_print_set_switch_value(ndr, &r->delta_id_union, r->delta_type); + ndr_print_netr_DELTA_ID_UNION(ndr, "delta_id_union", &r->delta_id_union); + ndr_print_set_switch_value(ndr, &r->delta_union, r->delta_type); + ndr_print_netr_DELTA_UNION(ndr, "delta_union", &r->delta_union); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DELTA_ENUM_ARRAY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM_ARRAY *r) +{ + uint32_t cntr_delta_enum_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_deltas)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->delta_enum)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->delta_enum) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_deltas)); + for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) { + NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr, NDR_SCALARS, &r->delta_enum[cntr_delta_enum_1])); + } + for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) { + NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr, NDR_BUFFERS, &r->delta_enum[cntr_delta_enum_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DELTA_ENUM_ARRAY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM_ARRAY *r) +{ + uint32_t _ptr_delta_enum; + uint32_t cntr_delta_enum_1; + TALLOC_CTX *_mem_save_delta_enum_0; + TALLOC_CTX *_mem_save_delta_enum_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_deltas)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum)); + if (_ptr_delta_enum) { + NDR_PULL_ALLOC(ndr, r->delta_enum); + } else { + r->delta_enum = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->delta_enum) { + _mem_save_delta_enum_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->delta_enum, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->delta_enum)); + NDR_PULL_ALLOC_N(ndr, r->delta_enum, ndr_get_array_size(ndr, &r->delta_enum)); + _mem_save_delta_enum_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->delta_enum, 0); + for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) { + NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr, NDR_SCALARS, &r->delta_enum[cntr_delta_enum_1])); + } + for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) { + NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr, NDR_BUFFERS, &r->delta_enum[cntr_delta_enum_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_0, 0); + } + if (r->delta_enum) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->delta_enum, r->num_deltas)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM_ARRAY *r) +{ + uint32_t cntr_delta_enum_1; + ndr_print_struct(ndr, name, "netr_DELTA_ENUM_ARRAY"); + ndr->depth++; + ndr_print_uint32(ndr, "num_deltas", r->num_deltas); + ndr_print_ptr(ndr, "delta_enum", r->delta_enum); + ndr->depth++; + if (r->delta_enum) { + ndr->print(ndr, "%s: ARRAY(%d)", "delta_enum", (int)r->num_deltas); + ndr->depth++; + for (cntr_delta_enum_1=0;cntr_delta_enum_1num_deltas;cntr_delta_enum_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_delta_enum_1) != -1) { + ndr_print_netr_DELTA_ENUM(ndr, "delta_enum", &r->delta_enum[cntr_delta_enum_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_UAS_INFO_0(struct ndr_push *ndr, int ndr_flags, const struct netr_UAS_INFO_0 *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->computer_name, 16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timecreated)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_UAS_INFO_0(struct ndr_pull *ndr, int ndr_flags, struct netr_UAS_INFO_0 *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->computer_name, 16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timecreated)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_UAS_INFO_0(struct ndr_print *ndr, const char *name, const struct netr_UAS_INFO_0 *r) +{ + ndr_print_struct(ndr, name, "netr_UAS_INFO_0"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "computer_name", r->computer_name, 16); + ndr_print_uint32(ndr, "timecreated", r->timecreated); + ndr_print_uint32(ndr, "serial_number", r->serial_number); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_netr_AccountBuffer(struct ndr_push *ndr, int ndr_flags, const struct netr_AccountBuffer *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->blob)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_AccountBuffer(struct ndr_pull *ndr, int ndr_flags, struct netr_AccountBuffer *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->blob)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_AccountBuffer(struct ndr_print *ndr, const char *name, const struct netr_AccountBuffer *r) +{ + ndr_print_struct(ndr, name, "netr_AccountBuffer"); + ndr->depth++; + ndr_print_DATA_BLOB(ndr, "blob", r->blob); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_InfoFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_InfoFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_InfoFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CTRL_REPL_NEEDED", NETLOGON_CTRL_REPL_NEEDED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CTRL_REPL_IN_PROGRESS", NETLOGON_CTRL_REPL_IN_PROGRESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CTRL_REPL_FULL_SYNC", NETLOGON_CTRL_REPL_FULL_SYNC, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_1(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pdc_connection_status)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pdc_connection_status)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_1 *r) +{ + ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_1"); + ndr->depth++; + ndr_print_netr_InfoFlags(ndr, "flags", r->flags); + ndr_print_uint32(ndr, "pdc_connection_status", r->pdc_connection_status); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_2(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pdc_connection_status)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_dc_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tc_connection_status)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->trusted_dc_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->trusted_dc_name, ndr_charset_length(r->trusted_dc_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_2 *r) +{ + uint32_t _ptr_trusted_dc_name; + TALLOC_CTX *_mem_save_trusted_dc_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pdc_connection_status)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_dc_name)); + if (_ptr_trusted_dc_name) { + NDR_PULL_ALLOC(ndr, r->trusted_dc_name); + } else { + r->trusted_dc_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tc_connection_status)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->trusted_dc_name) { + _mem_save_trusted_dc_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->trusted_dc_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_dc_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_dc_name)); + if (ndr_get_array_length(ndr, &r->trusted_dc_name) > ndr_get_array_size(ndr, &r->trusted_dc_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->trusted_dc_name), ndr_get_array_length(ndr, &r->trusted_dc_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_dc_name, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_dc_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_2 *r) +{ + ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_2"); + ndr->depth++; + ndr_print_netr_InfoFlags(ndr, "flags", r->flags); + ndr_print_uint32(ndr, "pdc_connection_status", r->pdc_connection_status); + ndr_print_ptr(ndr, "trusted_dc_name", r->trusted_dc_name); + ndr->depth++; + if (r->trusted_dc_name) { + ndr_print_string(ndr, "trusted_dc_name", r->trusted_dc_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "tc_connection_status", r->tc_connection_status); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_3(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_attempts)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_3(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_attempts)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_3 *r) +{ + ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_3"); + ndr->depth++; + ndr_print_netr_InfoFlags(ndr, "flags", r->flags); + ndr_print_uint32(ndr, "logon_attempts", r->logon_attempts); + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr_print_uint32(ndr, "unknown3", r->unknown3); + ndr_print_uint32(ndr, "unknown4", r->unknown4); + ndr_print_uint32(ndr, "unknown5", r->unknown5); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push *ndr, int ndr_flags, const union netr_CONTROL_QUERY_INFORMATION *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_netr_NETLOGON_INFO_1(ndr, NDR_SCALARS, r->info1)); + } + break; + + case 2: + if (r->info2) { + NDR_CHECK(ndr_push_netr_NETLOGON_INFO_2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + } + break; + + case 3: + if (r->info3) { + NDR_CHECK(ndr_push_netr_NETLOGON_INFO_3(ndr, NDR_SCALARS, r->info3)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_QUERY_INFORMATION *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info1_0; + TALLOC_CTX *_mem_save_info2_0; + TALLOC_CTX *_mem_save_info3_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_info2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_PULL_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + + case 3: { + uint32_t _ptr_info3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); + if (_ptr_info3) { + NDR_PULL_ALLOC(ndr, r->info3); + } else { + r->info3 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_1(ndr, NDR_SCALARS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + case 2: + if (r->info2) { + _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); + NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); + } + break; + + case 3: + if (r->info3) { + _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); + NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_3(ndr, NDR_SCALARS, r->info3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_QUERY_INFORMATION *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_CONTROL_QUERY_INFORMATION"); + switch (level) { + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_netr_NETLOGON_INFO_1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_netr_NETLOGON_INFO_2(ndr, "info2", r->info2); + } + ndr->depth--; + break; + + case 3: + ndr_print_ptr(ndr, "info3", r->info3); + ndr->depth++; + if (r->info3) { + ndr_print_netr_NETLOGON_INFO_3(ndr, "info3", r->info3); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_netr_LogonControlCode(struct ndr_push *ndr, int ndr_flags, enum netr_LogonControlCode r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonControlCode(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonControlCode *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char *name, enum netr_LogonControlCode r) +{ + const char *val = NULL; + + switch (r) { + case NETLOGON_CONTROL_SYNC: val = "NETLOGON_CONTROL_SYNC"; break; + case NETLOGON_CONTROL_REDISCOVER: val = "NETLOGON_CONTROL_REDISCOVER"; break; + case NETLOGON_CONTROL_TC_QUERY: val = "NETLOGON_CONTROL_TC_QUERY"; break; + case NETLOGON_CONTROL_TRANSPORT_NOTIFY: val = "NETLOGON_CONTROL_TRANSPORT_NOTIFY"; break; + case NETLOGON_CONTROL_SET_DBFLAG: val = "NETLOGON_CONTROL_SET_DBFLAG"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_netr_CONTROL_DATA_INFORMATION(struct ndr_push *ndr, int ndr_flags, const union netr_CONTROL_DATA_INFORMATION *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case NETLOGON_CONTROL_REDISCOVER: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + break; } + + case NETLOGON_CONTROL_TC_QUERY: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + break; } + + case NETLOGON_CONTROL_TRANSPORT_NOTIFY: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + break; } + + case NETLOGON_CONTROL_SET_DBFLAG: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->debug_level)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NETLOGON_CONTROL_REDISCOVER: + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + break; + + case NETLOGON_CONTROL_TC_QUERY: + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + break; + + case NETLOGON_CONTROL_TRANSPORT_NOTIFY: + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + break; + + case NETLOGON_CONTROL_SET_DBFLAG: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_DATA_INFORMATION *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_domain_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case NETLOGON_CONTROL_REDISCOVER: { + uint32_t _ptr_domain; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + break; } + + case NETLOGON_CONTROL_TC_QUERY: { + uint32_t _ptr_domain; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + break; } + + case NETLOGON_CONTROL_TRANSPORT_NOTIFY: { + uint32_t _ptr_domain; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + break; } + + case NETLOGON_CONTROL_SET_DBFLAG: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->debug_level)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case NETLOGON_CONTROL_REDISCOVER: + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + break; + + case NETLOGON_CONTROL_TC_QUERY: + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + break; + + case NETLOGON_CONTROL_TRANSPORT_NOTIFY: + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + break; + + case NETLOGON_CONTROL_SET_DBFLAG: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_DATA_INFORMATION *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_CONTROL_DATA_INFORMATION"); + switch (level) { + case NETLOGON_CONTROL_REDISCOVER: + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + break; + + case NETLOGON_CONTROL_TC_QUERY: + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + break; + + case NETLOGON_CONTROL_TRANSPORT_NOTIFY: + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + break; + + case NETLOGON_CONTROL_SET_DBFLAG: + ndr_print_uint32(ndr, "debug_level", r->debug_level); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_netr_NegotiateFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NegotiateFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NegotiateFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_ACCOUNT_LOCKOUT", NETLOGON_NEG_ACCOUNT_LOCKOUT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PERSISTENT_SAMREPL", NETLOGON_NEG_PERSISTENT_SAMREPL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_ARCFOUR", NETLOGON_NEG_ARCFOUR, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PROMOTION_COUNT", NETLOGON_NEG_PROMOTION_COUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CHANGELOG_BDC", NETLOGON_NEG_CHANGELOG_BDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_FULL_SYNC_REPL", NETLOGON_NEG_FULL_SYNC_REPL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_MULTIPLE_SIDS", NETLOGON_NEG_MULTIPLE_SIDS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_REDO", NETLOGON_NEG_REDO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL", NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SEND_PASSWORD_INFO_PDC", NETLOGON_NEG_SEND_PASSWORD_INFO_PDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_GENERIC_PASSTHROUGH", NETLOGON_NEG_GENERIC_PASSTHROUGH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CONCURRENT_RPC", NETLOGON_NEG_CONCURRENT_RPC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL", NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL", NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_128BIT", NETLOGON_NEG_128BIT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_TRANSITIVE_TRUSTS", NETLOGON_NEG_TRANSITIVE_TRUSTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_DNS_DOMAIN_TRUSTS", NETLOGON_NEG_DNS_DOMAIN_TRUSTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_SET2", NETLOGON_NEG_PASSWORD_SET2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_GETDOMAININFO", NETLOGON_NEG_GETDOMAININFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CROSS_FOREST_TRUSTS", NETLOGON_NEG_CROSS_FOREST_TRUSTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION", NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_RODC_PASSTHROUGH", NETLOGON_NEG_RODC_PASSTHROUGH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AUTHENTICATED_RPC_LSASS", NETLOGON_NEG_AUTHENTICATED_RPC_LSASS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SCHANNEL", NETLOGON_NEG_SCHANNEL, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ChangeLogFlags(struct ndr_push *ndr, int ndr_flags, uint16_t r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ChangeLogFlags(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ChangeLogFlags(struct ndr_print *ndr, const char *name, uint16_t r) +{ + ndr_print_uint16(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED", NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_CHANGED_PASSWORD", NETR_CHANGELOG_CHANGED_PASSWORD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_SID_INCLUDED", NETR_CHANGELOG_SID_INCLUDED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_NAME_INCLUDED", NETR_CHANGELOG_NAME_INCLUDED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_FIRST_PROMOTION_OBJ", NETR_CHANGELOG_FIRST_PROMOTION_OBJ, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ChangeLogObject(struct ndr_push *ndr, int ndr_flags, const union netr_ChangeLogObject *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NETR_CHANGELOG_SID_INCLUDED: { + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->object_sid)); + break; } + + case NETR_CHANGELOG_NAME_INCLUDED: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->object_name)); + ndr->flags = _flags_save_string; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case NETR_CHANGELOG_SID_INCLUDED: + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_BUFFERS, &r->object_sid)); + break; + + case NETR_CHANGELOG_NAME_INCLUDED: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ChangeLogObject(struct ndr_pull *ndr, int ndr_flags, union netr_ChangeLogObject *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case NETR_CHANGELOG_SID_INCLUDED: { + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->object_sid)); + break; } + + case NETR_CHANGELOG_NAME_INCLUDED: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->object_name)); + ndr->flags = _flags_save_string; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case NETR_CHANGELOG_SID_INCLUDED: + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_BUFFERS, &r->object_sid)); + break; + + case NETR_CHANGELOG_NAME_INCLUDED: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ChangeLogObject(struct ndr_print *ndr, const char *name, const union netr_ChangeLogObject *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_ChangeLogObject"); + switch (level) { + case NETR_CHANGELOG_SID_INCLUDED: + ndr_print_dom_sid(ndr, "object_sid", &r->object_sid); + break; + + case NETR_CHANGELOG_NAME_INCLUDED: + ndr_print_string(ndr, "object_name", r->object_name); + break; + + default: + break; + + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_ChangeLogEntry(struct ndr_push *ndr, int ndr_flags, const struct netr_ChangeLogEntry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_rid)); + NDR_CHECK(ndr_push_netr_ChangeLogFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_netr_SamDatabaseID8Bit(ndr, NDR_SCALARS, r->db_index)); + NDR_CHECK(ndr_push_netr_DeltaEnum8Bit(ndr, NDR_SCALARS, r->delta_type)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED))); + NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr, NDR_SCALARS, &r->object)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr, NDR_BUFFERS, &r->object)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_ChangeLogEntry(struct ndr_pull *ndr, int ndr_flags, struct netr_ChangeLogEntry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_rid)); + NDR_CHECK(ndr_pull_netr_ChangeLogFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_netr_SamDatabaseID8Bit(ndr, NDR_SCALARS, &r->db_index)); + NDR_CHECK(ndr_pull_netr_DeltaEnum8Bit(ndr, NDR_SCALARS, &r->delta_type)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED))); + NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr, NDR_SCALARS, &r->object)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr, NDR_BUFFERS, &r->object)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ChangeLogEntry(struct ndr_print *ndr, const char *name, const struct netr_ChangeLogEntry *r) +{ + ndr_print_struct(ndr, name, "netr_ChangeLogEntry"); + ndr->depth++; + ndr_print_uint32(ndr, "serial_number1", r->serial_number1); + ndr_print_uint32(ndr, "serial_number2", r->serial_number2); + ndr_print_uint32(ndr, "object_rid", r->object_rid); + ndr_print_netr_ChangeLogFlags(ndr, "flags", r->flags); + ndr_print_netr_SamDatabaseID8Bit(ndr, "db_index", r->db_index); + ndr_print_netr_DeltaEnum8Bit(ndr, "delta_type", r->delta_type); + ndr_print_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED)); + ndr_print_netr_ChangeLogObject(ndr, "object", &r->object); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_netr_ChangeLogEntry(const struct netr_ChangeLogEntry *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_netr_ChangeLogEntry); +} + +static enum ndr_err_code ndr_push_netr_Blob(struct ndr_push *ndr, int ndr_flags, const struct netr_Blob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_Blob(struct ndr_pull *ndr, int ndr_flags, struct netr_Blob *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r) +{ + ndr_print_struct(ndr, name, "netr_Blob"); + ndr->depth++; + ndr_print_uint32(ndr, "length", r->length); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRGetDCName_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRGetDCName_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRGetDCName_flags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_FORCE_REDISCOVERY", DS_FORCE_REDISCOVERY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_REQUIRED", DS_DIRECTORY_SERVICE_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_PREFERRED", DS_DIRECTORY_SERVICE_PREFERRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GC_SERVER_REQUIRED", DS_GC_SERVER_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_PDC_REQUIRED", DS_PDC_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_BACKGROUND_ONLY", DS_BACKGROUND_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IP_REQUIRED", DS_IP_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_KDC_REQUIRED", DS_KDC_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TIMESERV_REQUIRED", DS_TIMESERV_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_WRITABLE_REQUIRED", DS_WRITABLE_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GOOD_TIMESERV_PREFERRED", DS_GOOD_TIMESERV_PREFERRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_AVOID_SELF", DS_AVOID_SELF, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ONLY_LDAP_NEEDED", DS_ONLY_LDAP_NEEDED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_FLAT_NAME", DS_IS_FLAT_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_DNS_NAME", DS_IS_DNS_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TRY_NEXTCLOSEST_SITE", DS_TRY_NEXTCLOSEST_SITE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_6_REQUIRED", DS_DIRECTORY_SERVICE_6_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_DNS_NAME", DS_RETURN_DNS_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_FLAT_NAME", DS_RETURN_FLAT_NAME, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo_AddressType(struct ndr_push *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo_AddressType(struct ndr_pull *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print *ndr, const char *name, enum netr_DsRGetDCNameInfo_AddressType r) +{ + const char *val = NULL; + + switch (r) { + case DS_ADDRESS_TYPE_INET: val = "DS_ADDRESS_TYPE_INET"; break; + case DS_ADDRESS_TYPE_NETBIOS: val = "DS_ADDRESS_TYPE_NETBIOS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_netr_DsR_DcFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsR_DcFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_PDC", DS_SERVER_PDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GC", DS_SERVER_GC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_LDAP", DS_SERVER_LDAP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_DS", DS_SERVER_DS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_KDC", DS_SERVER_KDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_TIMESERV", DS_SERVER_TIMESERV, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_CLOSEST", DS_SERVER_CLOSEST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_WRITABLE", DS_SERVER_WRITABLE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GOOD_TIMESERV", DS_SERVER_GOOD_TIMESERV, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_NDNC", DS_SERVER_NDNC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_SELECT_SECRET_DOMAIN_6", DS_SERVER_SELECT_SECRET_DOMAIN_6, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_FULL_SECRET_DOMAIN_6", DS_SERVER_FULL_SECRET_DOMAIN_6, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_CONTROLLER", DS_DNS_CONTROLLER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_DOMAIN", DS_DNS_DOMAIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_FOREST", DS_DNS_FOREST, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_unc)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_address)); + NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, r->dc_address_type)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest_name)); + NDR_CHECK(ndr_push_netr_DsR_DcFlags(ndr, NDR_SCALARS, r->dc_flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_site_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_site_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dc_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_unc, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_unc, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_unc, ndr_charset_length(r->dc_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->dc_address) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_address, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_address, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_address, ndr_charset_length(r->dc_address, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->forest_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->forest_name, ndr_charset_length(r->forest_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->dc_site_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_site_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_site_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_site_name, ndr_charset_length(r->dc_site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->client_site_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_site_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_site_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_site_name, ndr_charset_length(r->client_site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r) +{ + uint32_t _ptr_dc_unc; + TALLOC_CTX *_mem_save_dc_unc_0; + uint32_t _ptr_dc_address; + TALLOC_CTX *_mem_save_dc_address_0; + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_domain_name_0; + uint32_t _ptr_forest_name; + TALLOC_CTX *_mem_save_forest_name_0; + uint32_t _ptr_dc_site_name; + TALLOC_CTX *_mem_save_dc_site_name_0; + uint32_t _ptr_client_site_name; + TALLOC_CTX *_mem_save_client_site_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_unc)); + if (_ptr_dc_unc) { + NDR_PULL_ALLOC(ndr, r->dc_unc); + } else { + r->dc_unc = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_address)); + if (_ptr_dc_address) { + NDR_PULL_ALLOC(ndr, r->dc_address); + } else { + r->dc_address = NULL; + } + NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, &r->dc_address_type)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->domain_name); + } else { + r->domain_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_name)); + if (_ptr_forest_name) { + NDR_PULL_ALLOC(ndr, r->forest_name); + } else { + r->forest_name = NULL; + } + NDR_CHECK(ndr_pull_netr_DsR_DcFlags(ndr, NDR_SCALARS, &r->dc_flags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_site_name)); + if (_ptr_dc_site_name) { + NDR_PULL_ALLOC(ndr, r->dc_site_name); + } else { + r->dc_site_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_site_name)); + if (_ptr_client_site_name) { + NDR_PULL_ALLOC(ndr, r->client_site_name); + } else { + r->client_site_name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->dc_unc) { + _mem_save_dc_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dc_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_unc)); + if (ndr_get_array_length(ndr, &r->dc_unc) > ndr_get_array_size(ndr, &r->dc_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dc_unc), ndr_get_array_length(ndr, &r->dc_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dc_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_unc, ndr_get_array_length(ndr, &r->dc_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_unc_0, 0); + } + if (r->dc_address) { + _mem_save_dc_address_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dc_address, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_address)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_address)); + if (ndr_get_array_length(ndr, &r->dc_address) > ndr_get_array_size(ndr, &r->dc_address)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dc_address), ndr_get_array_length(ndr, &r->dc_address)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dc_address), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_address, ndr_get_array_length(ndr, &r->dc_address), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_address_0, 0); + } + if (r->domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); + if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + if (r->forest_name) { + _mem_save_forest_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->forest_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->forest_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->forest_name)); + if (ndr_get_array_length(ndr, &r->forest_name) > ndr_get_array_size(ndr, &r->forest_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->forest_name), ndr_get_array_length(ndr, &r->forest_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->forest_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->forest_name, ndr_get_array_length(ndr, &r->forest_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_name_0, 0); + } + if (r->dc_site_name) { + _mem_save_dc_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dc_site_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_site_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_site_name)); + if (ndr_get_array_length(ndr, &r->dc_site_name) > ndr_get_array_size(ndr, &r->dc_site_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dc_site_name), ndr_get_array_length(ndr, &r->dc_site_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dc_site_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_site_name, ndr_get_array_length(ndr, &r->dc_site_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_site_name_0, 0); + } + if (r->client_site_name) { + _mem_save_client_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->client_site_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->client_site_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->client_site_name)); + if (ndr_get_array_length(ndr, &r->client_site_name) > ndr_get_array_size(ndr, &r->client_site_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_site_name), ndr_get_array_length(ndr, &r->client_site_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_site_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_site_name, ndr_get_array_length(ndr, &r->client_site_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_site_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r) +{ + ndr_print_struct(ndr, name, "netr_DsRGetDCNameInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "dc_unc", r->dc_unc); + ndr->depth++; + if (r->dc_unc) { + ndr_print_string(ndr, "dc_unc", r->dc_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "dc_address", r->dc_address); + ndr->depth++; + if (r->dc_address) { + ndr_print_string(ndr, "dc_address", r->dc_address); + } + ndr->depth--; + ndr_print_netr_DsRGetDCNameInfo_AddressType(ndr, "dc_address_type", r->dc_address_type); + ndr_print_GUID(ndr, "domain_guid", &r->domain_guid); + ndr_print_ptr(ndr, "domain_name", r->domain_name); + ndr->depth++; + if (r->domain_name) { + ndr_print_string(ndr, "domain_name", r->domain_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "forest_name", r->forest_name); + ndr->depth++; + if (r->forest_name) { + ndr_print_string(ndr, "forest_name", r->forest_name); + } + ndr->depth--; + ndr_print_netr_DsR_DcFlags(ndr, "dc_flags", r->dc_flags); + ndr_print_ptr(ndr, "dc_site_name", r->dc_site_name); + ndr->depth++; + if (r->dc_site_name) { + ndr_print_string(ndr, "dc_site_name", r->dc_site_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "client_site_name", r->client_site_name); + ndr->depth++; + if (r->client_site_name) { + ndr_print_string(ndr, "client_site_name", r->client_site_name); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_TrustFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_TrustFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_MIT_KRB5", NETR_TRUST_FLAG_MIT_KRB5, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_AES", NETR_TRUST_FLAG_AES, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct netr_BinaryString *r) +{ + uint32_t cntr_data_1; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length / 2)); + for (cntr_data_1 = 0; cntr_data_1 < r->length / 2; cntr_data_1++) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data[cntr_data_1])); + } + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct netr_BinaryString *r) +{ + uint32_t _ptr_data; + uint32_t cntr_data_1; + TALLOC_CTX *_mem_save_data_0; + TALLOC_CTX *_mem_save_data_1; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->data)); + if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data)); + } + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + for (cntr_data_1 = 0; cntr_data_1 < r->length / 2; cntr_data_1++) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data[cntr_data_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size / 2)); + } + if (r->data) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length / 2)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r) +{ + uint32_t cntr_data_1; + ndr_print_struct(ndr, name, "netr_BinaryString"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr_print_uint16(ndr, "size", r->size); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr->print(ndr, "%s: ARRAY(%d)", "data", (int)r->length / 2); + ndr->depth++; + for (cntr_data_1=0;cntr_data_1length / 2;cntr_data_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_data_1) != -1) { + ndr_print_uint16(ndr, "data", r->data[cntr_data_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_netr_DomainQuery1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainQuery1 *r) +{ + uint32_t cntr_unknown7_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_SCALARS, &r->blob)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->workstation_domain)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->workstation_site)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown1)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown2)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown3)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown4)); + NDR_CHECK(ndr_push_netr_BinaryString(ndr, NDR_SCALARS, &r->blob2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->product)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown6)); + for (cntr_unknown7_0 = 0; cntr_unknown7_0 < 4; cntr_unknown7_0++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7[cntr_unknown7_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_BUFFERS, &r->blob)); + if (r->workstation_domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->workstation_domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->workstation_domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->workstation_domain, ndr_charset_length(r->workstation_domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->workstation_site) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->workstation_site, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->workstation_site, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->workstation_site, ndr_charset_length(r->workstation_site, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->unknown1) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown1, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown1, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown1, ndr_charset_length(r->unknown1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->unknown2) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown2, ndr_charset_length(r->unknown2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->unknown3) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown3, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown3, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown3, ndr_charset_length(r->unknown3, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->unknown4) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown4, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown4, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown4, ndr_charset_length(r->unknown4, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_netr_BinaryString(ndr, NDR_BUFFERS, &r->blob2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->product)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown5)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown6)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DomainQuery1(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainQuery1 *r) +{ + uint32_t _ptr_workstation_domain; + TALLOC_CTX *_mem_save_workstation_domain_0; + uint32_t _ptr_workstation_site; + TALLOC_CTX *_mem_save_workstation_site_0; + uint32_t _ptr_unknown1; + TALLOC_CTX *_mem_save_unknown1_0; + uint32_t _ptr_unknown2; + TALLOC_CTX *_mem_save_unknown2_0; + uint32_t _ptr_unknown3; + TALLOC_CTX *_mem_save_unknown3_0; + uint32_t _ptr_unknown4; + TALLOC_CTX *_mem_save_unknown4_0; + uint32_t cntr_unknown7_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_SCALARS, &r->blob)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_workstation_domain)); + if (_ptr_workstation_domain) { + NDR_PULL_ALLOC(ndr, r->workstation_domain); + } else { + r->workstation_domain = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_workstation_site)); + if (_ptr_workstation_site) { + NDR_PULL_ALLOC(ndr, r->workstation_site); + } else { + r->workstation_site = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown1)); + if (_ptr_unknown1) { + NDR_PULL_ALLOC(ndr, r->unknown1); + } else { + r->unknown1 = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); + if (_ptr_unknown2) { + NDR_PULL_ALLOC(ndr, r->unknown2); + } else { + r->unknown2 = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown3)); + if (_ptr_unknown3) { + NDR_PULL_ALLOC(ndr, r->unknown3); + } else { + r->unknown3 = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown4)); + if (_ptr_unknown4) { + NDR_PULL_ALLOC(ndr, r->unknown4); + } else { + r->unknown4 = NULL; + } + NDR_CHECK(ndr_pull_netr_BinaryString(ndr, NDR_SCALARS, &r->blob2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->product)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown6)); + for (cntr_unknown7_0 = 0; cntr_unknown7_0 < 4; cntr_unknown7_0++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7[cntr_unknown7_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_BUFFERS, &r->blob)); + if (r->workstation_domain) { + _mem_save_workstation_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->workstation_domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->workstation_domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->workstation_domain)); + if (ndr_get_array_length(ndr, &r->workstation_domain) > ndr_get_array_size(ndr, &r->workstation_domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->workstation_domain), ndr_get_array_length(ndr, &r->workstation_domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->workstation_domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->workstation_domain, ndr_get_array_length(ndr, &r->workstation_domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_workstation_domain_0, 0); + } + if (r->workstation_site) { + _mem_save_workstation_site_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->workstation_site, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->workstation_site)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->workstation_site)); + if (ndr_get_array_length(ndr, &r->workstation_site) > ndr_get_array_size(ndr, &r->workstation_site)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->workstation_site), ndr_get_array_length(ndr, &r->workstation_site)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->workstation_site), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->workstation_site, ndr_get_array_length(ndr, &r->workstation_site), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_workstation_site_0, 0); + } + if (r->unknown1) { + _mem_save_unknown1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->unknown1, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown1)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown1)); + if (ndr_get_array_length(ndr, &r->unknown1) > ndr_get_array_size(ndr, &r->unknown1)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown1), ndr_get_array_length(ndr, &r->unknown1)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown1), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown1, ndr_get_array_length(ndr, &r->unknown1), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown1_0, 0); + } + if (r->unknown2) { + _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->unknown2, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown2)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown2)); + if (ndr_get_array_length(ndr, &r->unknown2) > ndr_get_array_size(ndr, &r->unknown2)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown2), ndr_get_array_length(ndr, &r->unknown2)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown2, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); + } + if (r->unknown3) { + _mem_save_unknown3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->unknown3, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown3)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown3)); + if (ndr_get_array_length(ndr, &r->unknown3) > ndr_get_array_size(ndr, &r->unknown3)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown3), ndr_get_array_length(ndr, &r->unknown3)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown3), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown3, ndr_get_array_length(ndr, &r->unknown3), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown3_0, 0); + } + if (r->unknown4) { + _mem_save_unknown4_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->unknown4, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown4)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown4)); + if (ndr_get_array_length(ndr, &r->unknown4) > ndr_get_array_size(ndr, &r->unknown4)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown4), ndr_get_array_length(ndr, &r->unknown4)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown4), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown4, ndr_get_array_length(ndr, &r->unknown4), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown4_0, 0); + } + NDR_CHECK(ndr_pull_netr_BinaryString(ndr, NDR_BUFFERS, &r->blob2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->product)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown5)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown6)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *name, const struct netr_DomainQuery1 *r) +{ + uint32_t cntr_unknown7_0; + ndr_print_struct(ndr, name, "netr_DomainQuery1"); + ndr->depth++; + ndr_print_netr_Blob(ndr, "blob", &r->blob); + ndr_print_ptr(ndr, "workstation_domain", r->workstation_domain); + ndr->depth++; + if (r->workstation_domain) { + ndr_print_string(ndr, "workstation_domain", r->workstation_domain); + } + ndr->depth--; + ndr_print_ptr(ndr, "workstation_site", r->workstation_site); + ndr->depth++; + if (r->workstation_site) { + ndr_print_string(ndr, "workstation_site", r->workstation_site); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown1", r->unknown1); + ndr->depth++; + if (r->unknown1) { + ndr_print_string(ndr, "unknown1", r->unknown1); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown2", r->unknown2); + ndr->depth++; + if (r->unknown2) { + ndr_print_string(ndr, "unknown2", r->unknown2); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown3", r->unknown3); + ndr->depth++; + if (r->unknown3) { + ndr_print_string(ndr, "unknown3", r->unknown3); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown4", r->unknown4); + ndr->depth++; + if (r->unknown4) { + ndr_print_string(ndr, "unknown4", r->unknown4); + } + ndr->depth--; + ndr_print_netr_BinaryString(ndr, "blob2", &r->blob2); + ndr_print_lsa_String(ndr, "product", &r->product); + ndr_print_lsa_String(ndr, "unknown5", &r->unknown5); + ndr_print_lsa_String(ndr, "unknown6", &r->unknown6); + ndr->print(ndr, "%s: ARRAY(%d)", "unknown7", (int)4); + ndr->depth++; + for (cntr_unknown7_0=0;cntr_unknown7_0<4;cntr_unknown7_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_unknown7_0) != -1) { + ndr_print_uint32(ndr, "unknown7", r->unknown7[cntr_unknown7_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DomainQuery(struct ndr_push *ndr, int ndr_flags, const union netr_DomainQuery *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->query1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->query1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + if (r->query1) { + NDR_CHECK(ndr_push_netr_DomainQuery1(ndr, NDR_SCALARS|NDR_BUFFERS, r->query1)); + } + break; + + case 2: + if (r->query1) { + NDR_CHECK(ndr_push_netr_DomainQuery1(ndr, NDR_SCALARS|NDR_BUFFERS, r->query1)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DomainQuery(struct ndr_pull *ndr, int ndr_flags, union netr_DomainQuery *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_query1_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + uint32_t _ptr_query1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_query1)); + if (_ptr_query1) { + NDR_PULL_ALLOC(ndr, r->query1); + } else { + r->query1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_query1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_query1)); + if (_ptr_query1) { + NDR_PULL_ALLOC(ndr, r->query1); + } else { + r->query1 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + if (r->query1) { + _mem_save_query1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->query1, 0); + NDR_CHECK(ndr_pull_netr_DomainQuery1(ndr, NDR_SCALARS|NDR_BUFFERS, r->query1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query1_0, 0); + } + break; + + case 2: + if (r->query1) { + _mem_save_query1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->query1, 0); + NDR_CHECK(ndr_pull_netr_DomainQuery1(ndr, NDR_SCALARS|NDR_BUFFERS, r->query1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query1_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name, const union netr_DomainQuery *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_DomainQuery"); + switch (level) { + case 1: + ndr_print_ptr(ndr, "query1", r->query1); + ndr->depth++; + if (r->query1) { + ndr_print_netr_DomainQuery1(ndr, "query1", r->query1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "query1", r->query1); + ndr->depth++; + if (r->query1) { + ndr_print_netr_DomainQuery1(ndr, "query1", r->query1); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_netr_trust_extension(struct ndr_push *ndr, int ndr_flags, const struct netr_trust_extension *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8)); + NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parent_index)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_trust_extension(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parent_index)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r) +{ + ndr_print_struct(ndr, name, "netr_trust_extension"); + ndr->depth++; + ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->length); + ndr_print_uint32(ndr, "dummy", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->dummy); + ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->size); + ndr_print_netr_TrustFlags(ndr, "flags", r->flags); + ndr_print_uint32(ndr, "parent_index", r->parent_index); + ndr_print_uint32(ndr, "trust_type", r->trust_type); + ndr_print_uint32(ndr, "trust_attributes", r->trust_attributes); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_trust_extension_container(struct ndr_push *ndr, int ndr_flags, const struct netr_trust_extension_container *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + NDR_CHECK(ndr_push_netr_trust_extension(ndr, NDR_SCALARS, r->info)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_trust_extension_container(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension_container *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->info); + } else { + r->info = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + NDR_CHECK(ndr_pull_netr_trust_extension(ndr, NDR_SCALARS, r->info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_trust_extension_container(struct ndr_print *ndr, const char *name, const struct netr_trust_extension_container *r) +{ + ndr_print_struct(ndr, name, "netr_trust_extension_container"); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size); + ndr_print_ptr(ndr, "info", r->info); + ndr->depth++; + if (r->info) { + ndr_print_netr_trust_extension(ndr, "info", r->info); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DomainTrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustInfo *r) +{ + uint32_t cntr_dummystring_0; + uint32_t cntr_dummy_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domainname)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->fulldomainname)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension)); + for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0])); + } + for (cntr_dummy_0 = 0; cntr_dummy_0 < 4; cntr_dummy_0++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy[cntr_dummy_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domainname)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->fulldomainname)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest)); + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension)); + for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DomainTrustInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustInfo *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + uint32_t cntr_dummystring_0; + uint32_t cntr_dummy_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domainname)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->fulldomainname)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->forest)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension)); + for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0])); + } + for (cntr_dummy_0 = 0; cntr_dummy_0 < 4; cntr_dummy_0++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy[cntr_dummy_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domainname)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->fulldomainname)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->forest)); + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension)); + for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustInfo *r) +{ + uint32_t cntr_dummystring_0; + uint32_t cntr_dummy_0; + ndr_print_struct(ndr, name, "netr_DomainTrustInfo"); + ndr->depth++; + ndr_print_lsa_String(ndr, "domainname", &r->domainname); + ndr_print_lsa_String(ndr, "fulldomainname", &r->fulldomainname); + ndr_print_lsa_String(ndr, "forest", &r->forest); + ndr_print_GUID(ndr, "guid", &r->guid); + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr_print_netr_trust_extension_container(ndr, "trust_extension", &r->trust_extension); + ndr->print(ndr, "%s: ARRAY(%d)", "dummystring", (int)3); + ndr->depth++; + for (cntr_dummystring_0=0;cntr_dummystring_0<3;cntr_dummystring_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_dummystring_0) != -1) { + ndr_print_lsa_String(ndr, "dummystring", &r->dummystring[cntr_dummystring_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "dummy", (int)4); + ndr->depth++; + for (cntr_dummy_0=0;cntr_dummy_0<4;cntr_dummy_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_dummy_0) != -1) { + ndr_print_uint32(ndr, "dummy", r->dummy[cntr_dummy_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LsaPolicyInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_LsaPolicyInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->policy_size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->policy) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->policy_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->policy, r->policy_size)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LsaPolicyInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_LsaPolicyInfo *r) +{ + uint32_t _ptr_policy; + TALLOC_CTX *_mem_save_policy_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->policy_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_policy)); + if (_ptr_policy) { + NDR_PULL_ALLOC(ndr, r->policy); + } else { + r->policy = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->policy) { + _mem_save_policy_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->policy, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->policy)); + NDR_PULL_ALLOC_N(ndr, r->policy, ndr_get_array_size(ndr, &r->policy)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->policy, ndr_get_array_size(ndr, &r->policy))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_0, 0); + } + if (r->policy) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->policy, r->policy_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LsaPolicyInfo(struct ndr_print *ndr, const char *name, const struct netr_LsaPolicyInfo *r) +{ + ndr_print_struct(ndr, name, "netr_LsaPolicyInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "policy_size", r->policy_size); + ndr_print_ptr(ndr, "policy", r->policy); + ndr->depth++; + if (r->policy) { + ndr_print_array_uint8(ndr, "policy", r->policy, r->policy_size); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_WorkstationFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_WorkstationFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_WorkstationFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS", NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_SPN_UPDATE", NETR_WS_FLAG_HANDLES_SPN_UPDATE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DomainInfo1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainInfo1 *r) +{ + uint32_t cntr_trusts_1; + uint32_t cntr_dummystring_0; + uint32_t cntr_dummy_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->domaininfo)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_trusts)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusts)); + NDR_CHECK(ndr_push_netr_LsaPolicyInfo(ndr, NDR_SCALARS, &r->lsa_policy)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dns_hostname)); + for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0])); + } + NDR_CHECK(ndr_push_netr_WorkstationFlags(ndr, NDR_SCALARS, r->workstation_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->supported_enc_types)); + for (cntr_dummy_0 = 0; cntr_dummy_0 < 2; cntr_dummy_0++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy[cntr_dummy_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_BUFFERS, &r->domaininfo)); + if (r->trusts) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_trusts)); + for (cntr_trusts_1 = 0; cntr_trusts_1 < r->num_trusts; cntr_trusts_1++) { + NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->trusts[cntr_trusts_1])); + } + for (cntr_trusts_1 = 0; cntr_trusts_1 < r->num_trusts; cntr_trusts_1++) { + NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_BUFFERS, &r->trusts[cntr_trusts_1])); + } + } + NDR_CHECK(ndr_push_netr_LsaPolicyInfo(ndr, NDR_BUFFERS, &r->lsa_policy)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dns_hostname)); + for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DomainInfo1(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainInfo1 *r) +{ + uint32_t _ptr_trusts; + uint32_t cntr_trusts_1; + TALLOC_CTX *_mem_save_trusts_0; + TALLOC_CTX *_mem_save_trusts_1; + uint32_t cntr_dummystring_0; + uint32_t cntr_dummy_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->domaininfo)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_trusts)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusts)); + if (_ptr_trusts) { + NDR_PULL_ALLOC(ndr, r->trusts); + } else { + r->trusts = NULL; + } + NDR_CHECK(ndr_pull_netr_LsaPolicyInfo(ndr, NDR_SCALARS, &r->lsa_policy)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dns_hostname)); + for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0])); + } + NDR_CHECK(ndr_pull_netr_WorkstationFlags(ndr, NDR_SCALARS, &r->workstation_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->supported_enc_types)); + for (cntr_dummy_0 = 0; cntr_dummy_0 < 2; cntr_dummy_0++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy[cntr_dummy_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr, NDR_BUFFERS, &r->domaininfo)); + if (r->trusts) { + _mem_save_trusts_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->trusts, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->trusts)); + NDR_PULL_ALLOC_N(ndr, r->trusts, ndr_get_array_size(ndr, &r->trusts)); + _mem_save_trusts_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->trusts, 0); + for (cntr_trusts_1 = 0; cntr_trusts_1 < r->num_trusts; cntr_trusts_1++) { + NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->trusts[cntr_trusts_1])); + } + for (cntr_trusts_1 = 0; cntr_trusts_1 < r->num_trusts; cntr_trusts_1++) { + NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr, NDR_BUFFERS, &r->trusts[cntr_trusts_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, 0); + } + NDR_CHECK(ndr_pull_netr_LsaPolicyInfo(ndr, NDR_BUFFERS, &r->lsa_policy)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dns_hostname)); + for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0])); + } + if (r->trusts) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->trusts, r->num_trusts)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name, const struct netr_DomainInfo1 *r) +{ + uint32_t cntr_trusts_1; + uint32_t cntr_dummystring_0; + uint32_t cntr_dummy_0; + ndr_print_struct(ndr, name, "netr_DomainInfo1"); + ndr->depth++; + ndr_print_netr_DomainTrustInfo(ndr, "domaininfo", &r->domaininfo); + ndr_print_uint32(ndr, "num_trusts", r->num_trusts); + ndr_print_ptr(ndr, "trusts", r->trusts); + ndr->depth++; + if (r->trusts) { + ndr->print(ndr, "%s: ARRAY(%d)", "trusts", (int)r->num_trusts); + ndr->depth++; + for (cntr_trusts_1=0;cntr_trusts_1num_trusts;cntr_trusts_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_trusts_1) != -1) { + ndr_print_netr_DomainTrustInfo(ndr, "trusts", &r->trusts[cntr_trusts_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_netr_LsaPolicyInfo(ndr, "lsa_policy", &r->lsa_policy); + ndr_print_lsa_String(ndr, "dns_hostname", &r->dns_hostname); + ndr->print(ndr, "%s: ARRAY(%d)", "dummystring", (int)3); + ndr->depth++; + for (cntr_dummystring_0=0;cntr_dummystring_0<3;cntr_dummystring_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_dummystring_0) != -1) { + ndr_print_lsa_String(ndr, "dummystring", &r->dummystring[cntr_dummystring_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_netr_WorkstationFlags(ndr, "workstation_flags", r->workstation_flags); + ndr_print_uint32(ndr, "supported_enc_types", r->supported_enc_types); + ndr->print(ndr, "%s: ARRAY(%d)", "dummy", (int)2); + ndr->depth++; + for (cntr_dummy_0=0;cntr_dummy_0<2;cntr_dummy_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_dummy_0) != -1) { + ndr_print_uint32(ndr, "dummy", r->dummy[cntr_dummy_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union netr_DomainInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + case 2: + if (r->info2) { + NDR_CHECK(ndr_push_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union netr_DomainInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info1_0; + TALLOC_CTX *_mem_save_info2_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_info2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_PULL_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + case 2: + if (r->info2) { + _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); + NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_DomainInfo"); + switch (level) { + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_netr_DomainInfo1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_netr_DomainInfo1(ndr, "info2", r->info2); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_netr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct netr_CryptPassword *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 512)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct netr_CryptPassword *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 512)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r) +{ + ndr_print_struct(ndr, name, "netr_CryptPassword"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->data, 512); + ndr_print_uint32(ndr, "length", r->length); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesWCtr *r) +{ + uint32_t cntr_sitename_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sitename) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); + } + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesWCtr *r) +{ + uint32_t _ptr_sitename; + uint32_t cntr_sitename_1; + TALLOC_CTX *_mem_save_sitename_0; + TALLOC_CTX *_mem_save_sitename_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename)); + if (_ptr_sitename) { + NDR_PULL_ALLOC(ndr, r->sitename); + } else { + r->sitename = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sitename) { + _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename)); + NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename)); + _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); + } + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0); + } + if (r->sitename) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r) +{ + uint32_t cntr_sitename_1; + ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesWCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "sitename", r->sitename); + ndr->depth++; + if (r->sitename) { + ndr->print(ndr, "%s: ARRAY(%d)", "sitename", (int)r->count); + ndr->depth++; + for (cntr_sitename_1=0;cntr_sitename_1count;cntr_sitename_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) { + ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRAddress(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddress *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->size)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRAddress(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddress *r) +{ + uint32_t _ptr_buffer; + TALLOC_CTX *_mem_save_buffer_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); + if (_ptr_buffer) { + NDR_PULL_ALLOC(ndr, r->buffer); + } else { + r->buffer = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->buffer) { + _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer)); + NDR_PULL_ALLOC_N(ndr, r->buffer, ndr_get_array_size(ndr, &r->buffer)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, ndr_get_array_size(ndr, &r->buffer))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); + } + if (r->buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r) +{ + ndr_print_struct(ndr, name, "netr_DsRAddress"); + ndr->depth++; + ndr_print_ptr(ndr, "buffer", r->buffer); + ndr->depth++; + if (r->buffer) { + ndr_print_array_uint8(ndr, "buffer", r->buffer, r->size); + } + ndr->depth--; + ndr_print_uint32(ndr, "size", r->size); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_TrustType(struct ndr_push *ndr, int ndr_flags, enum netr_TrustType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_TrustType(struct ndr_pull *ndr, int ndr_flags, enum netr_TrustType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r) +{ + const char *val = NULL; + + switch (r) { + case NETR_TRUST_TYPE_DOWNLEVEL: val = "NETR_TRUST_TYPE_DOWNLEVEL"; break; + case NETR_TRUST_TYPE_UPLEVEL: val = "NETR_TRUST_TYPE_UPLEVEL"; break; + case NETR_TRUST_TYPE_MIT: val = "NETR_TRUST_TYPE_MIT"; break; + case NETR_TRUST_TYPE_DCE: val = "NETR_TRUST_TYPE_DCE"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_netr_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE", NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY", NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_WITHIN_FOREST", NETR_TRUST_ATTRIBUTE_WITHIN_FOREST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DomainTrust(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrust *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name)); + NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->trust_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parent_index)); + NDR_CHECK(ndr_push_netr_TrustType(ndr, NDR_SCALARS, r->trust_type)); + NDR_CHECK(ndr_push_netr_TrustAttributes(ndr, NDR_SCALARS, r->trust_attributes)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->dns_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DomainTrust(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrust *r) +{ + uint32_t _ptr_netbios_name; + TALLOC_CTX *_mem_save_netbios_name_0; + uint32_t _ptr_dns_name; + TALLOC_CTX *_mem_save_dns_name_0; + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name)); + if (_ptr_netbios_name) { + NDR_PULL_ALLOC(ndr, r->netbios_name); + } else { + r->netbios_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name)); + if (_ptr_dns_name) { + NDR_PULL_ALLOC(ndr, r->dns_name); + } else { + r->dns_name = NULL; + } + NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->trust_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parent_index)); + NDR_CHECK(ndr_pull_netr_TrustType(ndr, NDR_SCALARS, &r->trust_type)); + NDR_CHECK(ndr_pull_netr_TrustAttributes(ndr, NDR_SCALARS, &r->trust_attributes)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, r->sid); + } else { + r->sid = NULL; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->netbios_name) { + _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name)); + if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0); + } + if (r->dns_name) { + _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name)); + if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0); + } + if (r->sid) { + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r) +{ + ndr_print_struct(ndr, name, "netr_DomainTrust"); + ndr->depth++; + ndr_print_ptr(ndr, "netbios_name", r->netbios_name); + ndr->depth++; + if (r->netbios_name) { + ndr_print_string(ndr, "netbios_name", r->netbios_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "dns_name", r->dns_name); + ndr->depth++; + if (r->dns_name) { + ndr_print_string(ndr, "dns_name", r->dns_name); + } + ndr->depth--; + ndr_print_netr_TrustFlags(ndr, "trust_flags", r->trust_flags); + ndr_print_uint32(ndr, "parent_index", r->parent_index); + ndr_print_netr_TrustType(ndr, "trust_type", r->trust_type); + ndr_print_netr_TrustAttributes(ndr, "trust_attributes", r->trust_attributes); + ndr_print_ptr(ndr, "sid", r->sid); + ndr->depth++; + if (r->sid) { + ndr_print_dom_sid2(ndr, "sid", r->sid); + } + ndr->depth--; + ndr_print_GUID(ndr, "guid", &r->guid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DomainTrustList(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustList *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DomainTrustList(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustList *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "netr_DomainTrustList"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_netr_DomainTrust(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesExWCtr *r) +{ + uint32_t cntr_sitename_1; + uint32_t cntr_subnetname_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->subnetname)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sitename) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); + } + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); + } + } + if (r->subnetname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1])); + } + for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesExWCtr *r) +{ + uint32_t _ptr_sitename; + uint32_t cntr_sitename_1; + TALLOC_CTX *_mem_save_sitename_0; + TALLOC_CTX *_mem_save_sitename_1; + uint32_t _ptr_subnetname; + uint32_t cntr_subnetname_1; + TALLOC_CTX *_mem_save_subnetname_0; + TALLOC_CTX *_mem_save_subnetname_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename)); + if (_ptr_sitename) { + NDR_PULL_ALLOC(ndr, r->sitename); + } else { + r->sitename = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_subnetname)); + if (_ptr_subnetname) { + NDR_PULL_ALLOC(ndr, r->subnetname); + } else { + r->subnetname = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sitename) { + _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename)); + NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename)); + _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); + } + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0); + } + if (r->subnetname) { + _mem_save_subnetname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->subnetname)); + NDR_PULL_ALLOC_N(ndr, r->subnetname, ndr_get_array_size(ndr, &r->subnetname)); + _mem_save_subnetname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0); + for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1])); + } + for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_0, 0); + } + if (r->sitename) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count)); + } + if (r->subnetname) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->subnetname, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r) +{ + uint32_t cntr_sitename_1; + uint32_t cntr_subnetname_1; + ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExWCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "sitename", r->sitename); + ndr->depth++; + if (r->sitename) { + ndr->print(ndr, "%s: ARRAY(%d)", "sitename", (int)r->count); + ndr->depth++; + for (cntr_sitename_1=0;cntr_sitename_1count;cntr_sitename_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) { + ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_ptr(ndr, "subnetname", r->subnetname); + ndr->depth++; + if (r->subnetname) { + ndr->print(ndr, "%s: ARRAY(%d)", "subnetname", (int)r->count); + ndr->depth++; + for (cntr_subnetname_1=0;cntr_subnetname_1count;cntr_subnetname_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_subnetname_1) != -1) { + ndr_print_lsa_String(ndr, "subnetname", &r->subnetname[cntr_subnetname_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DcSitesCtr(struct ndr_push *ndr, int ndr_flags, const struct DcSitesCtr *r) +{ + uint32_t cntr_sites_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sites)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sites) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites)); + for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1])); + } + for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DcSitesCtr(struct ndr_pull *ndr, int ndr_flags, struct DcSitesCtr *r) +{ + uint32_t _ptr_sites; + uint32_t cntr_sites_1; + TALLOC_CTX *_mem_save_sites_0; + TALLOC_CTX *_mem_save_sites_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sites)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sites)); + if (_ptr_sites) { + NDR_PULL_ALLOC(ndr, r->sites); + } else { + r->sites = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sites) { + _mem_save_sites_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sites)); + NDR_PULL_ALLOC_N(ndr, r->sites, ndr_get_array_size(ndr, &r->sites)); + _mem_save_sites_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0); + for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1])); + } + for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_0, 0); + } + if (r->sites) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sites, r->num_sites)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r) +{ + uint32_t cntr_sites_1; + ndr_print_struct(ndr, name, "DcSitesCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "num_sites", r->num_sites); + ndr_print_ptr(ndr, "sites", r->sites); + ndr->depth++; + if (r->sites) { + ndr->print(ndr, "%s: ARRAY(%d)", "sites", (int)r->num_sites); + ndr->depth++; + for (cntr_sites_1=0;cntr_sites_1num_sites;cntr_sites_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sites_1) != -1) { + ndr_print_lsa_String(ndr, "sites", &r->sites[cntr_sites_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_TrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_TrustInfo *r) +{ + uint32_t cntr_data_1; + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entry_count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_data_1 = 0; cntr_data_1 < r->count; cntr_data_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data[cntr_data_1])); + } + } + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_TrustInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_TrustInfo *r) +{ + uint32_t _ptr_data; + uint32_t cntr_data_1; + TALLOC_CTX *_mem_save_data_0; + TALLOC_CTX *_mem_save_data_1; + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entry_count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + for (cntr_data_1 = 0; cntr_data_1 < r->count; cntr_data_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data[cntr_data_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->count)); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_TrustInfo(struct ndr_print *ndr, const char *name, const struct netr_TrustInfo *r) +{ + uint32_t cntr_data_1; + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "netr_TrustInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr->print(ndr, "%s: ARRAY(%d)", "data", (int)r->count); + ndr->depth++; + for (cntr_data_1=0;cntr_data_1count;cntr_data_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_data_1) != -1) { + ndr_print_uint32(ndr, "data", r->data[cntr_data_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_uint32(ndr, "entry_count", r->entry_count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { + ndr_print_lsa_String(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogon *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16))); + 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonUasLogon(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogon *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.workstation)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.workstation)); + if (ndr_get_array_length(ndr, &r->in.workstation) > ndr_get_array_size(ndr, &r->in.workstation)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.workstation), ndr_get_array_length(ndr, &r->in.workstation)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogon *r) +{ + ndr_print_struct(ndr, name, "netr_LogonUasLogon"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonUasLogon"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_string(ndr, "workstation", r->in.workstation); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonUasLogon"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_netr_UasInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonUasLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogoff *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16))); + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonUasLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogoff *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.workstation)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.workstation)); + if (ndr_get_array_length(ndr, &r->in.workstation) > ndr_get_array_size(ndr, &r->in.workstation)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.workstation), ndr_get_array_length(ndr, &r->in.workstation)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_UasLogoffInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogoff *r) +{ + ndr_print_struct(ndr, name, "netr_LogonUasLogoff"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonUasLogoff"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_string(ndr, "workstation", r->in.workstation); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonUasLogoff"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_netr_UasLogoffInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogon *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); + if (r->in.computer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential)); + if (r->in.credential) { + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator)); + if (r->in.return_authenticator) { + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + } + NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level)); + if (r->in.logon == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + 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 (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator)); + if (r->out.return_authenticator) { + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + } + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogon *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_computer_name; + uint32_t _ptr_credential; + uint32_t _ptr_return_authenticator; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_computer_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_logon_0; + TALLOC_CTX *_mem_save_validation_0; + TALLOC_CTX *_mem_save_authoritative_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); + if (_ptr_computer_name) { + NDR_PULL_ALLOC(ndr, r->in.computer_name); + } else { + r->in.computer_name = NULL; + } + if (r->in.computer_name) { + _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential)); + if (_ptr_credential) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } else { + r->in.credential = NULL; + } + if (r->in.credential) { + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); + if (_ptr_return_authenticator) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } else { + r->in.return_authenticator = NULL; + } + if (r->in.return_authenticator) { + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); + } + NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.logon); + } + _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level)); + NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level)); + NDR_PULL_ALLOC(ndr, r->out.validation); + ZERO_STRUCTP(r->out.validation); + NDR_PULL_ALLOC(ndr, r->out.authoritative); + ZERO_STRUCTP(r->out.authoritative); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); + if (_ptr_return_authenticator) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } else { + r->out.return_authenticator = NULL; + } + if (r->out.return_authenticator) { + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.validation); + } + _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level)); + NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.authoritative); + } + _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogon *r) +{ + ndr_print_struct(ndr, name, "netr_LogonSamLogon"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonSamLogon"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "computer_name", r->in.computer_name); + ndr->depth++; + if (r->in.computer_name) { + ndr_print_string(ndr, "computer_name", r->in.computer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + if (r->in.credential) { + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + } + ndr->depth--; + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + if (r->in.return_authenticator) { + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + } + ndr->depth--; + ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level); + ndr_print_ptr(ndr, "logon", r->in.logon); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level); + ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon); + ndr->depth--; + ndr_print_uint16(ndr, "validation_level", r->in.validation_level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonSamLogon"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + if (r->out.return_authenticator) { + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + } + ndr->depth--; + ndr_print_ptr(ndr, "validation", r->out.validation); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level); + ndr_print_netr_Validation(ndr, "validation", r->out.validation); + ndr->depth--; + ndr_print_ptr(ndr, "authoritative", r->out.authoritative); + ndr->depth++; + ndr_print_uint8(ndr, "authoritative", *r->out.authoritative); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonSamLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogoff *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); + if (r->in.computer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential)); + if (r->in.credential) { + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator)); + if (r->in.return_authenticator) { + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + } + NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level)); + 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)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator)); + if (r->out.return_authenticator) { + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonSamLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogoff *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_computer_name; + uint32_t _ptr_credential; + uint32_t _ptr_return_authenticator; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_computer_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); + if (_ptr_computer_name) { + NDR_PULL_ALLOC(ndr, r->in.computer_name); + } else { + r->in.computer_name = NULL; + } + if (r->in.computer_name) { + _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential)); + if (_ptr_credential) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } else { + r->in.credential = NULL; + } + if (r->in.credential) { + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); + if (_ptr_return_authenticator) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } else { + r->in.return_authenticator = NULL; + } + if (r->in.return_authenticator) { + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); + } + NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level)); + NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); + if (_ptr_return_authenticator) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } else { + r->out.return_authenticator = NULL; + } + if (r->out.return_authenticator) { + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); + } + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonSamLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogoff *r) +{ + ndr_print_struct(ndr, name, "netr_LogonSamLogoff"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonSamLogoff"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "computer_name", r->in.computer_name); + ndr->depth++; + if (r->in.computer_name) { + ndr_print_string(ndr, "computer_name", r->in.computer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + if (r->in.credential) { + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + } + ndr->depth--; + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + if (r->in.return_authenticator) { + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + } + ndr->depth--; + ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level); + ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level); + ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonSamLogoff"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + if (r->out.return_authenticator) { + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + } + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags, const struct netr_ServerReqChallenge *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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.return_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.return_credentials)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, int flags, struct netr_ServerReqChallenge *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credentials_0; + TALLOC_CTX *_mem_save_return_credentials_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credentials); + } + _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + ZERO_STRUCTP(r->out.return_credentials); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + } + _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerReqChallenge *r) +{ + ndr_print_struct(ndr, name, "netr_ServerReqChallenge"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_ServerReqChallenge"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credentials", r->in.credentials); + ndr->depth++; + ndr_print_netr_Credential(ndr, "credentials", r->in.credentials); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_ServerReqChallenge"); + ndr->depth++; + ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); + ndr->depth++; + ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ServerAuthenticate(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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.return_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.return_credentials)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ServerAuthenticate(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credentials_0; + TALLOC_CTX *_mem_save_return_credentials_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credentials); + } + _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + ZERO_STRUCTP(r->out.return_credentials); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + } + _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate *r) +{ + ndr_print_struct(ndr, name, "netr_ServerAuthenticate"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_ServerAuthenticate"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credentials", r->in.credentials); + ndr->depth++; + ndr_print_netr_Credential(ndr, "credentials", r->in.credentials); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_ServerAuthenticate"); + ndr->depth++; + ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); + ndr->depth++; + ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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.new_password == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_password)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_new_password_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.new_password); + } + _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + ZERO_STRUCTP(r->out.return_authenticator); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet *r) +{ + ndr_print_struct(ndr, name, "netr_ServerPasswordSet"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_ServerPasswordSet"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_ptr(ndr, "new_password", r->in.new_password); + ndr->depth++; + ndr_print_samr_Password(ndr, "new_password", r->in.new_password); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_ServerPasswordSet"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int flags, const struct netr_DatabaseDeltas *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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)); + 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 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 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->out.sequence_num)); + if (r->out.delta_enum_array == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); + if (*r->out.delta_enum_array) { + NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, struct netr_DatabaseDeltas *r) +{ + uint32_t _ptr_delta_enum_array; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_sequence_num_0; + TALLOC_CTX *_mem_save_delta_enum_array_0; + TALLOC_CTX *_mem_save_delta_enum_array_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); + if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sequence_num); + } + _mem_save_sequence_num_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sequence_num, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->in.sequence_num)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength)); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + *r->out.return_authenticator = *r->in.return_authenticator; + NDR_PULL_ALLOC(ndr, r->out.sequence_num); + *r->out.sequence_num = *r->in.sequence_num; + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + ZERO_STRUCTP(r->out.delta_enum_array); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sequence_num); + } + _mem_save_sequence_num_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence_num, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->out.sequence_num)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + } + _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); + if (_ptr_delta_enum_array) { + NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); + } else { + *r->out.delta_enum_array = NULL; + } + if (*r->out.delta_enum_array) { + _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); + NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseDeltas *r) +{ + ndr_print_struct(ndr, name, "netr_DatabaseDeltas"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DatabaseDeltas"); + ndr->depth++; + ndr_print_string(ndr, "logon_server", r->in.logon_server); + ndr_print_string(ndr, "computername", r->in.computername); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth--; + ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id); + ndr_print_ptr(ndr, "sequence_num", r->in.sequence_num); + ndr->depth++; + ndr_print_udlong(ndr, "sequence_num", *r->in.sequence_num); + ndr->depth--; + ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DatabaseDeltas"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "sequence_num", r->out.sequence_num); + ndr->depth++; + ndr_print_udlong(ndr, "sequence_num", *r->out.sequence_num); + ndr->depth--; + ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); + ndr->depth++; + ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); + ndr->depth++; + if (*r->out.delta_enum_array) { + ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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)); + 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 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 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context)); + if (r->out.delta_enum_array == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); + if (*r->out.delta_enum_array) { + NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync *r) +{ + uint32_t _ptr_delta_enum_array; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_sync_context_0; + TALLOC_CTX *_mem_save_delta_enum_array_0; + TALLOC_CTX *_mem_save_delta_enum_array_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); + if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sync_context); + } + _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sync_context, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.sync_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength)); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + *r->out.return_authenticator = *r->in.return_authenticator; + NDR_PULL_ALLOC(ndr, r->out.sync_context); + *r->out.sync_context = *r->in.sync_context; + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + ZERO_STRUCTP(r->out.delta_enum_array); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sync_context); + } + _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + } + _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); + if (_ptr_delta_enum_array) { + NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); + } else { + *r->out.delta_enum_array = NULL; + } + if (*r->out.delta_enum_array) { + _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); + NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync *r) +{ + ndr_print_struct(ndr, name, "netr_DatabaseSync"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DatabaseSync"); + ndr->depth++; + ndr_print_string(ndr, "logon_server", r->in.logon_server); + ndr_print_string(ndr, "computername", r->in.computername); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth--; + ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id); + ndr_print_ptr(ndr, "sync_context", r->in.sync_context); + ndr->depth++; + ndr_print_uint32(ndr, "sync_context", *r->in.sync_context); + ndr->depth--; + ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DatabaseSync"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "sync_context", r->out.sync_context); + ndr->depth++; + ndr_print_uint32(ndr, "sync_context", *r->out.sync_context); + ndr->depth--; + ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); + ndr->depth++; + ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); + ndr->depth++; + if (*r->out.delta_enum_array) { + ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_AccountDeltas(struct ndr_push *ndr, int flags, const struct netr_AccountDeltas *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); + if (r->in.logon_server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffersize)); + } + if (flags & NDR_OUT) { + 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 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 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_AccountDeltas(struct ndr_pull *ndr, int flags, struct netr_AccountDeltas *r) +{ + uint32_t _ptr_logon_server; + TALLOC_CTX *_mem_save_logon_server_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_buffer_0; + TALLOC_CTX *_mem_save_count_returned_0; + TALLOC_CTX *_mem_save_total_entries_0; + TALLOC_CTX *_mem_save_recordid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); + if (_ptr_logon_server) { + NDR_PULL_ALLOC(ndr, r->in.logon_server); + } else { + r->in.logon_server = NULL; + } + if (r->in.logon_server) { + _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); + if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, &r->in.uas)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffersize)); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + *r->out.return_authenticator = *r->in.return_authenticator; + NDR_PULL_ALLOC(ndr, r->out.buffer); + ZERO_STRUCTP(r->out.buffer); + NDR_PULL_ALLOC(ndr, r->out.count_returned); + ZERO_STRUCTP(r->out.count_returned); + NDR_PULL_ALLOC(ndr, r->out.total_entries); + ZERO_STRUCTP(r->out.total_entries); + NDR_PULL_ALLOC(ndr, r->out.recordid); + ZERO_STRUCTP(r->out.recordid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.buffer); + } + _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, LIBNDR_FLAG_REF_ALLOC); + { + struct ndr_pull *_ndr_buffer; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 4, -1)); + NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 4, -1)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count_returned); + } + _mem_save_count_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count_returned, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count_returned)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_returned_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.total_entries); + } + _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.recordid); + } + _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.recordid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_AccountDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountDeltas *r) +{ + ndr_print_struct(ndr, name, "netr_AccountDeltas"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_AccountDeltas"); + ndr->depth++; + ndr_print_ptr(ndr, "logon_server", r->in.logon_server); + ndr->depth++; + if (r->in.logon_server) { + ndr_print_string(ndr, "logon_server", r->in.logon_server); + } + ndr->depth--; + ndr_print_string(ndr, "computername", r->in.computername); + ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential); + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth--; + ndr_print_netr_UAS_INFO_0(ndr, "uas", &r->in.uas); + ndr_print_uint32(ndr, "count", r->in.count); + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "buffersize", r->in.buffersize); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_AccountDeltas"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr_print_netr_AccountBuffer(ndr, "buffer", r->out.buffer); + ndr->depth--; + ndr_print_ptr(ndr, "count_returned", r->out.count_returned); + ndr->depth++; + ndr_print_uint32(ndr, "count_returned", *r->out.count_returned); + ndr->depth--; + ndr_print_ptr(ndr, "total_entries", r->out.total_entries); + ndr->depth++; + ndr_print_uint32(ndr, "total_entries", *r->out.total_entries); + ndr->depth--; + ndr_print_ptr(ndr, "recordid", r->out.recordid); + ndr->depth++; + ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->out.recordid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_AccountSync(struct ndr_push *ndr, int flags, const struct netr_AccountSync *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); + if (r->in.logon_server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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 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 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 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 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 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 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_AccountSync(struct ndr_pull *ndr, int flags, struct netr_AccountSync *r) +{ + uint32_t _ptr_logon_server; + TALLOC_CTX *_mem_save_logon_server_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_buffer_0; + TALLOC_CTX *_mem_save_count_returned_0; + TALLOC_CTX *_mem_save_total_entries_0; + TALLOC_CTX *_mem_save_next_reference_0; + TALLOC_CTX *_mem_save_recordid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); + if (_ptr_logon_server) { + NDR_PULL_ALLOC(ndr, r->in.logon_server); + } else { + r->in.logon_server = NULL; + } + if (r->in.logon_server) { + _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); + if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reference)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffersize)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.recordid); + } + _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.recordid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->in.recordid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + *r->out.return_authenticator = *r->in.return_authenticator; + NDR_PULL_ALLOC(ndr, r->out.buffer); + ZERO_STRUCTP(r->out.buffer); + NDR_PULL_ALLOC(ndr, r->out.count_returned); + ZERO_STRUCTP(r->out.count_returned); + NDR_PULL_ALLOC(ndr, r->out.total_entries); + ZERO_STRUCTP(r->out.total_entries); + NDR_PULL_ALLOC(ndr, r->out.next_reference); + ZERO_STRUCTP(r->out.next_reference); + NDR_PULL_ALLOC(ndr, r->out.recordid); + *r->out.recordid = *r->in.recordid; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.buffer); + } + _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, LIBNDR_FLAG_REF_ALLOC); + { + struct ndr_pull *_ndr_buffer; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 4, -1)); + NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 4, -1)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count_returned); + } + _mem_save_count_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count_returned, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count_returned)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_returned_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.total_entries); + } + _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.next_reference); + } + _mem_save_next_reference_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.next_reference, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.next_reference)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_reference_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.recordid); + } + _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.recordid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_AccountSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountSync *r) +{ + ndr_print_struct(ndr, name, "netr_AccountSync"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_AccountSync"); + ndr->depth++; + ndr_print_ptr(ndr, "logon_server", r->in.logon_server); + ndr->depth++; + if (r->in.logon_server) { + ndr_print_string(ndr, "logon_server", r->in.logon_server); + } + ndr->depth--; + ndr_print_string(ndr, "computername", r->in.computername); + ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential); + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth--; + ndr_print_uint32(ndr, "reference", r->in.reference); + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "buffersize", r->in.buffersize); + ndr_print_ptr(ndr, "recordid", r->in.recordid); + ndr->depth++; + ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->in.recordid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_AccountSync"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr_print_netr_AccountBuffer(ndr, "buffer", r->out.buffer); + ndr->depth--; + ndr_print_ptr(ndr, "count_returned", r->out.count_returned); + ndr->depth++; + ndr_print_uint32(ndr, "count_returned", *r->out.count_returned); + ndr->depth--; + ndr_print_ptr(ndr, "total_entries", r->out.total_entries); + ndr->depth++; + ndr_print_uint32(ndr, "total_entries", *r->out.total_entries); + ndr->depth--; + ndr_print_ptr(ndr, "next_reference", r->out.next_reference); + ndr->depth++; + ndr_print_uint32(ndr, "next_reference", *r->out.next_reference); + ndr->depth--; + ndr_print_ptr(ndr, "recordid", r->out.recordid); + ndr->depth++; + ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->out.recordid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_GetDcName(struct ndr_push *ndr, int flags, const struct netr_GetDcName *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domainname)); + if (r->in.domainname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domainname, ndr_charset_length(r->in.domainname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + if (r->out.dcname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname)); + if (*r->out.dcname) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_GetDcName(struct ndr_pull *ndr, int flags, struct netr_GetDcName *r) +{ + uint32_t _ptr_domainname; + uint32_t _ptr_dcname; + TALLOC_CTX *_mem_save_domainname_0; + TALLOC_CTX *_mem_save_dcname_0; + TALLOC_CTX *_mem_save_dcname_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domainname)); + if (_ptr_domainname) { + NDR_PULL_ALLOC(ndr, r->in.domainname); + } else { + r->in.domainname = NULL; + } + if (r->in.domainname) { + _mem_save_domainname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domainname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domainname)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domainname)); + if (ndr_get_array_length(ndr, &r->in.domainname) > ndr_get_array_size(ndr, &r->in.domainname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domainname), ndr_get_array_length(ndr, &r->in.domainname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domainname, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domainname_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.dcname); + ZERO_STRUCTP(r->out.dcname); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.dcname); + } + _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname)); + if (_ptr_dcname) { + NDR_PULL_ALLOC(ndr, *r->out.dcname); + } else { + *r->out.dcname = NULL; + } + if (*r->out.dcname) { + _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname)); + if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_GetDcName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetDcName *r) +{ + ndr_print_struct(ndr, name, "netr_GetDcName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_GetDcName"); + ndr->depth++; + ndr_print_string(ndr, "logon_server", r->in.logon_server); + ndr_print_ptr(ndr, "domainname", r->in.domainname); + ndr->depth++; + if (r->in.domainname) { + ndr_print_string(ndr, "domainname", r->in.domainname); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_GetDcName"); + ndr->depth++; + ndr_print_ptr(ndr, "dcname", r->out.dcname); + ndr->depth++; + ndr_print_ptr(ndr, "dcname", *r->out.dcname); + ndr->depth++; + if (*r->out.dcname) { + ndr_print_string(ndr, "dcname", *r->out.dcname); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonControl(struct ndr_push *ndr, int flags, const struct netr_LogonControl *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); + if (r->in.logon_server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonControl(struct ndr_pull *ndr, int flags, struct netr_LogonControl *r) +{ + uint32_t _ptr_logon_server; + TALLOC_CTX *_mem_save_logon_server_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); + if (_ptr_logon_server) { + NDR_PULL_ALLOC(ndr, r->in.logon_server); + } else { + r->in.logon_server = NULL; + } + if (r->in.logon_server) { + _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); + } + NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonControl(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl *r) +{ + ndr_print_struct(ndr, name, "netr_LogonControl"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonControl"); + ndr->depth++; + ndr_print_ptr(ndr, "logon_server", r->in.logon_server); + ndr->depth++; + if (r->in.logon_server) { + ndr_print_string(ndr, "logon_server", r->in.logon_server); + } + ndr->depth--; + ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code); + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonControl"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_GetAnyDCName(struct ndr_push *ndr, int flags, const struct netr_GetAnyDCName *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); + if (r->in.logon_server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domainname)); + if (r->in.domainname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domainname, ndr_charset_length(r->in.domainname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + if (r->out.dcname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname)); + if (*r->out.dcname) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int flags, struct netr_GetAnyDCName *r) +{ + uint32_t _ptr_logon_server; + uint32_t _ptr_domainname; + uint32_t _ptr_dcname; + TALLOC_CTX *_mem_save_logon_server_0; + TALLOC_CTX *_mem_save_domainname_0; + TALLOC_CTX *_mem_save_dcname_0; + TALLOC_CTX *_mem_save_dcname_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); + if (_ptr_logon_server) { + NDR_PULL_ALLOC(ndr, r->in.logon_server); + } else { + r->in.logon_server = NULL; + } + if (r->in.logon_server) { + _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domainname)); + if (_ptr_domainname) { + NDR_PULL_ALLOC(ndr, r->in.domainname); + } else { + r->in.domainname = NULL; + } + if (r->in.domainname) { + _mem_save_domainname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domainname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domainname)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domainname)); + if (ndr_get_array_length(ndr, &r->in.domainname) > ndr_get_array_size(ndr, &r->in.domainname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domainname), ndr_get_array_length(ndr, &r->in.domainname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domainname, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domainname_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.dcname); + ZERO_STRUCTP(r->out.dcname); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.dcname); + } + _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname)); + if (_ptr_dcname) { + NDR_PULL_ALLOC(ndr, *r->out.dcname); + } else { + *r->out.dcname = NULL; + } + if (*r->out.dcname) { + _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname)); + if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetAnyDCName *r) +{ + ndr_print_struct(ndr, name, "netr_GetAnyDCName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_GetAnyDCName"); + ndr->depth++; + ndr_print_ptr(ndr, "logon_server", r->in.logon_server); + ndr->depth++; + if (r->in.logon_server) { + ndr_print_string(ndr, "logon_server", r->in.logon_server); + } + ndr->depth--; + ndr_print_ptr(ndr, "domainname", r->in.domainname); + ndr->depth++; + if (r->in.domainname) { + ndr_print_string(ndr, "domainname", r->in.domainname); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_GetAnyDCName"); + ndr->depth++; + ndr_print_ptr(ndr, "dcname", r->out.dcname); + ndr->depth++; + ndr_print_ptr(ndr, "dcname", *r->out.dcname); + ndr->depth++; + if (*r->out.dcname) { + ndr_print_string(ndr, "dcname", *r->out.dcname); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonControl2(struct ndr_push *ndr, int flags, const struct netr_LogonControl2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); + if (r->in.logon_server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.data, r->in.function_code)); + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int flags, struct netr_LogonControl2 *r) +{ + uint32_t _ptr_logon_server; + TALLOC_CTX *_mem_save_logon_server_0; + TALLOC_CTX *_mem_save_data_0; + TALLOC_CTX *_mem_save_query_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); + if (_ptr_logon_server) { + NDR_PULL_ALLOC(ndr, r->in.logon_server); + } else { + r->in.logon_server = NULL; + } + if (r->in.logon_server) { + _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); + } + NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.data); + } + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.data, r->in.function_code)); + NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.query); + ZERO_STRUCTP(r->out.query); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.query); + } + _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level)); + NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2 *r) +{ + ndr_print_struct(ndr, name, "netr_LogonControl2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonControl2"); + ndr->depth++; + ndr_print_ptr(ndr, "logon_server", r->in.logon_server); + ndr->depth++; + if (r->in.logon_server) { + ndr_print_string(ndr, "logon_server", r->in.logon_server); + } + ndr->depth--; + ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code); + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "data", r->in.data); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.data, r->in.function_code); + ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", r->in.data); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonControl2"); + ndr->depth++; + ndr_print_ptr(ndr, "query", r->out.query); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.query, r->in.level); + ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ServerAuthenticate2(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->in.negotiate_flags)); + } + if (flags & NDR_OUT) { + if (r->out.return_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.return_credentials)); + if (r->out.negotiate_flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->out.negotiate_flags)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate2 *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credentials_0; + TALLOC_CTX *_mem_save_return_credentials_0; + TALLOC_CTX *_mem_save_negotiate_flags_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credentials); + } + _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.negotiate_flags); + } + _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->in.negotiate_flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + ZERO_STRUCTP(r->out.return_credentials); + NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); + *r->out.negotiate_flags = *r->in.negotiate_flags; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + } + _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); + } + _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.negotiate_flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->out.negotiate_flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate2 *r) +{ + ndr_print_struct(ndr, name, "netr_ServerAuthenticate2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_ServerAuthenticate2"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credentials", r->in.credentials); + ndr->depth++; + ndr_print_netr_Credential(ndr, "credentials", r->in.credentials); + ndr->depth--; + ndr_print_ptr(ndr, "negotiate_flags", r->in.negotiate_flags); + ndr->depth++; + ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->in.negotiate_flags); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_ServerAuthenticate2"); + ndr->depth++; + ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); + ndr->depth++; + ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); + ndr->depth--; + ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags); + ndr->depth++; + ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->out.negotiate_flags); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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)); + 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 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 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context)); + if (r->out.delta_enum_array == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); + if (*r->out.delta_enum_array) { + NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync2 *r) +{ + uint32_t _ptr_delta_enum_array; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_sync_context_0; + TALLOC_CTX *_mem_save_delta_enum_array_0; + TALLOC_CTX *_mem_save_delta_enum_array_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); + if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.restart_state)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sync_context); + } + _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sync_context, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.sync_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength)); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + *r->out.return_authenticator = *r->in.return_authenticator; + NDR_PULL_ALLOC(ndr, r->out.sync_context); + *r->out.sync_context = *r->in.sync_context; + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + ZERO_STRUCTP(r->out.delta_enum_array); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sync_context); + } + _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + } + _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); + if (_ptr_delta_enum_array) { + NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); + } else { + *r->out.delta_enum_array = NULL; + } + if (*r->out.delta_enum_array) { + _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); + NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync2 *r) +{ + ndr_print_struct(ndr, name, "netr_DatabaseSync2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DatabaseSync2"); + ndr->depth++; + ndr_print_string(ndr, "logon_server", r->in.logon_server); + ndr_print_string(ndr, "computername", r->in.computername); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth--; + ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id); + ndr_print_uint16(ndr, "restart_state", r->in.restart_state); + ndr_print_ptr(ndr, "sync_context", r->in.sync_context); + ndr->depth++; + ndr_print_uint32(ndr, "sync_context", *r->in.sync_context); + ndr->depth--; + ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DatabaseSync2"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "sync_context", r->out.sync_context); + ndr->depth++; + ndr_print_uint32(ndr, "sync_context", *r->out.sync_context); + ndr->depth--; + ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); + ndr->depth++; + ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); + ndr->depth++; + if (*r->out.delta_enum_array) { + ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int flags, const struct netr_DatabaseRedo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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)); + 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + { + struct ndr_push *_ndr_change_log_entry; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_change_log_entry, 4, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->flags))); + NDR_CHECK(ndr_push_netr_ChangeLogEntry(_ndr_change_log_entry, NDR_SCALARS|NDR_BUFFERS, &r->in.change_log_entry)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_change_log_entry, 4, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->flags))); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->flags))); + } + if (flags & NDR_OUT) { + 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.delta_enum_array == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); + if (*r->out.delta_enum_array) { + NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int flags, struct netr_DatabaseRedo *r) +{ + uint32_t _ptr_delta_enum_array; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_delta_enum_array_0; + TALLOC_CTX *_mem_save_delta_enum_array_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); + if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + { + struct ndr_pull *_ndr_change_log_entry; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_change_log_entry, 4, r->in.change_log_entry_size)); + NDR_CHECK(ndr_pull_netr_ChangeLogEntry(_ndr_change_log_entry, NDR_SCALARS|NDR_BUFFERS, &r->in.change_log_entry)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_change_log_entry, 4, r->in.change_log_entry_size)); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.change_log_entry_size)); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + *r->out.return_authenticator = *r->in.return_authenticator; + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + ZERO_STRUCTP(r->out.delta_enum_array); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + } + _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); + if (_ptr_delta_enum_array) { + NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); + } else { + *r->out.delta_enum_array = NULL; + } + if (*r->out.delta_enum_array) { + _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); + NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseRedo *r) +{ + ndr_print_struct(ndr, name, "netr_DatabaseRedo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DatabaseRedo"); + ndr->depth++; + ndr_print_string(ndr, "logon_server", r->in.logon_server); + ndr_print_string(ndr, "computername", r->in.computername); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth--; + ndr_print_netr_ChangeLogEntry(ndr, "change_log_entry", &r->in.change_log_entry); + ndr_print_uint32(ndr, "change_log_entry_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->flags):r->in.change_log_entry_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DatabaseRedo"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); + ndr->depth++; + ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); + ndr->depth++; + if (*r->out.delta_enum_array) { + ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonControl2Ex(struct ndr_push *ndr, int flags, const struct netr_LogonControl2Ex *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); + if (r->in.logon_server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.function_code)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.data, r->in.function_code)); + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonControl2Ex(struct ndr_pull *ndr, int flags, struct netr_LogonControl2Ex *r) +{ + uint32_t _ptr_logon_server; + TALLOC_CTX *_mem_save_logon_server_0; + TALLOC_CTX *_mem_save_query_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); + if (_ptr_logon_server) { + NDR_PULL_ALLOC(ndr, r->in.logon_server); + } else { + r->in.logon_server = NULL; + } + if (r->in.logon_server) { + _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); + if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.function_code)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.data, r->in.function_code)); + NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data)); + NDR_PULL_ALLOC(ndr, r->out.query); + ZERO_STRUCTP(r->out.query); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.query); + } + _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level)); + NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2Ex *r) +{ + ndr_print_struct(ndr, name, "netr_LogonControl2Ex"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonControl2Ex"); + ndr->depth++; + ndr_print_ptr(ndr, "logon_server", r->in.logon_server); + ndr->depth++; + if (r->in.logon_server) { + ndr_print_string(ndr, "logon_server", r->in.logon_server); + } + ndr->depth--; + ndr_print_uint32(ndr, "function_code", r->in.function_code); + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_set_switch_value(ndr, &r->in.data, r->in.function_code); + ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", &r->in.data); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonControl2Ex"); + ndr->depth++; + ndr_print_ptr(ndr, "query", r->out.query); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.query, r->in.level); + ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomains(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomains *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 (flags & NDR_OUT) { + if (r->out.trusted_domains_blob == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomains(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomains *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_trusted_domains_blob_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob); + ZERO_STRUCTP(r->out.trusted_domains_blob); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob); + } + _mem_save_trusted_domains_blob_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trusted_domains_blob, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_blob_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomains *r) +{ + ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomains"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomains"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomains"); + ndr->depth++; + ndr_print_ptr(ndr, "trusted_domains_blob", r->out.trusted_domains_blob); + ndr->depth++; + ndr_print_netr_Blob(ndr, "trusted_domains_blob", r->out.trusted_domains_blob); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRGetDCName(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCName *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); + if (r->in.domain_name) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid)); + if (r->in.domain_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_guid)); + if (r->in.site_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.site_guid)); + } + NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCName *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_domain_name; + uint32_t _ptr_domain_guid; + uint32_t _ptr_site_guid; + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_domain_guid_0; + TALLOC_CTX *_mem_save_site_guid_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->in.domain_name); + } else { + r->in.domain_name = NULL; + } + if (r->in.domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid)); + if (_ptr_domain_guid) { + NDR_PULL_ALLOC(ndr, r->in.domain_guid); + } else { + r->in.domain_guid = NULL; + } + if (r->in.domain_guid) { + _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_guid)); + if (_ptr_site_guid) { + NDR_PULL_ALLOC(ndr, r->in.site_guid); + } else { + r->in.site_guid = NULL; + } + if (r->in.site_guid) { + _mem_save_site_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.site_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.site_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_guid_0, 0); + } + NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCName *r) +{ + ndr_print_struct(ndr, name, "netr_DsRGetDCName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsRGetDCName"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + if (r->in.domain_name) { + ndr_print_string(ndr, "domain_name", r->in.domain_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid); + ndr->depth++; + if (r->in.domain_guid) { + ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid); + } + ndr->depth--; + ndr_print_ptr(ndr, "site_guid", r->in.site_guid); + ndr->depth++; + if (r->in.site_guid) { + ndr_print_GUID(ndr, "site_guid", r->in.site_guid); + } + ndr->depth--; + ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsRGetDCName"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NETRLOGONDUMMYROUTINE1(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETRLOGONDUMMYROUTINE1(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONDUMMYROUTINE1 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETRLOGONDUMMYROUTINE1(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r) +{ + ndr_print_struct(ndr, name, "netr_NETRLOGONDUMMYROUTINE1"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_NETRLOGONDUMMYROUTINE1"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_NETRLOGONDUMMYROUTINE1"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NETRLOGONSETSERVICEBITS(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETRLOGONSETSERVICEBITS(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSETSERVICEBITS *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r) +{ + ndr_print_struct(ndr, name, "netr_NETRLOGONSETSERVICEBITS"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_NETRLOGONSETSERVICEBITS"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_NETRLOGONSETSERVICEBITS"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonGetTrustRid(struct ndr_push *ndr, int flags, const struct netr_LogonGetTrustRid *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); + if (r->in.domain_name) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonGetTrustRid(struct ndr_pull *ndr, int flags, struct netr_LogonGetTrustRid *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->in.domain_name); + } else { + r->in.domain_name = NULL; + } + if (r->in.domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonGetTrustRid(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetTrustRid *r) +{ + ndr_print_struct(ndr, name, "netr_LogonGetTrustRid"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonGetTrustRid"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + if (r->in.domain_name) { + ndr_print_string(ndr, "domain_name", r->in.domain_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonGetTrustRid"); + ndr->depth++; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r) +{ + ndr_print_struct(ndr, name, "netr_NETRLOGONCOMPUTESERVERDIGEST"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_NETRLOGONCOMPUTESERVERDIGEST"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_NETRLOGONCOMPUTESERVERDIGEST"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r) +{ + ndr_print_struct(ndr, name, "netr_NETRLOGONCOMPUTECLIENTDIGEST"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_NETRLOGONCOMPUTECLIENTDIGEST"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_NETRLOGONCOMPUTECLIENTDIGEST"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate3 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->in.negotiate_flags)); + } + if (flags & NDR_OUT) { + if (r->out.return_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.return_credentials)); + if (r->out.negotiate_flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->out.negotiate_flags)); + 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_ServerAuthenticate3(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate3 *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credentials_0; + TALLOC_CTX *_mem_save_return_credentials_0; + TALLOC_CTX *_mem_save_negotiate_flags_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credentials); + } + _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.negotiate_flags); + } + _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->in.negotiate_flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + ZERO_STRUCTP(r->out.return_credentials); + NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); + *r->out.negotiate_flags = *r->in.negotiate_flags; + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + } + _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); + } + _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.negotiate_flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->out.negotiate_flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ServerAuthenticate3(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate3 *r) +{ + ndr_print_struct(ndr, name, "netr_ServerAuthenticate3"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_ServerAuthenticate3"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credentials", r->in.credentials); + ndr->depth++; + ndr_print_netr_Credential(ndr, "credentials", r->in.credentials); + ndr->depth--; + ndr_print_ptr(ndr, "negotiate_flags", r->in.negotiate_flags); + ndr->depth++; + ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->in.negotiate_flags); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_ServerAuthenticate3"); + ndr->depth++; + ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); + ndr->depth++; + ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); + ndr->depth--; + ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags); + ndr->depth++; + ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->out.negotiate_flags); + ndr->depth--; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); + if (r->in.domain_name) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid)); + if (r->in.domain_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name)); + if (r->in.site_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_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.site_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.site_name, ndr_charset_length(r->in.site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_domain_name; + uint32_t _ptr_domain_guid; + uint32_t _ptr_site_name; + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_domain_guid_0; + TALLOC_CTX *_mem_save_site_name_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->in.domain_name); + } else { + r->in.domain_name = NULL; + } + if (r->in.domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid)); + if (_ptr_domain_guid) { + NDR_PULL_ALLOC(ndr, r->in.domain_guid); + } else { + r->in.domain_guid = NULL; + } + if (r->in.domain_guid) { + _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); + if (_ptr_site_name) { + NDR_PULL_ALLOC(ndr, r->in.site_name); + } else { + r->in.site_name = NULL; + } + if (r->in.site_name) { + _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name)); + if (ndr_get_array_length(ndr, &r->in.site_name) > ndr_get_array_size(ndr, &r->in.site_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.site_name), ndr_get_array_length(ndr, &r->in.site_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); + } + NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx *r) +{ + ndr_print_struct(ndr, name, "netr_DsRGetDCNameEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsRGetDCNameEx"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + if (r->in.domain_name) { + ndr_print_string(ndr, "domain_name", r->in.domain_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid); + ndr->depth++; + if (r->in.domain_guid) { + ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid); + } + ndr->depth--; + ndr_print_ptr(ndr, "site_name", r->in.site_name); + ndr->depth++; + if (r->in.site_name) { + ndr_print_string(ndr, "site_name", r->in.site_name); + } + ndr->depth--; + ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsRGetDCNameEx"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRGetSiteName(struct ndr_push *ndr, int flags, const struct netr_DsRGetSiteName *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); + if (r->in.computer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 (flags & NDR_OUT) { + if (r->out.site == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.site)); + if (*r->out.site) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.site, ndr_charset_length(*r->out.site, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRGetSiteName(struct ndr_pull *ndr, int flags, struct netr_DsRGetSiteName *r) +{ + uint32_t _ptr_computer_name; + uint32_t _ptr_site; + TALLOC_CTX *_mem_save_computer_name_0; + TALLOC_CTX *_mem_save_site_0; + TALLOC_CTX *_mem_save_site_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); + if (_ptr_computer_name) { + NDR_PULL_ALLOC(ndr, r->in.computer_name); + } else { + r->in.computer_name = NULL; + } + if (r->in.computer_name) { + _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.site); + ZERO_STRUCTP(r->out.site); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.site); + } + _mem_save_site_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.site, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site)); + if (_ptr_site) { + NDR_PULL_ALLOC(ndr, *r->out.site); + } else { + *r->out.site = NULL; + } + if (*r->out.site) { + _mem_save_site_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.site, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.site)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.site)); + if (ndr_get_array_length(ndr, r->out.site) > ndr_get_array_size(ndr, r->out.site)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.site), ndr_get_array_length(ndr, r->out.site)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.site, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetSiteName *r) +{ + ndr_print_struct(ndr, name, "netr_DsRGetSiteName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsRGetSiteName"); + ndr->depth++; + ndr_print_ptr(ndr, "computer_name", r->in.computer_name); + ndr->depth++; + if (r->in.computer_name) { + ndr_print_string(ndr, "computer_name", r->in.computer_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsRGetSiteName"); + ndr->depth++; + ndr_print_ptr(ndr, "site", r->out.site); + ndr->depth++; + ndr_print_ptr(ndr, "site", *r->out.site); + ndr->depth++; + if (*r->out.site) { + ndr_print_string(ndr, "site", *r->out.site); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonGetDomainInfo(struct ndr_push *ndr, int flags, const struct netr_LogonGetDomainInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); + if (r->in.computer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonGetDomainInfo(struct ndr_pull *ndr, int flags, struct netr_LogonGetDomainInfo *r) +{ + uint32_t _ptr_computer_name; + TALLOC_CTX *_mem_save_computer_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); + if (_ptr_computer_name) { + NDR_PULL_ALLOC(ndr, r->in.computer_name); + } else { + r->in.computer_name = NULL; + } + if (r->in.computer_name) { + _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.query, r->in.level)); + NDR_CHECK(ndr_pull_netr_DomainQuery(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.query)); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + *r->out.return_authenticator = *r->in.return_authenticator; + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_netr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonGetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetDomainInfo *r) +{ + ndr_print_struct(ndr, name, "netr_LogonGetDomainInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonGetDomainInfo"); + ndr->depth++; + ndr_print_string(ndr, "server_name", r->in.server_name); + ndr_print_ptr(ndr, "computer_name", r->in.computer_name); + ndr->depth++; + if (r->in.computer_name) { + ndr_print_string(ndr, "computer_name", r->in.computer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_set_switch_value(ndr, &r->in.query, r->in.level); + ndr_print_netr_DomainQuery(ndr, "query", &r->in.query); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonGetDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_netr_DomainInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ServerPasswordSet2(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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.new_password == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ServerPasswordSet2(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet2 *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_new_password_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.new_password); + } + _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + ZERO_STRUCTP(r->out.return_authenticator); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet2 *r) +{ + ndr_print_struct(ndr, name, "netr_ServerPasswordSet2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_ServerPasswordSet2"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_ptr(ndr, "new_password", r->in.new_password); + ndr->depth++; + ndr_print_netr_CryptPassword(ndr, "new_password", r->in.new_password); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_ServerPasswordSet2"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ServerPasswordGet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordGet *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + } + if (flags & NDR_OUT) { + 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.password == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ServerPasswordGet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordGet *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_password_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + ZERO_STRUCTP(r->out.return_authenticator); + NDR_PULL_ALLOC(ndr, r->out.password); + ZERO_STRUCTP(r->out.password); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.password); + } + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ServerPasswordGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordGet *r) +{ + ndr_print_struct(ndr, name, "netr_ServerPasswordGet"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_ServerPasswordGet"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_ServerPasswordGet"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "password", r->out.password); + ndr->depth++; + ndr_print_samr_Password(ndr, "password", r->out.password); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NETRLOGONSENDTOSAM(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSENDTOSAM *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETRLOGONSENDTOSAM(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSENDTOSAM *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSENDTOSAM *r) +{ + ndr_print_struct(ndr, name, "netr_NETRLOGONSENDTOSAM"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_NETRLOGONSENDTOSAM"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_NETRLOGONSENDTOSAM"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesW *r) +{ + uint32_t cntr_addresses_1; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + if (r->in.addresses == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); + } + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); + } + } + if (flags & NDR_OUT) { + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); + if (*r->out.ctr) { + NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesW *r) +{ + uint32_t _ptr_server_name; + uint32_t cntr_addresses_1; + uint32_t _ptr_ctr; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_addresses_1; + TALLOC_CTX *_mem_save_ctr_0; + TALLOC_CTX *_mem_save_ctr_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); + if (r->in.count < 0 || r->in.count > 32000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses)); + } + _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0); + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); + } + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + if (r->in.addresses) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); + if (_ptr_ctr) { + NDR_PULL_ALLOC(ndr, *r->out.ctr); + } else { + *r->out.ctr = NULL; + } + if (*r->out.ctr) { + _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); + NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesW *r) +{ + uint32_t cntr_addresses_1; + ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesW"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "count", r->in.count); + ndr_print_ptr(ndr, "addresses", r->in.addresses); + ndr->depth++; + ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->in.count); + ndr->depth++; + for (cntr_addresses_1=0;cntr_addresses_1in.count;cntr_addresses_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) { + ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]); + free(idx_1); + } + } + ndr->depth--; + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesW"); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", *r->out.ctr); + ndr->depth++; + if (*r->out.ctr) { + ndr_print_netr_DsRAddressToSitenamesWCtr(ndr, "ctr", *r->out.ctr); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client_account)); + if (r->in.client_account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client_account, ndr_charset_length(r->in.client_account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.mask)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); + if (r->in.domain_name) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid)); + if (r->in.domain_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name)); + if (r->in.site_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_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.site_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.site_name, ndr_charset_length(r->in.site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx2 *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_client_account; + uint32_t _ptr_domain_name; + uint32_t _ptr_domain_guid; + uint32_t _ptr_site_name; + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_client_account_0; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_domain_guid_0; + TALLOC_CTX *_mem_save_site_name_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_account)); + if (_ptr_client_account) { + NDR_PULL_ALLOC(ndr, r->in.client_account); + } else { + r->in.client_account = NULL; + } + if (r->in.client_account) { + _mem_save_client_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.client_account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client_account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client_account)); + if (ndr_get_array_length(ndr, &r->in.client_account) > ndr_get_array_size(ndr, &r->in.client_account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.client_account), ndr_get_array_length(ndr, &r->in.client_account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.client_account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_account, ndr_get_array_length(ndr, &r->in.client_account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0); + } + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.mask)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->in.domain_name); + } else { + r->in.domain_name = NULL; + } + if (r->in.domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid)); + if (_ptr_domain_guid) { + NDR_PULL_ALLOC(ndr, r->in.domain_guid); + } else { + r->in.domain_guid = NULL; + } + if (r->in.domain_guid) { + _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); + if (_ptr_site_name) { + NDR_PULL_ALLOC(ndr, r->in.site_name); + } else { + r->in.site_name = NULL; + } + if (r->in.site_name) { + _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name)); + if (ndr_get_array_length(ndr, &r->in.site_name) > ndr_get_array_size(ndr, &r->in.site_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.site_name), ndr_get_array_length(ndr, &r->in.site_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); + } + NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx2 *r) +{ + ndr_print_struct(ndr, name, "netr_DsRGetDCNameEx2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsRGetDCNameEx2"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "client_account", r->in.client_account); + ndr->depth++; + if (r->in.client_account) { + ndr_print_string(ndr, "client_account", r->in.client_account); + } + ndr->depth--; + ndr_print_samr_AcctFlags(ndr, "mask", r->in.mask); + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + if (r->in.domain_name) { + ndr_print_string(ndr, "domain_name", r->in.domain_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid); + ndr->depth++; + if (r->in.domain_guid) { + ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid); + } + ndr->depth--; + ndr_print_ptr(ndr, "site_name", r->in.site_name); + ndr->depth++; + if (r->in.site_name) { + ndr_print_string(ndr, "site_name", r->in.site_name); + } + ndr->depth--; + ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsRGetDCNameEx2"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r) +{ + ndr_print_struct(ndr, name, "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomainsEx(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 (flags & NDR_OUT) { + if (r->out.dom_trust_list == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomainsEx(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomainsEx *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_dom_trust_list_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.dom_trust_list); + ZERO_STRUCTP(r->out.dom_trust_list); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.dom_trust_list); + } + _mem_save_dom_trust_list_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.dom_trust_list, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_trust_list_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r) +{ + ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomainsEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomainsEx"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomainsEx"); + ndr->depth++; + ndr_print_ptr(ndr, "dom_trust_list", r->out.dom_trust_list); + ndr->depth++; + ndr_print_netr_DomainTrustList(ndr, "dom_trust_list", r->out.dom_trust_list); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesExW *r) +{ + uint32_t cntr_addresses_1; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + if (r->in.addresses == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); + } + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); + } + } + if (flags & NDR_OUT) { + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); + if (*r->out.ctr) { + NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesExW *r) +{ + uint32_t _ptr_server_name; + uint32_t cntr_addresses_1; + uint32_t _ptr_ctr; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_addresses_1; + TALLOC_CTX *_mem_save_ctr_0; + TALLOC_CTX *_mem_save_ctr_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); + if (r->in.count < 0 || r->in.count > 32000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses)); + } + _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0); + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); + } + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + if (r->in.addresses) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); + if (_ptr_ctr) { + NDR_PULL_ALLOC(ndr, *r->out.ctr); + } else { + *r->out.ctr = NULL; + } + if (*r->out.ctr) { + _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); + NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesExW *r) +{ + uint32_t cntr_addresses_1; + ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesExW"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "count", r->in.count); + ndr_print_ptr(ndr, "addresses", r->in.addresses); + ndr->depth++; + ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->in.count); + ndr->depth++; + for (cntr_addresses_1=0;cntr_addresses_1in.count;cntr_addresses_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) { + ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]); + free(idx_1); + } + } + ndr->depth--; + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesExW"); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", *r->out.ctr); + ndr->depth++; + if (*r->out.ctr) { + ndr_print_netr_DsRAddressToSitenamesExWCtr(ndr, "ctr", *r->out.ctr); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsrGetDcSiteCoverageW(struct ndr_push *ndr, int flags, const struct netr_DsrGetDcSiteCoverageW *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 (flags & NDR_OUT) { + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); + if (*r->out.ctr) { + NDR_CHECK(ndr_push_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsrGetDcSiteCoverageW(struct ndr_pull *ndr, int flags, struct netr_DsrGetDcSiteCoverageW *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_ctr; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_ctr_0; + TALLOC_CTX *_mem_save_ctr_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); + if (_ptr_ctr) { + NDR_PULL_ALLOC(ndr, *r->out.ctr); + } else { + *r->out.ctr = NULL; + } + if (*r->out.ctr) { + _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); + NDR_CHECK(ndr_pull_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrGetDcSiteCoverageW *r) +{ + ndr_print_struct(ndr, name, "netr_DsrGetDcSiteCoverageW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsrGetDcSiteCoverageW"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsrGetDcSiteCoverageW"); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", *r->out.ctr); + ndr->depth++; + if (*r->out.ctr) { + ndr_print_DcSitesCtr(ndr, "ctr", *r->out.ctr); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonEx *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); + if (r->in.computer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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)); + } + NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level)); + if (r->in.logon == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + 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 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 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonEx *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_computer_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_computer_name_0; + TALLOC_CTX *_mem_save_logon_0; + TALLOC_CTX *_mem_save_validation_0; + TALLOC_CTX *_mem_save_authoritative_0; + TALLOC_CTX *_mem_save_flags_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); + if (_ptr_computer_name) { + NDR_PULL_ALLOC(ndr, r->in.computer_name); + } else { + r->in.computer_name = NULL; + } + if (r->in.computer_name) { + _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); + } + NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.logon); + } + _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level)); + NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.flags); + } + _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.validation); + ZERO_STRUCTP(r->out.validation); + NDR_PULL_ALLOC(ndr, r->out.authoritative); + ZERO_STRUCTP(r->out.authoritative); + NDR_PULL_ALLOC(ndr, r->out.flags); + *r->out.flags = *r->in.flags; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.validation); + } + _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level)); + NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.authoritative); + } + _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.flags); + } + _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonEx *r) +{ + ndr_print_struct(ndr, name, "netr_LogonSamLogonEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonSamLogonEx"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "computer_name", r->in.computer_name); + ndr->depth++; + if (r->in.computer_name) { + ndr_print_string(ndr, "computer_name", r->in.computer_name); + } + ndr->depth--; + ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level); + ndr_print_ptr(ndr, "logon", r->in.logon); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level); + ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon); + ndr->depth--; + ndr_print_uint16(ndr, "validation_level", r->in.validation_level); + ndr_print_ptr(ndr, "flags", r->in.flags); + ndr->depth++; + ndr_print_uint32(ndr, "flags", *r->in.flags); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonSamLogonEx"); + ndr->depth++; + ndr_print_ptr(ndr, "validation", r->out.validation); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level); + ndr_print_netr_Validation(ndr, "validation", r->out.validation); + ndr->depth--; + ndr_print_ptr(ndr, "authoritative", r->out.authoritative); + ndr->depth++; + ndr_print_uint8(ndr, "authoritative", *r->out.authoritative); + ndr->depth--; + ndr_print_ptr(ndr, "flags", r->out.flags); + ndr->depth++; + ndr_print_uint32(ndr, "flags", *r->out.flags); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push *ndr, int flags, const struct netr_DsrEnumerateDomainTrusts *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->in.trust_flags)); + } + if (flags & NDR_OUT) { + if (r->out.trusts == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull *ndr, int flags, struct netr_DsrEnumerateDomainTrusts *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_trusts_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->in.trust_flags)); + NDR_PULL_ALLOC(ndr, r->out.trusts); + ZERO_STRUCTP(r->out.trusts); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.trusts); + } + _mem_save_trusts_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrEnumerateDomainTrusts *r) +{ + ndr_print_struct(ndr, name, "netr_DsrEnumerateDomainTrusts"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsrEnumerateDomainTrusts"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_netr_TrustFlags(ndr, "trust_flags", r->in.trust_flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsrEnumerateDomainTrusts"); + ndr->depth++; + ndr_print_ptr(ndr, "trusts", r->out.trusts); + ndr->depth++; + ndr_print_netr_DomainTrustList(ndr, "trusts", r->out.trusts); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsrDeregisterDNSHostRecords(struct ndr_push *ndr, int flags, const struct netr_DsrDeregisterDNSHostRecords *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain)); + if (r->in.domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, 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, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid)); + if (r->in.domain_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dsa_guid)); + if (r->in.dsa_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.dsa_guid)); + } + if (r->in.dns_host == 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.dns_host, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dns_host, ndr_charset_length(r->in.dns_host, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsrDeregisterDNSHostRecords(struct ndr_pull *ndr, int flags, struct netr_DsrDeregisterDNSHostRecords *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_domain; + uint32_t _ptr_domain_guid; + uint32_t _ptr_dsa_guid; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_domain_0; + TALLOC_CTX *_mem_save_domain_guid_0; + TALLOC_CTX *_mem_save_dsa_guid_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->in.domain); + } else { + r->in.domain = NULL; + } + if (r->in.domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain)); + if (ndr_get_array_length(ndr, &r->in.domain) > ndr_get_array_size(ndr, &r->in.domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain), ndr_get_array_length(ndr, &r->in.domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid)); + if (_ptr_domain_guid) { + NDR_PULL_ALLOC(ndr, r->in.domain_guid); + } else { + r->in.domain_guid = NULL; + } + if (r->in.domain_guid) { + _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_guid)); + if (_ptr_dsa_guid) { + NDR_PULL_ALLOC(ndr, r->in.dsa_guid); + } else { + r->in.dsa_guid = NULL; + } + if (r->in.dsa_guid) { + _mem_save_dsa_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dsa_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.dsa_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_guid_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_host)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_host)); + if (ndr_get_array_length(ndr, &r->in.dns_host) > ndr_get_array_size(ndr, &r->in.dns_host)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dns_host), ndr_get_array_length(ndr, &r->in.dns_host)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_host, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrDeregisterDNSHostRecords *r) +{ + ndr_print_struct(ndr, name, "netr_DsrDeregisterDNSHostRecords"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsrDeregisterDNSHostRecords"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain", r->in.domain); + ndr->depth++; + if (r->in.domain) { + ndr_print_string(ndr, "domain", r->in.domain); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid); + ndr->depth++; + if (r->in.domain_guid) { + ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid); + } + ndr->depth--; + ndr_print_ptr(ndr, "dsa_guid", r->in.dsa_guid); + ndr->depth++; + if (r->in.dsa_guid) { + ndr_print_GUID(ndr, "dsa_guid", r->in.dsa_guid); + } + ndr->depth--; + ndr_print_ptr(ndr, "dns_host", r->in.dns_host); + ndr->depth++; + ndr_print_string(ndr, "dns_host", r->in.dns_host); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsrDeregisterDNSHostRecords"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ServerTrustPasswordsGet(struct ndr_push *ndr, int flags, const struct netr_ServerTrustPasswordsGet *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + } + if (flags & NDR_OUT) { + 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.password == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password)); + if (r->out.password2 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password2)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ServerTrustPasswordsGet(struct ndr_pull *ndr, int flags, struct netr_ServerTrustPasswordsGet *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_password_0; + TALLOC_CTX *_mem_save_password2_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + ZERO_STRUCTP(r->out.return_authenticator); + NDR_PULL_ALLOC(ndr, r->out.password); + ZERO_STRUCTP(r->out.password); + NDR_PULL_ALLOC(ndr, r->out.password2); + ZERO_STRUCTP(r->out.password2); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.password); + } + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.password2); + } + _mem_save_password2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.password2, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password2_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerTrustPasswordsGet *r) +{ + ndr_print_struct(ndr, name, "netr_ServerTrustPasswordsGet"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_ServerTrustPasswordsGet"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_ServerTrustPasswordsGet"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "password", r->out.password); + ndr->depth++; + ndr_print_samr_Password(ndr, "password", r->out.password); + ndr->depth--; + ndr_print_ptr(ndr, "password2", r->out.password2); + ndr->depth++; + ndr_print_samr_Password(ndr, "password2", r->out.password2); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRGetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_DsRGetForestTrustInformation *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.trusted_domain_name)); + if (r->in.trusted_domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_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.trusted_domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.trusted_domain_name, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.forest_trust_info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info)); + if (*r->out.forest_trust_info) { + NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRGetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_DsRGetForestTrustInformation *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_trusted_domain_name; + uint32_t _ptr_forest_trust_info; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_trusted_domain_name_0; + TALLOC_CTX *_mem_save_forest_trust_info_0; + TALLOC_CTX *_mem_save_forest_trust_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain_name)); + if (_ptr_trusted_domain_name) { + NDR_PULL_ALLOC(ndr, r->in.trusted_domain_name); + } else { + r->in.trusted_domain_name = NULL; + } + if (r->in.trusted_domain_name) { + _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name)); + if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + ZERO_STRUCTP(r->out.forest_trust_info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + } + _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info)); + if (_ptr_forest_trust_info) { + NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info); + } else { + *r->out.forest_trust_info = NULL; + } + if (*r->out.forest_trust_info) { + _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0); + NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r) +{ + ndr_print_struct(ndr, name, "netr_DsRGetForestTrustInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_DsRGetForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth++; + if (r->in.trusted_domain_name) { + ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_DsRGetForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info); + ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info); + ndr->depth++; + if (*r->out.forest_trust_info) { + ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_GetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_GetForestTrustInformation *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.trusted_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.trusted_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.trusted_domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.trusted_domain_name, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + 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.forest_trust_info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info)); + if (*r->out.forest_trust_info) { + NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_GetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_GetForestTrustInformation *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_forest_trust_info; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_forest_trust_info_0; + TALLOC_CTX *_mem_save_forest_trust_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name)); + if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + ZERO_STRUCTP(r->out.return_authenticator); + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + ZERO_STRUCTP(r->out.forest_trust_info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + } + _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info)); + if (_ptr_forest_trust_info) { + NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info); + } else { + *r->out.forest_trust_info = NULL; + } + if (*r->out.forest_trust_info) { + _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0); + NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r) +{ + ndr_print_struct(ndr, name, "netr_GetForestTrustInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_GetForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth++; + ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth--; + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_GetForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info); + ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info); + ndr->depth++; + if (*r->out.forest_trust_info) { + ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonWithFlags *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); + if (r->in.computer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential)); + if (r->in.credential) { + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator)); + if (r->in.return_authenticator) { + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + } + NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level)); + if (r->in.logon == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + 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 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) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator)); + if (r->out.return_authenticator) { + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + } + 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonWithFlags *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_computer_name; + uint32_t _ptr_credential; + uint32_t _ptr_return_authenticator; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_computer_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_logon_0; + TALLOC_CTX *_mem_save_validation_0; + TALLOC_CTX *_mem_save_authoritative_0; + TALLOC_CTX *_mem_save_flags_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); + if (_ptr_computer_name) { + NDR_PULL_ALLOC(ndr, r->in.computer_name); + } else { + r->in.computer_name = NULL; + } + if (r->in.computer_name) { + _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential)); + if (_ptr_credential) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } else { + r->in.credential = NULL; + } + if (r->in.credential) { + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); + if (_ptr_return_authenticator) { + NDR_PULL_ALLOC(ndr, r->in.return_authenticator); + } else { + r->in.return_authenticator = NULL; + } + if (r->in.return_authenticator) { + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); + } + NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.logon); + } + _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level)); + NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.flags); + } + _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.validation); + ZERO_STRUCTP(r->out.validation); + NDR_PULL_ALLOC(ndr, r->out.authoritative); + ZERO_STRUCTP(r->out.authoritative); + NDR_PULL_ALLOC(ndr, r->out.flags); + *r->out.flags = *r->in.flags; + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); + if (_ptr_return_authenticator) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } else { + r->out.return_authenticator = NULL; + } + if (r->out.return_authenticator) { + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.validation); + } + _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level)); + NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.authoritative); + } + _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.flags); + } + _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonWithFlags *r) +{ + ndr_print_struct(ndr, name, "netr_LogonSamLogonWithFlags"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_LogonSamLogonWithFlags"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "computer_name", r->in.computer_name); + ndr->depth++; + if (r->in.computer_name) { + ndr_print_string(ndr, "computer_name", r->in.computer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + if (r->in.credential) { + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + } + ndr->depth--; + ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + if (r->in.return_authenticator) { + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + } + ndr->depth--; + ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level); + ndr_print_ptr(ndr, "logon", r->in.logon); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level); + ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon); + ndr->depth--; + ndr_print_uint16(ndr, "validation_level", r->in.validation_level); + ndr_print_ptr(ndr, "flags", r->in.flags); + ndr->depth++; + ndr_print_uint32(ndr, "flags", *r->in.flags); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_LogonSamLogonWithFlags"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + if (r->out.return_authenticator) { + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + } + ndr->depth--; + ndr_print_ptr(ndr, "validation", r->out.validation); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level); + ndr_print_netr_Validation(ndr, "validation", r->out.validation); + ndr->depth--; + ndr_print_ptr(ndr, "authoritative", r->out.authoritative); + ndr->depth++; + ndr_print_uint8(ndr, "authoritative", *r->out.authoritative); + ndr->depth--; + ndr_print_ptr(ndr, "flags", r->out.flags); + ndr->depth++; + ndr_print_uint32(ndr, "flags", *r->out.flags); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_ServerGetTrustInfo(struct ndr_push *ndr, int flags, const struct netr_ServerGetTrustInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.account_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.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + if (r->in.computer_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.computer_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.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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + } + if (flags & NDR_OUT) { + 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.new_owf_password == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password)); + if (r->out.old_owf_password == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password)); + if (r->out.trust_info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.trust_info)); + if (*r->out.trust_info) { + NDR_CHECK(ndr_push_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_ServerGetTrustInfo(struct ndr_pull *ndr, int flags, struct netr_ServerGetTrustInfo *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_trust_info; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_new_owf_password_0; + TALLOC_CTX *_mem_save_old_owf_password_0; + TALLOC_CTX *_mem_save_trust_info_0; + TALLOC_CTX *_mem_save_trust_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + ZERO_STRUCTP(r->out.return_authenticator); + NDR_PULL_ALLOC(ndr, r->out.new_owf_password); + ZERO_STRUCTP(r->out.new_owf_password); + NDR_PULL_ALLOC(ndr, r->out.old_owf_password); + ZERO_STRUCTP(r->out.old_owf_password); + NDR_PULL_ALLOC(ndr, r->out.trust_info); + ZERO_STRUCTP(r->out.trust_info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.new_owf_password); + } + _mem_save_new_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.new_owf_password, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_owf_password_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.old_owf_password); + } + _mem_save_old_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.old_owf_password, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_owf_password_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.trust_info); + } + _mem_save_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trust_info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trust_info)); + if (_ptr_trust_info) { + NDR_PULL_ALLOC(ndr, *r->out.trust_info); + } else { + *r->out.trust_info = NULL; + } + if (*r->out.trust_info) { + _mem_save_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.trust_info, 0); + NDR_CHECK(ndr_pull_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_ServerGetTrustInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerGetTrustInfo *r) +{ + ndr_print_struct(ndr, name, "netr_ServerGetTrustInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "netr_ServerGetTrustInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "account_name", r->in.account_name); + ndr->depth++; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr->depth--; + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_ptr(ndr, "computer_name", r->in.computer_name); + ndr->depth++; + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr->depth--; + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "netr_ServerGetTrustInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "new_owf_password", r->out.new_owf_password); + ndr->depth++; + ndr_print_samr_Password(ndr, "new_owf_password", r->out.new_owf_password); + ndr->depth--; + ndr_print_ptr(ndr, "old_owf_password", r->out.old_owf_password); + ndr->depth++; + ndr_print_samr_Password(ndr, "old_owf_password", r->out.old_owf_password); + ndr->depth--; + ndr_print_ptr(ndr, "trust_info", r->out.trust_info); + ndr->depth++; + ndr_print_ptr(ndr, "trust_info", *r->out.trust_info); + ndr->depth++; + if (*r->out.trust_info) { + ndr_print_netr_TrustInfo(ndr, "trust_info", *r->out.trust_info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call netlogon_calls[] = { + { + "netr_LogonUasLogon", + sizeof(struct netr_LogonUasLogon), + (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogon, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogon, + (ndr_print_function_t) ndr_print_netr_LogonUasLogon, + false, + }, + { + "netr_LogonUasLogoff", + sizeof(struct netr_LogonUasLogoff), + (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogoff, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogoff, + (ndr_print_function_t) ndr_print_netr_LogonUasLogoff, + false, + }, + { + "netr_LogonSamLogon", + sizeof(struct netr_LogonSamLogon), + (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogon, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogon, + (ndr_print_function_t) ndr_print_netr_LogonSamLogon, + false, + }, + { + "netr_LogonSamLogoff", + sizeof(struct netr_LogonSamLogoff), + (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogoff, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogoff, + (ndr_print_function_t) ndr_print_netr_LogonSamLogoff, + false, + }, + { + "netr_ServerReqChallenge", + sizeof(struct netr_ServerReqChallenge), + (ndr_push_flags_fn_t) ndr_push_netr_ServerReqChallenge, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerReqChallenge, + (ndr_print_function_t) ndr_print_netr_ServerReqChallenge, + false, + }, + { + "netr_ServerAuthenticate", + sizeof(struct netr_ServerAuthenticate), + (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate, + (ndr_print_function_t) ndr_print_netr_ServerAuthenticate, + false, + }, + { + "netr_ServerPasswordSet", + sizeof(struct netr_ServerPasswordSet), + (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet, + (ndr_print_function_t) ndr_print_netr_ServerPasswordSet, + false, + }, + { + "netr_DatabaseDeltas", + sizeof(struct netr_DatabaseDeltas), + (ndr_push_flags_fn_t) ndr_push_netr_DatabaseDeltas, + (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseDeltas, + (ndr_print_function_t) ndr_print_netr_DatabaseDeltas, + false, + }, + { + "netr_DatabaseSync", + sizeof(struct netr_DatabaseSync), + (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync, + (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync, + (ndr_print_function_t) ndr_print_netr_DatabaseSync, + false, + }, + { + "netr_AccountDeltas", + sizeof(struct netr_AccountDeltas), + (ndr_push_flags_fn_t) ndr_push_netr_AccountDeltas, + (ndr_pull_flags_fn_t) ndr_pull_netr_AccountDeltas, + (ndr_print_function_t) ndr_print_netr_AccountDeltas, + false, + }, + { + "netr_AccountSync", + sizeof(struct netr_AccountSync), + (ndr_push_flags_fn_t) ndr_push_netr_AccountSync, + (ndr_pull_flags_fn_t) ndr_pull_netr_AccountSync, + (ndr_print_function_t) ndr_print_netr_AccountSync, + false, + }, + { + "netr_GetDcName", + sizeof(struct netr_GetDcName), + (ndr_push_flags_fn_t) ndr_push_netr_GetDcName, + (ndr_pull_flags_fn_t) ndr_pull_netr_GetDcName, + (ndr_print_function_t) ndr_print_netr_GetDcName, + false, + }, + { + "netr_LogonControl", + sizeof(struct netr_LogonControl), + (ndr_push_flags_fn_t) ndr_push_netr_LogonControl, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl, + (ndr_print_function_t) ndr_print_netr_LogonControl, + false, + }, + { + "netr_GetAnyDCName", + sizeof(struct netr_GetAnyDCName), + (ndr_push_flags_fn_t) ndr_push_netr_GetAnyDCName, + (ndr_pull_flags_fn_t) ndr_pull_netr_GetAnyDCName, + (ndr_print_function_t) ndr_print_netr_GetAnyDCName, + false, + }, + { + "netr_LogonControl2", + sizeof(struct netr_LogonControl2), + (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2, + (ndr_print_function_t) ndr_print_netr_LogonControl2, + false, + }, + { + "netr_ServerAuthenticate2", + sizeof(struct netr_ServerAuthenticate2), + (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate2, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate2, + (ndr_print_function_t) ndr_print_netr_ServerAuthenticate2, + false, + }, + { + "netr_DatabaseSync2", + sizeof(struct netr_DatabaseSync2), + (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync2, + (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync2, + (ndr_print_function_t) ndr_print_netr_DatabaseSync2, + false, + }, + { + "netr_DatabaseRedo", + sizeof(struct netr_DatabaseRedo), + (ndr_push_flags_fn_t) ndr_push_netr_DatabaseRedo, + (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseRedo, + (ndr_print_function_t) ndr_print_netr_DatabaseRedo, + false, + }, + { + "netr_LogonControl2Ex", + sizeof(struct netr_LogonControl2Ex), + (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2Ex, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2Ex, + (ndr_print_function_t) ndr_print_netr_LogonControl2Ex, + false, + }, + { + "netr_NetrEnumerateTrustedDomains", + sizeof(struct netr_NetrEnumerateTrustedDomains), + (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomains, + (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomains, + (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomains, + false, + }, + { + "netr_DsRGetDCName", + sizeof(struct netr_DsRGetDCName), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCName, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCName, + (ndr_print_function_t) ndr_print_netr_DsRGetDCName, + false, + }, + { + "netr_NETRLOGONDUMMYROUTINE1", + sizeof(struct netr_NETRLOGONDUMMYROUTINE1), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONDUMMYROUTINE1, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONDUMMYROUTINE1, + (ndr_print_function_t) ndr_print_netr_NETRLOGONDUMMYROUTINE1, + false, + }, + { + "netr_NETRLOGONSETSERVICEBITS", + sizeof(struct netr_NETRLOGONSETSERVICEBITS), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSETSERVICEBITS, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSETSERVICEBITS, + (ndr_print_function_t) ndr_print_netr_NETRLOGONSETSERVICEBITS, + false, + }, + { + "netr_LogonGetTrustRid", + sizeof(struct netr_LogonGetTrustRid), + (ndr_push_flags_fn_t) ndr_push_netr_LogonGetTrustRid, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetTrustRid, + (ndr_print_function_t) ndr_print_netr_LogonGetTrustRid, + false, + }, + { + "netr_NETRLOGONCOMPUTESERVERDIGEST", + sizeof(struct netr_NETRLOGONCOMPUTESERVERDIGEST), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST, + (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST, + false, + }, + { + "netr_NETRLOGONCOMPUTECLIENTDIGEST", + sizeof(struct netr_NETRLOGONCOMPUTECLIENTDIGEST), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST, + (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST, + false, + }, + { + "netr_ServerAuthenticate3", + sizeof(struct netr_ServerAuthenticate3), + (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate3, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate3, + (ndr_print_function_t) ndr_print_netr_ServerAuthenticate3, + false, + }, + { + "netr_DsRGetDCNameEx", + sizeof(struct netr_DsRGetDCNameEx), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx, + (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx, + false, + }, + { + "netr_DsRGetSiteName", + sizeof(struct netr_DsRGetSiteName), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetSiteName, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetSiteName, + (ndr_print_function_t) ndr_print_netr_DsRGetSiteName, + false, + }, + { + "netr_LogonGetDomainInfo", + sizeof(struct netr_LogonGetDomainInfo), + (ndr_push_flags_fn_t) ndr_push_netr_LogonGetDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetDomainInfo, + (ndr_print_function_t) ndr_print_netr_LogonGetDomainInfo, + false, + }, + { + "netr_ServerPasswordSet2", + sizeof(struct netr_ServerPasswordSet2), + (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet2, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet2, + (ndr_print_function_t) ndr_print_netr_ServerPasswordSet2, + false, + }, + { + "netr_ServerPasswordGet", + sizeof(struct netr_ServerPasswordGet), + (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordGet, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordGet, + (ndr_print_function_t) ndr_print_netr_ServerPasswordGet, + false, + }, + { + "netr_NETRLOGONSENDTOSAM", + sizeof(struct netr_NETRLOGONSENDTOSAM), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSENDTOSAM, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSENDTOSAM, + (ndr_print_function_t) ndr_print_netr_NETRLOGONSENDTOSAM, + false, + }, + { + "netr_DsRAddressToSitenamesW", + sizeof(struct netr_DsRAddressToSitenamesW), + (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesW, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesW, + (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesW, + false, + }, + { + "netr_DsRGetDCNameEx2", + sizeof(struct netr_DsRGetDCNameEx2), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx2, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx2, + (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx2, + false, + }, + { + "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN", + sizeof(struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN), + (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, + (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, + (ndr_print_function_t) ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, + false, + }, + { + "netr_NetrEnumerateTrustedDomainsEx", + sizeof(struct netr_NetrEnumerateTrustedDomainsEx), + (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomainsEx, + (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomainsEx, + (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomainsEx, + false, + }, + { + "netr_DsRAddressToSitenamesExW", + sizeof(struct netr_DsRAddressToSitenamesExW), + (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesExW, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesExW, + (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesExW, + false, + }, + { + "netr_DsrGetDcSiteCoverageW", + sizeof(struct netr_DsrGetDcSiteCoverageW), + (ndr_push_flags_fn_t) ndr_push_netr_DsrGetDcSiteCoverageW, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsrGetDcSiteCoverageW, + (ndr_print_function_t) ndr_print_netr_DsrGetDcSiteCoverageW, + false, + }, + { + "netr_LogonSamLogonEx", + sizeof(struct netr_LogonSamLogonEx), + (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonEx, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonEx, + (ndr_print_function_t) ndr_print_netr_LogonSamLogonEx, + false, + }, + { + "netr_DsrEnumerateDomainTrusts", + sizeof(struct netr_DsrEnumerateDomainTrusts), + (ndr_push_flags_fn_t) ndr_push_netr_DsrEnumerateDomainTrusts, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsrEnumerateDomainTrusts, + (ndr_print_function_t) ndr_print_netr_DsrEnumerateDomainTrusts, + false, + }, + { + "netr_DsrDeregisterDNSHostRecords", + sizeof(struct netr_DsrDeregisterDNSHostRecords), + (ndr_push_flags_fn_t) ndr_push_netr_DsrDeregisterDNSHostRecords, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsrDeregisterDNSHostRecords, + (ndr_print_function_t) ndr_print_netr_DsrDeregisterDNSHostRecords, + false, + }, + { + "netr_ServerTrustPasswordsGet", + sizeof(struct netr_ServerTrustPasswordsGet), + (ndr_push_flags_fn_t) ndr_push_netr_ServerTrustPasswordsGet, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerTrustPasswordsGet, + (ndr_print_function_t) ndr_print_netr_ServerTrustPasswordsGet, + false, + }, + { + "netr_DsRGetForestTrustInformation", + sizeof(struct netr_DsRGetForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetForestTrustInformation, + (ndr_print_function_t) ndr_print_netr_DsRGetForestTrustInformation, + false, + }, + { + "netr_GetForestTrustInformation", + sizeof(struct netr_GetForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_netr_GetForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_netr_GetForestTrustInformation, + (ndr_print_function_t) ndr_print_netr_GetForestTrustInformation, + false, + }, + { + "netr_LogonSamLogonWithFlags", + sizeof(struct netr_LogonSamLogonWithFlags), + (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonWithFlags, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonWithFlags, + (ndr_print_function_t) ndr_print_netr_LogonSamLogonWithFlags, + false, + }, + { + "netr_ServerGetTrustInfo", + sizeof(struct netr_ServerGetTrustInfo), + (ndr_push_flags_fn_t) ndr_push_netr_ServerGetTrustInfo, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerGetTrustInfo, + (ndr_print_function_t) ndr_print_netr_ServerGetTrustInfo, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const netlogon_endpoint_strings[] = { + "ncacn_np:[\\pipe\\netlogon]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array netlogon_endpoints = { + .count = 3, + .names = netlogon_endpoint_strings +}; + +static const char * const netlogon_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array netlogon_authservices = { + .count = 1, + .names = netlogon_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_netlogon = { + .name = "netlogon", + .syntax_id = { + {0x12345678,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0xcf,0xfb}}, + NDR_NETLOGON_VERSION + }, + .helpstring = NDR_NETLOGON_HELPSTRING, + .num_calls = 47, + .calls = netlogon_calls, + .endpoints = &netlogon_endpoints, + .authservices = &netlogon_authservices +}; + diff --git a/librpc/gen_ndr/ndr_netlogon.h b/librpc/gen_ndr/ndr_netlogon.h new file mode 100644 index 0000000000..5858906c1c --- /dev/null +++ b/librpc/gen_ndr/ndr_netlogon.h @@ -0,0 +1,281 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/netlogon.h" + +#ifndef _HEADER_NDR_netlogon +#define _HEADER_NDR_netlogon + +#include "../librpc/ndr/ndr_netlogon.h" +#define NDR_NETLOGON_UUID "12345678-1234-abcd-ef00-01234567cffb" +#define NDR_NETLOGON_VERSION 1.0 +#define NDR_NETLOGON_NAME "netlogon" +#define NDR_NETLOGON_HELPSTRING NULL +extern const struct ndr_interface_table ndr_table_netlogon; +#define NDR_NETR_LOGONUASLOGON (0x00) + +#define NDR_NETR_LOGONUASLOGOFF (0x01) + +#define NDR_NETR_LOGONSAMLOGON (0x02) + +#define NDR_NETR_LOGONSAMLOGOFF (0x03) + +#define NDR_NETR_SERVERREQCHALLENGE (0x04) + +#define NDR_NETR_SERVERAUTHENTICATE (0x05) + +#define NDR_NETR_SERVERPASSWORDSET (0x06) + +#define NDR_NETR_DATABASEDELTAS (0x07) + +#define NDR_NETR_DATABASESYNC (0x08) + +#define NDR_NETR_ACCOUNTDELTAS (0x09) + +#define NDR_NETR_ACCOUNTSYNC (0x0a) + +#define NDR_NETR_GETDCNAME (0x0b) + +#define NDR_NETR_LOGONCONTROL (0x0c) + +#define NDR_NETR_GETANYDCNAME (0x0d) + +#define NDR_NETR_LOGONCONTROL2 (0x0e) + +#define NDR_NETR_SERVERAUTHENTICATE2 (0x0f) + +#define NDR_NETR_DATABASESYNC2 (0x10) + +#define NDR_NETR_DATABASEREDO (0x11) + +#define NDR_NETR_LOGONCONTROL2EX (0x12) + +#define NDR_NETR_NETRENUMERATETRUSTEDDOMAINS (0x13) + +#define NDR_NETR_DSRGETDCNAME (0x14) + +#define NDR_NETR_NETRLOGONDUMMYROUTINE1 (0x15) + +#define NDR_NETR_NETRLOGONSETSERVICEBITS (0x16) + +#define NDR_NETR_LOGONGETTRUSTRID (0x17) + +#define NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST (0x18) + +#define NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST (0x19) + +#define NDR_NETR_SERVERAUTHENTICATE3 (0x1a) + +#define NDR_NETR_DSRGETDCNAMEEX (0x1b) + +#define NDR_NETR_DSRGETSITENAME (0x1c) + +#define NDR_NETR_LOGONGETDOMAININFO (0x1d) + +#define NDR_NETR_SERVERPASSWORDSET2 (0x1e) + +#define NDR_NETR_SERVERPASSWORDGET (0x1f) + +#define NDR_NETR_NETRLOGONSENDTOSAM (0x20) + +#define NDR_NETR_DSRADDRESSTOSITENAMESW (0x21) + +#define NDR_NETR_DSRGETDCNAMEEX2 (0x22) + +#define NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN (0x23) + +#define NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX (0x24) + +#define NDR_NETR_DSRADDRESSTOSITENAMESEXW (0x25) + +#define NDR_NETR_DSRGETDCSITECOVERAGEW (0x26) + +#define NDR_NETR_LOGONSAMLOGONEX (0x27) + +#define NDR_NETR_DSRENUMERATEDOMAINTRUSTS (0x28) + +#define NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS (0x29) + +#define NDR_NETR_SERVERTRUSTPASSWORDSGET (0x2a) + +#define NDR_NETR_DSRGETFORESTTRUSTINFORMATION (0x2b) + +#define NDR_NETR_GETFORESTTRUSTINFORMATION (0x2c) + +#define NDR_NETR_LOGONSAMLOGONWITHFLAGS (0x2d) + +#define NDR_NETR_SERVERGETTRUSTINFO (0x2e) + +#define NDR_NETLOGON_CALL_COUNT (47) +void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r); +void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r); +enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r); +enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r); +void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r); +enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_netr_LogonParameterControl(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r); +void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r); +void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r); +void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r); +void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r); +void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r); +enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r); +enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r); +void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r); +enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r); +enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r); +void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r); +enum ndr_err_code ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r); +enum ndr_err_code ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r); +void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *name, const struct netr_LMSessionKey *r); +enum ndr_err_code ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name, const struct netr_SamBaseInfo *r); +void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, const struct netr_SamInfo2 *r); +void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, const struct netr_SidAttr *r); +enum ndr_err_code ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r); +enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r); +void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r); +void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r); +void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r); +void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r); +enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r); +enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r); +void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r); +enum ndr_err_code ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r); +enum ndr_err_code ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r); +void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const struct netr_Credential *r); +enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r); +enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r); +void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r); +void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r); +void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r); +void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r); +void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS2 *r); +void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY_UNION *r); +enum ndr_err_code ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r); +enum ndr_err_code ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r); +void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS *r); +void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char *name, const struct netr_USER_PRIVATE_INFO *r); +void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_USER *r); +void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DOMAIN *r); +void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP *r); +void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *name, const struct netr_DELTA_RENAME *r); +void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP_MEMBER *r); +void ndr_print_netr_DELTA_ALIAS(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS *r); +void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS_MEMBER *r); +void ndr_print_netr_QUOTA_LIMITS(struct ndr_print *ndr, const char *name, const struct netr_QUOTA_LIMITS *r); +void ndr_print_netr_DELTA_POLICY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_POLICY *r); +void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_TRUSTED_DOMAIN *r); +void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_TRUST *r); +void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ACCOUNT *r); +void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_ACCOUNT *r); +void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_SECRET *r); +void ndr_print_netr_CIPHER_VALUE(struct ndr_print *ndr, const char *name, const struct netr_CIPHER_VALUE *r); +void ndr_print_netr_DELTA_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_SECRET *r); +void ndr_print_netr_DeltaEnum(struct ndr_print *ndr, const char *name, enum netr_DeltaEnum r); +void ndr_print_netr_DELTA_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_UNION *r); +void ndr_print_netr_DELTA_ID_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_ID_UNION *r); +void ndr_print_netr_DELTA_ENUM(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM *r); +void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM_ARRAY *r); +void ndr_print_netr_UAS_INFO_0(struct ndr_print *ndr, const char *name, const struct netr_UAS_INFO_0 *r); +void ndr_print_netr_AccountBuffer(struct ndr_print *ndr, const char *name, const struct netr_AccountBuffer *r); +void ndr_print_netr_InfoFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_1 *r); +void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_2 *r); +void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_3 *r); +void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_QUERY_INFORMATION *r); +void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char *name, enum netr_LogonControlCode r); +void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_DATA_INFORMATION *r); +void ndr_print_netr_NegotiateFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_ChangeLogFlags(struct ndr_print *ndr, const char *name, uint16_t r); +void ndr_print_netr_ChangeLogObject(struct ndr_print *ndr, const char *name, const union netr_ChangeLogObject *r); +enum ndr_err_code ndr_push_netr_ChangeLogEntry(struct ndr_push *ndr, int ndr_flags, const struct netr_ChangeLogEntry *r); +enum ndr_err_code ndr_pull_netr_ChangeLogEntry(struct ndr_pull *ndr, int ndr_flags, struct netr_ChangeLogEntry *r); +void ndr_print_netr_ChangeLogEntry(struct ndr_print *ndr, const char *name, const struct netr_ChangeLogEntry *r); +size_t ndr_size_netr_ChangeLogEntry(const struct netr_ChangeLogEntry *r, int flags); +void ndr_print_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r); +void ndr_print_netr_DsRGetDCName_flags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print *ndr, const char *name, enum netr_DsRGetDCNameInfo_AddressType r); +void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r); +enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r); +void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r); +void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r); +void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *name, const struct netr_DomainQuery1 *r); +void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name, const union netr_DomainQuery *r); +void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r); +void ndr_print_netr_trust_extension_container(struct ndr_print *ndr, const char *name, const struct netr_trust_extension_container *r); +void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustInfo *r); +void ndr_print_netr_LsaPolicyInfo(struct ndr_print *ndr, const char *name, const struct netr_LsaPolicyInfo *r); +enum ndr_err_code ndr_push_netr_WorkstationFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_netr_WorkstationFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_netr_WorkstationFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name, const struct netr_DomainInfo1 *r); +void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r); +void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r); +void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r); +void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r); +void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r); +void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r); +void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r); +void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r); +void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r); +void ndr_print_netr_TrustInfo(struct ndr_print *ndr, const char *name, const struct netr_TrustInfo *r); +void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogon *r); +void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogoff *r); +void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogon *r); +void ndr_print_netr_LogonSamLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogoff *r); +enum ndr_err_code ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags, const struct netr_ServerReqChallenge *r); +enum ndr_err_code ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, int flags, struct netr_ServerReqChallenge *r); +void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerReqChallenge *r); +void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate *r); +void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet *r); +void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseDeltas *r); +void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync *r); +void ndr_print_netr_AccountDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountDeltas *r); +void ndr_print_netr_AccountSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountSync *r); +void ndr_print_netr_GetDcName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetDcName *r); +void ndr_print_netr_LogonControl(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl *r); +void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetAnyDCName *r); +void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2 *r); +void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate2 *r); +void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync2 *r); +void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseRedo *r); +void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2Ex *r); +void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomains *r); +void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCName *r); +void ndr_print_netr_NETRLOGONDUMMYROUTINE1(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r); +void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r); +void ndr_print_netr_LogonGetTrustRid(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetTrustRid *r); +void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r); +void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r); +enum ndr_err_code ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate3 *r); +enum ndr_err_code ndr_pull_netr_ServerAuthenticate3(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate3 *r); +void ndr_print_netr_ServerAuthenticate3(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate3 *r); +void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx *r); +void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetSiteName *r); +void ndr_print_netr_LogonGetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetDomainInfo *r); +void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet2 *r); +void ndr_print_netr_ServerPasswordGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordGet *r); +void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSENDTOSAM *r); +void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesW *r); +void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx2 *r); +void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r); +void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r); +void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesExW *r); +void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrGetDcSiteCoverageW *r); +void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonEx *r); +void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrEnumerateDomainTrusts *r); +void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrDeregisterDNSHostRecords *r); +void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerTrustPasswordsGet *r); +void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r); +void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r); +void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonWithFlags *r); +void ndr_print_netr_ServerGetTrustInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerGetTrustInfo *r); +#endif /* _HEADER_NDR_netlogon */ diff --git a/librpc/gen_ndr/ndr_ntsvcs.c b/librpc/gen_ndr/ndr_ntsvcs.c new file mode 100644 index 0000000000..ced6fb7767 --- /dev/null +++ b/librpc/gen_ndr/ndr_ntsvcs.c @@ -0,0 +1,3890 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_ntsvcs.h" + +#include "librpc/gen_ndr/ndr_winreg.h" +static enum ndr_err_code ndr_push_PNP_HwProfInfo(struct ndr_push *ndr, int ndr_flags, const struct PNP_HwProfInfo *r) +{ + uint32_t cntr_friendly_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->profile_handle)); + for (cntr_friendly_name_0 = 0; cntr_friendly_name_0 < 80; cntr_friendly_name_0++) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->friendly_name[cntr_friendly_name_0])); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_HwProfInfo(struct ndr_pull *ndr, int ndr_flags, struct PNP_HwProfInfo *r) +{ + uint32_t cntr_friendly_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->profile_handle)); + for (cntr_friendly_name_0 = 0; cntr_friendly_name_0 < 80; cntr_friendly_name_0++) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->friendly_name[cntr_friendly_name_0])); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_HwProfInfo(struct ndr_print *ndr, const char *name, const struct PNP_HwProfInfo *r) +{ + uint32_t cntr_friendly_name_0; + ndr_print_struct(ndr, name, "PNP_HwProfInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "profile_handle", r->profile_handle); + ndr->print(ndr, "%s: ARRAY(%d)", "friendly_name", (int)80); + ndr->depth++; + for (cntr_friendly_name_0=0;cntr_friendly_name_0<80;cntr_friendly_name_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_friendly_name_0) != -1) { + ndr_print_uint16(ndr, "friendly_name", r->friendly_name[cntr_friendly_name_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_Disconnect(struct ndr_push *ndr, int flags, const struct PNP_Disconnect *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_Disconnect(struct ndr_pull *ndr, int flags, struct PNP_Disconnect *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_Disconnect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Disconnect *r) +{ + ndr_print_struct(ndr, name, "PNP_Disconnect"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_Disconnect"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_Disconnect"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_Connect(struct ndr_push *ndr, int flags, const struct PNP_Connect *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_Connect(struct ndr_pull *ndr, int flags, struct PNP_Connect *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_Connect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Connect *r) +{ + ndr_print_struct(ndr, name, "PNP_Connect"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_Connect"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_Connect"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetVersion(struct ndr_push *ndr, int flags, const struct PNP_GetVersion *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + if (r->out.version == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.version)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetVersion(struct ndr_pull *ndr, int flags, struct PNP_GetVersion *r) +{ + TALLOC_CTX *_mem_save_version_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_PULL_ALLOC(ndr, r->out.version); + ZERO_STRUCTP(r->out.version); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.version); + } + _mem_save_version_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.version, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.version)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersion *r) +{ + ndr_print_struct(ndr, name, "PNP_GetVersion"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetVersion"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetVersion"); + ndr->depth++; + ndr_print_ptr(ndr, "version", r->out.version); + ndr->depth++; + ndr_print_uint16(ndr, "version", *r->out.version); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetGlobalState(struct ndr_push *ndr, int flags, const struct PNP_GetGlobalState *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetGlobalState(struct ndr_pull *ndr, int flags, struct PNP_GetGlobalState *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetGlobalState(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetGlobalState *r) +{ + ndr_print_struct(ndr, name, "PNP_GetGlobalState"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetGlobalState"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetGlobalState"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_InitDetection(struct ndr_push *ndr, int flags, const struct PNP_InitDetection *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_InitDetection(struct ndr_pull *ndr, int flags, struct PNP_InitDetection *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_InitDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_InitDetection *r) +{ + ndr_print_struct(ndr, name, "PNP_InitDetection"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_InitDetection"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_InitDetection"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_ReportLogOn(struct ndr_push *ndr, int flags, const struct PNP_ReportLogOn *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_ReportLogOn(struct ndr_pull *ndr, int flags, struct PNP_ReportLogOn *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_ReportLogOn(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ReportLogOn *r) +{ + ndr_print_struct(ndr, name, "PNP_ReportLogOn"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_ReportLogOn"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_ReportLogOn"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_ValidateDeviceInstance(struct ndr_push *ndr, int flags, const struct PNP_ValidateDeviceInstance *r) +{ + if (flags & NDR_IN) { + if (r->in.devicepath == 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.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicepath, ndr_charset_length(r->in.devicepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_ValidateDeviceInstance(struct ndr_pull *ndr, int flags, struct PNP_ValidateDeviceInstance *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicepath)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicepath)); + if (ndr_get_array_length(ndr, &r->in.devicepath) > ndr_get_array_size(ndr, &r->in.devicepath)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.devicepath), ndr_get_array_length(ndr, &r->in.devicepath)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicepath, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_ValidateDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ValidateDeviceInstance *r) +{ + ndr_print_struct(ndr, name, "PNP_ValidateDeviceInstance"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_ValidateDeviceInstance"); + ndr->depth++; + ndr_print_ptr(ndr, "devicepath", r->in.devicepath); + ndr->depth++; + ndr_print_string(ndr, "devicepath", r->in.devicepath); + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_ValidateDeviceInstance"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetRootDeviceInstance(struct ndr_push *ndr, int flags, const struct PNP_GetRootDeviceInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetRootDeviceInstance(struct ndr_pull *ndr, int flags, struct PNP_GetRootDeviceInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetRootDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRootDeviceInstance *r) +{ + ndr_print_struct(ndr, name, "PNP_GetRootDeviceInstance"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetRootDeviceInstance"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetRootDeviceInstance"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetRelatedDeviceInstance(struct ndr_push *ndr, int flags, const struct PNP_GetRelatedDeviceInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetRelatedDeviceInstance(struct ndr_pull *ndr, int flags, struct PNP_GetRelatedDeviceInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetRelatedDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRelatedDeviceInstance *r) +{ + ndr_print_struct(ndr, name, "PNP_GetRelatedDeviceInstance"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetRelatedDeviceInstance"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetRelatedDeviceInstance"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_EnumerateSubKeys(struct ndr_push *ndr, int flags, const struct PNP_EnumerateSubKeys *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_EnumerateSubKeys(struct ndr_pull *ndr, int flags, struct PNP_EnumerateSubKeys *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_EnumerateSubKeys(struct ndr_print *ndr, const char *name, int flags, const struct PNP_EnumerateSubKeys *r) +{ + ndr_print_struct(ndr, name, "PNP_EnumerateSubKeys"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_EnumerateSubKeys"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_EnumerateSubKeys"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDeviceList(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceList *r) +{ + uint32_t cntr_buffer_1; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.filter)); + if (r->in.filter) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.filter, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.filter, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.filter, ndr_charset_length(r->in.filter, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->in.length == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); + for (cntr_buffer_1 = 0; cntr_buffer_1 < *r->out.length; cntr_buffer_1++) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.buffer[cntr_buffer_1])); + } + if (r->out.length == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDeviceList(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceList *r) +{ + uint32_t _ptr_filter; + uint32_t cntr_buffer_1; + TALLOC_CTX *_mem_save_filter_0; + TALLOC_CTX *_mem_save_buffer_1; + TALLOC_CTX *_mem_save_length_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_filter)); + if (_ptr_filter) { + NDR_PULL_ALLOC(ndr, r->in.filter); + } else { + r->in.filter = NULL; + } + if (r->in.filter) { + _mem_save_filter_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.filter, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.filter)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.filter)); + if (ndr_get_array_length(ndr, &r->in.filter) > ndr_get_array_size(ndr, &r->in.filter)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.filter), ndr_get_array_length(ndr, &r->in.filter)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.filter), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.filter, ndr_get_array_length(ndr, &r->in.filter), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filter_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.length); + } + _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.length, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC_N(ndr, r->out.buffer, *r->in.length); + memset(r->out.buffer, 0, (*r->in.length) * sizeof(*r->out.buffer)); + NDR_PULL_ALLOC(ndr, r->out.length); + *r->out.length = *r->in.length; + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->out.buffer)); + if (ndr_get_array_length(ndr, &r->out.buffer) > ndr_get_array_size(ndr, &r->out.buffer)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.buffer), ndr_get_array_length(ndr, &r->out.buffer)); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + } + _mem_save_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, 0); + for (cntr_buffer_1 = 0; cntr_buffer_1 < *r->out.length; cntr_buffer_1++) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.buffer[cntr_buffer_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_1, 0); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.length); + } + _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.length, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, *r->out.length)); + } + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.buffer, *r->out.length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceList *r) +{ + uint32_t cntr_buffer_1; + ndr_print_struct(ndr, name, "PNP_GetDeviceList"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDeviceList"); + ndr->depth++; + ndr_print_ptr(ndr, "filter", r->in.filter); + ndr->depth++; + if (r->in.filter) { + ndr_print_string(ndr, "filter", r->in.filter); + } + ndr->depth--; + ndr_print_ptr(ndr, "length", r->in.length); + ndr->depth++; + ndr_print_uint32(ndr, "length", *r->in.length); + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDeviceList"); + ndr->depth++; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr->print(ndr, "%s: ARRAY(%d)", "buffer", (int)*r->out.length); + ndr->depth++; + for (cntr_buffer_1=0;cntr_buffer_1<*r->out.length;cntr_buffer_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_buffer_1) != -1) { + ndr_print_uint16(ndr, "buffer", r->out.buffer[cntr_buffer_1]); + free(idx_1); + } + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "length", r->out.length); + ndr->depth++; + ndr_print_uint32(ndr, "length", *r->out.length); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDeviceListSize(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceListSize *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.devicename)); + if (r->in.devicename) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicename, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicename, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicename, ndr_charset_length(r->in.devicename, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDeviceListSize(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceListSize *r) +{ + uint32_t _ptr_devicename; + TALLOC_CTX *_mem_save_devicename_0; + TALLOC_CTX *_mem_save_size_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devicename)); + if (_ptr_devicename) { + NDR_PULL_ALLOC(ndr, r->in.devicename); + } else { + r->in.devicename = NULL; + } + if (r->in.devicename) { + _mem_save_devicename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.devicename, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicename)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicename)); + if (ndr_get_array_length(ndr, &r->in.devicename) > ndr_get_array_size(ndr, &r->in.devicename)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.devicename), ndr_get_array_length(ndr, &r->in.devicename)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicename), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicename, ndr_get_array_length(ndr, &r->in.devicename), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devicename_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.size); + ZERO_STRUCTP(r->out.size); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.size); + } + _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceListSize *r) +{ + ndr_print_struct(ndr, name, "PNP_GetDeviceListSize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDeviceListSize"); + ndr->depth++; + ndr_print_ptr(ndr, "devicename", r->in.devicename); + ndr->depth++; + if (r->in.devicename) { + ndr_print_string(ndr, "devicename", r->in.devicename); + } + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDeviceListSize"); + ndr->depth++; + ndr_print_ptr(ndr, "size", r->out.size); + ndr->depth++; + ndr_print_uint32(ndr, "size", *r->out.size); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDepth(struct ndr_push *ndr, int flags, const struct PNP_GetDepth *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDepth(struct ndr_pull *ndr, int flags, struct PNP_GetDepth *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDepth(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDepth *r) +{ + ndr_print_struct(ndr, name, "PNP_GetDepth"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDepth"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDepth"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDeviceRegProp(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceRegProp *r) +{ + if (flags & NDR_IN) { + if (r->in.devicepath == 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.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicepath, ndr_charset_length(r->in.devicepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.property)); + if (r->in.reg_data_type == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.reg_data_type)); + 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 (r->in.needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.needed)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.reg_data_type == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.reg_data_type)); + if (r->out.buffer == 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_uint32(ndr, NDR_SCALARS, 0)); + 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.buffer_size)); + if (r->out.needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDeviceRegProp(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceRegProp *r) +{ + TALLOC_CTX *_mem_save_reg_data_type_0; + TALLOC_CTX *_mem_save_buffer_size_0; + TALLOC_CTX *_mem_save_needed_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicepath)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicepath)); + if (ndr_get_array_length(ndr, &r->in.devicepath) > ndr_get_array_size(ndr, &r->in.devicepath)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.devicepath), ndr_get_array_length(ndr, &r->in.devicepath)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicepath, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.property)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.reg_data_type); + } + _mem_save_reg_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.reg_data_type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->in.reg_data_type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reg_data_type_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.buffer_size); + } + _mem_save_buffer_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.needed)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.reg_data_type); + *r->out.reg_data_type = *r->in.reg_data_type; + NDR_PULL_ALLOC_N(ndr, r->out.buffer, *r->in.buffer_size); + memset(r->out.buffer, 0, (*r->in.buffer_size) * sizeof(*r->out.buffer)); + NDR_PULL_ALLOC(ndr, r->out.buffer_size); + *r->out.buffer_size = *r->in.buffer_size; + NDR_PULL_ALLOC(ndr, r->out.needed); + *r->out.needed = *r->in.needed; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.reg_data_type); + } + _mem_save_reg_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.reg_data_type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.reg_data_type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reg_data_type_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->out.buffer)); + if (ndr_get_array_length(ndr, &r->out.buffer) > ndr_get_array_size(ndr, &r->out.buffer)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.buffer), ndr_get_array_length(ndr, &r->out.buffer)); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_length(ndr, &r->out.buffer))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.buffer_size); + } + _mem_save_buffer_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.buffer_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, *r->out.buffer_size)); + } + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.buffer, *r->out.buffer_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceRegProp *r) +{ + ndr_print_struct(ndr, name, "PNP_GetDeviceRegProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDeviceRegProp"); + ndr->depth++; + ndr_print_ptr(ndr, "devicepath", r->in.devicepath); + ndr->depth++; + ndr_print_string(ndr, "devicepath", r->in.devicepath); + ndr->depth--; + ndr_print_uint32(ndr, "property", r->in.property); + ndr_print_ptr(ndr, "reg_data_type", r->in.reg_data_type); + ndr->depth++; + ndr_print_winreg_Type(ndr, "reg_data_type", *r->in.reg_data_type); + ndr->depth--; + ndr_print_ptr(ndr, "buffer_size", r->in.buffer_size); + ndr->depth++; + ndr_print_uint32(ndr, "buffer_size", *r->in.buffer_size); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->in.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->in.needed); + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDeviceRegProp"); + ndr->depth++; + ndr_print_ptr(ndr, "reg_data_type", r->out.reg_data_type); + ndr->depth++; + ndr_print_winreg_Type(ndr, "reg_data_type", *r->out.reg_data_type); + ndr->depth--; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->out.buffer, *r->out.buffer_size); + ndr->depth--; + ndr_print_ptr(ndr, "buffer_size", r->out.buffer_size); + ndr->depth++; + ndr_print_uint32(ndr, "buffer_size", *r->out.buffer_size); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_SetDeviceRegProp(struct ndr_push *ndr, int flags, const struct PNP_SetDeviceRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_SetDeviceRegProp(struct ndr_pull *ndr, int flags, struct PNP_SetDeviceRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_SetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceRegProp *r) +{ + ndr_print_struct(ndr, name, "PNP_SetDeviceRegProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_SetDeviceRegProp"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_SetDeviceRegProp"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetClassInstance(struct ndr_push *ndr, int flags, const struct PNP_GetClassInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetClassInstance(struct ndr_pull *ndr, int flags, struct PNP_GetClassInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetClassInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassInstance *r) +{ + ndr_print_struct(ndr, name, "PNP_GetClassInstance"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetClassInstance"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetClassInstance"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_CreateKey(struct ndr_push *ndr, int flags, const struct PNP_CreateKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_CreateKey(struct ndr_pull *ndr, int flags, struct PNP_CreateKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateKey *r) +{ + ndr_print_struct(ndr, name, "PNP_CreateKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_CreateKey"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_CreateKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DeleteRegistryKey(struct ndr_push *ndr, int flags, const struct PNP_DeleteRegistryKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DeleteRegistryKey(struct ndr_pull *ndr, int flags, struct PNP_DeleteRegistryKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DeleteRegistryKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteRegistryKey *r) +{ + ndr_print_struct(ndr, name, "PNP_DeleteRegistryKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DeleteRegistryKey"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DeleteRegistryKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetClassCount(struct ndr_push *ndr, int flags, const struct PNP_GetClassCount *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetClassCount(struct ndr_pull *ndr, int flags, struct PNP_GetClassCount *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetClassCount(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassCount *r) +{ + ndr_print_struct(ndr, name, "PNP_GetClassCount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetClassCount"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetClassCount"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetClassName(struct ndr_push *ndr, int flags, const struct PNP_GetClassName *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetClassName(struct ndr_pull *ndr, int flags, struct PNP_GetClassName *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetClassName(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassName *r) +{ + ndr_print_struct(ndr, name, "PNP_GetClassName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetClassName"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetClassName"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DeleteClassKey(struct ndr_push *ndr, int flags, const struct PNP_DeleteClassKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DeleteClassKey(struct ndr_pull *ndr, int flags, struct PNP_DeleteClassKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DeleteClassKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteClassKey *r) +{ + ndr_print_struct(ndr, name, "PNP_DeleteClassKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DeleteClassKey"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DeleteClassKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetInterfaceDeviceAlias(struct ndr_push *ndr, int flags, const struct PNP_GetInterfaceDeviceAlias *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetInterfaceDeviceAlias(struct ndr_pull *ndr, int flags, struct PNP_GetInterfaceDeviceAlias *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetInterfaceDeviceAlias(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceAlias *r) +{ + ndr_print_struct(ndr, name, "PNP_GetInterfaceDeviceAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetInterfaceDeviceAlias"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetInterfaceDeviceAlias"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetInterfaceDeviceList(struct ndr_push *ndr, int flags, const struct PNP_GetInterfaceDeviceList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetInterfaceDeviceList(struct ndr_pull *ndr, int flags, struct PNP_GetInterfaceDeviceList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetInterfaceDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceList *r) +{ + ndr_print_struct(ndr, name, "PNP_GetInterfaceDeviceList"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetInterfaceDeviceList"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetInterfaceDeviceList"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetInterfaceDeviceListSize(struct ndr_push *ndr, int flags, const struct PNP_GetInterfaceDeviceListSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetInterfaceDeviceListSize(struct ndr_pull *ndr, int flags, struct PNP_GetInterfaceDeviceListSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetInterfaceDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceListSize *r) +{ + ndr_print_struct(ndr, name, "PNP_GetInterfaceDeviceListSize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetInterfaceDeviceListSize"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetInterfaceDeviceListSize"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RegisterDeviceClassAssociation(struct ndr_push *ndr, int flags, const struct PNP_RegisterDeviceClassAssociation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RegisterDeviceClassAssociation(struct ndr_pull *ndr, int flags, struct PNP_RegisterDeviceClassAssociation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RegisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDeviceClassAssociation *r) +{ + ndr_print_struct(ndr, name, "PNP_RegisterDeviceClassAssociation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RegisterDeviceClassAssociation"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RegisterDeviceClassAssociation"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_UnregisterDeviceClassAssociation(struct ndr_push *ndr, int flags, const struct PNP_UnregisterDeviceClassAssociation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_UnregisterDeviceClassAssociation(struct ndr_pull *ndr, int flags, struct PNP_UnregisterDeviceClassAssociation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_UnregisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterDeviceClassAssociation *r) +{ + ndr_print_struct(ndr, name, "PNP_UnregisterDeviceClassAssociation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_UnregisterDeviceClassAssociation"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_UnregisterDeviceClassAssociation"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetClassRegProp(struct ndr_push *ndr, int flags, const struct PNP_GetClassRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetClassRegProp(struct ndr_pull *ndr, int flags, struct PNP_GetClassRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassRegProp *r) +{ + ndr_print_struct(ndr, name, "PNP_GetClassRegProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetClassRegProp"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetClassRegProp"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_SetClassRegProp(struct ndr_push *ndr, int flags, const struct PNP_SetClassRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_SetClassRegProp(struct ndr_pull *ndr, int flags, struct PNP_SetClassRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_SetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetClassRegProp *r) +{ + ndr_print_struct(ndr, name, "PNP_SetClassRegProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_SetClassRegProp"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_SetClassRegProp"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_CreateDevInst(struct ndr_push *ndr, int flags, const struct PNP_CreateDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_CreateDevInst(struct ndr_pull *ndr, int flags, struct PNP_CreateDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_CreateDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateDevInst *r) +{ + ndr_print_struct(ndr, name, "PNP_CreateDevInst"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_CreateDevInst"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_CreateDevInst"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DeviceInstanceAction(struct ndr_push *ndr, int flags, const struct PNP_DeviceInstanceAction *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DeviceInstanceAction(struct ndr_pull *ndr, int flags, struct PNP_DeviceInstanceAction *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DeviceInstanceAction(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeviceInstanceAction *r) +{ + ndr_print_struct(ndr, name, "PNP_DeviceInstanceAction"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DeviceInstanceAction"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DeviceInstanceAction"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDeviceStatus(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceStatus *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDeviceStatus(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceStatus *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDeviceStatus(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceStatus *r) +{ + ndr_print_struct(ndr, name, "PNP_GetDeviceStatus"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDeviceStatus"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDeviceStatus"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_SetDeviceProblem(struct ndr_push *ndr, int flags, const struct PNP_SetDeviceProblem *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_SetDeviceProblem(struct ndr_pull *ndr, int flags, struct PNP_SetDeviceProblem *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_SetDeviceProblem(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceProblem *r) +{ + ndr_print_struct(ndr, name, "PNP_SetDeviceProblem"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_SetDeviceProblem"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_SetDeviceProblem"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DisableDevInst(struct ndr_push *ndr, int flags, const struct PNP_DisableDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DisableDevInst(struct ndr_pull *ndr, int flags, struct PNP_DisableDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DisableDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DisableDevInst *r) +{ + ndr_print_struct(ndr, name, "PNP_DisableDevInst"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DisableDevInst"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DisableDevInst"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_UninstallDevInst(struct ndr_push *ndr, int flags, const struct PNP_UninstallDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_UninstallDevInst(struct ndr_pull *ndr, int flags, struct PNP_UninstallDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_UninstallDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UninstallDevInst *r) +{ + ndr_print_struct(ndr, name, "PNP_UninstallDevInst"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_UninstallDevInst"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_UninstallDevInst"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_AddID(struct ndr_push *ndr, int flags, const struct PNP_AddID *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_AddID(struct ndr_pull *ndr, int flags, struct PNP_AddID *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_AddID(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddID *r) +{ + ndr_print_struct(ndr, name, "PNP_AddID"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_AddID"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_AddID"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RegisterDriver(struct ndr_push *ndr, int flags, const struct PNP_RegisterDriver *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RegisterDriver(struct ndr_pull *ndr, int flags, struct PNP_RegisterDriver *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RegisterDriver(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDriver *r) +{ + ndr_print_struct(ndr, name, "PNP_RegisterDriver"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RegisterDriver"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RegisterDriver"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_QueryRemove(struct ndr_push *ndr, int flags, const struct PNP_QueryRemove *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_QueryRemove(struct ndr_pull *ndr, int flags, struct PNP_QueryRemove *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_QueryRemove(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryRemove *r) +{ + ndr_print_struct(ndr, name, "PNP_QueryRemove"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_QueryRemove"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_QueryRemove"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RequestDeviceEject(struct ndr_push *ndr, int flags, const struct PNP_RequestDeviceEject *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RequestDeviceEject(struct ndr_pull *ndr, int flags, struct PNP_RequestDeviceEject *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RequestDeviceEject(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestDeviceEject *r) +{ + ndr_print_struct(ndr, name, "PNP_RequestDeviceEject"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RequestDeviceEject"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RequestDeviceEject"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_IsDockStationPresent(struct ndr_push *ndr, int flags, const struct PNP_IsDockStationPresent *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_IsDockStationPresent(struct ndr_pull *ndr, int flags, struct PNP_IsDockStationPresent *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_IsDockStationPresent(struct ndr_print *ndr, const char *name, int flags, const struct PNP_IsDockStationPresent *r) +{ + ndr_print_struct(ndr, name, "PNP_IsDockStationPresent"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_IsDockStationPresent"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_IsDockStationPresent"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RequestEjectPC(struct ndr_push *ndr, int flags, const struct PNP_RequestEjectPC *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RequestEjectPC(struct ndr_pull *ndr, int flags, struct PNP_RequestEjectPC *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RequestEjectPC(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestEjectPC *r) +{ + ndr_print_struct(ndr, name, "PNP_RequestEjectPC"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RequestEjectPC"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RequestEjectPC"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_HwProfFlags(struct ndr_push *ndr, int flags, const struct PNP_HwProfFlags *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.action)); + if (r->in.devicepath == 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.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicepath, ndr_charset_length(r->in.devicepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.config)); + if (r->in.profile_flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.profile_flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.veto_type)); + if (r->in.veto_type) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.veto_type)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown5)); + if (r->in.unknown5) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown5, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown5, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown5, ndr_charset_length(r->in.unknown5, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.name_length)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.profile_flags == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.profile_flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.veto_type)); + if (r->out.veto_type) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.veto_type)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.unknown5a)); + if (r->out.unknown5a) { + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.unknown5a)); + if (*r->out.unknown5a) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.unknown5a, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.unknown5a, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.unknown5a, ndr_charset_length(*r->out.unknown5a, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_HwProfFlags(struct ndr_pull *ndr, int flags, struct PNP_HwProfFlags *r) +{ + uint32_t _ptr_veto_type; + uint32_t _ptr_unknown5; + uint32_t _ptr_unknown5a; + TALLOC_CTX *_mem_save_profile_flags_0; + TALLOC_CTX *_mem_save_veto_type_0; + TALLOC_CTX *_mem_save_unknown5_0; + TALLOC_CTX *_mem_save_unknown5a_0; + TALLOC_CTX *_mem_save_unknown5a_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.action)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicepath)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicepath)); + if (ndr_get_array_length(ndr, &r->in.devicepath) > ndr_get_array_size(ndr, &r->in.devicepath)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.devicepath), ndr_get_array_length(ndr, &r->in.devicepath)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicepath, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.config)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.profile_flags); + } + _mem_save_profile_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.profile_flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.profile_flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_profile_flags_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_veto_type)); + if (_ptr_veto_type) { + NDR_PULL_ALLOC(ndr, r->in.veto_type); + } else { + r->in.veto_type = NULL; + } + if (r->in.veto_type) { + _mem_save_veto_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.veto_type, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.veto_type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_veto_type_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown5)); + if (_ptr_unknown5) { + NDR_PULL_ALLOC(ndr, r->in.unknown5); + } else { + r->in.unknown5 = NULL; + } + if (r->in.unknown5) { + _mem_save_unknown5_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown5, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown5)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown5)); + if (ndr_get_array_length(ndr, &r->in.unknown5) > ndr_get_array_size(ndr, &r->in.unknown5)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown5), ndr_get_array_length(ndr, &r->in.unknown5)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown5), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown5, ndr_get_array_length(ndr, &r->in.unknown5), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown5_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.name_length)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.profile_flags); + *r->out.profile_flags = *r->in.profile_flags; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.profile_flags); + } + _mem_save_profile_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.profile_flags, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.profile_flags)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_profile_flags_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_veto_type)); + if (_ptr_veto_type) { + NDR_PULL_ALLOC(ndr, r->out.veto_type); + } else { + r->out.veto_type = NULL; + } + if (r->out.veto_type) { + _mem_save_veto_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.veto_type, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.veto_type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_veto_type_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown5a)); + if (_ptr_unknown5a) { + NDR_PULL_ALLOC(ndr, r->out.unknown5a); + } else { + r->out.unknown5a = NULL; + } + if (r->out.unknown5a) { + _mem_save_unknown5a_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown5a, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown5a)); + if (_ptr_unknown5a) { + NDR_PULL_ALLOC(ndr, *r->out.unknown5a); + } else { + *r->out.unknown5a = NULL; + } + if (*r->out.unknown5a) { + _mem_save_unknown5a_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.unknown5a, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.unknown5a)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.unknown5a)); + if (ndr_get_array_length(ndr, r->out.unknown5a) > ndr_get_array_size(ndr, r->out.unknown5a)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.unknown5a), ndr_get_array_length(ndr, r->out.unknown5a)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.unknown5a), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.unknown5a, ndr_get_array_length(ndr, r->out.unknown5a), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown5a_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown5a_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_HwProfFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_HwProfFlags *r) +{ + ndr_print_struct(ndr, name, "PNP_HwProfFlags"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_HwProfFlags"); + ndr->depth++; + ndr_print_uint32(ndr, "action", r->in.action); + ndr_print_ptr(ndr, "devicepath", r->in.devicepath); + ndr->depth++; + ndr_print_string(ndr, "devicepath", r->in.devicepath); + ndr->depth--; + ndr_print_uint32(ndr, "config", r->in.config); + ndr_print_ptr(ndr, "profile_flags", r->in.profile_flags); + ndr->depth++; + ndr_print_uint32(ndr, "profile_flags", *r->in.profile_flags); + ndr->depth--; + ndr_print_ptr(ndr, "veto_type", r->in.veto_type); + ndr->depth++; + if (r->in.veto_type) { + ndr_print_uint16(ndr, "veto_type", *r->in.veto_type); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown5", r->in.unknown5); + ndr->depth++; + if (r->in.unknown5) { + ndr_print_string(ndr, "unknown5", r->in.unknown5); + } + ndr->depth--; + ndr_print_uint32(ndr, "name_length", r->in.name_length); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_HwProfFlags"); + ndr->depth++; + ndr_print_ptr(ndr, "profile_flags", r->out.profile_flags); + ndr->depth++; + ndr_print_uint32(ndr, "profile_flags", *r->out.profile_flags); + ndr->depth--; + ndr_print_ptr(ndr, "veto_type", r->out.veto_type); + ndr->depth++; + if (r->out.veto_type) { + ndr_print_uint16(ndr, "veto_type", *r->out.veto_type); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown5a", r->out.unknown5a); + ndr->depth++; + if (r->out.unknown5a) { + ndr_print_ptr(ndr, "unknown5a", *r->out.unknown5a); + ndr->depth++; + if (*r->out.unknown5a) { + ndr_print_string(ndr, "unknown5a", *r->out.unknown5a); + } + ndr->depth--; + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetHwProfInfo(struct ndr_push *ndr, int flags, const struct PNP_GetHwProfInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.idx)); + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_PNP_HwProfInfo(ndr, NDR_SCALARS, r->in.info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_PNP_HwProfInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetHwProfInfo(struct ndr_pull *ndr, int flags, struct PNP_GetHwProfInfo *r) +{ + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.idx)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_PNP_HwProfInfo(ndr, NDR_SCALARS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.info); + *r->out.info = *r->in.info; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_PNP_HwProfInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetHwProfInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetHwProfInfo *r) +{ + ndr_print_struct(ndr, name, "PNP_GetHwProfInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetHwProfInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->in.idx); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_PNP_HwProfInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_uint32(ndr, "size", r->in.size); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetHwProfInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_PNP_HwProfInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_AddEmptyLogConf(struct ndr_push *ndr, int flags, const struct PNP_AddEmptyLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_AddEmptyLogConf(struct ndr_pull *ndr, int flags, struct PNP_AddEmptyLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_AddEmptyLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddEmptyLogConf *r) +{ + ndr_print_struct(ndr, name, "PNP_AddEmptyLogConf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_AddEmptyLogConf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_AddEmptyLogConf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_FreeLogConf(struct ndr_push *ndr, int flags, const struct PNP_FreeLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_FreeLogConf(struct ndr_pull *ndr, int flags, struct PNP_FreeLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_FreeLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeLogConf *r) +{ + ndr_print_struct(ndr, name, "PNP_FreeLogConf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_FreeLogConf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_FreeLogConf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetFirstLogConf(struct ndr_push *ndr, int flags, const struct PNP_GetFirstLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetFirstLogConf(struct ndr_pull *ndr, int flags, struct PNP_GetFirstLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetFirstLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetFirstLogConf *r) +{ + ndr_print_struct(ndr, name, "PNP_GetFirstLogConf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetFirstLogConf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetFirstLogConf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetNextLogConf(struct ndr_push *ndr, int flags, const struct PNP_GetNextLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetNextLogConf(struct ndr_pull *ndr, int flags, struct PNP_GetNextLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetNextLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextLogConf *r) +{ + ndr_print_struct(ndr, name, "PNP_GetNextLogConf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetNextLogConf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetNextLogConf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetLogConfPriority(struct ndr_push *ndr, int flags, const struct PNP_GetLogConfPriority *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetLogConfPriority(struct ndr_pull *ndr, int flags, struct PNP_GetLogConfPriority *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetLogConfPriority(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetLogConfPriority *r) +{ + ndr_print_struct(ndr, name, "PNP_GetLogConfPriority"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetLogConfPriority"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetLogConfPriority"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_AddResDes(struct ndr_push *ndr, int flags, const struct PNP_AddResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_AddResDes(struct ndr_pull *ndr, int flags, struct PNP_AddResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_AddResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddResDes *r) +{ + ndr_print_struct(ndr, name, "PNP_AddResDes"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_AddResDes"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_AddResDes"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_FreeResDes(struct ndr_push *ndr, int flags, const struct PNP_FreeResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_FreeResDes(struct ndr_pull *ndr, int flags, struct PNP_FreeResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_FreeResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeResDes *r) +{ + ndr_print_struct(ndr, name, "PNP_FreeResDes"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_FreeResDes"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_FreeResDes"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetNextResDes(struct ndr_push *ndr, int flags, const struct PNP_GetNextResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetNextResDes(struct ndr_pull *ndr, int flags, struct PNP_GetNextResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetNextResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextResDes *r) +{ + ndr_print_struct(ndr, name, "PNP_GetNextResDes"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetNextResDes"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetNextResDes"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetResDesData(struct ndr_push *ndr, int flags, const struct PNP_GetResDesData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetResDesData(struct ndr_pull *ndr, int flags, struct PNP_GetResDesData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetResDesData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesData *r) +{ + ndr_print_struct(ndr, name, "PNP_GetResDesData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetResDesData"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetResDesData"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetResDesDataSize(struct ndr_push *ndr, int flags, const struct PNP_GetResDesDataSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetResDesDataSize(struct ndr_pull *ndr, int flags, struct PNP_GetResDesDataSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetResDesDataSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesDataSize *r) +{ + ndr_print_struct(ndr, name, "PNP_GetResDesDataSize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetResDesDataSize"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetResDesDataSize"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_ModifyResDes(struct ndr_push *ndr, int flags, const struct PNP_ModifyResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_ModifyResDes(struct ndr_pull *ndr, int flags, struct PNP_ModifyResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_ModifyResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ModifyResDes *r) +{ + ndr_print_struct(ndr, name, "PNP_ModifyResDes"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_ModifyResDes"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_ModifyResDes"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DetectResourceLimit(struct ndr_push *ndr, int flags, const struct PNP_DetectResourceLimit *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DetectResourceLimit(struct ndr_pull *ndr, int flags, struct PNP_DetectResourceLimit *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DetectResourceLimit(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DetectResourceLimit *r) +{ + ndr_print_struct(ndr, name, "PNP_DetectResourceLimit"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DetectResourceLimit"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DetectResourceLimit"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_QueryResConfList(struct ndr_push *ndr, int flags, const struct PNP_QueryResConfList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_QueryResConfList(struct ndr_pull *ndr, int flags, struct PNP_QueryResConfList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_QueryResConfList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryResConfList *r) +{ + ndr_print_struct(ndr, name, "PNP_QueryResConfList"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_QueryResConfList"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_QueryResConfList"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_SetHwProf(struct ndr_push *ndr, int flags, const struct PNP_SetHwProf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_SetHwProf(struct ndr_pull *ndr, int flags, struct PNP_SetHwProf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_SetHwProf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetHwProf *r) +{ + ndr_print_struct(ndr, name, "PNP_SetHwProf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_SetHwProf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_SetHwProf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_QueryArbitratorFreeData(struct ndr_push *ndr, int flags, const struct PNP_QueryArbitratorFreeData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_QueryArbitratorFreeData(struct ndr_pull *ndr, int flags, struct PNP_QueryArbitratorFreeData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_QueryArbitratorFreeData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeData *r) +{ + ndr_print_struct(ndr, name, "PNP_QueryArbitratorFreeData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_QueryArbitratorFreeData"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_QueryArbitratorFreeData"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_QueryArbitratorFreeSize(struct ndr_push *ndr, int flags, const struct PNP_QueryArbitratorFreeSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_QueryArbitratorFreeSize(struct ndr_pull *ndr, int flags, struct PNP_QueryArbitratorFreeSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_QueryArbitratorFreeSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeSize *r) +{ + ndr_print_struct(ndr, name, "PNP_QueryArbitratorFreeSize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_QueryArbitratorFreeSize"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_QueryArbitratorFreeSize"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RunDetection(struct ndr_push *ndr, int flags, const struct PNP_RunDetection *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RunDetection(struct ndr_pull *ndr, int flags, struct PNP_RunDetection *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RunDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RunDetection *r) +{ + ndr_print_struct(ndr, name, "PNP_RunDetection"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RunDetection"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RunDetection"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RegisterNotification(struct ndr_push *ndr, int flags, const struct PNP_RegisterNotification *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RegisterNotification(struct ndr_pull *ndr, int flags, struct PNP_RegisterNotification *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RegisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterNotification *r) +{ + ndr_print_struct(ndr, name, "PNP_RegisterNotification"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RegisterNotification"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RegisterNotification"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_UnregisterNotification(struct ndr_push *ndr, int flags, const struct PNP_UnregisterNotification *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_UnregisterNotification(struct ndr_pull *ndr, int flags, struct PNP_UnregisterNotification *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_UnregisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterNotification *r) +{ + ndr_print_struct(ndr, name, "PNP_UnregisterNotification"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_UnregisterNotification"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_UnregisterNotification"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetCustomDevProp(struct ndr_push *ndr, int flags, const struct PNP_GetCustomDevProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetCustomDevProp(struct ndr_pull *ndr, int flags, struct PNP_GetCustomDevProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetCustomDevProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetCustomDevProp *r) +{ + ndr_print_struct(ndr, name, "PNP_GetCustomDevProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetCustomDevProp"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetCustomDevProp"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetVersionInternal(struct ndr_push *ndr, int flags, const struct PNP_GetVersionInternal *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetVersionInternal(struct ndr_pull *ndr, int flags, struct PNP_GetVersionInternal *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetVersionInternal(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersionInternal *r) +{ + ndr_print_struct(ndr, name, "PNP_GetVersionInternal"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetVersionInternal"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetVersionInternal"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetBlockedDriverInfo(struct ndr_push *ndr, int flags, const struct PNP_GetBlockedDriverInfo *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetBlockedDriverInfo(struct ndr_pull *ndr, int flags, struct PNP_GetBlockedDriverInfo *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetBlockedDriverInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetBlockedDriverInfo *r) +{ + ndr_print_struct(ndr, name, "PNP_GetBlockedDriverInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetBlockedDriverInfo"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetBlockedDriverInfo"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetServerSideDeviceInstallFlags(struct ndr_push *ndr, int flags, const struct PNP_GetServerSideDeviceInstallFlags *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetServerSideDeviceInstallFlags(struct ndr_pull *ndr, int flags, struct PNP_GetServerSideDeviceInstallFlags *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetServerSideDeviceInstallFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetServerSideDeviceInstallFlags *r) +{ + ndr_print_struct(ndr, name, "PNP_GetServerSideDeviceInstallFlags"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetServerSideDeviceInstallFlags"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetServerSideDeviceInstallFlags"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call ntsvcs_calls[] = { + { + "PNP_Disconnect", + sizeof(struct PNP_Disconnect), + (ndr_push_flags_fn_t) ndr_push_PNP_Disconnect, + (ndr_pull_flags_fn_t) ndr_pull_PNP_Disconnect, + (ndr_print_function_t) ndr_print_PNP_Disconnect, + false, + }, + { + "PNP_Connect", + sizeof(struct PNP_Connect), + (ndr_push_flags_fn_t) ndr_push_PNP_Connect, + (ndr_pull_flags_fn_t) ndr_pull_PNP_Connect, + (ndr_print_function_t) ndr_print_PNP_Connect, + false, + }, + { + "PNP_GetVersion", + sizeof(struct PNP_GetVersion), + (ndr_push_flags_fn_t) ndr_push_PNP_GetVersion, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetVersion, + (ndr_print_function_t) ndr_print_PNP_GetVersion, + false, + }, + { + "PNP_GetGlobalState", + sizeof(struct PNP_GetGlobalState), + (ndr_push_flags_fn_t) ndr_push_PNP_GetGlobalState, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetGlobalState, + (ndr_print_function_t) ndr_print_PNP_GetGlobalState, + false, + }, + { + "PNP_InitDetection", + sizeof(struct PNP_InitDetection), + (ndr_push_flags_fn_t) ndr_push_PNP_InitDetection, + (ndr_pull_flags_fn_t) ndr_pull_PNP_InitDetection, + (ndr_print_function_t) ndr_print_PNP_InitDetection, + false, + }, + { + "PNP_ReportLogOn", + sizeof(struct PNP_ReportLogOn), + (ndr_push_flags_fn_t) ndr_push_PNP_ReportLogOn, + (ndr_pull_flags_fn_t) ndr_pull_PNP_ReportLogOn, + (ndr_print_function_t) ndr_print_PNP_ReportLogOn, + false, + }, + { + "PNP_ValidateDeviceInstance", + sizeof(struct PNP_ValidateDeviceInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_ValidateDeviceInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_ValidateDeviceInstance, + (ndr_print_function_t) ndr_print_PNP_ValidateDeviceInstance, + false, + }, + { + "PNP_GetRootDeviceInstance", + sizeof(struct PNP_GetRootDeviceInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_GetRootDeviceInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetRootDeviceInstance, + (ndr_print_function_t) ndr_print_PNP_GetRootDeviceInstance, + false, + }, + { + "PNP_GetRelatedDeviceInstance", + sizeof(struct PNP_GetRelatedDeviceInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_GetRelatedDeviceInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetRelatedDeviceInstance, + (ndr_print_function_t) ndr_print_PNP_GetRelatedDeviceInstance, + false, + }, + { + "PNP_EnumerateSubKeys", + sizeof(struct PNP_EnumerateSubKeys), + (ndr_push_flags_fn_t) ndr_push_PNP_EnumerateSubKeys, + (ndr_pull_flags_fn_t) ndr_pull_PNP_EnumerateSubKeys, + (ndr_print_function_t) ndr_print_PNP_EnumerateSubKeys, + false, + }, + { + "PNP_GetDeviceList", + sizeof(struct PNP_GetDeviceList), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceList, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceList, + (ndr_print_function_t) ndr_print_PNP_GetDeviceList, + false, + }, + { + "PNP_GetDeviceListSize", + sizeof(struct PNP_GetDeviceListSize), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceListSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceListSize, + (ndr_print_function_t) ndr_print_PNP_GetDeviceListSize, + false, + }, + { + "PNP_GetDepth", + sizeof(struct PNP_GetDepth), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDepth, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDepth, + (ndr_print_function_t) ndr_print_PNP_GetDepth, + false, + }, + { + "PNP_GetDeviceRegProp", + sizeof(struct PNP_GetDeviceRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceRegProp, + (ndr_print_function_t) ndr_print_PNP_GetDeviceRegProp, + false, + }, + { + "PNP_SetDeviceRegProp", + sizeof(struct PNP_SetDeviceRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_SetDeviceRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetDeviceRegProp, + (ndr_print_function_t) ndr_print_PNP_SetDeviceRegProp, + false, + }, + { + "PNP_GetClassInstance", + sizeof(struct PNP_GetClassInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassInstance, + (ndr_print_function_t) ndr_print_PNP_GetClassInstance, + false, + }, + { + "PNP_CreateKey", + sizeof(struct PNP_CreateKey), + (ndr_push_flags_fn_t) ndr_push_PNP_CreateKey, + (ndr_pull_flags_fn_t) ndr_pull_PNP_CreateKey, + (ndr_print_function_t) ndr_print_PNP_CreateKey, + false, + }, + { + "PNP_DeleteRegistryKey", + sizeof(struct PNP_DeleteRegistryKey), + (ndr_push_flags_fn_t) ndr_push_PNP_DeleteRegistryKey, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DeleteRegistryKey, + (ndr_print_function_t) ndr_print_PNP_DeleteRegistryKey, + false, + }, + { + "PNP_GetClassCount", + sizeof(struct PNP_GetClassCount), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassCount, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassCount, + (ndr_print_function_t) ndr_print_PNP_GetClassCount, + false, + }, + { + "PNP_GetClassName", + sizeof(struct PNP_GetClassName), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassName, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassName, + (ndr_print_function_t) ndr_print_PNP_GetClassName, + false, + }, + { + "PNP_DeleteClassKey", + sizeof(struct PNP_DeleteClassKey), + (ndr_push_flags_fn_t) ndr_push_PNP_DeleteClassKey, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DeleteClassKey, + (ndr_print_function_t) ndr_print_PNP_DeleteClassKey, + false, + }, + { + "PNP_GetInterfaceDeviceAlias", + sizeof(struct PNP_GetInterfaceDeviceAlias), + (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceAlias, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceAlias, + (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceAlias, + false, + }, + { + "PNP_GetInterfaceDeviceList", + sizeof(struct PNP_GetInterfaceDeviceList), + (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceList, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceList, + (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceList, + false, + }, + { + "PNP_GetInterfaceDeviceListSize", + sizeof(struct PNP_GetInterfaceDeviceListSize), + (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceListSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceListSize, + (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceListSize, + false, + }, + { + "PNP_RegisterDeviceClassAssociation", + sizeof(struct PNP_RegisterDeviceClassAssociation), + (ndr_push_flags_fn_t) ndr_push_PNP_RegisterDeviceClassAssociation, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterDeviceClassAssociation, + (ndr_print_function_t) ndr_print_PNP_RegisterDeviceClassAssociation, + false, + }, + { + "PNP_UnregisterDeviceClassAssociation", + sizeof(struct PNP_UnregisterDeviceClassAssociation), + (ndr_push_flags_fn_t) ndr_push_PNP_UnregisterDeviceClassAssociation, + (ndr_pull_flags_fn_t) ndr_pull_PNP_UnregisterDeviceClassAssociation, + (ndr_print_function_t) ndr_print_PNP_UnregisterDeviceClassAssociation, + false, + }, + { + "PNP_GetClassRegProp", + sizeof(struct PNP_GetClassRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassRegProp, + (ndr_print_function_t) ndr_print_PNP_GetClassRegProp, + false, + }, + { + "PNP_SetClassRegProp", + sizeof(struct PNP_SetClassRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_SetClassRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetClassRegProp, + (ndr_print_function_t) ndr_print_PNP_SetClassRegProp, + false, + }, + { + "PNP_CreateDevInst", + sizeof(struct PNP_CreateDevInst), + (ndr_push_flags_fn_t) ndr_push_PNP_CreateDevInst, + (ndr_pull_flags_fn_t) ndr_pull_PNP_CreateDevInst, + (ndr_print_function_t) ndr_print_PNP_CreateDevInst, + false, + }, + { + "PNP_DeviceInstanceAction", + sizeof(struct PNP_DeviceInstanceAction), + (ndr_push_flags_fn_t) ndr_push_PNP_DeviceInstanceAction, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DeviceInstanceAction, + (ndr_print_function_t) ndr_print_PNP_DeviceInstanceAction, + false, + }, + { + "PNP_GetDeviceStatus", + sizeof(struct PNP_GetDeviceStatus), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceStatus, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceStatus, + (ndr_print_function_t) ndr_print_PNP_GetDeviceStatus, + false, + }, + { + "PNP_SetDeviceProblem", + sizeof(struct PNP_SetDeviceProblem), + (ndr_push_flags_fn_t) ndr_push_PNP_SetDeviceProblem, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetDeviceProblem, + (ndr_print_function_t) ndr_print_PNP_SetDeviceProblem, + false, + }, + { + "PNP_DisableDevInst", + sizeof(struct PNP_DisableDevInst), + (ndr_push_flags_fn_t) ndr_push_PNP_DisableDevInst, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DisableDevInst, + (ndr_print_function_t) ndr_print_PNP_DisableDevInst, + false, + }, + { + "PNP_UninstallDevInst", + sizeof(struct PNP_UninstallDevInst), + (ndr_push_flags_fn_t) ndr_push_PNP_UninstallDevInst, + (ndr_pull_flags_fn_t) ndr_pull_PNP_UninstallDevInst, + (ndr_print_function_t) ndr_print_PNP_UninstallDevInst, + false, + }, + { + "PNP_AddID", + sizeof(struct PNP_AddID), + (ndr_push_flags_fn_t) ndr_push_PNP_AddID, + (ndr_pull_flags_fn_t) ndr_pull_PNP_AddID, + (ndr_print_function_t) ndr_print_PNP_AddID, + false, + }, + { + "PNP_RegisterDriver", + sizeof(struct PNP_RegisterDriver), + (ndr_push_flags_fn_t) ndr_push_PNP_RegisterDriver, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterDriver, + (ndr_print_function_t) ndr_print_PNP_RegisterDriver, + false, + }, + { + "PNP_QueryRemove", + sizeof(struct PNP_QueryRemove), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryRemove, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryRemove, + (ndr_print_function_t) ndr_print_PNP_QueryRemove, + false, + }, + { + "PNP_RequestDeviceEject", + sizeof(struct PNP_RequestDeviceEject), + (ndr_push_flags_fn_t) ndr_push_PNP_RequestDeviceEject, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RequestDeviceEject, + (ndr_print_function_t) ndr_print_PNP_RequestDeviceEject, + false, + }, + { + "PNP_IsDockStationPresent", + sizeof(struct PNP_IsDockStationPresent), + (ndr_push_flags_fn_t) ndr_push_PNP_IsDockStationPresent, + (ndr_pull_flags_fn_t) ndr_pull_PNP_IsDockStationPresent, + (ndr_print_function_t) ndr_print_PNP_IsDockStationPresent, + false, + }, + { + "PNP_RequestEjectPC", + sizeof(struct PNP_RequestEjectPC), + (ndr_push_flags_fn_t) ndr_push_PNP_RequestEjectPC, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RequestEjectPC, + (ndr_print_function_t) ndr_print_PNP_RequestEjectPC, + false, + }, + { + "PNP_HwProfFlags", + sizeof(struct PNP_HwProfFlags), + (ndr_push_flags_fn_t) ndr_push_PNP_HwProfFlags, + (ndr_pull_flags_fn_t) ndr_pull_PNP_HwProfFlags, + (ndr_print_function_t) ndr_print_PNP_HwProfFlags, + false, + }, + { + "PNP_GetHwProfInfo", + sizeof(struct PNP_GetHwProfInfo), + (ndr_push_flags_fn_t) ndr_push_PNP_GetHwProfInfo, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetHwProfInfo, + (ndr_print_function_t) ndr_print_PNP_GetHwProfInfo, + false, + }, + { + "PNP_AddEmptyLogConf", + sizeof(struct PNP_AddEmptyLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_AddEmptyLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_AddEmptyLogConf, + (ndr_print_function_t) ndr_print_PNP_AddEmptyLogConf, + false, + }, + { + "PNP_FreeLogConf", + sizeof(struct PNP_FreeLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_FreeLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_FreeLogConf, + (ndr_print_function_t) ndr_print_PNP_FreeLogConf, + false, + }, + { + "PNP_GetFirstLogConf", + sizeof(struct PNP_GetFirstLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_GetFirstLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetFirstLogConf, + (ndr_print_function_t) ndr_print_PNP_GetFirstLogConf, + false, + }, + { + "PNP_GetNextLogConf", + sizeof(struct PNP_GetNextLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_GetNextLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetNextLogConf, + (ndr_print_function_t) ndr_print_PNP_GetNextLogConf, + false, + }, + { + "PNP_GetLogConfPriority", + sizeof(struct PNP_GetLogConfPriority), + (ndr_push_flags_fn_t) ndr_push_PNP_GetLogConfPriority, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetLogConfPriority, + (ndr_print_function_t) ndr_print_PNP_GetLogConfPriority, + false, + }, + { + "PNP_AddResDes", + sizeof(struct PNP_AddResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_AddResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_AddResDes, + (ndr_print_function_t) ndr_print_PNP_AddResDes, + false, + }, + { + "PNP_FreeResDes", + sizeof(struct PNP_FreeResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_FreeResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_FreeResDes, + (ndr_print_function_t) ndr_print_PNP_FreeResDes, + false, + }, + { + "PNP_GetNextResDes", + sizeof(struct PNP_GetNextResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_GetNextResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetNextResDes, + (ndr_print_function_t) ndr_print_PNP_GetNextResDes, + false, + }, + { + "PNP_GetResDesData", + sizeof(struct PNP_GetResDesData), + (ndr_push_flags_fn_t) ndr_push_PNP_GetResDesData, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetResDesData, + (ndr_print_function_t) ndr_print_PNP_GetResDesData, + false, + }, + { + "PNP_GetResDesDataSize", + sizeof(struct PNP_GetResDesDataSize), + (ndr_push_flags_fn_t) ndr_push_PNP_GetResDesDataSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetResDesDataSize, + (ndr_print_function_t) ndr_print_PNP_GetResDesDataSize, + false, + }, + { + "PNP_ModifyResDes", + sizeof(struct PNP_ModifyResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_ModifyResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_ModifyResDes, + (ndr_print_function_t) ndr_print_PNP_ModifyResDes, + false, + }, + { + "PNP_DetectResourceLimit", + sizeof(struct PNP_DetectResourceLimit), + (ndr_push_flags_fn_t) ndr_push_PNP_DetectResourceLimit, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DetectResourceLimit, + (ndr_print_function_t) ndr_print_PNP_DetectResourceLimit, + false, + }, + { + "PNP_QueryResConfList", + sizeof(struct PNP_QueryResConfList), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryResConfList, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryResConfList, + (ndr_print_function_t) ndr_print_PNP_QueryResConfList, + false, + }, + { + "PNP_SetHwProf", + sizeof(struct PNP_SetHwProf), + (ndr_push_flags_fn_t) ndr_push_PNP_SetHwProf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetHwProf, + (ndr_print_function_t) ndr_print_PNP_SetHwProf, + false, + }, + { + "PNP_QueryArbitratorFreeData", + sizeof(struct PNP_QueryArbitratorFreeData), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryArbitratorFreeData, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryArbitratorFreeData, + (ndr_print_function_t) ndr_print_PNP_QueryArbitratorFreeData, + false, + }, + { + "PNP_QueryArbitratorFreeSize", + sizeof(struct PNP_QueryArbitratorFreeSize), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryArbitratorFreeSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryArbitratorFreeSize, + (ndr_print_function_t) ndr_print_PNP_QueryArbitratorFreeSize, + false, + }, + { + "PNP_RunDetection", + sizeof(struct PNP_RunDetection), + (ndr_push_flags_fn_t) ndr_push_PNP_RunDetection, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RunDetection, + (ndr_print_function_t) ndr_print_PNP_RunDetection, + false, + }, + { + "PNP_RegisterNotification", + sizeof(struct PNP_RegisterNotification), + (ndr_push_flags_fn_t) ndr_push_PNP_RegisterNotification, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterNotification, + (ndr_print_function_t) ndr_print_PNP_RegisterNotification, + false, + }, + { + "PNP_UnregisterNotification", + sizeof(struct PNP_UnregisterNotification), + (ndr_push_flags_fn_t) ndr_push_PNP_UnregisterNotification, + (ndr_pull_flags_fn_t) ndr_pull_PNP_UnregisterNotification, + (ndr_print_function_t) ndr_print_PNP_UnregisterNotification, + false, + }, + { + "PNP_GetCustomDevProp", + sizeof(struct PNP_GetCustomDevProp), + (ndr_push_flags_fn_t) ndr_push_PNP_GetCustomDevProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetCustomDevProp, + (ndr_print_function_t) ndr_print_PNP_GetCustomDevProp, + false, + }, + { + "PNP_GetVersionInternal", + sizeof(struct PNP_GetVersionInternal), + (ndr_push_flags_fn_t) ndr_push_PNP_GetVersionInternal, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetVersionInternal, + (ndr_print_function_t) ndr_print_PNP_GetVersionInternal, + false, + }, + { + "PNP_GetBlockedDriverInfo", + sizeof(struct PNP_GetBlockedDriverInfo), + (ndr_push_flags_fn_t) ndr_push_PNP_GetBlockedDriverInfo, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetBlockedDriverInfo, + (ndr_print_function_t) ndr_print_PNP_GetBlockedDriverInfo, + false, + }, + { + "PNP_GetServerSideDeviceInstallFlags", + sizeof(struct PNP_GetServerSideDeviceInstallFlags), + (ndr_push_flags_fn_t) ndr_push_PNP_GetServerSideDeviceInstallFlags, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetServerSideDeviceInstallFlags, + (ndr_print_function_t) ndr_print_PNP_GetServerSideDeviceInstallFlags, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const ntsvcs_endpoint_strings[] = { + "ncacn_np:[\\pipe\\ntsvcs]", + "ncacn_np:[\\pipe\\plugplay]", +}; + +static const struct ndr_interface_string_array ntsvcs_endpoints = { + .count = 2, + .names = ntsvcs_endpoint_strings +}; + +static const char * const ntsvcs_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array ntsvcs_authservices = { + .count = 1, + .names = ntsvcs_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_ntsvcs = { + .name = "ntsvcs", + .syntax_id = { + {0x8d9f4e40,0xa03d,0x11ce,{0x8f,0x69},{0x08,0x00,0x3e,0x30,0x05,0x1b}}, + NDR_NTSVCS_VERSION + }, + .helpstring = NDR_NTSVCS_HELPSTRING, + .num_calls = 65, + .calls = ntsvcs_calls, + .endpoints = &ntsvcs_endpoints, + .authservices = &ntsvcs_authservices +}; + diff --git a/librpc/gen_ndr/ndr_ntsvcs.h b/librpc/gen_ndr/ndr_ntsvcs.h new file mode 100644 index 0000000000..0e3b6b91c4 --- /dev/null +++ b/librpc/gen_ndr/ndr_ntsvcs.h @@ -0,0 +1,211 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/ntsvcs.h" + +#ifndef _HEADER_NDR_ntsvcs +#define _HEADER_NDR_ntsvcs + +#define NDR_NTSVCS_UUID "8d9f4e40-a03d-11ce-8f69-08003e30051b" +#define NDR_NTSVCS_VERSION 1.0 +#define NDR_NTSVCS_NAME "ntsvcs" +#define NDR_NTSVCS_HELPSTRING "Plug and Play services" +extern const struct ndr_interface_table ndr_table_ntsvcs; +#define NDR_PNP_DISCONNECT (0x00) + +#define NDR_PNP_CONNECT (0x01) + +#define NDR_PNP_GETVERSION (0x02) + +#define NDR_PNP_GETGLOBALSTATE (0x03) + +#define NDR_PNP_INITDETECTION (0x04) + +#define NDR_PNP_REPORTLOGON (0x05) + +#define NDR_PNP_VALIDATEDEVICEINSTANCE (0x06) + +#define NDR_PNP_GETROOTDEVICEINSTANCE (0x07) + +#define NDR_PNP_GETRELATEDDEVICEINSTANCE (0x08) + +#define NDR_PNP_ENUMERATESUBKEYS (0x09) + +#define NDR_PNP_GETDEVICELIST (0x0a) + +#define NDR_PNP_GETDEVICELISTSIZE (0x0b) + +#define NDR_PNP_GETDEPTH (0x0c) + +#define NDR_PNP_GETDEVICEREGPROP (0x0d) + +#define NDR_PNP_SETDEVICEREGPROP (0x0e) + +#define NDR_PNP_GETCLASSINSTANCE (0x0f) + +#define NDR_PNP_CREATEKEY (0x10) + +#define NDR_PNP_DELETEREGISTRYKEY (0x11) + +#define NDR_PNP_GETCLASSCOUNT (0x12) + +#define NDR_PNP_GETCLASSNAME (0x13) + +#define NDR_PNP_DELETECLASSKEY (0x14) + +#define NDR_PNP_GETINTERFACEDEVICEALIAS (0x15) + +#define NDR_PNP_GETINTERFACEDEVICELIST (0x16) + +#define NDR_PNP_GETINTERFACEDEVICELISTSIZE (0x17) + +#define NDR_PNP_REGISTERDEVICECLASSASSOCIATION (0x18) + +#define NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION (0x19) + +#define NDR_PNP_GETCLASSREGPROP (0x1a) + +#define NDR_PNP_SETCLASSREGPROP (0x1b) + +#define NDR_PNP_CREATEDEVINST (0x1c) + +#define NDR_PNP_DEVICEINSTANCEACTION (0x1d) + +#define NDR_PNP_GETDEVICESTATUS (0x1e) + +#define NDR_PNP_SETDEVICEPROBLEM (0x1f) + +#define NDR_PNP_DISABLEDEVINST (0x20) + +#define NDR_PNP_UNINSTALLDEVINST (0x21) + +#define NDR_PNP_ADDID (0x22) + +#define NDR_PNP_REGISTERDRIVER (0x23) + +#define NDR_PNP_QUERYREMOVE (0x24) + +#define NDR_PNP_REQUESTDEVICEEJECT (0x25) + +#define NDR_PNP_ISDOCKSTATIONPRESENT (0x26) + +#define NDR_PNP_REQUESTEJECTPC (0x27) + +#define NDR_PNP_HWPROFFLAGS (0x28) + +#define NDR_PNP_GETHWPROFINFO (0x29) + +#define NDR_PNP_ADDEMPTYLOGCONF (0x2a) + +#define NDR_PNP_FREELOGCONF (0x2b) + +#define NDR_PNP_GETFIRSTLOGCONF (0x2c) + +#define NDR_PNP_GETNEXTLOGCONF (0x2d) + +#define NDR_PNP_GETLOGCONFPRIORITY (0x2e) + +#define NDR_PNP_ADDRESDES (0x2f) + +#define NDR_PNP_FREERESDES (0x30) + +#define NDR_PNP_GETNEXTRESDES (0x31) + +#define NDR_PNP_GETRESDESDATA (0x32) + +#define NDR_PNP_GETRESDESDATASIZE (0x33) + +#define NDR_PNP_MODIFYRESDES (0x34) + +#define NDR_PNP_DETECTRESOURCELIMIT (0x35) + +#define NDR_PNP_QUERYRESCONFLIST (0x36) + +#define NDR_PNP_SETHWPROF (0x37) + +#define NDR_PNP_QUERYARBITRATORFREEDATA (0x38) + +#define NDR_PNP_QUERYARBITRATORFREESIZE (0x39) + +#define NDR_PNP_RUNDETECTION (0x3a) + +#define NDR_PNP_REGISTERNOTIFICATION (0x3b) + +#define NDR_PNP_UNREGISTERNOTIFICATION (0x3c) + +#define NDR_PNP_GETCUSTOMDEVPROP (0x3d) + +#define NDR_PNP_GETVERSIONINTERNAL (0x3e) + +#define NDR_PNP_GETBLOCKEDDRIVERINFO (0x3f) + +#define NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS (0x40) + +#define NDR_NTSVCS_CALL_COUNT (65) +void ndr_print_PNP_HwProfInfo(struct ndr_print *ndr, const char *name, const struct PNP_HwProfInfo *r); +void ndr_print_PNP_Disconnect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Disconnect *r); +void ndr_print_PNP_Connect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Connect *r); +void ndr_print_PNP_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersion *r); +void ndr_print_PNP_GetGlobalState(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetGlobalState *r); +void ndr_print_PNP_InitDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_InitDetection *r); +void ndr_print_PNP_ReportLogOn(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ReportLogOn *r); +void ndr_print_PNP_ValidateDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ValidateDeviceInstance *r); +void ndr_print_PNP_GetRootDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRootDeviceInstance *r); +void ndr_print_PNP_GetRelatedDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRelatedDeviceInstance *r); +void ndr_print_PNP_EnumerateSubKeys(struct ndr_print *ndr, const char *name, int flags, const struct PNP_EnumerateSubKeys *r); +void ndr_print_PNP_GetDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceList *r); +void ndr_print_PNP_GetDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceListSize *r); +void ndr_print_PNP_GetDepth(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDepth *r); +void ndr_print_PNP_GetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceRegProp *r); +void ndr_print_PNP_SetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceRegProp *r); +void ndr_print_PNP_GetClassInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassInstance *r); +void ndr_print_PNP_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateKey *r); +void ndr_print_PNP_DeleteRegistryKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteRegistryKey *r); +void ndr_print_PNP_GetClassCount(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassCount *r); +void ndr_print_PNP_GetClassName(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassName *r); +void ndr_print_PNP_DeleteClassKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteClassKey *r); +void ndr_print_PNP_GetInterfaceDeviceAlias(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceAlias *r); +void ndr_print_PNP_GetInterfaceDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceList *r); +void ndr_print_PNP_GetInterfaceDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceListSize *r); +void ndr_print_PNP_RegisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDeviceClassAssociation *r); +void ndr_print_PNP_UnregisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterDeviceClassAssociation *r); +void ndr_print_PNP_GetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassRegProp *r); +void ndr_print_PNP_SetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetClassRegProp *r); +void ndr_print_PNP_CreateDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateDevInst *r); +void ndr_print_PNP_DeviceInstanceAction(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeviceInstanceAction *r); +void ndr_print_PNP_GetDeviceStatus(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceStatus *r); +void ndr_print_PNP_SetDeviceProblem(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceProblem *r); +void ndr_print_PNP_DisableDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DisableDevInst *r); +void ndr_print_PNP_UninstallDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UninstallDevInst *r); +void ndr_print_PNP_AddID(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddID *r); +void ndr_print_PNP_RegisterDriver(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDriver *r); +void ndr_print_PNP_QueryRemove(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryRemove *r); +void ndr_print_PNP_RequestDeviceEject(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestDeviceEject *r); +void ndr_print_PNP_IsDockStationPresent(struct ndr_print *ndr, const char *name, int flags, const struct PNP_IsDockStationPresent *r); +void ndr_print_PNP_RequestEjectPC(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestEjectPC *r); +void ndr_print_PNP_HwProfFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_HwProfFlags *r); +void ndr_print_PNP_GetHwProfInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetHwProfInfo *r); +void ndr_print_PNP_AddEmptyLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddEmptyLogConf *r); +void ndr_print_PNP_FreeLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeLogConf *r); +void ndr_print_PNP_GetFirstLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetFirstLogConf *r); +void ndr_print_PNP_GetNextLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextLogConf *r); +void ndr_print_PNP_GetLogConfPriority(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetLogConfPriority *r); +void ndr_print_PNP_AddResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddResDes *r); +void ndr_print_PNP_FreeResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeResDes *r); +void ndr_print_PNP_GetNextResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextResDes *r); +void ndr_print_PNP_GetResDesData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesData *r); +void ndr_print_PNP_GetResDesDataSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesDataSize *r); +void ndr_print_PNP_ModifyResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ModifyResDes *r); +void ndr_print_PNP_DetectResourceLimit(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DetectResourceLimit *r); +void ndr_print_PNP_QueryResConfList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryResConfList *r); +void ndr_print_PNP_SetHwProf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetHwProf *r); +void ndr_print_PNP_QueryArbitratorFreeData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeData *r); +void ndr_print_PNP_QueryArbitratorFreeSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeSize *r); +void ndr_print_PNP_RunDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RunDetection *r); +void ndr_print_PNP_RegisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterNotification *r); +void ndr_print_PNP_UnregisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterNotification *r); +void ndr_print_PNP_GetCustomDevProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetCustomDevProp *r); +void ndr_print_PNP_GetVersionInternal(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersionInternal *r); +void ndr_print_PNP_GetBlockedDriverInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetBlockedDriverInfo *r); +void ndr_print_PNP_GetServerSideDeviceInstallFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetServerSideDeviceInstallFlags *r); +#endif /* _HEADER_NDR_ntsvcs */ diff --git a/librpc/gen_ndr/ndr_samr.c b/librpc/gen_ndr/ndr_samr.c new file mode 100644 index 0000000000..83db0faaef --- /dev/null +++ b/librpc/gen_ndr/ndr_samr.c @@ -0,0 +1,12856 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_samr.h" + +#include "librpc/gen_ndr/ndr_misc.h" +#include "librpc/gen_ndr/ndr_lsa.h" +#include "librpc/gen_ndr/ndr_security.h" +_PUBLIC_ enum ndr_err_code ndr_push_netr_SamDatabaseID(struct ndr_push *ndr, int ndr_flags, enum netr_SamDatabaseID r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_SamDatabaseID(struct ndr_pull *ndr, int ndr_flags, enum netr_SamDatabaseID *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_SamDatabaseID(struct ndr_print *ndr, const char *name, enum netr_SamDatabaseID r) +{ + const char *val = NULL; + + switch (r) { + case SAM_DATABASE_DOMAIN: val = "SAM_DATABASE_DOMAIN"; break; + case SAM_DATABASE_BUILTIN: val = "SAM_DATABASE_BUILTIN"; break; + case SAM_DATABASE_PRIVS: val = "SAM_DATABASE_PRIVS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int ndr_flags, enum samr_RejectReason r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r) +{ + const char *val = NULL; + + switch (r) { + case SAMR_REJECT_OTHER: val = "SAMR_REJECT_OTHER"; break; + case SAMR_REJECT_TOO_SHORT: val = "SAMR_REJECT_TOO_SHORT"; break; + case SAMR_REJECT_IN_HISTORY: val = "SAMR_REJECT_IN_HISTORY"; break; + case SAMR_REJECT_COMPLEXITY: val = "SAMR_REJECT_COMPLEXITY"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_AcctFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_AcctFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AcctFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DISABLED", ACB_DISABLED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_HOMDIRREQ", ACB_HOMDIRREQ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PWNOTREQ", ACB_PWNOTREQ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_TEMPDUP", ACB_TEMPDUP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NORMAL", ACB_NORMAL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_MNS", ACB_MNS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DOMTRUST", ACB_DOMTRUST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_WSTRUST", ACB_WSTRUST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_SVRTRUST", ACB_SVRTRUST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PWNOEXP", ACB_PWNOEXP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_AUTOLOCK", ACB_AUTOLOCK, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_ENC_TXT_PWD_ALLOWED", ACB_ENC_TXT_PWD_ALLOWED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_SMARTCARD_REQUIRED", ACB_SMARTCARD_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_TRUSTED_FOR_DELEGATION", ACB_TRUSTED_FOR_DELEGATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NOT_DELEGATED", ACB_NOT_DELEGATED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_USE_DES_KEY_ONLY", ACB_USE_DES_KEY_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DONT_REQUIRE_PREAUTH", ACB_DONT_REQUIRE_PREAUTH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PW_EXPIRED", ACB_PW_EXPIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NO_AUTH_DATA_REQD", ACB_NO_AUTH_DATA_REQD, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ConnectAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ConnectAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ConnectAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_CONNECT_TO_SERVER", SAMR_ACCESS_CONNECT_TO_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_SHUTDOWN_SERVER", SAMR_ACCESS_SHUTDOWN_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_INITIALIZE_SERVER", SAMR_ACCESS_INITIALIZE_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_CREATE_DOMAIN", SAMR_ACCESS_CREATE_DOMAIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_ENUM_DOMAINS", SAMR_ACCESS_ENUM_DOMAINS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_OPEN_DOMAIN", SAMR_ACCESS_OPEN_DOMAIN, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_NAME_ETC", SAMR_USER_ACCESS_GET_NAME_ETC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_LOCALE", SAMR_USER_ACCESS_GET_LOCALE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_LOC_COM", SAMR_USER_ACCESS_SET_LOC_COM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_LOGONINFO", SAMR_USER_ACCESS_GET_LOGONINFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_ATTRIBUTES", SAMR_USER_ACCESS_GET_ATTRIBUTES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_ATTRIBUTES", SAMR_USER_ACCESS_SET_ATTRIBUTES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_CHANGE_PASSWORD", SAMR_USER_ACCESS_CHANGE_PASSWORD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_PASSWORD", SAMR_USER_ACCESS_SET_PASSWORD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_GROUPS", SAMR_USER_ACCESS_GET_GROUPS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP", SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP", SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomainAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomainAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomainAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1", SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_1", SAMR_DOMAIN_ACCESS_SET_INFO_1, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2", SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_2", SAMR_DOMAIN_ACCESS_SET_INFO_2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_USER", SAMR_DOMAIN_ACCESS_CREATE_USER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_GROUP", SAMR_DOMAIN_ACCESS_CREATE_GROUP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_ALIAS", SAMR_DOMAIN_ACCESS_CREATE_ALIAS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS", SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS", SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT", SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_3", SAMR_DOMAIN_ACCESS_SET_INFO_3, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GroupAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_LOOKUP_INFO", SAMR_GROUP_ACCESS_LOOKUP_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_SET_INFO", SAMR_GROUP_ACCESS_SET_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_ADD_MEMBER", SAMR_GROUP_ACCESS_ADD_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_REMOVE_MEMBER", SAMR_GROUP_ACCESS_REMOVE_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_GET_MEMBERS", SAMR_GROUP_ACCESS_GET_MEMBERS, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AliasAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AliasAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AliasAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_ADD_MEMBER", SAMR_ALIAS_ACCESS_ADD_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_REMOVE_MEMBER", SAMR_ALIAS_ACCESS_REMOVE_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_GET_MEMBERS", SAMR_ALIAS_ACCESS_GET_MEMBERS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_LOOKUP_INFO", SAMR_ALIAS_ACCESS_LOOKUP_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_SET_INFO", SAMR_ALIAS_ACCESS_SET_INFO, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SamEntry(struct ndr_push *ndr, int ndr_flags, const struct samr_SamEntry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SamEntry(struct ndr_pull *ndr, int ndr_flags, struct samr_SamEntry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, const struct samr_SamEntry *r) +{ + ndr_print_struct(ndr, name, "samr_SamEntry"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_lsa_String(ndr, "name", &r->name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SamArray(struct ndr_push *ndr, int ndr_flags, const struct samr_SamArray *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SamArray(struct ndr_pull *ndr, int ndr_flags, struct samr_SamArray *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SamArray(struct ndr_print *ndr, const char *name, const struct samr_SamArray *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_SamArray"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { + ndr_print_samr_SamEntry(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Role(struct ndr_push *ndr, int ndr_flags, enum samr_Role r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Role(struct ndr_pull *ndr, int ndr_flags, enum samr_Role *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Role(struct ndr_print *ndr, const char *name, enum samr_Role r) +{ + const char *val = NULL; + + switch (r) { + case SAMR_ROLE_STANDALONE: val = "SAMR_ROLE_STANDALONE"; break; + case SAMR_ROLE_DOMAIN_MEMBER: val = "SAMR_ROLE_DOMAIN_MEMBER"; break; + case SAMR_ROLE_DOMAIN_BDC: val = "SAMR_ROLE_DOMAIN_BDC"; break; + case SAMR_ROLE_DOMAIN_PDC: val = "SAMR_ROLE_DOMAIN_PDC"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_COMPLEX", DOMAIN_PASSWORD_COMPLEX, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_ANON_CHANGE", DOMAIN_PASSWORD_NO_ANON_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_CLEAR_CHANGE", DOMAIN_PASSWORD_NO_CLEAR_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_LOCKOUT_ADMINS", DOMAIN_PASSWORD_LOCKOUT_ADMINS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_STORE_CLEARTEXT", DOMAIN_PASSWORD_STORE_CLEARTEXT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_REFUSE_PASSWORD_CHANGE", DOMAIN_REFUSE_PASSWORD_CHANGE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomainServerState(struct ndr_push *ndr, int ndr_flags, enum samr_DomainServerState r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomainServerState(struct ndr_pull *ndr, int ndr_flags, enum samr_DomainServerState *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomainServerState(struct ndr_print *ndr, const char *name, enum samr_DomainServerState r) +{ + const char *val = NULL; + + switch (r) { + case DOMAIN_SERVER_ENABLED: val = "DOMAIN_SERVER_ENABLED"; break; + case DOMAIN_SERVER_DISABLED: val = "DOMAIN_SERVER_DISABLED"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_DomInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length)); + NDR_CHECK(ndr_push_samr_PasswordProperties(ndr, NDR_SCALARS, r->password_properties)); + NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age)); + NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length)); + NDR_CHECK(ndr_pull_samr_PasswordProperties(ndr, NDR_SCALARS, &r->password_properties)); + NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age)); + NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo1"); + ndr->depth++; + ndr_print_uint16(ndr, "min_password_length", r->min_password_length); + ndr_print_uint16(ndr, "password_history_length", r->password_history_length); + ndr_print_samr_PasswordProperties(ndr, "password_properties", r->password_properties); + ndr_print_dlong(ndr, "max_password_age", r->max_password_age); + ndr_print_dlong(ndr, "min_password_age", r->min_password_age); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomGeneralInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num)); + NDR_CHECK(ndr_push_samr_DomainServerState(ndr, NDR_SCALARS, r->domain_server_state)); + NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_users)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_groups)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aliases)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomGeneralInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num)); + NDR_CHECK(ndr_pull_samr_DomainServerState(ndr, NDR_SCALARS, &r->domain_server_state)); + NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_users)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_groups)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aliases)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomGeneralInformation(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation *r) +{ + ndr_print_struct(ndr, name, "samr_DomGeneralInformation"); + ndr->depth++; + ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time); + ndr_print_lsa_String(ndr, "oem_information", &r->oem_information); + ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); + ndr_print_lsa_String(ndr, "primary", &r->primary); + ndr_print_udlong(ndr, "sequence_num", r->sequence_num); + ndr_print_samr_DomainServerState(ndr, "domain_server_state", r->domain_server_state); + ndr_print_samr_Role(ndr, "role", r->role); + ndr_print_uint32(ndr, "unknown3", r->unknown3); + ndr_print_uint32(ndr, "num_users", r->num_users); + ndr_print_uint32(ndr, "num_groups", r->num_groups); + ndr_print_uint32(ndr, "num_aliases", r->num_aliases); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo3"); + ndr->depth++; + ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomOEMInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomOEMInformation *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomOEMInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomOEMInformation *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomOEMInformation(struct ndr_print *ndr, const char *name, const struct samr_DomOEMInformation *r) +{ + ndr_print_struct(ndr, name, "samr_DomOEMInformation"); + ndr->depth++; + ndr_print_lsa_String(ndr, "oem_information", &r->oem_information); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo5"); + ndr->depth++; + ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo6"); + ndr->depth++; + ndr_print_lsa_String(ndr, "primary", &r->primary); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo7"); + ndr->depth++; + ndr_print_samr_Role(ndr, "role", r->role); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo8"); + ndr->depth++; + ndr_print_hyper(ndr, "sequence_num", r->sequence_num); + ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_DomainServerState(ndr, NDR_SCALARS, r->domain_server_state)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_DomainServerState(ndr, NDR_SCALARS, &r->domain_server_state)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo9"); + ndr->depth++; + ndr_print_samr_DomainServerState(ndr, "domain_server_state", r->domain_server_state); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomGeneralInformation2(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomGeneralInformation2(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomGeneralInformation2(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation2 *r) +{ + ndr_print_struct(ndr, name, "samr_DomGeneralInformation2"); + ndr->depth++; + ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general); + ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration); + ndr_print_hyper(ndr, "lockout_window", r->lockout_window); + ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo12 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo12 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo12"); + ndr->depth++; + ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration); + ndr_print_hyper(ndr, "lockout_window", r->lockout_window); + ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo13 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->modified_count_at_last_promotion)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo13 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->modified_count_at_last_promotion)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo13"); + ndr->depth++; + ndr_print_hyper(ndr, "sequence_num", r->sequence_num); + ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time); + ndr_print_hyper(ndr, "modified_count_at_last_promotion", r->modified_count_at_last_promotion); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union samr_DomainInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general)); + break; } + + case 3: { + NDR_CHECK(ndr_push_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem)); + break; } + + case 5: { + NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_push_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7)); + break; } + + case 8: { + NDR_CHECK(ndr_push_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8)); + break; } + + case 9: { + NDR_CHECK(ndr_push_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9)); + break; } + + case 11: { + NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2)); + break; } + + case 12: { + NDR_CHECK(ndr_push_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12)); + break; } + + case 13: { + NDR_CHECK(ndr_push_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + case 2: + NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general)); + break; + + case 3: + break; + + case 4: + NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem)); + break; + + case 5: + NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6)); + break; + + case 7: + break; + + case 8: + break; + + case 9: + break; + + case 11: + NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2)); + break; + + case 12: + break; + + case 13: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union samr_DomainInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem)); + break; } + + case 5: { + NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_pull_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7)); + break; } + + case 8: { + NDR_CHECK(ndr_pull_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8)); + break; } + + case 9: { + NDR_CHECK(ndr_pull_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9)); + break; } + + case 11: { + NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2)); + break; } + + case 12: { + NDR_CHECK(ndr_pull_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12)); + break; } + + case 13: { + NDR_CHECK(ndr_pull_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + case 2: + NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general)); + break; + + case 3: + break; + + case 4: + NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem)); + break; + + case 5: + NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6)); + break; + + case 7: + break; + + case 8: + break; + + case 9: + break; + + case 11: + NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2)); + break; + + case 12: + break; + + case 13: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_DomainInfo"); + switch (level) { + case 1: + ndr_print_samr_DomInfo1(ndr, "info1", &r->info1); + break; + + case 2: + ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general); + break; + + case 3: + ndr_print_samr_DomInfo3(ndr, "info3", &r->info3); + break; + + case 4: + ndr_print_samr_DomOEMInformation(ndr, "oem", &r->oem); + break; + + case 5: + ndr_print_samr_DomInfo5(ndr, "info5", &r->info5); + break; + + case 6: + ndr_print_samr_DomInfo6(ndr, "info6", &r->info6); + break; + + case 7: + ndr_print_samr_DomInfo7(ndr, "info7", &r->info7); + break; + + case 8: + ndr_print_samr_DomInfo8(ndr, "info8", &r->info8); + break; + + case 9: + ndr_print_samr_DomInfo9(ndr, "info9", &r->info9); + break; + + case 11: + ndr_print_samr_DomGeneralInformation2(ndr, "general2", &r->general2); + break; + + case 12: + ndr_print_samr_DomInfo12(ndr, "info12", &r->info12); + break; + + case 13: + ndr_print_samr_DomInfo13(ndr, "info13", &r->info13); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_Ids(struct ndr_push *ndr, int ndr_flags, const struct samr_Ids *r) +{ + uint32_t cntr_ids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ids)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->ids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ids[cntr_ids_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Ids(struct ndr_pull *ndr, int ndr_flags, struct samr_Ids *r) +{ + uint32_t _ptr_ids; + uint32_t cntr_ids_1; + TALLOC_CTX *_mem_save_ids_0; + TALLOC_CTX *_mem_save_ids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1024) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ids)); + if (_ptr_ids) { + NDR_PULL_ALLOC(ndr, r->ids); + } else { + r->ids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->ids) { + _mem_save_ids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->ids)); + NDR_PULL_ALLOC_N(ndr, r->ids, ndr_get_array_size(ndr, &r->ids)); + _mem_save_ids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0); + for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ids[cntr_ids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_0, 0); + } + if (r->ids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->ids, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Ids(struct ndr_print *ndr, const char *name, const struct samr_Ids *r) +{ + uint32_t cntr_ids_1; + ndr_print_struct(ndr, name, "samr_Ids"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "ids", r->ids); + ndr->depth++; + if (r->ids) { + ndr->print(ndr, "%s: ARRAY(%d)", "ids", (int)r->count); + ndr->depth++; + for (cntr_ids_1=0;cntr_ids_1count;cntr_ids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_ids_1) != -1) { + ndr_print_uint32(ndr, "ids", r->ids[cntr_ids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_GroupAttrs(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_GroupAttrs(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupAttrs(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_MANDATORY", SE_GROUP_MANDATORY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED_BY_DEFAULT", SE_GROUP_ENABLED_BY_DEFAULT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED", SE_GROUP_ENABLED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_OWNER", SE_GROUP_OWNER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_USE_FOR_DENY_ONLY", SE_GROUP_USE_FOR_DENY_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_RESOURCE", SE_GROUP_RESOURCE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_LOGON_ID", SE_GROUP_LOGON_ID, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GroupInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAll *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAll *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupInfoAll(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAll *r) +{ + ndr_print_struct(ndr, name, "samr_GroupInfoAll"); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", &r->name); + ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); + ndr_print_uint32(ndr, "num_members", r->num_members); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GroupInfoAttributes(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAttributes *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupInfoAttributes(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAttributes *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupInfoAttributes(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAttributes *r) +{ + ndr_print_struct(ndr, name, "samr_GroupInfoAttributes"); + ndr->depth++; + ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GroupInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_GroupInfoEnum r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_GroupInfoEnum *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupInfoEnum(struct ndr_print *ndr, const char *name, enum samr_GroupInfoEnum r) +{ + const char *val = NULL; + + switch (r) { + case GROUPINFOALL: val = "GROUPINFOALL"; break; + case GROUPINFONAME: val = "GROUPINFONAME"; break; + case GROUPINFOATTRIBUTES: val = "GROUPINFOATTRIBUTES"; break; + case GROUPINFODESCRIPTION: val = "GROUPINFODESCRIPTION"; break; + case GROUPINFOALL2: val = "GROUPINFOALL2"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_GroupInfo(struct ndr_push *ndr, int ndr_flags, const union samr_GroupInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, level)); + switch (level) { + case GROUPINFOALL: { + NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all)); + break; } + + case GROUPINFONAME: { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + break; } + + case GROUPINFOATTRIBUTES: { + NDR_CHECK(ndr_push_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes)); + break; } + + case GROUPINFODESCRIPTION: { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + break; } + + case GROUPINFOALL2: { + NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case GROUPINFOALL: + NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all)); + break; + + case GROUPINFONAME: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + break; + + case GROUPINFOATTRIBUTES: + break; + + case GROUPINFODESCRIPTION: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + break; + + case GROUPINFOALL2: + NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupInfo(struct ndr_pull *ndr, int ndr_flags, union samr_GroupInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case GROUPINFOALL: { + NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all)); + break; } + + case GROUPINFONAME: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + break; } + + case GROUPINFOATTRIBUTES: { + NDR_CHECK(ndr_pull_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes)); + break; } + + case GROUPINFODESCRIPTION: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + break; } + + case GROUPINFOALL2: { + NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case GROUPINFOALL: + NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all)); + break; + + case GROUPINFONAME: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + break; + + case GROUPINFOATTRIBUTES: + break; + + case GROUPINFODESCRIPTION: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + break; + + case GROUPINFOALL2: + NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupInfo(struct ndr_print *ndr, const char *name, const union samr_GroupInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_GroupInfo"); + switch (level) { + case GROUPINFOALL: + ndr_print_samr_GroupInfoAll(ndr, "all", &r->all); + break; + + case GROUPINFONAME: + ndr_print_lsa_String(ndr, "name", &r->name); + break; + + case GROUPINFOATTRIBUTES: + ndr_print_samr_GroupInfoAttributes(ndr, "attributes", &r->attributes); + break; + + case GROUPINFODESCRIPTION: + ndr_print_lsa_String(ndr, "description", &r->description); + break; + + case GROUPINFOALL2: + ndr_print_samr_GroupInfoAll(ndr, "all2", &r->all2); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_RidTypeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidTypeArray *r) +{ + uint32_t cntr_rids_1; + uint32_t cntr_types_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->types)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1])); + } + } + if (r->types) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->types[cntr_types_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_RidTypeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidTypeArray *r) +{ + uint32_t _ptr_rids; + uint32_t cntr_rids_1; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_rids_1; + uint32_t _ptr_types; + uint32_t cntr_types_1; + TALLOC_CTX *_mem_save_types_0; + TALLOC_CTX *_mem_save_types_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); + if (_ptr_rids) { + NDR_PULL_ALLOC(ndr, r->rids); + } else { + r->rids = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_types)); + if (_ptr_types) { + NDR_PULL_ALLOC(ndr, r->types); + } else { + r->types = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->rids)); + NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids)); + _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); + } + if (r->types) { + _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->types, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->types)); + NDR_PULL_ALLOC_N(ndr, r->types, ndr_get_array_size(ndr, &r->types)); + _mem_save_types_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->types, 0); + for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->types[cntr_types_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, 0); + } + if (r->rids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->count)); + } + if (r->types) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->types, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RidTypeArray(struct ndr_print *ndr, const char *name, const struct samr_RidTypeArray *r) +{ + uint32_t cntr_rids_1; + uint32_t cntr_types_1; + ndr_print_struct(ndr, name, "samr_RidTypeArray"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "rids", r->rids); + ndr->depth++; + if (r->rids) { + ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->count); + ndr->depth++; + for (cntr_rids_1=0;cntr_rids_1count;cntr_rids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) { + ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_ptr(ndr, "types", r->types); + ndr->depth++; + if (r->types) { + ndr->print(ndr, "%s: ARRAY(%d)", "types", (int)r->count); + ndr->depth++; + for (cntr_types_1=0;cntr_types_1count;cntr_types_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_types_1) != -1) { + ndr_print_uint32(ndr, "types", r->types[cntr_types_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AliasInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_AliasInfoAll *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AliasInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_AliasInfoAll *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AliasInfoAll(struct ndr_print *ndr, const char *name, const struct samr_AliasInfoAll *r) +{ + ndr_print_struct(ndr, name, "samr_AliasInfoAll"); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", &r->name); + ndr_print_uint32(ndr, "num_members", r->num_members); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AliasInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_AliasInfoEnum r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AliasInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_AliasInfoEnum *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AliasInfoEnum(struct ndr_print *ndr, const char *name, enum samr_AliasInfoEnum r) +{ + const char *val = NULL; + + switch (r) { + case ALIASINFOALL: val = "ALIASINFOALL"; break; + case ALIASINFONAME: val = "ALIASINFONAME"; break; + case ALIASINFODESCRIPTION: val = "ALIASINFODESCRIPTION"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_AliasInfo(struct ndr_push *ndr, int ndr_flags, const union samr_AliasInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, level)); + switch (level) { + case ALIASINFOALL: { + NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all)); + break; } + + case ALIASINFONAME: { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + break; } + + case ALIASINFODESCRIPTION: { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case ALIASINFOALL: + NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all)); + break; + + case ALIASINFONAME: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + break; + + case ALIASINFODESCRIPTION: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AliasInfo(struct ndr_pull *ndr, int ndr_flags, union samr_AliasInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case ALIASINFOALL: { + NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all)); + break; } + + case ALIASINFONAME: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + break; } + + case ALIASINFODESCRIPTION: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case ALIASINFOALL: + NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all)); + break; + + case ALIASINFONAME: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + break; + + case ALIASINFODESCRIPTION: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AliasInfo(struct ndr_print *ndr, const char *name, const union samr_AliasInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_AliasInfo"); + switch (level) { + case ALIASINFOALL: + ndr_print_samr_AliasInfoAll(ndr, "all", &r->all); + break; + + case ALIASINFONAME: + ndr_print_lsa_String(ndr, "name", &r->name); + break; + + case ALIASINFODESCRIPTION: + ndr_print_lsa_String(ndr, "description", &r->description); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo1(struct ndr_print *ndr, const char *name, const struct samr_UserInfo1 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo1"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "comment", &r->comment); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo2(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo2(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo2(struct ndr_print *ndr, const char *name, const struct samr_UserInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo2"); + ndr->depth++; + ndr_print_lsa_String(ndr, "comment", &r->comment); + ndr_print_lsa_String(ndr, "unknown", &r->unknown); + ndr_print_uint16(ndr, "country_code", r->country_code); + ndr_print_uint16(ndr, "code_page", r->code_page); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_LogonHours(struct ndr_push *ndr, int ndr_flags, const struct samr_LogonHours *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->units_per_week)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->bits)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->bits) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1260)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->units_per_week / 8)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->bits, r->units_per_week / 8)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_LogonHours(struct ndr_pull *ndr, int ndr_flags, struct samr_LogonHours *r) +{ + uint32_t _ptr_bits; + TALLOC_CTX *_mem_save_bits_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->units_per_week)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bits)); + if (_ptr_bits) { + NDR_PULL_ALLOC(ndr, r->bits); + } else { + r->bits = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->bits) { + _mem_save_bits_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->bits, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->bits)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->bits)); + if (ndr_get_array_length(ndr, &r->bits) > ndr_get_array_size(ndr, &r->bits)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->bits), ndr_get_array_length(ndr, &r->bits)); + } + NDR_PULL_ALLOC_N(ndr, r->bits, ndr_get_array_size(ndr, &r->bits)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->bits, ndr_get_array_length(ndr, &r->bits))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bits_0, 0); + } + if (r->bits) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->bits, 1260)); + } + if (r->bits) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->bits, r->units_per_week / 8)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_LogonHours(struct ndr_print *ndr, const char *name, const struct samr_LogonHours *r) +{ + ndr_print_struct(ndr, name, "samr_LogonHours"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint16(ndr, "units_per_week", r->units_per_week); + ndr_print_ptr(ndr, "bits", r->bits); + ndr->depth++; + if (r->bits) { + ndr_print_array_uint8(ndr, "bits", r->bits, r->units_per_week / 8); + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo3(struct ndr_print *ndr, const char *name, const struct samr_UserInfo3 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo3"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr_print_lsa_String(ndr, "workstations", &r->workstations); + ndr_print_NTTIME(ndr, "last_logon", r->last_logon); + ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); + ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change); + ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change); + ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); + ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); + ndr_print_uint16(ndr, "logon_count", r->logon_count); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo4(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo4(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo4(struct ndr_print *ndr, const char *name, const struct samr_UserInfo4 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo4"); + ndr->depth++; + ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo5(struct ndr_print *ndr, const char *name, const struct samr_UserInfo5 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo5"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "workstations", &r->workstations); + ndr_print_NTTIME(ndr, "last_logon", r->last_logon); + ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); + ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); + ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); + ndr_print_uint16(ndr, "logon_count", r->logon_count); + ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo6(struct ndr_print *ndr, const char *name, const struct samr_UserInfo6 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo6"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo7(struct ndr_print *ndr, const char *name, const struct samr_UserInfo7 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo7"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo8(struct ndr_print *ndr, const char *name, const struct samr_UserInfo8 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo8"); + ndr->depth++; + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo9(struct ndr_print *ndr, const char *name, const struct samr_UserInfo9 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo9"); + ndr->depth++; + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo10(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo10 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo10(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo10 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo10(struct ndr_print *ndr, const char *name, const struct samr_UserInfo10 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo10"); + ndr->depth++; + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo11(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo11 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo11(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo11 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo11(struct ndr_print *ndr, const char *name, const struct samr_UserInfo11 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo11"); + ndr->depth++; + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo12 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo12 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo12(struct ndr_print *ndr, const char *name, const struct samr_UserInfo12 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo12"); + ndr->depth++; + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo13 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo13 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo13(struct ndr_print *ndr, const char *name, const struct samr_UserInfo13 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo13"); + ndr->depth++; + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo14(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo14 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo14(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo14 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo14(struct ndr_print *ndr, const char *name, const struct samr_UserInfo14 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo14"); + ndr->depth++; + ndr_print_lsa_String(ndr, "workstations", &r->workstations); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo16(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo16 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo16(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo16 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo16(struct ndr_print *ndr, const char *name, const struct samr_UserInfo16 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo16"); + ndr->depth++; + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo17(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo17 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo17(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo17 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo17(struct ndr_print *ndr, const char *name, const struct samr_UserInfo17 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo17"); + ndr->depth++; + ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_Password(struct ndr_push *ndr, int ndr_flags, const struct samr_Password *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_Password(struct ndr_pull *ndr, int ndr_flags, struct samr_Password *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Password(struct ndr_print *ndr, const char *name, const struct samr_Password *r) +{ + ndr_print_struct(ndr, name, "samr_Password"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "hash", r->hash, 16); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo18(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo18 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_pwd_active)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_pwd_active)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo18(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo18 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_pwd_active)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_pwd_active)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo18(struct ndr_print *ndr, const char *name, const struct samr_UserInfo18 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo18"); + ndr->depth++; + ndr_print_samr_Password(ndr, "nt_pwd", &r->nt_pwd); + ndr_print_samr_Password(ndr, "lm_pwd", &r->lm_pwd); + ndr_print_uint8(ndr, "nt_pwd_active", r->nt_pwd_active); + ndr_print_uint8(ndr, "lm_pwd_active", r->lm_pwd_active); + ndr_print_uint8(ndr, "password_expired", r->password_expired); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo20(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo20 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo20(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo20 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo20(struct ndr_print *ndr, const char *name, const struct samr_UserInfo20 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo20"); + ndr->depth++; + ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_FieldsPresent(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_FieldsPresent(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_FieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCOUNT_NAME", SAMR_FIELD_ACCOUNT_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FULL_NAME", SAMR_FIELD_FULL_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_RID", SAMR_FIELD_RID, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIMARY_GID", SAMR_FIELD_PRIMARY_GID, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_DESCRIPTION", SAMR_FIELD_DESCRIPTION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COMMENT", SAMR_FIELD_COMMENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DIRECTORY", SAMR_FIELD_HOME_DIRECTORY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DRIVE", SAMR_FIELD_HOME_DRIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_SCRIPT", SAMR_FIELD_LOGON_SCRIPT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PROFILE_PATH", SAMR_FIELD_PROFILE_PATH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_WORKSTATIONS", SAMR_FIELD_WORKSTATIONS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGON", SAMR_FIELD_LAST_LOGON, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGOFF", SAMR_FIELD_LAST_LOGOFF, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_HOURS", SAMR_FIELD_LOGON_HOURS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_BAD_PWD_COUNT", SAMR_FIELD_BAD_PWD_COUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_NUM_LOGONS", SAMR_FIELD_NUM_LOGONS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ALLOW_PWD_CHANGE", SAMR_FIELD_ALLOW_PWD_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FORCE_PWD_CHANGE", SAMR_FIELD_FORCE_PWD_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_PWD_CHANGE", SAMR_FIELD_LAST_PWD_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_EXPIRY", SAMR_FIELD_ACCT_EXPIRY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_FLAGS", SAMR_FIELD_ACCT_FLAGS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PARAMETERS", SAMR_FIELD_PARAMETERS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COUNTRY_CODE", SAMR_FIELD_COUNTRY_CODE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_CODE_PAGE", SAMR_FIELD_CODE_PAGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_NT_PASSWORD_PRESENT", SAMR_FIELD_NT_PASSWORD_PRESENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LM_PASSWORD_PRESENT", SAMR_FIELD_LM_PASSWORD_PRESENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIVATE_DATA", SAMR_FIELD_PRIVATE_DATA, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_EXPIRED_FLAG", SAMR_FIELD_EXPIRED_FLAG, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_SEC_DESC", SAMR_FIELD_SEC_DESC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_OWF_PWD", SAMR_FIELD_OWF_PWD, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo21(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo21 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->lm_owf_password)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->nt_owf_password)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + NDR_CHECK(ndr_push_samr_FieldsPresent(ndr, NDR_SCALARS, r->fields_present)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_set)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_set)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->lm_owf_password)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->nt_owf_password)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + if (r->buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->buf_count)); + } + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo21(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo21 *r) +{ + uint32_t _ptr_buffer; + TALLOC_CTX *_mem_save_buffer_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->lm_owf_password)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->nt_owf_password)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); + if (_ptr_buffer) { + NDR_PULL_ALLOC(ndr, r->buffer); + } else { + r->buffer = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + NDR_CHECK(ndr_pull_samr_FieldsPresent(ndr, NDR_SCALARS, &r->fields_present)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_set)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_set)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->lm_owf_password)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->nt_owf_password)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + if (r->buffer) { + _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer)); + NDR_PULL_ALLOC_N(ndr, r->buffer, ndr_get_array_size(ndr, &r->buffer)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, ndr_get_array_size(ndr, &r->buffer))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); + } + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + if (r->buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->buf_count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo21(struct ndr_print *ndr, const char *name, const struct samr_UserInfo21 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo21"); + ndr->depth++; + ndr_print_NTTIME(ndr, "last_logon", r->last_logon); + ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); + ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); + ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change); + ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "workstations", &r->workstations); + ndr_print_lsa_String(ndr, "comment", &r->comment); + ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters); + ndr_print_lsa_BinaryString(ndr, "lm_owf_password", &r->lm_owf_password); + ndr_print_lsa_BinaryString(ndr, "nt_owf_password", &r->nt_owf_password); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_uint32(ndr, "buf_count", r->buf_count); + ndr_print_ptr(ndr, "buffer", r->buffer); + ndr->depth++; + if (r->buffer) { + ndr_print_array_uint8(ndr, "buffer", r->buffer, r->buf_count); + } + ndr->depth--; + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr_print_samr_FieldsPresent(ndr, "fields_present", r->fields_present); + ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); + ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); + ndr_print_uint16(ndr, "logon_count", r->logon_count); + ndr_print_uint16(ndr, "country_code", r->country_code); + ndr_print_uint16(ndr, "code_page", r->code_page); + ndr_print_uint8(ndr, "lm_password_set", r->lm_password_set); + ndr_print_uint8(ndr, "nt_password_set", r->nt_password_set); + ndr_print_uint8(ndr, "password_expired", r->password_expired); + ndr_print_uint8(ndr, "unknown4", r->unknown4); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPassword *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 516)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPassword *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 516)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CryptPassword(struct ndr_print *ndr, const char *name, const struct samr_CryptPassword *r) +{ + ndr_print_struct(ndr, name, "samr_CryptPassword"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->data, 516); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo23(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo23 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo23(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo23 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo23(struct ndr_print *ndr, const char *name, const struct samr_UserInfo23 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo23"); + ndr->depth++; + ndr_print_samr_UserInfo21(ndr, "info", &r->info); + ndr_print_samr_CryptPassword(ndr, "password", &r->password); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo24(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo24 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo24(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo24 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo24(struct ndr_print *ndr, const char *name, const struct samr_UserInfo24 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo24"); + ndr->depth++; + ndr_print_samr_CryptPassword(ndr, "password", &r->password); + ndr_print_uint8(ndr, "password_expired", r->password_expired); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CryptPasswordEx(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPasswordEx *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 532)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CryptPasswordEx(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPasswordEx *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 532)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CryptPasswordEx(struct ndr_print *ndr, const char *name, const struct samr_CryptPasswordEx *r) +{ + ndr_print_struct(ndr, name, "samr_CryptPasswordEx"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->data, 532); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo25(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo25 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo25(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo25 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo25(struct ndr_print *ndr, const char *name, const struct samr_UserInfo25 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo25"); + ndr->depth++; + ndr_print_samr_UserInfo21(ndr, "info", &r->info); + ndr_print_samr_CryptPasswordEx(ndr, "password", &r->password); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo26(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo26 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo26(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo26 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo26(struct ndr_print *ndr, const char *name, const struct samr_UserInfo26 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo26"); + ndr->depth++; + ndr_print_samr_CryptPasswordEx(ndr, "password", &r->password); + ndr_print_uint8(ndr, "password_expired", r->password_expired); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo(struct ndr_push *ndr, int ndr_flags, const union samr_UserInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_samr_UserInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_samr_UserInfo2(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_samr_UserInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_samr_UserInfo4(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_push_samr_UserInfo5(ndr, NDR_SCALARS, &r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_push_samr_UserInfo6(ndr, NDR_SCALARS, &r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_push_samr_UserInfo7(ndr, NDR_SCALARS, &r->info7)); + break; } + + case 8: { + NDR_CHECK(ndr_push_samr_UserInfo8(ndr, NDR_SCALARS, &r->info8)); + break; } + + case 9: { + NDR_CHECK(ndr_push_samr_UserInfo9(ndr, NDR_SCALARS, &r->info9)); + break; } + + case 10: { + NDR_CHECK(ndr_push_samr_UserInfo10(ndr, NDR_SCALARS, &r->info10)); + break; } + + case 11: { + NDR_CHECK(ndr_push_samr_UserInfo11(ndr, NDR_SCALARS, &r->info11)); + break; } + + case 12: { + NDR_CHECK(ndr_push_samr_UserInfo12(ndr, NDR_SCALARS, &r->info12)); + break; } + + case 13: { + NDR_CHECK(ndr_push_samr_UserInfo13(ndr, NDR_SCALARS, &r->info13)); + break; } + + case 14: { + NDR_CHECK(ndr_push_samr_UserInfo14(ndr, NDR_SCALARS, &r->info14)); + break; } + + case 16: { + NDR_CHECK(ndr_push_samr_UserInfo16(ndr, NDR_SCALARS, &r->info16)); + break; } + + case 17: { + NDR_CHECK(ndr_push_samr_UserInfo17(ndr, NDR_SCALARS, &r->info17)); + break; } + + case 18: { + NDR_CHECK(ndr_push_samr_UserInfo18(ndr, NDR_SCALARS, &r->info18)); + break; } + + case 20: { + NDR_CHECK(ndr_push_samr_UserInfo20(ndr, NDR_SCALARS, &r->info20)); + break; } + + case 21: { + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info21)); + break; } + + case 23: { + NDR_CHECK(ndr_push_samr_UserInfo23(ndr, NDR_SCALARS, &r->info23)); + break; } + + case 24: { + NDR_CHECK(ndr_push_samr_UserInfo24(ndr, NDR_SCALARS, &r->info24)); + break; } + + case 25: { + NDR_CHECK(ndr_push_samr_UserInfo25(ndr, NDR_SCALARS, &r->info25)); + break; } + + case 26: { + NDR_CHECK(ndr_push_samr_UserInfo26(ndr, NDR_SCALARS, &r->info26)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_UserInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_UserInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_UserInfo3(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_push_samr_UserInfo4(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_push_samr_UserInfo5(ndr, NDR_BUFFERS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_push_samr_UserInfo6(ndr, NDR_BUFFERS, &r->info6)); + break; + + case 7: + NDR_CHECK(ndr_push_samr_UserInfo7(ndr, NDR_BUFFERS, &r->info7)); + break; + + case 8: + NDR_CHECK(ndr_push_samr_UserInfo8(ndr, NDR_BUFFERS, &r->info8)); + break; + + case 9: + break; + + case 10: + NDR_CHECK(ndr_push_samr_UserInfo10(ndr, NDR_BUFFERS, &r->info10)); + break; + + case 11: + NDR_CHECK(ndr_push_samr_UserInfo11(ndr, NDR_BUFFERS, &r->info11)); + break; + + case 12: + NDR_CHECK(ndr_push_samr_UserInfo12(ndr, NDR_BUFFERS, &r->info12)); + break; + + case 13: + NDR_CHECK(ndr_push_samr_UserInfo13(ndr, NDR_BUFFERS, &r->info13)); + break; + + case 14: + NDR_CHECK(ndr_push_samr_UserInfo14(ndr, NDR_BUFFERS, &r->info14)); + break; + + case 16: + break; + + case 17: + break; + + case 18: + break; + + case 20: + NDR_CHECK(ndr_push_samr_UserInfo20(ndr, NDR_BUFFERS, &r->info20)); + break; + + case 21: + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info21)); + break; + + case 23: + NDR_CHECK(ndr_push_samr_UserInfo23(ndr, NDR_BUFFERS, &r->info23)); + break; + + case 24: + break; + + case 25: + NDR_CHECK(ndr_push_samr_UserInfo25(ndr, NDR_BUFFERS, &r->info25)); + break; + + case 26: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo(struct ndr_pull *ndr, int ndr_flags, union samr_UserInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_UserInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_UserInfo2(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_UserInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_samr_UserInfo4(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_pull_samr_UserInfo5(ndr, NDR_SCALARS, &r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_pull_samr_UserInfo6(ndr, NDR_SCALARS, &r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_pull_samr_UserInfo7(ndr, NDR_SCALARS, &r->info7)); + break; } + + case 8: { + NDR_CHECK(ndr_pull_samr_UserInfo8(ndr, NDR_SCALARS, &r->info8)); + break; } + + case 9: { + NDR_CHECK(ndr_pull_samr_UserInfo9(ndr, NDR_SCALARS, &r->info9)); + break; } + + case 10: { + NDR_CHECK(ndr_pull_samr_UserInfo10(ndr, NDR_SCALARS, &r->info10)); + break; } + + case 11: { + NDR_CHECK(ndr_pull_samr_UserInfo11(ndr, NDR_SCALARS, &r->info11)); + break; } + + case 12: { + NDR_CHECK(ndr_pull_samr_UserInfo12(ndr, NDR_SCALARS, &r->info12)); + break; } + + case 13: { + NDR_CHECK(ndr_pull_samr_UserInfo13(ndr, NDR_SCALARS, &r->info13)); + break; } + + case 14: { + NDR_CHECK(ndr_pull_samr_UserInfo14(ndr, NDR_SCALARS, &r->info14)); + break; } + + case 16: { + NDR_CHECK(ndr_pull_samr_UserInfo16(ndr, NDR_SCALARS, &r->info16)); + break; } + + case 17: { + NDR_CHECK(ndr_pull_samr_UserInfo17(ndr, NDR_SCALARS, &r->info17)); + break; } + + case 18: { + NDR_CHECK(ndr_pull_samr_UserInfo18(ndr, NDR_SCALARS, &r->info18)); + break; } + + case 20: { + NDR_CHECK(ndr_pull_samr_UserInfo20(ndr, NDR_SCALARS, &r->info20)); + break; } + + case 21: { + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info21)); + break; } + + case 23: { + NDR_CHECK(ndr_pull_samr_UserInfo23(ndr, NDR_SCALARS, &r->info23)); + break; } + + case 24: { + NDR_CHECK(ndr_pull_samr_UserInfo24(ndr, NDR_SCALARS, &r->info24)); + break; } + + case 25: { + NDR_CHECK(ndr_pull_samr_UserInfo25(ndr, NDR_SCALARS, &r->info25)); + break; } + + case 26: { + NDR_CHECK(ndr_pull_samr_UserInfo26(ndr, NDR_SCALARS, &r->info26)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_samr_UserInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_pull_samr_UserInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_pull_samr_UserInfo3(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_pull_samr_UserInfo4(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_pull_samr_UserInfo5(ndr, NDR_BUFFERS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_pull_samr_UserInfo6(ndr, NDR_BUFFERS, &r->info6)); + break; + + case 7: + NDR_CHECK(ndr_pull_samr_UserInfo7(ndr, NDR_BUFFERS, &r->info7)); + break; + + case 8: + NDR_CHECK(ndr_pull_samr_UserInfo8(ndr, NDR_BUFFERS, &r->info8)); + break; + + case 9: + break; + + case 10: + NDR_CHECK(ndr_pull_samr_UserInfo10(ndr, NDR_BUFFERS, &r->info10)); + break; + + case 11: + NDR_CHECK(ndr_pull_samr_UserInfo11(ndr, NDR_BUFFERS, &r->info11)); + break; + + case 12: + NDR_CHECK(ndr_pull_samr_UserInfo12(ndr, NDR_BUFFERS, &r->info12)); + break; + + case 13: + NDR_CHECK(ndr_pull_samr_UserInfo13(ndr, NDR_BUFFERS, &r->info13)); + break; + + case 14: + NDR_CHECK(ndr_pull_samr_UserInfo14(ndr, NDR_BUFFERS, &r->info14)); + break; + + case 16: + break; + + case 17: + break; + + case 18: + break; + + case 20: + NDR_CHECK(ndr_pull_samr_UserInfo20(ndr, NDR_BUFFERS, &r->info20)); + break; + + case 21: + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info21)); + break; + + case 23: + NDR_CHECK(ndr_pull_samr_UserInfo23(ndr, NDR_BUFFERS, &r->info23)); + break; + + case 24: + break; + + case 25: + NDR_CHECK(ndr_pull_samr_UserInfo25(ndr, NDR_BUFFERS, &r->info25)); + break; + + case 26: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo(struct ndr_print *ndr, const char *name, const union samr_UserInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_UserInfo"); + switch (level) { + case 1: + ndr_print_samr_UserInfo1(ndr, "info1", &r->info1); + break; + + case 2: + ndr_print_samr_UserInfo2(ndr, "info2", &r->info2); + break; + + case 3: + ndr_print_samr_UserInfo3(ndr, "info3", &r->info3); + break; + + case 4: + ndr_print_samr_UserInfo4(ndr, "info4", &r->info4); + break; + + case 5: + ndr_print_samr_UserInfo5(ndr, "info5", &r->info5); + break; + + case 6: + ndr_print_samr_UserInfo6(ndr, "info6", &r->info6); + break; + + case 7: + ndr_print_samr_UserInfo7(ndr, "info7", &r->info7); + break; + + case 8: + ndr_print_samr_UserInfo8(ndr, "info8", &r->info8); + break; + + case 9: + ndr_print_samr_UserInfo9(ndr, "info9", &r->info9); + break; + + case 10: + ndr_print_samr_UserInfo10(ndr, "info10", &r->info10); + break; + + case 11: + ndr_print_samr_UserInfo11(ndr, "info11", &r->info11); + break; + + case 12: + ndr_print_samr_UserInfo12(ndr, "info12", &r->info12); + break; + + case 13: + ndr_print_samr_UserInfo13(ndr, "info13", &r->info13); + break; + + case 14: + ndr_print_samr_UserInfo14(ndr, "info14", &r->info14); + break; + + case 16: + ndr_print_samr_UserInfo16(ndr, "info16", &r->info16); + break; + + case 17: + ndr_print_samr_UserInfo17(ndr, "info17", &r->info17); + break; + + case 18: + ndr_print_samr_UserInfo18(ndr, "info18", &r->info18); + break; + + case 20: + ndr_print_samr_UserInfo20(ndr, "info20", &r->info20); + break; + + case 21: + ndr_print_samr_UserInfo21(ndr, "info21", &r->info21); + break; + + case 23: + ndr_print_samr_UserInfo23(ndr, "info23", &r->info23); + break; + + case 24: + ndr_print_samr_UserInfo24(ndr, "info24", &r->info24); + break; + + case 25: + ndr_print_samr_UserInfo25(ndr, "info25", &r->info25); + break; + + case 26: + ndr_print_samr_UserInfo26(ndr, "info26", &r->info26); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_RidWithAttribute(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_RidWithAttribute(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RidWithAttribute(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttribute *r) +{ + ndr_print_struct(ndr, name, "samr_RidWithAttribute"); + ndr->depth++; + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_RidWithAttributeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttributeArray *r) +{ + uint32_t cntr_rids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { + NDR_CHECK(ndr_push_samr_RidWithAttribute(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_RidWithAttributeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttributeArray *r) +{ + uint32_t _ptr_rids; + uint32_t cntr_rids_1; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_rids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); + if (_ptr_rids) { + NDR_PULL_ALLOC(ndr, r->rids); + } else { + r->rids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->rids)); + NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids)); + _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { + NDR_CHECK(ndr_pull_samr_RidWithAttribute(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); + } + if (r->rids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RidWithAttributeArray(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttributeArray *r) +{ + uint32_t cntr_rids_1; + ndr_print_struct(ndr, name, "samr_RidWithAttributeArray"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "rids", r->rids); + ndr->depth++; + if (r->rids) { + ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->count); + ndr->depth++; + for (cntr_rids_1=0;cntr_rids_1count;cntr_rids_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) { + ndr_print_samr_RidWithAttribute(ndr, "rids", &r->rids[cntr_rids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispEntryGeneral(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryGeneral *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispEntryGeneral(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryGeneral *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispEntryGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispEntryGeneral *r) +{ + ndr_print_struct(ndr, name, "samr_DispEntryGeneral"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfoGeneral(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoGeneral *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryGeneral(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryGeneral(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfoGeneral(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoGeneral *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryGeneral(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryGeneral(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfoGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispInfoGeneral *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_DispInfoGeneral"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { + ndr_print_samr_DispEntryGeneral(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispEntryFull(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryFull *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispEntryFull(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryFull *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispEntryFull(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFull *r) +{ + ndr_print_struct(ndr, name, "samr_DispEntryFull"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfoFull(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoFull *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryFull(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryFull(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfoFull(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoFull *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryFull(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryFull(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfoFull(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFull *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_DispInfoFull"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { + ndr_print_samr_DispEntryFull(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispEntryFullGroup(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryFullGroup *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->acct_flags)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispEntryFullGroup(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryFullGroup *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->acct_flags)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispEntryFullGroup(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFullGroup *r) +{ + ndr_print_struct(ndr, name, "samr_DispEntryFullGroup"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_samr_GroupAttrs(ndr, "acct_flags", r->acct_flags); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfoFullGroups(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoFullGroups *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryFullGroup(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryFullGroup(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfoFullGroups(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoFullGroups *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryFullGroup(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryFullGroup(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfoFullGroups(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFullGroups *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_DispInfoFullGroups"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { + ndr_print_samr_DispEntryFullGroup(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispEntryAscii(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryAscii *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_lsa_AsciiStringLarge(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_AsciiStringLarge(ndr, NDR_BUFFERS, &r->account_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispEntryAscii(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryAscii *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_lsa_AsciiStringLarge(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_AsciiStringLarge(ndr, NDR_BUFFERS, &r->account_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispEntryAscii(struct ndr_print *ndr, const char *name, const struct samr_DispEntryAscii *r) +{ + ndr_print_struct(ndr, name, "samr_DispEntryAscii"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_lsa_AsciiStringLarge(ndr, "account_name", &r->account_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfoAscii(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoAscii *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryAscii(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryAscii(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfoAscii(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoAscii *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryAscii(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryAscii(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfoAscii(struct ndr_print *ndr, const char *name, const struct samr_DispInfoAscii *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_DispInfoAscii"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { + ndr_print_samr_DispEntryAscii(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfo(struct ndr_push *ndr, int ndr_flags, const union samr_DispInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_samr_DispInfoGeneral(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_samr_DispInfoFull(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_samr_DispInfoFullGroups(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info5)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_DispInfoGeneral(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_DispInfoFull(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_DispInfoFullGroups(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info5)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfo(struct ndr_pull *ndr, int ndr_flags, union samr_DispInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_DispInfoGeneral(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_DispInfoFull(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_DispInfoFullGroups(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info5)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_samr_DispInfoGeneral(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_pull_samr_DispInfoFull(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_pull_samr_DispInfoFullGroups(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info5)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfo(struct ndr_print *ndr, const char *name, const union samr_DispInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_DispInfo"); + switch (level) { + case 1: + ndr_print_samr_DispInfoGeneral(ndr, "info1", &r->info1); + break; + + case 2: + ndr_print_samr_DispInfoFull(ndr, "info2", &r->info2); + break; + + case 3: + ndr_print_samr_DispInfoFullGroups(ndr, "info3", &r->info3); + break; + + case 4: + ndr_print_samr_DispInfoAscii(ndr, "info4", &r->info4); + break; + + case 5: + ndr_print_samr_DispInfoAscii(ndr, "info5", &r->info5); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_PwInfo(struct ndr_push *ndr, int ndr_flags, const struct samr_PwInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length)); + NDR_CHECK(ndr_push_samr_PasswordProperties(ndr, NDR_SCALARS, r->password_properties)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_PwInfo(struct ndr_pull *ndr, int ndr_flags, struct samr_PwInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length)); + NDR_CHECK(ndr_pull_samr_PasswordProperties(ndr, NDR_SCALARS, &r->password_properties)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_PwInfo(struct ndr_print *ndr, const char *name, const struct samr_PwInfo *r) +{ + ndr_print_struct(ndr, name, "samr_PwInfo"); + ndr->depth++; + ndr_print_uint16(ndr, "min_password_length", r->min_password_length); + ndr_print_samr_PasswordProperties(ndr, "password_properties", r->password_properties); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ConnectVersion(struct ndr_push *ndr, int ndr_flags, enum samr_ConnectVersion r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ConnectVersion(struct ndr_pull *ndr, int ndr_flags, enum samr_ConnectVersion *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ConnectVersion(struct ndr_print *ndr, const char *name, enum samr_ConnectVersion r) +{ + const char *val = NULL; + + switch (r) { + case SAMR_CONNECT_PRE_W2K: val = "SAMR_CONNECT_PRE_W2K"; break; + case SAMR_CONNECT_W2K: val = "SAMR_CONNECT_W2K"; break; + case SAMR_CONNECT_AFTER_W2K: val = "SAMR_CONNECT_AFTER_W2K"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_ChangeReject(struct ndr_push *ndr, int ndr_flags, const struct samr_ChangeReject *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_RejectReason(ndr, NDR_SCALARS, r->reason)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ChangeReject(struct ndr_pull *ndr, int ndr_flags, struct samr_ChangeReject *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_RejectReason(ndr, NDR_SCALARS, &r->reason)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ChangeReject(struct ndr_print *ndr, const char *name, const struct samr_ChangeReject *r) +{ + ndr_print_struct(ndr, name, "samr_ChangeReject"); + ndr->depth++; + ndr_print_samr_RejectReason(ndr, "reason", r->reason); + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ConnectInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_ConnectInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_ConnectVersion(ndr, NDR_SCALARS, r->client_version)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ConnectInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_ConnectInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_ConnectVersion(ndr, NDR_SCALARS, &r->client_version)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ConnectInfo1(struct ndr_print *ndr, const char *name, const struct samr_ConnectInfo1 *r) +{ + ndr_print_struct(ndr, name, "samr_ConnectInfo1"); + ndr->depth++; + ndr_print_samr_ConnectVersion(ndr, "client_version", r->client_version); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ConnectInfo(struct ndr_push *ndr, int ndr_flags, const union samr_ConnectInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_samr_ConnectInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ConnectInfo(struct ndr_pull *ndr, int ndr_flags, union samr_ConnectInfo *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_ConnectInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ConnectInfo(struct ndr_print *ndr, const char *name, const union samr_ConnectInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_ConnectInfo"); + switch (level) { + case 1: + ndr_print_samr_ConnectInfo1(ndr, "info1", &r->info1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_ValidateFieldsPresent(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidateFieldsPresent(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidateFieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET", SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME", SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_LOCKOUT_TIME", SAMR_VALIDATE_FIELD_LOCKOUT_TIME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT", SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH", SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY", SAMR_VALIDATE_FIELD_PASSWORD_HISTORY, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordLevel(struct ndr_push *ndr, int ndr_flags, enum samr_ValidatePasswordLevel r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordLevel(struct ndr_pull *ndr, int ndr_flags, enum samr_ValidatePasswordLevel *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordLevel(struct ndr_print *ndr, const char *name, enum samr_ValidatePasswordLevel r) +{ + const char *val = NULL; + + switch (r) { + case NetValidateAuthentication: val = "NetValidateAuthentication"; break; + case NetValidatePasswordChange: val = "NetValidatePasswordChange"; break; + case NetValidatePasswordReset: val = "NetValidatePasswordReset"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_ValidationStatus(struct ndr_push *ndr, int ndr_flags, enum samr_ValidationStatus r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidationStatus(struct ndr_pull *ndr, int ndr_flags, enum samr_ValidationStatus *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidationStatus(struct ndr_print *ndr, const char *name, enum samr_ValidationStatus r) +{ + const char *val = NULL; + + switch (r) { + case SAMR_VALIDATION_STATUS_SUCCESS: val = "SAMR_VALIDATION_STATUS_SUCCESS"; break; + case SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE: val = "SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE"; break; + case SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT: val = "SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT"; break; + case SAMR_VALIDATION_STATUS_BAD_PASSWORD: val = "SAMR_VALIDATION_STATUS_BAD_PASSWORD"; break; + case SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT: val = "SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT"; break; + case SAMR_VALIDATION_STATUS_PWD_TOO_SHORT: val = "SAMR_VALIDATION_STATUS_PWD_TOO_SHORT"; break; + case SAMR_VALIDATION_STATUS_PWD_TOO_LONG: val = "SAMR_VALIDATION_STATUS_PWD_TOO_LONG"; break; + case SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH: val = "SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH"; break; + case SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT: val = "SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_ValidationBlob(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidationBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidationBlob(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidationBlob *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidationBlob(struct ndr_print *ndr, const char *name, const struct samr_ValidationBlob *r) +{ + ndr_print_struct(ndr, name, "samr_ValidationBlob"); + ndr->depth++; + ndr_print_uint32(ndr, "length", r->length); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordInfo *r) +{ + uint32_t cntr_pwd_history_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidateFieldsPresent(ndr, NDR_SCALARS, r->fields_present)); + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->bad_password_time)); + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->lockout_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_pwd_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pwd_history_len)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->pwd_history)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->pwd_history) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pwd_history_len)); + for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_SCALARS, &r->pwd_history[cntr_pwd_history_1])); + } + for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->pwd_history[cntr_pwd_history_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordInfo *r) +{ + uint32_t _ptr_pwd_history; + uint32_t cntr_pwd_history_1; + TALLOC_CTX *_mem_save_pwd_history_0; + TALLOC_CTX *_mem_save_pwd_history_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidateFieldsPresent(ndr, NDR_SCALARS, &r->fields_present)); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->bad_password_time)); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->lockout_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_pwd_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pwd_history_len)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pwd_history)); + if (_ptr_pwd_history) { + NDR_PULL_ALLOC(ndr, r->pwd_history); + } else { + r->pwd_history = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->pwd_history) { + _mem_save_pwd_history_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->pwd_history, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->pwd_history)); + NDR_PULL_ALLOC_N(ndr, r->pwd_history, ndr_get_array_size(ndr, &r->pwd_history)); + _mem_save_pwd_history_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->pwd_history, 0); + for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_SCALARS, &r->pwd_history[cntr_pwd_history_1])); + } + for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->pwd_history[cntr_pwd_history_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pwd_history_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pwd_history_0, 0); + } + if (r->pwd_history) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->pwd_history, r->pwd_history_len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordInfo(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordInfo *r) +{ + uint32_t cntr_pwd_history_1; + ndr_print_struct(ndr, name, "samr_ValidatePasswordInfo"); + ndr->depth++; + ndr_print_samr_ValidateFieldsPresent(ndr, "fields_present", r->fields_present); + ndr_print_NTTIME_hyper(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME_hyper(ndr, "bad_password_time", r->bad_password_time); + ndr_print_NTTIME_hyper(ndr, "lockout_time", r->lockout_time); + ndr_print_uint32(ndr, "bad_pwd_count", r->bad_pwd_count); + ndr_print_uint32(ndr, "pwd_history_len", r->pwd_history_len); + ndr_print_ptr(ndr, "pwd_history", r->pwd_history); + ndr->depth++; + if (r->pwd_history) { + ndr->print(ndr, "%s: ARRAY(%d)", "pwd_history", (int)r->pwd_history_len); + ndr->depth++; + for (cntr_pwd_history_1=0;cntr_pwd_history_1pwd_history_len;cntr_pwd_history_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_pwd_history_1) != -1) { + ndr_print_samr_ValidationBlob(ndr, "pwd_history", &r->pwd_history[cntr_pwd_history_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordRepCtr(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordRepCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_samr_ValidationStatus(ndr, NDR_SCALARS, r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordRepCtr(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordRepCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_samr_ValidationStatus(ndr, NDR_SCALARS, &r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordRepCtr(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordRepCtr *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePasswordRepCtr"); + ndr->depth++; + ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); + ndr_print_samr_ValidationStatus(ndr, "status", r->status); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordRep(struct ndr_push *ndr, int ndr_flags, const union samr_ValidatePasswordRep *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr3)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordRep(struct ndr_pull *ndr, int ndr_flags, union samr_ValidatePasswordRep *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr3)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + case 2: + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case 3: + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordRep(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordRep *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_ValidatePasswordRep"); + switch (level) { + case 1: + ndr_print_samr_ValidatePasswordRepCtr(ndr, "ctr1", &r->ctr1); + break; + + case 2: + ndr_print_samr_ValidatePasswordRepCtr(ndr, "ctr2", &r->ctr2); + break; + + case 3: + ndr_print_samr_ValidatePasswordRepCtr(ndr, "ctr3", &r->ctr3); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordReq3(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordReq3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pwd_must_change_at_next_logon)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->clear_lockout)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq3(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordReq3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pwd_must_change_at_next_logon)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->clear_lockout)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordReq3(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq3 *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePasswordReq3"); + ndr->depth++; + ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); + ndr_print_lsa_StringLarge(ndr, "password", &r->password); + ndr_print_lsa_StringLarge(ndr, "account", &r->account); + ndr_print_samr_ValidationBlob(ndr, "hash", &r->hash); + ndr_print_uint8(ndr, "pwd_must_change_at_next_logon", r->pwd_must_change_at_next_logon); + ndr_print_uint8(ndr, "clear_lockout", r->clear_lockout); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordReq2(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordReq2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_matched)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq2(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordReq2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_matched)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordReq2(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq2 *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePasswordReq2"); + ndr->depth++; + ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); + ndr_print_lsa_StringLarge(ndr, "password", &r->password); + ndr_print_lsa_StringLarge(ndr, "account", &r->account); + ndr_print_samr_ValidationBlob(ndr, "hash", &r->hash); + ndr_print_uint8(ndr, "password_matched", r->password_matched); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordReq1(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordReq1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_matched)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq1(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordReq1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_matched)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordReq1(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq1 *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePasswordReq1"); + ndr->depth++; + ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); + ndr_print_uint8(ndr, "password_matched", r->password_matched); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordReq(struct ndr_push *ndr, int ndr_flags, const union samr_ValidatePasswordReq *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_samr_ValidatePasswordReq1(ndr, NDR_SCALARS, &r->req1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_samr_ValidatePasswordReq2(ndr, NDR_SCALARS, &r->req2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_samr_ValidatePasswordReq3(ndr, NDR_SCALARS, &r->req3)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_ValidatePasswordReq1(ndr, NDR_BUFFERS, &r->req1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_ValidatePasswordReq2(ndr, NDR_BUFFERS, &r->req2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_ValidatePasswordReq3(ndr, NDR_BUFFERS, &r->req3)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq(struct ndr_pull *ndr, int ndr_flags, union samr_ValidatePasswordReq *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq1(ndr, NDR_SCALARS, &r->req1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq2(ndr, NDR_SCALARS, &r->req2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq3(ndr, NDR_SCALARS, &r->req3)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq1(ndr, NDR_BUFFERS, &r->req1)); + break; + + case 2: + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq2(ndr, NDR_BUFFERS, &r->req2)); + break; + + case 3: + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq3(ndr, NDR_BUFFERS, &r->req3)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordReq(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordReq *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_ValidatePasswordReq"); + switch (level) { + case 1: + ndr_print_samr_ValidatePasswordReq1(ndr, "req1", &r->req1); + break; + + case 2: + ndr_print_samr_ValidatePasswordReq2(ndr, "req2", &r->req2); + break; + + case 3: + ndr_print_samr_ValidatePasswordReq3(ndr, "req3", &r->req3); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_Connect(struct ndr_push *ndr, int flags, const struct samr_Connect *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Connect(struct ndr_pull *ndr, int flags, struct samr_Connect *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect *r) +{ + ndr_print_struct(ndr, name, "samr_Connect"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_Close(struct ndr_push *ndr, int flags, const struct samr_Close *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_Close(struct ndr_pull *ndr, int flags, struct samr_Close *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.handle); + *r->out.handle = *r->in.handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Close(struct ndr_print *ndr, const char *name, int flags, const struct samr_Close *r) +{ + ndr_print_struct(ndr, name, "samr_Close"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Close"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Close"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetSecurity(struct ndr_push *ndr, int flags, const struct samr_SetSecurity *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); + if (r->in.sdbuf == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetSecurity(struct ndr_pull *ndr, int flags, struct samr_SetSecurity *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sdbuf_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sdbuf); + } + _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sdbuf, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetSecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetSecurity *r) +{ + ndr_print_struct(ndr, name, "samr_SetSecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetSecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); + ndr_print_ptr(ndr, "sdbuf", r->in.sdbuf); + ndr->depth++; + ndr_print_sec_desc_buf(ndr, "sdbuf", r->in.sdbuf); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetSecurity"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QuerySecurity(struct ndr_push *ndr, int flags, const struct samr_QuerySecurity *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); + } + if (flags & NDR_OUT) { + if (r->out.sdbuf == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sdbuf)); + if (*r->out.sdbuf) { + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QuerySecurity(struct ndr_pull *ndr, int flags, struct samr_QuerySecurity *r) +{ + uint32_t _ptr_sdbuf; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sdbuf_0; + TALLOC_CTX *_mem_save_sdbuf_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); + NDR_PULL_ALLOC(ndr, r->out.sdbuf); + ZERO_STRUCTP(r->out.sdbuf); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sdbuf); + } + _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sdbuf, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sdbuf)); + if (_ptr_sdbuf) { + NDR_PULL_ALLOC(ndr, *r->out.sdbuf); + } else { + *r->out.sdbuf = NULL; + } + if (*r->out.sdbuf) { + _mem_save_sdbuf_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sdbuf, 0); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_QuerySecurity *r) +{ + ndr_print_struct(ndr, name, "samr_QuerySecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QuerySecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QuerySecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "sdbuf", r->out.sdbuf); + ndr->depth++; + ndr_print_ptr(ndr, "sdbuf", *r->out.sdbuf); + ndr->depth++; + if (*r->out.sdbuf) { + ndr_print_sec_desc_buf(ndr, "sdbuf", *r->out.sdbuf); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Shutdown(struct ndr_push *ndr, int flags, const struct samr_Shutdown *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Shutdown(struct ndr_pull *ndr, int flags, struct samr_Shutdown *r) +{ + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Shutdown(struct ndr_print *ndr, const char *name, int flags, const struct samr_Shutdown *r) +{ + ndr_print_struct(ndr, name, "samr_Shutdown"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Shutdown"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Shutdown"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_LookupDomain(struct ndr_push *ndr, int flags, const struct samr_LookupDomain *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + if (r->in.domain_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.domain_name)); + } + if (flags & NDR_OUT) { + if (r->out.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sid)); + if (*r->out.sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sid)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_LookupDomain(struct ndr_pull *ndr, int flags, struct samr_LookupDomain *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_connect_handle_0; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_sid_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_name); + } + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.sid); + ZERO_STRUCTP(r->out.sid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, *r->out.sid); + } else { + *r->out.sid = NULL; + } + if (*r->out.sid) { + _mem_save_sid_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_LookupDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupDomain *r) +{ + ndr_print_struct(ndr, name, "samr_LookupDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_LookupDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "domain_name", r->in.domain_name); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_LookupDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->out.sid); + ndr->depth++; + ndr_print_ptr(ndr, "sid", *r->out.sid); + ndr->depth++; + if (*r->out.sid) { + ndr_print_dom_sid2(ndr, "sid", *r->out.sid); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_EnumDomains(struct ndr_push *ndr, int flags, const struct samr_EnumDomains *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + 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.buf_size)); + } + if (flags & NDR_OUT) { + 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.sam == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sam)); + if (*r->out.sam) { + NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + } + if (r->out.num_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_EnumDomains(struct ndr_pull *ndr, int flags, struct samr_EnumDomains *r) +{ + uint32_t _ptr_sam; + TALLOC_CTX *_mem_save_connect_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_sam_1; + TALLOC_CTX *_mem_save_num_entries_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.sam); + ZERO_STRUCTP(r->out.sam); + NDR_PULL_ALLOC(ndr, r->out.num_entries); + ZERO_STRUCTP(r->out.num_entries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sam); + } + _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam)); + if (_ptr_sam) { + NDR_PULL_ALLOC(ndr, *r->out.sam); + } else { + *r->out.sam = NULL; + } + if (*r->out.sam) { + _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_entries); + } + _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_EnumDomains(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomains *r) +{ + ndr_print_struct(ndr, name, "samr_EnumDomains"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_EnumDomains"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_EnumDomains"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sam", r->out.sam); + ndr->depth++; + ndr_print_ptr(ndr, "sam", *r->out.sam); + ndr->depth++; + if (*r->out.sam) { + ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "num_entries", r->out.num_entries); + ndr->depth++; + ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_OpenDomain(struct ndr_push *ndr, int flags, const struct samr_OpenDomain *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_CHECK(ndr_push_samr_DomainAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + 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.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.domain_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_OpenDomain(struct ndr_pull *ndr, int flags, struct samr_OpenDomain *r) +{ + TALLOC_CTX *_mem_save_connect_handle_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_domain_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_DomainAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.domain_handle); + ZERO_STRUCTP(r->out.domain_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OpenDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenDomain *r) +{ + ndr_print_struct(ndr, name, "samr_OpenDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OpenDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr_print_samr_DomainAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OpenDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->out.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->out.domain_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDomainInfo(struct ndr_push *ndr, int flags, const struct samr_QueryDomainInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDomainInfo(struct ndr_pull *ndr, int flags, struct samr_QueryDomainInfo *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDomainInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_DomainInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetDomainInfo(struct ndr_push *ndr, int flags, const struct samr_SetDomainInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + 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_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetDomainInfo(struct ndr_pull *ndr, int flags, struct samr_SetDomainInfo *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDomainInfo *r) +{ + ndr_print_struct(ndr, name, "samr_SetDomainInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_DomainInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetDomainInfo"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CreateDomainGroup(struct ndr_push *ndr, int flags, const struct samr_CreateDomainGroup *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + 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)); + NDR_CHECK(ndr_push_samr_GroupAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CreateDomainGroup(struct ndr_pull *ndr, int flags, struct samr_CreateDomainGroup *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_GroupAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.group_handle); + ZERO_STRUCTP(r->out.group_handle); + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CreateDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomainGroup *r) +{ + ndr_print_struct(ndr, name, "samr_CreateDomainGroup"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_CreateDomainGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", r->in.name); + ndr->depth--; + ndr_print_samr_GroupAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_CreateDomainGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->out.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->out.group_handle); + ndr->depth--; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_EnumDomainGroups(struct ndr_push *ndr, int flags, const struct samr_EnumDomainGroups *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + 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 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.sam == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sam)); + if (*r->out.sam) { + NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + } + if (r->out.num_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_EnumDomainGroups(struct ndr_pull *ndr, int flags, struct samr_EnumDomainGroups *r) +{ + uint32_t _ptr_sam; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_sam_1; + TALLOC_CTX *_mem_save_num_entries_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.sam); + ZERO_STRUCTP(r->out.sam); + NDR_PULL_ALLOC(ndr, r->out.num_entries); + ZERO_STRUCTP(r->out.num_entries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sam); + } + _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam)); + if (_ptr_sam) { + NDR_PULL_ALLOC(ndr, *r->out.sam); + } else { + *r->out.sam = NULL; + } + if (*r->out.sam) { + _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_entries); + } + _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_EnumDomainGroups(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainGroups *r) +{ + ndr_print_struct(ndr, name, "samr_EnumDomainGroups"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_EnumDomainGroups"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_uint32(ndr, "max_size", r->in.max_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_EnumDomainGroups"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sam", r->out.sam); + ndr->depth++; + ndr_print_ptr(ndr, "sam", *r->out.sam); + ndr->depth++; + if (*r->out.sam) { + ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "num_entries", r->out.num_entries); + ndr->depth++; + ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CreateUser(struct ndr_push *ndr, int flags, const struct samr_CreateUser *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.account_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.account_name)); + NDR_CHECK(ndr_push_samr_UserAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CreateUser(struct ndr_pull *ndr, int flags, struct samr_CreateUser *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_account_name_0; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account_name); + } + _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_UserAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.user_handle); + ZERO_STRUCTP(r->out.user_handle); + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CreateUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser *r) +{ + ndr_print_struct(ndr, name, "samr_CreateUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_CreateUser"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "account_name", r->in.account_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", r->in.account_name); + ndr->depth--; + ndr_print_samr_UserAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_CreateUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->out.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); + ndr->depth--; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_EnumDomainUsers(struct ndr_push *ndr, int flags, const struct samr_EnumDomainUsers *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + 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_samr_AcctFlags(ndr, NDR_SCALARS, r->in.acct_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_size)); + } + if (flags & NDR_OUT) { + 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.sam == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sam)); + if (*r->out.sam) { + NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + } + if (r->out.num_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_EnumDomainUsers(struct ndr_pull *ndr, int flags, struct samr_EnumDomainUsers *r) +{ + uint32_t _ptr_sam; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_sam_1; + TALLOC_CTX *_mem_save_num_entries_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.acct_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.sam); + ZERO_STRUCTP(r->out.sam); + NDR_PULL_ALLOC(ndr, r->out.num_entries); + ZERO_STRUCTP(r->out.num_entries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sam); + } + _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam)); + if (_ptr_sam) { + NDR_PULL_ALLOC(ndr, *r->out.sam); + } else { + *r->out.sam = NULL; + } + if (*r->out.sam) { + _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_entries); + } + _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_EnumDomainUsers(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainUsers *r) +{ + ndr_print_struct(ndr, name, "samr_EnumDomainUsers"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_EnumDomainUsers"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->in.acct_flags); + ndr_print_uint32(ndr, "max_size", r->in.max_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_EnumDomainUsers"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sam", r->out.sam); + ndr->depth++; + ndr_print_ptr(ndr, "sam", *r->out.sam); + ndr->depth++; + if (*r->out.sam) { + ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "num_entries", r->out.num_entries); + ndr->depth++; + ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CreateDomAlias(struct ndr_push *ndr, int flags, const struct samr_CreateDomAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.alias_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.alias_name)); + NDR_CHECK(ndr_push_samr_AliasAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CreateDomAlias(struct ndr_pull *ndr, int flags, struct samr_CreateDomAlias *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_alias_name_0; + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_name); + } + _mem_save_alias_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.alias_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AliasAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + ZERO_STRUCTP(r->out.alias_handle); + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CreateDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomAlias *r) +{ + ndr_print_struct(ndr, name, "samr_CreateDomAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_CreateDomAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "alias_name", r->in.alias_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "alias_name", r->in.alias_name); + ndr->depth--; + ndr_print_samr_AliasAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_CreateDomAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->out.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->out.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_EnumDomainAliases(struct ndr_push *ndr, int flags, const struct samr_EnumDomainAliases *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + 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 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.sam == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sam)); + if (*r->out.sam) { + NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + } + if (r->out.num_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_EnumDomainAliases(struct ndr_pull *ndr, int flags, struct samr_EnumDomainAliases *r) +{ + uint32_t _ptr_sam; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_sam_1; + TALLOC_CTX *_mem_save_num_entries_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.sam); + ZERO_STRUCTP(r->out.sam); + NDR_PULL_ALLOC(ndr, r->out.num_entries); + ZERO_STRUCTP(r->out.num_entries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sam); + } + _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam)); + if (_ptr_sam) { + NDR_PULL_ALLOC(ndr, *r->out.sam); + } else { + *r->out.sam = NULL; + } + if (*r->out.sam) { + _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_entries); + } + _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_EnumDomainAliases(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainAliases *r) +{ + ndr_print_struct(ndr, name, "samr_EnumDomainAliases"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_EnumDomainAliases"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_uint32(ndr, "max_size", r->in.max_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_EnumDomainAliases"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sam", r->out.sam); + ndr->depth++; + ndr_print_ptr(ndr, "sam", *r->out.sam); + ndr->depth++; + if (*r->out.sam) { + ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "num_entries", r->out.num_entries); + ndr->depth++; + ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetAliasMembership(struct ndr_push *ndr, int flags, const struct samr_GetAliasMembership *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + 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 (flags & NDR_OUT) { + if (r->out.rids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetAliasMembership(struct ndr_pull *ndr, int flags, struct samr_GetAliasMembership *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_rids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.rids); + ZERO_STRUCTP(r->out.rids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rids); + } + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetAliasMembership(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetAliasMembership *r) +{ + ndr_print_struct(ndr, name, "samr_GetAliasMembership"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetAliasMembership"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetAliasMembership"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->out.rids); + ndr->depth++; + ndr_print_samr_Ids(ndr, "rids", r->out.rids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_LookupNames(struct ndr_push *ndr, int flags, const struct samr_LookupNames *r) +{ + uint32_t cntr_names_0; + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1000)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + 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 (flags & NDR_OUT) { + if (r->out.rids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + if (r->out.types == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_LookupNames(struct ndr_pull *ndr, int flags, struct samr_LookupNames *r) +{ + uint32_t cntr_names_0; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_types_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); + if (r->in.num_names < 0 || r->in.num_names > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.names)); + if (ndr_get_array_length(ndr, &r->in.names) > ndr_get_array_size(ndr, &r->in.names)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.names), ndr_get_array_length(ndr, &r->in.names)); + } + NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + NDR_PULL_ALLOC(ndr, r->out.rids); + ZERO_STRUCTP(r->out.rids); + NDR_PULL_ALLOC(ndr, r->out.types); + ZERO_STRUCTP(r->out.types); + if (r->in.names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, 1000)); + } + if (r->in.names) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.names, r->in.num_names)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rids); + } + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.types); + } + _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.types, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupNames *r) +{ + uint32_t cntr_names_0; + ndr_print_struct(ndr, name, "samr_LookupNames"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_LookupNames"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint32(ndr, "num_names", r->in.num_names); + ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); + ndr->depth++; + for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { + ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_LookupNames"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->out.rids); + ndr->depth++; + ndr_print_samr_Ids(ndr, "rids", r->out.rids); + ndr->depth--; + ndr_print_ptr(ndr, "types", r->out.types); + ndr->depth++; + ndr_print_samr_Ids(ndr, "types", r->out.types); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_LookupRids(struct ndr_push *ndr, int flags, const struct samr_LookupRids *r) +{ + uint32_t cntr_rids_0; + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_rids)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1000)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_rids)); + for (cntr_rids_0 = 0; cntr_rids_0 < r->in.num_rids; cntr_rids_0++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rids[cntr_rids_0])); + } + } + if (flags & NDR_OUT) { + if (r->out.names == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_Strings(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); + if (r->out.types == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_LookupRids(struct ndr_pull *ndr, int flags, struct samr_LookupRids *r) +{ + uint32_t cntr_rids_0; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_types_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_rids)); + if (r->in.num_rids < 0 || r->in.num_rids > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rids)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rids)); + if (ndr_get_array_length(ndr, &r->in.rids) > ndr_get_array_size(ndr, &r->in.rids)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rids), ndr_get_array_length(ndr, &r->in.rids)); + } + NDR_PULL_ALLOC_N(ndr, r->in.rids, ndr_get_array_size(ndr, &r->in.rids)); + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.rids, 0); + for (cntr_rids_0 = 0; cntr_rids_0 < r->in.num_rids; cntr_rids_0++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rids[cntr_rids_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); + NDR_PULL_ALLOC(ndr, r->out.names); + ZERO_STRUCTP(r->out.names); + NDR_PULL_ALLOC(ndr, r->out.types); + ZERO_STRUCTP(r->out.types); + if (r->in.rids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.rids, 1000)); + } + if (r->in.rids) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.rids, r->in.num_rids)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.names); + } + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_Strings(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.types); + } + _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.types, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_LookupRids(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupRids *r) +{ + uint32_t cntr_rids_0; + ndr_print_struct(ndr, name, "samr_LookupRids"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_LookupRids"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint32(ndr, "num_rids", r->in.num_rids); + ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->in.num_rids); + ndr->depth++; + for (cntr_rids_0=0;cntr_rids_0in.num_rids;cntr_rids_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_rids_0) != -1) { + ndr_print_uint32(ndr, "rids", r->in.rids[cntr_rids_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_LookupRids"); + ndr->depth++; + ndr_print_ptr(ndr, "names", r->out.names); + ndr->depth++; + ndr_print_lsa_Strings(ndr, "names", r->out.names); + ndr->depth--; + ndr_print_ptr(ndr, "types", r->out.types); + ndr->depth++; + ndr_print_samr_Ids(ndr, "types", r->out.types); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_OpenGroup(struct ndr_push *ndr, int flags, const struct samr_OpenGroup *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_samr_GroupAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + if (r->out.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_OpenGroup(struct ndr_pull *ndr, int flags, struct samr_OpenGroup *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_GroupAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_PULL_ALLOC(ndr, r->out.group_handle); + ZERO_STRUCTP(r->out.group_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OpenGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenGroup *r) +{ + ndr_print_struct(ndr, name, "samr_OpenGroup"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OpenGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_samr_GroupAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OpenGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->out.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->out.group_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryGroupInfo(struct ndr_push *ndr, int flags, const struct samr_QueryGroupInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryGroupInfo(struct ndr_pull *ndr, int flags, struct samr_QueryGroupInfo *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_GroupInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryGroupInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryGroupInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_samr_GroupInfoEnum(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryGroupInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_GroupInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetGroupInfo(struct ndr_push *ndr, int flags, const struct samr_SetGroupInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, r->in.level)); + 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_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetGroupInfo(struct ndr_pull *ndr, int flags, struct samr_SetGroupInfo *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_GroupInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetGroupInfo *r) +{ + ndr_print_struct(ndr, name, "samr_SetGroupInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetGroupInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_samr_GroupInfoEnum(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_GroupInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetGroupInfo"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AddGroupMember(struct ndr_push *ndr, int flags, const struct samr_AddGroupMember *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AddGroupMember(struct ndr_pull *ndr, int flags, struct samr_AddGroupMember *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AddGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddGroupMember *r) +{ + ndr_print_struct(ndr, name, "samr_AddGroupMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_AddGroupMember"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_AddGroupMember"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteDomainGroup(struct ndr_push *ndr, int flags, const struct samr_DeleteDomainGroup *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + } + if (flags & NDR_OUT) { + if (r->out.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteDomainGroup(struct ndr_pull *ndr, int flags, struct samr_DeleteDomainGroup *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.group_handle); + *r->out.group_handle = *r->in.group_handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomainGroup *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteDomainGroup"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteDomainGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteDomainGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->out.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->out.group_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteGroupMember(struct ndr_push *ndr, int flags, const struct samr_DeleteGroupMember *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteGroupMember(struct ndr_pull *ndr, int flags, struct samr_DeleteGroupMember *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteGroupMember *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteGroupMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteGroupMember"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteGroupMember"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryGroupMember(struct ndr_push *ndr, int flags, const struct samr_QueryGroupMember *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + } + if (flags & NDR_OUT) { + if (r->out.rids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.rids)); + if (*r->out.rids) { + NDR_CHECK(ndr_push_samr_RidTypeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryGroupMember(struct ndr_pull *ndr, int flags, struct samr_QueryGroupMember *r) +{ + uint32_t _ptr_rids; + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_rids_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.rids); + ZERO_STRUCTP(r->out.rids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rids); + } + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); + if (_ptr_rids) { + NDR_PULL_ALLOC(ndr, *r->out.rids); + } else { + *r->out.rids = NULL; + } + if (*r->out.rids) { + _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.rids, 0); + NDR_CHECK(ndr_pull_samr_RidTypeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupMember *r) +{ + ndr_print_struct(ndr, name, "samr_QueryGroupMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryGroupMember"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryGroupMember"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->out.rids); + ndr->depth++; + ndr_print_ptr(ndr, "rids", *r->out.rids); + ndr->depth++; + if (*r->out.rids) { + ndr_print_samr_RidTypeArray(ndr, "rids", *r->out.rids); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetMemberAttributesOfGroup(struct ndr_push *ndr, int flags, const struct samr_SetMemberAttributesOfGroup *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetMemberAttributesOfGroup(struct ndr_pull *ndr, int flags, struct samr_SetMemberAttributesOfGroup *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetMemberAttributesOfGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetMemberAttributesOfGroup *r) +{ + ndr_print_struct(ndr, name, "samr_SetMemberAttributesOfGroup"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetMemberAttributesOfGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_uint32(ndr, "unknown1", r->in.unknown1); + ndr_print_uint32(ndr, "unknown2", r->in.unknown2); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetMemberAttributesOfGroup"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_OpenAlias(struct ndr_push *ndr, int flags, const struct samr_OpenAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_samr_AliasAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + if (r->out.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_OpenAlias(struct ndr_pull *ndr, int flags, struct samr_OpenAlias *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_alias_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AliasAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + ZERO_STRUCTP(r->out.alias_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OpenAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenAlias *r) +{ + ndr_print_struct(ndr, name, "samr_OpenAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OpenAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_samr_AliasAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OpenAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->out.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->out.alias_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryAliasInfo(struct ndr_push *ndr, int flags, const struct samr_QueryAliasInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryAliasInfo(struct ndr_pull *ndr, int flags, struct samr_QueryAliasInfo *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AliasInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryAliasInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryAliasInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryAliasInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_samr_AliasInfoEnum(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryAliasInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_AliasInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetAliasInfo(struct ndr_push *ndr, int flags, const struct samr_SetAliasInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, r->in.level)); + 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_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetAliasInfo(struct ndr_pull *ndr, int flags, struct samr_SetAliasInfo *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AliasInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetAliasInfo *r) +{ + ndr_print_struct(ndr, name, "samr_SetAliasInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetAliasInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_samr_AliasInfoEnum(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_AliasInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetAliasInfo"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteDomAlias(struct ndr_push *ndr, int flags, const struct samr_DeleteDomAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + } + if (flags & NDR_OUT) { + if (r->out.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteDomAlias(struct ndr_pull *ndr, int flags, struct samr_DeleteDomAlias *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + *r->out.alias_handle = *r->in.alias_handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomAlias *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteDomAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteDomAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteDomAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->out.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->out.alias_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AddAliasMember(struct ndr_push *ndr, int flags, const struct samr_AddAliasMember *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + 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) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AddAliasMember(struct ndr_pull *ndr, int flags, struct samr_AddAliasMember *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AddAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddAliasMember *r) +{ + ndr_print_struct(ndr, name, "samr_AddAliasMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_AddAliasMember"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_AddAliasMember"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteAliasMember(struct ndr_push *ndr, int flags, const struct samr_DeleteAliasMember *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + 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) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteAliasMember(struct ndr_pull *ndr, int flags, struct samr_DeleteAliasMember *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteAliasMember *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteAliasMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteAliasMember"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteAliasMember"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetMembersInAlias(struct ndr_push *ndr, int flags, const struct samr_GetMembersInAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetMembersInAlias(struct ndr_pull *ndr, int flags, struct samr_GetMembersInAlias *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.sids); + ZERO_STRUCTP(r->out.sids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetMembersInAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetMembersInAlias *r) +{ + ndr_print_struct(ndr, name, "samr_GetMembersInAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetMembersInAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetMembersInAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_OpenUser(struct ndr_push *ndr, int flags, const struct samr_OpenUser *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_samr_UserAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + if (r->out.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_OpenUser(struct ndr_pull *ndr, int flags, struct samr_OpenUser *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_user_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_UserAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_PULL_ALLOC(ndr, r->out.user_handle); + ZERO_STRUCTP(r->out.user_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OpenUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenUser *r) +{ + ndr_print_struct(ndr, name, "samr_OpenUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OpenUser"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_samr_UserAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OpenUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->out.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteUser(struct ndr_push *ndr, int flags, const struct samr_DeleteUser *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + } + if (flags & NDR_OUT) { + if (r->out.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteUser(struct ndr_pull *ndr, int flags, struct samr_DeleteUser *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.user_handle); + *r->out.user_handle = *r->in.user_handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteUser *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->out.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_QueryUserInfo(struct ndr_push *ndr, int flags, const struct samr_QueryUserInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_QueryUserInfo(struct ndr_pull *ndr, int flags, struct samr_QueryUserInfo *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryUserInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryUserInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryUserInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_UserInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_SetUserInfo(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + 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_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_SetUserInfo(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo *r) +{ + ndr_print_struct(ndr, name, "samr_SetUserInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetUserInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_UserInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetUserInfo"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ChangePasswordUser(struct ndr_push *ndr, int flags, const struct samr_ChangePasswordUser *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.lm_present)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_lm_crypted)); + if (r->in.old_lm_crypted) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.old_lm_crypted)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_lm_crypted)); + if (r->in.new_lm_crypted) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_lm_crypted)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.nt_present)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_nt_crypted)); + if (r->in.old_nt_crypted) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.old_nt_crypted)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_nt_crypted)); + if (r->in.new_nt_crypted) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_nt_crypted)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.cross1_present)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_cross)); + if (r->in.nt_cross) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.nt_cross)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.cross2_present)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_cross)); + if (r->in.lm_cross) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.lm_cross)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ChangePasswordUser(struct ndr_pull *ndr, int flags, struct samr_ChangePasswordUser *r) +{ + uint32_t _ptr_old_lm_crypted; + uint32_t _ptr_new_lm_crypted; + uint32_t _ptr_old_nt_crypted; + uint32_t _ptr_new_nt_crypted; + uint32_t _ptr_nt_cross; + uint32_t _ptr_lm_cross; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_old_lm_crypted_0; + TALLOC_CTX *_mem_save_new_lm_crypted_0; + TALLOC_CTX *_mem_save_old_nt_crypted_0; + TALLOC_CTX *_mem_save_new_nt_crypted_0; + TALLOC_CTX *_mem_save_nt_cross_0; + TALLOC_CTX *_mem_save_lm_cross_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.lm_present)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_lm_crypted)); + if (_ptr_old_lm_crypted) { + NDR_PULL_ALLOC(ndr, r->in.old_lm_crypted); + } else { + r->in.old_lm_crypted = NULL; + } + if (r->in.old_lm_crypted) { + _mem_save_old_lm_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.old_lm_crypted, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.old_lm_crypted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_lm_crypted_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_lm_crypted)); + if (_ptr_new_lm_crypted) { + NDR_PULL_ALLOC(ndr, r->in.new_lm_crypted); + } else { + r->in.new_lm_crypted = NULL; + } + if (r->in.new_lm_crypted) { + _mem_save_new_lm_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_lm_crypted, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_lm_crypted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_lm_crypted_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.nt_present)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_nt_crypted)); + if (_ptr_old_nt_crypted) { + NDR_PULL_ALLOC(ndr, r->in.old_nt_crypted); + } else { + r->in.old_nt_crypted = NULL; + } + if (r->in.old_nt_crypted) { + _mem_save_old_nt_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.old_nt_crypted, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.old_nt_crypted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_nt_crypted_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_nt_crypted)); + if (_ptr_new_nt_crypted) { + NDR_PULL_ALLOC(ndr, r->in.new_nt_crypted); + } else { + r->in.new_nt_crypted = NULL; + } + if (r->in.new_nt_crypted) { + _mem_save_new_nt_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_nt_crypted, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_nt_crypted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_nt_crypted_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.cross1_present)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_cross)); + if (_ptr_nt_cross) { + NDR_PULL_ALLOC(ndr, r->in.nt_cross); + } else { + r->in.nt_cross = NULL; + } + if (r->in.nt_cross) { + _mem_save_nt_cross_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_cross, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.nt_cross)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_cross_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.cross2_present)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_cross)); + if (_ptr_lm_cross) { + NDR_PULL_ALLOC(ndr, r->in.lm_cross); + } else { + r->in.lm_cross = NULL; + } + if (r->in.lm_cross) { + _mem_save_lm_cross_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_cross, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.lm_cross)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_cross_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ChangePasswordUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser *r) +{ + ndr_print_struct(ndr, name, "samr_ChangePasswordUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_ChangePasswordUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint8(ndr, "lm_present", r->in.lm_present); + ndr_print_ptr(ndr, "old_lm_crypted", r->in.old_lm_crypted); + ndr->depth++; + if (r->in.old_lm_crypted) { + ndr_print_samr_Password(ndr, "old_lm_crypted", r->in.old_lm_crypted); + } + ndr->depth--; + ndr_print_ptr(ndr, "new_lm_crypted", r->in.new_lm_crypted); + ndr->depth++; + if (r->in.new_lm_crypted) { + ndr_print_samr_Password(ndr, "new_lm_crypted", r->in.new_lm_crypted); + } + ndr->depth--; + ndr_print_uint8(ndr, "nt_present", r->in.nt_present); + ndr_print_ptr(ndr, "old_nt_crypted", r->in.old_nt_crypted); + ndr->depth++; + if (r->in.old_nt_crypted) { + ndr_print_samr_Password(ndr, "old_nt_crypted", r->in.old_nt_crypted); + } + ndr->depth--; + ndr_print_ptr(ndr, "new_nt_crypted", r->in.new_nt_crypted); + ndr->depth++; + if (r->in.new_nt_crypted) { + ndr_print_samr_Password(ndr, "new_nt_crypted", r->in.new_nt_crypted); + } + ndr->depth--; + ndr_print_uint8(ndr, "cross1_present", r->in.cross1_present); + ndr_print_ptr(ndr, "nt_cross", r->in.nt_cross); + ndr->depth++; + if (r->in.nt_cross) { + ndr_print_samr_Password(ndr, "nt_cross", r->in.nt_cross); + } + ndr->depth--; + ndr_print_uint8(ndr, "cross2_present", r->in.cross2_present); + ndr_print_ptr(ndr, "lm_cross", r->in.lm_cross); + ndr->depth++; + if (r->in.lm_cross) { + ndr_print_samr_Password(ndr, "lm_cross", r->in.lm_cross); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_ChangePasswordUser"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetGroupsForUser(struct ndr_push *ndr, int flags, const struct samr_GetGroupsForUser *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + } + if (flags & NDR_OUT) { + if (r->out.rids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.rids)); + if (*r->out.rids) { + NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetGroupsForUser(struct ndr_pull *ndr, int flags, struct samr_GetGroupsForUser *r) +{ + uint32_t _ptr_rids; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_rids_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.rids); + ZERO_STRUCTP(r->out.rids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rids); + } + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); + if (_ptr_rids) { + NDR_PULL_ALLOC(ndr, *r->out.rids); + } else { + *r->out.rids = NULL; + } + if (*r->out.rids) { + _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.rids, 0); + NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetGroupsForUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetGroupsForUser *r) +{ + ndr_print_struct(ndr, name, "samr_GetGroupsForUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetGroupsForUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetGroupsForUser"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->out.rids); + ndr->depth++; + ndr_print_ptr(ndr, "rids", *r->out.rids); + ndr->depth++; + if (*r->out.rids) { + ndr_print_samr_RidWithAttributeArray(ndr, "rids", *r->out.rids); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDisplayInfo(struct ndr_push *ndr, int flags, const struct samr_QueryDisplayInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_entries)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + } + if (flags & NDR_OUT) { + if (r->out.total_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_size)); + if (r->out.returned_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.returned_size)); + 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_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDisplayInfo(struct ndr_pull *ndr, int flags, struct samr_QueryDisplayInfo *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_total_size_0; + TALLOC_CTX *_mem_save_returned_size_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_entries)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.total_size); + ZERO_STRUCTP(r->out.total_size); + NDR_PULL_ALLOC(ndr, r->out.returned_size); + ZERO_STRUCTP(r->out.returned_size); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.total_size); + } + _mem_save_total_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.returned_size); + } + _mem_save_returned_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.returned_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDisplayInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDisplayInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDisplayInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "start_idx", r->in.start_idx); + ndr_print_uint32(ndr, "max_entries", r->in.max_entries); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDisplayInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "total_size", r->out.total_size); + ndr->depth++; + ndr_print_uint32(ndr, "total_size", *r->out.total_size); + ndr->depth--; + ndr_print_ptr(ndr, "returned_size", r->out.returned_size); + ndr->depth++; + ndr_print_uint32(ndr, "returned_size", *r->out.returned_size); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_DispInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetDisplayEnumerationIndex(struct ndr_push *ndr, int flags, const struct samr_GetDisplayEnumerationIndex *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + 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.idx == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.idx)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetDisplayEnumerationIndex(struct ndr_pull *ndr, int flags, struct samr_GetDisplayEnumerationIndex *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_idx_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.idx); + ZERO_STRUCTP(r->out.idx); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.idx); + } + _mem_save_idx_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.idx, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.idx)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_idx_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetDisplayEnumerationIndex(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex *r) +{ + ndr_print_struct(ndr, name, "samr_GetDisplayEnumerationIndex"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetDisplayEnumerationIndex"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", r->in.name); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetDisplayEnumerationIndex"); + ndr->depth++; + ndr_print_ptr(ndr, "idx", r->out.idx); + ndr->depth++; + ndr_print_uint32(ndr, "idx", *r->out.idx); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_TestPrivateFunctionsDomain(struct ndr_push *ndr, int flags, const struct samr_TestPrivateFunctionsDomain *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_TestPrivateFunctionsDomain(struct ndr_pull *ndr, int flags, struct samr_TestPrivateFunctionsDomain *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_TestPrivateFunctionsDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsDomain *r) +{ + ndr_print_struct(ndr, name, "samr_TestPrivateFunctionsDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_TestPrivateFunctionsDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_TestPrivateFunctionsDomain"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_TestPrivateFunctionsUser(struct ndr_push *ndr, int flags, const struct samr_TestPrivateFunctionsUser *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_TestPrivateFunctionsUser(struct ndr_pull *ndr, int flags, struct samr_TestPrivateFunctionsUser *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_TestPrivateFunctionsUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsUser *r) +{ + ndr_print_struct(ndr, name, "samr_TestPrivateFunctionsUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_TestPrivateFunctionsUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_TestPrivateFunctionsUser"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_GetUserPwInfo(struct ndr_push *ndr, int flags, const struct samr_GetUserPwInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_GetUserPwInfo(struct ndr_pull *ndr, int flags, struct samr_GetUserPwInfo *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetUserPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetUserPwInfo *r) +{ + ndr_print_struct(ndr, name, "samr_GetUserPwInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetUserPwInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetUserPwInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_samr_PwInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_RemoveMemberFromForeignDomain(struct ndr_push *ndr, int flags, const struct samr_RemoveMemberFromForeignDomain *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + 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) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_RemoveMemberFromForeignDomain(struct ndr_pull *ndr, int flags, struct samr_RemoveMemberFromForeignDomain *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RemoveMemberFromForeignDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMemberFromForeignDomain *r) +{ + ndr_print_struct(ndr, name, "samr_RemoveMemberFromForeignDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_RemoveMemberFromForeignDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_RemoveMemberFromForeignDomain"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDomainInfo2(struct ndr_push *ndr, int flags, const struct samr_QueryDomainInfo2 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDomainInfo2(struct ndr_pull *ndr, int flags, struct samr_QueryDomainInfo2 *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDomainInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDomainInfo2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDomainInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDomainInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_DomainInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryUserInfo2(struct ndr_push *ndr, int flags, const struct samr_QueryUserInfo2 *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryUserInfo2(struct ndr_pull *ndr, int flags, struct samr_QueryUserInfo2 *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_QueryUserInfo2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryUserInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryUserInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_UserInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDisplayInfo2(struct ndr_push *ndr, int flags, const struct samr_QueryDisplayInfo2 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_entries)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + } + if (flags & NDR_OUT) { + if (r->out.total_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_size)); + if (r->out.returned_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.returned_size)); + 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_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDisplayInfo2(struct ndr_pull *ndr, int flags, struct samr_QueryDisplayInfo2 *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_total_size_0; + TALLOC_CTX *_mem_save_returned_size_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_entries)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.total_size); + ZERO_STRUCTP(r->out.total_size); + NDR_PULL_ALLOC(ndr, r->out.returned_size); + ZERO_STRUCTP(r->out.returned_size); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.total_size); + } + _mem_save_total_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.returned_size); + } + _mem_save_returned_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.returned_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDisplayInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDisplayInfo2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDisplayInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "start_idx", r->in.start_idx); + ndr_print_uint32(ndr, "max_entries", r->in.max_entries); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDisplayInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "total_size", r->out.total_size); + ndr->depth++; + ndr_print_uint32(ndr, "total_size", *r->out.total_size); + ndr->depth--; + ndr_print_ptr(ndr, "returned_size", r->out.returned_size); + ndr->depth++; + ndr_print_uint32(ndr, "returned_size", *r->out.returned_size); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_DispInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetDisplayEnumerationIndex2(struct ndr_push *ndr, int flags, const struct samr_GetDisplayEnumerationIndex2 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + 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.idx == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.idx)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetDisplayEnumerationIndex2(struct ndr_pull *ndr, int flags, struct samr_GetDisplayEnumerationIndex2 *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_idx_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.idx); + ZERO_STRUCTP(r->out.idx); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.idx); + } + _mem_save_idx_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.idx, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.idx)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_idx_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetDisplayEnumerationIndex2(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex2 *r) +{ + ndr_print_struct(ndr, name, "samr_GetDisplayEnumerationIndex2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetDisplayEnumerationIndex2"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", r->in.name); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetDisplayEnumerationIndex2"); + ndr->depth++; + ndr_print_ptr(ndr, "idx", r->out.idx); + ndr->depth++; + ndr_print_uint32(ndr, "idx", *r->out.idx); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CreateUser2(struct ndr_push *ndr, int flags, const struct samr_CreateUser2 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.account_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.account_name)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.acct_flags)); + NDR_CHECK(ndr_push_samr_UserAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + if (r->out.access_granted == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.access_granted)); + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CreateUser2(struct ndr_pull *ndr, int flags, struct samr_CreateUser2 *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_account_name_0; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_access_granted_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account_name); + } + _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.acct_flags)); + NDR_CHECK(ndr_pull_samr_UserAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.user_handle); + ZERO_STRUCTP(r->out.user_handle); + NDR_PULL_ALLOC(ndr, r->out.access_granted); + ZERO_STRUCTP(r->out.access_granted); + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.access_granted); + } + _mem_save_access_granted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.access_granted, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.access_granted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_access_granted_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CreateUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser2 *r) +{ + ndr_print_struct(ndr, name, "samr_CreateUser2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_CreateUser2"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "account_name", r->in.account_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", r->in.account_name); + ndr->depth--; + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->in.acct_flags); + ndr_print_samr_UserAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_CreateUser2"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->out.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); + ndr->depth--; + ndr_print_ptr(ndr, "access_granted", r->out.access_granted); + ndr->depth++; + ndr_print_uint32(ndr, "access_granted", *r->out.access_granted); + ndr->depth--; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDisplayInfo3(struct ndr_push *ndr, int flags, const struct samr_QueryDisplayInfo3 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_entries)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + } + if (flags & NDR_OUT) { + if (r->out.total_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_size)); + if (r->out.returned_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.returned_size)); + 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_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDisplayInfo3(struct ndr_pull *ndr, int flags, struct samr_QueryDisplayInfo3 *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_total_size_0; + TALLOC_CTX *_mem_save_returned_size_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_entries)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.total_size); + ZERO_STRUCTP(r->out.total_size); + NDR_PULL_ALLOC(ndr, r->out.returned_size); + ZERO_STRUCTP(r->out.returned_size); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.total_size); + } + _mem_save_total_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.returned_size); + } + _mem_save_returned_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.returned_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDisplayInfo3(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo3 *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDisplayInfo3"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDisplayInfo3"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "start_idx", r->in.start_idx); + ndr_print_uint32(ndr, "max_entries", r->in.max_entries); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDisplayInfo3"); + ndr->depth++; + ndr_print_ptr(ndr, "total_size", r->out.total_size); + ndr->depth++; + ndr_print_uint32(ndr, "total_size", *r->out.total_size); + ndr->depth--; + ndr_print_ptr(ndr, "returned_size", r->out.returned_size); + ndr->depth++; + ndr_print_uint32(ndr, "returned_size", *r->out.returned_size); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_DispInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AddMultipleMembersToAlias(struct ndr_push *ndr, int flags, const struct samr_AddMultipleMembersToAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + 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 (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AddMultipleMembersToAlias(struct ndr_pull *ndr, int flags, struct samr_AddMultipleMembersToAlias *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AddMultipleMembersToAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddMultipleMembersToAlias *r) +{ + ndr_print_struct(ndr, name, "samr_AddMultipleMembersToAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_AddMultipleMembersToAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_AddMultipleMembersToAlias"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_RemoveMultipleMembersFromAlias(struct ndr_push *ndr, int flags, const struct samr_RemoveMultipleMembersFromAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + 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 (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_RemoveMultipleMembersFromAlias(struct ndr_pull *ndr, int flags, struct samr_RemoveMultipleMembersFromAlias *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RemoveMultipleMembersFromAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMultipleMembersFromAlias *r) +{ + ndr_print_struct(ndr, name, "samr_RemoveMultipleMembersFromAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_RemoveMultipleMembersFromAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_RemoveMultipleMembersFromAlias"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_OemChangePasswordUser2(struct ndr_push *ndr, int flags, const struct samr_OemChangePasswordUser2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + } + if (r->in.account == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); + if (r->in.password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hash)); + if (r->in.hash) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.hash)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_OemChangePasswordUser2(struct ndr_pull *ndr, int flags, struct samr_OemChangePasswordUser2 *r) +{ + uint32_t _ptr_server; + uint32_t _ptr_password; + uint32_t _ptr_hash; + TALLOC_CTX *_mem_save_server_0; + TALLOC_CTX *_mem_save_account_0; + TALLOC_CTX *_mem_save_password_0; + TALLOC_CTX *_mem_save_hash_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account); + } + _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->in.password); + } else { + r->in.password = NULL; + } + if (r->in.password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hash)); + if (_ptr_hash) { + NDR_PULL_ALLOC(ndr, r->in.hash); + } else { + r->in.hash = NULL; + } + if (r->in.hash) { + _mem_save_hash_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.hash, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.hash)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hash_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OemChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_OemChangePasswordUser2 *r) +{ + ndr_print_struct(ndr, name, "samr_OemChangePasswordUser2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OemChangePasswordUser2"); + ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_lsa_AsciiString(ndr, "server", r->in.server); + } + ndr->depth--; + ndr_print_ptr(ndr, "account", r->in.account); + ndr->depth++; + ndr_print_lsa_AsciiString(ndr, "account", r->in.account); + ndr->depth--; + ndr_print_ptr(ndr, "password", r->in.password); + ndr->depth++; + if (r->in.password) { + ndr_print_samr_CryptPassword(ndr, "password", r->in.password); + } + ndr->depth--; + ndr_print_ptr(ndr, "hash", r->in.hash); + ndr->depth++; + if (r->in.hash) { + ndr_print_samr_Password(ndr, "hash", r->in.hash); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OemChangePasswordUser2"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ChangePasswordUser2(struct ndr_push *ndr, int flags, const struct samr_ChangePasswordUser2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + } + if (r->in.account == 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.account)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_password)); + if (r->in.nt_password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_verifier)); + if (r->in.nt_verifier) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.lm_change)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_password)); + if (r->in.lm_password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_verifier)); + if (r->in.lm_verifier) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ChangePasswordUser2(struct ndr_pull *ndr, int flags, struct samr_ChangePasswordUser2 *r) +{ + uint32_t _ptr_server; + uint32_t _ptr_nt_password; + uint32_t _ptr_nt_verifier; + uint32_t _ptr_lm_password; + uint32_t _ptr_lm_verifier; + TALLOC_CTX *_mem_save_server_0; + TALLOC_CTX *_mem_save_account_0; + TALLOC_CTX *_mem_save_nt_password_0; + TALLOC_CTX *_mem_save_nt_verifier_0; + TALLOC_CTX *_mem_save_lm_password_0; + TALLOC_CTX *_mem_save_lm_verifier_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account); + } + _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_password)); + if (_ptr_nt_password) { + NDR_PULL_ALLOC(ndr, r->in.nt_password); + } else { + r->in.nt_password = NULL; + } + if (r->in.nt_password) { + _mem_save_nt_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_verifier)); + if (_ptr_nt_verifier) { + NDR_PULL_ALLOC(ndr, r->in.nt_verifier); + } else { + r->in.nt_verifier = NULL; + } + if (r->in.nt_verifier) { + _mem_save_nt_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_verifier, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_verifier_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.lm_change)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_password)); + if (_ptr_lm_password) { + NDR_PULL_ALLOC(ndr, r->in.lm_password); + } else { + r->in.lm_password = NULL; + } + if (r->in.lm_password) { + _mem_save_lm_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_verifier)); + if (_ptr_lm_verifier) { + NDR_PULL_ALLOC(ndr, r->in.lm_verifier); + } else { + r->in.lm_verifier = NULL; + } + if (r->in.lm_verifier) { + _mem_save_lm_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_verifier, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_verifier_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser2 *r) +{ + ndr_print_struct(ndr, name, "samr_ChangePasswordUser2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_ChangePasswordUser2"); + ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_lsa_String(ndr, "server", r->in.server); + } + ndr->depth--; + ndr_print_ptr(ndr, "account", r->in.account); + ndr->depth++; + ndr_print_lsa_String(ndr, "account", r->in.account); + ndr->depth--; + ndr_print_ptr(ndr, "nt_password", r->in.nt_password); + ndr->depth++; + if (r->in.nt_password) { + ndr_print_samr_CryptPassword(ndr, "nt_password", r->in.nt_password); + } + ndr->depth--; + ndr_print_ptr(ndr, "nt_verifier", r->in.nt_verifier); + ndr->depth++; + if (r->in.nt_verifier) { + ndr_print_samr_Password(ndr, "nt_verifier", r->in.nt_verifier); + } + ndr->depth--; + ndr_print_uint8(ndr, "lm_change", r->in.lm_change); + ndr_print_ptr(ndr, "lm_password", r->in.lm_password); + ndr->depth++; + if (r->in.lm_password) { + ndr_print_samr_CryptPassword(ndr, "lm_password", r->in.lm_password); + } + ndr->depth--; + ndr_print_ptr(ndr, "lm_verifier", r->in.lm_verifier); + ndr->depth++; + if (r->in.lm_verifier) { + ndr_print_samr_Password(ndr, "lm_verifier", r->in.lm_verifier); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_ChangePasswordUser2"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetDomPwInfo(struct ndr_push *ndr, int flags, const struct samr_GetDomPwInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); + if (r->in.domain_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); + } + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetDomPwInfo(struct ndr_pull *ndr, int flags, struct samr_GetDomPwInfo *r) +{ + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->in.domain_name); + } else { + r->in.domain_name = NULL; + } + if (r->in.domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetDomPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDomPwInfo *r) +{ + ndr_print_struct(ndr, name, "samr_GetDomPwInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetDomPwInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + if (r->in.domain_name) { + ndr_print_lsa_String(ndr, "domain_name", r->in.domain_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetDomPwInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_samr_PwInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Connect2(struct ndr_push *ndr, int flags, const struct samr_Connect2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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)); + } + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Connect2(struct ndr_pull *ndr, int flags, struct samr_Connect2 *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect2(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect2 *r) +{ + ndr_print_struct(ndr, name, "samr_Connect2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect2"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect2"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_SetUserInfo2(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo2 *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + 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_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_SetUserInfo2(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo2 *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_SetUserInfo2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetUserInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_UserInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetUserInfo2"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetBootKeyInformation(struct ndr_push *ndr, int flags, const struct samr_SetBootKeyInformation *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetBootKeyInformation(struct ndr_pull *ndr, int flags, struct samr_SetBootKeyInformation *r) +{ + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown3)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetBootKeyInformation *r) +{ + ndr_print_struct(ndr, name, "samr_SetBootKeyInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetBootKeyInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr_print_uint32(ndr, "unknown1", r->in.unknown1); + ndr_print_uint32(ndr, "unknown2", r->in.unknown2); + ndr_print_uint32(ndr, "unknown3", r->in.unknown3); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetBootKeyInformation"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetBootKeyInformation(struct ndr_push *ndr, int flags, const struct samr_GetBootKeyInformation *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + } + if (flags & NDR_OUT) { + if (r->out.unknown == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.unknown)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetBootKeyInformation(struct ndr_pull *ndr, int flags, struct samr_GetBootKeyInformation *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_unknown_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.unknown); + ZERO_STRUCTP(r->out.unknown); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.unknown); + } + _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.unknown)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetBootKeyInformation *r) +{ + ndr_print_struct(ndr, name, "samr_GetBootKeyInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetBootKeyInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetBootKeyInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "unknown", r->out.unknown); + ndr->depth++; + ndr_print_uint32(ndr, "unknown", *r->out.unknown); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Connect3(struct ndr_push *ndr, int flags, const struct samr_Connect3 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Connect3(struct ndr_pull *ndr, int flags, struct samr_Connect3 *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect3(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect3 *r) +{ + ndr_print_struct(ndr, name, "samr_Connect3"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect3"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect3"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Connect4(struct ndr_push *ndr, int flags, const struct samr_Connect4 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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)); + } + NDR_CHECK(ndr_push_samr_ConnectVersion(ndr, NDR_SCALARS, r->in.client_version)); + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Connect4(struct ndr_pull *ndr, int flags, struct samr_Connect4 *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_samr_ConnectVersion(ndr, NDR_SCALARS, &r->in.client_version)); + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect4(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect4 *r) +{ + ndr_print_struct(ndr, name, "samr_Connect4"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect4"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_samr_ConnectVersion(ndr, "client_version", r->in.client_version); + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect4"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ChangePasswordUser3(struct ndr_push *ndr, int flags, const struct samr_ChangePasswordUser3 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + } + if (r->in.account == 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.account)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_password)); + if (r->in.nt_password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_verifier)); + if (r->in.nt_verifier) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.lm_change)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_password)); + if (r->in.lm_password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_verifier)); + if (r->in.lm_verifier) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password3)); + if (r->in.password3) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password3)); + } + } + if (flags & NDR_OUT) { + if (r->out.dominfo == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dominfo)); + if (*r->out.dominfo) { + NDR_CHECK(ndr_push_samr_DomInfo1(ndr, NDR_SCALARS, *r->out.dominfo)); + } + if (r->out.reject == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.reject)); + if (*r->out.reject) { + NDR_CHECK(ndr_push_samr_ChangeReject(ndr, NDR_SCALARS, *r->out.reject)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ChangePasswordUser3(struct ndr_pull *ndr, int flags, struct samr_ChangePasswordUser3 *r) +{ + uint32_t _ptr_server; + uint32_t _ptr_nt_password; + uint32_t _ptr_nt_verifier; + uint32_t _ptr_lm_password; + uint32_t _ptr_lm_verifier; + uint32_t _ptr_password3; + uint32_t _ptr_dominfo; + uint32_t _ptr_reject; + TALLOC_CTX *_mem_save_server_0; + TALLOC_CTX *_mem_save_account_0; + TALLOC_CTX *_mem_save_nt_password_0; + TALLOC_CTX *_mem_save_nt_verifier_0; + TALLOC_CTX *_mem_save_lm_password_0; + TALLOC_CTX *_mem_save_lm_verifier_0; + TALLOC_CTX *_mem_save_password3_0; + TALLOC_CTX *_mem_save_dominfo_0; + TALLOC_CTX *_mem_save_dominfo_1; + TALLOC_CTX *_mem_save_reject_0; + TALLOC_CTX *_mem_save_reject_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account); + } + _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_password)); + if (_ptr_nt_password) { + NDR_PULL_ALLOC(ndr, r->in.nt_password); + } else { + r->in.nt_password = NULL; + } + if (r->in.nt_password) { + _mem_save_nt_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_verifier)); + if (_ptr_nt_verifier) { + NDR_PULL_ALLOC(ndr, r->in.nt_verifier); + } else { + r->in.nt_verifier = NULL; + } + if (r->in.nt_verifier) { + _mem_save_nt_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_verifier, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_verifier_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.lm_change)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_password)); + if (_ptr_lm_password) { + NDR_PULL_ALLOC(ndr, r->in.lm_password); + } else { + r->in.lm_password = NULL; + } + if (r->in.lm_password) { + _mem_save_lm_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_verifier)); + if (_ptr_lm_verifier) { + NDR_PULL_ALLOC(ndr, r->in.lm_verifier); + } else { + r->in.lm_verifier = NULL; + } + if (r->in.lm_verifier) { + _mem_save_lm_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_verifier, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_verifier_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password3)); + if (_ptr_password3) { + NDR_PULL_ALLOC(ndr, r->in.password3); + } else { + r->in.password3 = NULL; + } + if (r->in.password3) { + _mem_save_password3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password3, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password3_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.dominfo); + ZERO_STRUCTP(r->out.dominfo); + NDR_PULL_ALLOC(ndr, r->out.reject); + ZERO_STRUCTP(r->out.reject); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.dominfo); + } + _mem_save_dominfo_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.dominfo, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dominfo)); + if (_ptr_dominfo) { + NDR_PULL_ALLOC(ndr, *r->out.dominfo); + } else { + *r->out.dominfo = NULL; + } + if (*r->out.dominfo) { + _mem_save_dominfo_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.dominfo, 0); + NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, *r->out.dominfo)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dominfo_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dominfo_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.reject); + } + _mem_save_reject_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.reject, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_reject)); + if (_ptr_reject) { + NDR_PULL_ALLOC(ndr, *r->out.reject); + } else { + *r->out.reject = NULL; + } + if (*r->out.reject) { + _mem_save_reject_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.reject, 0); + NDR_CHECK(ndr_pull_samr_ChangeReject(ndr, NDR_SCALARS, *r->out.reject)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reject_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reject_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ChangePasswordUser3(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser3 *r) +{ + ndr_print_struct(ndr, name, "samr_ChangePasswordUser3"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_ChangePasswordUser3"); + ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_lsa_String(ndr, "server", r->in.server); + } + ndr->depth--; + ndr_print_ptr(ndr, "account", r->in.account); + ndr->depth++; + ndr_print_lsa_String(ndr, "account", r->in.account); + ndr->depth--; + ndr_print_ptr(ndr, "nt_password", r->in.nt_password); + ndr->depth++; + if (r->in.nt_password) { + ndr_print_samr_CryptPassword(ndr, "nt_password", r->in.nt_password); + } + ndr->depth--; + ndr_print_ptr(ndr, "nt_verifier", r->in.nt_verifier); + ndr->depth++; + if (r->in.nt_verifier) { + ndr_print_samr_Password(ndr, "nt_verifier", r->in.nt_verifier); + } + ndr->depth--; + ndr_print_uint8(ndr, "lm_change", r->in.lm_change); + ndr_print_ptr(ndr, "lm_password", r->in.lm_password); + ndr->depth++; + if (r->in.lm_password) { + ndr_print_samr_CryptPassword(ndr, "lm_password", r->in.lm_password); + } + ndr->depth--; + ndr_print_ptr(ndr, "lm_verifier", r->in.lm_verifier); + ndr->depth++; + if (r->in.lm_verifier) { + ndr_print_samr_Password(ndr, "lm_verifier", r->in.lm_verifier); + } + ndr->depth--; + ndr_print_ptr(ndr, "password3", r->in.password3); + ndr->depth++; + if (r->in.password3) { + ndr_print_samr_CryptPassword(ndr, "password3", r->in.password3); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_ChangePasswordUser3"); + ndr->depth++; + ndr_print_ptr(ndr, "dominfo", r->out.dominfo); + ndr->depth++; + ndr_print_ptr(ndr, "dominfo", *r->out.dominfo); + ndr->depth++; + if (*r->out.dominfo) { + ndr_print_samr_DomInfo1(ndr, "dominfo", *r->out.dominfo); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "reject", r->out.reject); + ndr->depth++; + ndr_print_ptr(ndr, "reject", *r->out.reject); + ndr->depth++; + if (*r->out.reject) { + ndr_print_samr_ChangeReject(ndr, "reject", *r->out.reject); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_Connect5(struct ndr_push *ndr, int flags, const struct samr_Connect5 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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)); + } + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level_in)); + if (r->in.info_in == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info_in, r->in.level_in)); + NDR_CHECK(ndr_push_samr_ConnectInfo(ndr, NDR_SCALARS, r->in.info_in)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level_out)); + if (r->out.info_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info_out, *r->out.level_out)); + NDR_CHECK(ndr_push_samr_ConnectInfo(ndr, NDR_SCALARS, r->out.info_out)); + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_Connect5(struct ndr_pull *ndr, int flags, struct samr_Connect5 *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_info_in_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_info_out_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level_in)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info_in); + } + _mem_save_info_in_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info_in, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info_in, r->in.level_in)); + NDR_CHECK(ndr_pull_samr_ConnectInfo(ndr, NDR_SCALARS, r->in.info_in)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_in_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.info_out); + ZERO_STRUCTP(r->out.info_out); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_out); + } + _mem_save_info_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info_out, *r->out.level_out)); + NDR_CHECK(ndr_pull_samr_ConnectInfo(ndr, NDR_SCALARS, r->out.info_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect5(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect5 *r) +{ + ndr_print_struct(ndr, name, "samr_Connect5"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect5"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_uint32(ndr, "level_in", r->in.level_in); + ndr_print_ptr(ndr, "info_in", r->in.info_in); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info_in, r->in.level_in); + ndr_print_samr_ConnectInfo(ndr, "info_in", r->in.info_in); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect5"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_uint32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "info_out", r->out.info_out); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info_out, *r->out.level_out); + ndr_print_samr_ConnectInfo(ndr, "info_out", r->out.info_out); + ndr->depth--; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_RidToSid(struct ndr_push *ndr, int flags, const struct samr_RidToSid *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + if (r->out.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sid)); + if (*r->out.sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sid)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_RidToSid(struct ndr_pull *ndr, int flags, struct samr_RidToSid *r) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_sid_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_PULL_ALLOC(ndr, r->out.sid); + ZERO_STRUCTP(r->out.sid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, *r->out.sid); + } else { + *r->out.sid = NULL; + } + if (*r->out.sid) { + _mem_save_sid_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RidToSid(struct ndr_print *ndr, const char *name, int flags, const struct samr_RidToSid *r) +{ + ndr_print_struct(ndr, name, "samr_RidToSid"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_RidToSid"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_RidToSid"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->out.sid); + ndr->depth++; + ndr_print_ptr(ndr, "sid", *r->out.sid); + ndr->depth++; + if (*r->out.sid) { + ndr_print_dom_sid2(ndr, "sid", *r->out.sid); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetDsrmPassword(struct ndr_push *ndr, int flags, const struct samr_SetDsrmPassword *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.name)); + if (r->in.name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hash)); + if (r->in.hash) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.hash)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetDsrmPassword(struct ndr_pull *ndr, int flags, struct samr_SetDsrmPassword *r) +{ + uint32_t _ptr_name; + uint32_t _ptr_hash; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_hash_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->in.name); + } else { + r->in.name = NULL; + } + if (r->in.name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hash)); + if (_ptr_hash) { + NDR_PULL_ALLOC(ndr, r->in.hash); + } else { + r->in.hash = NULL; + } + if (r->in.hash) { + _mem_save_hash_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.hash, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.hash)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hash_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetDsrmPassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDsrmPassword *r) +{ + ndr_print_struct(ndr, name, "samr_SetDsrmPassword"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetDsrmPassword"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + if (r->in.name) { + ndr_print_lsa_String(ndr, "name", r->in.name); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_ptr(ndr, "hash", r->in.hash); + ndr->depth++; + if (r->in.hash) { + ndr_print_samr_Password(ndr, "hash", r->in.hash); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetDsrmPassword"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePassword(struct ndr_push *ndr, int flags, const struct samr_ValidatePassword *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_samr_ValidatePasswordLevel(ndr, NDR_SCALARS, r->in.level)); + if (r->in.req == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_push_samr_ValidatePasswordReq(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.rep == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.rep)); + if (*r->out.rep) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.rep, r->in.level)); + NDR_CHECK(ndr_push_samr_ValidatePasswordRep(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rep)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePassword(struct ndr_pull *ndr, int flags, struct samr_ValidatePassword *r) +{ + uint32_t _ptr_rep; + TALLOC_CTX *_mem_save_req_0; + TALLOC_CTX *_mem_save_rep_0; + TALLOC_CTX *_mem_save_rep_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_samr_ValidatePasswordLevel(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.req); + } + _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.rep); + ZERO_STRUCTP(r->out.rep); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rep); + } + _mem_save_rep_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rep, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rep)); + if (_ptr_rep) { + NDR_PULL_ALLOC(ndr, *r->out.rep); + } else { + *r->out.rep = NULL; + } + if (*r->out.rep) { + _mem_save_rep_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.rep, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.rep, r->in.level)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordRep(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rep)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rep_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rep_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_ValidatePassword *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePassword"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_ValidatePassword"); + ndr->depth++; + ndr_print_samr_ValidatePasswordLevel(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "req", r->in.req); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.req, r->in.level); + ndr_print_samr_ValidatePasswordReq(ndr, "req", r->in.req); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_ValidatePassword"); + ndr->depth++; + ndr_print_ptr(ndr, "rep", r->out.rep); + ndr->depth++; + ndr_print_ptr(ndr, "rep", *r->out.rep); + ndr->depth++; + if (*r->out.rep) { + ndr_print_set_switch_value(ndr, *r->out.rep, r->in.level); + ndr_print_samr_ValidatePasswordRep(ndr, "rep", *r->out.rep); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call samr_calls[] = { + { + "samr_Connect", + sizeof(struct samr_Connect), + (ndr_push_flags_fn_t) ndr_push_samr_Connect, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect, + (ndr_print_function_t) ndr_print_samr_Connect, + false, + }, + { + "samr_Close", + sizeof(struct samr_Close), + (ndr_push_flags_fn_t) ndr_push_samr_Close, + (ndr_pull_flags_fn_t) ndr_pull_samr_Close, + (ndr_print_function_t) ndr_print_samr_Close, + false, + }, + { + "samr_SetSecurity", + sizeof(struct samr_SetSecurity), + (ndr_push_flags_fn_t) ndr_push_samr_SetSecurity, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetSecurity, + (ndr_print_function_t) ndr_print_samr_SetSecurity, + false, + }, + { + "samr_QuerySecurity", + sizeof(struct samr_QuerySecurity), + (ndr_push_flags_fn_t) ndr_push_samr_QuerySecurity, + (ndr_pull_flags_fn_t) ndr_pull_samr_QuerySecurity, + (ndr_print_function_t) ndr_print_samr_QuerySecurity, + false, + }, + { + "samr_Shutdown", + sizeof(struct samr_Shutdown), + (ndr_push_flags_fn_t) ndr_push_samr_Shutdown, + (ndr_pull_flags_fn_t) ndr_pull_samr_Shutdown, + (ndr_print_function_t) ndr_print_samr_Shutdown, + false, + }, + { + "samr_LookupDomain", + sizeof(struct samr_LookupDomain), + (ndr_push_flags_fn_t) ndr_push_samr_LookupDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_LookupDomain, + (ndr_print_function_t) ndr_print_samr_LookupDomain, + false, + }, + { + "samr_EnumDomains", + sizeof(struct samr_EnumDomains), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomains, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomains, + (ndr_print_function_t) ndr_print_samr_EnumDomains, + false, + }, + { + "samr_OpenDomain", + sizeof(struct samr_OpenDomain), + (ndr_push_flags_fn_t) ndr_push_samr_OpenDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenDomain, + (ndr_print_function_t) ndr_print_samr_OpenDomain, + false, + }, + { + "samr_QueryDomainInfo", + sizeof(struct samr_QueryDomainInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDomainInfo, + (ndr_print_function_t) ndr_print_samr_QueryDomainInfo, + false, + }, + { + "samr_SetDomainInfo", + sizeof(struct samr_SetDomainInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetDomainInfo, + (ndr_print_function_t) ndr_print_samr_SetDomainInfo, + false, + }, + { + "samr_CreateDomainGroup", + sizeof(struct samr_CreateDomainGroup), + (ndr_push_flags_fn_t) ndr_push_samr_CreateDomainGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateDomainGroup, + (ndr_print_function_t) ndr_print_samr_CreateDomainGroup, + false, + }, + { + "samr_EnumDomainGroups", + sizeof(struct samr_EnumDomainGroups), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainGroups, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainGroups, + (ndr_print_function_t) ndr_print_samr_EnumDomainGroups, + false, + }, + { + "samr_CreateUser", + sizeof(struct samr_CreateUser), + (ndr_push_flags_fn_t) ndr_push_samr_CreateUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateUser, + (ndr_print_function_t) ndr_print_samr_CreateUser, + false, + }, + { + "samr_EnumDomainUsers", + sizeof(struct samr_EnumDomainUsers), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainUsers, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainUsers, + (ndr_print_function_t) ndr_print_samr_EnumDomainUsers, + false, + }, + { + "samr_CreateDomAlias", + sizeof(struct samr_CreateDomAlias), + (ndr_push_flags_fn_t) ndr_push_samr_CreateDomAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateDomAlias, + (ndr_print_function_t) ndr_print_samr_CreateDomAlias, + false, + }, + { + "samr_EnumDomainAliases", + sizeof(struct samr_EnumDomainAliases), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainAliases, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainAliases, + (ndr_print_function_t) ndr_print_samr_EnumDomainAliases, + false, + }, + { + "samr_GetAliasMembership", + sizeof(struct samr_GetAliasMembership), + (ndr_push_flags_fn_t) ndr_push_samr_GetAliasMembership, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetAliasMembership, + (ndr_print_function_t) ndr_print_samr_GetAliasMembership, + false, + }, + { + "samr_LookupNames", + sizeof(struct samr_LookupNames), + (ndr_push_flags_fn_t) ndr_push_samr_LookupNames, + (ndr_pull_flags_fn_t) ndr_pull_samr_LookupNames, + (ndr_print_function_t) ndr_print_samr_LookupNames, + false, + }, + { + "samr_LookupRids", + sizeof(struct samr_LookupRids), + (ndr_push_flags_fn_t) ndr_push_samr_LookupRids, + (ndr_pull_flags_fn_t) ndr_pull_samr_LookupRids, + (ndr_print_function_t) ndr_print_samr_LookupRids, + false, + }, + { + "samr_OpenGroup", + sizeof(struct samr_OpenGroup), + (ndr_push_flags_fn_t) ndr_push_samr_OpenGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenGroup, + (ndr_print_function_t) ndr_print_samr_OpenGroup, + false, + }, + { + "samr_QueryGroupInfo", + sizeof(struct samr_QueryGroupInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryGroupInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryGroupInfo, + (ndr_print_function_t) ndr_print_samr_QueryGroupInfo, + false, + }, + { + "samr_SetGroupInfo", + sizeof(struct samr_SetGroupInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetGroupInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetGroupInfo, + (ndr_print_function_t) ndr_print_samr_SetGroupInfo, + false, + }, + { + "samr_AddGroupMember", + sizeof(struct samr_AddGroupMember), + (ndr_push_flags_fn_t) ndr_push_samr_AddGroupMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_AddGroupMember, + (ndr_print_function_t) ndr_print_samr_AddGroupMember, + false, + }, + { + "samr_DeleteDomainGroup", + sizeof(struct samr_DeleteDomainGroup), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteDomainGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteDomainGroup, + (ndr_print_function_t) ndr_print_samr_DeleteDomainGroup, + false, + }, + { + "samr_DeleteGroupMember", + sizeof(struct samr_DeleteGroupMember), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteGroupMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteGroupMember, + (ndr_print_function_t) ndr_print_samr_DeleteGroupMember, + false, + }, + { + "samr_QueryGroupMember", + sizeof(struct samr_QueryGroupMember), + (ndr_push_flags_fn_t) ndr_push_samr_QueryGroupMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryGroupMember, + (ndr_print_function_t) ndr_print_samr_QueryGroupMember, + false, + }, + { + "samr_SetMemberAttributesOfGroup", + sizeof(struct samr_SetMemberAttributesOfGroup), + (ndr_push_flags_fn_t) ndr_push_samr_SetMemberAttributesOfGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetMemberAttributesOfGroup, + (ndr_print_function_t) ndr_print_samr_SetMemberAttributesOfGroup, + false, + }, + { + "samr_OpenAlias", + sizeof(struct samr_OpenAlias), + (ndr_push_flags_fn_t) ndr_push_samr_OpenAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenAlias, + (ndr_print_function_t) ndr_print_samr_OpenAlias, + false, + }, + { + "samr_QueryAliasInfo", + sizeof(struct samr_QueryAliasInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryAliasInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryAliasInfo, + (ndr_print_function_t) ndr_print_samr_QueryAliasInfo, + false, + }, + { + "samr_SetAliasInfo", + sizeof(struct samr_SetAliasInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetAliasInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetAliasInfo, + (ndr_print_function_t) ndr_print_samr_SetAliasInfo, + false, + }, + { + "samr_DeleteDomAlias", + sizeof(struct samr_DeleteDomAlias), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteDomAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteDomAlias, + (ndr_print_function_t) ndr_print_samr_DeleteDomAlias, + false, + }, + { + "samr_AddAliasMember", + sizeof(struct samr_AddAliasMember), + (ndr_push_flags_fn_t) ndr_push_samr_AddAliasMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_AddAliasMember, + (ndr_print_function_t) ndr_print_samr_AddAliasMember, + false, + }, + { + "samr_DeleteAliasMember", + sizeof(struct samr_DeleteAliasMember), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteAliasMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteAliasMember, + (ndr_print_function_t) ndr_print_samr_DeleteAliasMember, + false, + }, + { + "samr_GetMembersInAlias", + sizeof(struct samr_GetMembersInAlias), + (ndr_push_flags_fn_t) ndr_push_samr_GetMembersInAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetMembersInAlias, + (ndr_print_function_t) ndr_print_samr_GetMembersInAlias, + false, + }, + { + "samr_OpenUser", + sizeof(struct samr_OpenUser), + (ndr_push_flags_fn_t) ndr_push_samr_OpenUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenUser, + (ndr_print_function_t) ndr_print_samr_OpenUser, + false, + }, + { + "samr_DeleteUser", + sizeof(struct samr_DeleteUser), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteUser, + (ndr_print_function_t) ndr_print_samr_DeleteUser, + false, + }, + { + "samr_QueryUserInfo", + sizeof(struct samr_QueryUserInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryUserInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryUserInfo, + (ndr_print_function_t) ndr_print_samr_QueryUserInfo, + false, + }, + { + "samr_SetUserInfo", + sizeof(struct samr_SetUserInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetUserInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetUserInfo, + (ndr_print_function_t) ndr_print_samr_SetUserInfo, + false, + }, + { + "samr_ChangePasswordUser", + sizeof(struct samr_ChangePasswordUser), + (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser, + (ndr_print_function_t) ndr_print_samr_ChangePasswordUser, + false, + }, + { + "samr_GetGroupsForUser", + sizeof(struct samr_GetGroupsForUser), + (ndr_push_flags_fn_t) ndr_push_samr_GetGroupsForUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetGroupsForUser, + (ndr_print_function_t) ndr_print_samr_GetGroupsForUser, + false, + }, + { + "samr_QueryDisplayInfo", + sizeof(struct samr_QueryDisplayInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo, + (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo, + false, + }, + { + "samr_GetDisplayEnumerationIndex", + sizeof(struct samr_GetDisplayEnumerationIndex), + (ndr_push_flags_fn_t) ndr_push_samr_GetDisplayEnumerationIndex, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetDisplayEnumerationIndex, + (ndr_print_function_t) ndr_print_samr_GetDisplayEnumerationIndex, + false, + }, + { + "samr_TestPrivateFunctionsDomain", + sizeof(struct samr_TestPrivateFunctionsDomain), + (ndr_push_flags_fn_t) ndr_push_samr_TestPrivateFunctionsDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_TestPrivateFunctionsDomain, + (ndr_print_function_t) ndr_print_samr_TestPrivateFunctionsDomain, + false, + }, + { + "samr_TestPrivateFunctionsUser", + sizeof(struct samr_TestPrivateFunctionsUser), + (ndr_push_flags_fn_t) ndr_push_samr_TestPrivateFunctionsUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_TestPrivateFunctionsUser, + (ndr_print_function_t) ndr_print_samr_TestPrivateFunctionsUser, + false, + }, + { + "samr_GetUserPwInfo", + sizeof(struct samr_GetUserPwInfo), + (ndr_push_flags_fn_t) ndr_push_samr_GetUserPwInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetUserPwInfo, + (ndr_print_function_t) ndr_print_samr_GetUserPwInfo, + false, + }, + { + "samr_RemoveMemberFromForeignDomain", + sizeof(struct samr_RemoveMemberFromForeignDomain), + (ndr_push_flags_fn_t) ndr_push_samr_RemoveMemberFromForeignDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_RemoveMemberFromForeignDomain, + (ndr_print_function_t) ndr_print_samr_RemoveMemberFromForeignDomain, + false, + }, + { + "samr_QueryDomainInfo2", + sizeof(struct samr_QueryDomainInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDomainInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDomainInfo2, + (ndr_print_function_t) ndr_print_samr_QueryDomainInfo2, + false, + }, + { + "samr_QueryUserInfo2", + sizeof(struct samr_QueryUserInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_QueryUserInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryUserInfo2, + (ndr_print_function_t) ndr_print_samr_QueryUserInfo2, + false, + }, + { + "samr_QueryDisplayInfo2", + sizeof(struct samr_QueryDisplayInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo2, + (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo2, + false, + }, + { + "samr_GetDisplayEnumerationIndex2", + sizeof(struct samr_GetDisplayEnumerationIndex2), + (ndr_push_flags_fn_t) ndr_push_samr_GetDisplayEnumerationIndex2, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetDisplayEnumerationIndex2, + (ndr_print_function_t) ndr_print_samr_GetDisplayEnumerationIndex2, + false, + }, + { + "samr_CreateUser2", + sizeof(struct samr_CreateUser2), + (ndr_push_flags_fn_t) ndr_push_samr_CreateUser2, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateUser2, + (ndr_print_function_t) ndr_print_samr_CreateUser2, + false, + }, + { + "samr_QueryDisplayInfo3", + sizeof(struct samr_QueryDisplayInfo3), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo3, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo3, + (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo3, + false, + }, + { + "samr_AddMultipleMembersToAlias", + sizeof(struct samr_AddMultipleMembersToAlias), + (ndr_push_flags_fn_t) ndr_push_samr_AddMultipleMembersToAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_AddMultipleMembersToAlias, + (ndr_print_function_t) ndr_print_samr_AddMultipleMembersToAlias, + false, + }, + { + "samr_RemoveMultipleMembersFromAlias", + sizeof(struct samr_RemoveMultipleMembersFromAlias), + (ndr_push_flags_fn_t) ndr_push_samr_RemoveMultipleMembersFromAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_RemoveMultipleMembersFromAlias, + (ndr_print_function_t) ndr_print_samr_RemoveMultipleMembersFromAlias, + false, + }, + { + "samr_OemChangePasswordUser2", + sizeof(struct samr_OemChangePasswordUser2), + (ndr_push_flags_fn_t) ndr_push_samr_OemChangePasswordUser2, + (ndr_pull_flags_fn_t) ndr_pull_samr_OemChangePasswordUser2, + (ndr_print_function_t) ndr_print_samr_OemChangePasswordUser2, + false, + }, + { + "samr_ChangePasswordUser2", + sizeof(struct samr_ChangePasswordUser2), + (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser2, + (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser2, + (ndr_print_function_t) ndr_print_samr_ChangePasswordUser2, + false, + }, + { + "samr_GetDomPwInfo", + sizeof(struct samr_GetDomPwInfo), + (ndr_push_flags_fn_t) ndr_push_samr_GetDomPwInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetDomPwInfo, + (ndr_print_function_t) ndr_print_samr_GetDomPwInfo, + false, + }, + { + "samr_Connect2", + sizeof(struct samr_Connect2), + (ndr_push_flags_fn_t) ndr_push_samr_Connect2, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect2, + (ndr_print_function_t) ndr_print_samr_Connect2, + false, + }, + { + "samr_SetUserInfo2", + sizeof(struct samr_SetUserInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_SetUserInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetUserInfo2, + (ndr_print_function_t) ndr_print_samr_SetUserInfo2, + false, + }, + { + "samr_SetBootKeyInformation", + sizeof(struct samr_SetBootKeyInformation), + (ndr_push_flags_fn_t) ndr_push_samr_SetBootKeyInformation, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetBootKeyInformation, + (ndr_print_function_t) ndr_print_samr_SetBootKeyInformation, + false, + }, + { + "samr_GetBootKeyInformation", + sizeof(struct samr_GetBootKeyInformation), + (ndr_push_flags_fn_t) ndr_push_samr_GetBootKeyInformation, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetBootKeyInformation, + (ndr_print_function_t) ndr_print_samr_GetBootKeyInformation, + false, + }, + { + "samr_Connect3", + sizeof(struct samr_Connect3), + (ndr_push_flags_fn_t) ndr_push_samr_Connect3, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect3, + (ndr_print_function_t) ndr_print_samr_Connect3, + false, + }, + { + "samr_Connect4", + sizeof(struct samr_Connect4), + (ndr_push_flags_fn_t) ndr_push_samr_Connect4, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect4, + (ndr_print_function_t) ndr_print_samr_Connect4, + false, + }, + { + "samr_ChangePasswordUser3", + sizeof(struct samr_ChangePasswordUser3), + (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser3, + (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser3, + (ndr_print_function_t) ndr_print_samr_ChangePasswordUser3, + false, + }, + { + "samr_Connect5", + sizeof(struct samr_Connect5), + (ndr_push_flags_fn_t) ndr_push_samr_Connect5, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect5, + (ndr_print_function_t) ndr_print_samr_Connect5, + false, + }, + { + "samr_RidToSid", + sizeof(struct samr_RidToSid), + (ndr_push_flags_fn_t) ndr_push_samr_RidToSid, + (ndr_pull_flags_fn_t) ndr_pull_samr_RidToSid, + (ndr_print_function_t) ndr_print_samr_RidToSid, + false, + }, + { + "samr_SetDsrmPassword", + sizeof(struct samr_SetDsrmPassword), + (ndr_push_flags_fn_t) ndr_push_samr_SetDsrmPassword, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetDsrmPassword, + (ndr_print_function_t) ndr_print_samr_SetDsrmPassword, + false, + }, + { + "samr_ValidatePassword", + sizeof(struct samr_ValidatePassword), + (ndr_push_flags_fn_t) ndr_push_samr_ValidatePassword, + (ndr_pull_flags_fn_t) ndr_pull_samr_ValidatePassword, + (ndr_print_function_t) ndr_print_samr_ValidatePassword, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const samr_endpoint_strings[] = { + "ncacn_np:[\\pipe\\samr]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array samr_endpoints = { + .count = 3, + .names = samr_endpoint_strings +}; + +static const char * const samr_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array samr_authservices = { + .count = 1, + .names = samr_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_samr = { + .name = "samr", + .syntax_id = { + {0x12345778,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xac}}, + NDR_SAMR_VERSION + }, + .helpstring = NDR_SAMR_HELPSTRING, + .num_calls = 68, + .calls = samr_calls, + .endpoints = &samr_endpoints, + .authservices = &samr_authservices +}; + diff --git a/librpc/gen_ndr/ndr_samr.h b/librpc/gen_ndr/ndr_samr.h new file mode 100644 index 0000000000..64c60ee704 --- /dev/null +++ b/librpc/gen_ndr/ndr_samr.h @@ -0,0 +1,349 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/samr.h" + +#ifndef _HEADER_NDR_samr +#define _HEADER_NDR_samr + +#define NDR_SAMR_UUID "12345778-1234-abcd-ef00-0123456789ac" +#define NDR_SAMR_VERSION 1.0 +#define NDR_SAMR_NAME "samr" +#define NDR_SAMR_HELPSTRING NULL +extern const struct ndr_interface_table ndr_table_samr; +#define NDR_SAMR_CONNECT (0x00) + +#define NDR_SAMR_CLOSE (0x01) + +#define NDR_SAMR_SETSECURITY (0x02) + +#define NDR_SAMR_QUERYSECURITY (0x03) + +#define NDR_SAMR_SHUTDOWN (0x04) + +#define NDR_SAMR_LOOKUPDOMAIN (0x05) + +#define NDR_SAMR_ENUMDOMAINS (0x06) + +#define NDR_SAMR_OPENDOMAIN (0x07) + +#define NDR_SAMR_QUERYDOMAININFO (0x08) + +#define NDR_SAMR_SETDOMAININFO (0x09) + +#define NDR_SAMR_CREATEDOMAINGROUP (0x0a) + +#define NDR_SAMR_ENUMDOMAINGROUPS (0x0b) + +#define NDR_SAMR_CREATEUSER (0x0c) + +#define NDR_SAMR_ENUMDOMAINUSERS (0x0d) + +#define NDR_SAMR_CREATEDOMALIAS (0x0e) + +#define NDR_SAMR_ENUMDOMAINALIASES (0x0f) + +#define NDR_SAMR_GETALIASMEMBERSHIP (0x10) + +#define NDR_SAMR_LOOKUPNAMES (0x11) + +#define NDR_SAMR_LOOKUPRIDS (0x12) + +#define NDR_SAMR_OPENGROUP (0x13) + +#define NDR_SAMR_QUERYGROUPINFO (0x14) + +#define NDR_SAMR_SETGROUPINFO (0x15) + +#define NDR_SAMR_ADDGROUPMEMBER (0x16) + +#define NDR_SAMR_DELETEDOMAINGROUP (0x17) + +#define NDR_SAMR_DELETEGROUPMEMBER (0x18) + +#define NDR_SAMR_QUERYGROUPMEMBER (0x19) + +#define NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP (0x1a) + +#define NDR_SAMR_OPENALIAS (0x1b) + +#define NDR_SAMR_QUERYALIASINFO (0x1c) + +#define NDR_SAMR_SETALIASINFO (0x1d) + +#define NDR_SAMR_DELETEDOMALIAS (0x1e) + +#define NDR_SAMR_ADDALIASMEMBER (0x1f) + +#define NDR_SAMR_DELETEALIASMEMBER (0x20) + +#define NDR_SAMR_GETMEMBERSINALIAS (0x21) + +#define NDR_SAMR_OPENUSER (0x22) + +#define NDR_SAMR_DELETEUSER (0x23) + +#define NDR_SAMR_QUERYUSERINFO (0x24) + +#define NDR_SAMR_SETUSERINFO (0x25) + +#define NDR_SAMR_CHANGEPASSWORDUSER (0x26) + +#define NDR_SAMR_GETGROUPSFORUSER (0x27) + +#define NDR_SAMR_QUERYDISPLAYINFO (0x28) + +#define NDR_SAMR_GETDISPLAYENUMERATIONINDEX (0x29) + +#define NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN (0x2a) + +#define NDR_SAMR_TESTPRIVATEFUNCTIONSUSER (0x2b) + +#define NDR_SAMR_GETUSERPWINFO (0x2c) + +#define NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN (0x2d) + +#define NDR_SAMR_QUERYDOMAININFO2 (0x2e) + +#define NDR_SAMR_QUERYUSERINFO2 (0x2f) + +#define NDR_SAMR_QUERYDISPLAYINFO2 (0x30) + +#define NDR_SAMR_GETDISPLAYENUMERATIONINDEX2 (0x31) + +#define NDR_SAMR_CREATEUSER2 (0x32) + +#define NDR_SAMR_QUERYDISPLAYINFO3 (0x33) + +#define NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS (0x34) + +#define NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS (0x35) + +#define NDR_SAMR_OEMCHANGEPASSWORDUSER2 (0x36) + +#define NDR_SAMR_CHANGEPASSWORDUSER2 (0x37) + +#define NDR_SAMR_GETDOMPWINFO (0x38) + +#define NDR_SAMR_CONNECT2 (0x39) + +#define NDR_SAMR_SETUSERINFO2 (0x3a) + +#define NDR_SAMR_SETBOOTKEYINFORMATION (0x3b) + +#define NDR_SAMR_GETBOOTKEYINFORMATION (0x3c) + +#define NDR_SAMR_CONNECT3 (0x3d) + +#define NDR_SAMR_CONNECT4 (0x3e) + +#define NDR_SAMR_CHANGEPASSWORDUSER3 (0x3f) + +#define NDR_SAMR_CONNECT5 (0x40) + +#define NDR_SAMR_RIDTOSID (0x41) + +#define NDR_SAMR_SETDSRMPASSWORD (0x42) + +#define NDR_SAMR_VALIDATEPASSWORD (0x43) + +#define NDR_SAMR_CALL_COUNT (68) +enum ndr_err_code ndr_push_netr_SamDatabaseID(struct ndr_push *ndr, int ndr_flags, enum netr_SamDatabaseID r); +enum ndr_err_code ndr_pull_netr_SamDatabaseID(struct ndr_pull *ndr, int ndr_flags, enum netr_SamDatabaseID *r); +void ndr_print_netr_SamDatabaseID(struct ndr_print *ndr, const char *name, enum netr_SamDatabaseID r); +enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int ndr_flags, enum samr_RejectReason r); +enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r); +void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r); +enum ndr_err_code ndr_push_samr_AcctFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_samr_AcctFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_samr_AcctFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_ConnectAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_UserAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_DomainAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_GroupAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_AliasAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, const struct samr_SamEntry *r); +void ndr_print_samr_SamArray(struct ndr_print *ndr, const char *name, const struct samr_SamArray *r); +void ndr_print_samr_Role(struct ndr_print *ndr, const char *name, enum samr_Role r); +enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_DomainServerState(struct ndr_print *ndr, const char *name, enum samr_DomainServerState r); +void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r); +void ndr_print_samr_DomGeneralInformation(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation *r); +void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r); +void ndr_print_samr_DomOEMInformation(struct ndr_print *ndr, const char *name, const struct samr_DomOEMInformation *r); +void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r); +void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r); +void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r); +void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r); +void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r); +void ndr_print_samr_DomGeneralInformation2(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation2 *r); +void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r); +void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r); +void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r); +void ndr_print_samr_Ids(struct ndr_print *ndr, const char *name, const struct samr_Ids *r); +enum ndr_err_code ndr_push_samr_GroupAttrs(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_samr_GroupAttrs(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_samr_GroupAttrs(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_GroupInfoAll(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAll *r); +void ndr_print_samr_GroupInfoAttributes(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAttributes *r); +void ndr_print_samr_GroupInfoEnum(struct ndr_print *ndr, const char *name, enum samr_GroupInfoEnum r); +void ndr_print_samr_GroupInfo(struct ndr_print *ndr, const char *name, const union samr_GroupInfo *r); +void ndr_print_samr_RidTypeArray(struct ndr_print *ndr, const char *name, const struct samr_RidTypeArray *r); +void ndr_print_samr_AliasInfoAll(struct ndr_print *ndr, const char *name, const struct samr_AliasInfoAll *r); +void ndr_print_samr_AliasInfoEnum(struct ndr_print *ndr, const char *name, enum samr_AliasInfoEnum r); +void ndr_print_samr_AliasInfo(struct ndr_print *ndr, const char *name, const union samr_AliasInfo *r); +void ndr_print_samr_UserInfo1(struct ndr_print *ndr, const char *name, const struct samr_UserInfo1 *r); +void ndr_print_samr_UserInfo2(struct ndr_print *ndr, const char *name, const struct samr_UserInfo2 *r); +enum ndr_err_code ndr_push_samr_LogonHours(struct ndr_push *ndr, int ndr_flags, const struct samr_LogonHours *r); +enum ndr_err_code ndr_pull_samr_LogonHours(struct ndr_pull *ndr, int ndr_flags, struct samr_LogonHours *r); +void ndr_print_samr_LogonHours(struct ndr_print *ndr, const char *name, const struct samr_LogonHours *r); +void ndr_print_samr_UserInfo3(struct ndr_print *ndr, const char *name, const struct samr_UserInfo3 *r); +void ndr_print_samr_UserInfo4(struct ndr_print *ndr, const char *name, const struct samr_UserInfo4 *r); +void ndr_print_samr_UserInfo5(struct ndr_print *ndr, const char *name, const struct samr_UserInfo5 *r); +void ndr_print_samr_UserInfo6(struct ndr_print *ndr, const char *name, const struct samr_UserInfo6 *r); +void ndr_print_samr_UserInfo7(struct ndr_print *ndr, const char *name, const struct samr_UserInfo7 *r); +void ndr_print_samr_UserInfo8(struct ndr_print *ndr, const char *name, const struct samr_UserInfo8 *r); +void ndr_print_samr_UserInfo9(struct ndr_print *ndr, const char *name, const struct samr_UserInfo9 *r); +void ndr_print_samr_UserInfo10(struct ndr_print *ndr, const char *name, const struct samr_UserInfo10 *r); +void ndr_print_samr_UserInfo11(struct ndr_print *ndr, const char *name, const struct samr_UserInfo11 *r); +void ndr_print_samr_UserInfo12(struct ndr_print *ndr, const char *name, const struct samr_UserInfo12 *r); +void ndr_print_samr_UserInfo13(struct ndr_print *ndr, const char *name, const struct samr_UserInfo13 *r); +void ndr_print_samr_UserInfo14(struct ndr_print *ndr, const char *name, const struct samr_UserInfo14 *r); +void ndr_print_samr_UserInfo16(struct ndr_print *ndr, const char *name, const struct samr_UserInfo16 *r); +void ndr_print_samr_UserInfo17(struct ndr_print *ndr, const char *name, const struct samr_UserInfo17 *r); +enum ndr_err_code ndr_push_samr_Password(struct ndr_push *ndr, int ndr_flags, const struct samr_Password *r); +enum ndr_err_code ndr_pull_samr_Password(struct ndr_pull *ndr, int ndr_flags, struct samr_Password *r); +void ndr_print_samr_Password(struct ndr_print *ndr, const char *name, const struct samr_Password *r); +void ndr_print_samr_UserInfo18(struct ndr_print *ndr, const char *name, const struct samr_UserInfo18 *r); +void ndr_print_samr_UserInfo20(struct ndr_print *ndr, const char *name, const struct samr_UserInfo20 *r); +void ndr_print_samr_FieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_UserInfo21(struct ndr_print *ndr, const char *name, const struct samr_UserInfo21 *r); +enum ndr_err_code ndr_push_samr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPassword *r); +enum ndr_err_code ndr_pull_samr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPassword *r); +void ndr_print_samr_CryptPassword(struct ndr_print *ndr, const char *name, const struct samr_CryptPassword *r); +void ndr_print_samr_UserInfo23(struct ndr_print *ndr, const char *name, const struct samr_UserInfo23 *r); +void ndr_print_samr_UserInfo24(struct ndr_print *ndr, const char *name, const struct samr_UserInfo24 *r); +void ndr_print_samr_CryptPasswordEx(struct ndr_print *ndr, const char *name, const struct samr_CryptPasswordEx *r); +void ndr_print_samr_UserInfo25(struct ndr_print *ndr, const char *name, const struct samr_UserInfo25 *r); +void ndr_print_samr_UserInfo26(struct ndr_print *ndr, const char *name, const struct samr_UserInfo26 *r); +void ndr_print_samr_UserInfo(struct ndr_print *ndr, const char *name, const union samr_UserInfo *r); +enum ndr_err_code ndr_push_samr_RidWithAttribute(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttribute *r); +enum ndr_err_code ndr_pull_samr_RidWithAttribute(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttribute *r); +void ndr_print_samr_RidWithAttribute(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttribute *r); +enum ndr_err_code ndr_push_samr_RidWithAttributeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttributeArray *r); +enum ndr_err_code ndr_pull_samr_RidWithAttributeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttributeArray *r); +void ndr_print_samr_RidWithAttributeArray(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttributeArray *r); +void ndr_print_samr_DispEntryGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispEntryGeneral *r); +void ndr_print_samr_DispInfoGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispInfoGeneral *r); +void ndr_print_samr_DispEntryFull(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFull *r); +void ndr_print_samr_DispInfoFull(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFull *r); +void ndr_print_samr_DispEntryFullGroup(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFullGroup *r); +void ndr_print_samr_DispInfoFullGroups(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFullGroups *r); +void ndr_print_samr_DispEntryAscii(struct ndr_print *ndr, const char *name, const struct samr_DispEntryAscii *r); +void ndr_print_samr_DispInfoAscii(struct ndr_print *ndr, const char *name, const struct samr_DispInfoAscii *r); +void ndr_print_samr_DispInfo(struct ndr_print *ndr, const char *name, const union samr_DispInfo *r); +void ndr_print_samr_PwInfo(struct ndr_print *ndr, const char *name, const struct samr_PwInfo *r); +void ndr_print_samr_ConnectVersion(struct ndr_print *ndr, const char *name, enum samr_ConnectVersion r); +void ndr_print_samr_ChangeReject(struct ndr_print *ndr, const char *name, const struct samr_ChangeReject *r); +void ndr_print_samr_ConnectInfo1(struct ndr_print *ndr, const char *name, const struct samr_ConnectInfo1 *r); +void ndr_print_samr_ConnectInfo(struct ndr_print *ndr, const char *name, const union samr_ConnectInfo *r); +void ndr_print_samr_ValidateFieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_ValidatePasswordLevel(struct ndr_print *ndr, const char *name, enum samr_ValidatePasswordLevel r); +void ndr_print_samr_ValidationStatus(struct ndr_print *ndr, const char *name, enum samr_ValidationStatus r); +void ndr_print_samr_ValidationBlob(struct ndr_print *ndr, const char *name, const struct samr_ValidationBlob *r); +void ndr_print_samr_ValidatePasswordInfo(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordInfo *r); +void ndr_print_samr_ValidatePasswordRepCtr(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordRepCtr *r); +void ndr_print_samr_ValidatePasswordRep(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordRep *r); +void ndr_print_samr_ValidatePasswordReq3(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq3 *r); +void ndr_print_samr_ValidatePasswordReq2(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq2 *r); +void ndr_print_samr_ValidatePasswordReq1(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq1 *r); +void ndr_print_samr_ValidatePasswordReq(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordReq *r); +void ndr_print_samr_Connect(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect *r); +enum ndr_err_code ndr_push_samr_Close(struct ndr_push *ndr, int flags, const struct samr_Close *r); +enum ndr_err_code ndr_pull_samr_Close(struct ndr_pull *ndr, int flags, struct samr_Close *r); +void ndr_print_samr_Close(struct ndr_print *ndr, const char *name, int flags, const struct samr_Close *r); +void ndr_print_samr_SetSecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetSecurity *r); +void ndr_print_samr_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_QuerySecurity *r); +void ndr_print_samr_Shutdown(struct ndr_print *ndr, const char *name, int flags, const struct samr_Shutdown *r); +void ndr_print_samr_LookupDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupDomain *r); +void ndr_print_samr_EnumDomains(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomains *r); +enum ndr_err_code ndr_push_samr_OpenDomain(struct ndr_push *ndr, int flags, const struct samr_OpenDomain *r); +enum ndr_err_code ndr_pull_samr_OpenDomain(struct ndr_pull *ndr, int flags, struct samr_OpenDomain *r); +void ndr_print_samr_OpenDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenDomain *r); +void ndr_print_samr_QueryDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo *r); +void ndr_print_samr_SetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDomainInfo *r); +void ndr_print_samr_CreateDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomainGroup *r); +void ndr_print_samr_EnumDomainGroups(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainGroups *r); +void ndr_print_samr_CreateUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser *r); +void ndr_print_samr_EnumDomainUsers(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainUsers *r); +void ndr_print_samr_CreateDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomAlias *r); +void ndr_print_samr_EnumDomainAliases(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainAliases *r); +void ndr_print_samr_GetAliasMembership(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetAliasMembership *r); +enum ndr_err_code ndr_push_samr_LookupNames(struct ndr_push *ndr, int flags, const struct samr_LookupNames *r); +enum ndr_err_code ndr_pull_samr_LookupNames(struct ndr_pull *ndr, int flags, struct samr_LookupNames *r); +void ndr_print_samr_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupNames *r); +void ndr_print_samr_LookupRids(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupRids *r); +void ndr_print_samr_OpenGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenGroup *r); +void ndr_print_samr_QueryGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupInfo *r); +void ndr_print_samr_SetGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetGroupInfo *r); +void ndr_print_samr_AddGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddGroupMember *r); +void ndr_print_samr_DeleteDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomainGroup *r); +void ndr_print_samr_DeleteGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteGroupMember *r); +void ndr_print_samr_QueryGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupMember *r); +void ndr_print_samr_SetMemberAttributesOfGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetMemberAttributesOfGroup *r); +void ndr_print_samr_OpenAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenAlias *r); +void ndr_print_samr_QueryAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryAliasInfo *r); +void ndr_print_samr_SetAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetAliasInfo *r); +void ndr_print_samr_DeleteDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomAlias *r); +void ndr_print_samr_AddAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddAliasMember *r); +void ndr_print_samr_DeleteAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteAliasMember *r); +void ndr_print_samr_GetMembersInAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetMembersInAlias *r); +enum ndr_err_code ndr_push_samr_OpenUser(struct ndr_push *ndr, int flags, const struct samr_OpenUser *r); +enum ndr_err_code ndr_pull_samr_OpenUser(struct ndr_pull *ndr, int flags, struct samr_OpenUser *r); +void ndr_print_samr_OpenUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenUser *r); +void ndr_print_samr_DeleteUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteUser *r); +enum ndr_err_code ndr_push_samr_QueryUserInfo(struct ndr_push *ndr, int flags, const struct samr_QueryUserInfo *r); +enum ndr_err_code ndr_pull_samr_QueryUserInfo(struct ndr_pull *ndr, int flags, struct samr_QueryUserInfo *r); +void ndr_print_samr_QueryUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo *r); +enum ndr_err_code ndr_push_samr_SetUserInfo(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo *r); +enum ndr_err_code ndr_pull_samr_SetUserInfo(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo *r); +void ndr_print_samr_SetUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo *r); +void ndr_print_samr_ChangePasswordUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser *r); +void ndr_print_samr_GetGroupsForUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetGroupsForUser *r); +void ndr_print_samr_QueryDisplayInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo *r); +void ndr_print_samr_GetDisplayEnumerationIndex(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex *r); +void ndr_print_samr_TestPrivateFunctionsDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsDomain *r); +void ndr_print_samr_TestPrivateFunctionsUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsUser *r); +enum ndr_err_code ndr_push_samr_GetUserPwInfo(struct ndr_push *ndr, int flags, const struct samr_GetUserPwInfo *r); +enum ndr_err_code ndr_pull_samr_GetUserPwInfo(struct ndr_pull *ndr, int flags, struct samr_GetUserPwInfo *r); +void ndr_print_samr_GetUserPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetUserPwInfo *r); +void ndr_print_samr_RemoveMemberFromForeignDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMemberFromForeignDomain *r); +void ndr_print_samr_QueryDomainInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo2 *r); +void ndr_print_samr_QueryUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo2 *r); +void ndr_print_samr_QueryDisplayInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo2 *r); +void ndr_print_samr_GetDisplayEnumerationIndex2(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex2 *r); +void ndr_print_samr_CreateUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser2 *r); +void ndr_print_samr_QueryDisplayInfo3(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo3 *r); +void ndr_print_samr_AddMultipleMembersToAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddMultipleMembersToAlias *r); +void ndr_print_samr_RemoveMultipleMembersFromAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMultipleMembersFromAlias *r); +void ndr_print_samr_OemChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_OemChangePasswordUser2 *r); +void ndr_print_samr_ChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser2 *r); +void ndr_print_samr_GetDomPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDomPwInfo *r); +void ndr_print_samr_Connect2(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect2 *r); +enum ndr_err_code ndr_push_samr_SetUserInfo2(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo2 *r); +enum ndr_err_code ndr_pull_samr_SetUserInfo2(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo2 *r); +void ndr_print_samr_SetUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo2 *r); +void ndr_print_samr_SetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetBootKeyInformation *r); +void ndr_print_samr_GetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetBootKeyInformation *r); +void ndr_print_samr_Connect3(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect3 *r); +void ndr_print_samr_Connect4(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect4 *r); +void ndr_print_samr_ChangePasswordUser3(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser3 *r); +enum ndr_err_code ndr_push_samr_Connect5(struct ndr_push *ndr, int flags, const struct samr_Connect5 *r); +enum ndr_err_code ndr_pull_samr_Connect5(struct ndr_pull *ndr, int flags, struct samr_Connect5 *r); +void ndr_print_samr_Connect5(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect5 *r); +void ndr_print_samr_RidToSid(struct ndr_print *ndr, const char *name, int flags, const struct samr_RidToSid *r); +void ndr_print_samr_SetDsrmPassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDsrmPassword *r); +void ndr_print_samr_ValidatePassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_ValidatePassword *r); +#endif /* _HEADER_NDR_samr */ diff --git a/librpc/gen_ndr/ndr_security.c b/librpc/gen_ndr/ndr_security.c new file mode 100644 index 0000000000..b4d221ac90 --- /dev/null +++ b/librpc/gen_ndr/ndr_security.c @@ -0,0 +1,1032 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_security.h" + +#include "librpc/gen_ndr/ndr_misc.h" +_PUBLIC_ enum ndr_err_code ndr_push_security_ace_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_ace_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_flags(struct ndr_print *ndr, const char *name, uint8_t r) +{ + ndr_print_uint8(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_OBJECT_INHERIT", SEC_ACE_FLAG_OBJECT_INHERIT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_CONTAINER_INHERIT", SEC_ACE_FLAG_CONTAINER_INHERIT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_NO_PROPAGATE_INHERIT", SEC_ACE_FLAG_NO_PROPAGATE_INHERIT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_INHERIT_ONLY", SEC_ACE_FLAG_INHERIT_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_INHERITED_ACE", SEC_ACE_FLAG_INHERITED_ACE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_VALID_INHERIT", SEC_ACE_FLAG_VALID_INHERIT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_SUCCESSFUL_ACCESS", SEC_ACE_FLAG_SUCCESSFUL_ACCESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_FAILED_ACCESS", SEC_ACE_FLAG_FAILED_ACCESS, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_ace_type(struct ndr_push *ndr, int ndr_flags, enum security_ace_type r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_ace_type(struct ndr_pull *ndr, int ndr_flags, enum security_ace_type *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_type(struct ndr_print *ndr, const char *name, enum security_ace_type r) +{ + const char *val = NULL; + + switch (r) { + case SEC_ACE_TYPE_ACCESS_ALLOWED: val = "SEC_ACE_TYPE_ACCESS_ALLOWED"; break; + case SEC_ACE_TYPE_ACCESS_DENIED: val = "SEC_ACE_TYPE_ACCESS_DENIED"; break; + case SEC_ACE_TYPE_SYSTEM_AUDIT: val = "SEC_ACE_TYPE_SYSTEM_AUDIT"; break; + case SEC_ACE_TYPE_SYSTEM_ALARM: val = "SEC_ACE_TYPE_SYSTEM_ALARM"; break; + case SEC_ACE_TYPE_ALLOWED_COMPOUND: val = "SEC_ACE_TYPE_ALLOWED_COMPOUND"; break; + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: val = "SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT"; break; + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: val = "SEC_ACE_TYPE_ACCESS_DENIED_OBJECT"; break; + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: val = "SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT"; break; + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: val = "SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_security_ace_object_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_object_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_object_flags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SEC_ACE_OBJECT_TYPE_PRESENT", SEC_ACE_OBJECT_TYPE_PRESENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT", SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_security_ace_object_type(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_type *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->type)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_object_type(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_type *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: { + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->type)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_object_type(struct ndr_print *ndr, const char *name, const union security_ace_object_type *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "security_ace_object_type"); + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: + ndr_print_GUID(ndr, "type", &r->type); + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_security_ace_object_inherited_type(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_inherited_type *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->inherited_type)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_object_inherited_type(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_inherited_type *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: { + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->inherited_type)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_object_inherited_type(struct ndr_print *ndr, const char *name, const union security_ace_object_inherited_type *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "security_ace_object_inherited_type"); + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: + ndr_print_GUID(ndr, "inherited_type", &r->inherited_type); + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_security_ace_object(struct ndr_push *ndr, int ndr_flags, const struct security_ace_object *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_security_ace_object_flags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->type, r->flags & SEC_ACE_OBJECT_TYPE_PRESENT)); + NDR_CHECK(ndr_push_security_ace_object_type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->inherited_type, r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)); + NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr, NDR_SCALARS, &r->inherited_type)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_security_ace_object_type(ndr, NDR_BUFFERS, &r->type)); + NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr, NDR_BUFFERS, &r->inherited_type)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_object(struct ndr_pull *ndr, int ndr_flags, struct security_ace_object *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_security_ace_object_flags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->type, r->flags & SEC_ACE_OBJECT_TYPE_PRESENT)); + NDR_CHECK(ndr_pull_security_ace_object_type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->inherited_type, r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)); + NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr, NDR_SCALARS, &r->inherited_type)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_security_ace_object_type(ndr, NDR_BUFFERS, &r->type)); + NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr, NDR_BUFFERS, &r->inherited_type)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_object(struct ndr_print *ndr, const char *name, const struct security_ace_object *r) +{ + ndr_print_struct(ndr, name, "security_ace_object"); + ndr->depth++; + ndr_print_security_ace_object_flags(ndr, "flags", r->flags); + ndr_print_set_switch_value(ndr, &r->type, r->flags & SEC_ACE_OBJECT_TYPE_PRESENT); + ndr_print_security_ace_object_type(ndr, "type", &r->type); + ndr_print_set_switch_value(ndr, &r->inherited_type, r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT); + ndr_print_security_ace_object_inherited_type(ndr, "inherited_type", &r->inherited_type); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_ace_object_ctr(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_ctr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: { + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: { + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: { + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: { + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_ace_object_ctr(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_ctr *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: { + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: { + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: { + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: { + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_object_ctr(struct ndr_print *ndr, const char *name, const union security_ace_object_ctr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "security_ace_object_ctr"); + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: + ndr_print_security_ace_object(ndr, "object", &r->object); + break; + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: + ndr_print_security_ace_object(ndr, "object", &r->object); + break; + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: + ndr_print_security_ace_object(ndr, "object", &r->object); + break; + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: + ndr_print_security_ace_object(ndr, "object", &r->object); + break; + + default: + break; + + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_ace(struct ndr_push *ndr, int ndr_flags, const struct security_ace *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_security_ace_type(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_security_ace_flags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_security_ace(r, ndr->flags))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->access_mask)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, r->type)); + NDR_CHECK(ndr_push_security_ace_object_ctr(ndr, NDR_SCALARS, &r->object)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->trustee)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_security_ace_object_ctr(ndr, NDR_BUFFERS, &r->object)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace(struct ndr_print *ndr, const char *name, const struct security_ace *r) +{ + ndr_print_struct(ndr, name, "security_ace"); + ndr->depth++; + ndr_print_security_ace_type(ndr, "type", r->type); + ndr_print_security_ace_flags(ndr, "flags", r->flags); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_ace(r, ndr->flags):r->size); + ndr_print_uint32(ndr, "access_mask", r->access_mask); + ndr_print_set_switch_value(ndr, &r->object, r->type); + ndr_print_security_ace_object_ctr(ndr, "object", &r->object); + ndr_print_dom_sid(ndr, "trustee", &r->trustee); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_security_acl_revision(struct ndr_push *ndr, int ndr_flags, enum security_acl_revision r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_acl_revision(struct ndr_pull *ndr, int ndr_flags, enum security_acl_revision *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_acl_revision(struct ndr_print *ndr, const char *name, enum security_acl_revision r) +{ + const char *val = NULL; + + switch (r) { + case SECURITY_ACL_REVISION_NT4: val = "SECURITY_ACL_REVISION_NT4"; break; + case SECURITY_ACL_REVISION_ADS: val = "SECURITY_ACL_REVISION_ADS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_acl(struct ndr_push *ndr, int ndr_flags, const struct security_acl *r) +{ + uint32_t cntr_aces_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_security_acl_revision(ndr, NDR_SCALARS, r->revision)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_security_acl(r, ndr->flags))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aces)); + for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { + NDR_CHECK(ndr_push_security_ace(ndr, NDR_SCALARS, &r->aces[cntr_aces_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { + NDR_CHECK(ndr_push_security_ace(ndr, NDR_BUFFERS, &r->aces[cntr_aces_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_acl(struct ndr_pull *ndr, int ndr_flags, struct security_acl *r) +{ + uint32_t cntr_aces_0; + TALLOC_CTX *_mem_save_aces_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_security_acl_revision(ndr, NDR_SCALARS, &r->revision)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aces)); + if (r->num_aces < 0 || r->num_aces > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->aces, r->num_aces); + _mem_save_aces_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->aces, 0); + for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { + NDR_CHECK(ndr_pull_security_ace(ndr, NDR_SCALARS, &r->aces[cntr_aces_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_aces_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_aces_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->aces, 0); + for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { + NDR_CHECK(ndr_pull_security_ace(ndr, NDR_BUFFERS, &r->aces[cntr_aces_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_aces_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_acl(struct ndr_print *ndr, const char *name, const struct security_acl *r) +{ + uint32_t cntr_aces_0; + ndr_print_struct(ndr, name, "security_acl"); + ndr->depth++; + ndr_print_security_acl_revision(ndr, "revision", r->revision); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_acl(r, ndr->flags):r->size); + ndr_print_uint32(ndr, "num_aces", r->num_aces); + ndr->print(ndr, "%s: ARRAY(%d)", "aces", (int)r->num_aces); + ndr->depth++; + for (cntr_aces_0=0;cntr_aces_0num_aces;cntr_aces_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_aces_0) != -1) { + ndr_print_security_ace(ndr, "aces", &r->aces[cntr_aces_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_security_descriptor_revision(struct ndr_push *ndr, int ndr_flags, enum security_descriptor_revision r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_descriptor_revision(struct ndr_pull *ndr, int ndr_flags, enum security_descriptor_revision *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_descriptor_revision(struct ndr_print *ndr, const char *name, enum security_descriptor_revision r) +{ + const char *val = NULL; + + switch (r) { + case SECURITY_DESCRIPTOR_REVISION_1: val = "SECURITY_DESCRIPTOR_REVISION_1"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_security_descriptor_type(struct ndr_push *ndr, int ndr_flags, uint16_t r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_descriptor_type(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_descriptor_type(struct ndr_print *ndr, const char *name, uint16_t r) +{ + ndr_print_uint16(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_OWNER_DEFAULTED", SEC_DESC_OWNER_DEFAULTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_GROUP_DEFAULTED", SEC_DESC_GROUP_DEFAULTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_PRESENT", SEC_DESC_DACL_PRESENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_DEFAULTED", SEC_DESC_DACL_DEFAULTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_PRESENT", SEC_DESC_SACL_PRESENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_DEFAULTED", SEC_DESC_SACL_DEFAULTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_TRUSTED", SEC_DESC_DACL_TRUSTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SERVER_SECURITY", SEC_DESC_SERVER_SECURITY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERIT_REQ", SEC_DESC_DACL_AUTO_INHERIT_REQ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERIT_REQ", SEC_DESC_SACL_AUTO_INHERIT_REQ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERITED", SEC_DESC_DACL_AUTO_INHERITED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERITED", SEC_DESC_SACL_AUTO_INHERITED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_PROTECTED", SEC_DESC_DACL_PROTECTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_PROTECTED", SEC_DESC_SACL_PROTECTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_RM_CONTROL_VALID", SEC_DESC_RM_CONTROL_VALID, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SELF_RELATIVE", SEC_DESC_SELF_RELATIVE, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_security_descriptor_revision(ndr, NDR_SCALARS, r->revision)); + NDR_CHECK(ndr_push_security_descriptor_type(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->owner_sid)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->group_sid)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sacl)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dacl)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->owner_sid) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->owner_sid)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->owner_sid)); + } + if (r->group_sid) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->group_sid)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->group_sid)); + } + if (r->sacl) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->sacl)); + NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); + } + if (r->dacl) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->dacl)); + NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r) +{ + uint32_t _ptr_owner_sid; + TALLOC_CTX *_mem_save_owner_sid_0; + uint32_t _ptr_group_sid; + TALLOC_CTX *_mem_save_group_sid_0; + uint32_t _ptr_sacl; + TALLOC_CTX *_mem_save_sacl_0; + uint32_t _ptr_dacl; + TALLOC_CTX *_mem_save_dacl_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_security_descriptor_revision(ndr, NDR_SCALARS, &r->revision)); + NDR_CHECK(ndr_pull_security_descriptor_type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_owner_sid)); + if (_ptr_owner_sid) { + NDR_PULL_ALLOC(ndr, r->owner_sid); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->owner_sid, _ptr_owner_sid)); + } else { + r->owner_sid = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_sid)); + if (_ptr_group_sid) { + NDR_PULL_ALLOC(ndr, r->group_sid); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->group_sid, _ptr_group_sid)); + } else { + r->group_sid = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sacl)); + if (_ptr_sacl) { + NDR_PULL_ALLOC(ndr, r->sacl); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sacl, _ptr_sacl)); + } else { + r->sacl = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dacl)); + if (_ptr_dacl) { + NDR_PULL_ALLOC(ndr, r->dacl); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dacl, _ptr_dacl)); + } else { + r->dacl = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->owner_sid) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->owner_sid)); + _mem_save_owner_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->owner_sid, 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->owner_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_owner_sid_0, 0); + ndr->offset = _relative_save_offset; + } + if (r->group_sid) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->group_sid)); + _mem_save_group_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->group_sid, 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->group_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_sid_0, 0); + ndr->offset = _relative_save_offset; + } + if (r->sacl) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sacl)); + _mem_save_sacl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sacl, 0); + NDR_CHECK(ndr_pull_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sacl_0, 0); + ndr->offset = _relative_save_offset; + } + if (r->dacl) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dacl)); + _mem_save_dacl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dacl, 0); + NDR_CHECK(ndr_pull_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dacl_0, 0); + ndr->offset = _relative_save_offset; + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r) +{ + ndr_print_struct(ndr, name, "security_descriptor"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); + ndr->depth++; + ndr_print_security_descriptor_revision(ndr, "revision", r->revision); + ndr_print_security_descriptor_type(ndr, "type", r->type); + ndr_print_ptr(ndr, "owner_sid", r->owner_sid); + ndr->depth++; + if (r->owner_sid) { + ndr_print_dom_sid(ndr, "owner_sid", r->owner_sid); + } + ndr->depth--; + ndr_print_ptr(ndr, "group_sid", r->group_sid); + ndr->depth++; + if (r->group_sid) { + ndr_print_dom_sid(ndr, "group_sid", r->group_sid); + } + ndr->depth--; + ndr_print_ptr(ndr, "sacl", r->sacl); + ndr->depth++; + if (r->sacl) { + ndr_print_security_acl(ndr, "sacl", r->sacl); + } + ndr->depth--; + ndr_print_ptr(ndr, "dacl", r->dacl); + ndr->depth++; + if (r->dacl) { + ndr_print_security_acl(ndr, "dacl", r->dacl); + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_sec_desc_buf(struct ndr_push *ndr, int ndr_flags, const struct sec_desc_buf *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_security_descriptor(r->sd, ndr->flags))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sd) { + { + struct ndr_push *_ndr_sd; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sd, 4, -1)); + NDR_CHECK(ndr_push_security_descriptor(_ndr_sd, NDR_SCALARS|NDR_BUFFERS, r->sd)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sd, 4, -1)); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_sec_desc_buf(struct ndr_pull *ndr, int ndr_flags, struct sec_desc_buf *r) +{ + uint32_t _ptr_sd; + TALLOC_CTX *_mem_save_sd_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sd_size)); + if (r->sd_size < 0 || r->sd_size > 0x40000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd)); + if (_ptr_sd) { + NDR_PULL_ALLOC(ndr, r->sd); + } else { + r->sd = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sd) { + _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0); + { + struct ndr_pull *_ndr_sd; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sd, 4, -1)); + NDR_CHECK(ndr_pull_security_descriptor(_ndr_sd, NDR_SCALARS|NDR_BUFFERS, r->sd)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sd, 4, -1)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_sec_desc_buf(struct ndr_print *ndr, const char *name, const struct sec_desc_buf *r) +{ + ndr_print_struct(ndr, name, "sec_desc_buf"); + ndr->depth++; + ndr_print_uint32(ndr, "sd_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_descriptor(r->sd, ndr->flags):r->sd_size); + ndr_print_ptr(ndr, "sd", r->sd); + ndr->depth++; + if (r->sd) { + ndr_print_security_descriptor(ndr, "sd", r->sd); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_token(struct ndr_push *ndr, int ndr_flags, const struct security_token *r) +{ + uint32_t cntr_sids_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_sid)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_sid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids[cntr_sids_0])); + } + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->privilege_mask)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user_sid) { + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->user_sid)); + } + if (r->group_sid) { + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->group_sid)); + } + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + if (r->sids[cntr_sids_0]) { + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->sids[cntr_sids_0])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_token(struct ndr_pull *ndr, int ndr_flags, struct security_token *r) +{ + uint32_t _ptr_user_sid; + TALLOC_CTX *_mem_save_user_sid_0; + uint32_t _ptr_group_sid; + TALLOC_CTX *_mem_save_group_sid_0; + uint32_t _ptr_sids; + uint32_t cntr_sids_0; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_sid)); + if (_ptr_user_sid) { + NDR_PULL_ALLOC(ndr, r->user_sid); + } else { + r->user_sid = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_sid)); + if (_ptr_group_sid) { + NDR_PULL_ALLOC(ndr, r->group_sid); + } else { + r->group_sid = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids[cntr_sids_0]); + } else { + r->sids[cntr_sids_0] = NULL; + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->privilege_mask)); + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids)); + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user_sid) { + _mem_save_user_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_sid, 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->user_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_sid_0, 0); + } + if (r->group_sid) { + _mem_save_group_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->group_sid, 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->group_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_sid_0, 0); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + if (r->sids[cntr_sids_0]) { + _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids[cntr_sids_0], 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->sids[cntr_sids_0])); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_token(struct ndr_print *ndr, const char *name, const struct security_token *r) +{ + uint32_t cntr_sids_0; + ndr_print_struct(ndr, name, "security_token"); + ndr->depth++; + ndr_print_ptr(ndr, "user_sid", r->user_sid); + ndr->depth++; + if (r->user_sid) { + ndr_print_dom_sid(ndr, "user_sid", r->user_sid); + } + ndr->depth--; + ndr_print_ptr(ndr, "group_sid", r->group_sid); + ndr->depth++; + if (r->group_sid) { + ndr_print_dom_sid(ndr, "group_sid", r->group_sid); + } + ndr->depth--; + ndr_print_uint32(ndr, "num_sids", r->num_sids); + ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids); + ndr->depth++; + for (cntr_sids_0=0;cntr_sids_0num_sids;cntr_sids_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_sids_0) != -1) { + ndr_print_ptr(ndr, "sids", r->sids[cntr_sids_0]); + ndr->depth++; + if (r->sids[cntr_sids_0]) { + ndr_print_dom_sid(ndr, "sids", r->sids[cntr_sids_0]); + } + ndr->depth--; + free(idx_0); + } + } + ndr->depth--; + ndr_print_udlong(ndr, "privilege_mask", r->privilege_mask); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_secinfo(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_secinfo(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_secinfo(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_OWNER", SECINFO_OWNER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_GROUP", SECINFO_GROUP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_DACL", SECINFO_DACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_SACL", SECINFO_SACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_UNPROTECTED_SACL", SECINFO_UNPROTECTED_SACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_UNPROTECTED_DACL", SECINFO_UNPROTECTED_DACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_PROTECTED_SACL", SECINFO_PROTECTED_SACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_PROTECTED_DACL", SECINFO_PROTECTED_DACL, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_kerb_EncTypes(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_kerb_EncTypes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_kerb_EncTypes(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_DES_CBC_CRC", KERB_ENCTYPE_DES_CBC_CRC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_DES_CBC_MD5", KERB_ENCTYPE_DES_CBC_MD5, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_RC4_HMAC_MD5", KERB_ENCTYPE_RC4_HMAC_MD5, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96", KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96", KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96, r); + ndr->depth--; +} + diff --git a/librpc/gen_ndr/ndr_security.h b/librpc/gen_ndr/ndr_security.h new file mode 100644 index 0000000000..41c66aa65b --- /dev/null +++ b/librpc/gen_ndr/ndr_security.h @@ -0,0 +1,54 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/security.h" + +#ifndef _HEADER_NDR_security +#define _HEADER_NDR_security + +#define NDR_SECURITY_CALL_COUNT (0) +enum ndr_err_code ndr_push_dom_sid(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *r); +enum ndr_err_code ndr_pull_dom_sid(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *r); +void ndr_print_dom_sid(struct ndr_print *ndr, const char *name, const struct dom_sid *r); +size_t ndr_size_dom_sid(const struct dom_sid *r, int flags); +enum ndr_err_code ndr_push_security_ace_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r); +enum ndr_err_code ndr_pull_security_ace_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r); +void ndr_print_security_ace_flags(struct ndr_print *ndr, const char *name, uint8_t r); +enum ndr_err_code ndr_push_security_ace_type(struct ndr_push *ndr, int ndr_flags, enum security_ace_type r); +enum ndr_err_code ndr_pull_security_ace_type(struct ndr_pull *ndr, int ndr_flags, enum security_ace_type *r); +void ndr_print_security_ace_type(struct ndr_print *ndr, const char *name, enum security_ace_type r); +void ndr_print_security_ace_object_flags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_security_ace_object_type(struct ndr_print *ndr, const char *name, const union security_ace_object_type *r); +void ndr_print_security_ace_object_inherited_type(struct ndr_print *ndr, const char *name, const union security_ace_object_inherited_type *r); +void ndr_print_security_ace_object(struct ndr_print *ndr, const char *name, const struct security_ace_object *r); +enum ndr_err_code ndr_push_security_ace_object_ctr(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_ctr *r); +enum ndr_err_code ndr_pull_security_ace_object_ctr(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_ctr *r); +void ndr_print_security_ace_object_ctr(struct ndr_print *ndr, const char *name, const union security_ace_object_ctr *r); +enum ndr_err_code ndr_push_security_ace(struct ndr_push *ndr, int ndr_flags, const struct security_ace *r); +enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, struct security_ace *r); +void ndr_print_security_ace(struct ndr_print *ndr, const char *name, const struct security_ace *r); +size_t ndr_size_security_ace(const struct security_ace *r, int flags); +void ndr_print_security_acl_revision(struct ndr_print *ndr, const char *name, enum security_acl_revision r); +enum ndr_err_code ndr_push_security_acl(struct ndr_push *ndr, int ndr_flags, const struct security_acl *r); +enum ndr_err_code ndr_pull_security_acl(struct ndr_pull *ndr, int ndr_flags, struct security_acl *r); +void ndr_print_security_acl(struct ndr_print *ndr, const char *name, const struct security_acl *r); +size_t ndr_size_security_acl(const struct security_acl *r, int flags); +void ndr_print_security_descriptor_revision(struct ndr_print *ndr, const char *name, enum security_descriptor_revision r); +void ndr_print_security_descriptor_type(struct ndr_print *ndr, const char *name, uint16_t r); +enum ndr_err_code ndr_push_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r); +enum ndr_err_code ndr_pull_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r); +void ndr_print_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r); +size_t ndr_size_security_descriptor(const struct security_descriptor *r, int flags); +enum ndr_err_code ndr_push_sec_desc_buf(struct ndr_push *ndr, int ndr_flags, const struct sec_desc_buf *r); +enum ndr_err_code ndr_pull_sec_desc_buf(struct ndr_pull *ndr, int ndr_flags, struct sec_desc_buf *r); +void ndr_print_sec_desc_buf(struct ndr_print *ndr, const char *name, const struct sec_desc_buf *r); +enum ndr_err_code ndr_push_security_token(struct ndr_push *ndr, int ndr_flags, const struct security_token *r); +enum ndr_err_code ndr_pull_security_token(struct ndr_pull *ndr, int ndr_flags, struct security_token *r); +void ndr_print_security_token(struct ndr_print *ndr, const char *name, const struct security_token *r); +enum ndr_err_code ndr_push_security_secinfo(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_security_secinfo(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_security_secinfo(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_kerb_EncTypes(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_kerb_EncTypes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_kerb_EncTypes(struct ndr_print *ndr, const char *name, uint32_t r); +#endif /* _HEADER_NDR_security */ diff --git a/librpc/gen_ndr/ndr_srvsvc.c b/librpc/gen_ndr/ndr_srvsvc.c new file mode 100644 index 0000000000..125542d14a --- /dev/null +++ b/librpc/gen_ndr/ndr_srvsvc.c @@ -0,0 +1,19687 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_srvsvc.h" + +#include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/ndr_svcctl.h" +static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->device)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->device) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevInfo0 *r) +{ + uint32_t _ptr_device; + TALLOC_CTX *_mem_save_device_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device)); + if (_ptr_device) { + NDR_PULL_ALLOC(ndr, r->device); + } else { + r->device = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->device) { + _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->device, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->device)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->device)); + if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo0 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevInfo0"); + ndr->depth++; + ndr_print_ptr(ndr, "device", r->device); + ndr->depth++; + if (r->device) { + ndr_print_string(ndr, "device", r->device); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevCtr0 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevCtr0 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr0 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetCharDevCtr0"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetCharDevInfo0(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->device)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->device) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevInfo1 *r) +{ + uint32_t _ptr_device; + TALLOC_CTX *_mem_save_device_0; + uint32_t _ptr_user; + TALLOC_CTX *_mem_save_user_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device)); + if (_ptr_device) { + NDR_PULL_ALLOC(ndr, r->device); + } else { + r->device = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->user); + } else { + r->user = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->device) { + _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->device, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->device)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->device)); + if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0); + } + if (r->user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); + if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo1 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevInfo1"); + ndr->depth++; + ndr_print_ptr(ndr, "device", r->device); + ndr->depth++; + if (r->device) { + ndr_print_string(ndr, "device", r->device); + } + ndr->depth--; + ndr_print_uint32(ndr, "status", r->status); + ndr_print_ptr(ndr, "user", r->user); + ndr->depth++; + if (r->user) { + ndr_print_string(ndr, "user", r->user); + } + ndr->depth--; + ndr_print_uint32(ndr, "time", r->time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevCtr1 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevCtr1 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr1 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetCharDevCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetCharDevInfo1(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->info0) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + } + break; + + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info0_0; + TALLOC_CTX *_mem_save_info1_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_info0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); + if (_ptr_info0) { + NDR_PULL_ALLOC(ndr, r->info0); + } else { + r->info0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->info0) { + _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); + } + break; + + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetCharDevInfo"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "info0", r->info0); + ndr->depth++; + if (r->info0) { + ndr_print_srvsvc_NetCharDevInfo0(ndr, "info0", r->info0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_srvsvc_NetCharDevInfo1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->ctr0) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + } + break; + + case 1: + if (r->ctr1) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_ctr0_0; + TALLOC_CTX *_mem_save_ctr1_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_ctr0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); + if (_ptr_ctr0) { + NDR_PULL_ALLOC(ndr, r->ctr0); + } else { + r->ctr0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_ctr1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); + if (_ptr_ctr1) { + NDR_PULL_ALLOC(ndr, r->ctr1); + } else { + r->ctr1 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->ctr0) { + _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); + } + break; + + case 1: + if (r->ctr1) { + _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetCharDevCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "ctr0", r->ctr0); + ndr->depth++; + if (r->ctr0) { + ndr_print_srvsvc_NetCharDevCtr0(ndr, "ctr0", r->ctr0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "ctr1", r->ctr1); + ndr->depth++; + if (r->ctr1) { + ndr_print_srvsvc_NetCharDevCtr1(ndr, "ctr1", r->ctr1); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfoCtr *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevInfoCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_srvsvc_NetCharDevCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->device)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->device) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQInfo0 *r) +{ + uint32_t _ptr_device; + TALLOC_CTX *_mem_save_device_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device)); + if (_ptr_device) { + NDR_PULL_ALLOC(ndr, r->device); + } else { + r->device = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->device) { + _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->device, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->device)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->device)); + if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo0 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQInfo0"); + ndr->depth++; + ndr_print_ptr(ndr, "device", r->device); + ndr->depth++; + if (r->device) { + ndr_print_string(ndr, "device", r->device); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQCtr0 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQCtr0 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr0 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQCtr0"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetCharDevQInfo0(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->device)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->devices)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->users)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_ahead)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->device) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->devices) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->devices, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->devices, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->devices, ndr_charset_length(r->devices, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQInfo1 *r) +{ + uint32_t _ptr_device; + TALLOC_CTX *_mem_save_device_0; + uint32_t _ptr_devices; + TALLOC_CTX *_mem_save_devices_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device)); + if (_ptr_device) { + NDR_PULL_ALLOC(ndr, r->device); + } else { + r->device = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devices)); + if (_ptr_devices) { + NDR_PULL_ALLOC(ndr, r->devices); + } else { + r->devices = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->users)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_ahead)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->device) { + _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->device, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->device)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->device)); + if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0); + } + if (r->devices) { + _mem_save_devices_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->devices, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->devices)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->devices)); + if (ndr_get_array_length(ndr, &r->devices) > ndr_get_array_size(ndr, &r->devices)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->devices), ndr_get_array_length(ndr, &r->devices)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->devices), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->devices, ndr_get_array_length(ndr, &r->devices), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devices_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo1 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQInfo1"); + ndr->depth++; + ndr_print_ptr(ndr, "device", r->device); + ndr->depth++; + if (r->device) { + ndr_print_string(ndr, "device", r->device); + } + ndr->depth--; + ndr_print_uint32(ndr, "priority", r->priority); + ndr_print_ptr(ndr, "devices", r->devices); + ndr->depth++; + if (r->devices) { + ndr_print_string(ndr, "devices", r->devices); + } + ndr->depth--; + ndr_print_uint32(ndr, "users", r->users); + ndr_print_uint32(ndr, "num_ahead", r->num_ahead); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQCtr1 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQCtr1 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr1 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetCharDevQInfo1(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevQInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->info0) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + } + break; + + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevQInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info0_0; + TALLOC_CTX *_mem_save_info1_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_info0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); + if (_ptr_info0) { + NDR_PULL_ALLOC(ndr, r->info0); + } else { + r->info0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->info0) { + _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); + } + break; + + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetCharDevQInfo"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "info0", r->info0); + ndr->depth++; + if (r->info0) { + ndr_print_srvsvc_NetCharDevQInfo0(ndr, "info0", r->info0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_srvsvc_NetCharDevQInfo1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevQCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->ctr0) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + } + break; + + case 1: + if (r->ctr1) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevQCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_ctr0_0; + TALLOC_CTX *_mem_save_ctr1_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_ctr0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); + if (_ptr_ctr0) { + NDR_PULL_ALLOC(ndr, r->ctr0); + } else { + r->ctr0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_ctr1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); + if (_ptr_ctr1) { + NDR_PULL_ALLOC(ndr, r->ctr1); + } else { + r->ctr1 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->ctr0) { + _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); + } + break; + + case 1: + if (r->ctr1) { + _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetCharDevQCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "ctr0", r->ctr0); + ndr->depth++; + if (r->ctr0) { + ndr_print_srvsvc_NetCharDevQCtr0(ndr, "ctr0", r->ctr0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "ctr1", r->ctr1); + ndr->depth++; + if (r->ctr1) { + ndr_print_srvsvc_NetCharDevQCtr1(ndr, "ctr1", r->ctr1); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfoCtr *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQInfoCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_srvsvc_NetCharDevQCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetConnInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_id)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetConnInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_id)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetConnInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo0 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetConnInfo0"); + ndr->depth++; + ndr_print_uint32(ndr, "conn_id", r->conn_id); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetConnCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnCtr0 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetConnInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetConnCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnCtr0 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetConnInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetConnCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr0 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetConnCtr0"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetConnInfo0(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetConnInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_id)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_users)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_time)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->share)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->share) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->share, ndr_charset_length(r->share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetConnInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnInfo1 *r) +{ + uint32_t _ptr_user; + TALLOC_CTX *_mem_save_user_0; + uint32_t _ptr_share; + TALLOC_CTX *_mem_save_share_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_id)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_users)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_time)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->user); + } else { + r->user = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); + if (_ptr_share) { + NDR_PULL_ALLOC(ndr, r->share); + } else { + r->share = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); + if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + if (r->share) { + _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->share, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->share)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->share)); + if (ndr_get_array_length(ndr, &r->share) > ndr_get_array_size(ndr, &r->share)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->share), ndr_get_array_length(ndr, &r->share)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->share, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetConnInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo1 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetConnInfo1"); + ndr->depth++; + ndr_print_uint32(ndr, "conn_id", r->conn_id); + ndr_print_uint32(ndr, "conn_type", r->conn_type); + ndr_print_uint32(ndr, "num_open", r->num_open); + ndr_print_uint32(ndr, "num_users", r->num_users); + ndr_print_uint32(ndr, "conn_time", r->conn_time); + ndr_print_ptr(ndr, "user", r->user); + ndr->depth++; + if (r->user) { + ndr_print_string(ndr, "user", r->user); + } + ndr->depth--; + ndr_print_ptr(ndr, "share", r->share); + ndr->depth++; + if (r->share) { + ndr_print_string(ndr, "share", r->share); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetConnCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnCtr1 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetConnInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetConnInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetConnCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnCtr1 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetConnInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetConnInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetConnCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr1 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetConnCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetConnInfo1(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetConnCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetConnCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->ctr0) { + NDR_CHECK(ndr_push_srvsvc_NetConnCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + } + break; + + case 1: + if (r->ctr1) { + NDR_CHECK(ndr_push_srvsvc_NetConnCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetConnCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetConnCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_ctr0_0; + TALLOC_CTX *_mem_save_ctr1_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_ctr0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); + if (_ptr_ctr0) { + NDR_PULL_ALLOC(ndr, r->ctr0); + } else { + r->ctr0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_ctr1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); + if (_ptr_ctr1) { + NDR_PULL_ALLOC(ndr, r->ctr1); + } else { + r->ctr1 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->ctr0) { + _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); + NDR_CHECK(ndr_pull_srvsvc_NetConnCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); + } + break; + + case 1: + if (r->ctr1) { + _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); + NDR_CHECK(ndr_pull_srvsvc_NetConnCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetConnCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetConnCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetConnCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "ctr0", r->ctr0); + ndr->depth++; + if (r->ctr0) { + ndr_print_srvsvc_NetConnCtr0(ndr, "ctr0", r->ctr0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "ctr1", r->ctr1); + ndr->depth++; + if (r->ctr1) { + ndr_print_srvsvc_NetConnCtr1(ndr, "ctr1", r->ctr1); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetConnInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_srvsvc_NetConnCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_srvsvc_NetConnCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetConnInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_srvsvc_NetConnCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_srvsvc_NetConnCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetConnInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfoCtr *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetConnInfoCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_srvsvc_NetConnCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->fid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->fid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo2 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetFileInfo2"); + ndr->depth++; + ndr_print_uint32(ndr, "fid", r->fid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileCtr2 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileCtr2 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr2 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetFileCtr2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetFileInfo2(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileInfo3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->fid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->permissions)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_locks)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileInfo3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileInfo3 *r) +{ + uint32_t _ptr_path; + TALLOC_CTX *_mem_save_path_0; + uint32_t _ptr_user; + TALLOC_CTX *_mem_save_user_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->fid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->permissions)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_locks)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->path); + } else { + r->path = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->user); + } else { + r->user = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); + if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + if (r->user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); + if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileInfo3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo3 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetFileInfo3"); + ndr->depth++; + ndr_print_uint32(ndr, "fid", r->fid); + ndr_print_uint32(ndr, "permissions", r->permissions); + ndr_print_uint32(ndr, "num_locks", r->num_locks); + ndr_print_ptr(ndr, "path", r->path); + ndr->depth++; + if (r->path) { + ndr_print_string(ndr, "path", r->path); + } + ndr->depth--; + ndr_print_ptr(ndr, "user", r->user); + ndr->depth++; + if (r->user) { + ndr_print_string(ndr, "user", r->user); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileCtr3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileCtr3 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetFileInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetFileInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileCtr3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileCtr3 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetFileInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetFileInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileCtr3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr3 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetFileCtr3"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetFileInfo3(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetFileInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 2: + if (r->info2) { + NDR_CHECK(ndr_push_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, r->info2)); + } + break; + + case 3: + if (r->info3) { + NDR_CHECK(ndr_push_srvsvc_NetFileInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetFileInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info2_0; + TALLOC_CTX *_mem_save_info3_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 2: { + uint32_t _ptr_info2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_PULL_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + + case 3: { + uint32_t _ptr_info3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); + if (_ptr_info3) { + NDR_PULL_ALLOC(ndr, r->info3); + } else { + r->info3 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 2: + if (r->info2) { + _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); + NDR_CHECK(ndr_pull_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, r->info2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); + } + break; + + case 3: + if (r->info3) { + _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); + NDR_CHECK(ndr_pull_srvsvc_NetFileInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetFileInfo"); + switch (level) { + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_srvsvc_NetFileInfo2(ndr, "info2", r->info2); + } + ndr->depth--; + break; + + case 3: + ndr_print_ptr(ndr, "info3", r->info3); + ndr->depth++; + if (r->info3) { + ndr_print_srvsvc_NetFileInfo3(ndr, "info3", r->info3); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetFileCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr3)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 2: + if (r->ctr2) { + NDR_CHECK(ndr_push_srvsvc_NetFileCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + } + break; + + case 3: + if (r->ctr3) { + NDR_CHECK(ndr_push_srvsvc_NetFileCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetFileCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_ctr2_0; + TALLOC_CTX *_mem_save_ctr3_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 2: { + uint32_t _ptr_ctr2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); + if (_ptr_ctr2) { + NDR_PULL_ALLOC(ndr, r->ctr2); + } else { + r->ctr2 = NULL; + } + break; } + + case 3: { + uint32_t _ptr_ctr3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr3)); + if (_ptr_ctr3) { + NDR_PULL_ALLOC(ndr, r->ctr3); + } else { + r->ctr3 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 2: + if (r->ctr2) { + _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); + NDR_CHECK(ndr_pull_srvsvc_NetFileCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); + } + break; + + case 3: + if (r->ctr3) { + _mem_save_ctr3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr3, 0); + NDR_CHECK(ndr_pull_srvsvc_NetFileCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr3_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetFileCtr"); + switch (level) { + case 2: + ndr_print_ptr(ndr, "ctr2", r->ctr2); + ndr->depth++; + if (r->ctr2) { + ndr_print_srvsvc_NetFileCtr2(ndr, "ctr2", r->ctr2); + } + ndr->depth--; + break; + + case 3: + ndr_print_ptr(ndr, "ctr3", r->ctr3); + ndr->depth++; + if (r->ctr3) { + ndr_print_srvsvc_NetFileCtr3(ndr, "ctr3", r->ctr3); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_srvsvc_NetFileCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_srvsvc_NetFileCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_srvsvc_NetFileCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_srvsvc_NetFileCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfoCtr *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetFileInfoCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_srvsvc_NetFileCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo0 *r) +{ + uint32_t _ptr_client; + TALLOC_CTX *_mem_save_client_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); + if (_ptr_client) { + NDR_PULL_ALLOC(ndr, r->client); + } else { + r->client = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); + if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo0 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSessInfo0"); + ndr->depth++; + ndr_print_ptr(ndr, "client", r->client); + ndr->depth++; + if (r->client) { + ndr_print_string(ndr, "client", r->client); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr0 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr0 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr0 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetSessCtr0"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetSessInfo0(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->user_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo1 *r) +{ + uint32_t _ptr_client; + TALLOC_CTX *_mem_save_client_0; + uint32_t _ptr_user; + TALLOC_CTX *_mem_save_user_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); + if (_ptr_client) { + NDR_PULL_ALLOC(ndr, r->client); + } else { + r->client = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->user); + } else { + r->user = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->user_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); + if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); + } + if (r->user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); + if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo1 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSessInfo1"); + ndr->depth++; + ndr_print_ptr(ndr, "client", r->client); + ndr->depth++; + if (r->client) { + ndr_print_string(ndr, "client", r->client); + } + ndr->depth--; + ndr_print_ptr(ndr, "user", r->user); + ndr->depth++; + if (r->user) { + ndr_print_string(ndr, "user", r->user); + } + ndr->depth--; + ndr_print_uint32(ndr, "num_open", r->num_open); + ndr_print_uint32(ndr, "time", r->time); + ndr_print_uint32(ndr, "idle_time", r->idle_time); + ndr_print_uint32(ndr, "user_flags", r->user_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr1 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr1 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr1 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetSessCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetSessInfo1(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->user_flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_type)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->client_type) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_type, ndr_charset_length(r->client_type, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo2 *r) +{ + uint32_t _ptr_client; + TALLOC_CTX *_mem_save_client_0; + uint32_t _ptr_user; + TALLOC_CTX *_mem_save_user_0; + uint32_t _ptr_client_type; + TALLOC_CTX *_mem_save_client_type_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); + if (_ptr_client) { + NDR_PULL_ALLOC(ndr, r->client); + } else { + r->client = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->user); + } else { + r->user = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->user_flags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_type)); + if (_ptr_client_type) { + NDR_PULL_ALLOC(ndr, r->client_type); + } else { + r->client_type = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); + if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); + } + if (r->user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); + if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + if (r->client_type) { + _mem_save_client_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->client_type, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->client_type)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->client_type)); + if (ndr_get_array_length(ndr, &r->client_type) > ndr_get_array_size(ndr, &r->client_type)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_type), ndr_get_array_length(ndr, &r->client_type)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_type, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_type_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo2 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSessInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "client", r->client); + ndr->depth++; + if (r->client) { + ndr_print_string(ndr, "client", r->client); + } + ndr->depth--; + ndr_print_ptr(ndr, "user", r->user); + ndr->depth++; + if (r->user) { + ndr_print_string(ndr, "user", r->user); + } + ndr->depth--; + ndr_print_uint32(ndr, "num_open", r->num_open); + ndr_print_uint32(ndr, "time", r->time); + ndr_print_uint32(ndr, "idle_time", r->idle_time); + ndr_print_uint32(ndr, "user_flags", r->user_flags); + ndr_print_ptr(ndr, "client_type", r->client_type); + ndr->depth++; + if (r->client_type) { + ndr_print_string(ndr, "client_type", r->client_type); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr2 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr2 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr2 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetSessCtr2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetSessInfo2(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessInfo10(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo10 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo10(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo10 *r) +{ + uint32_t _ptr_client; + TALLOC_CTX *_mem_save_client_0; + uint32_t _ptr_user; + TALLOC_CTX *_mem_save_user_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); + if (_ptr_client) { + NDR_PULL_ALLOC(ndr, r->client); + } else { + r->client = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->user); + } else { + r->user = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); + if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); + } + if (r->user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); + if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessInfo10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo10 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSessInfo10"); + ndr->depth++; + ndr_print_ptr(ndr, "client", r->client); + ndr->depth++; + if (r->client) { + ndr_print_string(ndr, "client", r->client); + } + ndr->depth--; + ndr_print_ptr(ndr, "user", r->user); + ndr->depth++; + if (r->user) { + ndr_print_string(ndr, "user", r->user); + } + ndr->depth--; + ndr_print_uint32(ndr, "time", r->time); + ndr_print_uint32(ndr, "idle_time", r->idle_time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessCtr10(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr10 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo10(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo10(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr10(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr10 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo10(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo10(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessCtr10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr10 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetSessCtr10"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetSessInfo10(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessInfo502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo502 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->user_flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->transport)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->client_type) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_type, ndr_charset_length(r->client_type, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->transport) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->transport, ndr_charset_length(r->transport, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo502 *r) +{ + uint32_t _ptr_client; + TALLOC_CTX *_mem_save_client_0; + uint32_t _ptr_user; + TALLOC_CTX *_mem_save_user_0; + uint32_t _ptr_client_type; + TALLOC_CTX *_mem_save_client_type_0; + uint32_t _ptr_transport; + TALLOC_CTX *_mem_save_transport_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); + if (_ptr_client) { + NDR_PULL_ALLOC(ndr, r->client); + } else { + r->client = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->user); + } else { + r->user = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->user_flags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_type)); + if (_ptr_client_type) { + NDR_PULL_ALLOC(ndr, r->client_type); + } else { + r->client_type = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport)); + if (_ptr_transport) { + NDR_PULL_ALLOC(ndr, r->transport); + } else { + r->transport = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->client) { + _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); + if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); + } + if (r->user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); + if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + if (r->client_type) { + _mem_save_client_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->client_type, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->client_type)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->client_type)); + if (ndr_get_array_length(ndr, &r->client_type) > ndr_get_array_size(ndr, &r->client_type)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_type), ndr_get_array_length(ndr, &r->client_type)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_type, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_type_0, 0); + } + if (r->transport) { + _mem_save_transport_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->transport, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->transport)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->transport)); + if (ndr_get_array_length(ndr, &r->transport) > ndr_get_array_size(ndr, &r->transport)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->transport), ndr_get_array_length(ndr, &r->transport)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->transport), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->transport, ndr_get_array_length(ndr, &r->transport), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo502 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSessInfo502"); + ndr->depth++; + ndr_print_ptr(ndr, "client", r->client); + ndr->depth++; + if (r->client) { + ndr_print_string(ndr, "client", r->client); + } + ndr->depth--; + ndr_print_ptr(ndr, "user", r->user); + ndr->depth++; + if (r->user) { + ndr_print_string(ndr, "user", r->user); + } + ndr->depth--; + ndr_print_uint32(ndr, "num_open", r->num_open); + ndr_print_uint32(ndr, "time", r->time); + ndr_print_uint32(ndr, "idle_time", r->idle_time); + ndr_print_uint32(ndr, "user_flags", r->user_flags); + ndr_print_ptr(ndr, "client_type", r->client_type); + ndr->depth++; + if (r->client_type) { + ndr_print_string(ndr, "client_type", r->client_type); + } + ndr->depth--; + ndr_print_ptr(ndr, "transport", r->transport); + ndr->depth++; + if (r->transport) { + ndr_print_string(ndr, "transport", r->transport); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessCtr502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr502 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo502(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetSessInfo502(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr502 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo502(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetSessInfo502(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessCtr502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr502 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetSessCtr502"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetSessInfo502(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetSessCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); + break; } + + case 10: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr10)); + break; } + + case 502: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr502)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->ctr0) { + NDR_CHECK(ndr_push_srvsvc_NetSessCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + } + break; + + case 1: + if (r->ctr1) { + NDR_CHECK(ndr_push_srvsvc_NetSessCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + } + break; + + case 2: + if (r->ctr2) { + NDR_CHECK(ndr_push_srvsvc_NetSessCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + } + break; + + case 10: + if (r->ctr10) { + NDR_CHECK(ndr_push_srvsvc_NetSessCtr10(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr10)); + } + break; + + case 502: + if (r->ctr502) { + NDR_CHECK(ndr_push_srvsvc_NetSessCtr502(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr502)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetSessCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_ctr0_0; + TALLOC_CTX *_mem_save_ctr1_0; + TALLOC_CTX *_mem_save_ctr2_0; + TALLOC_CTX *_mem_save_ctr10_0; + TALLOC_CTX *_mem_save_ctr502_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_ctr0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); + if (_ptr_ctr0) { + NDR_PULL_ALLOC(ndr, r->ctr0); + } else { + r->ctr0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_ctr1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); + if (_ptr_ctr1) { + NDR_PULL_ALLOC(ndr, r->ctr1); + } else { + r->ctr1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_ctr2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); + if (_ptr_ctr2) { + NDR_PULL_ALLOC(ndr, r->ctr2); + } else { + r->ctr2 = NULL; + } + break; } + + case 10: { + uint32_t _ptr_ctr10; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr10)); + if (_ptr_ctr10) { + NDR_PULL_ALLOC(ndr, r->ctr10); + } else { + r->ctr10 = NULL; + } + break; } + + case 502: { + uint32_t _ptr_ctr502; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr502)); + if (_ptr_ctr502) { + NDR_PULL_ALLOC(ndr, r->ctr502); + } else { + r->ctr502 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->ctr0) { + _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSessCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); + } + break; + + case 1: + if (r->ctr1) { + _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSessCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); + } + break; + + case 2: + if (r->ctr2) { + _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSessCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); + } + break; + + case 10: + if (r->ctr10) { + _mem_save_ctr10_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr10, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSessCtr10(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr10)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr10_0, 0); + } + break; + + case 502: + if (r->ctr502) { + _mem_save_ctr502_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr502, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSessCtr502(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr502)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr502_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetSessCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetSessCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "ctr0", r->ctr0); + ndr->depth++; + if (r->ctr0) { + ndr_print_srvsvc_NetSessCtr0(ndr, "ctr0", r->ctr0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "ctr1", r->ctr1); + ndr->depth++; + if (r->ctr1) { + ndr_print_srvsvc_NetSessCtr1(ndr, "ctr1", r->ctr1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "ctr2", r->ctr2); + ndr->depth++; + if (r->ctr2) { + ndr_print_srvsvc_NetSessCtr2(ndr, "ctr2", r->ctr2); + } + ndr->depth--; + break; + + case 10: + ndr_print_ptr(ndr, "ctr10", r->ctr10); + ndr->depth++; + if (r->ctr10) { + ndr_print_srvsvc_NetSessCtr10(ndr, "ctr10", r->ctr10); + } + ndr->depth--; + break; + + case 502: + ndr_print_ptr(ndr, "ctr502", r->ctr502); + ndr->depth++; + if (r->ctr502) { + ndr_print_srvsvc_NetSessCtr502(ndr, "ctr502", r->ctr502); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_srvsvc_NetSessCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_srvsvc_NetSessCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_srvsvc_NetSessCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_srvsvc_NetSessCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfoCtr *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSessInfoCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_srvsvc_NetSessCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_ShareType(struct ndr_push *ndr, int ndr_flags, enum srvsvc_ShareType r) +{ + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_ShareType(struct ndr_pull *ndr, int ndr_flags, enum srvsvc_ShareType *r) +{ + uint32_t v; + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_ShareType(struct ndr_print *ndr, const char *name, enum srvsvc_ShareType r) +{ + const char *val = NULL; + + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + switch (r) { + case STYPE_DISKTREE: val = "STYPE_DISKTREE"; break; + case STYPE_DISKTREE_TEMPORARY: val = "STYPE_DISKTREE_TEMPORARY"; break; + case STYPE_DISKTREE_HIDDEN: val = "STYPE_DISKTREE_HIDDEN"; break; + case STYPE_PRINTQ: val = "STYPE_PRINTQ"; break; + case STYPE_PRINTQ_TEMPORARY: val = "STYPE_PRINTQ_TEMPORARY"; break; + case STYPE_PRINTQ_HIDDEN: val = "STYPE_PRINTQ_HIDDEN"; break; + case STYPE_DEVICE: val = "STYPE_DEVICE"; break; + case STYPE_DEVICE_TEMPORARY: val = "STYPE_DEVICE_TEMPORARY"; break; + case STYPE_DEVICE_HIDDEN: val = "STYPE_DEVICE_HIDDEN"; break; + case STYPE_IPC: val = "STYPE_IPC"; break; + case STYPE_IPC_TEMPORARY: val = "STYPE_IPC_TEMPORARY"; break; + case STYPE_IPC_HIDDEN: val = "STYPE_IPC_HIDDEN"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); + ndr->flags = _flags_save_ENUM; + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo0 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo0 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfo0"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr0 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr0 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr0 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr0"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetShareInfo0(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_srvsvc_ShareType(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_srvsvc_ShareType(ndr, "type", r->type); + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetShareInfo1(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_srvsvc_ShareType(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->permissions)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_users)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->current_users)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->password, ndr_charset_length(r->password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo2 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + uint32_t _ptr_path; + TALLOC_CTX *_mem_save_path_0; + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_password_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->permissions)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_users)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->current_users)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->path); + } else { + r->path = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->password); + } else { + r->password = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + if (r->path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); + if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + if (r->password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->password)); + if (ndr_get_array_length(ndr, &r->password) > ndr_get_array_size(ndr, &r->password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->password), ndr_get_array_length(ndr, &r->password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->password, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo2 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_srvsvc_ShareType(ndr, "type", r->type); + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_uint32(ndr, "permissions", r->permissions); + ndr_print_uint32(ndr, "max_users", r->max_users); + ndr_print_uint32(ndr, "current_users", r->current_users); + ndr_print_ptr(ndr, "path", r->path); + ndr->depth++; + if (r->path) { + ndr_print_string(ndr, "path", r->path); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->password); + ndr->depth++; + if (r->password) { + ndr_print_string(ndr, "password", r->password); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr2 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr2 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr2 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetShareInfo2(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo501(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo501 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_srvsvc_ShareType(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->csc_policy)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo501(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo501 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->csc_policy)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo501 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfo501"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_srvsvc_ShareType(ndr, "type", r->type); + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_uint32(ndr, "csc_policy", r->csc_policy); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr501(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr501 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo501(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo501(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr501(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr501 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo501(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo501(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr501 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr501"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetShareInfo501(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo502 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_srvsvc_ShareType(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->permissions)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_users)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->current_users)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sd_buf)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->password, ndr_charset_length(r->password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sd_buf)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo502 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + uint32_t _ptr_path; + TALLOC_CTX *_mem_save_path_0; + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_password_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->permissions)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_users)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->current_users)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->path); + } else { + r->path = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->password); + } else { + r->password = NULL; + } + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sd_buf)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + if (r->path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); + if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + if (r->password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->password)); + if (ndr_get_array_length(ndr, &r->password) > ndr_get_array_size(ndr, &r->password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->password), ndr_get_array_length(ndr, &r->password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->password, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sd_buf)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo502 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfo502"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_srvsvc_ShareType(ndr, "type", r->type); + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_uint32(ndr, "permissions", r->permissions); + ndr_print_uint32(ndr, "max_users", r->max_users); + ndr_print_uint32(ndr, "current_users", r->current_users); + ndr_print_ptr(ndr, "path", r->path); + ndr->depth++; + if (r->path) { + ndr_print_string(ndr, "path", r->path); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->password); + ndr->depth++; + if (r->password) { + ndr_print_string(ndr, "password", r->password); + } + ndr->depth--; + ndr_print_sec_desc_buf(ndr, "sd_buf", &r->sd_buf); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr502 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo502(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo502(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr502 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo502(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo502(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr502 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr502"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetShareInfo502(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1004(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1004 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1004(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1004 *r) +{ + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1004(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1004 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1004"); + ndr->depth++; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1004(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1004 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1004(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1004(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1004(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1004 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1004(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1004(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1004(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1004 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1004"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetShareInfo1004(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_NetShareInfo1005Flags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_NetShareInfo1005Flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_NetShareInfo1005Flags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SHARE_1005_IN_DFS", SHARE_1005_IN_DFS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SHARE_1005_DFS_ROOT", SHARE_1005_DFS_ROOT, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1005(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1005 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NetShareInfo1005Flags(ndr, NDR_SCALARS, r->dfs_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1005(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1005 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NetShareInfo1005Flags(ndr, NDR_SCALARS, &r->dfs_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1005 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1005"); + ndr->depth++; + ndr_print_NetShareInfo1005Flags(ndr, "dfs_flags", r->dfs_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1005(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1005 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1005(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1005(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1005 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1005(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1005 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1005"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetShareInfo1005(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1006(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1006 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_users)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1006(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1006 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_users)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1006(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1006 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1006"); + ndr->depth++; + ndr_print_uint32(ndr, "max_users", r->max_users); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1006(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1006 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1006(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1006(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1006 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1006(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1006(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1006 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1006"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetShareInfo1006(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1007(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1007 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->alternate_directory_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->alternate_directory_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alternate_directory_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alternate_directory_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->alternate_directory_name, ndr_charset_length(r->alternate_directory_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1007(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1007 *r) +{ + uint32_t _ptr_alternate_directory_name; + TALLOC_CTX *_mem_save_alternate_directory_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alternate_directory_name)); + if (_ptr_alternate_directory_name) { + NDR_PULL_ALLOC(ndr, r->alternate_directory_name); + } else { + r->alternate_directory_name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->alternate_directory_name) { + _mem_save_alternate_directory_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->alternate_directory_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->alternate_directory_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->alternate_directory_name)); + if (ndr_get_array_length(ndr, &r->alternate_directory_name) > ndr_get_array_size(ndr, &r->alternate_directory_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->alternate_directory_name), ndr_get_array_length(ndr, &r->alternate_directory_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->alternate_directory_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->alternate_directory_name, ndr_get_array_length(ndr, &r->alternate_directory_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alternate_directory_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1007(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1007 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1007"); + ndr->depth++; + ndr_print_uint32(ndr, "flags", r->flags); + ndr_print_ptr(ndr, "alternate_directory_name", r->alternate_directory_name); + ndr->depth++; + if (r->alternate_directory_name) { + ndr_print_string(ndr, "alternate_directory_name", r->alternate_directory_name); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1007(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1007 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1007(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1007(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1007(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1007 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1007(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1007(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1007(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1007 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1007"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetShareInfo1007(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1501(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1501 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1501(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1501 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1501 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1501"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_sec_desc_buf(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetShareInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); + break; } + + case 501: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info501)); + break; } + + case 502: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info502)); + break; } + + case 1004: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1004)); + break; } + + case 1005: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1005)); + break; } + + case 1006: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1006)); + break; } + + case 1007: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1007)); + break; } + + case 1501: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1501)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->info0) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + } + break; + + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + case 2: + if (r->info2) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + } + break; + + case 501: + if (r->info501) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo501(ndr, NDR_SCALARS|NDR_BUFFERS, r->info501)); + } + break; + + case 502: + if (r->info502) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo502(ndr, NDR_SCALARS|NDR_BUFFERS, r->info502)); + } + break; + + case 1004: + if (r->info1004) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1004)); + } + break; + + case 1005: + if (r->info1005) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1005(ndr, NDR_SCALARS, r->info1005)); + } + break; + + case 1006: + if (r->info1006) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1006(ndr, NDR_SCALARS, r->info1006)); + } + break; + + case 1007: + if (r->info1007) { + NDR_CHECK(ndr_push_srvsvc_NetShareInfo1007(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1007)); + } + break; + + case 1501: + if (r->info1501) { + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1501)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetShareInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info0_0; + TALLOC_CTX *_mem_save_info1_0; + TALLOC_CTX *_mem_save_info2_0; + TALLOC_CTX *_mem_save_info501_0; + TALLOC_CTX *_mem_save_info502_0; + TALLOC_CTX *_mem_save_info1004_0; + TALLOC_CTX *_mem_save_info1005_0; + TALLOC_CTX *_mem_save_info1006_0; + TALLOC_CTX *_mem_save_info1007_0; + TALLOC_CTX *_mem_save_info1501_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_info0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); + if (_ptr_info0) { + NDR_PULL_ALLOC(ndr, r->info0); + } else { + r->info0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_info2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_PULL_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + + case 501: { + uint32_t _ptr_info501; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info501)); + if (_ptr_info501) { + NDR_PULL_ALLOC(ndr, r->info501); + } else { + r->info501 = NULL; + } + break; } + + case 502: { + uint32_t _ptr_info502; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info502)); + if (_ptr_info502) { + NDR_PULL_ALLOC(ndr, r->info502); + } else { + r->info502 = NULL; + } + break; } + + case 1004: { + uint32_t _ptr_info1004; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1004)); + if (_ptr_info1004) { + NDR_PULL_ALLOC(ndr, r->info1004); + } else { + r->info1004 = NULL; + } + break; } + + case 1005: { + uint32_t _ptr_info1005; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1005)); + if (_ptr_info1005) { + NDR_PULL_ALLOC(ndr, r->info1005); + } else { + r->info1005 = NULL; + } + break; } + + case 1006: { + uint32_t _ptr_info1006; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1006)); + if (_ptr_info1006) { + NDR_PULL_ALLOC(ndr, r->info1006); + } else { + r->info1006 = NULL; + } + break; } + + case 1007: { + uint32_t _ptr_info1007; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1007)); + if (_ptr_info1007) { + NDR_PULL_ALLOC(ndr, r->info1007); + } else { + r->info1007 = NULL; + } + break; } + + case 1501: { + uint32_t _ptr_info1501; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1501)); + if (_ptr_info1501) { + NDR_PULL_ALLOC(ndr, r->info1501); + } else { + r->info1501 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->info0) { + _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); + } + break; + + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + case 2: + if (r->info2) { + _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); + } + break; + + case 501: + if (r->info501) { + _mem_save_info501_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info501, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo501(ndr, NDR_SCALARS|NDR_BUFFERS, r->info501)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info501_0, 0); + } + break; + + case 502: + if (r->info502) { + _mem_save_info502_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info502, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo502(ndr, NDR_SCALARS|NDR_BUFFERS, r->info502)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info502_0, 0); + } + break; + + case 1004: + if (r->info1004) { + _mem_save_info1004_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1004, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1004)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1004_0, 0); + } + break; + + case 1005: + if (r->info1005) { + _mem_save_info1005_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1005, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1005(ndr, NDR_SCALARS, r->info1005)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1005_0, 0); + } + break; + + case 1006: + if (r->info1006) { + _mem_save_info1006_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1006, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1006(ndr, NDR_SCALARS, r->info1006)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1006_0, 0); + } + break; + + case 1007: + if (r->info1007) { + _mem_save_info1007_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1007, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1007(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1007)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1007_0, 0); + } + break; + + case 1501: + if (r->info1501) { + _mem_save_info1501_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1501, 0); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1501)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1501_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetShareInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetShareInfo"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "info0", r->info0); + ndr->depth++; + if (r->info0) { + ndr_print_srvsvc_NetShareInfo0(ndr, "info0", r->info0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_srvsvc_NetShareInfo1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_srvsvc_NetShareInfo2(ndr, "info2", r->info2); + } + ndr->depth--; + break; + + case 501: + ndr_print_ptr(ndr, "info501", r->info501); + ndr->depth++; + if (r->info501) { + ndr_print_srvsvc_NetShareInfo501(ndr, "info501", r->info501); + } + ndr->depth--; + break; + + case 502: + ndr_print_ptr(ndr, "info502", r->info502); + ndr->depth++; + if (r->info502) { + ndr_print_srvsvc_NetShareInfo502(ndr, "info502", r->info502); + } + ndr->depth--; + break; + + case 1004: + ndr_print_ptr(ndr, "info1004", r->info1004); + ndr->depth++; + if (r->info1004) { + ndr_print_srvsvc_NetShareInfo1004(ndr, "info1004", r->info1004); + } + ndr->depth--; + break; + + case 1005: + ndr_print_ptr(ndr, "info1005", r->info1005); + ndr->depth++; + if (r->info1005) { + ndr_print_srvsvc_NetShareInfo1005(ndr, "info1005", r->info1005); + } + ndr->depth--; + break; + + case 1006: + ndr_print_ptr(ndr, "info1006", r->info1006); + ndr->depth++; + if (r->info1006) { + ndr_print_srvsvc_NetShareInfo1006(ndr, "info1006", r->info1006); + } + ndr->depth--; + break; + + case 1007: + ndr_print_ptr(ndr, "info1007", r->info1007); + ndr->depth++; + if (r->info1007) { + ndr_print_srvsvc_NetShareInfo1007(ndr, "info1007", r->info1007); + } + ndr->depth--; + break; + + case 1501: + ndr_print_ptr(ndr, "info1501", r->info1501); + ndr->depth++; + if (r->info1501) { + ndr_print_sec_desc_buf(ndr, "info1501", r->info1501); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetShareCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); + break; } + + case 501: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr501)); + break; } + + case 502: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr502)); + break; } + + case 1004: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1004)); + break; } + + case 1005: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1005)); + break; } + + case 1006: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1006)); + break; } + + case 1007: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1007)); + break; } + + case 1501: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1501)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->ctr0) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + } + break; + + case 1: + if (r->ctr1) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + } + break; + + case 2: + if (r->ctr2) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + } + break; + + case 501: + if (r->ctr501) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr501(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr501)); + } + break; + + case 502: + if (r->ctr502) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr502(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr502)); + } + break; + + case 1004: + if (r->ctr1004) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1004)); + } + break; + + case 1005: + if (r->ctr1005) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr1005(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1005)); + } + break; + + case 1006: + if (r->ctr1006) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr1006(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1006)); + } + break; + + case 1007: + if (r->ctr1007) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr1007(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1007)); + } + break; + + case 1501: + if (r->ctr1501) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr1501(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1501)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetShareCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_ctr0_0; + TALLOC_CTX *_mem_save_ctr1_0; + TALLOC_CTX *_mem_save_ctr2_0; + TALLOC_CTX *_mem_save_ctr501_0; + TALLOC_CTX *_mem_save_ctr502_0; + TALLOC_CTX *_mem_save_ctr1004_0; + TALLOC_CTX *_mem_save_ctr1005_0; + TALLOC_CTX *_mem_save_ctr1006_0; + TALLOC_CTX *_mem_save_ctr1007_0; + TALLOC_CTX *_mem_save_ctr1501_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_ctr0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); + if (_ptr_ctr0) { + NDR_PULL_ALLOC(ndr, r->ctr0); + } else { + r->ctr0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_ctr1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); + if (_ptr_ctr1) { + NDR_PULL_ALLOC(ndr, r->ctr1); + } else { + r->ctr1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_ctr2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); + if (_ptr_ctr2) { + NDR_PULL_ALLOC(ndr, r->ctr2); + } else { + r->ctr2 = NULL; + } + break; } + + case 501: { + uint32_t _ptr_ctr501; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr501)); + if (_ptr_ctr501) { + NDR_PULL_ALLOC(ndr, r->ctr501); + } else { + r->ctr501 = NULL; + } + break; } + + case 502: { + uint32_t _ptr_ctr502; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr502)); + if (_ptr_ctr502) { + NDR_PULL_ALLOC(ndr, r->ctr502); + } else { + r->ctr502 = NULL; + } + break; } + + case 1004: { + uint32_t _ptr_ctr1004; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1004)); + if (_ptr_ctr1004) { + NDR_PULL_ALLOC(ndr, r->ctr1004); + } else { + r->ctr1004 = NULL; + } + break; } + + case 1005: { + uint32_t _ptr_ctr1005; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1005)); + if (_ptr_ctr1005) { + NDR_PULL_ALLOC(ndr, r->ctr1005); + } else { + r->ctr1005 = NULL; + } + break; } + + case 1006: { + uint32_t _ptr_ctr1006; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1006)); + if (_ptr_ctr1006) { + NDR_PULL_ALLOC(ndr, r->ctr1006); + } else { + r->ctr1006 = NULL; + } + break; } + + case 1007: { + uint32_t _ptr_ctr1007; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1007)); + if (_ptr_ctr1007) { + NDR_PULL_ALLOC(ndr, r->ctr1007); + } else { + r->ctr1007 = NULL; + } + break; } + + case 1501: { + uint32_t _ptr_ctr1501; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1501)); + if (_ptr_ctr1501) { + NDR_PULL_ALLOC(ndr, r->ctr1501); + } else { + r->ctr1501 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->ctr0) { + _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); + } + break; + + case 1: + if (r->ctr1) { + _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); + } + break; + + case 2: + if (r->ctr2) { + _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); + } + break; + + case 501: + if (r->ctr501) { + _mem_save_ctr501_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr501, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr501(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr501)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr501_0, 0); + } + break; + + case 502: + if (r->ctr502) { + _mem_save_ctr502_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr502, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr502(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr502)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr502_0, 0); + } + break; + + case 1004: + if (r->ctr1004) { + _mem_save_ctr1004_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1004, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1004)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1004_0, 0); + } + break; + + case 1005: + if (r->ctr1005) { + _mem_save_ctr1005_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1005, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1005(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1005)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1005_0, 0); + } + break; + + case 1006: + if (r->ctr1006) { + _mem_save_ctr1006_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1006, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1006(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1006)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1006_0, 0); + } + break; + + case 1007: + if (r->ctr1007) { + _mem_save_ctr1007_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1007, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1007(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1007)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1007_0, 0); + } + break; + + case 1501: + if (r->ctr1501) { + _mem_save_ctr1501_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1501, 0); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1501(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1501)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1501_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetShareCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetShareCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "ctr0", r->ctr0); + ndr->depth++; + if (r->ctr0) { + ndr_print_srvsvc_NetShareCtr0(ndr, "ctr0", r->ctr0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "ctr1", r->ctr1); + ndr->depth++; + if (r->ctr1) { + ndr_print_srvsvc_NetShareCtr1(ndr, "ctr1", r->ctr1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "ctr2", r->ctr2); + ndr->depth++; + if (r->ctr2) { + ndr_print_srvsvc_NetShareCtr2(ndr, "ctr2", r->ctr2); + } + ndr->depth--; + break; + + case 501: + ndr_print_ptr(ndr, "ctr501", r->ctr501); + ndr->depth++; + if (r->ctr501) { + ndr_print_srvsvc_NetShareCtr501(ndr, "ctr501", r->ctr501); + } + ndr->depth--; + break; + + case 502: + ndr_print_ptr(ndr, "ctr502", r->ctr502); + ndr->depth++; + if (r->ctr502) { + ndr_print_srvsvc_NetShareCtr502(ndr, "ctr502", r->ctr502); + } + ndr->depth--; + break; + + case 1004: + ndr_print_ptr(ndr, "ctr1004", r->ctr1004); + ndr->depth++; + if (r->ctr1004) { + ndr_print_srvsvc_NetShareCtr1004(ndr, "ctr1004", r->ctr1004); + } + ndr->depth--; + break; + + case 1005: + ndr_print_ptr(ndr, "ctr1005", r->ctr1005); + ndr->depth++; + if (r->ctr1005) { + ndr_print_srvsvc_NetShareCtr1005(ndr, "ctr1005", r->ctr1005); + } + ndr->depth--; + break; + + case 1006: + ndr_print_ptr(ndr, "ctr1006", r->ctr1006); + ndr->depth++; + if (r->ctr1006) { + ndr_print_srvsvc_NetShareCtr1006(ndr, "ctr1006", r->ctr1006); + } + ndr->depth--; + break; + + case 1007: + ndr_print_ptr(ndr, "ctr1007", r->ctr1007); + ndr->depth++; + if (r->ctr1007) { + ndr_print_srvsvc_NetShareCtr1007(ndr, "ctr1007", r->ctr1007); + } + ndr->depth--; + break; + + case 1501: + ndr_print_ptr(ndr, "ctr1501", r->ctr1501); + ndr->depth++; + if (r->ctr1501) { + ndr_print_srvsvc_NetShareCtr1501(ndr, "ctr1501", r->ctr1501); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_srvsvc_NetShareCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfoCtr *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareInfoCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_srvsvc_NetShareCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_srvsvc_PlatformId(struct ndr_push *ndr, int ndr_flags, enum srvsvc_PlatformId r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_srvsvc_PlatformId(struct ndr_pull *ndr, int ndr_flags, enum srvsvc_PlatformId *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_PlatformId(struct ndr_print *ndr, const char *name, enum srvsvc_PlatformId r) +{ + const char *val = NULL; + + switch (r) { + case PLATFORM_ID_DOS: val = "PLATFORM_ID_DOS"; break; + case PLATFORM_ID_OS2: val = "PLATFORM_ID_OS2"; break; + case PLATFORM_ID_NT: val = "PLATFORM_ID_NT"; break; + case PLATFORM_ID_OSF: val = "PLATFORM_ID_OSF"; break; + case PLATFORM_ID_VMS: val = "PLATFORM_ID_VMS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_srvsvc_NetSrvInfo100(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo100 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo100(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo100 *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + } else { + r->server_name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); + if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo100(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo100 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo100"); + ndr->depth++; + ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_srvsvc_NetSrvInfo101(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo101 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); + NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->server_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo101(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo101 *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + } else { + r->server_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); + NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->server_type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); + if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo101(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo101 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo101"); + ndr->depth++; + ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "version_major", r->version_major); + ndr_print_uint32(ndr, "version_minor", r->version_minor); + ndr_print_svcctl_ServerType(ndr, "server_type", r->server_type); + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo102(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo102 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); + NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->server_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->users)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->disc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->hidden)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->announce)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->anndelta)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->licenses)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->userpath)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->userpath) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->userpath, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->userpath, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->userpath, ndr_charset_length(r->userpath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo102(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo102 *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + uint32_t _ptr_userpath; + TALLOC_CTX *_mem_save_userpath_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + } else { + r->server_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); + NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->server_type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->users)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->disc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->hidden)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->announce)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->anndelta)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->licenses)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_userpath)); + if (_ptr_userpath) { + NDR_PULL_ALLOC(ndr, r->userpath); + } else { + r->userpath = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); + if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + if (r->userpath) { + _mem_save_userpath_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->userpath, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->userpath)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->userpath)); + if (ndr_get_array_length(ndr, &r->userpath) > ndr_get_array_size(ndr, &r->userpath)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->userpath), ndr_get_array_length(ndr, &r->userpath)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->userpath), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->userpath, ndr_get_array_length(ndr, &r->userpath), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_userpath_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo102(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo102 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo102"); + ndr->depth++; + ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "version_major", r->version_major); + ndr_print_uint32(ndr, "version_minor", r->version_minor); + ndr_print_svcctl_ServerType(ndr, "server_type", r->server_type); + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr_print_uint32(ndr, "users", r->users); + ndr_print_uint32(ndr, "disc", r->disc); + ndr_print_uint32(ndr, "hidden", r->hidden); + ndr_print_uint32(ndr, "announce", r->announce); + ndr_print_uint32(ndr, "anndelta", r->anndelta); + ndr_print_uint32(ndr, "licenses", r->licenses); + ndr_print_ptr(ndr, "userpath", r->userpath); + ndr->depth++; + if (r->userpath) { + ndr_print_string(ndr, "userpath", r->userpath); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo402(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo402 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ulist_mtime)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->glist_mtime)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alist_mtime)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->alerts)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->security)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numadmin)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lanmask)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->guestaccount)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevqs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevjobs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->connections)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->shares)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->openfiles)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessreqs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->activelocks)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numreqbufs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numbigbufs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numfiletasks)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alertsched)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->erroralert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logonalert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->accessalert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->diskalert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->netioalert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxaudits)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->srvheuristics)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->alerts) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alerts, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alerts, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->alerts, ndr_charset_length(r->alerts, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->guestaccount) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guestaccount, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guestaccount, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->guestaccount, ndr_charset_length(r->guestaccount, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->srvheuristics) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->srvheuristics, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->srvheuristics, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->srvheuristics, ndr_charset_length(r->srvheuristics, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo402(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo402 *r) +{ + uint32_t _ptr_alerts; + TALLOC_CTX *_mem_save_alerts_0; + uint32_t _ptr_guestaccount; + TALLOC_CTX *_mem_save_guestaccount_0; + uint32_t _ptr_srvheuristics; + TALLOC_CTX *_mem_save_srvheuristics_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ulist_mtime)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->glist_mtime)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alist_mtime)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alerts)); + if (_ptr_alerts) { + NDR_PULL_ALLOC(ndr, r->alerts); + } else { + r->alerts = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->security)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numadmin)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lanmask)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_guestaccount)); + if (_ptr_guestaccount) { + NDR_PULL_ALLOC(ndr, r->guestaccount); + } else { + r->guestaccount = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevqs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevjobs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->connections)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->shares)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->openfiles)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessreqs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->activelocks)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numreqbufs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numbigbufs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numfiletasks)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alertsched)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->erroralert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logonalert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->accessalert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->diskalert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->netioalert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxaudits)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_srvheuristics)); + if (_ptr_srvheuristics) { + NDR_PULL_ALLOC(ndr, r->srvheuristics); + } else { + r->srvheuristics = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->alerts) { + _mem_save_alerts_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->alerts, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->alerts)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->alerts)); + if (ndr_get_array_length(ndr, &r->alerts) > ndr_get_array_size(ndr, &r->alerts)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->alerts), ndr_get_array_length(ndr, &r->alerts)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->alerts), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->alerts, ndr_get_array_length(ndr, &r->alerts), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alerts_0, 0); + } + if (r->guestaccount) { + _mem_save_guestaccount_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->guestaccount, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->guestaccount)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->guestaccount)); + if (ndr_get_array_length(ndr, &r->guestaccount) > ndr_get_array_size(ndr, &r->guestaccount)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->guestaccount), ndr_get_array_length(ndr, &r->guestaccount)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->guestaccount), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->guestaccount, ndr_get_array_length(ndr, &r->guestaccount), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_guestaccount_0, 0); + } + if (r->srvheuristics) { + _mem_save_srvheuristics_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->srvheuristics, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->srvheuristics)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->srvheuristics)); + if (ndr_get_array_length(ndr, &r->srvheuristics) > ndr_get_array_size(ndr, &r->srvheuristics)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->srvheuristics), ndr_get_array_length(ndr, &r->srvheuristics)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->srvheuristics), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->srvheuristics, ndr_get_array_length(ndr, &r->srvheuristics), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_srvheuristics_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo402(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo402 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo402"); + ndr->depth++; + ndr_print_uint32(ndr, "ulist_mtime", r->ulist_mtime); + ndr_print_uint32(ndr, "glist_mtime", r->glist_mtime); + ndr_print_uint32(ndr, "alist_mtime", r->alist_mtime); + ndr_print_ptr(ndr, "alerts", r->alerts); + ndr->depth++; + if (r->alerts) { + ndr_print_string(ndr, "alerts", r->alerts); + } + ndr->depth--; + ndr_print_uint32(ndr, "security", r->security); + ndr_print_uint32(ndr, "numadmin", r->numadmin); + ndr_print_uint32(ndr, "lanmask", r->lanmask); + ndr_print_ptr(ndr, "guestaccount", r->guestaccount); + ndr->depth++; + if (r->guestaccount) { + ndr_print_string(ndr, "guestaccount", r->guestaccount); + } + ndr->depth--; + ndr_print_uint32(ndr, "chdevs", r->chdevs); + ndr_print_uint32(ndr, "chdevqs", r->chdevqs); + ndr_print_uint32(ndr, "chdevjobs", r->chdevjobs); + ndr_print_uint32(ndr, "connections", r->connections); + ndr_print_uint32(ndr, "shares", r->shares); + ndr_print_uint32(ndr, "openfiles", r->openfiles); + ndr_print_uint32(ndr, "sessopen", r->sessopen); + ndr_print_uint32(ndr, "sesssvc", r->sesssvc); + ndr_print_uint32(ndr, "sessreqs", r->sessreqs); + ndr_print_uint32(ndr, "opensearch", r->opensearch); + ndr_print_uint32(ndr, "activelocks", r->activelocks); + ndr_print_uint32(ndr, "numreqbufs", r->numreqbufs); + ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); + ndr_print_uint32(ndr, "numbigbufs", r->numbigbufs); + ndr_print_uint32(ndr, "numfiletasks", r->numfiletasks); + ndr_print_uint32(ndr, "alertsched", r->alertsched); + ndr_print_uint32(ndr, "erroralert", r->erroralert); + ndr_print_uint32(ndr, "logonalert", r->logonalert); + ndr_print_uint32(ndr, "accessalert", r->accessalert); + ndr_print_uint32(ndr, "diskalert", r->diskalert); + ndr_print_uint32(ndr, "netioalert", r->netioalert); + ndr_print_uint32(ndr, "maxaudits", r->maxaudits); + ndr_print_ptr(ndr, "srvheuristics", r->srvheuristics); + ndr->depth++; + if (r->srvheuristics) { + ndr_print_string(ndr, "srvheuristics", r->srvheuristics); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo403(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo403 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ulist_mtime)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->glist_mtime)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alist_mtime)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->alerts)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->security)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numadmin)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lanmask)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->guestaccount)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevqs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevjobs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->connections)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->shares)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->openfiles)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessreqs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->activelocks)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numreqbufs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numbigbufs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numfiletasks)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alertsched)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->erroralert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logonalert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->accessalert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->diskalert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->netioalert)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxaudits)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->srvheuristics)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auditedevents)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auditprofile)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->autopath)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->alerts) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alerts, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alerts, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->alerts, ndr_charset_length(r->alerts, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->guestaccount) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guestaccount, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guestaccount, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->guestaccount, ndr_charset_length(r->guestaccount, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->srvheuristics) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->srvheuristics, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->srvheuristics, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->srvheuristics, ndr_charset_length(r->srvheuristics, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->autopath) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->autopath, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->autopath, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->autopath, ndr_charset_length(r->autopath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo403(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo403 *r) +{ + uint32_t _ptr_alerts; + TALLOC_CTX *_mem_save_alerts_0; + uint32_t _ptr_guestaccount; + TALLOC_CTX *_mem_save_guestaccount_0; + uint32_t _ptr_srvheuristics; + TALLOC_CTX *_mem_save_srvheuristics_0; + uint32_t _ptr_autopath; + TALLOC_CTX *_mem_save_autopath_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ulist_mtime)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->glist_mtime)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alist_mtime)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alerts)); + if (_ptr_alerts) { + NDR_PULL_ALLOC(ndr, r->alerts); + } else { + r->alerts = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->security)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numadmin)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lanmask)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_guestaccount)); + if (_ptr_guestaccount) { + NDR_PULL_ALLOC(ndr, r->guestaccount); + } else { + r->guestaccount = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevqs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevjobs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->connections)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->shares)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->openfiles)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessreqs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->activelocks)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numreqbufs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numbigbufs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numfiletasks)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alertsched)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->erroralert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logonalert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->accessalert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->diskalert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->netioalert)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxaudits)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_srvheuristics)); + if (_ptr_srvheuristics) { + NDR_PULL_ALLOC(ndr, r->srvheuristics); + } else { + r->srvheuristics = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auditedevents)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auditprofile)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_autopath)); + if (_ptr_autopath) { + NDR_PULL_ALLOC(ndr, r->autopath); + } else { + r->autopath = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->alerts) { + _mem_save_alerts_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->alerts, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->alerts)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->alerts)); + if (ndr_get_array_length(ndr, &r->alerts) > ndr_get_array_size(ndr, &r->alerts)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->alerts), ndr_get_array_length(ndr, &r->alerts)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->alerts), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->alerts, ndr_get_array_length(ndr, &r->alerts), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alerts_0, 0); + } + if (r->guestaccount) { + _mem_save_guestaccount_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->guestaccount, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->guestaccount)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->guestaccount)); + if (ndr_get_array_length(ndr, &r->guestaccount) > ndr_get_array_size(ndr, &r->guestaccount)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->guestaccount), ndr_get_array_length(ndr, &r->guestaccount)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->guestaccount), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->guestaccount, ndr_get_array_length(ndr, &r->guestaccount), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_guestaccount_0, 0); + } + if (r->srvheuristics) { + _mem_save_srvheuristics_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->srvheuristics, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->srvheuristics)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->srvheuristics)); + if (ndr_get_array_length(ndr, &r->srvheuristics) > ndr_get_array_size(ndr, &r->srvheuristics)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->srvheuristics), ndr_get_array_length(ndr, &r->srvheuristics)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->srvheuristics), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->srvheuristics, ndr_get_array_length(ndr, &r->srvheuristics), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_srvheuristics_0, 0); + } + if (r->autopath) { + _mem_save_autopath_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->autopath, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->autopath)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->autopath)); + if (ndr_get_array_length(ndr, &r->autopath) > ndr_get_array_size(ndr, &r->autopath)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->autopath), ndr_get_array_length(ndr, &r->autopath)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->autopath), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->autopath, ndr_get_array_length(ndr, &r->autopath), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_autopath_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo403(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo403 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo403"); + ndr->depth++; + ndr_print_uint32(ndr, "ulist_mtime", r->ulist_mtime); + ndr_print_uint32(ndr, "glist_mtime", r->glist_mtime); + ndr_print_uint32(ndr, "alist_mtime", r->alist_mtime); + ndr_print_ptr(ndr, "alerts", r->alerts); + ndr->depth++; + if (r->alerts) { + ndr_print_string(ndr, "alerts", r->alerts); + } + ndr->depth--; + ndr_print_uint32(ndr, "security", r->security); + ndr_print_uint32(ndr, "numadmin", r->numadmin); + ndr_print_uint32(ndr, "lanmask", r->lanmask); + ndr_print_ptr(ndr, "guestaccount", r->guestaccount); + ndr->depth++; + if (r->guestaccount) { + ndr_print_string(ndr, "guestaccount", r->guestaccount); + } + ndr->depth--; + ndr_print_uint32(ndr, "chdevs", r->chdevs); + ndr_print_uint32(ndr, "chdevqs", r->chdevqs); + ndr_print_uint32(ndr, "chdevjobs", r->chdevjobs); + ndr_print_uint32(ndr, "connections", r->connections); + ndr_print_uint32(ndr, "shares", r->shares); + ndr_print_uint32(ndr, "openfiles", r->openfiles); + ndr_print_uint32(ndr, "sessopen", r->sessopen); + ndr_print_uint32(ndr, "sesssvc", r->sesssvc); + ndr_print_uint32(ndr, "sessreqs", r->sessreqs); + ndr_print_uint32(ndr, "opensearch", r->opensearch); + ndr_print_uint32(ndr, "activelocks", r->activelocks); + ndr_print_uint32(ndr, "numreqbufs", r->numreqbufs); + ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); + ndr_print_uint32(ndr, "numbigbufs", r->numbigbufs); + ndr_print_uint32(ndr, "numfiletasks", r->numfiletasks); + ndr_print_uint32(ndr, "alertsched", r->alertsched); + ndr_print_uint32(ndr, "erroralert", r->erroralert); + ndr_print_uint32(ndr, "logonalert", r->logonalert); + ndr_print_uint32(ndr, "accessalert", r->accessalert); + ndr_print_uint32(ndr, "diskalert", r->diskalert); + ndr_print_uint32(ndr, "netioalert", r->netioalert); + ndr_print_uint32(ndr, "maxaudits", r->maxaudits); + ndr_print_ptr(ndr, "srvheuristics", r->srvheuristics); + ndr->depth++; + if (r->srvheuristics) { + ndr_print_string(ndr, "srvheuristics", r->srvheuristics); + } + ndr->depth--; + ndr_print_uint32(ndr, "auditedevents", r->auditedevents); + ndr_print_uint32(ndr, "auditprofile", r->auditprofile); + ndr_print_ptr(ndr, "autopath", r->autopath); + ndr->depth++; + if (r->autopath) { + ndr_print_string(ndr, "autopath", r->autopath); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo502 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rawworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->irpstacksize)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxrawbuflen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessusers)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessconns)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxpagedmemoryusage)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxnonpagedmemoryusage)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesoftcompat)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableforcedlogoff)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timesource)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->acceptdownlevelapis)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lmannounce)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo502 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rawworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->irpstacksize)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxrawbuflen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessusers)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessconns)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxpagedmemoryusage)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxnonpagedmemoryusage)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesoftcompat)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableforcedlogoff)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timesource)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->acceptdownlevelapis)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lmannounce)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo502 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo502"); + ndr->depth++; + ndr_print_uint32(ndr, "sessopen", r->sessopen); + ndr_print_uint32(ndr, "sesssvc", r->sesssvc); + ndr_print_uint32(ndr, "opensearch", r->opensearch); + ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); + ndr_print_uint32(ndr, "initworkitems", r->initworkitems); + ndr_print_uint32(ndr, "maxworkitems", r->maxworkitems); + ndr_print_uint32(ndr, "rawworkitems", r->rawworkitems); + ndr_print_uint32(ndr, "irpstacksize", r->irpstacksize); + ndr_print_uint32(ndr, "maxrawbuflen", r->maxrawbuflen); + ndr_print_uint32(ndr, "sessusers", r->sessusers); + ndr_print_uint32(ndr, "sessconns", r->sessconns); + ndr_print_uint32(ndr, "maxpagedmemoryusage", r->maxpagedmemoryusage); + ndr_print_uint32(ndr, "maxnonpagedmemoryusage", r->maxnonpagedmemoryusage); + ndr_print_uint32(ndr, "enablesoftcompat", r->enablesoftcompat); + ndr_print_uint32(ndr, "enableforcedlogoff", r->enableforcedlogoff); + ndr_print_uint32(ndr, "timesource", r->timesource); + ndr_print_uint32(ndr, "acceptdownlevelapis", r->acceptdownlevelapis); + ndr_print_uint32(ndr, "lmannounce", r->lmannounce); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo503(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo503 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rawworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->irpstacksize)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxrawbuflen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessusers)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessconns)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxpagedmemoryusage)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxnonpagedmemoryusage)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesoftcompat)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableforcedlogoff)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timesource)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->acceptdownlevelapis)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lmannounce)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopyreadlen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopywritelen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepsearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepsearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepcomplsearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepcomplsearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->threadcountadd)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numlockthreads)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavtimeout)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minrcvqueue)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->xactmemsize)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->threadpriority)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxmpxct)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakwait)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakresponsewait)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplocks)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplockforceclose)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablefcbopens)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableraw)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesharednetdrives)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeconnections)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxfreeconnections)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo503(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo503 *r) +{ + uint32_t _ptr_domain; + TALLOC_CTX *_mem_save_domain_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rawworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->irpstacksize)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxrawbuflen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessusers)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessconns)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxpagedmemoryusage)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxnonpagedmemoryusage)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesoftcompat)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableforcedlogoff)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timesource)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->acceptdownlevelapis)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lmannounce)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopyreadlen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopywritelen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepsearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepsearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepcomplsearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepcomplsearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->threadcountadd)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numlockthreads)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavtimeout)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minrcvqueue)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->xactmemsize)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->threadpriority)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxmpxct)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakwait)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakresponsewait)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplocks)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplockforceclose)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablefcbopens)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableraw)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesharednetdrives)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeconnections)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxfreeconnections)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo503(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo503 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo503"); + ndr->depth++; + ndr_print_uint32(ndr, "sessopen", r->sessopen); + ndr_print_uint32(ndr, "sesssvc", r->sesssvc); + ndr_print_uint32(ndr, "opensearch", r->opensearch); + ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); + ndr_print_uint32(ndr, "initworkitems", r->initworkitems); + ndr_print_uint32(ndr, "maxworkitems", r->maxworkitems); + ndr_print_uint32(ndr, "rawworkitems", r->rawworkitems); + ndr_print_uint32(ndr, "irpstacksize", r->irpstacksize); + ndr_print_uint32(ndr, "maxrawbuflen", r->maxrawbuflen); + ndr_print_uint32(ndr, "sessusers", r->sessusers); + ndr_print_uint32(ndr, "sessconns", r->sessconns); + ndr_print_uint32(ndr, "maxpagedmemoryusage", r->maxpagedmemoryusage); + ndr_print_uint32(ndr, "maxnonpagedmemoryusage", r->maxnonpagedmemoryusage); + ndr_print_uint32(ndr, "enablesoftcompat", r->enablesoftcompat); + ndr_print_uint32(ndr, "enableforcedlogoff", r->enableforcedlogoff); + ndr_print_uint32(ndr, "timesource", r->timesource); + ndr_print_uint32(ndr, "acceptdownlevelapis", r->acceptdownlevelapis); + ndr_print_uint32(ndr, "lmannounce", r->lmannounce); + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + ndr_print_uint32(ndr, "maxcopyreadlen", r->maxcopyreadlen); + ndr_print_uint32(ndr, "maxcopywritelen", r->maxcopywritelen); + ndr_print_uint32(ndr, "minkeepsearch", r->minkeepsearch); + ndr_print_uint32(ndr, "maxkeepsearch", r->maxkeepsearch); + ndr_print_uint32(ndr, "minkeepcomplsearch", r->minkeepcomplsearch); + ndr_print_uint32(ndr, "maxkeepcomplsearch", r->maxkeepcomplsearch); + ndr_print_uint32(ndr, "threadcountadd", r->threadcountadd); + ndr_print_uint32(ndr, "numlockthreads", r->numlockthreads); + ndr_print_uint32(ndr, "scavtimeout", r->scavtimeout); + ndr_print_uint32(ndr, "minrcvqueue", r->minrcvqueue); + ndr_print_uint32(ndr, "minfreeworkitems", r->minfreeworkitems); + ndr_print_uint32(ndr, "xactmemsize", r->xactmemsize); + ndr_print_uint32(ndr, "threadpriority", r->threadpriority); + ndr_print_uint32(ndr, "maxmpxct", r->maxmpxct); + ndr_print_uint32(ndr, "oplockbreakwait", r->oplockbreakwait); + ndr_print_uint32(ndr, "oplockbreakresponsewait", r->oplockbreakresponsewait); + ndr_print_uint32(ndr, "enableoplocks", r->enableoplocks); + ndr_print_uint32(ndr, "enableoplockforceclose", r->enableoplockforceclose); + ndr_print_uint32(ndr, "enablefcbopens", r->enablefcbopens); + ndr_print_uint32(ndr, "enableraw", r->enableraw); + ndr_print_uint32(ndr, "enablesharednetdrives", r->enablesharednetdrives); + ndr_print_uint32(ndr, "minfreeconnections", r->minfreeconnections); + ndr_print_uint32(ndr, "maxfreeconnections", r->maxfreeconnections); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo599(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo599 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rawworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->irpstacksize)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxrawbuflen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessusers)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessconns)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxpagedmemoryusage)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxnonpagedmemoryusage)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesoftcompat)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableforcedlogoff)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timesource)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->acceptdownlevelapis)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lmannounce)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopyreadlen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopywritelen)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepsearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepcomplsearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepcomplsearch)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->threadcountadd)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numlockthreads)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavtimeout)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minrcvqueue)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeworkitems)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->xactmemsize)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->threadpriority)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxmpxct)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakwait)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakresponsewait)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplocks)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplockforceclose)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablefcbopens)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableraw)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesharednetdrives)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeconnections)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxfreeconnections)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initsesstable)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initconntable)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initfiletable)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initsearchtable)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alertsched)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->errortreshold)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->networkerrortreshold)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->diskspacetreshold)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlinkdelay)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minlinkthroughput)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linkinfovalidtime)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavqosinfoupdatetime)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitemidletime)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo599(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo599 *r) +{ + uint32_t _ptr_domain; + TALLOC_CTX *_mem_save_domain_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rawworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->irpstacksize)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxrawbuflen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessusers)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessconns)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxpagedmemoryusage)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxnonpagedmemoryusage)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesoftcompat)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableforcedlogoff)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timesource)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->acceptdownlevelapis)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lmannounce)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopyreadlen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopywritelen)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepsearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepcomplsearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepcomplsearch)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->threadcountadd)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numlockthreads)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavtimeout)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minrcvqueue)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeworkitems)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->xactmemsize)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->threadpriority)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxmpxct)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakwait)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakresponsewait)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplocks)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplockforceclose)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablefcbopens)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableraw)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesharednetdrives)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeconnections)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxfreeconnections)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initsesstable)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initconntable)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initfiletable)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initsearchtable)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alertsched)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->errortreshold)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->networkerrortreshold)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->diskspacetreshold)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlinkdelay)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minlinkthroughput)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->linkinfovalidtime)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavqosinfoupdatetime)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitemidletime)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo599(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo599 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo599"); + ndr->depth++; + ndr_print_uint32(ndr, "sessopen", r->sessopen); + ndr_print_uint32(ndr, "sesssvc", r->sesssvc); + ndr_print_uint32(ndr, "opensearch", r->opensearch); + ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); + ndr_print_uint32(ndr, "initworkitems", r->initworkitems); + ndr_print_uint32(ndr, "maxworkitems", r->maxworkitems); + ndr_print_uint32(ndr, "rawworkitems", r->rawworkitems); + ndr_print_uint32(ndr, "irpstacksize", r->irpstacksize); + ndr_print_uint32(ndr, "maxrawbuflen", r->maxrawbuflen); + ndr_print_uint32(ndr, "sessusers", r->sessusers); + ndr_print_uint32(ndr, "sessconns", r->sessconns); + ndr_print_uint32(ndr, "maxpagedmemoryusage", r->maxpagedmemoryusage); + ndr_print_uint32(ndr, "maxnonpagedmemoryusage", r->maxnonpagedmemoryusage); + ndr_print_uint32(ndr, "enablesoftcompat", r->enablesoftcompat); + ndr_print_uint32(ndr, "enableforcedlogoff", r->enableforcedlogoff); + ndr_print_uint32(ndr, "timesource", r->timesource); + ndr_print_uint32(ndr, "acceptdownlevelapis", r->acceptdownlevelapis); + ndr_print_uint32(ndr, "lmannounce", r->lmannounce); + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + ndr_print_uint32(ndr, "maxcopyreadlen", r->maxcopyreadlen); + ndr_print_uint32(ndr, "maxcopywritelen", r->maxcopywritelen); + ndr_print_uint32(ndr, "minkeepsearch", r->minkeepsearch); + ndr_print_uint32(ndr, "minkeepcomplsearch", r->minkeepcomplsearch); + ndr_print_uint32(ndr, "maxkeepcomplsearch", r->maxkeepcomplsearch); + ndr_print_uint32(ndr, "threadcountadd", r->threadcountadd); + ndr_print_uint32(ndr, "numlockthreads", r->numlockthreads); + ndr_print_uint32(ndr, "scavtimeout", r->scavtimeout); + ndr_print_uint32(ndr, "minrcvqueue", r->minrcvqueue); + ndr_print_uint32(ndr, "minfreeworkitems", r->minfreeworkitems); + ndr_print_uint32(ndr, "xactmemsize", r->xactmemsize); + ndr_print_uint32(ndr, "threadpriority", r->threadpriority); + ndr_print_uint32(ndr, "maxmpxct", r->maxmpxct); + ndr_print_uint32(ndr, "oplockbreakwait", r->oplockbreakwait); + ndr_print_uint32(ndr, "oplockbreakresponsewait", r->oplockbreakresponsewait); + ndr_print_uint32(ndr, "enableoplocks", r->enableoplocks); + ndr_print_uint32(ndr, "enableoplockforceclose", r->enableoplockforceclose); + ndr_print_uint32(ndr, "enablefcbopens", r->enablefcbopens); + ndr_print_uint32(ndr, "enableraw", r->enableraw); + ndr_print_uint32(ndr, "enablesharednetdrives", r->enablesharednetdrives); + ndr_print_uint32(ndr, "minfreeconnections", r->minfreeconnections); + ndr_print_uint32(ndr, "maxfreeconnections", r->maxfreeconnections); + ndr_print_uint32(ndr, "initsesstable", r->initsesstable); + ndr_print_uint32(ndr, "initconntable", r->initconntable); + ndr_print_uint32(ndr, "initfiletable", r->initfiletable); + ndr_print_uint32(ndr, "initsearchtable", r->initsearchtable); + ndr_print_uint32(ndr, "alertsched", r->alertsched); + ndr_print_uint32(ndr, "errortreshold", r->errortreshold); + ndr_print_uint32(ndr, "networkerrortreshold", r->networkerrortreshold); + ndr_print_uint32(ndr, "diskspacetreshold", r->diskspacetreshold); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr_print_uint32(ndr, "maxlinkdelay", r->maxlinkdelay); + ndr_print_uint32(ndr, "minlinkthroughput", r->minlinkthroughput); + ndr_print_uint32(ndr, "linkinfovalidtime", r->linkinfovalidtime); + ndr_print_uint32(ndr, "scavqosinfoupdatetime", r->scavqosinfoupdatetime); + ndr_print_uint32(ndr, "maxworkitemidletime", r->maxworkitemidletime); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1005(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1005 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->comment) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1005(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1005 *r) +{ + uint32_t _ptr_comment; + TALLOC_CTX *_mem_save_comment_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_PULL_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->comment) { + _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); + if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1005 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1005"); + ndr->depth++; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_string(ndr, "comment", r->comment); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1010(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1010 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->disc)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1010(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1010 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->disc)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1010(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1010 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1010"); + ndr->depth++; + ndr_print_uint32(ndr, "disc", r->disc); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1016(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1016 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->hidden)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1016(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1016 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->hidden)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1016(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1016 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1016"); + ndr->depth++; + ndr_print_uint32(ndr, "hidden", r->hidden); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1017(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1017 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->announce)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1017(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1017 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->announce)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1017(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1017 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1017"); + ndr->depth++; + ndr_print_uint32(ndr, "announce", r->announce); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1018(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1018 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->anndelta)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1018(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1018 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->anndelta)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1018(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1018 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1018"); + ndr->depth++; + ndr_print_uint32(ndr, "anndelta", r->anndelta); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1107(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1107 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->users)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1107(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1107 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->users)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1107(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1107 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1107"); + ndr->depth++; + ndr_print_uint32(ndr, "users", r->users); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1501(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1501 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopens)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1501(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1501 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopens)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1501 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1501"); + ndr->depth++; + ndr_print_uint32(ndr, "sessopens", r->sessopens); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1502 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessvcs)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1502 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessvcs)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1502 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1502"); + ndr->depth++; + ndr_print_uint32(ndr, "sessvcs", r->sessvcs); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1503(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1503 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1503(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1503 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1503(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1503 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1503"); + ndr->depth++; + ndr_print_uint32(ndr, "opensearch", r->opensearch); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1506(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1506 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitems)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1506(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1506 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitems)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1506(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1506 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1506"); + ndr->depth++; + ndr_print_uint32(ndr, "maxworkitems", r->maxworkitems); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1509(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1509 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxrawbuflen)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1509(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1509 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxrawbuflen)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1509(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1509 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1509"); + ndr->depth++; + ndr_print_uint32(ndr, "maxrawbuflen", r->maxrawbuflen); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1510(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1510 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessusers)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1510(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1510 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessusers)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1510(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1510 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1510"); + ndr->depth++; + ndr_print_uint32(ndr, "sessusers", r->sessusers); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1511(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1511 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesscons)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1511(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1511 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesscons)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1511(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1511 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1511"); + ndr->depth++; + ndr_print_uint32(ndr, "sesscons", r->sesscons); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1512(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1512 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxnonpagedmemoryusage)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1512(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1512 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxnonpagedmemoryusage)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1512(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1512 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1512"); + ndr->depth++; + ndr_print_uint32(ndr, "maxnonpagedmemoryusage", r->maxnonpagedmemoryusage); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1513(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1513 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxpagedmemoryusage)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1513(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1513 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxpagedmemoryusage)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1513(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1513 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1513"); + ndr->depth++; + ndr_print_uint32(ndr, "maxpagedmemoryusage", r->maxpagedmemoryusage); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1514(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1514 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesoftcompat)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1514(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1514 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesoftcompat)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1514(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1514 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1514"); + ndr->depth++; + ndr_print_uint32(ndr, "enablesoftcompat", r->enablesoftcompat); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1515(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1515 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableforcedlogoff)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1515(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1515 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableforcedlogoff)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1515(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1515 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1515"); + ndr->depth++; + ndr_print_uint32(ndr, "enableforcedlogoff", r->enableforcedlogoff); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1516(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1516 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timesource)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1516(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1516 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timesource)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1516(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1516 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1516"); + ndr->depth++; + ndr_print_uint32(ndr, "timesource", r->timesource); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1518(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1518 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lmannounce)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1518(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1518 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lmannounce)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1518(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1518 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1518"); + ndr->depth++; + ndr_print_uint32(ndr, "lmannounce", r->lmannounce); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1520(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1520 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopyreadlen)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1520(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1520 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopyreadlen)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1520(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1520 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1520"); + ndr->depth++; + ndr_print_uint32(ndr, "maxcopyreadlen", r->maxcopyreadlen); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1521(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1521 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopywritelen)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1521(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1521 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopywritelen)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1521(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1521 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1521"); + ndr->depth++; + ndr_print_uint32(ndr, "maxcopywritelen", r->maxcopywritelen); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1522(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1522 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepsearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1522(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1522 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepsearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1522(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1522 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1522"); + ndr->depth++; + ndr_print_uint32(ndr, "minkeepsearch", r->minkeepsearch); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1523(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1523 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepsearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1523(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1523 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepsearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1523(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1523 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1523"); + ndr->depth++; + ndr_print_uint32(ndr, "maxkeepsearch", r->maxkeepsearch); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1524(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1524 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepcomplsearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1524(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1524 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepcomplsearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1524(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1524 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1524"); + ndr->depth++; + ndr_print_uint32(ndr, "minkeepcomplsearch", r->minkeepcomplsearch); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1525(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1525 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepcomplsearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1525(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1525 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepcomplsearch)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1525(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1525 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1525"); + ndr->depth++; + ndr_print_uint32(ndr, "maxkeepcomplsearch", r->maxkeepcomplsearch); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1528(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1528 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavtimeout)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1528(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1528 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavtimeout)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1528(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1528 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1528"); + ndr->depth++; + ndr_print_uint32(ndr, "scavtimeout", r->scavtimeout); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1529(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1529 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minrcvqueue)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1529(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1529 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minrcvqueue)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1529(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1529 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1529"); + ndr->depth++; + ndr_print_uint32(ndr, "minrcvqueue", r->minrcvqueue); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1530(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1530 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeworkitems)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1530(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1530 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeworkitems)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1530(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1530 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1530"); + ndr->depth++; + ndr_print_uint32(ndr, "minfreeworkitems", r->minfreeworkitems); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1533(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1533 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxmpxct)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1533(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1533 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxmpxct)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1533(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1533 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1533"); + ndr->depth++; + ndr_print_uint32(ndr, "maxmpxct", r->maxmpxct); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1534(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1534 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakwait)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1534(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1534 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakwait)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1534(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1534 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1534"); + ndr->depth++; + ndr_print_uint32(ndr, "oplockbreakwait", r->oplockbreakwait); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1535(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1535 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakresponsewait)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1535(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1535 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakresponsewait)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1535(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1535 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1535"); + ndr->depth++; + ndr_print_uint32(ndr, "oplockbreakresponsewait", r->oplockbreakresponsewait); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1536(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1536 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplocks)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1536(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1536 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplocks)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1536(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1536 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1536"); + ndr->depth++; + ndr_print_uint32(ndr, "enableoplocks", r->enableoplocks); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1537(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1537 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplockforceclose)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1537(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1537 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplockforceclose)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1537(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1537 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1537"); + ndr->depth++; + ndr_print_uint32(ndr, "enableoplockforceclose", r->enableoplockforceclose); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1538(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1538 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablefcbopens)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1538(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1538 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablefcbopens)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1538(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1538 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1538"); + ndr->depth++; + ndr_print_uint32(ndr, "enablefcbopens", r->enablefcbopens); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1539(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1539 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableraw)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1539(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1539 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableraw)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1539(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1539 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1539"); + ndr->depth++; + ndr_print_uint32(ndr, "enableraw", r->enableraw); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1540(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1540 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesharednetdrives)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1540(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1540 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesharednetdrives)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1540(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1540 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1540"); + ndr->depth++; + ndr_print_uint32(ndr, "enablesharednetdrives", r->enablesharednetdrives); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1541(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1541 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeconnections)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1541(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1541 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeconnections)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1541(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1541 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1541"); + ndr->depth++; + ndr_print_uint32(ndr, "minfreeconnections", r->minfreeconnections); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1542(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1542 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxfreeconnections)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1542(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1542 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxfreeconnections)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1542(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1542 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1542"); + ndr->depth++; + ndr_print_uint32(ndr, "maxfreeconnections", r->maxfreeconnections); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1543(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1543 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initsesstable)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1543(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1543 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initsesstable)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1543(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1543 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1543"); + ndr->depth++; + ndr_print_uint32(ndr, "initsesstable", r->initsesstable); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1544(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1544 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initconntable)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1544(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1544 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initconntable)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1544(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1544 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1544"); + ndr->depth++; + ndr_print_uint32(ndr, "initconntable", r->initconntable); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1545(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1545 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initfiletable)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1545(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1545 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initfiletable)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1545(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1545 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1545"); + ndr->depth++; + ndr_print_uint32(ndr, "initfiletable", r->initfiletable); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1546(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1546 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initsearchtable)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1546(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1546 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initsearchtable)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1546(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1546 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1546"); + ndr->depth++; + ndr_print_uint32(ndr, "initsearchtable", r->initsearchtable); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1547(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1547 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alertsched)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1547(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1547 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alertsched)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1547(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1547 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1547"); + ndr->depth++; + ndr_print_uint32(ndr, "alertsched", r->alertsched); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1548(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1548 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->errortreshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1548(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1548 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->errortreshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1548(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1548 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1548"); + ndr->depth++; + ndr_print_uint32(ndr, "errortreshold", r->errortreshold); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1549(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1549 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->networkerrortreshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1549(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1549 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->networkerrortreshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1549(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1549 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1549"); + ndr->depth++; + ndr_print_uint32(ndr, "networkerrortreshold", r->networkerrortreshold); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1550(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1550 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->diskspacetreshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1550(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1550 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->diskspacetreshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1550(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1550 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1550"); + ndr->depth++; + ndr_print_uint32(ndr, "diskspacetreshold", r->diskspacetreshold); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1552(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1552 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlinkdelay)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1552(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1552 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlinkdelay)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1552(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1552 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1552"); + ndr->depth++; + ndr_print_uint32(ndr, "maxlinkdelay", r->maxlinkdelay); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1553(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1553 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minlinkthroughput)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1553(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1553 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minlinkthroughput)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1553(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1553 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1553"); + ndr->depth++; + ndr_print_uint32(ndr, "minlinkthroughput", r->minlinkthroughput); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1554(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1554 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linkinfovalidtime)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1554(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1554 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->linkinfovalidtime)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1554(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1554 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1554"); + ndr->depth++; + ndr_print_uint32(ndr, "linkinfovalidtime", r->linkinfovalidtime); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1555(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1555 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavqosinfoupdatetime)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1555(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1555 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavqosinfoupdatetime)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1555(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1555 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1555"); + ndr->depth++; + ndr_print_uint32(ndr, "scavqosinfoupdatetime", r->scavqosinfoupdatetime); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1556(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1556 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitemidletime)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1556(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1556 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitemidletime)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1556(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1556 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1556"); + ndr->depth++; + ndr_print_uint32(ndr, "maxworkitemidletime", r->maxworkitemidletime); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetSrvInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 100: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info100)); + break; } + + case 101: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info101)); + break; } + + case 102: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info102)); + break; } + + case 402: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info402)); + break; } + + case 403: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info403)); + break; } + + case 502: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info502)); + break; } + + case 503: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info503)); + break; } + + case 599: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info599)); + break; } + + case 1005: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1005)); + break; } + + case 1010: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1010)); + break; } + + case 1016: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1016)); + break; } + + case 1017: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1017)); + break; } + + case 1018: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1018)); + break; } + + case 1107: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1107)); + break; } + + case 1501: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1501)); + break; } + + case 1502: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1502)); + break; } + + case 1503: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1503)); + break; } + + case 1506: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1506)); + break; } + + case 1509: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1509)); + break; } + + case 1510: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1510)); + break; } + + case 1511: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1511)); + break; } + + case 1512: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1512)); + break; } + + case 1513: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1513)); + break; } + + case 1514: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1514)); + break; } + + case 1515: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1515)); + break; } + + case 1516: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1516)); + break; } + + case 1518: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1518)); + break; } + + case 1520: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1520)); + break; } + + case 1521: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1521)); + break; } + + case 1522: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1522)); + break; } + + case 1523: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1523)); + break; } + + case 1524: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1524)); + break; } + + case 1525: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1525)); + break; } + + case 1528: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1528)); + break; } + + case 1529: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1529)); + break; } + + case 1530: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1530)); + break; } + + case 1533: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1533)); + break; } + + case 1534: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1534)); + break; } + + case 1535: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1535)); + break; } + + case 1536: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1536)); + break; } + + case 1537: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1537)); + break; } + + case 1538: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1538)); + break; } + + case 1539: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1539)); + break; } + + case 1540: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1540)); + break; } + + case 1541: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1541)); + break; } + + case 1542: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1542)); + break; } + + case 1543: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1543)); + break; } + + case 1544: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1544)); + break; } + + case 1545: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1545)); + break; } + + case 1546: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1546)); + break; } + + case 1547: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1547)); + break; } + + case 1548: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1548)); + break; } + + case 1549: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1549)); + break; } + + case 1550: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1550)); + break; } + + case 1552: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1552)); + break; } + + case 1553: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1553)); + break; } + + case 1554: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1554)); + break; } + + case 1555: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1555)); + break; } + + case 1556: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1556)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 100: + if (r->info100) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); + } + break; + + case 101: + if (r->info101) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info101)); + } + break; + + case 102: + if (r->info102) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo102(ndr, NDR_SCALARS|NDR_BUFFERS, r->info102)); + } + break; + + case 402: + if (r->info402) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo402(ndr, NDR_SCALARS|NDR_BUFFERS, r->info402)); + } + break; + + case 403: + if (r->info403) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo403(ndr, NDR_SCALARS|NDR_BUFFERS, r->info403)); + } + break; + + case 502: + if (r->info502) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo502(ndr, NDR_SCALARS, r->info502)); + } + break; + + case 503: + if (r->info503) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo503(ndr, NDR_SCALARS|NDR_BUFFERS, r->info503)); + } + break; + + case 599: + if (r->info599) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo599(ndr, NDR_SCALARS|NDR_BUFFERS, r->info599)); + } + break; + + case 1005: + if (r->info1005) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1005(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1005)); + } + break; + + case 1010: + if (r->info1010) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1010(ndr, NDR_SCALARS, r->info1010)); + } + break; + + case 1016: + if (r->info1016) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1016(ndr, NDR_SCALARS, r->info1016)); + } + break; + + case 1017: + if (r->info1017) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1017(ndr, NDR_SCALARS, r->info1017)); + } + break; + + case 1018: + if (r->info1018) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1018(ndr, NDR_SCALARS, r->info1018)); + } + break; + + case 1107: + if (r->info1107) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1107(ndr, NDR_SCALARS, r->info1107)); + } + break; + + case 1501: + if (r->info1501) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1501(ndr, NDR_SCALARS, r->info1501)); + } + break; + + case 1502: + if (r->info1502) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1502(ndr, NDR_SCALARS, r->info1502)); + } + break; + + case 1503: + if (r->info1503) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1503(ndr, NDR_SCALARS, r->info1503)); + } + break; + + case 1506: + if (r->info1506) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1506(ndr, NDR_SCALARS, r->info1506)); + } + break; + + case 1509: + if (r->info1509) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1509(ndr, NDR_SCALARS, r->info1509)); + } + break; + + case 1510: + if (r->info1510) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1510(ndr, NDR_SCALARS, r->info1510)); + } + break; + + case 1511: + if (r->info1511) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1511(ndr, NDR_SCALARS, r->info1511)); + } + break; + + case 1512: + if (r->info1512) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1512(ndr, NDR_SCALARS, r->info1512)); + } + break; + + case 1513: + if (r->info1513) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1513(ndr, NDR_SCALARS, r->info1513)); + } + break; + + case 1514: + if (r->info1514) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1514(ndr, NDR_SCALARS, r->info1514)); + } + break; + + case 1515: + if (r->info1515) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1515(ndr, NDR_SCALARS, r->info1515)); + } + break; + + case 1516: + if (r->info1516) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1516(ndr, NDR_SCALARS, r->info1516)); + } + break; + + case 1518: + if (r->info1518) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1518(ndr, NDR_SCALARS, r->info1518)); + } + break; + + case 1520: + if (r->info1520) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1520(ndr, NDR_SCALARS, r->info1520)); + } + break; + + case 1521: + if (r->info1521) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1521(ndr, NDR_SCALARS, r->info1521)); + } + break; + + case 1522: + if (r->info1522) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1522(ndr, NDR_SCALARS, r->info1522)); + } + break; + + case 1523: + if (r->info1523) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1523(ndr, NDR_SCALARS, r->info1523)); + } + break; + + case 1524: + if (r->info1524) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1524(ndr, NDR_SCALARS, r->info1524)); + } + break; + + case 1525: + if (r->info1525) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1525(ndr, NDR_SCALARS, r->info1525)); + } + break; + + case 1528: + if (r->info1528) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1528(ndr, NDR_SCALARS, r->info1528)); + } + break; + + case 1529: + if (r->info1529) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1529(ndr, NDR_SCALARS, r->info1529)); + } + break; + + case 1530: + if (r->info1530) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1530(ndr, NDR_SCALARS, r->info1530)); + } + break; + + case 1533: + if (r->info1533) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1533(ndr, NDR_SCALARS, r->info1533)); + } + break; + + case 1534: + if (r->info1534) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1534(ndr, NDR_SCALARS, r->info1534)); + } + break; + + case 1535: + if (r->info1535) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1535(ndr, NDR_SCALARS, r->info1535)); + } + break; + + case 1536: + if (r->info1536) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1536(ndr, NDR_SCALARS, r->info1536)); + } + break; + + case 1537: + if (r->info1537) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1537(ndr, NDR_SCALARS, r->info1537)); + } + break; + + case 1538: + if (r->info1538) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1538(ndr, NDR_SCALARS, r->info1538)); + } + break; + + case 1539: + if (r->info1539) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1539(ndr, NDR_SCALARS, r->info1539)); + } + break; + + case 1540: + if (r->info1540) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1540(ndr, NDR_SCALARS, r->info1540)); + } + break; + + case 1541: + if (r->info1541) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1541(ndr, NDR_SCALARS, r->info1541)); + } + break; + + case 1542: + if (r->info1542) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1542(ndr, NDR_SCALARS, r->info1542)); + } + break; + + case 1543: + if (r->info1543) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1543(ndr, NDR_SCALARS, r->info1543)); + } + break; + + case 1544: + if (r->info1544) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1544(ndr, NDR_SCALARS, r->info1544)); + } + break; + + case 1545: + if (r->info1545) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1545(ndr, NDR_SCALARS, r->info1545)); + } + break; + + case 1546: + if (r->info1546) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1546(ndr, NDR_SCALARS, r->info1546)); + } + break; + + case 1547: + if (r->info1547) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1547(ndr, NDR_SCALARS, r->info1547)); + } + break; + + case 1548: + if (r->info1548) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1548(ndr, NDR_SCALARS, r->info1548)); + } + break; + + case 1549: + if (r->info1549) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1549(ndr, NDR_SCALARS, r->info1549)); + } + break; + + case 1550: + if (r->info1550) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1550(ndr, NDR_SCALARS, r->info1550)); + } + break; + + case 1552: + if (r->info1552) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1552(ndr, NDR_SCALARS, r->info1552)); + } + break; + + case 1553: + if (r->info1553) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1553(ndr, NDR_SCALARS, r->info1553)); + } + break; + + case 1554: + if (r->info1554) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1554(ndr, NDR_SCALARS, r->info1554)); + } + break; + + case 1555: + if (r->info1555) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1555(ndr, NDR_SCALARS, r->info1555)); + } + break; + + case 1556: + if (r->info1556) { + NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1556(ndr, NDR_SCALARS, r->info1556)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetSrvInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info100_0; + TALLOC_CTX *_mem_save_info101_0; + TALLOC_CTX *_mem_save_info102_0; + TALLOC_CTX *_mem_save_info402_0; + TALLOC_CTX *_mem_save_info403_0; + TALLOC_CTX *_mem_save_info502_0; + TALLOC_CTX *_mem_save_info503_0; + TALLOC_CTX *_mem_save_info599_0; + TALLOC_CTX *_mem_save_info1005_0; + TALLOC_CTX *_mem_save_info1010_0; + TALLOC_CTX *_mem_save_info1016_0; + TALLOC_CTX *_mem_save_info1017_0; + TALLOC_CTX *_mem_save_info1018_0; + TALLOC_CTX *_mem_save_info1107_0; + TALLOC_CTX *_mem_save_info1501_0; + TALLOC_CTX *_mem_save_info1502_0; + TALLOC_CTX *_mem_save_info1503_0; + TALLOC_CTX *_mem_save_info1506_0; + TALLOC_CTX *_mem_save_info1509_0; + TALLOC_CTX *_mem_save_info1510_0; + TALLOC_CTX *_mem_save_info1511_0; + TALLOC_CTX *_mem_save_info1512_0; + TALLOC_CTX *_mem_save_info1513_0; + TALLOC_CTX *_mem_save_info1514_0; + TALLOC_CTX *_mem_save_info1515_0; + TALLOC_CTX *_mem_save_info1516_0; + TALLOC_CTX *_mem_save_info1518_0; + TALLOC_CTX *_mem_save_info1520_0; + TALLOC_CTX *_mem_save_info1521_0; + TALLOC_CTX *_mem_save_info1522_0; + TALLOC_CTX *_mem_save_info1523_0; + TALLOC_CTX *_mem_save_info1524_0; + TALLOC_CTX *_mem_save_info1525_0; + TALLOC_CTX *_mem_save_info1528_0; + TALLOC_CTX *_mem_save_info1529_0; + TALLOC_CTX *_mem_save_info1530_0; + TALLOC_CTX *_mem_save_info1533_0; + TALLOC_CTX *_mem_save_info1534_0; + TALLOC_CTX *_mem_save_info1535_0; + TALLOC_CTX *_mem_save_info1536_0; + TALLOC_CTX *_mem_save_info1537_0; + TALLOC_CTX *_mem_save_info1538_0; + TALLOC_CTX *_mem_save_info1539_0; + TALLOC_CTX *_mem_save_info1540_0; + TALLOC_CTX *_mem_save_info1541_0; + TALLOC_CTX *_mem_save_info1542_0; + TALLOC_CTX *_mem_save_info1543_0; + TALLOC_CTX *_mem_save_info1544_0; + TALLOC_CTX *_mem_save_info1545_0; + TALLOC_CTX *_mem_save_info1546_0; + TALLOC_CTX *_mem_save_info1547_0; + TALLOC_CTX *_mem_save_info1548_0; + TALLOC_CTX *_mem_save_info1549_0; + TALLOC_CTX *_mem_save_info1550_0; + TALLOC_CTX *_mem_save_info1552_0; + TALLOC_CTX *_mem_save_info1553_0; + TALLOC_CTX *_mem_save_info1554_0; + TALLOC_CTX *_mem_save_info1555_0; + TALLOC_CTX *_mem_save_info1556_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 100: { + uint32_t _ptr_info100; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info100)); + if (_ptr_info100) { + NDR_PULL_ALLOC(ndr, r->info100); + } else { + r->info100 = NULL; + } + break; } + + case 101: { + uint32_t _ptr_info101; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info101)); + if (_ptr_info101) { + NDR_PULL_ALLOC(ndr, r->info101); + } else { + r->info101 = NULL; + } + break; } + + case 102: { + uint32_t _ptr_info102; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info102)); + if (_ptr_info102) { + NDR_PULL_ALLOC(ndr, r->info102); + } else { + r->info102 = NULL; + } + break; } + + case 402: { + uint32_t _ptr_info402; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info402)); + if (_ptr_info402) { + NDR_PULL_ALLOC(ndr, r->info402); + } else { + r->info402 = NULL; + } + break; } + + case 403: { + uint32_t _ptr_info403; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info403)); + if (_ptr_info403) { + NDR_PULL_ALLOC(ndr, r->info403); + } else { + r->info403 = NULL; + } + break; } + + case 502: { + uint32_t _ptr_info502; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info502)); + if (_ptr_info502) { + NDR_PULL_ALLOC(ndr, r->info502); + } else { + r->info502 = NULL; + } + break; } + + case 503: { + uint32_t _ptr_info503; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info503)); + if (_ptr_info503) { + NDR_PULL_ALLOC(ndr, r->info503); + } else { + r->info503 = NULL; + } + break; } + + case 599: { + uint32_t _ptr_info599; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info599)); + if (_ptr_info599) { + NDR_PULL_ALLOC(ndr, r->info599); + } else { + r->info599 = NULL; + } + break; } + + case 1005: { + uint32_t _ptr_info1005; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1005)); + if (_ptr_info1005) { + NDR_PULL_ALLOC(ndr, r->info1005); + } else { + r->info1005 = NULL; + } + break; } + + case 1010: { + uint32_t _ptr_info1010; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1010)); + if (_ptr_info1010) { + NDR_PULL_ALLOC(ndr, r->info1010); + } else { + r->info1010 = NULL; + } + break; } + + case 1016: { + uint32_t _ptr_info1016; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1016)); + if (_ptr_info1016) { + NDR_PULL_ALLOC(ndr, r->info1016); + } else { + r->info1016 = NULL; + } + break; } + + case 1017: { + uint32_t _ptr_info1017; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1017)); + if (_ptr_info1017) { + NDR_PULL_ALLOC(ndr, r->info1017); + } else { + r->info1017 = NULL; + } + break; } + + case 1018: { + uint32_t _ptr_info1018; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1018)); + if (_ptr_info1018) { + NDR_PULL_ALLOC(ndr, r->info1018); + } else { + r->info1018 = NULL; + } + break; } + + case 1107: { + uint32_t _ptr_info1107; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1107)); + if (_ptr_info1107) { + NDR_PULL_ALLOC(ndr, r->info1107); + } else { + r->info1107 = NULL; + } + break; } + + case 1501: { + uint32_t _ptr_info1501; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1501)); + if (_ptr_info1501) { + NDR_PULL_ALLOC(ndr, r->info1501); + } else { + r->info1501 = NULL; + } + break; } + + case 1502: { + uint32_t _ptr_info1502; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1502)); + if (_ptr_info1502) { + NDR_PULL_ALLOC(ndr, r->info1502); + } else { + r->info1502 = NULL; + } + break; } + + case 1503: { + uint32_t _ptr_info1503; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1503)); + if (_ptr_info1503) { + NDR_PULL_ALLOC(ndr, r->info1503); + } else { + r->info1503 = NULL; + } + break; } + + case 1506: { + uint32_t _ptr_info1506; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1506)); + if (_ptr_info1506) { + NDR_PULL_ALLOC(ndr, r->info1506); + } else { + r->info1506 = NULL; + } + break; } + + case 1509: { + uint32_t _ptr_info1509; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1509)); + if (_ptr_info1509) { + NDR_PULL_ALLOC(ndr, r->info1509); + } else { + r->info1509 = NULL; + } + break; } + + case 1510: { + uint32_t _ptr_info1510; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1510)); + if (_ptr_info1510) { + NDR_PULL_ALLOC(ndr, r->info1510); + } else { + r->info1510 = NULL; + } + break; } + + case 1511: { + uint32_t _ptr_info1511; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1511)); + if (_ptr_info1511) { + NDR_PULL_ALLOC(ndr, r->info1511); + } else { + r->info1511 = NULL; + } + break; } + + case 1512: { + uint32_t _ptr_info1512; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1512)); + if (_ptr_info1512) { + NDR_PULL_ALLOC(ndr, r->info1512); + } else { + r->info1512 = NULL; + } + break; } + + case 1513: { + uint32_t _ptr_info1513; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1513)); + if (_ptr_info1513) { + NDR_PULL_ALLOC(ndr, r->info1513); + } else { + r->info1513 = NULL; + } + break; } + + case 1514: { + uint32_t _ptr_info1514; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1514)); + if (_ptr_info1514) { + NDR_PULL_ALLOC(ndr, r->info1514); + } else { + r->info1514 = NULL; + } + break; } + + case 1515: { + uint32_t _ptr_info1515; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1515)); + if (_ptr_info1515) { + NDR_PULL_ALLOC(ndr, r->info1515); + } else { + r->info1515 = NULL; + } + break; } + + case 1516: { + uint32_t _ptr_info1516; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1516)); + if (_ptr_info1516) { + NDR_PULL_ALLOC(ndr, r->info1516); + } else { + r->info1516 = NULL; + } + break; } + + case 1518: { + uint32_t _ptr_info1518; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1518)); + if (_ptr_info1518) { + NDR_PULL_ALLOC(ndr, r->info1518); + } else { + r->info1518 = NULL; + } + break; } + + case 1520: { + uint32_t _ptr_info1520; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1520)); + if (_ptr_info1520) { + NDR_PULL_ALLOC(ndr, r->info1520); + } else { + r->info1520 = NULL; + } + break; } + + case 1521: { + uint32_t _ptr_info1521; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1521)); + if (_ptr_info1521) { + NDR_PULL_ALLOC(ndr, r->info1521); + } else { + r->info1521 = NULL; + } + break; } + + case 1522: { + uint32_t _ptr_info1522; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1522)); + if (_ptr_info1522) { + NDR_PULL_ALLOC(ndr, r->info1522); + } else { + r->info1522 = NULL; + } + break; } + + case 1523: { + uint32_t _ptr_info1523; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1523)); + if (_ptr_info1523) { + NDR_PULL_ALLOC(ndr, r->info1523); + } else { + r->info1523 = NULL; + } + break; } + + case 1524: { + uint32_t _ptr_info1524; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1524)); + if (_ptr_info1524) { + NDR_PULL_ALLOC(ndr, r->info1524); + } else { + r->info1524 = NULL; + } + break; } + + case 1525: { + uint32_t _ptr_info1525; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1525)); + if (_ptr_info1525) { + NDR_PULL_ALLOC(ndr, r->info1525); + } else { + r->info1525 = NULL; + } + break; } + + case 1528: { + uint32_t _ptr_info1528; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1528)); + if (_ptr_info1528) { + NDR_PULL_ALLOC(ndr, r->info1528); + } else { + r->info1528 = NULL; + } + break; } + + case 1529: { + uint32_t _ptr_info1529; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1529)); + if (_ptr_info1529) { + NDR_PULL_ALLOC(ndr, r->info1529); + } else { + r->info1529 = NULL; + } + break; } + + case 1530: { + uint32_t _ptr_info1530; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1530)); + if (_ptr_info1530) { + NDR_PULL_ALLOC(ndr, r->info1530); + } else { + r->info1530 = NULL; + } + break; } + + case 1533: { + uint32_t _ptr_info1533; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1533)); + if (_ptr_info1533) { + NDR_PULL_ALLOC(ndr, r->info1533); + } else { + r->info1533 = NULL; + } + break; } + + case 1534: { + uint32_t _ptr_info1534; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1534)); + if (_ptr_info1534) { + NDR_PULL_ALLOC(ndr, r->info1534); + } else { + r->info1534 = NULL; + } + break; } + + case 1535: { + uint32_t _ptr_info1535; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1535)); + if (_ptr_info1535) { + NDR_PULL_ALLOC(ndr, r->info1535); + } else { + r->info1535 = NULL; + } + break; } + + case 1536: { + uint32_t _ptr_info1536; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1536)); + if (_ptr_info1536) { + NDR_PULL_ALLOC(ndr, r->info1536); + } else { + r->info1536 = NULL; + } + break; } + + case 1537: { + uint32_t _ptr_info1537; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1537)); + if (_ptr_info1537) { + NDR_PULL_ALLOC(ndr, r->info1537); + } else { + r->info1537 = NULL; + } + break; } + + case 1538: { + uint32_t _ptr_info1538; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1538)); + if (_ptr_info1538) { + NDR_PULL_ALLOC(ndr, r->info1538); + } else { + r->info1538 = NULL; + } + break; } + + case 1539: { + uint32_t _ptr_info1539; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1539)); + if (_ptr_info1539) { + NDR_PULL_ALLOC(ndr, r->info1539); + } else { + r->info1539 = NULL; + } + break; } + + case 1540: { + uint32_t _ptr_info1540; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1540)); + if (_ptr_info1540) { + NDR_PULL_ALLOC(ndr, r->info1540); + } else { + r->info1540 = NULL; + } + break; } + + case 1541: { + uint32_t _ptr_info1541; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1541)); + if (_ptr_info1541) { + NDR_PULL_ALLOC(ndr, r->info1541); + } else { + r->info1541 = NULL; + } + break; } + + case 1542: { + uint32_t _ptr_info1542; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1542)); + if (_ptr_info1542) { + NDR_PULL_ALLOC(ndr, r->info1542); + } else { + r->info1542 = NULL; + } + break; } + + case 1543: { + uint32_t _ptr_info1543; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1543)); + if (_ptr_info1543) { + NDR_PULL_ALLOC(ndr, r->info1543); + } else { + r->info1543 = NULL; + } + break; } + + case 1544: { + uint32_t _ptr_info1544; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1544)); + if (_ptr_info1544) { + NDR_PULL_ALLOC(ndr, r->info1544); + } else { + r->info1544 = NULL; + } + break; } + + case 1545: { + uint32_t _ptr_info1545; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1545)); + if (_ptr_info1545) { + NDR_PULL_ALLOC(ndr, r->info1545); + } else { + r->info1545 = NULL; + } + break; } + + case 1546: { + uint32_t _ptr_info1546; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1546)); + if (_ptr_info1546) { + NDR_PULL_ALLOC(ndr, r->info1546); + } else { + r->info1546 = NULL; + } + break; } + + case 1547: { + uint32_t _ptr_info1547; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1547)); + if (_ptr_info1547) { + NDR_PULL_ALLOC(ndr, r->info1547); + } else { + r->info1547 = NULL; + } + break; } + + case 1548: { + uint32_t _ptr_info1548; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1548)); + if (_ptr_info1548) { + NDR_PULL_ALLOC(ndr, r->info1548); + } else { + r->info1548 = NULL; + } + break; } + + case 1549: { + uint32_t _ptr_info1549; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1549)); + if (_ptr_info1549) { + NDR_PULL_ALLOC(ndr, r->info1549); + } else { + r->info1549 = NULL; + } + break; } + + case 1550: { + uint32_t _ptr_info1550; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1550)); + if (_ptr_info1550) { + NDR_PULL_ALLOC(ndr, r->info1550); + } else { + r->info1550 = NULL; + } + break; } + + case 1552: { + uint32_t _ptr_info1552; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1552)); + if (_ptr_info1552) { + NDR_PULL_ALLOC(ndr, r->info1552); + } else { + r->info1552 = NULL; + } + break; } + + case 1553: { + uint32_t _ptr_info1553; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1553)); + if (_ptr_info1553) { + NDR_PULL_ALLOC(ndr, r->info1553); + } else { + r->info1553 = NULL; + } + break; } + + case 1554: { + uint32_t _ptr_info1554; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1554)); + if (_ptr_info1554) { + NDR_PULL_ALLOC(ndr, r->info1554); + } else { + r->info1554 = NULL; + } + break; } + + case 1555: { + uint32_t _ptr_info1555; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1555)); + if (_ptr_info1555) { + NDR_PULL_ALLOC(ndr, r->info1555); + } else { + r->info1555 = NULL; + } + break; } + + case 1556: { + uint32_t _ptr_info1556; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1556)); + if (_ptr_info1556) { + NDR_PULL_ALLOC(ndr, r->info1556); + } else { + r->info1556 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 100: + if (r->info100) { + _mem_save_info100_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info100, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info100_0, 0); + } + break; + + case 101: + if (r->info101) { + _mem_save_info101_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info101, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info101)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info101_0, 0); + } + break; + + case 102: + if (r->info102) { + _mem_save_info102_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info102, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo102(ndr, NDR_SCALARS|NDR_BUFFERS, r->info102)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info102_0, 0); + } + break; + + case 402: + if (r->info402) { + _mem_save_info402_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info402, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo402(ndr, NDR_SCALARS|NDR_BUFFERS, r->info402)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info402_0, 0); + } + break; + + case 403: + if (r->info403) { + _mem_save_info403_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info403, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo403(ndr, NDR_SCALARS|NDR_BUFFERS, r->info403)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info403_0, 0); + } + break; + + case 502: + if (r->info502) { + _mem_save_info502_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info502, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo502(ndr, NDR_SCALARS, r->info502)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info502_0, 0); + } + break; + + case 503: + if (r->info503) { + _mem_save_info503_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info503, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo503(ndr, NDR_SCALARS|NDR_BUFFERS, r->info503)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info503_0, 0); + } + break; + + case 599: + if (r->info599) { + _mem_save_info599_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info599, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo599(ndr, NDR_SCALARS|NDR_BUFFERS, r->info599)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info599_0, 0); + } + break; + + case 1005: + if (r->info1005) { + _mem_save_info1005_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1005, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1005(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1005)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1005_0, 0); + } + break; + + case 1010: + if (r->info1010) { + _mem_save_info1010_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1010, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1010(ndr, NDR_SCALARS, r->info1010)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1010_0, 0); + } + break; + + case 1016: + if (r->info1016) { + _mem_save_info1016_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1016, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1016(ndr, NDR_SCALARS, r->info1016)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1016_0, 0); + } + break; + + case 1017: + if (r->info1017) { + _mem_save_info1017_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1017, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1017(ndr, NDR_SCALARS, r->info1017)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1017_0, 0); + } + break; + + case 1018: + if (r->info1018) { + _mem_save_info1018_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1018, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1018(ndr, NDR_SCALARS, r->info1018)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1018_0, 0); + } + break; + + case 1107: + if (r->info1107) { + _mem_save_info1107_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1107, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1107(ndr, NDR_SCALARS, r->info1107)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1107_0, 0); + } + break; + + case 1501: + if (r->info1501) { + _mem_save_info1501_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1501, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1501(ndr, NDR_SCALARS, r->info1501)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1501_0, 0); + } + break; + + case 1502: + if (r->info1502) { + _mem_save_info1502_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1502, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1502(ndr, NDR_SCALARS, r->info1502)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1502_0, 0); + } + break; + + case 1503: + if (r->info1503) { + _mem_save_info1503_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1503, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1503(ndr, NDR_SCALARS, r->info1503)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1503_0, 0); + } + break; + + case 1506: + if (r->info1506) { + _mem_save_info1506_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1506, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1506(ndr, NDR_SCALARS, r->info1506)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1506_0, 0); + } + break; + + case 1509: + if (r->info1509) { + _mem_save_info1509_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1509, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1509(ndr, NDR_SCALARS, r->info1509)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1509_0, 0); + } + break; + + case 1510: + if (r->info1510) { + _mem_save_info1510_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1510, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1510(ndr, NDR_SCALARS, r->info1510)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1510_0, 0); + } + break; + + case 1511: + if (r->info1511) { + _mem_save_info1511_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1511, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1511(ndr, NDR_SCALARS, r->info1511)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1511_0, 0); + } + break; + + case 1512: + if (r->info1512) { + _mem_save_info1512_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1512, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1512(ndr, NDR_SCALARS, r->info1512)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1512_0, 0); + } + break; + + case 1513: + if (r->info1513) { + _mem_save_info1513_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1513, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1513(ndr, NDR_SCALARS, r->info1513)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1513_0, 0); + } + break; + + case 1514: + if (r->info1514) { + _mem_save_info1514_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1514, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1514(ndr, NDR_SCALARS, r->info1514)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1514_0, 0); + } + break; + + case 1515: + if (r->info1515) { + _mem_save_info1515_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1515, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1515(ndr, NDR_SCALARS, r->info1515)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1515_0, 0); + } + break; + + case 1516: + if (r->info1516) { + _mem_save_info1516_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1516, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1516(ndr, NDR_SCALARS, r->info1516)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1516_0, 0); + } + break; + + case 1518: + if (r->info1518) { + _mem_save_info1518_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1518, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1518(ndr, NDR_SCALARS, r->info1518)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1518_0, 0); + } + break; + + case 1520: + if (r->info1520) { + _mem_save_info1520_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1520, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1520(ndr, NDR_SCALARS, r->info1520)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1520_0, 0); + } + break; + + case 1521: + if (r->info1521) { + _mem_save_info1521_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1521, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1521(ndr, NDR_SCALARS, r->info1521)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1521_0, 0); + } + break; + + case 1522: + if (r->info1522) { + _mem_save_info1522_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1522, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1522(ndr, NDR_SCALARS, r->info1522)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1522_0, 0); + } + break; + + case 1523: + if (r->info1523) { + _mem_save_info1523_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1523, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1523(ndr, NDR_SCALARS, r->info1523)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1523_0, 0); + } + break; + + case 1524: + if (r->info1524) { + _mem_save_info1524_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1524, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1524(ndr, NDR_SCALARS, r->info1524)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1524_0, 0); + } + break; + + case 1525: + if (r->info1525) { + _mem_save_info1525_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1525, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1525(ndr, NDR_SCALARS, r->info1525)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1525_0, 0); + } + break; + + case 1528: + if (r->info1528) { + _mem_save_info1528_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1528, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1528(ndr, NDR_SCALARS, r->info1528)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1528_0, 0); + } + break; + + case 1529: + if (r->info1529) { + _mem_save_info1529_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1529, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1529(ndr, NDR_SCALARS, r->info1529)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1529_0, 0); + } + break; + + case 1530: + if (r->info1530) { + _mem_save_info1530_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1530, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1530(ndr, NDR_SCALARS, r->info1530)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1530_0, 0); + } + break; + + case 1533: + if (r->info1533) { + _mem_save_info1533_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1533, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1533(ndr, NDR_SCALARS, r->info1533)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1533_0, 0); + } + break; + + case 1534: + if (r->info1534) { + _mem_save_info1534_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1534, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1534(ndr, NDR_SCALARS, r->info1534)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1534_0, 0); + } + break; + + case 1535: + if (r->info1535) { + _mem_save_info1535_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1535, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1535(ndr, NDR_SCALARS, r->info1535)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1535_0, 0); + } + break; + + case 1536: + if (r->info1536) { + _mem_save_info1536_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1536, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1536(ndr, NDR_SCALARS, r->info1536)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1536_0, 0); + } + break; + + case 1537: + if (r->info1537) { + _mem_save_info1537_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1537, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1537(ndr, NDR_SCALARS, r->info1537)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1537_0, 0); + } + break; + + case 1538: + if (r->info1538) { + _mem_save_info1538_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1538, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1538(ndr, NDR_SCALARS, r->info1538)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1538_0, 0); + } + break; + + case 1539: + if (r->info1539) { + _mem_save_info1539_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1539, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1539(ndr, NDR_SCALARS, r->info1539)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1539_0, 0); + } + break; + + case 1540: + if (r->info1540) { + _mem_save_info1540_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1540, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1540(ndr, NDR_SCALARS, r->info1540)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1540_0, 0); + } + break; + + case 1541: + if (r->info1541) { + _mem_save_info1541_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1541, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1541(ndr, NDR_SCALARS, r->info1541)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1541_0, 0); + } + break; + + case 1542: + if (r->info1542) { + _mem_save_info1542_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1542, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1542(ndr, NDR_SCALARS, r->info1542)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1542_0, 0); + } + break; + + case 1543: + if (r->info1543) { + _mem_save_info1543_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1543, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1543(ndr, NDR_SCALARS, r->info1543)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1543_0, 0); + } + break; + + case 1544: + if (r->info1544) { + _mem_save_info1544_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1544, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1544(ndr, NDR_SCALARS, r->info1544)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1544_0, 0); + } + break; + + case 1545: + if (r->info1545) { + _mem_save_info1545_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1545, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1545(ndr, NDR_SCALARS, r->info1545)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1545_0, 0); + } + break; + + case 1546: + if (r->info1546) { + _mem_save_info1546_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1546, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1546(ndr, NDR_SCALARS, r->info1546)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1546_0, 0); + } + break; + + case 1547: + if (r->info1547) { + _mem_save_info1547_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1547, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1547(ndr, NDR_SCALARS, r->info1547)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1547_0, 0); + } + break; + + case 1548: + if (r->info1548) { + _mem_save_info1548_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1548, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1548(ndr, NDR_SCALARS, r->info1548)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1548_0, 0); + } + break; + + case 1549: + if (r->info1549) { + _mem_save_info1549_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1549, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1549(ndr, NDR_SCALARS, r->info1549)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1549_0, 0); + } + break; + + case 1550: + if (r->info1550) { + _mem_save_info1550_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1550, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1550(ndr, NDR_SCALARS, r->info1550)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1550_0, 0); + } + break; + + case 1552: + if (r->info1552) { + _mem_save_info1552_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1552, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1552(ndr, NDR_SCALARS, r->info1552)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1552_0, 0); + } + break; + + case 1553: + if (r->info1553) { + _mem_save_info1553_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1553, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1553(ndr, NDR_SCALARS, r->info1553)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1553_0, 0); + } + break; + + case 1554: + if (r->info1554) { + _mem_save_info1554_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1554, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1554(ndr, NDR_SCALARS, r->info1554)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1554_0, 0); + } + break; + + case 1555: + if (r->info1555) { + _mem_save_info1555_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1555, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1555(ndr, NDR_SCALARS, r->info1555)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1555_0, 0); + } + break; + + case 1556: + if (r->info1556) { + _mem_save_info1556_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1556, 0); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1556(ndr, NDR_SCALARS, r->info1556)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1556_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetSrvInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetSrvInfo"); + switch (level) { + case 100: + ndr_print_ptr(ndr, "info100", r->info100); + ndr->depth++; + if (r->info100) { + ndr_print_srvsvc_NetSrvInfo100(ndr, "info100", r->info100); + } + ndr->depth--; + break; + + case 101: + ndr_print_ptr(ndr, "info101", r->info101); + ndr->depth++; + if (r->info101) { + ndr_print_srvsvc_NetSrvInfo101(ndr, "info101", r->info101); + } + ndr->depth--; + break; + + case 102: + ndr_print_ptr(ndr, "info102", r->info102); + ndr->depth++; + if (r->info102) { + ndr_print_srvsvc_NetSrvInfo102(ndr, "info102", r->info102); + } + ndr->depth--; + break; + + case 402: + ndr_print_ptr(ndr, "info402", r->info402); + ndr->depth++; + if (r->info402) { + ndr_print_srvsvc_NetSrvInfo402(ndr, "info402", r->info402); + } + ndr->depth--; + break; + + case 403: + ndr_print_ptr(ndr, "info403", r->info403); + ndr->depth++; + if (r->info403) { + ndr_print_srvsvc_NetSrvInfo403(ndr, "info403", r->info403); + } + ndr->depth--; + break; + + case 502: + ndr_print_ptr(ndr, "info502", r->info502); + ndr->depth++; + if (r->info502) { + ndr_print_srvsvc_NetSrvInfo502(ndr, "info502", r->info502); + } + ndr->depth--; + break; + + case 503: + ndr_print_ptr(ndr, "info503", r->info503); + ndr->depth++; + if (r->info503) { + ndr_print_srvsvc_NetSrvInfo503(ndr, "info503", r->info503); + } + ndr->depth--; + break; + + case 599: + ndr_print_ptr(ndr, "info599", r->info599); + ndr->depth++; + if (r->info599) { + ndr_print_srvsvc_NetSrvInfo599(ndr, "info599", r->info599); + } + ndr->depth--; + break; + + case 1005: + ndr_print_ptr(ndr, "info1005", r->info1005); + ndr->depth++; + if (r->info1005) { + ndr_print_srvsvc_NetSrvInfo1005(ndr, "info1005", r->info1005); + } + ndr->depth--; + break; + + case 1010: + ndr_print_ptr(ndr, "info1010", r->info1010); + ndr->depth++; + if (r->info1010) { + ndr_print_srvsvc_NetSrvInfo1010(ndr, "info1010", r->info1010); + } + ndr->depth--; + break; + + case 1016: + ndr_print_ptr(ndr, "info1016", r->info1016); + ndr->depth++; + if (r->info1016) { + ndr_print_srvsvc_NetSrvInfo1016(ndr, "info1016", r->info1016); + } + ndr->depth--; + break; + + case 1017: + ndr_print_ptr(ndr, "info1017", r->info1017); + ndr->depth++; + if (r->info1017) { + ndr_print_srvsvc_NetSrvInfo1017(ndr, "info1017", r->info1017); + } + ndr->depth--; + break; + + case 1018: + ndr_print_ptr(ndr, "info1018", r->info1018); + ndr->depth++; + if (r->info1018) { + ndr_print_srvsvc_NetSrvInfo1018(ndr, "info1018", r->info1018); + } + ndr->depth--; + break; + + case 1107: + ndr_print_ptr(ndr, "info1107", r->info1107); + ndr->depth++; + if (r->info1107) { + ndr_print_srvsvc_NetSrvInfo1107(ndr, "info1107", r->info1107); + } + ndr->depth--; + break; + + case 1501: + ndr_print_ptr(ndr, "info1501", r->info1501); + ndr->depth++; + if (r->info1501) { + ndr_print_srvsvc_NetSrvInfo1501(ndr, "info1501", r->info1501); + } + ndr->depth--; + break; + + case 1502: + ndr_print_ptr(ndr, "info1502", r->info1502); + ndr->depth++; + if (r->info1502) { + ndr_print_srvsvc_NetSrvInfo1502(ndr, "info1502", r->info1502); + } + ndr->depth--; + break; + + case 1503: + ndr_print_ptr(ndr, "info1503", r->info1503); + ndr->depth++; + if (r->info1503) { + ndr_print_srvsvc_NetSrvInfo1503(ndr, "info1503", r->info1503); + } + ndr->depth--; + break; + + case 1506: + ndr_print_ptr(ndr, "info1506", r->info1506); + ndr->depth++; + if (r->info1506) { + ndr_print_srvsvc_NetSrvInfo1506(ndr, "info1506", r->info1506); + } + ndr->depth--; + break; + + case 1509: + ndr_print_ptr(ndr, "info1509", r->info1509); + ndr->depth++; + if (r->info1509) { + ndr_print_srvsvc_NetSrvInfo1509(ndr, "info1509", r->info1509); + } + ndr->depth--; + break; + + case 1510: + ndr_print_ptr(ndr, "info1510", r->info1510); + ndr->depth++; + if (r->info1510) { + ndr_print_srvsvc_NetSrvInfo1510(ndr, "info1510", r->info1510); + } + ndr->depth--; + break; + + case 1511: + ndr_print_ptr(ndr, "info1511", r->info1511); + ndr->depth++; + if (r->info1511) { + ndr_print_srvsvc_NetSrvInfo1511(ndr, "info1511", r->info1511); + } + ndr->depth--; + break; + + case 1512: + ndr_print_ptr(ndr, "info1512", r->info1512); + ndr->depth++; + if (r->info1512) { + ndr_print_srvsvc_NetSrvInfo1512(ndr, "info1512", r->info1512); + } + ndr->depth--; + break; + + case 1513: + ndr_print_ptr(ndr, "info1513", r->info1513); + ndr->depth++; + if (r->info1513) { + ndr_print_srvsvc_NetSrvInfo1513(ndr, "info1513", r->info1513); + } + ndr->depth--; + break; + + case 1514: + ndr_print_ptr(ndr, "info1514", r->info1514); + ndr->depth++; + if (r->info1514) { + ndr_print_srvsvc_NetSrvInfo1514(ndr, "info1514", r->info1514); + } + ndr->depth--; + break; + + case 1515: + ndr_print_ptr(ndr, "info1515", r->info1515); + ndr->depth++; + if (r->info1515) { + ndr_print_srvsvc_NetSrvInfo1515(ndr, "info1515", r->info1515); + } + ndr->depth--; + break; + + case 1516: + ndr_print_ptr(ndr, "info1516", r->info1516); + ndr->depth++; + if (r->info1516) { + ndr_print_srvsvc_NetSrvInfo1516(ndr, "info1516", r->info1516); + } + ndr->depth--; + break; + + case 1518: + ndr_print_ptr(ndr, "info1518", r->info1518); + ndr->depth++; + if (r->info1518) { + ndr_print_srvsvc_NetSrvInfo1518(ndr, "info1518", r->info1518); + } + ndr->depth--; + break; + + case 1520: + ndr_print_ptr(ndr, "info1520", r->info1520); + ndr->depth++; + if (r->info1520) { + ndr_print_srvsvc_NetSrvInfo1520(ndr, "info1520", r->info1520); + } + ndr->depth--; + break; + + case 1521: + ndr_print_ptr(ndr, "info1521", r->info1521); + ndr->depth++; + if (r->info1521) { + ndr_print_srvsvc_NetSrvInfo1521(ndr, "info1521", r->info1521); + } + ndr->depth--; + break; + + case 1522: + ndr_print_ptr(ndr, "info1522", r->info1522); + ndr->depth++; + if (r->info1522) { + ndr_print_srvsvc_NetSrvInfo1522(ndr, "info1522", r->info1522); + } + ndr->depth--; + break; + + case 1523: + ndr_print_ptr(ndr, "info1523", r->info1523); + ndr->depth++; + if (r->info1523) { + ndr_print_srvsvc_NetSrvInfo1523(ndr, "info1523", r->info1523); + } + ndr->depth--; + break; + + case 1524: + ndr_print_ptr(ndr, "info1524", r->info1524); + ndr->depth++; + if (r->info1524) { + ndr_print_srvsvc_NetSrvInfo1524(ndr, "info1524", r->info1524); + } + ndr->depth--; + break; + + case 1525: + ndr_print_ptr(ndr, "info1525", r->info1525); + ndr->depth++; + if (r->info1525) { + ndr_print_srvsvc_NetSrvInfo1525(ndr, "info1525", r->info1525); + } + ndr->depth--; + break; + + case 1528: + ndr_print_ptr(ndr, "info1528", r->info1528); + ndr->depth++; + if (r->info1528) { + ndr_print_srvsvc_NetSrvInfo1528(ndr, "info1528", r->info1528); + } + ndr->depth--; + break; + + case 1529: + ndr_print_ptr(ndr, "info1529", r->info1529); + ndr->depth++; + if (r->info1529) { + ndr_print_srvsvc_NetSrvInfo1529(ndr, "info1529", r->info1529); + } + ndr->depth--; + break; + + case 1530: + ndr_print_ptr(ndr, "info1530", r->info1530); + ndr->depth++; + if (r->info1530) { + ndr_print_srvsvc_NetSrvInfo1530(ndr, "info1530", r->info1530); + } + ndr->depth--; + break; + + case 1533: + ndr_print_ptr(ndr, "info1533", r->info1533); + ndr->depth++; + if (r->info1533) { + ndr_print_srvsvc_NetSrvInfo1533(ndr, "info1533", r->info1533); + } + ndr->depth--; + break; + + case 1534: + ndr_print_ptr(ndr, "info1534", r->info1534); + ndr->depth++; + if (r->info1534) { + ndr_print_srvsvc_NetSrvInfo1534(ndr, "info1534", r->info1534); + } + ndr->depth--; + break; + + case 1535: + ndr_print_ptr(ndr, "info1535", r->info1535); + ndr->depth++; + if (r->info1535) { + ndr_print_srvsvc_NetSrvInfo1535(ndr, "info1535", r->info1535); + } + ndr->depth--; + break; + + case 1536: + ndr_print_ptr(ndr, "info1536", r->info1536); + ndr->depth++; + if (r->info1536) { + ndr_print_srvsvc_NetSrvInfo1536(ndr, "info1536", r->info1536); + } + ndr->depth--; + break; + + case 1537: + ndr_print_ptr(ndr, "info1537", r->info1537); + ndr->depth++; + if (r->info1537) { + ndr_print_srvsvc_NetSrvInfo1537(ndr, "info1537", r->info1537); + } + ndr->depth--; + break; + + case 1538: + ndr_print_ptr(ndr, "info1538", r->info1538); + ndr->depth++; + if (r->info1538) { + ndr_print_srvsvc_NetSrvInfo1538(ndr, "info1538", r->info1538); + } + ndr->depth--; + break; + + case 1539: + ndr_print_ptr(ndr, "info1539", r->info1539); + ndr->depth++; + if (r->info1539) { + ndr_print_srvsvc_NetSrvInfo1539(ndr, "info1539", r->info1539); + } + ndr->depth--; + break; + + case 1540: + ndr_print_ptr(ndr, "info1540", r->info1540); + ndr->depth++; + if (r->info1540) { + ndr_print_srvsvc_NetSrvInfo1540(ndr, "info1540", r->info1540); + } + ndr->depth--; + break; + + case 1541: + ndr_print_ptr(ndr, "info1541", r->info1541); + ndr->depth++; + if (r->info1541) { + ndr_print_srvsvc_NetSrvInfo1541(ndr, "info1541", r->info1541); + } + ndr->depth--; + break; + + case 1542: + ndr_print_ptr(ndr, "info1542", r->info1542); + ndr->depth++; + if (r->info1542) { + ndr_print_srvsvc_NetSrvInfo1542(ndr, "info1542", r->info1542); + } + ndr->depth--; + break; + + case 1543: + ndr_print_ptr(ndr, "info1543", r->info1543); + ndr->depth++; + if (r->info1543) { + ndr_print_srvsvc_NetSrvInfo1543(ndr, "info1543", r->info1543); + } + ndr->depth--; + break; + + case 1544: + ndr_print_ptr(ndr, "info1544", r->info1544); + ndr->depth++; + if (r->info1544) { + ndr_print_srvsvc_NetSrvInfo1544(ndr, "info1544", r->info1544); + } + ndr->depth--; + break; + + case 1545: + ndr_print_ptr(ndr, "info1545", r->info1545); + ndr->depth++; + if (r->info1545) { + ndr_print_srvsvc_NetSrvInfo1545(ndr, "info1545", r->info1545); + } + ndr->depth--; + break; + + case 1546: + ndr_print_ptr(ndr, "info1546", r->info1546); + ndr->depth++; + if (r->info1546) { + ndr_print_srvsvc_NetSrvInfo1546(ndr, "info1546", r->info1546); + } + ndr->depth--; + break; + + case 1547: + ndr_print_ptr(ndr, "info1547", r->info1547); + ndr->depth++; + if (r->info1547) { + ndr_print_srvsvc_NetSrvInfo1547(ndr, "info1547", r->info1547); + } + ndr->depth--; + break; + + case 1548: + ndr_print_ptr(ndr, "info1548", r->info1548); + ndr->depth++; + if (r->info1548) { + ndr_print_srvsvc_NetSrvInfo1548(ndr, "info1548", r->info1548); + } + ndr->depth--; + break; + + case 1549: + ndr_print_ptr(ndr, "info1549", r->info1549); + ndr->depth++; + if (r->info1549) { + ndr_print_srvsvc_NetSrvInfo1549(ndr, "info1549", r->info1549); + } + ndr->depth--; + break; + + case 1550: + ndr_print_ptr(ndr, "info1550", r->info1550); + ndr->depth++; + if (r->info1550) { + ndr_print_srvsvc_NetSrvInfo1550(ndr, "info1550", r->info1550); + } + ndr->depth--; + break; + + case 1552: + ndr_print_ptr(ndr, "info1552", r->info1552); + ndr->depth++; + if (r->info1552) { + ndr_print_srvsvc_NetSrvInfo1552(ndr, "info1552", r->info1552); + } + ndr->depth--; + break; + + case 1553: + ndr_print_ptr(ndr, "info1553", r->info1553); + ndr->depth++; + if (r->info1553) { + ndr_print_srvsvc_NetSrvInfo1553(ndr, "info1553", r->info1553); + } + ndr->depth--; + break; + + case 1554: + ndr_print_ptr(ndr, "info1554", r->info1554); + ndr->depth++; + if (r->info1554) { + ndr_print_srvsvc_NetSrvInfo1554(ndr, "info1554", r->info1554); + } + ndr->depth--; + break; + + case 1555: + ndr_print_ptr(ndr, "info1555", r->info1555); + ndr->depth++; + if (r->info1555) { + ndr_print_srvsvc_NetSrvInfo1555(ndr, "info1555", r->info1555); + } + ndr->depth--; + break; + + case 1556: + ndr_print_ptr(ndr, "info1556", r->info1556); + ndr->depth++; + if (r->info1556) { + ndr_print_srvsvc_NetSrvInfo1556(ndr, "info1556", r->info1556); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetDiskInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetDiskInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen(r->disk) + 1)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->disk, strlen(r->disk) + 1, sizeof(uint16_t), CH_UTF16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetDiskInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetDiskInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__disk_offset)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__disk_length)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->disk, r->__disk_length, sizeof(uint16_t), CH_UTF16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetDiskInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetDiskInfo0 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetDiskInfo0"); + ndr->depth++; + ndr_print_uint32(ndr, "__disk_offset", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->__disk_offset); + ndr_print_uint32(ndr, "__disk_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->disk) + 1:r->__disk_length); + ndr_print_string(ndr, "disk", r->disk); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetDiskInfo(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetDiskInfo *r) +{ + uint32_t cntr_disks_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->disks)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->disks) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_disks_1 = 0; cntr_disks_1 < r->count; cntr_disks_1++) { + NDR_CHECK(ndr_push_srvsvc_NetDiskInfo0(ndr, NDR_SCALARS, &r->disks[cntr_disks_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetDiskInfo(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetDiskInfo *r) +{ + uint32_t _ptr_disks; + uint32_t cntr_disks_1; + TALLOC_CTX *_mem_save_disks_0; + TALLOC_CTX *_mem_save_disks_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_disks)); + if (_ptr_disks) { + NDR_PULL_ALLOC(ndr, r->disks); + } else { + r->disks = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->disks) { + _mem_save_disks_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->disks, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->disks)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->disks)); + if (ndr_get_array_length(ndr, &r->disks) > ndr_get_array_size(ndr, &r->disks)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->disks), ndr_get_array_length(ndr, &r->disks)); + } + NDR_PULL_ALLOC_N(ndr, r->disks, ndr_get_array_size(ndr, &r->disks)); + _mem_save_disks_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->disks, 0); + for (cntr_disks_1 = 0; cntr_disks_1 < r->count; cntr_disks_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetDiskInfo0(ndr, NDR_SCALARS, &r->disks[cntr_disks_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disks_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disks_0, 0); + } + if (r->disks) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->disks, r->count)); + } + if (r->disks) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->disks, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetDiskInfo(struct ndr_print *ndr, const char *name, const struct srvsvc_NetDiskInfo *r) +{ + uint32_t cntr_disks_1; + ndr_print_struct(ndr, name, "srvsvc_NetDiskInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "disks", r->disks); + ndr->depth++; + if (r->disks) { + ndr->print(ndr, "%s: ARRAY(%d)", "disks", (int)r->count); + ndr->depth++; + for (cntr_disks_1=0;cntr_disks_1count;cntr_disks_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_disks_1) != -1) { + ndr_print_srvsvc_NetDiskInfo0(ndr, "disks", &r->disks[cntr_disks_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_Statistics(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_Statistics *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->fopens)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->devopens)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->jobsqueued)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sopens)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->stimeouts)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serrorout)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pwerrors)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->permerrors)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->syserrors)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bytessent_low)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bytessent_high)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bytesrcvd_low)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bytesrcvd_high)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->avresponse)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reqbufneed)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bigbufneed)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_Statistics(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_Statistics *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->fopens)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->devopens)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->jobsqueued)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sopens)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->stimeouts)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serrorout)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pwerrors)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->permerrors)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->syserrors)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bytessent_low)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bytessent_high)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bytesrcvd_low)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bytesrcvd_high)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->avresponse)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reqbufneed)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bigbufneed)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_Statistics(struct ndr_print *ndr, const char *name, const struct srvsvc_Statistics *r) +{ + ndr_print_struct(ndr, name, "srvsvc_Statistics"); + ndr->depth++; + ndr_print_uint32(ndr, "start", r->start); + ndr_print_uint32(ndr, "fopens", r->fopens); + ndr_print_uint32(ndr, "devopens", r->devopens); + ndr_print_uint32(ndr, "jobsqueued", r->jobsqueued); + ndr_print_uint32(ndr, "sopens", r->sopens); + ndr_print_uint32(ndr, "stimeouts", r->stimeouts); + ndr_print_uint32(ndr, "serrorout", r->serrorout); + ndr_print_uint32(ndr, "pwerrors", r->pwerrors); + ndr_print_uint32(ndr, "permerrors", r->permerrors); + ndr_print_uint32(ndr, "syserrors", r->syserrors); + ndr_print_uint32(ndr, "bytessent_low", r->bytessent_low); + ndr_print_uint32(ndr, "bytessent_high", r->bytessent_high); + ndr_print_uint32(ndr, "bytesrcvd_low", r->bytesrcvd_low); + ndr_print_uint32(ndr, "bytesrcvd_high", r->bytesrcvd_high); + ndr_print_uint32(ndr, "avresponse", r->avresponse); + ndr_print_uint32(ndr, "reqbufneed", r->reqbufneed); + ndr_print_uint32(ndr, "bigbufneed", r->bigbufneed); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vcs)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->addr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->net_addr)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->addr) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->addr, r->addr_len)); + } + if (r->net_addr) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->net_addr, ndr_charset_length(r->net_addr, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfo0 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + uint32_t _ptr_addr; + TALLOC_CTX *_mem_save_addr_0; + uint32_t _ptr_net_addr; + TALLOC_CTX *_mem_save_net_addr_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vcs)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_addr)); + if (_ptr_addr) { + NDR_PULL_ALLOC(ndr, r->addr); + } else { + r->addr = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->addr_len)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_addr)); + if (_ptr_net_addr) { + NDR_PULL_ALLOC(ndr, r->net_addr); + } else { + r->net_addr = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->addr) { + _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->addr)); + NDR_PULL_ALLOC_N(ndr, r->addr, ndr_get_array_size(ndr, &r->addr)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->addr, ndr_get_array_size(ndr, &r->addr))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0); + } + if (r->net_addr) { + _mem_save_net_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->net_addr, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->net_addr)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->net_addr)); + if (ndr_get_array_length(ndr, &r->net_addr) > ndr_get_array_size(ndr, &r->net_addr)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->net_addr), ndr_get_array_length(ndr, &r->net_addr)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->net_addr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_addr_0, 0); + } + if (r->addr) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->addr, r->addr_len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo0 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetTransportInfo0"); + ndr->depth++; + ndr_print_uint32(ndr, "vcs", r->vcs); + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_ptr(ndr, "addr", r->addr); + ndr->depth++; + if (r->addr) { + ndr_print_array_uint8(ndr, "addr", r->addr, r->addr_len); + } + ndr->depth--; + ndr_print_uint32(ndr, "addr_len", r->addr_len); + ndr_print_ptr(ndr, "net_addr", r->net_addr); + ndr->depth++; + if (r->net_addr) { + ndr_print_string(ndr, "net_addr", r->net_addr); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportCtr0 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportCtr0 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr0 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetTransportCtr0"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetTransportInfo0(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vcs)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->addr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->net_addr)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->addr) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->addr, r->addr_len)); + } + if (r->net_addr) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->net_addr, ndr_charset_length(r->net_addr, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfo1 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + uint32_t _ptr_addr; + TALLOC_CTX *_mem_save_addr_0; + uint32_t _ptr_net_addr; + TALLOC_CTX *_mem_save_net_addr_0; + uint32_t _ptr_domain; + TALLOC_CTX *_mem_save_domain_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vcs)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_addr)); + if (_ptr_addr) { + NDR_PULL_ALLOC(ndr, r->addr); + } else { + r->addr = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->addr_len)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_addr)); + if (_ptr_net_addr) { + NDR_PULL_ALLOC(ndr, r->net_addr); + } else { + r->net_addr = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->addr) { + _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->addr)); + NDR_PULL_ALLOC_N(ndr, r->addr, ndr_get_array_size(ndr, &r->addr)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->addr, ndr_get_array_size(ndr, &r->addr))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0); + } + if (r->net_addr) { + _mem_save_net_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->net_addr, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->net_addr)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->net_addr)); + if (ndr_get_array_length(ndr, &r->net_addr) > ndr_get_array_size(ndr, &r->net_addr)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->net_addr), ndr_get_array_length(ndr, &r->net_addr)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->net_addr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_addr_0, 0); + } + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + if (r->addr) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->addr, r->addr_len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo1 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetTransportInfo1"); + ndr->depth++; + ndr_print_uint32(ndr, "vcs", r->vcs); + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_ptr(ndr, "addr", r->addr); + ndr->depth++; + if (r->addr) { + ndr_print_array_uint8(ndr, "addr", r->addr, r->addr_len); + } + ndr->depth--; + ndr_print_uint32(ndr, "addr_len", r->addr_len); + ndr_print_ptr(ndr, "net_addr", r->net_addr); + ndr->depth++; + if (r->net_addr) { + ndr_print_string(ndr, "net_addr", r->net_addr); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportCtr1 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportCtr1 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr1 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetTransportCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetTransportInfo1(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vcs)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->addr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->net_addr)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->addr) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->addr, r->addr_len)); + } + if (r->net_addr) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->net_addr, ndr_charset_length(r->net_addr, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfo2 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + uint32_t _ptr_addr; + TALLOC_CTX *_mem_save_addr_0; + uint32_t _ptr_net_addr; + TALLOC_CTX *_mem_save_net_addr_0; + uint32_t _ptr_domain; + TALLOC_CTX *_mem_save_domain_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vcs)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_addr)); + if (_ptr_addr) { + NDR_PULL_ALLOC(ndr, r->addr); + } else { + r->addr = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->addr_len)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_addr)); + if (_ptr_net_addr) { + NDR_PULL_ALLOC(ndr, r->net_addr); + } else { + r->net_addr = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->addr) { + _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->addr)); + NDR_PULL_ALLOC_N(ndr, r->addr, ndr_get_array_size(ndr, &r->addr)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->addr, ndr_get_array_size(ndr, &r->addr))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0); + } + if (r->net_addr) { + _mem_save_net_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->net_addr, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->net_addr)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->net_addr)); + if (ndr_get_array_length(ndr, &r->net_addr) > ndr_get_array_size(ndr, &r->net_addr)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->net_addr), ndr_get_array_length(ndr, &r->net_addr)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->net_addr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_addr_0, 0); + } + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + if (r->addr) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->addr, r->addr_len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo2 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetTransportInfo2"); + ndr->depth++; + ndr_print_uint32(ndr, "vcs", r->vcs); + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_ptr(ndr, "addr", r->addr); + ndr->depth++; + if (r->addr) { + ndr_print_array_uint8(ndr, "addr", r->addr, r->addr_len); + } + ndr->depth--; + ndr_print_uint32(ndr, "addr_len", r->addr_len); + ndr_print_ptr(ndr, "net_addr", r->net_addr); + ndr->depth++; + if (r->net_addr) { + ndr_print_string(ndr, "net_addr", r->net_addr); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportCtr2 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportCtr2 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr2 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetTransportCtr2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetTransportInfo2(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vcs)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->addr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->net_addr)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->unknown3, 256)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->addr) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->addr, r->addr_len)); + } + if (r->net_addr) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->net_addr, ndr_charset_length(r->net_addr, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfo3 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + uint32_t _ptr_addr; + TALLOC_CTX *_mem_save_addr_0; + uint32_t _ptr_net_addr; + TALLOC_CTX *_mem_save_net_addr_0; + uint32_t _ptr_domain; + TALLOC_CTX *_mem_save_domain_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vcs)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_addr)); + if (_ptr_addr) { + NDR_PULL_ALLOC(ndr, r->addr); + } else { + r->addr = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->addr_len)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_addr)); + if (_ptr_net_addr) { + NDR_PULL_ALLOC(ndr, r->net_addr); + } else { + r->net_addr = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->unknown3, 256)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->addr) { + _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->addr)); + NDR_PULL_ALLOC_N(ndr, r->addr, ndr_get_array_size(ndr, &r->addr)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->addr, ndr_get_array_size(ndr, &r->addr))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0); + } + if (r->net_addr) { + _mem_save_net_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->net_addr, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->net_addr)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->net_addr)); + if (ndr_get_array_length(ndr, &r->net_addr) > ndr_get_array_size(ndr, &r->net_addr)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->net_addr), ndr_get_array_length(ndr, &r->net_addr)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->net_addr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_addr_0, 0); + } + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + if (r->addr) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->addr, r->addr_len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo3 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetTransportInfo3"); + ndr->depth++; + ndr_print_uint32(ndr, "vcs", r->vcs); + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_ptr(ndr, "addr", r->addr); + ndr->depth++; + if (r->addr) { + ndr_print_array_uint8(ndr, "addr", r->addr, r->addr_len); + } + ndr->depth--; + ndr_print_uint32(ndr, "addr_len", r->addr_len); + ndr_print_ptr(ndr, "net_addr", r->net_addr); + ndr->depth++; + if (r->net_addr) { + ndr_print_string(ndr, "net_addr", r->net_addr); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr_print_array_uint8(ndr, "unknown3", r->unknown3, 256); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportCtr3 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportCtr3 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr3 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "srvsvc_NetTransportCtr3"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_srvsvc_NetTransportInfo3(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetTransportCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr3)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->ctr0) { + NDR_CHECK(ndr_push_srvsvc_NetTransportCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + } + break; + + case 1: + if (r->ctr1) { + NDR_CHECK(ndr_push_srvsvc_NetTransportCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + } + break; + + case 2: + if (r->ctr2) { + NDR_CHECK(ndr_push_srvsvc_NetTransportCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + } + break; + + case 3: + if (r->ctr3) { + NDR_CHECK(ndr_push_srvsvc_NetTransportCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetTransportCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_ctr0_0; + TALLOC_CTX *_mem_save_ctr1_0; + TALLOC_CTX *_mem_save_ctr2_0; + TALLOC_CTX *_mem_save_ctr3_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_ctr0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); + if (_ptr_ctr0) { + NDR_PULL_ALLOC(ndr, r->ctr0); + } else { + r->ctr0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_ctr1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); + if (_ptr_ctr1) { + NDR_PULL_ALLOC(ndr, r->ctr1); + } else { + r->ctr1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_ctr2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); + if (_ptr_ctr2) { + NDR_PULL_ALLOC(ndr, r->ctr2); + } else { + r->ctr2 = NULL; + } + break; } + + case 3: { + uint32_t _ptr_ctr3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr3)); + if (_ptr_ctr3) { + NDR_PULL_ALLOC(ndr, r->ctr3); + } else { + r->ctr3 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->ctr0) { + _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); + NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); + } + break; + + case 1: + if (r->ctr1) { + _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); + NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); + } + break; + + case 2: + if (r->ctr2) { + _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); + NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); + } + break; + + case 3: + if (r->ctr3) { + _mem_save_ctr3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr3, 0); + NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr3_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetTransportCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetTransportCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "ctr0", r->ctr0); + ndr->depth++; + if (r->ctr0) { + ndr_print_srvsvc_NetTransportCtr0(ndr, "ctr0", r->ctr0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "ctr1", r->ctr1); + ndr->depth++; + if (r->ctr1) { + ndr_print_srvsvc_NetTransportCtr1(ndr, "ctr1", r->ctr1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "ctr2", r->ctr2); + ndr->depth++; + if (r->ctr2) { + ndr_print_srvsvc_NetTransportCtr2(ndr, "ctr2", r->ctr2); + } + ndr->depth--; + break; + + case 3: + ndr_print_ptr(ndr, "ctr3", r->ctr3); + ndr->depth++; + if (r->ctr3) { + ndr_print_srvsvc_NetTransportCtr3(ndr, "ctr3", r->ctr3); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_srvsvc_NetTransportCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_srvsvc_NetTransportCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfoCtr *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetTransportInfoCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_srvsvc_NetTransportCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetRemoteTODInfo(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetRemoteTODInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->elapsed)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->msecs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->hours)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->mins)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->secs)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->hunds)); + NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->timezone)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tinterval)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->day)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->month)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->year)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->weekday)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetRemoteTODInfo(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetRemoteTODInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->elapsed)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->msecs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->hours)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->mins)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->secs)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->hunds)); + NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->timezone)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tinterval)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->day)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->month)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->year)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->weekday)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetRemoteTODInfo(struct ndr_print *ndr, const char *name, const struct srvsvc_NetRemoteTODInfo *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetRemoteTODInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "elapsed", r->elapsed); + ndr_print_uint32(ndr, "msecs", r->msecs); + ndr_print_uint32(ndr, "hours", r->hours); + ndr_print_uint32(ndr, "mins", r->mins); + ndr_print_uint32(ndr, "secs", r->secs); + ndr_print_uint32(ndr, "hunds", r->hunds); + ndr_print_int32(ndr, "timezone", r->timezone); + ndr_print_uint32(ndr, "tinterval", r->tinterval); + ndr_print_uint32(ndr, "day", r->day); + ndr_print_uint32(ndr, "month", r->month); + ndr_print_uint32(ndr, "year", r->year); + ndr_print_uint32(ndr, "weekday", r->weekday); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetTransportInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS, &r->info0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo2(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_BUFFERS, &r->info0)); + break; + + case 1: + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo3(ndr, NDR_BUFFERS, &r->info3)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetTransportInfo *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS, &r->info0)); + break; } + + case 1: { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo2(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_BUFFERS, &r->info0)); + break; + + case 1: + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo3(ndr, NDR_BUFFERS, &r->info3)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetTransportInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "srvsvc_NetTransportInfo"); + switch (level) { + case 0: + ndr_print_srvsvc_NetTransportInfo0(ndr, "info0", &r->info0); + break; + + case 1: + ndr_print_srvsvc_NetTransportInfo1(ndr, "info1", &r->info1); + break; + + case 2: + ndr_print_srvsvc_NetTransportInfo2(ndr, "info2", &r->info2); + break; + + case 3: + ndr_print_srvsvc_NetTransportInfo3(ndr, "info3", &r->info3); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetCharDevInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetCharDevInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevEnum *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_ctr_0; + TALLOC_CTX *_mem_save_totalentries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + *r->out.info_ctr = *r->in.info_ctr; + NDR_PULL_ALLOC(ndr, r->out.totalentries); + ZERO_STRUCTP(r->out.totalentries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.totalentries); + } + _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevEnum *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetCharDevEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetCharDevInfoCtr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth--; + ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetCharDevEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetCharDevInfoCtr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth--; + ndr_print_ptr(ndr, "totalentries", r->out.totalentries); + ndr->depth++; + ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevGetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.device_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.device_name, CH_UTF16))); + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevGetInfo *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.device_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.device_name)); + if (ndr_get_array_length(ndr, &r->in.device_name) > ndr_get_array_size(ndr, &r->in.device_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.device_name), ndr_get_array_length(ndr, &r->in.device_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.device_name, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevGetInfo *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetCharDevGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "device_name", r->in.device_name); + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetCharDevGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_srvsvc_NetCharDevInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevControl(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevControl *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.device_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.device_name, CH_UTF16))); + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.opcode)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevControl(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevControl *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.device_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.device_name)); + if (ndr_get_array_length(ndr, &r->in.device_name) > ndr_get_array_size(ndr, &r->in.device_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.device_name), ndr_get_array_length(ndr, &r->in.device_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.device_name, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.opcode)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevControl(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevControl *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevControl"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetCharDevControl"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "device_name", r->in.device_name); + ndr_print_uint32(ndr, "opcode", r->in.opcode); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetCharDevControl"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.user)); + if (r->in.user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQEnum *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_user; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_user_0; + TALLOC_CTX *_mem_save_info_ctr_0; + TALLOC_CTX *_mem_save_totalentries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->in.user); + } else { + r->in.user = NULL; + } + if (r->in.user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); + if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + *r->out.info_ctr = *r->in.info_ctr; + NDR_PULL_ALLOC(ndr, r->out.totalentries); + ZERO_STRUCTP(r->out.totalentries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.totalentries); + } + _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQEnum *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "user", r->in.user); + ndr->depth++; + if (r->in.user) { + ndr_print_string(ndr, "user", r->in.user); + } + ndr->depth--; + ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetCharDevQInfoCtr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth--; + ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetCharDevQInfoCtr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth--; + ndr_print_ptr(ndr, "totalentries", r->out.totalentries); + ndr->depth++; + ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQGetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.queue_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.queue_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.queue_name, ndr_charset_length(r->in.queue_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQGetInfo *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.queue_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.queue_name)); + if (ndr_get_array_length(ndr, &r->in.queue_name) > ndr_get_array_size(ndr, &r->in.queue_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.queue_name), ndr_get_array_length(ndr, &r->in.queue_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.queue_name, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); + if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQGetInfo *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "queue_name", r->in.queue_name); + ndr_print_string(ndr, "user", r->in.user); + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_srvsvc_NetCharDevQInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQSetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQSetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.queue_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.queue_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.queue_name, ndr_charset_length(r->in.queue_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.info, r->in.level)); + NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_error)); + if (r->in.parm_error) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_error)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_error)); + if (r->out.parm_error) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_error)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQSetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQSetInfo *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_parm_error; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_parm_error_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.queue_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.queue_name)); + if (ndr_get_array_length(ndr, &r->in.queue_name) > ndr_get_array_size(ndr, &r->in.queue_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.queue_name), ndr_get_array_length(ndr, &r->in.queue_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.queue_name, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); + if (_ptr_parm_error) { + NDR_PULL_ALLOC(ndr, r->in.parm_error); + } else { + r->in.parm_error = NULL; + } + if (r->in.parm_error) { + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); + if (_ptr_parm_error) { + NDR_PULL_ALLOC(ndr, r->out.parm_error); + } else { + r->out.parm_error = NULL; + } + if (r->out.parm_error) { + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQSetInfo *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQSetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "queue_name", r->in.queue_name); + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_set_switch_value(ndr, &r->in.info, r->in.level); + ndr_print_srvsvc_NetCharDevQInfo(ndr, "info", &r->in.info); + ndr_print_ptr(ndr, "parm_error", r->in.parm_error); + ndr->depth++; + if (r->in.parm_error) { + ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "parm_error", r->out.parm_error); + ndr->depth++; + if (r->out.parm_error) { + ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQPurge(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQPurge *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.queue_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.queue_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.queue_name, ndr_charset_length(r->in.queue_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQPurge(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQPurge *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.queue_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.queue_name)); + if (ndr_get_array_length(ndr, &r->in.queue_name) > ndr_get_array_size(ndr, &r->in.queue_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.queue_name), ndr_get_array_length(ndr, &r->in.queue_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.queue_name, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQPurge(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQPurge *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQPurge"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQPurge"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "queue_name", r->in.queue_name); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQPurge"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetCharDevQPurgeSelf(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQPurgeSelf *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.queue_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.queue_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.queue_name, ndr_charset_length(r->in.queue_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQPurgeSelf(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQPurgeSelf *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.queue_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.queue_name)); + if (ndr_get_array_length(ndr, &r->in.queue_name) > ndr_get_array_size(ndr, &r->in.queue_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.queue_name), ndr_get_array_length(ndr, &r->in.queue_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.queue_name, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetCharDevQPurgeSelf(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQPurgeSelf *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetCharDevQPurgeSelf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQPurgeSelf"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "queue_name", r->in.queue_name); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQPurgeSelf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetConnEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetConnEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.path)); + if (r->in.path) { + 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.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetConnInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetConnInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetConnEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetConnEnum *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_path; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_path_0; + TALLOC_CTX *_mem_save_info_ctr_0; + TALLOC_CTX *_mem_save_totalentries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->in.path); + } else { + r->in.path = NULL; + } + if (r->in.path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); + if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetConnInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + *r->out.info_ctr = *r->in.info_ctr; + NDR_PULL_ALLOC(ndr, r->out.totalentries); + ZERO_STRUCTP(r->out.totalentries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetConnInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.totalentries); + } + _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetConnEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetConnEnum *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetConnEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetConnEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "path", r->in.path); + ndr->depth++; + if (r->in.path) { + ndr_print_string(ndr, "path", r->in.path); + } + ndr->depth--; + ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetConnInfoCtr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth--; + ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetConnEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetConnInfoCtr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth--; + ndr_print_ptr(ndr, "totalentries", r->out.totalentries); + ndr->depth++; + ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetFileEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.path)); + if (r->in.path) { + 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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.user)); + if (r->in.user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetFileInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetFileInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetFileEnum *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_path; + uint32_t _ptr_user; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_path_0; + TALLOC_CTX *_mem_save_user_0; + TALLOC_CTX *_mem_save_info_ctr_0; + TALLOC_CTX *_mem_save_totalentries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); + if (_ptr_path) { + NDR_PULL_ALLOC(ndr, r->in.path); + } else { + r->in.path = NULL; + } + if (r->in.path) { + _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); + if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->in.user); + } else { + r->in.user = NULL; + } + if (r->in.user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); + if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetFileInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + *r->out.info_ctr = *r->in.info_ctr; + NDR_PULL_ALLOC(ndr, r->out.totalentries); + ZERO_STRUCTP(r->out.totalentries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetFileInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.totalentries); + } + _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileEnum *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetFileEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetFileEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "path", r->in.path); + ndr->depth++; + if (r->in.path) { + ndr_print_string(ndr, "path", r->in.path); + } + ndr->depth--; + ndr_print_ptr(ndr, "user", r->in.user); + ndr->depth++; + if (r->in.user) { + ndr_print_string(ndr, "user", r->in.user); + } + ndr->depth--; + ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetFileInfoCtr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth--; + ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetFileEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetFileInfoCtr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth--; + ndr_print_ptr(ndr, "totalentries", r->out.totalentries); + ndr->depth++; + ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetFileGetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.fid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetFileGetInfo *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.fid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetFileInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileGetInfo *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetFileGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetFileGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_uint32(ndr, "fid", r->in.fid); + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetFileGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_srvsvc_NetFileInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetFileClose(struct ndr_push *ndr, int flags, const struct srvsvc_NetFileClose *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.fid)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetFileClose(struct ndr_pull *ndr, int flags, struct srvsvc_NetFileClose *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.fid)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetFileClose(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileClose *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetFileClose"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetFileClose"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_uint32(ndr, "fid", r->in.fid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetFileClose"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetSessEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client)); + if (r->in.client) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client, ndr_charset_length(r->in.client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.user)); + if (r->in.user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetSessInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetSessInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetSessEnum *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_client; + uint32_t _ptr_user; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_client_0; + TALLOC_CTX *_mem_save_user_0; + TALLOC_CTX *_mem_save_info_ctr_0; + TALLOC_CTX *_mem_save_totalentries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); + if (_ptr_client) { + NDR_PULL_ALLOC(ndr, r->in.client); + } else { + r->in.client = NULL; + } + if (r->in.client) { + _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.client, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client)); + if (ndr_get_array_length(ndr, &r->in.client) > ndr_get_array_size(ndr, &r->in.client)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.client), ndr_get_array_length(ndr, &r->in.client)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.client), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client, ndr_get_array_length(ndr, &r->in.client), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->in.user); + } else { + r->in.user = NULL; + } + if (r->in.user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); + if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetSessInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + *r->out.info_ctr = *r->in.info_ctr; + NDR_PULL_ALLOC(ndr, r->out.totalentries); + ZERO_STRUCTP(r->out.totalentries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetSessInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.totalentries); + } + _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSessEnum *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSessEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetSessEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "client", r->in.client); + ndr->depth++; + if (r->in.client) { + ndr_print_string(ndr, "client", r->in.client); + } + ndr->depth--; + ndr_print_ptr(ndr, "user", r->in.user); + ndr->depth++; + if (r->in.user) { + ndr_print_string(ndr, "user", r->in.user); + } + ndr->depth--; + ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetSessInfoCtr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth--; + ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetSessEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetSessInfoCtr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth--; + ndr_print_ptr(ndr, "totalentries", r->out.totalentries); + ndr->depth++; + ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSessDel(struct ndr_push *ndr, int flags, const struct srvsvc_NetSessDel *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client)); + if (r->in.client) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client, ndr_charset_length(r->in.client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.user)); + if (r->in.user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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 (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSessDel(struct ndr_pull *ndr, int flags, struct srvsvc_NetSessDel *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_client; + uint32_t _ptr_user; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_client_0; + TALLOC_CTX *_mem_save_user_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); + if (_ptr_client) { + NDR_PULL_ALLOC(ndr, r->in.client); + } else { + r->in.client = NULL; + } + if (r->in.client) { + _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.client, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client)); + if (ndr_get_array_length(ndr, &r->in.client) > ndr_get_array_size(ndr, &r->in.client)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.client), ndr_get_array_length(ndr, &r->in.client)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.client), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client, ndr_get_array_length(ndr, &r->in.client), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->in.user); + } else { + r->in.user = NULL; + } + if (r->in.user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); + if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSessDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSessDel *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSessDel"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetSessDel"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "client", r->in.client); + ndr->depth++; + if (r->in.client) { + ndr_print_string(ndr, "client", r->in.client); + } + ndr->depth--; + ndr_print_ptr(ndr, "user", r->in.user); + ndr->depth++; + if (r->in.user) { + ndr_print_string(ndr, "user", r->in.user); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetSessDel"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareAdd(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareAdd *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + 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_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_error)); + if (r->in.parm_error) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_error)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_error)); + if (r->out.parm_error) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_error)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareAdd(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareAdd *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_parm_error; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_parm_error_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); + if (_ptr_parm_error) { + NDR_PULL_ALLOC(ndr, r->in.parm_error); + } else { + r->in.parm_error = NULL; + } + if (r->in.parm_error) { + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); + if (_ptr_parm_error) { + NDR_PULL_ALLOC(ndr, r->out.parm_error); + } else { + r->out.parm_error = NULL; + } + if (r->out.parm_error) { + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareAdd(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareAdd *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareAdd"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareAdd"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_srvsvc_NetShareInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_ptr(ndr, "parm_error", r->in.parm_error); + ndr->depth++; + if (r->in.parm_error) { + ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareAdd"); + ndr->depth++; + ndr_print_ptr(ndr, "parm_error", r->out.parm_error); + ndr->depth++; + if (r->out.parm_error) { + ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareEnumAll(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareEnumAll *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareEnumAll(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareEnumAll *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_ctr_0; + TALLOC_CTX *_mem_save_totalentries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + *r->out.info_ctr = *r->in.info_ctr; + NDR_PULL_ALLOC(ndr, r->out.totalentries); + ZERO_STRUCTP(r->out.totalentries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.totalentries); + } + _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareEnumAll(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareEnumAll *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareEnumAll"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareEnumAll"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetShareInfoCtr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth--; + ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareEnumAll"); + ndr->depth++; + ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetShareInfoCtr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth--; + ndr_print_ptr(ndr, "totalentries", r->out.totalentries); + ndr->depth++; + ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareGetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_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.share_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareGetInfo *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name)); + if (ndr_get_array_length(ndr, &r->in.share_name) > ndr_get_array_size(ndr, &r->in.share_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share_name), ndr_get_array_length(ndr, &r->in.share_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareGetInfo *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "share_name", r->in.share_name); + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_srvsvc_NetShareInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareSetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareSetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_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.share_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_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 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_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_error)); + if (r->in.parm_error) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_error)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_error)); + if (r->out.parm_error) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_error)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareSetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareSetInfo *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_parm_error; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_parm_error_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name)); + if (ndr_get_array_length(ndr, &r->in.share_name) > ndr_get_array_size(ndr, &r->in.share_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share_name), ndr_get_array_length(ndr, &r->in.share_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); + if (_ptr_parm_error) { + NDR_PULL_ALLOC(ndr, r->in.parm_error); + } else { + r->in.parm_error = NULL; + } + if (r->in.parm_error) { + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); + if (_ptr_parm_error) { + NDR_PULL_ALLOC(ndr, r->out.parm_error); + } else { + r->out.parm_error = NULL; + } + if (r->out.parm_error) { + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareSetInfo *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareSetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "share_name", r->in.share_name); + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_srvsvc_NetShareInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_ptr(ndr, "parm_error", r->in.parm_error); + ndr->depth++; + if (r->in.parm_error) { + ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "parm_error", r->out.parm_error); + ndr->depth++; + if (r->out.parm_error) { + ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareDel(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareDel *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_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.share_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareDel(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareDel *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name)); + if (ndr_get_array_length(ndr, &r->in.share_name) > ndr_get_array_size(ndr, &r->in.share_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share_name), ndr_get_array_length(ndr, &r->in.share_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDel *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareDel"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareDel"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "share_name", r->in.share_name); + ndr_print_uint32(ndr, "reserved", r->in.reserved); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareDel"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareDelSticky(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareDelSticky *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_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.share_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareDelSticky(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareDelSticky *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name)); + if (ndr_get_array_length(ndr, &r->in.share_name) > ndr_get_array_size(ndr, &r->in.share_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share_name), ndr_get_array_length(ndr, &r->in.share_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareDelSticky(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelSticky *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareDelSticky"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareDelSticky"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "share_name", r->in.share_name); + ndr_print_uint32(ndr, "reserved", r->in.reserved); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareDelSticky"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareCheck(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareCheck *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.device_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.device_name, CH_UTF16))); + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareCheck(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareCheck *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_type_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.device_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.device_name)); + if (ndr_get_array_length(ndr, &r->in.device_name) > ndr_get_array_size(ndr, &r->in.device_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.device_name), ndr_get_array_length(ndr, &r->in.device_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.device_name, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_ALLOC(ndr, r->out.type); + ZERO_STRUCTP(r->out.type); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.type); + } + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, r->out.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareCheck(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareCheck *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareCheck"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareCheck"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "device_name", r->in.device_name); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareCheck"); + ndr->depth++; + ndr_print_ptr(ndr, "type", r->out.type); + ndr->depth++; + ndr_print_srvsvc_ShareType(ndr, "type", *r->out.type); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetSrvGetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetSrvGetInfo *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSrvGetInfo *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetSrvGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetSrvGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_srvsvc_NetSrvInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSrvSetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetSrvSetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + 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_srvsvc_NetSrvInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_error)); + if (r->in.parm_error) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_error)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_error)); + if (r->out.parm_error) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_error)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSrvSetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetSrvSetInfo *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_parm_error; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_parm_error_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); + if (_ptr_parm_error) { + NDR_PULL_ALLOC(ndr, r->in.parm_error); + } else { + r->in.parm_error = NULL; + } + if (r->in.parm_error) { + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); + if (_ptr_parm_error) { + NDR_PULL_ALLOC(ndr, r->out.parm_error); + } else { + r->out.parm_error = NULL; + } + if (r->out.parm_error) { + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSrvSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSrvSetInfo *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSrvSetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetSrvSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_srvsvc_NetSrvInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_ptr(ndr, "parm_error", r->in.parm_error); + ndr->depth++; + if (r->in.parm_error) { + ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetSrvSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "parm_error", r->out.parm_error); + ndr->depth++; + if (r->out.parm_error) { + ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetDiskEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetDiskEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + 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)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + 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 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetDiskEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetDiskEnum *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_totalentries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetDiskInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.maxlen)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info); + *r->out.info = *r->in.info; + NDR_PULL_ALLOC(ndr, r->out.totalentries); + ZERO_STRUCTP(r->out.totalentries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetDiskInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.totalentries); + } + _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetDiskEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetDiskEnum *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetDiskEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetDiskEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_srvsvc_NetDiskInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_uint32(ndr, "maxlen", r->in.maxlen); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetDiskEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_srvsvc_NetDiskInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_ptr(ndr, "totalentries", r->out.totalentries); + ndr->depth++; + ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetServerStatisticsGet(struct ndr_push *ndr, int flags, const struct srvsvc_NetServerStatisticsGet *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service)); + if (r->in.service) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service, ndr_charset_length(r->in.service, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.options)); + } + if (flags & NDR_OUT) { + if (r->out.stats == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.stats)); + if (*r->out.stats) { + NDR_CHECK(ndr_push_srvsvc_Statistics(ndr, NDR_SCALARS, *r->out.stats)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetServerStatisticsGet(struct ndr_pull *ndr, int flags, struct srvsvc_NetServerStatisticsGet *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_service; + uint32_t _ptr_stats; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_service_0; + TALLOC_CTX *_mem_save_stats_0; + TALLOC_CTX *_mem_save_stats_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service)); + if (_ptr_service) { + NDR_PULL_ALLOC(ndr, r->in.service); + } else { + r->in.service = NULL; + } + if (r->in.service) { + _mem_save_service_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service)); + if (ndr_get_array_length(ndr, &r->in.service) > ndr_get_array_size(ndr, &r->in.service)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service), ndr_get_array_length(ndr, &r->in.service)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service, ndr_get_array_length(ndr, &r->in.service), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.options)); + NDR_PULL_ALLOC(ndr, r->out.stats); + ZERO_STRUCTP(r->out.stats); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.stats); + } + _mem_save_stats_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.stats, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_stats)); + if (_ptr_stats) { + NDR_PULL_ALLOC(ndr, *r->out.stats); + } else { + *r->out.stats = NULL; + } + if (*r->out.stats) { + _mem_save_stats_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.stats, 0); + NDR_CHECK(ndr_pull_srvsvc_Statistics(ndr, NDR_SCALARS, *r->out.stats)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stats_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stats_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetServerStatisticsGet(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerStatisticsGet *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetServerStatisticsGet"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetServerStatisticsGet"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "service", r->in.service); + ndr->depth++; + if (r->in.service) { + ndr_print_string(ndr, "service", r->in.service); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "options", r->in.options); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetServerStatisticsGet"); + ndr->depth++; + ndr_print_ptr(ndr, "stats", r->out.stats); + ndr->depth++; + ndr_print_ptr(ndr, "stats", *r->out.stats); + ndr->depth++; + if (*r->out.stats) { + ndr_print_srvsvc_Statistics(ndr, "stats", *r->out.stats); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportAdd(struct ndr_push *ndr, int flags, const struct srvsvc_NetTransportAdd *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.info, r->in.level)); + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportAdd(struct ndr_pull *ndr, int flags, struct srvsvc_NetTransportAdd *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportAdd(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportAdd *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetTransportAdd"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetTransportAdd"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_set_switch_value(ndr, &r->in.info, r->in.level); + ndr_print_srvsvc_NetTransportInfo(ndr, "info", &r->in.info); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetTransportAdd"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetTransportEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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.transports == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetTransportInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.transports)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.transports == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetTransportInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.transports)); + 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetTransportEnum *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_transports_0; + TALLOC_CTX *_mem_save_totalentries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.transports); + } + _mem_save_transports_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.transports, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.transports)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transports_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.transports); + *r->out.transports = *r->in.transports; + NDR_PULL_ALLOC(ndr, r->out.totalentries); + ZERO_STRUCTP(r->out.totalentries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.transports); + } + _mem_save_transports_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.transports, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.transports)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transports_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.totalentries); + } + _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportEnum *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetTransportEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetTransportEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "transports", r->in.transports); + ndr->depth++; + ndr_print_srvsvc_NetTransportInfoCtr(ndr, "transports", r->in.transports); + ndr->depth--; + ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetTransportEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "transports", r->out.transports); + ndr->depth++; + ndr_print_srvsvc_NetTransportInfoCtr(ndr, "transports", r->out.transports); + ndr->depth--; + ndr_print_ptr(ndr, "totalentries", r->out.totalentries); + ndr->depth++; + ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetTransportDel(struct ndr_push *ndr, int flags, const struct srvsvc_NetTransportDel *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.info0 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info0)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetTransportDel(struct ndr_pull *ndr, int flags, struct srvsvc_NetTransportDel *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info0_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info0); + } + _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetTransportDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportDel *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetTransportDel"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetTransportDel"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info0", r->in.info0); + ndr->depth++; + ndr_print_srvsvc_NetTransportInfo0(ndr, "info0", r->in.info0); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetTransportDel"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetRemoteTOD(struct ndr_push *ndr, int flags, const struct srvsvc_NetRemoteTOD *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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 (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_srvsvc_NetRemoteTODInfo(ndr, NDR_SCALARS, *r->out.info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetRemoteTOD(struct ndr_pull *ndr, int flags, struct srvsvc_NetRemoteTOD *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_srvsvc_NetRemoteTODInfo(ndr, NDR_SCALARS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetRemoteTOD(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetRemoteTOD *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetRemoteTOD"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetRemoteTOD"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetRemoteTOD"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_srvsvc_NetRemoteTODInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSetServiceBits(struct ndr_push *ndr, int flags, const struct srvsvc_NetSetServiceBits *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.transport)); + if (r->in.transport) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.transport, ndr_charset_length(r->in.transport, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.servicebits)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.updateimmediately)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSetServiceBits(struct ndr_pull *ndr, int flags, struct srvsvc_NetSetServiceBits *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_transport; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_transport_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport)); + if (_ptr_transport) { + NDR_PULL_ALLOC(ndr, r->in.transport); + } else { + r->in.transport = NULL; + } + if (r->in.transport) { + _mem_save_transport_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.transport, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.transport)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.transport)); + if (ndr_get_array_length(ndr, &r->in.transport) > ndr_get_array_size(ndr, &r->in.transport)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.transport), ndr_get_array_length(ndr, &r->in.transport)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.transport), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.transport, ndr_get_array_length(ndr, &r->in.transport), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.servicebits)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.updateimmediately)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSetServiceBits(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSetServiceBits *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSetServiceBits"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetSetServiceBits"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "transport", r->in.transport); + ndr->depth++; + if (r->in.transport) { + ndr_print_string(ndr, "transport", r->in.transport); + } + ndr->depth--; + ndr_print_uint32(ndr, "servicebits", r->in.servicebits); + ndr_print_uint32(ndr, "updateimmediately", r->in.updateimmediately); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetSetServiceBits"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetPathType(struct ndr_push *ndr, int flags, const struct srvsvc_NetPathType *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.pathflags)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetPathType(struct ndr_pull *ndr, int flags, struct srvsvc_NetPathType *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_pathtype_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); + if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.pathflags)); + NDR_PULL_ALLOC(ndr, r->out.pathtype); + ZERO_STRUCTP(r->out.pathtype); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.pathtype); + } + _mem_save_pathtype_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.pathtype, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pathtype)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pathtype_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetPathType(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathType *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetPathType"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetPathType"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "path", r->in.path); + ndr_print_uint32(ndr, "pathflags", r->in.pathflags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetPathType"); + ndr->depth++; + ndr_print_ptr(ndr, "pathtype", r->out.pathtype); + ndr->depth++; + ndr_print_uint32(ndr, "pathtype", *r->out.pathtype); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetPathCanonicalize(struct ndr_push *ndr, int flags, const struct srvsvc_NetPathCanonicalize *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.maxbuf)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.prefix, CH_UTF16))); + 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetPathCanonicalize(struct ndr_pull *ndr, int flags, struct srvsvc_NetPathCanonicalize *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_pathtype_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); + if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.maxbuf)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.prefix)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.prefix)); + if (ndr_get_array_length(ndr, &r->in.prefix) > ndr_get_array_size(ndr, &r->in.prefix)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.prefix), ndr_get_array_length(ndr, &r->in.prefix)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.prefix), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.prefix, ndr_get_array_length(ndr, &r->in.prefix), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.pathtype); + } + _mem_save_pathtype_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.pathtype, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.pathtype)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pathtype_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.pathflags)); + NDR_PULL_ALLOC(ndr, r->out.pathtype); + *r->out.pathtype = *r->in.pathtype; + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.can_path)); + NDR_PULL_ALLOC_N(ndr, r->out.can_path, ndr_get_array_size(ndr, &r->out.can_path)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.can_path, ndr_get_array_size(ndr, &r->out.can_path))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.pathtype); + } + _mem_save_pathtype_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.pathtype, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pathtype)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pathtype_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.can_path) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.can_path, r->in.maxbuf)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetPathCanonicalize(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathCanonicalize *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetPathCanonicalize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetPathCanonicalize"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "path", r->in.path); + ndr_print_uint32(ndr, "maxbuf", r->in.maxbuf); + ndr_print_string(ndr, "prefix", r->in.prefix); + ndr_print_ptr(ndr, "pathtype", r->in.pathtype); + ndr->depth++; + ndr_print_uint32(ndr, "pathtype", *r->in.pathtype); + ndr->depth--; + ndr_print_uint32(ndr, "pathflags", r->in.pathflags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetPathCanonicalize"); + ndr->depth++; + ndr_print_array_uint8(ndr, "can_path", r->out.can_path, r->in.maxbuf); + ndr_print_ptr(ndr, "pathtype", r->out.pathtype); + ndr->depth++; + ndr_print_uint32(ndr, "pathtype", *r->out.pathtype); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetPathCompare(struct ndr_push *ndr, int flags, const struct srvsvc_NetPathCompare *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path1, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path1, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.path1, ndr_charset_length(r->in.path1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path2, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path2, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.path2, ndr_charset_length(r->in.path2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetPathCompare(struct ndr_pull *ndr, int flags, struct srvsvc_NetPathCompare *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path1)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path1)); + if (ndr_get_array_length(ndr, &r->in.path1) > ndr_get_array_size(ndr, &r->in.path1)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path1), ndr_get_array_length(ndr, &r->in.path1)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path1), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path1, ndr_get_array_length(ndr, &r->in.path1), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path2)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path2)); + if (ndr_get_array_length(ndr, &r->in.path2) > ndr_get_array_size(ndr, &r->in.path2)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path2), ndr_get_array_length(ndr, &r->in.path2)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path2), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path2, ndr_get_array_length(ndr, &r->in.path2), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.pathtype)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.pathflags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetPathCompare(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathCompare *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetPathCompare"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetPathCompare"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "path1", r->in.path1); + ndr_print_string(ndr, "path2", r->in.path2); + ndr_print_uint32(ndr, "pathtype", r->in.pathtype); + ndr_print_uint32(ndr, "pathflags", r->in.pathflags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetPathCompare"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetNameValidate(struct ndr_push *ndr, int flags, const struct srvsvc_NetNameValidate *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.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.name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.name_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetNameValidate(struct ndr_pull *ndr, int flags, struct srvsvc_NetNameValidate *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name)); + if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name), ndr_get_array_length(ndr, &r->in.name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.name_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetNameValidate(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetNameValidate *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetNameValidate"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetNameValidate"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "name", r->in.name); + ndr_print_uint32(ndr, "name_type", r->in.name_type); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetNameValidate"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRPRNAMECANONICALIZE(struct ndr_push *ndr, int flags, const struct srvsvc_NETRPRNAMECANONICALIZE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRPRNAMECANONICALIZE(struct ndr_pull *ndr, int flags, struct srvsvc_NETRPRNAMECANONICALIZE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRPRNAMECANONICALIZE(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRPRNAMECANONICALIZE *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRPRNAMECANONICALIZE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRPRNAMECANONICALIZE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRPRNAMECANONICALIZE"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetPRNameCompare(struct ndr_push *ndr, int flags, const struct srvsvc_NetPRNameCompare *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name1, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name1, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name1, ndr_charset_length(r->in.name1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name2, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name2, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name2, ndr_charset_length(r->in.name2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.name_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetPRNameCompare(struct ndr_pull *ndr, int flags, struct srvsvc_NetPRNameCompare *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name1)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name1)); + if (ndr_get_array_length(ndr, &r->in.name1) > ndr_get_array_size(ndr, &r->in.name1)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name1), ndr_get_array_length(ndr, &r->in.name1)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name1), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name1, ndr_get_array_length(ndr, &r->in.name1), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name2)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name2)); + if (ndr_get_array_length(ndr, &r->in.name2) > ndr_get_array_size(ndr, &r->in.name2)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name2), ndr_get_array_length(ndr, &r->in.name2)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name2), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name2, ndr_get_array_length(ndr, &r->in.name2), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.name_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetPRNameCompare(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPRNameCompare *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetPRNameCompare"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetPRNameCompare"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "name1", r->in.name1); + ndr_print_string(ndr, "name2", r->in.name2); + ndr_print_uint32(ndr, "name_type", r->in.name_type); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetPRNameCompare"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info_ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareEnum *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_info_ctr_0; + TALLOC_CTX *_mem_save_totalentries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + *r->out.info_ctr = *r->in.info_ctr; + NDR_PULL_ALLOC(ndr, r->out.totalentries); + ZERO_STRUCTP(r->out.totalentries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_ctr); + } + _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.totalentries); + } + _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareEnum *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetShareInfoCtr(ndr, "info_ctr", r->in.info_ctr); + ndr->depth--; + ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth++; + ndr_print_srvsvc_NetShareInfoCtr(ndr, "info_ctr", r->out.info_ctr); + ndr->depth--; + ndr_print_ptr(ndr, "totalentries", r->out.totalentries); + ndr->depth++; + ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareDelStart(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareDelStart *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share, ndr_charset_length(r->in.share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.hnd)); + if (r->out.hnd) { + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.hnd)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareDelStart(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareDelStart *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_hnd; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_hnd_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share)); + if (ndr_get_array_length(ndr, &r->in.share) > ndr_get_array_size(ndr, &r->in.share)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share), ndr_get_array_length(ndr, &r->in.share)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hnd)); + if (_ptr_hnd) { + NDR_PULL_ALLOC(ndr, r->out.hnd); + } else { + r->out.hnd = NULL; + } + if (r->out.hnd) { + _mem_save_hnd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.hnd, 0); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.hnd)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hnd_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareDelStart(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelStart *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareDelStart"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareDelStart"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_string(ndr, "share", r->in.share); + ndr_print_uint32(ndr, "reserved", r->in.reserved); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareDelStart"); + ndr->depth++; + ndr_print_ptr(ndr, "hnd", r->out.hnd); + ndr->depth++; + if (r->out.hnd) { + ndr_print_policy_handle(ndr, "hnd", r->out.hnd); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetShareDelCommit(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareDelCommit *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hnd)); + if (r->in.hnd) { + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.hnd)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.hnd)); + if (r->out.hnd) { + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.hnd)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetShareDelCommit(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareDelCommit *r) +{ + uint32_t _ptr_hnd; + TALLOC_CTX *_mem_save_hnd_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hnd)); + if (_ptr_hnd) { + NDR_PULL_ALLOC(ndr, r->in.hnd); + } else { + r->in.hnd = NULL; + } + if (r->in.hnd) { + _mem_save_hnd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.hnd, 0); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.hnd)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hnd_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hnd)); + if (_ptr_hnd) { + NDR_PULL_ALLOC(ndr, r->out.hnd); + } else { + r->out.hnd = NULL; + } + if (r->out.hnd) { + _mem_save_hnd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.hnd, 0); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.hnd)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hnd_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetShareDelCommit(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelCommit *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareDelCommit"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetShareDelCommit"); + ndr->depth++; + ndr_print_ptr(ndr, "hnd", r->in.hnd); + ndr->depth++; + if (r->in.hnd) { + ndr_print_policy_handle(ndr, "hnd", r->in.hnd); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetShareDelCommit"); + ndr->depth++; + ndr_print_ptr(ndr, "hnd", r->out.hnd); + ndr->depth++; + if (r->out.hnd) { + ndr_print_policy_handle(ndr, "hnd", r->out.hnd); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetGetFileSecurity(struct ndr_push *ndr, int flags, const struct srvsvc_NetGetFileSecurity *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.share)); + if (r->in.share) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share, ndr_charset_length(r->in.share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.file, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.file, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.file, ndr_charset_length(r->in.file, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.securityinformation)); + } + if (flags & NDR_OUT) { + if (r->out.sd_buf == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sd_buf)); + if (*r->out.sd_buf) { + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sd_buf)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetGetFileSecurity(struct ndr_pull *ndr, int flags, struct srvsvc_NetGetFileSecurity *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_share; + uint32_t _ptr_sd_buf; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_share_0; + TALLOC_CTX *_mem_save_sd_buf_0; + TALLOC_CTX *_mem_save_sd_buf_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); + if (_ptr_share) { + NDR_PULL_ALLOC(ndr, r->in.share); + } else { + r->in.share = NULL; + } + if (r->in.share) { + _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.share, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share)); + if (ndr_get_array_length(ndr, &r->in.share) > ndr_get_array_size(ndr, &r->in.share)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share), ndr_get_array_length(ndr, &r->in.share)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.file)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.file)); + if (ndr_get_array_length(ndr, &r->in.file) > ndr_get_array_size(ndr, &r->in.file)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.file), ndr_get_array_length(ndr, &r->in.file)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.file), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.file, ndr_get_array_length(ndr, &r->in.file), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.securityinformation)); + NDR_PULL_ALLOC(ndr, r->out.sd_buf); + ZERO_STRUCTP(r->out.sd_buf); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sd_buf); + } + _mem_save_sd_buf_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sd_buf, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd_buf)); + if (_ptr_sd_buf) { + NDR_PULL_ALLOC(ndr, *r->out.sd_buf); + } else { + *r->out.sd_buf = NULL; + } + if (*r->out.sd_buf) { + _mem_save_sd_buf_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sd_buf, 0); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sd_buf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_buf_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_buf_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetGetFileSecurity(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetGetFileSecurity *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetGetFileSecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetGetFileSecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "share", r->in.share); + ndr->depth++; + if (r->in.share) { + ndr_print_string(ndr, "share", r->in.share); + } + ndr->depth--; + ndr_print_string(ndr, "file", r->in.file); + ndr_print_security_secinfo(ndr, "securityinformation", r->in.securityinformation); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetGetFileSecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "sd_buf", r->out.sd_buf); + ndr->depth++; + ndr_print_ptr(ndr, "sd_buf", *r->out.sd_buf); + ndr->depth++; + if (*r->out.sd_buf) { + ndr_print_sec_desc_buf(ndr, "sd_buf", *r->out.sd_buf); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetSetFileSecurity(struct ndr_push *ndr, int flags, const struct srvsvc_NetSetFileSecurity *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.share)); + if (r->in.share) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share, ndr_charset_length(r->in.share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.file, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.file, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.file, ndr_charset_length(r->in.file, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.securityinformation)); + if (r->in.sd_buf == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd_buf)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetSetFileSecurity(struct ndr_pull *ndr, int flags, struct srvsvc_NetSetFileSecurity *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_share; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_share_0; + TALLOC_CTX *_mem_save_sd_buf_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); + if (_ptr_share) { + NDR_PULL_ALLOC(ndr, r->in.share); + } else { + r->in.share = NULL; + } + if (r->in.share) { + _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.share, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share)); + if (ndr_get_array_length(ndr, &r->in.share) > ndr_get_array_size(ndr, &r->in.share)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share), ndr_get_array_length(ndr, &r->in.share)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.file)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.file)); + if (ndr_get_array_length(ndr, &r->in.file) > ndr_get_array_size(ndr, &r->in.file)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.file), ndr_get_array_length(ndr, &r->in.file)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.file), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.file, ndr_get_array_length(ndr, &r->in.file), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.securityinformation)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sd_buf); + } + _mem_save_sd_buf_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sd_buf, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd_buf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_buf_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetSetFileSecurity(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSetFileSecurity *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetSetFileSecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetSetFileSecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "share", r->in.share); + ndr->depth++; + if (r->in.share) { + ndr_print_string(ndr, "share", r->in.share); + } + ndr->depth--; + ndr_print_string(ndr, "file", r->in.file); + ndr_print_security_secinfo(ndr, "securityinformation", r->in.securityinformation); + ndr_print_ptr(ndr, "sd_buf", r->in.sd_buf); + ndr->depth++; + ndr_print_sec_desc_buf(ndr, "sd_buf", r->in.sd_buf); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetSetFileSecurity"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetServerTransportAddEx(struct ndr_push *ndr, int flags, const struct srvsvc_NetServerTransportAddEx *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.info, r->in.level)); + NDR_CHECK(ndr_push_srvsvc_NetTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetServerTransportAddEx(struct ndr_pull *ndr, int flags, struct srvsvc_NetServerTransportAddEx *r) +{ + uint32_t _ptr_server_unc; + TALLOC_CTX *_mem_save_server_unc_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetServerTransportAddEx(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerTransportAddEx *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetServerTransportAddEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetServerTransportAddEx"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_set_switch_value(ndr, &r->in.info, r->in.level); + ndr_print_srvsvc_NetTransportInfo(ndr, "info", &r->in.info); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetServerTransportAddEx"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NetServerSetServiceBitsEx(struct ndr_push *ndr, int flags, const struct srvsvc_NetServerSetServiceBitsEx *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); + if (r->in.server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.emulated_server_unc)); + if (r->in.emulated_server_unc) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.emulated_server_unc, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.emulated_server_unc, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.emulated_server_unc, ndr_charset_length(r->in.emulated_server_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.transport)); + if (r->in.transport) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.transport, ndr_charset_length(r->in.transport, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.servicebitsofinterest)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.servicebits)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.updateimmediately)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NetServerSetServiceBitsEx(struct ndr_pull *ndr, int flags, struct srvsvc_NetServerSetServiceBitsEx *r) +{ + uint32_t _ptr_server_unc; + uint32_t _ptr_emulated_server_unc; + uint32_t _ptr_transport; + TALLOC_CTX *_mem_save_server_unc_0; + TALLOC_CTX *_mem_save_emulated_server_unc_0; + TALLOC_CTX *_mem_save_transport_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); + if (_ptr_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.server_unc); + } else { + r->in.server_unc = NULL; + } + if (r->in.server_unc) { + _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); + if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_emulated_server_unc)); + if (_ptr_emulated_server_unc) { + NDR_PULL_ALLOC(ndr, r->in.emulated_server_unc); + } else { + r->in.emulated_server_unc = NULL; + } + if (r->in.emulated_server_unc) { + _mem_save_emulated_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.emulated_server_unc, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.emulated_server_unc)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.emulated_server_unc)); + if (ndr_get_array_length(ndr, &r->in.emulated_server_unc) > ndr_get_array_size(ndr, &r->in.emulated_server_unc)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.emulated_server_unc), ndr_get_array_length(ndr, &r->in.emulated_server_unc)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.emulated_server_unc), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.emulated_server_unc, ndr_get_array_length(ndr, &r->in.emulated_server_unc), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_emulated_server_unc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport)); + if (_ptr_transport) { + NDR_PULL_ALLOC(ndr, r->in.transport); + } else { + r->in.transport = NULL; + } + if (r->in.transport) { + _mem_save_transport_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.transport, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.transport)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.transport)); + if (ndr_get_array_length(ndr, &r->in.transport) > ndr_get_array_size(ndr, &r->in.transport)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.transport), ndr_get_array_length(ndr, &r->in.transport)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.transport), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.transport, ndr_get_array_length(ndr, &r->in.transport), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.servicebitsofinterest)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.servicebits)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.updateimmediately)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NetServerSetServiceBitsEx(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerSetServiceBitsEx *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetServerSetServiceBitsEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NetServerSetServiceBitsEx"); + ndr->depth++; + ndr_print_ptr(ndr, "server_unc", r->in.server_unc); + ndr->depth++; + if (r->in.server_unc) { + ndr_print_string(ndr, "server_unc", r->in.server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "emulated_server_unc", r->in.emulated_server_unc); + ndr->depth++; + if (r->in.emulated_server_unc) { + ndr_print_string(ndr, "emulated_server_unc", r->in.emulated_server_unc); + } + ndr->depth--; + ndr_print_ptr(ndr, "transport", r->in.transport); + ndr->depth++; + if (r->in.transport) { + ndr_print_string(ndr, "transport", r->in.transport); + } + ndr->depth--; + ndr_print_uint32(ndr, "servicebitsofinterest", r->in.servicebitsofinterest); + ndr_print_uint32(ndr, "servicebits", r->in.servicebits); + ndr_print_uint32(ndr, "updateimmediately", r->in.updateimmediately); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NetServerSetServiceBitsEx"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSGETVERSION(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSGETVERSION *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSGETVERSION(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSGETVERSION *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSGETVERSION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSGETVERSION *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSGETVERSION"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSGETVERSION"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSGETVERSION"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSCREATELOCALPARTITION(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSCREATELOCALPARTITION *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSCREATELOCALPARTITION(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSCREATELOCALPARTITION *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSCREATELOCALPARTITION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSCREATELOCALPARTITION *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSCREATELOCALPARTITION"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSCREATELOCALPARTITION"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSCREATELOCALPARTITION"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSDELETELOCALPARTITION(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSDELETELOCALPARTITION *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSDELETELOCALPARTITION(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSDELETELOCALPARTITION *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSDELETELOCALPARTITION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSDELETELOCALPARTITION *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSDELETELOCALPARTITION"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSDELETELOCALPARTITION"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSDELETELOCALPARTITION"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSSETLOCALVOLUMESTATE"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSSETLOCALVOLUMESTATE"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSSETLOCALVOLUMESTATE"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSSETSERVERINFO(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSSETSERVERINFO *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSSETSERVERINFO(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSSETSERVERINFO *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSSETSERVERINFO(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSSETSERVERINFO *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSSETSERVERINFO"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSSETSERVERINFO"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSSETSERVERINFO"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSCREATEEXITPOINT(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSCREATEEXITPOINT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSCREATEEXITPOINT(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSCREATEEXITPOINT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSCREATEEXITPOINT(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSCREATEEXITPOINT *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSCREATEEXITPOINT"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSCREATEEXITPOINT"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSCREATEEXITPOINT"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSDELETEEXITPOINT(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSDELETEEXITPOINT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSDELETEEXITPOINT(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSDELETEEXITPOINT *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSDELETEEXITPOINT(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSDELETEEXITPOINT *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSDELETEEXITPOINT"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSDELETEEXITPOINT"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSDELETEEXITPOINT"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSMODIFYPREFIX(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSMODIFYPREFIX *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSMODIFYPREFIX(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSMODIFYPREFIX *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSMODIFYPREFIX(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSMODIFYPREFIX *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSMODIFYPREFIX"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSMODIFYPREFIX"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSMODIFYPREFIX"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSFIXLOCALVOLUME(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSFIXLOCALVOLUME *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSFIXLOCALVOLUME(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSFIXLOCALVOLUME *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSFIXLOCALVOLUME(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSFIXLOCALVOLUME *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSFIXLOCALVOLUME"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSFIXLOCALVOLUME"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSFIXLOCALVOLUME"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRDFSMANAGERREPORTSITEINFO"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRDFSMANAGERREPORTSITEINFO"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRDFSMANAGERREPORTSITEINFO"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_srvsvc_NETRSERVERTRANSPORTDELEX(struct ndr_push *ndr, int flags, const struct srvsvc_NETRSERVERTRANSPORTDELEX *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_srvsvc_NETRSERVERTRANSPORTDELEX(struct ndr_pull *ndr, int flags, struct srvsvc_NETRSERVERTRANSPORTDELEX *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_srvsvc_NETRSERVERTRANSPORTDELEX(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRSERVERTRANSPORTDELEX *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NETRSERVERTRANSPORTDELEX"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "srvsvc_NETRSERVERTRANSPORTDELEX"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "srvsvc_NETRSERVERTRANSPORTDELEX"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call srvsvc_calls[] = { + { + "srvsvc_NetCharDevEnum", + sizeof(struct srvsvc_NetCharDevEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevEnum, + (ndr_print_function_t) ndr_print_srvsvc_NetCharDevEnum, + false, + }, + { + "srvsvc_NetCharDevGetInfo", + sizeof(struct srvsvc_NetCharDevGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevGetInfo, + (ndr_print_function_t) ndr_print_srvsvc_NetCharDevGetInfo, + false, + }, + { + "srvsvc_NetCharDevControl", + sizeof(struct srvsvc_NetCharDevControl), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevControl, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevControl, + (ndr_print_function_t) ndr_print_srvsvc_NetCharDevControl, + false, + }, + { + "srvsvc_NetCharDevQEnum", + sizeof(struct srvsvc_NetCharDevQEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQEnum, + (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQEnum, + false, + }, + { + "srvsvc_NetCharDevQGetInfo", + sizeof(struct srvsvc_NetCharDevQGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQGetInfo, + (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQGetInfo, + false, + }, + { + "srvsvc_NetCharDevQSetInfo", + sizeof(struct srvsvc_NetCharDevQSetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQSetInfo, + (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQSetInfo, + false, + }, + { + "srvsvc_NetCharDevQPurge", + sizeof(struct srvsvc_NetCharDevQPurge), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQPurge, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQPurge, + (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQPurge, + false, + }, + { + "srvsvc_NetCharDevQPurgeSelf", + sizeof(struct srvsvc_NetCharDevQPurgeSelf), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQPurgeSelf, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQPurgeSelf, + (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQPurgeSelf, + false, + }, + { + "srvsvc_NetConnEnum", + sizeof(struct srvsvc_NetConnEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetConnEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetConnEnum, + (ndr_print_function_t) ndr_print_srvsvc_NetConnEnum, + false, + }, + { + "srvsvc_NetFileEnum", + sizeof(struct srvsvc_NetFileEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetFileEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetFileEnum, + (ndr_print_function_t) ndr_print_srvsvc_NetFileEnum, + false, + }, + { + "srvsvc_NetFileGetInfo", + sizeof(struct srvsvc_NetFileGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetFileGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetFileGetInfo, + (ndr_print_function_t) ndr_print_srvsvc_NetFileGetInfo, + false, + }, + { + "srvsvc_NetFileClose", + sizeof(struct srvsvc_NetFileClose), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetFileClose, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetFileClose, + (ndr_print_function_t) ndr_print_srvsvc_NetFileClose, + false, + }, + { + "srvsvc_NetSessEnum", + sizeof(struct srvsvc_NetSessEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSessEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSessEnum, + (ndr_print_function_t) ndr_print_srvsvc_NetSessEnum, + false, + }, + { + "srvsvc_NetSessDel", + sizeof(struct srvsvc_NetSessDel), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSessDel, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSessDel, + (ndr_print_function_t) ndr_print_srvsvc_NetSessDel, + false, + }, + { + "srvsvc_NetShareAdd", + sizeof(struct srvsvc_NetShareAdd), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareAdd, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareAdd, + (ndr_print_function_t) ndr_print_srvsvc_NetShareAdd, + false, + }, + { + "srvsvc_NetShareEnumAll", + sizeof(struct srvsvc_NetShareEnumAll), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareEnumAll, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareEnumAll, + (ndr_print_function_t) ndr_print_srvsvc_NetShareEnumAll, + false, + }, + { + "srvsvc_NetShareGetInfo", + sizeof(struct srvsvc_NetShareGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareGetInfo, + (ndr_print_function_t) ndr_print_srvsvc_NetShareGetInfo, + false, + }, + { + "srvsvc_NetShareSetInfo", + sizeof(struct srvsvc_NetShareSetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareSetInfo, + (ndr_print_function_t) ndr_print_srvsvc_NetShareSetInfo, + false, + }, + { + "srvsvc_NetShareDel", + sizeof(struct srvsvc_NetShareDel), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDel, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDel, + (ndr_print_function_t) ndr_print_srvsvc_NetShareDel, + false, + }, + { + "srvsvc_NetShareDelSticky", + sizeof(struct srvsvc_NetShareDelSticky), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDelSticky, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDelSticky, + (ndr_print_function_t) ndr_print_srvsvc_NetShareDelSticky, + false, + }, + { + "srvsvc_NetShareCheck", + sizeof(struct srvsvc_NetShareCheck), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareCheck, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareCheck, + (ndr_print_function_t) ndr_print_srvsvc_NetShareCheck, + false, + }, + { + "srvsvc_NetSrvGetInfo", + sizeof(struct srvsvc_NetSrvGetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSrvGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSrvGetInfo, + (ndr_print_function_t) ndr_print_srvsvc_NetSrvGetInfo, + false, + }, + { + "srvsvc_NetSrvSetInfo", + sizeof(struct srvsvc_NetSrvSetInfo), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSrvSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSrvSetInfo, + (ndr_print_function_t) ndr_print_srvsvc_NetSrvSetInfo, + false, + }, + { + "srvsvc_NetDiskEnum", + sizeof(struct srvsvc_NetDiskEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetDiskEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetDiskEnum, + (ndr_print_function_t) ndr_print_srvsvc_NetDiskEnum, + false, + }, + { + "srvsvc_NetServerStatisticsGet", + sizeof(struct srvsvc_NetServerStatisticsGet), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetServerStatisticsGet, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetServerStatisticsGet, + (ndr_print_function_t) ndr_print_srvsvc_NetServerStatisticsGet, + false, + }, + { + "srvsvc_NetTransportAdd", + sizeof(struct srvsvc_NetTransportAdd), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetTransportAdd, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetTransportAdd, + (ndr_print_function_t) ndr_print_srvsvc_NetTransportAdd, + false, + }, + { + "srvsvc_NetTransportEnum", + sizeof(struct srvsvc_NetTransportEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetTransportEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetTransportEnum, + (ndr_print_function_t) ndr_print_srvsvc_NetTransportEnum, + false, + }, + { + "srvsvc_NetTransportDel", + sizeof(struct srvsvc_NetTransportDel), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetTransportDel, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetTransportDel, + (ndr_print_function_t) ndr_print_srvsvc_NetTransportDel, + false, + }, + { + "srvsvc_NetRemoteTOD", + sizeof(struct srvsvc_NetRemoteTOD), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetRemoteTOD, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetRemoteTOD, + (ndr_print_function_t) ndr_print_srvsvc_NetRemoteTOD, + false, + }, + { + "srvsvc_NetSetServiceBits", + sizeof(struct srvsvc_NetSetServiceBits), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSetServiceBits, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSetServiceBits, + (ndr_print_function_t) ndr_print_srvsvc_NetSetServiceBits, + false, + }, + { + "srvsvc_NetPathType", + sizeof(struct srvsvc_NetPathType), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPathType, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPathType, + (ndr_print_function_t) ndr_print_srvsvc_NetPathType, + false, + }, + { + "srvsvc_NetPathCanonicalize", + sizeof(struct srvsvc_NetPathCanonicalize), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPathCanonicalize, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPathCanonicalize, + (ndr_print_function_t) ndr_print_srvsvc_NetPathCanonicalize, + false, + }, + { + "srvsvc_NetPathCompare", + sizeof(struct srvsvc_NetPathCompare), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPathCompare, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPathCompare, + (ndr_print_function_t) ndr_print_srvsvc_NetPathCompare, + false, + }, + { + "srvsvc_NetNameValidate", + sizeof(struct srvsvc_NetNameValidate), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetNameValidate, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetNameValidate, + (ndr_print_function_t) ndr_print_srvsvc_NetNameValidate, + false, + }, + { + "srvsvc_NETRPRNAMECANONICALIZE", + sizeof(struct srvsvc_NETRPRNAMECANONICALIZE), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRPRNAMECANONICALIZE, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRPRNAMECANONICALIZE, + (ndr_print_function_t) ndr_print_srvsvc_NETRPRNAMECANONICALIZE, + false, + }, + { + "srvsvc_NetPRNameCompare", + sizeof(struct srvsvc_NetPRNameCompare), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPRNameCompare, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPRNameCompare, + (ndr_print_function_t) ndr_print_srvsvc_NetPRNameCompare, + false, + }, + { + "srvsvc_NetShareEnum", + sizeof(struct srvsvc_NetShareEnum), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareEnum, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareEnum, + (ndr_print_function_t) ndr_print_srvsvc_NetShareEnum, + false, + }, + { + "srvsvc_NetShareDelStart", + sizeof(struct srvsvc_NetShareDelStart), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDelStart, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDelStart, + (ndr_print_function_t) ndr_print_srvsvc_NetShareDelStart, + false, + }, + { + "srvsvc_NetShareDelCommit", + sizeof(struct srvsvc_NetShareDelCommit), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDelCommit, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDelCommit, + (ndr_print_function_t) ndr_print_srvsvc_NetShareDelCommit, + false, + }, + { + "srvsvc_NetGetFileSecurity", + sizeof(struct srvsvc_NetGetFileSecurity), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetGetFileSecurity, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetGetFileSecurity, + (ndr_print_function_t) ndr_print_srvsvc_NetGetFileSecurity, + false, + }, + { + "srvsvc_NetSetFileSecurity", + sizeof(struct srvsvc_NetSetFileSecurity), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSetFileSecurity, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSetFileSecurity, + (ndr_print_function_t) ndr_print_srvsvc_NetSetFileSecurity, + false, + }, + { + "srvsvc_NetServerTransportAddEx", + sizeof(struct srvsvc_NetServerTransportAddEx), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetServerTransportAddEx, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetServerTransportAddEx, + (ndr_print_function_t) ndr_print_srvsvc_NetServerTransportAddEx, + false, + }, + { + "srvsvc_NetServerSetServiceBitsEx", + sizeof(struct srvsvc_NetServerSetServiceBitsEx), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NetServerSetServiceBitsEx, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetServerSetServiceBitsEx, + (ndr_print_function_t) ndr_print_srvsvc_NetServerSetServiceBitsEx, + false, + }, + { + "srvsvc_NETRDFSGETVERSION", + sizeof(struct srvsvc_NETRDFSGETVERSION), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSGETVERSION, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSGETVERSION, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSGETVERSION, + false, + }, + { + "srvsvc_NETRDFSCREATELOCALPARTITION", + sizeof(struct srvsvc_NETRDFSCREATELOCALPARTITION), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSCREATELOCALPARTITION, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSCREATELOCALPARTITION, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSCREATELOCALPARTITION, + false, + }, + { + "srvsvc_NETRDFSDELETELOCALPARTITION", + sizeof(struct srvsvc_NETRDFSDELETELOCALPARTITION), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSDELETELOCALPARTITION, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSDELETELOCALPARTITION, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSDELETELOCALPARTITION, + false, + }, + { + "srvsvc_NETRDFSSETLOCALVOLUMESTATE", + sizeof(struct srvsvc_NETRDFSSETLOCALVOLUMESTATE), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSSETLOCALVOLUMESTATE, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSSETLOCALVOLUMESTATE, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSSETLOCALVOLUMESTATE, + false, + }, + { + "srvsvc_NETRDFSSETSERVERINFO", + sizeof(struct srvsvc_NETRDFSSETSERVERINFO), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSSETSERVERINFO, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSSETSERVERINFO, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSSETSERVERINFO, + false, + }, + { + "srvsvc_NETRDFSCREATEEXITPOINT", + sizeof(struct srvsvc_NETRDFSCREATEEXITPOINT), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSCREATEEXITPOINT, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSCREATEEXITPOINT, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSCREATEEXITPOINT, + false, + }, + { + "srvsvc_NETRDFSDELETEEXITPOINT", + sizeof(struct srvsvc_NETRDFSDELETEEXITPOINT), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSDELETEEXITPOINT, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSDELETEEXITPOINT, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSDELETEEXITPOINT, + false, + }, + { + "srvsvc_NETRDFSMODIFYPREFIX", + sizeof(struct srvsvc_NETRDFSMODIFYPREFIX), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSMODIFYPREFIX, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSMODIFYPREFIX, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSMODIFYPREFIX, + false, + }, + { + "srvsvc_NETRDFSFIXLOCALVOLUME", + sizeof(struct srvsvc_NETRDFSFIXLOCALVOLUME), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSFIXLOCALVOLUME, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSFIXLOCALVOLUME, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSFIXLOCALVOLUME, + false, + }, + { + "srvsvc_NETRDFSMANAGERREPORTSITEINFO", + sizeof(struct srvsvc_NETRDFSMANAGERREPORTSITEINFO), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSMANAGERREPORTSITEINFO, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSMANAGERREPORTSITEINFO, + (ndr_print_function_t) ndr_print_srvsvc_NETRDFSMANAGERREPORTSITEINFO, + false, + }, + { + "srvsvc_NETRSERVERTRANSPORTDELEX", + sizeof(struct srvsvc_NETRSERVERTRANSPORTDELEX), + (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRSERVERTRANSPORTDELEX, + (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRSERVERTRANSPORTDELEX, + (ndr_print_function_t) ndr_print_srvsvc_NETRSERVERTRANSPORTDELEX, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const srvsvc_endpoint_strings[] = { + "ncacn_np:[\\pipe\\srvsvc]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array srvsvc_endpoints = { + .count = 3, + .names = srvsvc_endpoint_strings +}; + +static const char * const srvsvc_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array srvsvc_authservices = { + .count = 1, + .names = srvsvc_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_srvsvc = { + .name = "srvsvc", + .syntax_id = { + {0x4b324fc8,0x1670,0x01d3,{0x12,0x78},{0x5a,0x47,0xbf,0x6e,0xe1,0x88}}, + NDR_SRVSVC_VERSION + }, + .helpstring = NDR_SRVSVC_HELPSTRING, + .num_calls = 54, + .calls = srvsvc_calls, + .endpoints = &srvsvc_endpoints, + .authservices = &srvsvc_authservices +}; + diff --git a/librpc/gen_ndr/ndr_srvsvc.h b/librpc/gen_ndr/ndr_srvsvc.h new file mode 100644 index 0000000000..126680cad0 --- /dev/null +++ b/librpc/gen_ndr/ndr_srvsvc.h @@ -0,0 +1,322 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/srvsvc.h" + +#ifndef _HEADER_NDR_srvsvc +#define _HEADER_NDR_srvsvc + +#define NDR_SRVSVC_UUID "4b324fc8-1670-01d3-1278-5a47bf6ee188" +#define NDR_SRVSVC_VERSION 3.0 +#define NDR_SRVSVC_NAME "srvsvc" +#define NDR_SRVSVC_HELPSTRING "Server Service" +extern const struct ndr_interface_table ndr_table_srvsvc; +#define NDR_SRVSVC_NETCHARDEVENUM (0x00) + +#define NDR_SRVSVC_NETCHARDEVGETINFO (0x01) + +#define NDR_SRVSVC_NETCHARDEVCONTROL (0x02) + +#define NDR_SRVSVC_NETCHARDEVQENUM (0x03) + +#define NDR_SRVSVC_NETCHARDEVQGETINFO (0x04) + +#define NDR_SRVSVC_NETCHARDEVQSETINFO (0x05) + +#define NDR_SRVSVC_NETCHARDEVQPURGE (0x06) + +#define NDR_SRVSVC_NETCHARDEVQPURGESELF (0x07) + +#define NDR_SRVSVC_NETCONNENUM (0x08) + +#define NDR_SRVSVC_NETFILEENUM (0x09) + +#define NDR_SRVSVC_NETFILEGETINFO (0x0a) + +#define NDR_SRVSVC_NETFILECLOSE (0x0b) + +#define NDR_SRVSVC_NETSESSENUM (0x0c) + +#define NDR_SRVSVC_NETSESSDEL (0x0d) + +#define NDR_SRVSVC_NETSHAREADD (0x0e) + +#define NDR_SRVSVC_NETSHAREENUMALL (0x0f) + +#define NDR_SRVSVC_NETSHAREGETINFO (0x10) + +#define NDR_SRVSVC_NETSHARESETINFO (0x11) + +#define NDR_SRVSVC_NETSHAREDEL (0x12) + +#define NDR_SRVSVC_NETSHAREDELSTICKY (0x13) + +#define NDR_SRVSVC_NETSHARECHECK (0x14) + +#define NDR_SRVSVC_NETSRVGETINFO (0x15) + +#define NDR_SRVSVC_NETSRVSETINFO (0x16) + +#define NDR_SRVSVC_NETDISKENUM (0x17) + +#define NDR_SRVSVC_NETSERVERSTATISTICSGET (0x18) + +#define NDR_SRVSVC_NETTRANSPORTADD (0x19) + +#define NDR_SRVSVC_NETTRANSPORTENUM (0x1a) + +#define NDR_SRVSVC_NETTRANSPORTDEL (0x1b) + +#define NDR_SRVSVC_NETREMOTETOD (0x1c) + +#define NDR_SRVSVC_NETSETSERVICEBITS (0x1d) + +#define NDR_SRVSVC_NETPATHTYPE (0x1e) + +#define NDR_SRVSVC_NETPATHCANONICALIZE (0x1f) + +#define NDR_SRVSVC_NETPATHCOMPARE (0x20) + +#define NDR_SRVSVC_NETNAMEVALIDATE (0x21) + +#define NDR_SRVSVC_NETRPRNAMECANONICALIZE (0x22) + +#define NDR_SRVSVC_NETPRNAMECOMPARE (0x23) + +#define NDR_SRVSVC_NETSHAREENUM (0x24) + +#define NDR_SRVSVC_NETSHAREDELSTART (0x25) + +#define NDR_SRVSVC_NETSHAREDELCOMMIT (0x26) + +#define NDR_SRVSVC_NETGETFILESECURITY (0x27) + +#define NDR_SRVSVC_NETSETFILESECURITY (0x28) + +#define NDR_SRVSVC_NETSERVERTRANSPORTADDEX (0x29) + +#define NDR_SRVSVC_NETSERVERSETSERVICEBITSEX (0x2a) + +#define NDR_SRVSVC_NETRDFSGETVERSION (0x2b) + +#define NDR_SRVSVC_NETRDFSCREATELOCALPARTITION (0x2c) + +#define NDR_SRVSVC_NETRDFSDELETELOCALPARTITION (0x2d) + +#define NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE (0x2e) + +#define NDR_SRVSVC_NETRDFSSETSERVERINFO (0x2f) + +#define NDR_SRVSVC_NETRDFSCREATEEXITPOINT (0x30) + +#define NDR_SRVSVC_NETRDFSDELETEEXITPOINT (0x31) + +#define NDR_SRVSVC_NETRDFSMODIFYPREFIX (0x32) + +#define NDR_SRVSVC_NETRDFSFIXLOCALVOLUME (0x33) + +#define NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO (0x34) + +#define NDR_SRVSVC_NETRSERVERTRANSPORTDELEX (0x35) + +#define NDR_SRVSVC_CALL_COUNT (54) +void ndr_print_srvsvc_NetCharDevInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo0 *r); +void ndr_print_srvsvc_NetCharDevCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr0 *r); +void ndr_print_srvsvc_NetCharDevInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo1 *r); +void ndr_print_srvsvc_NetCharDevCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr1 *r); +void ndr_print_srvsvc_NetCharDevInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevInfo *r); +void ndr_print_srvsvc_NetCharDevCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevCtr *r); +void ndr_print_srvsvc_NetCharDevInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfoCtr *r); +void ndr_print_srvsvc_NetCharDevQInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo0 *r); +void ndr_print_srvsvc_NetCharDevQCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr0 *r); +void ndr_print_srvsvc_NetCharDevQInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo1 *r); +void ndr_print_srvsvc_NetCharDevQCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr1 *r); +void ndr_print_srvsvc_NetCharDevQInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQInfo *r); +void ndr_print_srvsvc_NetCharDevQCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQCtr *r); +void ndr_print_srvsvc_NetCharDevQInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfoCtr *r); +void ndr_print_srvsvc_NetConnInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo0 *r); +void ndr_print_srvsvc_NetConnCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr0 *r); +void ndr_print_srvsvc_NetConnInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo1 *r); +void ndr_print_srvsvc_NetConnCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr1 *r); +void ndr_print_srvsvc_NetConnCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetConnCtr *r); +void ndr_print_srvsvc_NetConnInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfoCtr *r); +void ndr_print_srvsvc_NetFileInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo2 *r); +void ndr_print_srvsvc_NetFileCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr2 *r); +void ndr_print_srvsvc_NetFileInfo3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo3 *r); +void ndr_print_srvsvc_NetFileCtr3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr3 *r); +void ndr_print_srvsvc_NetFileInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileInfo *r); +void ndr_print_srvsvc_NetFileCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileCtr *r); +void ndr_print_srvsvc_NetFileInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfoCtr *r); +void ndr_print_srvsvc_NetSessInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo0 *r); +void ndr_print_srvsvc_NetSessCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr0 *r); +void ndr_print_srvsvc_NetSessInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo1 *r); +void ndr_print_srvsvc_NetSessCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr1 *r); +void ndr_print_srvsvc_NetSessInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo2 *r); +void ndr_print_srvsvc_NetSessCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr2 *r); +void ndr_print_srvsvc_NetSessInfo10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo10 *r); +void ndr_print_srvsvc_NetSessCtr10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr10 *r); +void ndr_print_srvsvc_NetSessInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo502 *r); +void ndr_print_srvsvc_NetSessCtr502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr502 *r); +void ndr_print_srvsvc_NetSessCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetSessCtr *r); +void ndr_print_srvsvc_NetSessInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfoCtr *r); +void ndr_print_srvsvc_ShareType(struct ndr_print *ndr, const char *name, enum srvsvc_ShareType r); +void ndr_print_srvsvc_NetShareInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo0 *r); +void ndr_print_srvsvc_NetShareCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr0 *r); +void ndr_print_srvsvc_NetShareInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1 *r); +void ndr_print_srvsvc_NetShareCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1 *r); +void ndr_print_srvsvc_NetShareInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo2 *r); +void ndr_print_srvsvc_NetShareCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr2 *r); +void ndr_print_srvsvc_NetShareInfo501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo501 *r); +void ndr_print_srvsvc_NetShareCtr501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr501 *r); +void ndr_print_srvsvc_NetShareInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo502 *r); +void ndr_print_srvsvc_NetShareCtr502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr502 *r); +void ndr_print_srvsvc_NetShareInfo1004(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1004 *r); +void ndr_print_srvsvc_NetShareCtr1004(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1004 *r); +void ndr_print_NetShareInfo1005Flags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_srvsvc_NetShareInfo1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1005 *r); +void ndr_print_srvsvc_NetShareCtr1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1005 *r); +void ndr_print_srvsvc_NetShareInfo1006(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1006 *r); +void ndr_print_srvsvc_NetShareCtr1006(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1006 *r); +void ndr_print_srvsvc_NetShareInfo1007(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1007 *r); +void ndr_print_srvsvc_NetShareCtr1007(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1007 *r); +void ndr_print_srvsvc_NetShareCtr1501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1501 *r); +void ndr_print_srvsvc_NetShareInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetShareInfo *r); +void ndr_print_srvsvc_NetShareCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetShareCtr *r); +void ndr_print_srvsvc_NetShareInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfoCtr *r); +enum ndr_err_code ndr_push_srvsvc_PlatformId(struct ndr_push *ndr, int ndr_flags, enum srvsvc_PlatformId r); +enum ndr_err_code ndr_pull_srvsvc_PlatformId(struct ndr_pull *ndr, int ndr_flags, enum srvsvc_PlatformId *r); +void ndr_print_srvsvc_PlatformId(struct ndr_print *ndr, const char *name, enum srvsvc_PlatformId r); +enum ndr_err_code ndr_push_srvsvc_NetSrvInfo100(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo100 *r); +enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo100(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo100 *r); +void ndr_print_srvsvc_NetSrvInfo100(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo100 *r); +enum ndr_err_code ndr_push_srvsvc_NetSrvInfo101(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo101 *r); +enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo101(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo101 *r); +void ndr_print_srvsvc_NetSrvInfo101(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo101 *r); +void ndr_print_srvsvc_NetSrvInfo102(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo102 *r); +void ndr_print_srvsvc_NetSrvInfo402(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo402 *r); +void ndr_print_srvsvc_NetSrvInfo403(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo403 *r); +void ndr_print_srvsvc_NetSrvInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo502 *r); +void ndr_print_srvsvc_NetSrvInfo503(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo503 *r); +void ndr_print_srvsvc_NetSrvInfo599(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo599 *r); +void ndr_print_srvsvc_NetSrvInfo1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1005 *r); +void ndr_print_srvsvc_NetSrvInfo1010(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1010 *r); +void ndr_print_srvsvc_NetSrvInfo1016(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1016 *r); +void ndr_print_srvsvc_NetSrvInfo1017(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1017 *r); +void ndr_print_srvsvc_NetSrvInfo1018(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1018 *r); +void ndr_print_srvsvc_NetSrvInfo1107(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1107 *r); +void ndr_print_srvsvc_NetSrvInfo1501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1501 *r); +void ndr_print_srvsvc_NetSrvInfo1502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1502 *r); +void ndr_print_srvsvc_NetSrvInfo1503(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1503 *r); +void ndr_print_srvsvc_NetSrvInfo1506(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1506 *r); +void ndr_print_srvsvc_NetSrvInfo1509(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1509 *r); +void ndr_print_srvsvc_NetSrvInfo1510(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1510 *r); +void ndr_print_srvsvc_NetSrvInfo1511(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1511 *r); +void ndr_print_srvsvc_NetSrvInfo1512(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1512 *r); +void ndr_print_srvsvc_NetSrvInfo1513(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1513 *r); +void ndr_print_srvsvc_NetSrvInfo1514(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1514 *r); +void ndr_print_srvsvc_NetSrvInfo1515(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1515 *r); +void ndr_print_srvsvc_NetSrvInfo1516(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1516 *r); +void ndr_print_srvsvc_NetSrvInfo1518(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1518 *r); +void ndr_print_srvsvc_NetSrvInfo1520(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1520 *r); +void ndr_print_srvsvc_NetSrvInfo1521(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1521 *r); +void ndr_print_srvsvc_NetSrvInfo1522(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1522 *r); +void ndr_print_srvsvc_NetSrvInfo1523(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1523 *r); +void ndr_print_srvsvc_NetSrvInfo1524(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1524 *r); +void ndr_print_srvsvc_NetSrvInfo1525(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1525 *r); +void ndr_print_srvsvc_NetSrvInfo1528(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1528 *r); +void ndr_print_srvsvc_NetSrvInfo1529(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1529 *r); +void ndr_print_srvsvc_NetSrvInfo1530(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1530 *r); +void ndr_print_srvsvc_NetSrvInfo1533(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1533 *r); +void ndr_print_srvsvc_NetSrvInfo1534(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1534 *r); +void ndr_print_srvsvc_NetSrvInfo1535(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1535 *r); +void ndr_print_srvsvc_NetSrvInfo1536(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1536 *r); +void ndr_print_srvsvc_NetSrvInfo1537(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1537 *r); +void ndr_print_srvsvc_NetSrvInfo1538(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1538 *r); +void ndr_print_srvsvc_NetSrvInfo1539(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1539 *r); +void ndr_print_srvsvc_NetSrvInfo1540(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1540 *r); +void ndr_print_srvsvc_NetSrvInfo1541(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1541 *r); +void ndr_print_srvsvc_NetSrvInfo1542(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1542 *r); +void ndr_print_srvsvc_NetSrvInfo1543(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1543 *r); +void ndr_print_srvsvc_NetSrvInfo1544(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1544 *r); +void ndr_print_srvsvc_NetSrvInfo1545(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1545 *r); +void ndr_print_srvsvc_NetSrvInfo1546(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1546 *r); +void ndr_print_srvsvc_NetSrvInfo1547(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1547 *r); +void ndr_print_srvsvc_NetSrvInfo1548(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1548 *r); +void ndr_print_srvsvc_NetSrvInfo1549(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1549 *r); +void ndr_print_srvsvc_NetSrvInfo1550(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1550 *r); +void ndr_print_srvsvc_NetSrvInfo1552(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1552 *r); +void ndr_print_srvsvc_NetSrvInfo1553(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1553 *r); +void ndr_print_srvsvc_NetSrvInfo1554(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1554 *r); +void ndr_print_srvsvc_NetSrvInfo1555(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1555 *r); +void ndr_print_srvsvc_NetSrvInfo1556(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1556 *r); +void ndr_print_srvsvc_NetSrvInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetSrvInfo *r); +void ndr_print_srvsvc_NetDiskInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetDiskInfo0 *r); +void ndr_print_srvsvc_NetDiskInfo(struct ndr_print *ndr, const char *name, const struct srvsvc_NetDiskInfo *r); +void ndr_print_srvsvc_Statistics(struct ndr_print *ndr, const char *name, const struct srvsvc_Statistics *r); +void ndr_print_srvsvc_NetTransportInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo0 *r); +void ndr_print_srvsvc_NetTransportCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr0 *r); +void ndr_print_srvsvc_NetTransportInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo1 *r); +void ndr_print_srvsvc_NetTransportCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr1 *r); +void ndr_print_srvsvc_NetTransportInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo2 *r); +void ndr_print_srvsvc_NetTransportCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr2 *r); +void ndr_print_srvsvc_NetTransportInfo3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo3 *r); +void ndr_print_srvsvc_NetTransportCtr3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr3 *r); +void ndr_print_srvsvc_NetTransportCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetTransportCtr *r); +void ndr_print_srvsvc_NetTransportInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfoCtr *r); +void ndr_print_srvsvc_NetRemoteTODInfo(struct ndr_print *ndr, const char *name, const struct srvsvc_NetRemoteTODInfo *r); +void ndr_print_srvsvc_NetTransportInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetTransportInfo *r); +void ndr_print_srvsvc_NetCharDevEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevEnum *r); +void ndr_print_srvsvc_NetCharDevGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevGetInfo *r); +void ndr_print_srvsvc_NetCharDevControl(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevControl *r); +void ndr_print_srvsvc_NetCharDevQEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQEnum *r); +void ndr_print_srvsvc_NetCharDevQGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQGetInfo *r); +void ndr_print_srvsvc_NetCharDevQSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQSetInfo *r); +void ndr_print_srvsvc_NetCharDevQPurge(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQPurge *r); +void ndr_print_srvsvc_NetCharDevQPurgeSelf(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQPurgeSelf *r); +void ndr_print_srvsvc_NetConnEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetConnEnum *r); +void ndr_print_srvsvc_NetFileEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileEnum *r); +void ndr_print_srvsvc_NetFileGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileGetInfo *r); +void ndr_print_srvsvc_NetFileClose(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileClose *r); +void ndr_print_srvsvc_NetSessEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSessEnum *r); +void ndr_print_srvsvc_NetSessDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSessDel *r); +void ndr_print_srvsvc_NetShareAdd(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareAdd *r); +void ndr_print_srvsvc_NetShareEnumAll(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareEnumAll *r); +void ndr_print_srvsvc_NetShareGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareGetInfo *r); +void ndr_print_srvsvc_NetShareSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareSetInfo *r); +void ndr_print_srvsvc_NetShareDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDel *r); +void ndr_print_srvsvc_NetShareDelSticky(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelSticky *r); +void ndr_print_srvsvc_NetShareCheck(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareCheck *r); +void ndr_print_srvsvc_NetSrvGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSrvGetInfo *r); +void ndr_print_srvsvc_NetSrvSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSrvSetInfo *r); +void ndr_print_srvsvc_NetDiskEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetDiskEnum *r); +void ndr_print_srvsvc_NetServerStatisticsGet(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerStatisticsGet *r); +void ndr_print_srvsvc_NetTransportAdd(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportAdd *r); +void ndr_print_srvsvc_NetTransportEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportEnum *r); +void ndr_print_srvsvc_NetTransportDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportDel *r); +void ndr_print_srvsvc_NetRemoteTOD(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetRemoteTOD *r); +void ndr_print_srvsvc_NetSetServiceBits(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSetServiceBits *r); +void ndr_print_srvsvc_NetPathType(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathType *r); +void ndr_print_srvsvc_NetPathCanonicalize(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathCanonicalize *r); +void ndr_print_srvsvc_NetPathCompare(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathCompare *r); +void ndr_print_srvsvc_NetNameValidate(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetNameValidate *r); +void ndr_print_srvsvc_NETRPRNAMECANONICALIZE(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRPRNAMECANONICALIZE *r); +void ndr_print_srvsvc_NetPRNameCompare(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPRNameCompare *r); +void ndr_print_srvsvc_NetShareEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareEnum *r); +void ndr_print_srvsvc_NetShareDelStart(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelStart *r); +void ndr_print_srvsvc_NetShareDelCommit(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelCommit *r); +void ndr_print_srvsvc_NetGetFileSecurity(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetGetFileSecurity *r); +void ndr_print_srvsvc_NetSetFileSecurity(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSetFileSecurity *r); +void ndr_print_srvsvc_NetServerTransportAddEx(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerTransportAddEx *r); +void ndr_print_srvsvc_NetServerSetServiceBitsEx(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerSetServiceBitsEx *r); +void ndr_print_srvsvc_NETRDFSGETVERSION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSGETVERSION *r); +void ndr_print_srvsvc_NETRDFSCREATELOCALPARTITION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSCREATELOCALPARTITION *r); +void ndr_print_srvsvc_NETRDFSDELETELOCALPARTITION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSDELETELOCALPARTITION *r); +void ndr_print_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r); +void ndr_print_srvsvc_NETRDFSSETSERVERINFO(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSSETSERVERINFO *r); +void ndr_print_srvsvc_NETRDFSCREATEEXITPOINT(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSCREATEEXITPOINT *r); +void ndr_print_srvsvc_NETRDFSDELETEEXITPOINT(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSDELETEEXITPOINT *r); +void ndr_print_srvsvc_NETRDFSMODIFYPREFIX(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSMODIFYPREFIX *r); +void ndr_print_srvsvc_NETRDFSFIXLOCALVOLUME(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSFIXLOCALVOLUME *r); +void ndr_print_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r); +void ndr_print_srvsvc_NETRSERVERTRANSPORTDELEX(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRSERVERTRANSPORTDELEX *r); +#endif /* _HEADER_NDR_srvsvc */ diff --git a/librpc/gen_ndr/ndr_svcctl.c b/librpc/gen_ndr/ndr_svcctl.c new file mode 100644 index 0000000000..2bccde9ba0 --- /dev/null +++ b/librpc/gen_ndr/ndr_svcctl.c @@ -0,0 +1,6414 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_svcctl.h" + +#include "librpc/gen_ndr/ndr_misc.h" +#include "librpc/gen_ndr/ndr_security.h" +static enum ndr_err_code ndr_push_SERVICE_LOCK_STATUS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_LOCK_STATUS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_locked)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->lock_owner)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_duration)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->lock_owner) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lock_owner, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lock_owner, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->lock_owner, ndr_charset_length(r->lock_owner, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_SERVICE_LOCK_STATUS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_LOCK_STATUS *r) +{ + uint32_t _ptr_lock_owner; + TALLOC_CTX *_mem_save_lock_owner_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_locked)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lock_owner)); + if (_ptr_lock_owner) { + NDR_PULL_ALLOC(ndr, r->lock_owner); + } else { + r->lock_owner = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_duration)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->lock_owner) { + _mem_save_lock_owner_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->lock_owner, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->lock_owner)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->lock_owner)); + if (ndr_get_array_length(ndr, &r->lock_owner) > ndr_get_array_size(ndr, &r->lock_owner)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->lock_owner), ndr_get_array_length(ndr, &r->lock_owner)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->lock_owner), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->lock_owner, ndr_get_array_length(ndr, &r->lock_owner), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_owner_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_SERVICE_LOCK_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_LOCK_STATUS *r) +{ + ndr_print_struct(ndr, name, "SERVICE_LOCK_STATUS"); + ndr->depth++; + ndr_print_uint32(ndr, "is_locked", r->is_locked); + ndr_print_ptr(ndr, "lock_owner", r->lock_owner); + ndr->depth++; + if (r->lock_owner) { + ndr_print_string(ndr, "lock_owner", r->lock_owner); + } + ndr->depth--; + ndr_print_uint32(ndr, "lock_duration", r->lock_duration); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_SERVICE_STATUS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_STATUS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->state)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->controls_accepted)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->win32_exit_code)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_exit_code)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->check_point)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->wait_hint)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_SERVICE_STATUS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_STATUS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->controls_accepted)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->win32_exit_code)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_exit_code)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->check_point)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->wait_hint)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_STATUS *r) +{ + ndr_print_struct(ndr, name, "SERVICE_STATUS"); + ndr->depth++; + ndr_print_uint32(ndr, "type", r->type); + ndr_print_uint32(ndr, "state", r->state); + ndr_print_uint32(ndr, "controls_accepted", r->controls_accepted); + ndr_print_WERROR(ndr, "win32_exit_code", r->win32_exit_code); + ndr_print_uint32(ndr, "service_exit_code", r->service_exit_code); + ndr_print_uint32(ndr, "check_point", r->check_point); + ndr_print_uint32(ndr, "wait_hint", r->wait_hint); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_ENUM_SERVICE_STATUS(struct ndr_push *ndr, int ndr_flags, const struct ENUM_SERVICE_STATUS *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->service_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->display_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + if (r->service_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->service_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->service_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + if (r->display_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->display_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->display_name)); + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_ENUM_SERVICE_STATUS(struct ndr_pull *ndr, int ndr_flags, struct ENUM_SERVICE_STATUS *r) +{ + uint32_t _ptr_service_name; + TALLOC_CTX *_mem_save_service_name_0; + uint32_t _ptr_display_name; + TALLOC_CTX *_mem_save_display_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); + if (_ptr_service_name) { + NDR_PULL_ALLOC(ndr, r->service_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->service_name, _ptr_service_name)); + } else { + r->service_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); + if (_ptr_display_name) { + NDR_PULL_ALLOC(ndr, r->display_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->display_name, _ptr_display_name)); + } else { + r->display_name = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + if (r->service_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->service_name)); + _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->service_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->service_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + if (r->display_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->display_name)); + _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->display_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ENUM_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct ENUM_SERVICE_STATUS *r) +{ + ndr_print_struct(ndr, name, "ENUM_SERVICE_STATUS"); + ndr->depth++; + ndr_print_ptr(ndr, "service_name", r->service_name); + ndr->depth++; + if (r->service_name) { + ndr_print_string(ndr, "service_name", r->service_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "display_name", r->display_name); + ndr->depth++; + if (r->display_name) { + ndr_print_string(ndr, "display_name", r->display_name); + } + ndr->depth--; + ndr_print_SERVICE_STATUS(ndr, "status", &r->status); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_svcctl_ServerType(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_svcctl_ServerType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WORKSTATION", SV_TYPE_WORKSTATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER", SV_TYPE_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SQLSERVER", SV_TYPE_SQLSERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_CTRL", SV_TYPE_DOMAIN_CTRL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_BAKCTRL", SV_TYPE_DOMAIN_BAKCTRL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_TIME_SOURCE", SV_TYPE_TIME_SOURCE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_AFP", SV_TYPE_AFP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_NOVELL", SV_TYPE_NOVELL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_MEMBER", SV_TYPE_DOMAIN_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_PRINTQ_SERVER", SV_TYPE_PRINTQ_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DIALIN_SERVER", SV_TYPE_DIALIN_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_UNIX", SV_TYPE_SERVER_UNIX, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_NT", SV_TYPE_NT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WFW", SV_TYPE_WFW, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_MFPN", SV_TYPE_SERVER_MFPN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_NT", SV_TYPE_SERVER_NT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_POTENTIAL_BROWSER", SV_TYPE_POTENTIAL_BROWSER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_BACKUP_BROWSER", SV_TYPE_BACKUP_BROWSER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_MASTER_BROWSER", SV_TYPE_MASTER_BROWSER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_MASTER", SV_TYPE_DOMAIN_MASTER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_OSF", SV_TYPE_SERVER_OSF, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_VMS", SV_TYPE_SERVER_VMS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WIN95_PLUS", SV_TYPE_WIN95_PLUS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DFS_SERVER", SV_TYPE_DFS_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_ALTERNATE_XPORT", SV_TYPE_ALTERNATE_XPORT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_LOCAL_LIST_ONLY", SV_TYPE_LOCAL_LIST_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_ENUM", SV_TYPE_DOMAIN_ENUM, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_SERVICE_CONTROL(struct ndr_push *ndr, int ndr_flags, enum SERVICE_CONTROL r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_SERVICE_CONTROL(struct ndr_pull *ndr, int ndr_flags, enum SERVICE_CONTROL *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_SERVICE_CONTROL(struct ndr_print *ndr, const char *name, enum SERVICE_CONTROL r) +{ + const char *val = NULL; + + switch (r) { + case SVCCTL_CONTROL_STOP: val = "SVCCTL_CONTROL_STOP"; break; + case SVCCTL_CONTROL_PAUSE: val = "SVCCTL_CONTROL_PAUSE"; break; + case SVCCTL_CONTROL_CONTINUE: val = "SVCCTL_CONTROL_CONTINUE"; break; + case SVCCTL_CONTROL_INTERROGATE: val = "SVCCTL_CONTROL_INTERROGATE"; break; + case SVCCTL_CONTROL_SHUTDOWN: val = "SVCCTL_CONTROL_SHUTDOWN"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_svcctl_MgrAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_MgrAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_MgrAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_CONNECT", SC_RIGHT_MGR_CONNECT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_CREATE_SERVICE", SC_RIGHT_MGR_CREATE_SERVICE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_ENUMERATE_SERVICE", SC_RIGHT_MGR_ENUMERATE_SERVICE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_LOCK", SC_RIGHT_MGR_LOCK, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_QUERY_LOCK_STATUS", SC_RIGHT_MGR_QUERY_LOCK_STATUS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_MODIFY_BOOT_CONFIG", SC_RIGHT_MGR_MODIFY_BOOT_CONFIG, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_ServiceAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_ServiceAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_QUERY_CONFIG", SC_RIGHT_SVC_QUERY_CONFIG, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_CHANGE_CONFIG", SC_RIGHT_SVC_CHANGE_CONFIG, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_QUERY_STATUS", SC_RIGHT_SVC_QUERY_STATUS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_ENUMERATE_DEPENDENTS", SC_RIGHT_SVC_ENUMERATE_DEPENDENTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_START", SC_RIGHT_SVC_START, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_STOP", SC_RIGHT_SVC_STOP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_PAUSE_CONTINUE", SC_RIGHT_SVC_PAUSE_CONTINUE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_INTERROGATE", SC_RIGHT_SVC_INTERROGATE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_USER_DEFINED_CONTROL", SC_RIGHT_SVC_USER_DEFINED_CONTROL, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_flags, const struct QUERY_SERVICE_CONFIG *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->error_control)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->executablepath)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->loadordergroup)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tag_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependencies)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->startname)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->displayname)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->executablepath) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->executablepath, ndr_charset_length(r->executablepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->loadordergroup) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->loadordergroup, ndr_charset_length(r->loadordergroup, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->dependencies) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dependencies, ndr_charset_length(r->dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->startname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->startname, ndr_charset_length(r->startname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->displayname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->displayname, ndr_charset_length(r->displayname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_QUERY_SERVICE_CONFIG(struct ndr_pull *ndr, int ndr_flags, struct QUERY_SERVICE_CONFIG *r) +{ + uint32_t _ptr_executablepath; + TALLOC_CTX *_mem_save_executablepath_0; + uint32_t _ptr_loadordergroup; + TALLOC_CTX *_mem_save_loadordergroup_0; + uint32_t _ptr_dependencies; + TALLOC_CTX *_mem_save_dependencies_0; + uint32_t _ptr_startname; + TALLOC_CTX *_mem_save_startname_0; + uint32_t _ptr_displayname; + TALLOC_CTX *_mem_save_displayname_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->error_control)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_executablepath)); + if (_ptr_executablepath) { + NDR_PULL_ALLOC(ndr, r->executablepath); + } else { + r->executablepath = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_loadordergroup)); + if (_ptr_loadordergroup) { + NDR_PULL_ALLOC(ndr, r->loadordergroup); + } else { + r->loadordergroup = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tag_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); + if (_ptr_dependencies) { + NDR_PULL_ALLOC(ndr, r->dependencies); + } else { + r->dependencies = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_startname)); + if (_ptr_startname) { + NDR_PULL_ALLOC(ndr, r->startname); + } else { + r->startname = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_displayname)); + if (_ptr_displayname) { + NDR_PULL_ALLOC(ndr, r->displayname); + } else { + r->displayname = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->executablepath) { + _mem_save_executablepath_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->executablepath, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->executablepath)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->executablepath)); + if (ndr_get_array_length(ndr, &r->executablepath) > ndr_get_array_size(ndr, &r->executablepath)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->executablepath), ndr_get_array_length(ndr, &r->executablepath)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->executablepath, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_executablepath_0, 0); + } + if (r->loadordergroup) { + _mem_save_loadordergroup_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->loadordergroup, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->loadordergroup)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->loadordergroup)); + if (ndr_get_array_length(ndr, &r->loadordergroup) > ndr_get_array_size(ndr, &r->loadordergroup)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->loadordergroup), ndr_get_array_length(ndr, &r->loadordergroup)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->loadordergroup, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_loadordergroup_0, 0); + } + if (r->dependencies) { + _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dependencies, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dependencies)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dependencies)); + if (ndr_get_array_length(ndr, &r->dependencies) > ndr_get_array_size(ndr, &r->dependencies)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dependencies), ndr_get_array_length(ndr, &r->dependencies)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dependencies, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); + } + if (r->startname) { + _mem_save_startname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->startname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->startname)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->startname)); + if (ndr_get_array_length(ndr, &r->startname) > ndr_get_array_size(ndr, &r->startname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->startname), ndr_get_array_length(ndr, &r->startname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->startname, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_startname_0, 0); + } + if (r->displayname) { + _mem_save_displayname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->displayname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->displayname)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->displayname)); + if (ndr_get_array_length(ndr, &r->displayname) > ndr_get_array_size(ndr, &r->displayname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->displayname), ndr_get_array_length(ndr, &r->displayname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->displayname, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_displayname_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_QUERY_SERVICE_CONFIG(struct ndr_print *ndr, const char *name, const struct QUERY_SERVICE_CONFIG *r) +{ + ndr_print_struct(ndr, name, "QUERY_SERVICE_CONFIG"); + ndr->depth++; + ndr_print_uint32(ndr, "service_type", r->service_type); + ndr_print_uint32(ndr, "start_type", r->start_type); + ndr_print_uint32(ndr, "error_control", r->error_control); + ndr_print_ptr(ndr, "executablepath", r->executablepath); + ndr->depth++; + if (r->executablepath) { + ndr_print_string(ndr, "executablepath", r->executablepath); + } + ndr->depth--; + ndr_print_ptr(ndr, "loadordergroup", r->loadordergroup); + ndr->depth++; + if (r->loadordergroup) { + ndr_print_string(ndr, "loadordergroup", r->loadordergroup); + } + ndr->depth--; + ndr_print_uint32(ndr, "tag_id", r->tag_id); + ndr_print_ptr(ndr, "dependencies", r->dependencies); + ndr->depth++; + if (r->dependencies) { + ndr_print_string(ndr, "dependencies", r->dependencies); + } + ndr->depth--; + ndr_print_ptr(ndr, "startname", r->startname); + ndr->depth++; + if (r->startname) { + ndr_print_string(ndr, "startname", r->startname); + } + ndr->depth--; + ndr_print_ptr(ndr, "displayname", r->displayname); + ndr->depth++; + if (r->displayname) { + ndr_print_string(ndr, "displayname", r->displayname); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_QUERY_SERVICE_CONFIG); +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_CloseServiceHandle(struct ndr_pull *ndr, int flags, struct svcctl_CloseServiceHandle *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.handle); + *r->out.handle = *r->in.handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CloseServiceHandle *r) +{ + ndr_print_struct(ndr, name, "svcctl_CloseServiceHandle"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_CloseServiceHandle"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_CloseServiceHandle"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_SERVICE_CONTROL(ndr, NDR_SCALARS, r->in.control)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_ControlService(struct ndr_pull *ndr, int flags, struct svcctl_ControlService *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_service_status_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_SERVICE_CONTROL(ndr, NDR_SCALARS, &r->in.control)); + NDR_PULL_ALLOC(ndr, r->out.service_status); + ZERO_STRUCTP(r->out.service_status); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.service_status); + } + _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ControlService *r) +{ + ndr_print_struct(ndr, name, "svcctl_ControlService"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_ControlService"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_SERVICE_CONTROL(ndr, "control", r->in.control); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_ControlService"); + ndr->depth++; + ndr_print_ptr(ndr, "service_status", r->out.service_status); + ndr->depth++; + ndr_print_SERVICE_STATUS(ndr, "service_status", r->out.service_status); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_DeleteService(struct ndr_pull *ndr, int flags, struct svcctl_DeleteService *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_DeleteService *r) +{ + ndr_print_struct(ndr, name, "svcctl_DeleteService"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_DeleteService"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_DeleteService"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + 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, r->out.lock)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_LockServiceDatabase(struct ndr_pull *ndr, int flags, struct svcctl_LockServiceDatabase *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_lock_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.lock); + ZERO_STRUCTP(r->out.lock); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.lock); + } + _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.lock, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.lock)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_LockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_LockServiceDatabase *r) +{ + ndr_print_struct(ndr, name, "svcctl_LockServiceDatabase"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_LockServiceDatabase"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_LockServiceDatabase"); + ndr->depth++; + ndr_print_ptr(ndr, "lock", r->out.lock); + ndr->depth++; + ndr_print_policy_handle(ndr, "lock", r->out.lock); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_QueryServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceObjectSecurity *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); + } + if (flags & NDR_OUT) { + if (r->out.buffer == 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)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buffer_size)); + if (r->out.needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_QueryServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceObjectSecurity *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_needed_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size)); + if (r->in.buffer_size < 0 || r->in.buffer_size > 0x40000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buffer_size); + memset(r->out.buffer, 0, (r->in.buffer_size) * sizeof(*r->out.buffer)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (*r->out.needed < 0 || *r->out.needed > 0x40000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.buffer_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceObjectSecurity *r) +{ + ndr_print_struct(ndr, name, "svcctl_QueryServiceObjectSecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_QueryServiceObjectSecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "security_flags", r->in.security_flags); + ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_QueryServiceObjectSecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buffer_size); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_SetServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_SetServiceObjectSecurity *r) +{ + if (flags & NDR_IN) { + 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, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags)); + if (r->in.buffer == 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)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.buffer_size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_SetServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_SetServiceObjectSecurity *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer))); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size)); + if (r->in.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.buffer_size)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_SetServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceObjectSecurity *r) +{ + ndr_print_struct(ndr, name, "svcctl_SetServiceObjectSecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_SetServiceObjectSecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "security_flags", r->in.security_flags); + ndr_print_ptr(ndr, "buffer", r->in.buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.buffer_size); + ndr->depth--; + ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_SetServiceObjectSecurity"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_QueryServiceStatus(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceStatus *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_service_status_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.service_status); + ZERO_STRUCTP(r->out.service_status); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.service_status); + } + _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_QueryServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatus *r) +{ + ndr_print_struct(ndr, name, "svcctl_QueryServiceStatus"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_QueryServiceStatus"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_QueryServiceStatus"); + ndr->depth++; + ndr_print_ptr(ndr, "service_status", r->out.service_status); + ndr->depth++; + ndr_print_SERVICE_STATUS(ndr, "service_status", r->out.service_status); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_SetServiceStatus(struct ndr_push *ndr, int flags, const struct svcctl_SetServiceStatus *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_SetServiceStatus(struct ndr_pull *ndr, int flags, struct svcctl_SetServiceStatus *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_SetServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceStatus *r) +{ + ndr_print_struct(ndr, name, "svcctl_SetServiceStatus"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_SetServiceStatus"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_SetServiceStatus"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.lock)); + } + if (flags & NDR_OUT) { + 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, r->out.lock)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_UnlockServiceDatabase(struct ndr_pull *ndr, int flags, struct svcctl_UnlockServiceDatabase *r) +{ + TALLOC_CTX *_mem_save_lock_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.lock); + } + _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lock, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.lock)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.lock); + *r->out.lock = *r->in.lock; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.lock); + } + _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.lock, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.lock)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_UnlockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_UnlockServiceDatabase *r) +{ + ndr_print_struct(ndr, name, "svcctl_UnlockServiceDatabase"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_UnlockServiceDatabase"); + ndr->depth++; + ndr_print_ptr(ndr, "lock", r->in.lock); + ndr->depth++; + ndr_print_policy_handle(ndr, "lock", r->in.lock); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_UnlockServiceDatabase"); + ndr->depth++; + ndr_print_ptr(ndr, "lock", r->out.lock); + ndr->depth++; + ndr_print_policy_handle(ndr, "lock", r->out.lock); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_NotifyBootConfigStatus(struct ndr_push *ndr, int flags, const struct svcctl_NotifyBootConfigStatus *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_NotifyBootConfigStatus(struct ndr_pull *ndr, int flags, struct svcctl_NotifyBootConfigStatus *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_NotifyBootConfigStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_NotifyBootConfigStatus *r) +{ + ndr_print_struct(ndr, name, "svcctl_NotifyBootConfigStatus"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_NotifyBootConfigStatus"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_NotifyBootConfigStatus"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.immediate)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_SCSetServiceBitsW(struct ndr_pull *ndr, int flags, struct svcctl_SCSetServiceBitsW *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bits)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bitson)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.immediate)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_SCSetServiceBitsW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsW *r) +{ + ndr_print_struct(ndr, name, "svcctl_SCSetServiceBitsW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_SCSetServiceBitsW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "bits", r->in.bits); + ndr_print_uint32(ndr, "bitson", r->in.bitson); + ndr_print_uint32(ndr, "immediate", r->in.immediate); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_SCSetServiceBitsW"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.error)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path)); + if (r->in.binary_path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_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.binary_path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.load_order_group)); + if (r->in.load_order_group) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.load_order_group, ndr_charset_length(r->in.load_order_group, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies)); + if (r->in.dependencies) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name)); + if (r->in.service_start_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_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.service_start_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); + if (r->in.password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name)); + if (r->in.display_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_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.display_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.display_name, ndr_charset_length(r->in.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfigW(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfigW *r) +{ + uint32_t _ptr_binary_path; + uint32_t _ptr_load_order_group; + uint32_t _ptr_dependencies; + uint32_t _ptr_service_start_name; + uint32_t _ptr_password; + uint32_t _ptr_display_name; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_binary_path_0; + TALLOC_CTX *_mem_save_load_order_group_0; + TALLOC_CTX *_mem_save_tag_id_0; + TALLOC_CTX *_mem_save_dependencies_0; + TALLOC_CTX *_mem_save_service_start_name_0; + TALLOC_CTX *_mem_save_password_0; + TALLOC_CTX *_mem_save_display_name_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.error)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path)); + if (_ptr_binary_path) { + NDR_PULL_ALLOC(ndr, r->in.binary_path); + } else { + r->in.binary_path = NULL; + } + if (r->in.binary_path) { + _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path)); + if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_load_order_group)); + if (_ptr_load_order_group) { + NDR_PULL_ALLOC(ndr, r->in.load_order_group); + } else { + r->in.load_order_group = NULL; + } + if (r->in.load_order_group) { + _mem_save_load_order_group_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.load_order_group, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.load_order_group)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.load_order_group)); + if (ndr_get_array_length(ndr, &r->in.load_order_group) > ndr_get_array_size(ndr, &r->in.load_order_group)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.load_order_group), ndr_get_array_length(ndr, &r->in.load_order_group)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.load_order_group, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_load_order_group_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); + if (_ptr_dependencies) { + NDR_PULL_ALLOC(ndr, r->in.dependencies); + } else { + r->in.dependencies = NULL; + } + if (r->in.dependencies) { + _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies)); + if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name)); + if (_ptr_service_start_name) { + NDR_PULL_ALLOC(ndr, r->in.service_start_name); + } else { + r->in.service_start_name = NULL; + } + if (r->in.service_start_name) { + _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name)); + if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->in.password); + } else { + r->in.password = NULL; + } + if (r->in.password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); + if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); + if (_ptr_display_name) { + NDR_PULL_ALLOC(ndr, r->in.display_name); + } else { + r->in.display_name = NULL; + } + if (r->in.display_name) { + _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.display_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.display_name)); + if (ndr_get_array_length(ndr, &r->in.display_name) > ndr_get_array_size(ndr, &r->in.display_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.display_name), ndr_get_array_length(ndr, &r->in.display_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.display_name, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.tag_id); + ZERO_STRUCTP(r->out.tag_id); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.tag_id); + } + _mem_save_tag_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.tag_id, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.tag_id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tag_id_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_ChangeServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigW *r) +{ + ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfigW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfigW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "type", r->in.type); + ndr_print_uint32(ndr, "start", r->in.start); + ndr_print_uint32(ndr, "error", r->in.error); + ndr_print_ptr(ndr, "binary_path", r->in.binary_path); + ndr->depth++; + if (r->in.binary_path) { + ndr_print_string(ndr, "binary_path", r->in.binary_path); + } + ndr->depth--; + ndr_print_ptr(ndr, "load_order_group", r->in.load_order_group); + ndr->depth++; + if (r->in.load_order_group) { + ndr_print_string(ndr, "load_order_group", r->in.load_order_group); + } + ndr->depth--; + ndr_print_ptr(ndr, "dependencies", r->in.dependencies); + ndr->depth++; + if (r->in.dependencies) { + ndr_print_string(ndr, "dependencies", r->in.dependencies); + } + ndr->depth--; + ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name); + ndr->depth++; + if (r->in.service_start_name) { + ndr_print_string(ndr, "service_start_name", r->in.service_start_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->in.password); + ndr->depth++; + if (r->in.password) { + ndr_print_string(ndr, "password", r->in.password); + } + ndr->depth--; + ndr_print_ptr(ndr, "display_name", r->in.display_name); + ndr->depth++; + if (r->in.display_name) { + ndr_print_string(ndr, "display_name", r->in.display_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfigW"); + ndr->depth++; + ndr_print_ptr(ndr, "tag_id", r->out.tag_id); + ndr->depth++; + ndr_print_uint32(ndr, "tag_id", *r->out.tag_id); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DisplayName)); + if (r->in.DisplayName) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DisplayName, ndr_charset_length(r->in.DisplayName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.desired_access)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.error_control)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_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.binary_path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.LoadOrderGroupKey)); + if (r->in.LoadOrderGroupKey) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.LoadOrderGroupKey, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.TagId)); + if (r->in.TagId) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.TagId)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies)); + if (r->in.dependencies) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dependencies_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.dependencies, r->in.dependencies_size)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dependencies_size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name)); + if (r->in.service_start_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_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.service_start_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); + if (r->in.password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.password_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.password, r->in.password_size)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.password_size)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.TagId)); + if (r->out.TagId) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.TagId)); + } + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_CreateServiceW(struct ndr_pull *ndr, int flags, struct svcctl_CreateServiceW *r) +{ + uint32_t _ptr_DisplayName; + uint32_t _ptr_LoadOrderGroupKey; + uint32_t _ptr_TagId; + uint32_t _ptr_dependencies; + uint32_t _ptr_service_start_name; + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_scmanager_handle_0; + TALLOC_CTX *_mem_save_DisplayName_0; + TALLOC_CTX *_mem_save_LoadOrderGroupKey_0; + TALLOC_CTX *_mem_save_TagId_0; + TALLOC_CTX *_mem_save_dependencies_0; + TALLOC_CTX *_mem_save_service_start_name_0; + TALLOC_CTX *_mem_save_password_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.scmanager_handle); + } + _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName)); + if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DisplayName)); + if (_ptr_DisplayName) { + NDR_PULL_ALLOC(ndr, r->in.DisplayName); + } else { + r->in.DisplayName = NULL; + } + if (r->in.DisplayName) { + _mem_save_DisplayName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.DisplayName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DisplayName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DisplayName)); + if (ndr_get_array_length(ndr, &r->in.DisplayName) > ndr_get_array_size(ndr, &r->in.DisplayName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DisplayName), ndr_get_array_length(ndr, &r->in.DisplayName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DisplayName, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DisplayName_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.desired_access)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.error_control)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path)); + if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_LoadOrderGroupKey)); + if (_ptr_LoadOrderGroupKey) { + NDR_PULL_ALLOC(ndr, r->in.LoadOrderGroupKey); + } else { + r->in.LoadOrderGroupKey = NULL; + } + if (r->in.LoadOrderGroupKey) { + _mem_save_LoadOrderGroupKey_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.LoadOrderGroupKey, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.LoadOrderGroupKey)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.LoadOrderGroupKey)); + if (ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey) > ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey), ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.LoadOrderGroupKey, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_LoadOrderGroupKey_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId)); + if (_ptr_TagId) { + NDR_PULL_ALLOC(ndr, r->in.TagId); + } else { + r->in.TagId = NULL; + } + if (r->in.TagId) { + _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.TagId, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.TagId)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); + if (_ptr_dependencies) { + NDR_PULL_ALLOC(ndr, r->in.dependencies); + } else { + r->in.dependencies = NULL; + } + if (r->in.dependencies) { + _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies)); + NDR_PULL_ALLOC_N(ndr, r->in.dependencies, ndr_get_array_size(ndr, &r->in.dependencies)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.dependencies, ndr_get_array_size(ndr, &r->in.dependencies))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dependencies_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name)); + if (_ptr_service_start_name) { + NDR_PULL_ALLOC(ndr, r->in.service_start_name); + } else { + r->in.service_start_name = NULL; + } + if (r->in.service_start_name) { + _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name)); + if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->in.password); + } else { + r->in.password = NULL; + } + if (r->in.password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); + NDR_PULL_ALLOC_N(ndr, r->in.password, ndr_get_array_size(ndr, &r->in.password)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.password, ndr_get_array_size(ndr, &r->in.password))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.password_size)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + if (r->in.dependencies) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.dependencies, r->in.dependencies_size)); + } + if (r->in.password) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.password, r->in.password_size)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId)); + if (_ptr_TagId) { + NDR_PULL_ALLOC(ndr, r->out.TagId); + } else { + r->out.TagId = NULL; + } + if (r->out.TagId) { + _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.TagId, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.TagId)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_CreateServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceW *r) +{ + ndr_print_struct(ndr, name, "svcctl_CreateServiceW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_CreateServiceW"); + ndr->depth++; + ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle); + ndr->depth--; + ndr_print_string(ndr, "ServiceName", r->in.ServiceName); + ndr_print_ptr(ndr, "DisplayName", r->in.DisplayName); + ndr->depth++; + if (r->in.DisplayName) { + ndr_print_string(ndr, "DisplayName", r->in.DisplayName); + } + ndr->depth--; + ndr_print_uint32(ndr, "desired_access", r->in.desired_access); + ndr_print_uint32(ndr, "type", r->in.type); + ndr_print_uint32(ndr, "start_type", r->in.start_type); + ndr_print_uint32(ndr, "error_control", r->in.error_control); + ndr_print_string(ndr, "binary_path", r->in.binary_path); + ndr_print_ptr(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey); + ndr->depth++; + if (r->in.LoadOrderGroupKey) { + ndr_print_string(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey); + } + ndr->depth--; + ndr_print_ptr(ndr, "TagId", r->in.TagId); + ndr->depth++; + if (r->in.TagId) { + ndr_print_uint32(ndr, "TagId", *r->in.TagId); + } + ndr->depth--; + ndr_print_ptr(ndr, "dependencies", r->in.dependencies); + ndr->depth++; + if (r->in.dependencies) { + ndr_print_array_uint8(ndr, "dependencies", r->in.dependencies, r->in.dependencies_size); + } + ndr->depth--; + ndr_print_uint32(ndr, "dependencies_size", r->in.dependencies_size); + ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name); + ndr->depth++; + if (r->in.service_start_name) { + ndr_print_string(ndr, "service_start_name", r->in.service_start_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->in.password); + ndr->depth++; + if (r->in.password) { + ndr_print_array_uint8(ndr, "password", r->in.password, r->in.password_size); + } + ndr->depth--; + ndr_print_uint32(ndr, "password_size", r->in.password_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_CreateServiceW"); + ndr->depth++; + ndr_print_ptr(ndr, "TagId", r->out.TagId); + ndr->depth++; + if (r->out.TagId) { + ndr_print_uint32(ndr, "TagId", *r->out.TagId); + } + ndr->depth--; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + } + if (flags & NDR_OUT) { + if (r->out.service_status == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.service_status, r->in.buf_size)); + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_EnumDependentServicesW(struct ndr_pull *ndr, int flags, struct svcctl_EnumDependentServicesW *r) +{ + TALLOC_CTX *_mem_save_service_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + TALLOC_CTX *_mem_save_services_returned_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.service); + } + _mem_save_service_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.service)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + if (r->in.buf_size < 0 || r->in.buf_size > 0x40000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->out.service_status, r->in.buf_size); + memset(r->out.service_status, 0, (r->in.buf_size) * sizeof(*r->out.service_status)); + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + NDR_PULL_ALLOC(ndr, r->out.services_returned); + ZERO_STRUCTP(r->out.services_returned); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service_status)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.service_status, ndr_get_array_size(ndr, &r->out.service_status)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service_status, ndr_get_array_size(ndr, &r->out.service_status))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 0x40000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.services_returned); + } + _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned)); + if (*r->out.services_returned < 0 || *r->out.services_returned > 0x40000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.service_status) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service_status, r->in.buf_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_EnumDependentServicesW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesW *r) +{ + ndr_print_struct(ndr, name, "svcctl_EnumDependentServicesW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_EnumDependentServicesW"); + ndr->depth++; + ndr_print_ptr(ndr, "service", r->in.service); + ndr->depth++; + ndr_print_policy_handle(ndr, "service", r->in.service); + ndr->depth--; + ndr_print_uint32(ndr, "state", r->in.state); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_EnumDependentServicesW"); + ndr->depth++; + ndr_print_ptr(ndr, "service_status", r->out.service_status); + ndr->depth++; + ndr_print_array_uint8(ndr, "service_status", r->out.service_status, r->in.buf_size); + ndr->depth--; + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_ptr(ndr, "services_returned", r->out.services_returned); + ndr->depth++; + ndr_print_uint32(ndr, "services_returned", *r->out.services_returned); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.service == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + 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 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 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_EnumServicesStatusW(struct ndr_pull *ndr, int flags, struct svcctl_EnumServicesStatusW *r) +{ + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + TALLOC_CTX *_mem_save_services_returned_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + if (r->in.buf_size < 0 || r->in.buf_size > 262144) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC_N(ndr, r->out.service, r->in.buf_size); + memset(r->out.service, 0, (r->in.buf_size) * sizeof(*r->out.service)); + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + NDR_PULL_ALLOC(ndr, r->out.services_returned); + ZERO_STRUCTP(r->out.services_returned); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.service, ndr_get_array_size(ndr, &r->out.service)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service, ndr_get_array_size(ndr, &r->out.service))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 262144) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.services_returned); + } + _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned)); + if (*r->out.services_returned < 0 || *r->out.services_returned > 262144) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.service) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service, r->in.buf_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_EnumServicesStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusW *r) +{ + ndr_print_struct(ndr, name, "svcctl_EnumServicesStatusW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_EnumServicesStatusW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "type", r->in.type); + ndr_print_uint32(ndr, "state", r->in.state); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_EnumServicesStatusW"); + ndr->depth++; + ndr_print_ptr(ndr, "service", r->out.service); + ndr->depth++; + ndr_print_array_uint8(ndr, "service", r->out.service, r->in.buf_size); + ndr->depth--; + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_ptr(ndr, "services_returned", r->out.services_returned); + ndr->depth++; + ndr_print_uint32(ndr, "services_returned", *r->out.services_returned); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_OpenSCManagerW(struct ndr_push *ndr, int flags, const struct svcctl_OpenSCManagerW *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.MachineName)); + if (r->in.MachineName) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.MachineName, ndr_charset_length(r->in.MachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DatabaseName)); + if (r->in.DatabaseName) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DatabaseName, ndr_charset_length(r->in.DatabaseName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_svcctl_MgrAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_OpenSCManagerW(struct ndr_pull *ndr, int flags, struct svcctl_OpenSCManagerW *r) +{ + uint32_t _ptr_MachineName; + uint32_t _ptr_DatabaseName; + TALLOC_CTX *_mem_save_MachineName_0; + TALLOC_CTX *_mem_save_DatabaseName_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_MachineName)); + if (_ptr_MachineName) { + NDR_PULL_ALLOC(ndr, r->in.MachineName); + } else { + r->in.MachineName = NULL; + } + if (r->in.MachineName) { + _mem_save_MachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.MachineName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.MachineName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.MachineName)); + if (ndr_get_array_length(ndr, &r->in.MachineName) > ndr_get_array_size(ndr, &r->in.MachineName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.MachineName), ndr_get_array_length(ndr, &r->in.MachineName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.MachineName, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_MachineName_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DatabaseName)); + if (_ptr_DatabaseName) { + NDR_PULL_ALLOC(ndr, r->in.DatabaseName); + } else { + r->in.DatabaseName = NULL; + } + if (r->in.DatabaseName) { + _mem_save_DatabaseName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.DatabaseName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DatabaseName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DatabaseName)); + if (ndr_get_array_length(ndr, &r->in.DatabaseName) > ndr_get_array_size(ndr, &r->in.DatabaseName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DatabaseName), ndr_get_array_length(ndr, &r->in.DatabaseName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DatabaseName, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DatabaseName_0, 0); + } + NDR_CHECK(ndr_pull_svcctl_MgrAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_OpenSCManagerW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerW *r) +{ + ndr_print_struct(ndr, name, "svcctl_OpenSCManagerW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_OpenSCManagerW"); + ndr->depth++; + ndr_print_ptr(ndr, "MachineName", r->in.MachineName); + ndr->depth++; + if (r->in.MachineName) { + ndr_print_string(ndr, "MachineName", r->in.MachineName); + } + ndr->depth--; + ndr_print_ptr(ndr, "DatabaseName", r->in.DatabaseName); + ndr->depth++; + if (r->in.DatabaseName) { + ndr_print_string(ndr, "DatabaseName", r->in.DatabaseName); + } + ndr->depth--; + ndr_print_svcctl_MgrAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_OpenSCManagerW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_svcctl_ServiceAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_OpenServiceW(struct ndr_pull *ndr, int flags, struct svcctl_OpenServiceW *r) +{ + TALLOC_CTX *_mem_save_scmanager_handle_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.scmanager_handle); + } + _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName)); + if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_svcctl_ServiceAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_OpenServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceW *r) +{ + ndr_print_struct(ndr, name, "svcctl_OpenServiceW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_OpenServiceW"); + ndr->depth++; + ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle); + ndr->depth--; + ndr_print_string(ndr, "ServiceName", r->in.ServiceName); + ndr_print_svcctl_ServiceAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_OpenServiceW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + } + if (flags & NDR_OUT) { + if (r->out.query == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_QUERY_SERVICE_CONFIG(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfigW(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfigW *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_query_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + if (r->in.buf_size < 0 || r->in.buf_size > 8192) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC(ndr, r->out.query); + ZERO_STRUCTP(r->out.query); + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.query); + } + _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_QUERY_SERVICE_CONFIG(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 8192) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_QueryServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigW *r) +{ + ndr_print_struct(ndr, name, "svcctl_QueryServiceConfigW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfigW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfigW"); + ndr->depth++; + ndr_print_ptr(ndr, "query", r->out.query); + ndr->depth++; + ndr_print_QUERY_SERVICE_CONFIG(ndr, "query", r->out.query); + ndr->depth--; + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_QueryServiceLockStatusW(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceLockStatusW *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_lock_status_0; + TALLOC_CTX *_mem_save_required_buf_size_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.lock_status); + ZERO_STRUCTP(r->out.lock_status); + NDR_PULL_ALLOC(ndr, r->out.required_buf_size); + ZERO_STRUCTP(r->out.required_buf_size); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.lock_status); + } + _mem_save_lock_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.lock_status, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_status_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.required_buf_size); + } + _mem_save_required_buf_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.required_buf_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.required_buf_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_required_buf_size_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_QueryServiceLockStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusW *r) +{ + ndr_print_struct(ndr, name, "svcctl_QueryServiceLockStatusW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_QueryServiceLockStatusW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_QueryServiceLockStatusW"); + ndr->depth++; + ndr_print_ptr(ndr, "lock_status", r->out.lock_status); + ndr->depth++; + ndr_print_SERVICE_LOCK_STATUS(ndr, "lock_status", r->out.lock_status); + ndr->depth--; + ndr_print_ptr(ndr, "required_buf_size", r->out.required_buf_size); + ndr->depth++; + ndr_print_uint32(ndr, "required_buf_size", *r->out.required_buf_size); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.NumArgs)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Arguments)); + if (r->in.Arguments) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Arguments, ndr_charset_length(r->in.Arguments, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_StartServiceW(struct ndr_pull *ndr, int flags, struct svcctl_StartServiceW *r) +{ + uint32_t _ptr_Arguments; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_Arguments_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.NumArgs)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Arguments)); + if (_ptr_Arguments) { + NDR_PULL_ALLOC(ndr, r->in.Arguments); + } else { + r->in.Arguments = NULL; + } + if (r->in.Arguments) { + _mem_save_Arguments_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Arguments, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Arguments)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Arguments)); + if (ndr_get_array_length(ndr, &r->in.Arguments) > ndr_get_array_size(ndr, &r->in.Arguments)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Arguments), ndr_get_array_length(ndr, &r->in.Arguments)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Arguments, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Arguments_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_StartServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceW *r) +{ + ndr_print_struct(ndr, name, "svcctl_StartServiceW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_StartServiceW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "NumArgs", r->in.NumArgs); + ndr_print_ptr(ndr, "Arguments", r->in.Arguments); + ndr->depth++; + if (r->in.Arguments) { + ndr_print_string(ndr, "Arguments", r->in.Arguments); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_StartServiceW"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); + if (r->in.service_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_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.service_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length)); + if (r->in.display_name_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length)); + } + } + if (flags & NDR_OUT) { + if (r->out.display_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.display_name)); + if (*r->out.display_name) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); + if (r->out.display_name_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameW(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceDisplayNameW *r) +{ + uint32_t _ptr_service_name; + uint32_t _ptr_display_name; + uint32_t _ptr_display_name_length; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_service_name_0; + TALLOC_CTX *_mem_save_display_name_0; + TALLOC_CTX *_mem_save_display_name_1; + TALLOC_CTX *_mem_save_display_name_length_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); + if (_ptr_service_name) { + NDR_PULL_ALLOC(ndr, r->in.service_name); + } else { + r->in.service_name = NULL; + } + if (r->in.service_name) { + _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name)); + if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); + if (_ptr_display_name_length) { + NDR_PULL_ALLOC(ndr, r->in.display_name_length); + } else { + r->in.display_name_length = NULL; + } + if (r->in.display_name_length) { + _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.display_name); + ZERO_STRUCTP(r->out.display_name); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.display_name); + } + _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); + if (_ptr_display_name) { + NDR_PULL_ALLOC(ndr, *r->out.display_name); + } else { + *r->out.display_name = NULL; + } + if (*r->out.display_name) { + _mem_save_display_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.display_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name)); + if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.display_name), ndr_get_array_length(ndr, r->out.display_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); + if (_ptr_display_name_length) { + NDR_PULL_ALLOC(ndr, r->out.display_name_length); + } else { + r->out.display_name_length = NULL; + } + if (r->out.display_name_length) { + _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameW *r) +{ + ndr_print_struct(ndr, name, "svcctl_GetServiceDisplayNameW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_GetServiceDisplayNameW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "service_name", r->in.service_name); + ndr->depth++; + if (r->in.service_name) { + ndr_print_string(ndr, "service_name", r->in.service_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length); + ndr->depth++; + if (r->in.display_name_length) { + ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_GetServiceDisplayNameW"); + ndr->depth++; + ndr_print_ptr(ndr, "display_name", r->out.display_name); + ndr->depth++; + ndr_print_ptr(ndr, "display_name", *r->out.display_name); + ndr->depth++; + if (*r->out.display_name) { + ndr_print_string(ndr, "display_name", *r->out.display_name); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); + ndr->depth++; + if (r->out.display_name_length) { + ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); + if (r->in.service_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_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.service_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length)); + if (r->in.display_name_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length)); + } + } + if (flags & NDR_OUT) { + if (r->out.key_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_name)); + if (*r->out.key_name) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); + if (r->out.display_name_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameW(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceKeyNameW *r) +{ + uint32_t _ptr_service_name; + uint32_t _ptr_key_name; + uint32_t _ptr_display_name_length; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_service_name_0; + TALLOC_CTX *_mem_save_key_name_0; + TALLOC_CTX *_mem_save_key_name_1; + TALLOC_CTX *_mem_save_display_name_length_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); + if (_ptr_service_name) { + NDR_PULL_ALLOC(ndr, r->in.service_name); + } else { + r->in.service_name = NULL; + } + if (r->in.service_name) { + _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name)); + if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); + if (_ptr_display_name_length) { + NDR_PULL_ALLOC(ndr, r->in.display_name_length); + } else { + r->in.display_name_length = NULL; + } + if (r->in.display_name_length) { + _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.key_name); + ZERO_STRUCTP(r->out.key_name); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.key_name); + } + _mem_save_key_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.key_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_name)); + if (_ptr_key_name) { + NDR_PULL_ALLOC(ndr, *r->out.key_name); + } else { + *r->out.key_name = NULL; + } + if (*r->out.key_name) { + _mem_save_key_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name)); + if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.key_name), ndr_get_array_length(ndr, r->out.key_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); + if (_ptr_display_name_length) { + NDR_PULL_ALLOC(ndr, r->out.display_name_length); + } else { + r->out.display_name_length = NULL; + } + if (r->out.display_name_length) { + _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_GetServiceKeyNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameW *r) +{ + ndr_print_struct(ndr, name, "svcctl_GetServiceKeyNameW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_GetServiceKeyNameW"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "service_name", r->in.service_name); + ndr->depth++; + if (r->in.service_name) { + ndr_print_string(ndr, "service_name", r->in.service_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length); + ndr->depth++; + if (r->in.display_name_length) { + ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_GetServiceKeyNameW"); + ndr->depth++; + ndr_print_ptr(ndr, "key_name", r->out.key_name); + ndr->depth++; + ndr_print_ptr(ndr, "key_name", *r->out.key_name); + ndr->depth++; + if (*r->out.key_name) { + ndr_print_string(ndr, "key_name", *r->out.key_name); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); + ndr->depth++; + if (r->out.display_name_length) { + ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.immediate)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_SCSetServiceBitsA(struct ndr_pull *ndr, int flags, struct svcctl_SCSetServiceBitsA *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bits)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bitson)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.immediate)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_SCSetServiceBitsA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsA *r) +{ + ndr_print_struct(ndr, name, "svcctl_SCSetServiceBitsA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_SCSetServiceBitsA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "bits", r->in.bits); + ndr_print_uint32(ndr, "bitson", r->in.bitson); + ndr_print_uint32(ndr, "immediate", r->in.immediate); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_SCSetServiceBitsA"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.error)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path)); + if (r->in.binary_path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_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.binary_path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.load_order_group)); + if (r->in.load_order_group) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.load_order_group, ndr_charset_length(r->in.load_order_group, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies)); + if (r->in.dependencies) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name)); + if (r->in.service_start_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_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.service_start_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); + if (r->in.password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name)); + if (r->in.display_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_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.display_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.display_name, ndr_charset_length(r->in.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfigA(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfigA *r) +{ + uint32_t _ptr_binary_path; + uint32_t _ptr_load_order_group; + uint32_t _ptr_dependencies; + uint32_t _ptr_service_start_name; + uint32_t _ptr_password; + uint32_t _ptr_display_name; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_binary_path_0; + TALLOC_CTX *_mem_save_load_order_group_0; + TALLOC_CTX *_mem_save_tag_id_0; + TALLOC_CTX *_mem_save_dependencies_0; + TALLOC_CTX *_mem_save_service_start_name_0; + TALLOC_CTX *_mem_save_password_0; + TALLOC_CTX *_mem_save_display_name_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.error)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path)); + if (_ptr_binary_path) { + NDR_PULL_ALLOC(ndr, r->in.binary_path); + } else { + r->in.binary_path = NULL; + } + if (r->in.binary_path) { + _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path)); + if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_load_order_group)); + if (_ptr_load_order_group) { + NDR_PULL_ALLOC(ndr, r->in.load_order_group); + } else { + r->in.load_order_group = NULL; + } + if (r->in.load_order_group) { + _mem_save_load_order_group_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.load_order_group, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.load_order_group)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.load_order_group)); + if (ndr_get_array_length(ndr, &r->in.load_order_group) > ndr_get_array_size(ndr, &r->in.load_order_group)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.load_order_group), ndr_get_array_length(ndr, &r->in.load_order_group)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.load_order_group, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_load_order_group_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); + if (_ptr_dependencies) { + NDR_PULL_ALLOC(ndr, r->in.dependencies); + } else { + r->in.dependencies = NULL; + } + if (r->in.dependencies) { + _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies)); + if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name)); + if (_ptr_service_start_name) { + NDR_PULL_ALLOC(ndr, r->in.service_start_name); + } else { + r->in.service_start_name = NULL; + } + if (r->in.service_start_name) { + _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name)); + if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->in.password); + } else { + r->in.password = NULL; + } + if (r->in.password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); + if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); + if (_ptr_display_name) { + NDR_PULL_ALLOC(ndr, r->in.display_name); + } else { + r->in.display_name = NULL; + } + if (r->in.display_name) { + _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.display_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.display_name)); + if (ndr_get_array_length(ndr, &r->in.display_name) > ndr_get_array_size(ndr, &r->in.display_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.display_name), ndr_get_array_length(ndr, &r->in.display_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.display_name, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.tag_id); + ZERO_STRUCTP(r->out.tag_id); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.tag_id); + } + _mem_save_tag_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.tag_id, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.tag_id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tag_id_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_ChangeServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigA *r) +{ + ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfigA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfigA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "type", r->in.type); + ndr_print_uint32(ndr, "start", r->in.start); + ndr_print_uint32(ndr, "error", r->in.error); + ndr_print_ptr(ndr, "binary_path", r->in.binary_path); + ndr->depth++; + if (r->in.binary_path) { + ndr_print_string(ndr, "binary_path", r->in.binary_path); + } + ndr->depth--; + ndr_print_ptr(ndr, "load_order_group", r->in.load_order_group); + ndr->depth++; + if (r->in.load_order_group) { + ndr_print_string(ndr, "load_order_group", r->in.load_order_group); + } + ndr->depth--; + ndr_print_ptr(ndr, "dependencies", r->in.dependencies); + ndr->depth++; + if (r->in.dependencies) { + ndr_print_string(ndr, "dependencies", r->in.dependencies); + } + ndr->depth--; + ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name); + ndr->depth++; + if (r->in.service_start_name) { + ndr_print_string(ndr, "service_start_name", r->in.service_start_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->in.password); + ndr->depth++; + if (r->in.password) { + ndr_print_string(ndr, "password", r->in.password); + } + ndr->depth--; + ndr_print_ptr(ndr, "display_name", r->in.display_name); + ndr->depth++; + if (r->in.display_name) { + ndr_print_string(ndr, "display_name", r->in.display_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfigA"); + ndr->depth++; + ndr_print_ptr(ndr, "tag_id", r->out.tag_id); + ndr->depth++; + ndr_print_uint32(ndr, "tag_id", *r->out.tag_id); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ServiceName)); + if (r->in.ServiceName) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DisplayName)); + if (r->in.DisplayName) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DisplayName, ndr_charset_length(r->in.DisplayName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.desired_access)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.error_control)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path)); + if (r->in.binary_path) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_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.binary_path, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.LoadOrderGroupKey)); + if (r->in.LoadOrderGroupKey) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.LoadOrderGroupKey, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies)); + if (r->in.dependencies) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name)); + if (r->in.service_start_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_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.service_start_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); + if (r->in.password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.TagId)); + if (r->out.TagId) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.TagId)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_CreateServiceA(struct ndr_pull *ndr, int flags, struct svcctl_CreateServiceA *r) +{ + uint32_t _ptr_ServiceName; + uint32_t _ptr_DisplayName; + uint32_t _ptr_binary_path; + uint32_t _ptr_LoadOrderGroupKey; + uint32_t _ptr_TagId; + uint32_t _ptr_dependencies; + uint32_t _ptr_service_start_name; + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_ServiceName_0; + TALLOC_CTX *_mem_save_DisplayName_0; + TALLOC_CTX *_mem_save_binary_path_0; + TALLOC_CTX *_mem_save_LoadOrderGroupKey_0; + TALLOC_CTX *_mem_save_TagId_0; + TALLOC_CTX *_mem_save_dependencies_0; + TALLOC_CTX *_mem_save_service_start_name_0; + TALLOC_CTX *_mem_save_password_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ServiceName)); + if (_ptr_ServiceName) { + NDR_PULL_ALLOC(ndr, r->in.ServiceName); + } else { + r->in.ServiceName = NULL; + } + if (r->in.ServiceName) { + _mem_save_ServiceName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.ServiceName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName)); + if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ServiceName_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DisplayName)); + if (_ptr_DisplayName) { + NDR_PULL_ALLOC(ndr, r->in.DisplayName); + } else { + r->in.DisplayName = NULL; + } + if (r->in.DisplayName) { + _mem_save_DisplayName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.DisplayName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DisplayName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DisplayName)); + if (ndr_get_array_length(ndr, &r->in.DisplayName) > ndr_get_array_size(ndr, &r->in.DisplayName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DisplayName), ndr_get_array_length(ndr, &r->in.DisplayName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DisplayName, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DisplayName_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.desired_access)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.error_control)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path)); + if (_ptr_binary_path) { + NDR_PULL_ALLOC(ndr, r->in.binary_path); + } else { + r->in.binary_path = NULL; + } + if (r->in.binary_path) { + _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path)); + if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_LoadOrderGroupKey)); + if (_ptr_LoadOrderGroupKey) { + NDR_PULL_ALLOC(ndr, r->in.LoadOrderGroupKey); + } else { + r->in.LoadOrderGroupKey = NULL; + } + if (r->in.LoadOrderGroupKey) { + _mem_save_LoadOrderGroupKey_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.LoadOrderGroupKey, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.LoadOrderGroupKey)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.LoadOrderGroupKey)); + if (ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey) > ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey), ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.LoadOrderGroupKey, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_LoadOrderGroupKey_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); + if (_ptr_dependencies) { + NDR_PULL_ALLOC(ndr, r->in.dependencies); + } else { + r->in.dependencies = NULL; + } + if (r->in.dependencies) { + _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies)); + if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name)); + if (_ptr_service_start_name) { + NDR_PULL_ALLOC(ndr, r->in.service_start_name); + } else { + r->in.service_start_name = NULL; + } + if (r->in.service_start_name) { + _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name)); + if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->in.password); + } else { + r->in.password = NULL; + } + if (r->in.password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); + if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId)); + if (_ptr_TagId) { + NDR_PULL_ALLOC(ndr, r->out.TagId); + } else { + r->out.TagId = NULL; + } + if (r->out.TagId) { + _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.TagId, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.TagId)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_CreateServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceA *r) +{ + ndr_print_struct(ndr, name, "svcctl_CreateServiceA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_CreateServiceA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "ServiceName", r->in.ServiceName); + ndr->depth++; + if (r->in.ServiceName) { + ndr_print_string(ndr, "ServiceName", r->in.ServiceName); + } + ndr->depth--; + ndr_print_ptr(ndr, "DisplayName", r->in.DisplayName); + ndr->depth++; + if (r->in.DisplayName) { + ndr_print_string(ndr, "DisplayName", r->in.DisplayName); + } + ndr->depth--; + ndr_print_uint32(ndr, "desired_access", r->in.desired_access); + ndr_print_uint32(ndr, "type", r->in.type); + ndr_print_uint32(ndr, "start_type", r->in.start_type); + ndr_print_uint32(ndr, "error_control", r->in.error_control); + ndr_print_ptr(ndr, "binary_path", r->in.binary_path); + ndr->depth++; + if (r->in.binary_path) { + ndr_print_string(ndr, "binary_path", r->in.binary_path); + } + ndr->depth--; + ndr_print_ptr(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey); + ndr->depth++; + if (r->in.LoadOrderGroupKey) { + ndr_print_string(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey); + } + ndr->depth--; + ndr_print_ptr(ndr, "dependencies", r->in.dependencies); + ndr->depth++; + if (r->in.dependencies) { + ndr_print_string(ndr, "dependencies", r->in.dependencies); + } + ndr->depth--; + ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name); + ndr->depth++; + if (r->in.service_start_name) { + ndr_print_string(ndr, "service_start_name", r->in.service_start_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->in.password); + ndr->depth++; + if (r->in.password) { + ndr_print_string(ndr, "password", r->in.password); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_CreateServiceA"); + ndr->depth++; + ndr_print_ptr(ndr, "TagId", r->out.TagId); + ndr->depth++; + if (r->out.TagId) { + ndr_print_uint32(ndr, "TagId", *r->out.TagId); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.service_status)); + 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_EnumDependentServicesA(struct ndr_pull *ndr, int flags, struct svcctl_EnumDependentServicesA *r) +{ + uint32_t _ptr_service_status; + TALLOC_CTX *_mem_save_service_0; + TALLOC_CTX *_mem_save_service_status_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + TALLOC_CTX *_mem_save_services_returned_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.service); + } + _mem_save_service_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.service)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + NDR_PULL_ALLOC(ndr, r->out.services_returned); + ZERO_STRUCTP(r->out.services_returned); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_status)); + if (_ptr_service_status) { + NDR_PULL_ALLOC(ndr, r->out.service_status); + } else { + r->out.service_status = NULL; + } + if (r->out.service_status) { + _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, 0); + NDR_CHECK(ndr_pull_ENUM_SERVICE_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.service_status)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.services_returned); + } + _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_EnumDependentServicesA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesA *r) +{ + ndr_print_struct(ndr, name, "svcctl_EnumDependentServicesA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_EnumDependentServicesA"); + ndr->depth++; + ndr_print_ptr(ndr, "service", r->in.service); + ndr->depth++; + ndr_print_policy_handle(ndr, "service", r->in.service); + ndr->depth--; + ndr_print_uint32(ndr, "state", r->in.state); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_EnumDependentServicesA"); + ndr->depth++; + ndr_print_ptr(ndr, "service_status", r->out.service_status); + ndr->depth++; + if (r->out.service_status) { + ndr_print_ENUM_SERVICE_STATUS(ndr, "service_status", r->out.service_status); + } + ndr->depth--; + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_ptr(ndr, "services_returned", r->out.services_returned); + ndr->depth++; + ndr_print_uint32(ndr, "services_returned", *r->out.services_returned); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + 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 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 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) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_EnumServicesStatusA(struct ndr_pull *ndr, int flags, struct svcctl_EnumServicesStatusA *r) +{ + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + TALLOC_CTX *_mem_save_services_returned_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + NDR_PULL_ALLOC(ndr, r->out.services_returned); + ZERO_STRUCTP(r->out.services_returned); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service)); + NDR_PULL_ALLOC_N(ndr, r->out.service, ndr_get_array_size(ndr, &r->out.service)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service, ndr_get_array_size(ndr, &r->out.service))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.services_returned); + } + _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.service) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service, r->in.buf_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_EnumServicesStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusA *r) +{ + ndr_print_struct(ndr, name, "svcctl_EnumServicesStatusA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_EnumServicesStatusA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "type", r->in.type); + ndr_print_uint32(ndr, "state", r->in.state); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_EnumServicesStatusA"); + ndr->depth++; + ndr_print_array_uint8(ndr, "service", r->out.service, r->in.buf_size); + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_ptr(ndr, "services_returned", r->out.services_returned); + ndr->depth++; + ndr_print_uint32(ndr, "services_returned", *r->out.services_returned); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_OpenSCManagerA(struct ndr_push *ndr, int flags, const struct svcctl_OpenSCManagerA *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.MachineName)); + if (r->in.MachineName) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.MachineName, ndr_charset_length(r->in.MachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DatabaseName)); + if (r->in.DatabaseName) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DatabaseName, ndr_charset_length(r->in.DatabaseName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_OpenSCManagerA(struct ndr_pull *ndr, int flags, struct svcctl_OpenSCManagerA *r) +{ + uint32_t _ptr_MachineName; + uint32_t _ptr_DatabaseName; + TALLOC_CTX *_mem_save_MachineName_0; + TALLOC_CTX *_mem_save_DatabaseName_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_MachineName)); + if (_ptr_MachineName) { + NDR_PULL_ALLOC(ndr, r->in.MachineName); + } else { + r->in.MachineName = NULL; + } + if (r->in.MachineName) { + _mem_save_MachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.MachineName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.MachineName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.MachineName)); + if (ndr_get_array_length(ndr, &r->in.MachineName) > ndr_get_array_size(ndr, &r->in.MachineName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.MachineName), ndr_get_array_length(ndr, &r->in.MachineName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.MachineName, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_MachineName_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DatabaseName)); + if (_ptr_DatabaseName) { + NDR_PULL_ALLOC(ndr, r->in.DatabaseName); + } else { + r->in.DatabaseName = NULL; + } + if (r->in.DatabaseName) { + _mem_save_DatabaseName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.DatabaseName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DatabaseName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DatabaseName)); + if (ndr_get_array_length(ndr, &r->in.DatabaseName) > ndr_get_array_size(ndr, &r->in.DatabaseName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DatabaseName), ndr_get_array_length(ndr, &r->in.DatabaseName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DatabaseName, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DatabaseName_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_OpenSCManagerA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerA *r) +{ + ndr_print_struct(ndr, name, "svcctl_OpenSCManagerA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_OpenSCManagerA"); + ndr->depth++; + ndr_print_ptr(ndr, "MachineName", r->in.MachineName); + ndr->depth++; + if (r->in.MachineName) { + ndr_print_string(ndr, "MachineName", r->in.MachineName); + } + ndr->depth--; + ndr_print_ptr(ndr, "DatabaseName", r->in.DatabaseName); + ndr->depth++; + if (r->in.DatabaseName) { + ndr_print_string(ndr, "DatabaseName", r->in.DatabaseName); + } + ndr->depth--; + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_OpenSCManagerA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ServiceName)); + if (r->in.ServiceName) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_OpenServiceA(struct ndr_pull *ndr, int flags, struct svcctl_OpenServiceA *r) +{ + uint32_t _ptr_ServiceName; + TALLOC_CTX *_mem_save_scmanager_handle_0; + TALLOC_CTX *_mem_save_ServiceName_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.scmanager_handle); + } + _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ServiceName)); + if (_ptr_ServiceName) { + NDR_PULL_ALLOC(ndr, r->in.ServiceName); + } else { + r->in.ServiceName = NULL; + } + if (r->in.ServiceName) { + _mem_save_ServiceName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.ServiceName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName)); + if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ServiceName_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_OpenServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceA *r) +{ + ndr_print_struct(ndr, name, "svcctl_OpenServiceA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_OpenServiceA"); + ndr->depth++; + ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle); + ndr->depth--; + ndr_print_ptr(ndr, "ServiceName", r->in.ServiceName); + ndr->depth++; + if (r->in.ServiceName) { + ndr_print_string(ndr, "ServiceName", r->in.ServiceName); + } + ndr->depth--; + ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_OpenServiceA"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfigA(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfigA *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + } + if (flags & NDR_OUT) { + NDR_PULL_ALLOC_N(ndr, r->out.query, r->in.buf_size); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.query, r->in.buf_size)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_QueryServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigA *r) +{ + ndr_print_struct(ndr, name, "svcctl_QueryServiceConfigA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfigA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfigA"); + ndr->depth++; + ndr_print_array_uint8(ndr, "query", r->out.query, r->in.buf_size); + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_QueryServiceLockStatusA(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceLockStatusA *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_lock_status_0; + TALLOC_CTX *_mem_save_required_buf_size_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.lock_status); + ZERO_STRUCTP(r->out.lock_status); + NDR_PULL_ALLOC(ndr, r->out.required_buf_size); + ZERO_STRUCTP(r->out.required_buf_size); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.lock_status); + } + _mem_save_lock_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.lock_status, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_status_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.required_buf_size); + } + _mem_save_required_buf_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.required_buf_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.required_buf_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_required_buf_size_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_QueryServiceLockStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusA *r) +{ + ndr_print_struct(ndr, name, "svcctl_QueryServiceLockStatusA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_QueryServiceLockStatusA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_QueryServiceLockStatusA"); + ndr->depth++; + ndr_print_ptr(ndr, "lock_status", r->out.lock_status); + ndr->depth++; + ndr_print_SERVICE_LOCK_STATUS(ndr, "lock_status", r->out.lock_status); + ndr->depth--; + ndr_print_ptr(ndr, "required_buf_size", r->out.required_buf_size); + ndr->depth++; + ndr_print_uint32(ndr, "required_buf_size", *r->out.required_buf_size); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.NumArgs)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Arguments)); + if (r->in.Arguments) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Arguments, ndr_charset_length(r->in.Arguments, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_StartServiceA(struct ndr_pull *ndr, int flags, struct svcctl_StartServiceA *r) +{ + uint32_t _ptr_Arguments; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_Arguments_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.NumArgs)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Arguments)); + if (_ptr_Arguments) { + NDR_PULL_ALLOC(ndr, r->in.Arguments); + } else { + r->in.Arguments = NULL; + } + if (r->in.Arguments) { + _mem_save_Arguments_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Arguments, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Arguments)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Arguments)); + if (ndr_get_array_length(ndr, &r->in.Arguments) > ndr_get_array_size(ndr, &r->in.Arguments)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Arguments), ndr_get_array_length(ndr, &r->in.Arguments)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Arguments, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Arguments_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_StartServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceA *r) +{ + ndr_print_struct(ndr, name, "svcctl_StartServiceA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_StartServiceA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "NumArgs", r->in.NumArgs); + ndr_print_ptr(ndr, "Arguments", r->in.Arguments); + ndr->depth++; + if (r->in.Arguments) { + ndr_print_string(ndr, "Arguments", r->in.Arguments); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_StartServiceA"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); + if (r->in.service_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_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.service_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length)); + if (r->in.display_name_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length)); + } + } + if (flags & NDR_OUT) { + if (r->out.display_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.display_name)); + if (*r->out.display_name) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); + if (r->out.display_name_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameA(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceDisplayNameA *r) +{ + uint32_t _ptr_service_name; + uint32_t _ptr_display_name; + uint32_t _ptr_display_name_length; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_service_name_0; + TALLOC_CTX *_mem_save_display_name_0; + TALLOC_CTX *_mem_save_display_name_1; + TALLOC_CTX *_mem_save_display_name_length_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); + if (_ptr_service_name) { + NDR_PULL_ALLOC(ndr, r->in.service_name); + } else { + r->in.service_name = NULL; + } + if (r->in.service_name) { + _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name)); + if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); + if (_ptr_display_name_length) { + NDR_PULL_ALLOC(ndr, r->in.display_name_length); + } else { + r->in.display_name_length = NULL; + } + if (r->in.display_name_length) { + _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.display_name); + ZERO_STRUCTP(r->out.display_name); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.display_name); + } + _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); + if (_ptr_display_name) { + NDR_PULL_ALLOC(ndr, *r->out.display_name); + } else { + *r->out.display_name = NULL; + } + if (*r->out.display_name) { + _mem_save_display_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.display_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name)); + if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.display_name), ndr_get_array_length(ndr, r->out.display_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); + if (_ptr_display_name_length) { + NDR_PULL_ALLOC(ndr, r->out.display_name_length); + } else { + r->out.display_name_length = NULL; + } + if (r->out.display_name_length) { + _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameA *r) +{ + ndr_print_struct(ndr, name, "svcctl_GetServiceDisplayNameA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_GetServiceDisplayNameA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "service_name", r->in.service_name); + ndr->depth++; + if (r->in.service_name) { + ndr_print_string(ndr, "service_name", r->in.service_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length); + ndr->depth++; + if (r->in.display_name_length) { + ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_GetServiceDisplayNameA"); + ndr->depth++; + ndr_print_ptr(ndr, "display_name", r->out.display_name); + ndr->depth++; + ndr_print_ptr(ndr, "display_name", *r->out.display_name); + ndr->depth++; + if (*r->out.display_name) { + ndr_print_string(ndr, "display_name", *r->out.display_name); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); + ndr->depth++; + if (r->out.display_name_length) { + ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); + if (r->in.service_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_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.service_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length)); + if (r->in.display_name_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length)); + } + } + if (flags & NDR_OUT) { + if (r->out.key_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_name)); + if (*r->out.key_name) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); + if (r->out.display_name_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameA(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceKeyNameA *r) +{ + uint32_t _ptr_service_name; + uint32_t _ptr_key_name; + uint32_t _ptr_display_name_length; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_service_name_0; + TALLOC_CTX *_mem_save_key_name_0; + TALLOC_CTX *_mem_save_key_name_1; + TALLOC_CTX *_mem_save_display_name_length_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); + if (_ptr_service_name) { + NDR_PULL_ALLOC(ndr, r->in.service_name); + } else { + r->in.service_name = NULL; + } + if (r->in.service_name) { + _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name)); + if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); + if (_ptr_display_name_length) { + NDR_PULL_ALLOC(ndr, r->in.display_name_length); + } else { + r->in.display_name_length = NULL; + } + if (r->in.display_name_length) { + _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.key_name); + ZERO_STRUCTP(r->out.key_name); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.key_name); + } + _mem_save_key_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.key_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_name)); + if (_ptr_key_name) { + NDR_PULL_ALLOC(ndr, *r->out.key_name); + } else { + *r->out.key_name = NULL; + } + if (*r->out.key_name) { + _mem_save_key_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name)); + if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.key_name), ndr_get_array_length(ndr, r->out.key_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); + if (_ptr_display_name_length) { + NDR_PULL_ALLOC(ndr, r->out.display_name_length); + } else { + r->out.display_name_length = NULL; + } + if (r->out.display_name_length) { + _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_GetServiceKeyNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameA *r) +{ + ndr_print_struct(ndr, name, "svcctl_GetServiceKeyNameA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_GetServiceKeyNameA"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "service_name", r->in.service_name); + ndr->depth++; + if (r->in.service_name) { + ndr_print_string(ndr, "service_name", r->in.service_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length); + ndr->depth++; + if (r->in.display_name_length) { + ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_GetServiceKeyNameA"); + ndr->depth++; + ndr_print_ptr(ndr, "key_name", r->out.key_name); + ndr->depth++; + ndr_print_ptr(ndr, "key_name", *r->out.key_name); + ndr->depth++; + if (*r->out.key_name) { + ndr_print_string(ndr, "key_name", *r->out.key_name); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); + ndr->depth++; + if (r->out.display_name_length) { + ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_GetCurrentGroupeStateW(struct ndr_push *ndr, int flags, const struct svcctl_GetCurrentGroupeStateW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_GetCurrentGroupeStateW(struct ndr_pull *ndr, int flags, struct svcctl_GetCurrentGroupeStateW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_GetCurrentGroupeStateW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetCurrentGroupeStateW *r) +{ + ndr_print_struct(ndr, name, "svcctl_GetCurrentGroupeStateW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_GetCurrentGroupeStateW"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_GetCurrentGroupeStateW"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_EnumServiceGroupW(struct ndr_push *ndr, int flags, const struct svcctl_EnumServiceGroupW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_EnumServiceGroupW(struct ndr_pull *ndr, int flags, struct svcctl_EnumServiceGroupW *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_EnumServiceGroupW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServiceGroupW *r) +{ + ndr_print_struct(ndr, name, "svcctl_EnumServiceGroupW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_EnumServiceGroupW"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_EnumServiceGroupW"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + if (r->in.info) { + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.info)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfig2A(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfig2A *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->in.info); + } else { + r->in.info = NULL; + } + if (r->in.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_ChangeServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2A *r) +{ + ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfig2A"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfig2A"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "info_level", r->in.info_level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + if (r->in.info) { + ndr_print_uint8(ndr, "info", *r->in.info); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfig2A"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + if (r->in.info) { + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.info)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfig2W(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfig2W *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->in.info); + } else { + r->in.info = NULL; + } + if (r->in.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_ChangeServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2W *r) +{ + ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfig2W"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfig2W"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "info_level", r->in.info_level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + if (r->in.info) { + ndr_print_uint8(ndr, "info", *r->in.info); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfig2W"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfig2A(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfig2A *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + } + if (flags & NDR_OUT) { + NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buf_size); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buf_size)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2A *r) +{ + ndr_print_struct(ndr, name, "svcctl_QueryServiceConfig2A"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfig2A"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "info_level", r->in.info_level); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfig2A"); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buf_size); + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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) { + if (r->out.buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buf_size)); + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfig2W(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfig2W *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + if (r->in.buf_size < 0 || r->in.buf_size > 8192) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buf_size); + memset(r->out.buffer, 0, (r->in.buf_size) * sizeof(*r->out.buffer)); + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 8192) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.buf_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2W *r) +{ + ndr_print_struct(ndr, name, "svcctl_QueryServiceConfig2W"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfig2W"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "info_level", r->in.info_level); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfig2W"); + ndr->depth++; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buf_size); + ndr->depth--; + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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) { + if (r->out.buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buf_size)); + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_QueryServiceStatusEx(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceStatusEx *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + if (r->in.buf_size < 0 || r->in.buf_size > 8192) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buf_size); + memset(r->out.buffer, 0, (r->in.buf_size) * sizeof(*r->out.buffer)); + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 8192) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.buf_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_QueryServiceStatusEx(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatusEx *r) +{ + ndr_print_struct(ndr, name, "svcctl_QueryServiceStatusEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_QueryServiceStatusEx"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "info_level", r->in.info_level); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_QueryServiceStatusEx"); + ndr->depth++; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buf_size); + ndr->depth--; + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_EnumServicesStatusExA(struct ndr_push *ndr, int flags, const struct EnumServicesStatusExA *r) +{ + if (flags & NDR_IN) { + 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, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.state)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + 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 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.group_name)); + if (*r->out.group_name) { + 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.group_name, ndr_charset_length(*r->out.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_EnumServicesStatusExA(struct ndr_pull *ndr, int flags, struct EnumServicesStatusExA *r) +{ + uint32_t _ptr_resume_handle; + uint32_t _ptr_group_name; + TALLOC_CTX *_mem_save_scmanager_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + TALLOC_CTX *_mem_save_service_returned_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_group_name_0; + TALLOC_CTX *_mem_save_group_name_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.scmanager); + } + _mem_save_scmanager_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + NDR_PULL_ALLOC(ndr, r->out.service_returned); + ZERO_STRUCTP(r->out.service_returned); + NDR_PULL_ALLOC(ndr, r->out.group_name); + ZERO_STRUCTP(r->out.group_name); + } + if (flags & NDR_OUT) { + NDR_PULL_ALLOC_N(ndr, r->out.services, r->in.buf_size); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.services, r->in.buf_size)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.service_returned); + } + _mem_save_service_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.service_returned, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.service_returned)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_returned_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.group_name); + } + _mem_save_group_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.group_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_name)); + if (_ptr_group_name) { + NDR_PULL_ALLOC(ndr, *r->out.group_name); + } else { + *r->out.group_name = NULL; + } + if (*r->out.group_name) { + _mem_save_group_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.group_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.group_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.group_name)); + if (ndr_get_array_length(ndr, r->out.group_name) > ndr_get_array_size(ndr, r->out.group_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.group_name), ndr_get_array_length(ndr, r->out.group_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.group_name, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_EnumServicesStatusExA(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExA *r) +{ + ndr_print_struct(ndr, name, "EnumServicesStatusExA"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "EnumServicesStatusExA"); + ndr->depth++; + ndr_print_ptr(ndr, "scmanager", r->in.scmanager); + ndr->depth++; + ndr_print_policy_handle(ndr, "scmanager", r->in.scmanager); + ndr->depth--; + ndr_print_uint32(ndr, "info_level", r->in.info_level); + ndr_print_uint32(ndr, "type", r->in.type); + ndr_print_uint32(ndr, "state", r->in.state); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "EnumServicesStatusExA"); + ndr->depth++; + ndr_print_array_uint8(ndr, "services", r->out.services, r->in.buf_size); + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_ptr(ndr, "service_returned", r->out.service_returned); + ndr->depth++; + ndr_print_uint32(ndr, "service_returned", *r->out.service_returned); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_ptr(ndr, "group_name", r->out.group_name); + ndr->depth++; + ndr_print_ptr(ndr, "group_name", *r->out.group_name); + ndr->depth++; + if (*r->out.group_name) { + ndr_print_string(ndr, "group_name", *r->out.group_name); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_EnumServicesStatusExW(struct ndr_push *ndr, int flags, const struct EnumServicesStatusExW *r) +{ + if (flags & NDR_IN) { + 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, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.state)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.group_name)); + if (r->in.group_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.group_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.group_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.group_name, ndr_charset_length(r->in.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + if (r->out.services == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.services, r->in.buf_size)); + 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 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)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_EnumServicesStatusExW(struct ndr_pull *ndr, int flags, struct EnumServicesStatusExW *r) +{ + uint32_t _ptr_resume_handle; + uint32_t _ptr_group_name; + TALLOC_CTX *_mem_save_scmanager_0; + TALLOC_CTX *_mem_save_bytes_needed_0; + TALLOC_CTX *_mem_save_service_returned_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_group_name_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.scmanager); + } + _mem_save_scmanager_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + if (r->in.buf_size < 0 || r->in.buf_size > 262144) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + if (*r->in.resume_handle < 0 || *r->in.resume_handle > 262144) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_name)); + if (_ptr_group_name) { + NDR_PULL_ALLOC(ndr, r->in.group_name); + } else { + r->in.group_name = NULL; + } + if (r->in.group_name) { + _mem_save_group_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.group_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.group_name)); + if (ndr_get_array_length(ndr, &r->in.group_name) > ndr_get_array_size(ndr, &r->in.group_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.group_name), ndr_get_array_length(ndr, &r->in.group_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.group_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.group_name, ndr_get_array_length(ndr, &r->in.group_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_0, 0); + } + NDR_PULL_ALLOC_N(ndr, r->out.services, r->in.buf_size); + memset(r->out.services, 0, (r->in.buf_size) * sizeof(*r->out.services)); + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + ZERO_STRUCTP(r->out.bytes_needed); + NDR_PULL_ALLOC(ndr, r->out.service_returned); + ZERO_STRUCTP(r->out.service_returned); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.services)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.services, ndr_get_array_size(ndr, &r->out.services)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.services, ndr_get_array_size(ndr, &r->out.services))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.bytes_needed); + } + _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); + if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 262144) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.service_returned); + } + _mem_save_service_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.service_returned, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.service_returned)); + if (*r->out.service_returned < 0 || *r->out.service_returned > 262144) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_returned_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + if (*r->out.resume_handle < 0 || *r->out.resume_handle > 262144) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.services) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.services, r->in.buf_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_EnumServicesStatusExW(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExW *r) +{ + ndr_print_struct(ndr, name, "EnumServicesStatusExW"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "EnumServicesStatusExW"); + ndr->depth++; + ndr_print_ptr(ndr, "scmanager", r->in.scmanager); + ndr->depth++; + ndr_print_policy_handle(ndr, "scmanager", r->in.scmanager); + ndr->depth--; + ndr_print_uint32(ndr, "info_level", r->in.info_level); + ndr_print_uint32(ndr, "type", r->in.type); + ndr_print_uint32(ndr, "state", r->in.state); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr_print_ptr(ndr, "group_name", r->in.group_name); + ndr->depth++; + if (r->in.group_name) { + ndr_print_string(ndr, "group_name", r->in.group_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "EnumServicesStatusExW"); + ndr->depth++; + ndr_print_ptr(ndr, "services", r->out.services); + ndr->depth++; + ndr_print_array_uint8(ndr, "services", r->out.services, r->in.buf_size); + ndr->depth--; + ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); + ndr->depth++; + ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); + ndr->depth--; + ndr_print_ptr(ndr, "service_returned", r->out.service_returned); + ndr->depth++; + ndr_print_uint32(ndr, "service_returned", *r->out.service_returned); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_svcctl_SCSendTSMessage(struct ndr_push *ndr, int flags, const struct svcctl_SCSendTSMessage *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_svcctl_SCSendTSMessage(struct ndr_pull *ndr, int flags, struct svcctl_SCSendTSMessage *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_svcctl_SCSendTSMessage(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSendTSMessage *r) +{ + ndr_print_struct(ndr, name, "svcctl_SCSendTSMessage"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "svcctl_SCSendTSMessage"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "svcctl_SCSendTSMessage"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call svcctl_calls[] = { + { + "svcctl_CloseServiceHandle", + sizeof(struct svcctl_CloseServiceHandle), + (ndr_push_flags_fn_t) ndr_push_svcctl_CloseServiceHandle, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_CloseServiceHandle, + (ndr_print_function_t) ndr_print_svcctl_CloseServiceHandle, + false, + }, + { + "svcctl_ControlService", + sizeof(struct svcctl_ControlService), + (ndr_push_flags_fn_t) ndr_push_svcctl_ControlService, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ControlService, + (ndr_print_function_t) ndr_print_svcctl_ControlService, + false, + }, + { + "svcctl_DeleteService", + sizeof(struct svcctl_DeleteService), + (ndr_push_flags_fn_t) ndr_push_svcctl_DeleteService, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_DeleteService, + (ndr_print_function_t) ndr_print_svcctl_DeleteService, + false, + }, + { + "svcctl_LockServiceDatabase", + sizeof(struct svcctl_LockServiceDatabase), + (ndr_push_flags_fn_t) ndr_push_svcctl_LockServiceDatabase, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_LockServiceDatabase, + (ndr_print_function_t) ndr_print_svcctl_LockServiceDatabase, + false, + }, + { + "svcctl_QueryServiceObjectSecurity", + sizeof(struct svcctl_QueryServiceObjectSecurity), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceObjectSecurity, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceObjectSecurity, + (ndr_print_function_t) ndr_print_svcctl_QueryServiceObjectSecurity, + false, + }, + { + "svcctl_SetServiceObjectSecurity", + sizeof(struct svcctl_SetServiceObjectSecurity), + (ndr_push_flags_fn_t) ndr_push_svcctl_SetServiceObjectSecurity, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SetServiceObjectSecurity, + (ndr_print_function_t) ndr_print_svcctl_SetServiceObjectSecurity, + false, + }, + { + "svcctl_QueryServiceStatus", + sizeof(struct svcctl_QueryServiceStatus), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceStatus, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceStatus, + (ndr_print_function_t) ndr_print_svcctl_QueryServiceStatus, + false, + }, + { + "svcctl_SetServiceStatus", + sizeof(struct svcctl_SetServiceStatus), + (ndr_push_flags_fn_t) ndr_push_svcctl_SetServiceStatus, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SetServiceStatus, + (ndr_print_function_t) ndr_print_svcctl_SetServiceStatus, + false, + }, + { + "svcctl_UnlockServiceDatabase", + sizeof(struct svcctl_UnlockServiceDatabase), + (ndr_push_flags_fn_t) ndr_push_svcctl_UnlockServiceDatabase, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_UnlockServiceDatabase, + (ndr_print_function_t) ndr_print_svcctl_UnlockServiceDatabase, + false, + }, + { + "svcctl_NotifyBootConfigStatus", + sizeof(struct svcctl_NotifyBootConfigStatus), + (ndr_push_flags_fn_t) ndr_push_svcctl_NotifyBootConfigStatus, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_NotifyBootConfigStatus, + (ndr_print_function_t) ndr_print_svcctl_NotifyBootConfigStatus, + false, + }, + { + "svcctl_SCSetServiceBitsW", + sizeof(struct svcctl_SCSetServiceBitsW), + (ndr_push_flags_fn_t) ndr_push_svcctl_SCSetServiceBitsW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSetServiceBitsW, + (ndr_print_function_t) ndr_print_svcctl_SCSetServiceBitsW, + false, + }, + { + "svcctl_ChangeServiceConfigW", + sizeof(struct svcctl_ChangeServiceConfigW), + (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfigW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfigW, + (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfigW, + false, + }, + { + "svcctl_CreateServiceW", + sizeof(struct svcctl_CreateServiceW), + (ndr_push_flags_fn_t) ndr_push_svcctl_CreateServiceW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_CreateServiceW, + (ndr_print_function_t) ndr_print_svcctl_CreateServiceW, + false, + }, + { + "svcctl_EnumDependentServicesW", + sizeof(struct svcctl_EnumDependentServicesW), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumDependentServicesW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumDependentServicesW, + (ndr_print_function_t) ndr_print_svcctl_EnumDependentServicesW, + false, + }, + { + "svcctl_EnumServicesStatusW", + sizeof(struct svcctl_EnumServicesStatusW), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServicesStatusW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServicesStatusW, + (ndr_print_function_t) ndr_print_svcctl_EnumServicesStatusW, + false, + }, + { + "svcctl_OpenSCManagerW", + sizeof(struct svcctl_OpenSCManagerW), + (ndr_push_flags_fn_t) ndr_push_svcctl_OpenSCManagerW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenSCManagerW, + (ndr_print_function_t) ndr_print_svcctl_OpenSCManagerW, + false, + }, + { + "svcctl_OpenServiceW", + sizeof(struct svcctl_OpenServiceW), + (ndr_push_flags_fn_t) ndr_push_svcctl_OpenServiceW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenServiceW, + (ndr_print_function_t) ndr_print_svcctl_OpenServiceW, + false, + }, + { + "svcctl_QueryServiceConfigW", + sizeof(struct svcctl_QueryServiceConfigW), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfigW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfigW, + (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfigW, + false, + }, + { + "svcctl_QueryServiceLockStatusW", + sizeof(struct svcctl_QueryServiceLockStatusW), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceLockStatusW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceLockStatusW, + (ndr_print_function_t) ndr_print_svcctl_QueryServiceLockStatusW, + false, + }, + { + "svcctl_StartServiceW", + sizeof(struct svcctl_StartServiceW), + (ndr_push_flags_fn_t) ndr_push_svcctl_StartServiceW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_StartServiceW, + (ndr_print_function_t) ndr_print_svcctl_StartServiceW, + false, + }, + { + "svcctl_GetServiceDisplayNameW", + sizeof(struct svcctl_GetServiceDisplayNameW), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceDisplayNameW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceDisplayNameW, + (ndr_print_function_t) ndr_print_svcctl_GetServiceDisplayNameW, + false, + }, + { + "svcctl_GetServiceKeyNameW", + sizeof(struct svcctl_GetServiceKeyNameW), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceKeyNameW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceKeyNameW, + (ndr_print_function_t) ndr_print_svcctl_GetServiceKeyNameW, + false, + }, + { + "svcctl_SCSetServiceBitsA", + sizeof(struct svcctl_SCSetServiceBitsA), + (ndr_push_flags_fn_t) ndr_push_svcctl_SCSetServiceBitsA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSetServiceBitsA, + (ndr_print_function_t) ndr_print_svcctl_SCSetServiceBitsA, + false, + }, + { + "svcctl_ChangeServiceConfigA", + sizeof(struct svcctl_ChangeServiceConfigA), + (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfigA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfigA, + (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfigA, + false, + }, + { + "svcctl_CreateServiceA", + sizeof(struct svcctl_CreateServiceA), + (ndr_push_flags_fn_t) ndr_push_svcctl_CreateServiceA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_CreateServiceA, + (ndr_print_function_t) ndr_print_svcctl_CreateServiceA, + false, + }, + { + "svcctl_EnumDependentServicesA", + sizeof(struct svcctl_EnumDependentServicesA), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumDependentServicesA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumDependentServicesA, + (ndr_print_function_t) ndr_print_svcctl_EnumDependentServicesA, + false, + }, + { + "svcctl_EnumServicesStatusA", + sizeof(struct svcctl_EnumServicesStatusA), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServicesStatusA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServicesStatusA, + (ndr_print_function_t) ndr_print_svcctl_EnumServicesStatusA, + false, + }, + { + "svcctl_OpenSCManagerA", + sizeof(struct svcctl_OpenSCManagerA), + (ndr_push_flags_fn_t) ndr_push_svcctl_OpenSCManagerA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenSCManagerA, + (ndr_print_function_t) ndr_print_svcctl_OpenSCManagerA, + false, + }, + { + "svcctl_OpenServiceA", + sizeof(struct svcctl_OpenServiceA), + (ndr_push_flags_fn_t) ndr_push_svcctl_OpenServiceA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenServiceA, + (ndr_print_function_t) ndr_print_svcctl_OpenServiceA, + false, + }, + { + "svcctl_QueryServiceConfigA", + sizeof(struct svcctl_QueryServiceConfigA), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfigA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfigA, + (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfigA, + false, + }, + { + "svcctl_QueryServiceLockStatusA", + sizeof(struct svcctl_QueryServiceLockStatusA), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceLockStatusA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceLockStatusA, + (ndr_print_function_t) ndr_print_svcctl_QueryServiceLockStatusA, + false, + }, + { + "svcctl_StartServiceA", + sizeof(struct svcctl_StartServiceA), + (ndr_push_flags_fn_t) ndr_push_svcctl_StartServiceA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_StartServiceA, + (ndr_print_function_t) ndr_print_svcctl_StartServiceA, + false, + }, + { + "svcctl_GetServiceDisplayNameA", + sizeof(struct svcctl_GetServiceDisplayNameA), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceDisplayNameA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceDisplayNameA, + (ndr_print_function_t) ndr_print_svcctl_GetServiceDisplayNameA, + false, + }, + { + "svcctl_GetServiceKeyNameA", + sizeof(struct svcctl_GetServiceKeyNameA), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceKeyNameA, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceKeyNameA, + (ndr_print_function_t) ndr_print_svcctl_GetServiceKeyNameA, + false, + }, + { + "svcctl_GetCurrentGroupeStateW", + sizeof(struct svcctl_GetCurrentGroupeStateW), + (ndr_push_flags_fn_t) ndr_push_svcctl_GetCurrentGroupeStateW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetCurrentGroupeStateW, + (ndr_print_function_t) ndr_print_svcctl_GetCurrentGroupeStateW, + false, + }, + { + "svcctl_EnumServiceGroupW", + sizeof(struct svcctl_EnumServiceGroupW), + (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServiceGroupW, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServiceGroupW, + (ndr_print_function_t) ndr_print_svcctl_EnumServiceGroupW, + false, + }, + { + "svcctl_ChangeServiceConfig2A", + sizeof(struct svcctl_ChangeServiceConfig2A), + (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfig2A, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfig2A, + (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfig2A, + false, + }, + { + "svcctl_ChangeServiceConfig2W", + sizeof(struct svcctl_ChangeServiceConfig2W), + (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfig2W, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfig2W, + (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfig2W, + false, + }, + { + "svcctl_QueryServiceConfig2A", + sizeof(struct svcctl_QueryServiceConfig2A), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfig2A, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfig2A, + (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfig2A, + false, + }, + { + "svcctl_QueryServiceConfig2W", + sizeof(struct svcctl_QueryServiceConfig2W), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfig2W, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfig2W, + (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfig2W, + false, + }, + { + "svcctl_QueryServiceStatusEx", + sizeof(struct svcctl_QueryServiceStatusEx), + (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceStatusEx, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceStatusEx, + (ndr_print_function_t) ndr_print_svcctl_QueryServiceStatusEx, + false, + }, + { + "EnumServicesStatusExA", + sizeof(struct EnumServicesStatusExA), + (ndr_push_flags_fn_t) ndr_push_EnumServicesStatusExA, + (ndr_pull_flags_fn_t) ndr_pull_EnumServicesStatusExA, + (ndr_print_function_t) ndr_print_EnumServicesStatusExA, + false, + }, + { + "EnumServicesStatusExW", + sizeof(struct EnumServicesStatusExW), + (ndr_push_flags_fn_t) ndr_push_EnumServicesStatusExW, + (ndr_pull_flags_fn_t) ndr_pull_EnumServicesStatusExW, + (ndr_print_function_t) ndr_print_EnumServicesStatusExW, + false, + }, + { + "svcctl_SCSendTSMessage", + sizeof(struct svcctl_SCSendTSMessage), + (ndr_push_flags_fn_t) ndr_push_svcctl_SCSendTSMessage, + (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSendTSMessage, + (ndr_print_function_t) ndr_print_svcctl_SCSendTSMessage, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const svcctl_endpoint_strings[] = { + "ncacn_np:[\\pipe\\svcctl]", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array svcctl_endpoints = { + .count = 2, + .names = svcctl_endpoint_strings +}; + +static const char * const svcctl_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array svcctl_authservices = { + .count = 1, + .names = svcctl_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_svcctl = { + .name = "svcctl", + .syntax_id = { + {0x367abb81,0x9844,0x35f1,{0xad,0x32},{0x98,0xf0,0x38,0x00,0x10,0x03}}, + NDR_SVCCTL_VERSION + }, + .helpstring = NDR_SVCCTL_HELPSTRING, + .num_calls = 44, + .calls = svcctl_calls, + .endpoints = &svcctl_endpoints, + .authservices = &svcctl_authservices +}; + diff --git a/librpc/gen_ndr/ndr_svcctl.h b/librpc/gen_ndr/ndr_svcctl.h new file mode 100644 index 0000000000..8d7739a7db --- /dev/null +++ b/librpc/gen_ndr/ndr_svcctl.h @@ -0,0 +1,160 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/svcctl.h" + +#ifndef _HEADER_NDR_svcctl +#define _HEADER_NDR_svcctl + +#define NDR_SVCCTL_UUID "367abb81-9844-35f1-ad32-98f038001003" +#define NDR_SVCCTL_VERSION 2.0 +#define NDR_SVCCTL_NAME "svcctl" +#define NDR_SVCCTL_HELPSTRING "Service Control" +extern const struct ndr_interface_table ndr_table_svcctl; +#define NDR_SVCCTL_CLOSESERVICEHANDLE (0x00) + +#define NDR_SVCCTL_CONTROLSERVICE (0x01) + +#define NDR_SVCCTL_DELETESERVICE (0x02) + +#define NDR_SVCCTL_LOCKSERVICEDATABASE (0x03) + +#define NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY (0x04) + +#define NDR_SVCCTL_SETSERVICEOBJECTSECURITY (0x05) + +#define NDR_SVCCTL_QUERYSERVICESTATUS (0x06) + +#define NDR_SVCCTL_SETSERVICESTATUS (0x07) + +#define NDR_SVCCTL_UNLOCKSERVICEDATABASE (0x08) + +#define NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS (0x09) + +#define NDR_SVCCTL_SCSETSERVICEBITSW (0x0a) + +#define NDR_SVCCTL_CHANGESERVICECONFIGW (0x0b) + +#define NDR_SVCCTL_CREATESERVICEW (0x0c) + +#define NDR_SVCCTL_ENUMDEPENDENTSERVICESW (0x0d) + +#define NDR_SVCCTL_ENUMSERVICESSTATUSW (0x0e) + +#define NDR_SVCCTL_OPENSCMANAGERW (0x0f) + +#define NDR_SVCCTL_OPENSERVICEW (0x10) + +#define NDR_SVCCTL_QUERYSERVICECONFIGW (0x11) + +#define NDR_SVCCTL_QUERYSERVICELOCKSTATUSW (0x12) + +#define NDR_SVCCTL_STARTSERVICEW (0x13) + +#define NDR_SVCCTL_GETSERVICEDISPLAYNAMEW (0x14) + +#define NDR_SVCCTL_GETSERVICEKEYNAMEW (0x15) + +#define NDR_SVCCTL_SCSETSERVICEBITSA (0x16) + +#define NDR_SVCCTL_CHANGESERVICECONFIGA (0x17) + +#define NDR_SVCCTL_CREATESERVICEA (0x18) + +#define NDR_SVCCTL_ENUMDEPENDENTSERVICESA (0x19) + +#define NDR_SVCCTL_ENUMSERVICESSTATUSA (0x1a) + +#define NDR_SVCCTL_OPENSCMANAGERA (0x1b) + +#define NDR_SVCCTL_OPENSERVICEA (0x1c) + +#define NDR_SVCCTL_QUERYSERVICECONFIGA (0x1d) + +#define NDR_SVCCTL_QUERYSERVICELOCKSTATUSA (0x1e) + +#define NDR_SVCCTL_STARTSERVICEA (0x1f) + +#define NDR_SVCCTL_GETSERVICEDISPLAYNAMEA (0x20) + +#define NDR_SVCCTL_GETSERVICEKEYNAMEA (0x21) + +#define NDR_SVCCTL_GETCURRENTGROUPESTATEW (0x22) + +#define NDR_SVCCTL_ENUMSERVICEGROUPW (0x23) + +#define NDR_SVCCTL_CHANGESERVICECONFIG2A (0x24) + +#define NDR_SVCCTL_CHANGESERVICECONFIG2W (0x25) + +#define NDR_SVCCTL_QUERYSERVICECONFIG2A (0x26) + +#define NDR_SVCCTL_QUERYSERVICECONFIG2W (0x27) + +#define NDR_SVCCTL_QUERYSERVICESTATUSEX (0x28) + +#define NDR_ENUMSERVICESSTATUSEXA (0x29) + +#define NDR_ENUMSERVICESSTATUSEXW (0x2a) + +#define NDR_SVCCTL_SCSENDTSMESSAGE (0x2b) + +#define NDR_SVCCTL_CALL_COUNT (44) +void ndr_print_SERVICE_LOCK_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_LOCK_STATUS *r); +void ndr_print_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_STATUS *r); +void ndr_print_ENUM_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct ENUM_SERVICE_STATUS *r); +enum ndr_err_code ndr_push_svcctl_ServerType(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_svcctl_ServerType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_SERVICE_CONTROL(struct ndr_print *ndr, const char *name, enum SERVICE_CONTROL r); +void ndr_print_svcctl_MgrAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_flags, const struct QUERY_SERVICE_CONFIG *r); +enum ndr_err_code ndr_pull_QUERY_SERVICE_CONFIG(struct ndr_pull *ndr, int ndr_flags, struct QUERY_SERVICE_CONFIG *r); +void ndr_print_QUERY_SERVICE_CONFIG(struct ndr_print *ndr, const char *name, const struct QUERY_SERVICE_CONFIG *r); +size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG *r, int flags); +void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CloseServiceHandle *r); +void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ControlService *r); +void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_DeleteService *r); +void ndr_print_svcctl_LockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_LockServiceDatabase *r); +void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceObjectSecurity *r); +void ndr_print_svcctl_SetServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceObjectSecurity *r); +void ndr_print_svcctl_QueryServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatus *r); +void ndr_print_svcctl_SetServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceStatus *r); +void ndr_print_svcctl_UnlockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_UnlockServiceDatabase *r); +void ndr_print_svcctl_NotifyBootConfigStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_NotifyBootConfigStatus *r); +void ndr_print_svcctl_SCSetServiceBitsW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsW *r); +void ndr_print_svcctl_ChangeServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigW *r); +void ndr_print_svcctl_CreateServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceW *r); +void ndr_print_svcctl_EnumDependentServicesW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesW *r); +void ndr_print_svcctl_EnumServicesStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusW *r); +void ndr_print_svcctl_OpenSCManagerW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerW *r); +void ndr_print_svcctl_OpenServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceW *r); +void ndr_print_svcctl_QueryServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigW *r); +void ndr_print_svcctl_QueryServiceLockStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusW *r); +void ndr_print_svcctl_StartServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceW *r); +void ndr_print_svcctl_GetServiceDisplayNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameW *r); +void ndr_print_svcctl_GetServiceKeyNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameW *r); +void ndr_print_svcctl_SCSetServiceBitsA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsA *r); +void ndr_print_svcctl_ChangeServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigA *r); +void ndr_print_svcctl_CreateServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceA *r); +void ndr_print_svcctl_EnumDependentServicesA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesA *r); +void ndr_print_svcctl_EnumServicesStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusA *r); +void ndr_print_svcctl_OpenSCManagerA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerA *r); +void ndr_print_svcctl_OpenServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceA *r); +void ndr_print_svcctl_QueryServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigA *r); +void ndr_print_svcctl_QueryServiceLockStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusA *r); +void ndr_print_svcctl_StartServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceA *r); +void ndr_print_svcctl_GetServiceDisplayNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameA *r); +void ndr_print_svcctl_GetServiceKeyNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameA *r); +void ndr_print_svcctl_GetCurrentGroupeStateW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetCurrentGroupeStateW *r); +void ndr_print_svcctl_EnumServiceGroupW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServiceGroupW *r); +void ndr_print_svcctl_ChangeServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2A *r); +void ndr_print_svcctl_ChangeServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2W *r); +void ndr_print_svcctl_QueryServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2A *r); +void ndr_print_svcctl_QueryServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2W *r); +void ndr_print_svcctl_QueryServiceStatusEx(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatusEx *r); +void ndr_print_EnumServicesStatusExA(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExA *r); +void ndr_print_EnumServicesStatusExW(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExW *r); +void ndr_print_svcctl_SCSendTSMessage(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSendTSMessage *r); +#endif /* _HEADER_NDR_svcctl */ diff --git a/librpc/gen_ndr/ndr_winreg.c b/librpc/gen_ndr/ndr_winreg.c new file mode 100644 index 0000000000..791d11103d --- /dev/null +++ b/librpc/gen_ndr/ndr_winreg.c @@ -0,0 +1,4495 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_winreg.h" + +#include "librpc/gen_ndr/ndr_lsa.h" +#include "librpc/gen_ndr/ndr_security.h" +static enum ndr_err_code ndr_push_winreg_AccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_AccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_AccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_QUERY_VALUE", KEY_QUERY_VALUE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_SET_VALUE", KEY_SET_VALUE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_CREATE_SUB_KEY", KEY_CREATE_SUB_KEY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_ENUMERATE_SUB_KEYS", KEY_ENUMERATE_SUB_KEYS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_NOTIFY", KEY_NOTIFY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_CREATE_LINK", KEY_CREATE_LINK, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_WOW64_64KEY", KEY_WOW64_64KEY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_WOW64_32KEY", KEY_WOW64_32KEY, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r) +{ + const char *val = NULL; + + switch (r) { + case REG_NONE: val = "REG_NONE"; break; + case REG_SZ: val = "REG_SZ"; break; + case REG_EXPAND_SZ: val = "REG_EXPAND_SZ"; break; + case REG_BINARY: val = "REG_BINARY"; break; + case REG_DWORD: val = "REG_DWORD"; break; + case REG_DWORD_BIG_ENDIAN: val = "REG_DWORD_BIG_ENDIAN"; break; + case REG_LINK: val = "REG_LINK"; break; + case REG_MULTI_SZ: val = "REG_MULTI_SZ"; break; + case REG_RESOURCE_LIST: val = "REG_RESOURCE_LIST"; break; + case REG_FULL_RESOURCE_DESCRIPTOR: val = "REG_FULL_RESOURCE_DESCRIPTOR"; break; + case REG_RESOURCE_REQUIREMENTS_LIST: val = "REG_RESOURCE_REQUIREMENTS_LIST"; break; + case REG_QWORD: val = "REG_QWORD"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, const struct winreg_String *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, struct winreg_String *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_len)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_String(struct ndr_print *ndr, const char *name, const struct winreg_String *r) +{ + ndr_print_struct(ndr, name, "winreg_String"); + ndr->depth++; + ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->name_len); + ndr_print_uint16(ndr, "name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->name_size); + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_KeySecurityData(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityData *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->len)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_KeySecurityData(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityData *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->data)); + if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data)); + } + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size)); + } + if (r->data) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_KeySecurityData(struct ndr_print *ndr, const char *name, const struct KeySecurityData *r) +{ + ndr_print_struct(ndr, name, "KeySecurityData"); + ndr->depth++; + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->len); + } + ndr->depth--; + ndr_print_uint32(ndr, "size", r->size); + ndr_print_uint32(ndr, "len", r->len); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_SecBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_SecBuf *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS, &r->sd)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->inherit)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sd)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_SecBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_SecBuf *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS, &r->sd)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->inherit)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sd)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, const struct winreg_SecBuf *r) +{ + ndr_print_struct(ndr, name, "winreg_SecBuf"); + ndr->depth++; + ndr_print_uint32(ndr, "length", r->length); + ndr_print_KeySecurityData(ndr, "sd", &r->sd); + ndr_print_uint8(ndr, "inherit", r->inherit); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_CreateAction(struct ndr_push *ndr, int ndr_flags, enum winreg_CreateAction r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_CreateAction(struct ndr_pull *ndr, int ndr_flags, enum winreg_CreateAction *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_CreateAction(struct ndr_print *ndr, const char *name, enum winreg_CreateAction r) +{ + const char *val = NULL; + + switch (r) { + case REG_ACTION_NONE: val = "REG_ACTION_NONE"; break; + case REG_CREATED_NEW_KEY: val = "REG_CREATED_NEW_KEY"; break; + case REG_OPENED_EXISTING_KEY: val = "REG_OPENED_EXISTING_KEY"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_winreg_StringBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_StringBuf *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2 / 2)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, strlen_m_term(r->name) * 2 / 2, sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_StringBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_StringBuf *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->name) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->name, r->size / 2)); + } + if (r->name) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->name, r->length / 2)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name, const struct winreg_StringBuf *r) +{ + ndr_print_struct(ndr, name, "winreg_StringBuf"); + ndr->depth++; + ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->length); + ndr_print_uint16(ndr, "size", r->size); + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_winreg_NotifyChangeType(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_NotifyChangeType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_NotifyChangeType(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_NAME", REG_NOTIFY_CHANGE_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_ATTRIBUTES", REG_NOTIFY_CHANGE_ATTRIBUTES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_LAST_SET", REG_NOTIFY_CHANGE_LAST_SET, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_SECURITY", REG_NOTIFY_CHANGE_SECURITY, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_KeySecurityAttribute(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_size)); + NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS, &r->sec_data)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->inherit)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_KeySecurityAttribute(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_size)); + NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS, &r->sec_data)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->inherit)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_KeySecurityAttribute(struct ndr_print *ndr, const char *name, const struct KeySecurityAttribute *r) +{ + ndr_print_struct(ndr, name, "KeySecurityAttribute"); + ndr->depth++; + ndr_print_uint32(ndr, "data_size", r->data_size); + ndr_print_KeySecurityData(ndr, "sec_data", &r->sec_data); + ndr_print_uint8(ndr, "inherit", r->inherit); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_QueryMultipleValue(struct ndr_push *ndr, int ndr_flags, const struct QueryMultipleValue *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->offset)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->name)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_QueryMultipleValue(struct ndr_pull *ndr, int ndr_flags, struct QueryMultipleValue *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->offset)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_QueryMultipleValue(struct ndr_print *ndr, const char *name, const struct QueryMultipleValue *r) +{ + ndr_print_struct(ndr, name, "QueryMultipleValue"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_winreg_String(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_winreg_Type(ndr, "type", r->type); + ndr_print_uint32(ndr, "offset", r->offset); + ndr_print_uint32(ndr, "length", r->length); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_OpenHKCR(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCR *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_OpenHKCR(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCR *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenHKCR(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCR *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenHKCR"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenHKCR"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenHKCR"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_OpenHKCU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCU *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_OpenHKCU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCU *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenHKCU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCU *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenHKCU"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenHKCU"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenHKCU"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenHKLM(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKLM *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenHKLM"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenHKLM"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenHKLM"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_OpenHKPD(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPD *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_OpenHKPD(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPD *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenHKPD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPD *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenHKPD"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenHKPD"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenHKPD"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_OpenHKU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKU *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_OpenHKU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKU *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenHKU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKU *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenHKU"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenHKU"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenHKU"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.handle); + *r->out.handle = *r->in.handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_CloseKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CloseKey *r) +{ + ndr_print_struct(ndr, name, "winreg_CloseKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_CloseKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_CloseKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.options)); + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.secdesc)); + if (r->in.secdesc) { + NDR_CHECK(ndr_push_winreg_SecBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.secdesc)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.action_taken)); + if (r->in.action_taken) { + NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, *r->in.action_taken)); + } + } + if (flags & NDR_OUT) { + 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, r->out.new_handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.action_taken)); + if (r->out.action_taken) { + NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, *r->out.action_taken)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r) +{ + uint32_t _ptr_secdesc; + uint32_t _ptr_action_taken; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_secdesc_0; + TALLOC_CTX *_mem_save_new_handle_0; + TALLOC_CTX *_mem_save_action_taken_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyclass)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.options)); + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); + if (_ptr_secdesc) { + NDR_PULL_ALLOC(ndr, r->in.secdesc); + } else { + r->in.secdesc = NULL; + } + if (r->in.secdesc) { + _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.secdesc, 0); + NDR_CHECK(ndr_pull_winreg_SecBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.secdesc)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_action_taken)); + if (_ptr_action_taken) { + NDR_PULL_ALLOC(ndr, r->in.action_taken); + } else { + r->in.action_taken = NULL; + } + if (r->in.action_taken) { + _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.action_taken, 0); + NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, r->in.action_taken)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.new_handle); + ZERO_STRUCTP(r->out.new_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.new_handle); + } + _mem_save_new_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.new_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.new_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_action_taken)); + if (_ptr_action_taken) { + NDR_PULL_ALLOC(ndr, r->out.action_taken); + } else { + r->out.action_taken = NULL; + } + if (r->out.action_taken) { + _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.action_taken, 0); + NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, r->out.action_taken)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CreateKey *r) +{ + ndr_print_struct(ndr, name, "winreg_CreateKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_CreateKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_winreg_String(ndr, "name", &r->in.name); + ndr_print_winreg_String(ndr, "keyclass", &r->in.keyclass); + ndr_print_uint32(ndr, "options", r->in.options); + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_ptr(ndr, "secdesc", r->in.secdesc); + ndr->depth++; + if (r->in.secdesc) { + ndr_print_winreg_SecBuf(ndr, "secdesc", r->in.secdesc); + } + ndr->depth--; + ndr_print_ptr(ndr, "action_taken", r->in.action_taken); + ndr->depth++; + if (r->in.action_taken) { + ndr_print_winreg_CreateAction(ndr, "action_taken", *r->in.action_taken); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_CreateKey"); + ndr->depth++; + ndr_print_ptr(ndr, "new_handle", r->out.new_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "new_handle", r->out.new_handle); + ndr->depth--; + ndr_print_ptr(ndr, "action_taken", r->out.action_taken); + ndr->depth++; + if (r->out.action_taken) { + ndr_print_winreg_CreateAction(ndr, "action_taken", *r->out.action_taken); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.key)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.key)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_DeleteKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteKey *r) +{ + ndr_print_struct(ndr, name, "winreg_DeleteKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_DeleteKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_winreg_String(ndr, "key", &r->in.key); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_DeleteKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_DeleteValue(struct ndr_pull *ndr, int flags, struct winreg_DeleteValue *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_DeleteValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteValue *r) +{ + ndr_print_struct(ndr, name, "winreg_DeleteValue"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_DeleteValue"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_winreg_String(ndr, "value", &r->in.value); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_DeleteValue"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index)); + 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) { + NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyclass)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.last_changed_time)); + if (r->in.last_changed_time) { + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->in.last_changed_time)); + } + } + if (flags & NDR_OUT) { + 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) { + NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.keyclass)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.last_changed_time)); + if (r->out.last_changed_time) { + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r) +{ + uint32_t _ptr_keyclass; + uint32_t _ptr_last_changed_time; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_keyclass_0; + TALLOC_CTX *_mem_save_last_changed_time_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.enum_index)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyclass)); + if (_ptr_keyclass) { + NDR_PULL_ALLOC(ndr, r->in.keyclass); + } else { + r->in.keyclass = NULL; + } + if (r->in.keyclass) { + _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.keyclass, 0); + NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyclass)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_last_changed_time)); + if (_ptr_last_changed_time) { + NDR_PULL_ALLOC(ndr, r->in.last_changed_time); + } else { + r->in.last_changed_time = NULL; + } + if (r->in.last_changed_time) { + _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.last_changed_time, 0); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->in.last_changed_time)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.name); + *r->out.name = *r->in.name; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyclass)); + if (_ptr_keyclass) { + NDR_PULL_ALLOC(ndr, r->out.keyclass); + } else { + r->out.keyclass = NULL; + } + if (r->out.keyclass) { + _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.keyclass, 0); + NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.keyclass)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_last_changed_time)); + if (_ptr_last_changed_time) { + NDR_PULL_ALLOC(ndr, r->out.last_changed_time); + } else { + r->out.last_changed_time = NULL; + } + if (r->out.last_changed_time) { + _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, 0); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->out.last_changed_time)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumKey *r) +{ + ndr_print_struct(ndr, name, "winreg_EnumKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_EnumKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "enum_index", r->in.enum_index); + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_winreg_StringBuf(ndr, "name", r->in.name); + ndr->depth--; + ndr_print_ptr(ndr, "keyclass", r->in.keyclass); + ndr->depth++; + if (r->in.keyclass) { + ndr_print_winreg_StringBuf(ndr, "keyclass", r->in.keyclass); + } + ndr->depth--; + ndr_print_ptr(ndr, "last_changed_time", r->in.last_changed_time); + ndr->depth++; + if (r->in.last_changed_time) { + ndr_print_NTTIME(ndr, "last_changed_time", *r->in.last_changed_time); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_EnumKey"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->out.name); + ndr->depth++; + ndr_print_winreg_StringBuf(ndr, "name", r->out.name); + ndr->depth--; + ndr_print_ptr(ndr, "keyclass", r->out.keyclass); + ndr->depth++; + if (r->out.keyclass) { + ndr_print_winreg_StringBuf(ndr, "keyclass", r->out.keyclass); + } + ndr->depth--; + ndr_print_ptr(ndr, "last_changed_time", r->out.last_changed_time); + ndr->depth++; + if (r->out.last_changed_time) { + ndr_print_NTTIME(ndr, "last_changed_time", *r->out.last_changed_time); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index)); + 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.type)); + if (r->in.type) { + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.type)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.value)); + if (r->in.value) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.value, *r->in.length)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.size)); + if (r->in.size) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.size)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.length)); + if (r->in.length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length)); + } + } + if (flags & NDR_OUT) { + 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.type)); + if (r->out.type) { + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.value)); + if (r->out.value) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.value, *r->out.length)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.size)); + if (r->out.size) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.length)); + if (r->out.length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r) +{ + uint32_t _ptr_type; + uint32_t _ptr_value; + uint32_t _ptr_size; + uint32_t _ptr_length; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_type_0; + TALLOC_CTX *_mem_save_value_0; + TALLOC_CTX *_mem_save_size_0; + TALLOC_CTX *_mem_save_length_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.enum_index)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type)); + if (_ptr_type) { + NDR_PULL_ALLOC(ndr, r->in.type); + } else { + r->in.type = NULL; + } + if (r->in.type) { + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.type, 0); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->in.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value)); + if (_ptr_value) { + NDR_PULL_ALLOC(ndr, r->in.value); + } else { + r->in.value = NULL; + } + if (r->in.value) { + _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.value, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.value)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.value)); + if (ndr_get_array_length(ndr, &r->in.value) > ndr_get_array_size(ndr, &r->in.value)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.value), ndr_get_array_length(ndr, &r->in.value)); + } + NDR_PULL_ALLOC_N(ndr, r->in.value, ndr_get_array_size(ndr, &r->in.value)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.value, ndr_get_array_length(ndr, &r->in.value))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size)); + if (_ptr_size) { + NDR_PULL_ALLOC(ndr, r->in.size); + } else { + r->in.size = NULL; + } + if (r->in.size) { + _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.size, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_length)); + if (_ptr_length) { + NDR_PULL_ALLOC(ndr, r->in.length); + } else { + r->in.length = NULL; + } + if (r->in.length) { + _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.name); + *r->out.name = *r->in.name; + if (r->in.value) { + 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 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)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type)); + if (_ptr_type) { + NDR_PULL_ALLOC(ndr, r->out.type); + } else { + r->out.type = NULL; + } + if (r->out.type) { + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.type, 0); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value)); + if (_ptr_value) { + NDR_PULL_ALLOC(ndr, r->out.value); + } else { + r->out.value = NULL; + } + if (r->out.value) { + _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.value, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.value)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->out.value)); + if (ndr_get_array_length(ndr, &r->out.value) > ndr_get_array_size(ndr, &r->out.value)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.value), ndr_get_array_length(ndr, &r->out.value)); + } + NDR_PULL_ALLOC_N(ndr, r->out.value, ndr_get_array_size(ndr, &r->out.value)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.value, ndr_get_array_length(ndr, &r->out.value))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size)); + if (_ptr_size) { + NDR_PULL_ALLOC(ndr, r->out.size); + } else { + r->out.size = NULL; + } + if (r->out.size) { + _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.size, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_length)); + if (_ptr_length) { + NDR_PULL_ALLOC(ndr, r->out.length); + } else { + r->out.length = NULL; + } + if (r->out.length) { + _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.value) { + 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 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)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumValue *r) +{ + ndr_print_struct(ndr, name, "winreg_EnumValue"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_EnumValue"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint32(ndr, "enum_index", r->in.enum_index); + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_winreg_StringBuf(ndr, "name", r->in.name); + ndr->depth--; + ndr_print_ptr(ndr, "type", r->in.type); + ndr->depth++; + if (r->in.type) { + ndr_print_winreg_Type(ndr, "type", *r->in.type); + } + ndr->depth--; + ndr_print_ptr(ndr, "value", r->in.value); + ndr->depth++; + if (r->in.value) { + if (r->in.length == NULL) return; + ndr_print_array_uint8(ndr, "value", r->in.value, *r->in.length); + } + ndr->depth--; + ndr_print_ptr(ndr, "size", r->in.size); + ndr->depth++; + if (r->in.size) { + ndr_print_uint32(ndr, "size", *r->in.size); + } + ndr->depth--; + ndr_print_ptr(ndr, "length", r->in.length); + ndr->depth++; + if (r->in.length) { + ndr_print_uint32(ndr, "length", *r->in.length); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_EnumValue"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->out.name); + ndr->depth++; + ndr_print_winreg_StringBuf(ndr, "name", r->out.name); + ndr->depth--; + ndr_print_ptr(ndr, "type", r->out.type); + ndr->depth++; + if (r->out.type) { + ndr_print_winreg_Type(ndr, "type", *r->out.type); + } + ndr->depth--; + ndr_print_ptr(ndr, "value", r->out.value); + ndr->depth++; + if (r->out.value) { + if (r->out.length == NULL) return; + ndr_print_array_uint8(ndr, "value", r->out.value, *r->out.length); + } + ndr->depth--; + ndr_print_ptr(ndr, "size", r->out.size); + ndr->depth++; + if (r->out.size) { + ndr_print_uint32(ndr, "size", *r->out.size); + } + ndr->depth--; + ndr_print_ptr(ndr, "length", r->out.length); + ndr->depth++; + if (r->out.length) { + ndr_print_uint32(ndr, "length", *r->out.length); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_FlushKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_FlushKey *r) +{ + ndr_print_struct(ndr, name, "winreg_FlushKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_FlushKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_FlushKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sd_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sd); + } + _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sd, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.sd); + *r->out.sd = *r->in.sd; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sd); + } + _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sd, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_GetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetKeySecurity *r) +{ + ndr_print_struct(ndr, name, "winreg_GetKeySecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_GetKeySecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); + ndr_print_ptr(ndr, "sd", r->in.sd); + ndr->depth++; + ndr_print_KeySecurityData(ndr, "sd", r->in.sd); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_GetKeySecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "sd", r->out.sd); + ndr->depth++; + ndr_print_KeySecurityData(ndr, "sd", r->out.sd); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.keyname)); + if (r->in.keyname) { + NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyname)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.filename)); + if (r->in.filename) { + NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_LoadKey(struct ndr_pull *ndr, int flags, struct winreg_LoadKey *r) +{ + uint32_t _ptr_keyname; + uint32_t _ptr_filename; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_keyname_0; + TALLOC_CTX *_mem_save_filename_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyname)); + if (_ptr_keyname) { + NDR_PULL_ALLOC(ndr, r->in.keyname); + } else { + r->in.keyname = NULL; + } + if (r->in.keyname) { + _mem_save_keyname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.keyname, 0); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyname)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyname_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_filename)); + if (_ptr_filename) { + NDR_PULL_ALLOC(ndr, r->in.filename); + } else { + r->in.filename = NULL; + } + if (r->in.filename) { + _mem_save_filename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.filename, 0); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filename_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_LoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_LoadKey *r) +{ + ndr_print_struct(ndr, name, "winreg_LoadKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_LoadKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "keyname", r->in.keyname); + ndr->depth++; + if (r->in.keyname) { + ndr_print_winreg_String(ndr, "keyname", r->in.keyname); + } + ndr->depth--; + ndr_print_ptr(ndr, "filename", r->in.filename); + ndr->depth++; + if (r->in.filename) { + ndr_print_winreg_String(ndr, "filename", r->in.filename); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_LoadKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.watch_subtree)); + NDR_CHECK(ndr_push_winreg_NotifyChangeType(ndr, NDR_SCALARS, r->in.notify_filter)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); + NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string1)); + NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.watch_subtree)); + NDR_CHECK(ndr_pull_winreg_NotifyChangeType(ndr, NDR_SCALARS, &r->in.notify_filter)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string1)); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_NotifyChangeKeyValue *r) +{ + ndr_print_struct(ndr, name, "winreg_NotifyChangeKeyValue"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_NotifyChangeKeyValue"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_uint8(ndr, "watch_subtree", r->in.watch_subtree); + ndr_print_winreg_NotifyChangeType(ndr, "notify_filter", r->in.notify_filter); + ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_winreg_String(ndr, "string1", &r->in.string1); + ndr_print_winreg_String(ndr, "string2", &r->in.string2); + ndr_print_uint32(ndr, "unknown2", r->in.unknown2); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_NotifyChangeKeyValue"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r) +{ + TALLOC_CTX *_mem_save_parent_handle_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.parent_handle); + } + _mem_save_parent_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.parent_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.parent_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyname)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenKey *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenKey"); + ndr->depth++; + ndr_print_ptr(ndr, "parent_handle", r->in.parent_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "parent_handle", r->in.parent_handle); + ndr->depth--; + ndr_print_winreg_String(ndr, "keyname", &r->in.keyname); + ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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 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 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 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 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 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 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 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_classname_0; + TALLOC_CTX *_mem_save_num_subkeys_0; + TALLOC_CTX *_mem_save_max_subkeylen_0; + TALLOC_CTX *_mem_save_max_classlen_0; + TALLOC_CTX *_mem_save_num_values_0; + TALLOC_CTX *_mem_save_max_valnamelen_0; + TALLOC_CTX *_mem_save_max_valbufsize_0; + TALLOC_CTX *_mem_save_secdescsize_0; + TALLOC_CTX *_mem_save_last_changed_time_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.classname); + } + _mem_save_classname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.classname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.classname)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_classname_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.classname); + *r->out.classname = *r->in.classname; + NDR_PULL_ALLOC(ndr, r->out.num_subkeys); + ZERO_STRUCTP(r->out.num_subkeys); + NDR_PULL_ALLOC(ndr, r->out.max_subkeylen); + ZERO_STRUCTP(r->out.max_subkeylen); + NDR_PULL_ALLOC(ndr, r->out.max_classlen); + ZERO_STRUCTP(r->out.max_classlen); + NDR_PULL_ALLOC(ndr, r->out.num_values); + ZERO_STRUCTP(r->out.num_values); + NDR_PULL_ALLOC(ndr, r->out.max_valnamelen); + ZERO_STRUCTP(r->out.max_valnamelen); + NDR_PULL_ALLOC(ndr, r->out.max_valbufsize); + ZERO_STRUCTP(r->out.max_valbufsize); + NDR_PULL_ALLOC(ndr, r->out.secdescsize); + ZERO_STRUCTP(r->out.secdescsize); + NDR_PULL_ALLOC(ndr, r->out.last_changed_time); + ZERO_STRUCTP(r->out.last_changed_time); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.classname); + } + _mem_save_classname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.classname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.classname)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_classname_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_subkeys); + } + _mem_save_num_subkeys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_subkeys, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_subkeys)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_subkeys_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.max_subkeylen); + } + _mem_save_max_subkeylen_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.max_subkeylen, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_subkeylen)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_subkeylen_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.max_classlen); + } + _mem_save_max_classlen_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.max_classlen, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_classlen)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_classlen_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_values); + } + _mem_save_num_values_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_values, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_values)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_values_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.max_valnamelen); + } + _mem_save_max_valnamelen_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valnamelen, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valnamelen)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valnamelen_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.max_valbufsize); + } + _mem_save_max_valbufsize_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valbufsize, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valbufsize)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valbufsize_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.secdescsize); + } + _mem_save_secdescsize_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.secdescsize, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.secdescsize)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdescsize_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.last_changed_time); + } + _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->out.last_changed_time)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryInfoKey *r) +{ + ndr_print_struct(ndr, name, "winreg_QueryInfoKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_QueryInfoKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "classname", r->in.classname); + ndr->depth++; + ndr_print_winreg_String(ndr, "classname", r->in.classname); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_QueryInfoKey"); + ndr->depth++; + ndr_print_ptr(ndr, "classname", r->out.classname); + ndr->depth++; + ndr_print_winreg_String(ndr, "classname", r->out.classname); + ndr->depth--; + ndr_print_ptr(ndr, "num_subkeys", r->out.num_subkeys); + ndr->depth++; + ndr_print_uint32(ndr, "num_subkeys", *r->out.num_subkeys); + ndr->depth--; + ndr_print_ptr(ndr, "max_subkeylen", r->out.max_subkeylen); + ndr->depth++; + ndr_print_uint32(ndr, "max_subkeylen", *r->out.max_subkeylen); + ndr->depth--; + ndr_print_ptr(ndr, "max_classlen", r->out.max_classlen); + ndr->depth++; + ndr_print_uint32(ndr, "max_classlen", *r->out.max_classlen); + ndr->depth--; + ndr_print_ptr(ndr, "num_values", r->out.num_values); + ndr->depth++; + ndr_print_uint32(ndr, "num_values", *r->out.num_values); + ndr->depth--; + ndr_print_ptr(ndr, "max_valnamelen", r->out.max_valnamelen); + ndr->depth++; + ndr_print_uint32(ndr, "max_valnamelen", *r->out.max_valnamelen); + ndr->depth--; + ndr_print_ptr(ndr, "max_valbufsize", r->out.max_valbufsize); + ndr->depth++; + ndr_print_uint32(ndr, "max_valbufsize", *r->out.max_valbufsize); + ndr->depth--; + ndr_print_ptr(ndr, "secdescsize", r->out.secdescsize); + ndr->depth++; + ndr_print_uint32(ndr, "secdescsize", *r->out.secdescsize); + ndr->depth--; + ndr_print_ptr(ndr, "last_changed_time", r->out.last_changed_time); + ndr->depth++; + ndr_print_NTTIME(ndr, "last_changed_time", *r->out.last_changed_time); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + if (r->in.value_name == 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.value_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.type)); + if (r->in.type) { + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.type)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data)); + if (r->in.data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, *r->in.data_length)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data_size)); + if (r->in.data_size) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data_length)); + if (r->in.data_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_length)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.type)); + if (r->out.type) { + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data)); + if (r->out.data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, *r->out.data_length)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data_size)); + if (r->out.data_size) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data_length)); + if (r->out.data_length) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_length)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r) +{ + uint32_t _ptr_type; + uint32_t _ptr_data; + uint32_t _ptr_data_size; + uint32_t _ptr_data_length; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_value_name_0; + TALLOC_CTX *_mem_save_type_0; + TALLOC_CTX *_mem_save_data_0; + TALLOC_CTX *_mem_save_data_size_0; + TALLOC_CTX *_mem_save_data_length_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.value_name); + } + _mem_save_value_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.value_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.value_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type)); + if (_ptr_type) { + NDR_PULL_ALLOC(ndr, r->in.type); + } else { + r->in.type = NULL; + } + if (r->in.type) { + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.type, 0); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->in.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->in.data); + } else { + r->in.data = NULL; + } + if (r->in.data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.data)); + if (ndr_get_array_length(ndr, &r->in.data) > ndr_get_array_size(ndr, &r->in.data)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.data), ndr_get_array_length(ndr, &r->in.data)); + } + NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_length(ndr, &r->in.data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_size)); + if (_ptr_data_size) { + NDR_PULL_ALLOC(ndr, r->in.data_size); + } else { + r->in.data_size = NULL; + } + if (r->in.data_size) { + _mem_save_data_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.data_size, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.data_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_length)); + if (_ptr_data_length) { + NDR_PULL_ALLOC(ndr, r->in.data_length); + } else { + r->in.data_length = NULL; + } + if (r->in.data_length) { + _mem_save_data_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.data_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.data_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_length_0, 0); + } + if (r->in.data) { + 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.data_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.data_length)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type)); + if (_ptr_type) { + NDR_PULL_ALLOC(ndr, r->out.type); + } else { + r->out.type = NULL; + } + if (r->out.type) { + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.type, 0); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->out.data); + } else { + r->out.data = NULL; + } + if (r->out.data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->out.data)); + if (ndr_get_array_length(ndr, &r->out.data) > ndr_get_array_size(ndr, &r->out.data)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.data), ndr_get_array_length(ndr, &r->out.data)); + } + NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_length(ndr, &r->out.data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_size)); + if (_ptr_data_size) { + NDR_PULL_ALLOC(ndr, r->out.data_size); + } else { + r->out.data_size = NULL; + } + if (r->out.data_size) { + _mem_save_data_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.data_size, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.data_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_length)); + if (_ptr_data_length) { + NDR_PULL_ALLOC(ndr, r->out.data_length); + } else { + r->out.data_length = NULL; + } + if (r->out.data_length) { + _mem_save_data_length_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.data_length, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.data_length)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_length_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.data) { + 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.data_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.data_length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryValue *r) +{ + ndr_print_struct(ndr, name, "winreg_QueryValue"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_QueryValue"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "value_name", r->in.value_name); + ndr->depth++; + ndr_print_winreg_String(ndr, "value_name", r->in.value_name); + ndr->depth--; + ndr_print_ptr(ndr, "type", r->in.type); + ndr->depth++; + if (r->in.type) { + ndr_print_winreg_Type(ndr, "type", *r->in.type); + } + ndr->depth--; + ndr_print_ptr(ndr, "data", r->in.data); + ndr->depth++; + if (r->in.data) { + if (r->in.data_length == NULL) return; + ndr_print_array_uint8(ndr, "data", r->in.data, *r->in.data_length); + } + ndr->depth--; + ndr_print_ptr(ndr, "data_size", r->in.data_size); + ndr->depth++; + if (r->in.data_size) { + ndr_print_uint32(ndr, "data_size", *r->in.data_size); + } + ndr->depth--; + ndr_print_ptr(ndr, "data_length", r->in.data_length); + ndr->depth++; + if (r->in.data_length) { + ndr_print_uint32(ndr, "data_length", *r->in.data_length); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_QueryValue"); + ndr->depth++; + ndr_print_ptr(ndr, "type", r->out.type); + ndr->depth++; + if (r->out.type) { + ndr_print_winreg_Type(ndr, "type", *r->out.type); + } + ndr->depth--; + ndr_print_ptr(ndr, "data", r->out.data); + ndr->depth++; + if (r->out.data) { + if (r->out.data_length == NULL) return; + ndr_print_array_uint8(ndr, "data", r->out.data, *r->out.data_length); + } + ndr->depth--; + ndr_print_ptr(ndr, "data_size", r->out.data_size); + ndr->depth++; + if (r->out.data_size) { + ndr_print_uint32(ndr, "data_size", *r->out.data_size); + } + ndr->depth--; + ndr_print_ptr(ndr, "data_length", r->out.data_length); + ndr->depth++; + if (r->out.data_length) { + ndr_print_uint32(ndr, "data_length", *r->out.data_length); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_ReplaceKey(struct ndr_push *ndr, int flags, const struct winreg_ReplaceKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_ReplaceKey(struct ndr_pull *ndr, int flags, struct winreg_ReplaceKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_ReplaceKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_ReplaceKey *r) +{ + ndr_print_struct(ndr, name, "winreg_ReplaceKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_ReplaceKey"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_ReplaceKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_RestoreKey(struct ndr_pull *ndr, int flags, struct winreg_RestoreKey *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_filename_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.filename); + } + _mem_save_filename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.filename, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filename_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_RestoreKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_RestoreKey *r) +{ + ndr_print_struct(ndr, name, "winreg_RestoreKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_RestoreKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "filename", r->in.filename); + ndr->depth++; + ndr_print_winreg_String(ndr, "filename", r->in.filename); + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_RestoreKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + 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) { + NDR_CHECK(ndr_push_KeySecurityAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sec_attrib)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_SaveKey(struct ndr_pull *ndr, int flags, struct winreg_SaveKey *r) +{ + uint32_t _ptr_sec_attrib; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_filename_0; + TALLOC_CTX *_mem_save_sec_attrib_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.filename); + } + _mem_save_filename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.filename, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filename_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sec_attrib)); + if (_ptr_sec_attrib) { + NDR_PULL_ALLOC(ndr, r->in.sec_attrib); + } else { + r->in.sec_attrib = NULL; + } + if (r->in.sec_attrib) { + _mem_save_sec_attrib_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sec_attrib, 0); + NDR_CHECK(ndr_pull_KeySecurityAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sec_attrib)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_attrib_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_SaveKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKey *r) +{ + ndr_print_struct(ndr, name, "winreg_SaveKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_SaveKey"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_ptr(ndr, "filename", r->in.filename); + ndr->depth++; + ndr_print_winreg_String(ndr, "filename", r->in.filename); + ndr->depth--; + ndr_print_ptr(ndr, "sec_attrib", r->in.sec_attrib); + ndr->depth++; + if (r->in.sec_attrib) { + ndr_print_KeySecurityAttribute(ndr, "sec_attrib", r->in.sec_attrib); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_SaveKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); + 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) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_SetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_SetKeySecurity *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sd_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sd); + } + _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sd, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_SetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetKeySecurity *r) +{ + ndr_print_struct(ndr, name, "winreg_SetKeySecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_SetKeySecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); + ndr_print_ptr(ndr, "sd", r->in.sd); + ndr->depth++; + ndr_print_KeySecurityData(ndr, "sd", r->in.sd); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_SetKeySecurity"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_SetValue(struct ndr_pull *ndr, int flags, struct winreg_SetValue *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_size(ndr, &r->in.data))); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.size)); + if (r->in.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, r->in.size)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_SetValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetValue *r) +{ + ndr_print_struct(ndr, name, "winreg_SetValue"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_SetValue"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_winreg_String(ndr, "name", &r->in.name); + ndr_print_winreg_Type(ndr, "type", r->in.type); + ndr_print_ptr(ndr, "data", r->in.data); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->in.data, r->in.size); + ndr->depth--; + ndr_print_uint32(ndr, "size", r->in.size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_SetValue"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_UnLoadKey(struct ndr_push *ndr, int flags, const struct winreg_UnLoadKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_UnLoadKey(struct ndr_pull *ndr, int flags, struct winreg_UnLoadKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_UnLoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_UnLoadKey *r) +{ + ndr_print_struct(ndr, name, "winreg_UnLoadKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_UnLoadKey"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_UnLoadKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_InitiateSystemShutdown(struct ndr_push *ndr, int flags, const struct winreg_InitiateSystemShutdown *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname)); + if (r->in.hostname) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message)); + if (r->in.message) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_InitiateSystemShutdown(struct ndr_pull *ndr, int flags, struct winreg_InitiateSystemShutdown *r) +{ + uint32_t _ptr_hostname; + uint32_t _ptr_message; + TALLOC_CTX *_mem_save_hostname_0; + TALLOC_CTX *_mem_save_message_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname)); + if (_ptr_hostname) { + NDR_PULL_ALLOC(ndr, r->in.hostname); + } else { + r->in.hostname = NULL; + } + if (r->in.hostname) { + _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message)); + if (_ptr_message) { + NDR_PULL_ALLOC(ndr, r->in.message); + } else { + r->in.message = NULL; + } + if (r->in.message) { + _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_InitiateSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdown *r) +{ + ndr_print_struct(ndr, name, "winreg_InitiateSystemShutdown"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_InitiateSystemShutdown"); + ndr->depth++; + ndr_print_ptr(ndr, "hostname", r->in.hostname); + ndr->depth++; + if (r->in.hostname) { + ndr_print_uint16(ndr, "hostname", *r->in.hostname); + } + ndr->depth--; + ndr_print_ptr(ndr, "message", r->in.message); + ndr->depth++; + if (r->in.message) { + ndr_print_lsa_StringLarge(ndr, "message", r->in.message); + } + ndr->depth--; + ndr_print_uint32(ndr, "timeout", r->in.timeout); + ndr_print_uint8(ndr, "force_apps", r->in.force_apps); + ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_InitiateSystemShutdown"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_AbortSystemShutdown(struct ndr_push *ndr, int flags, const struct winreg_AbortSystemShutdown *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.server)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_AbortSystemShutdown(struct ndr_pull *ndr, int flags, struct winreg_AbortSystemShutdown *r) +{ + uint32_t _ptr_server; + TALLOC_CTX *_mem_save_server_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.server)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_AbortSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_AbortSystemShutdown *r) +{ + ndr_print_struct(ndr, name, "winreg_AbortSystemShutdown"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_AbortSystemShutdown"); + ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_uint16(ndr, "server", *r->in.server); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_AbortSystemShutdown"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_version_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.version); + ZERO_STRUCTP(r->out.version); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.version); + } + _mem_save_version_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.version, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.version)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetVersion *r) +{ + ndr_print_struct(ndr, name, "winreg_GetVersion"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_GetVersion"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_GetVersion"); + ndr->depth++; + ndr_print_ptr(ndr, "version", r->out.version); + ndr->depth++; + ndr_print_uint32(ndr, "version", *r->out.version); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_OpenHKCC(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCC *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_OpenHKCC(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCC *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenHKCC(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCC *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenHKCC"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenHKCC"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenHKCC"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_OpenHKDD(struct ndr_push *ndr, int flags, const struct winreg_OpenHKDD *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_OpenHKDD(struct ndr_pull *ndr, int flags, struct winreg_OpenHKDD *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenHKDD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKDD *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenHKDD"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenHKDD"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenHKDD"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues *r) +{ + uint32_t cntr_values_1; + if (flags & NDR_IN) { + 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, r->in.key_handle)); + 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)); + for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { + NDR_CHECK(ndr_push_QueryMultipleValue(ndr, NDR_SCALARS, &r->in.values[cntr_values_1])); + } + for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { + NDR_CHECK(ndr_push_QueryMultipleValue(ndr, NDR_BUFFERS, &r->in.values[cntr_values_1])); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.buffer)); + if (r->in.buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.buffer_size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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 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 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)); + for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { + NDR_CHECK(ndr_push_QueryMultipleValue(ndr, NDR_SCALARS, &r->out.values[cntr_values_1])); + } + for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { + NDR_CHECK(ndr_push_QueryMultipleValue(ndr, NDR_BUFFERS, &r->out.values[cntr_values_1])); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.buffer)); + if (r->out.buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.buffer_size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + 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 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)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues *r) +{ + uint32_t cntr_values_1; + uint32_t _ptr_buffer; + TALLOC_CTX *_mem_save_key_handle_0; + TALLOC_CTX *_mem_save_values_1; + TALLOC_CTX *_mem_save_buffer_0; + TALLOC_CTX *_mem_save_buffer_size_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.key_handle); + } + _mem_save_key_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.key_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.key_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.values)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.values)); + if (ndr_get_array_length(ndr, &r->in.values) > ndr_get_array_size(ndr, &r->in.values)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.values), ndr_get_array_length(ndr, &r->in.values)); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.values, ndr_get_array_size(ndr, &r->in.values)); + } + memcpy(r->out.values, r->in.values, ndr_get_array_size(ndr, &r->in.values) * sizeof(*r->in.values)); + _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.values, 0); + for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { + NDR_CHECK(ndr_pull_QueryMultipleValue(ndr, NDR_SCALARS, &r->in.values[cntr_values_1])); + } + for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { + NDR_CHECK(ndr_pull_QueryMultipleValue(ndr, NDR_BUFFERS, &r->in.values[cntr_values_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_values)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); + if (_ptr_buffer) { + NDR_PULL_ALLOC(ndr, r->in.buffer); + } else { + r->in.buffer = NULL; + } + if (r->in.buffer) { + _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.buffer)); + if (ndr_get_array_length(ndr, &r->in.buffer) > ndr_get_array_size(ndr, &r->in.buffer)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.buffer), ndr_get_array_length(ndr, &r->in.buffer)); + } + NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_length(ndr, &r->in.buffer))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.buffer_size); + } + _mem_save_buffer_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC_N(ndr, r->out.values, r->in.num_values); + memcpy(r->out.values, r->in.values, (r->in.num_values) * sizeof(*r->in.values)); + NDR_PULL_ALLOC(ndr, r->out.buffer_size); + *r->out.buffer_size = *r->in.buffer_size; + if (r->in.values) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.values, r->in.num_values)); + } + if (r->in.values) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.values, r->in.num_values)); + } + if (r->in.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, *r->in.buffer_size)); + } + if (r->in.buffer) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.buffer, *r->in.buffer_size)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.values)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->out.values)); + if (ndr_get_array_length(ndr, &r->out.values) > ndr_get_array_size(ndr, &r->out.values)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.values), ndr_get_array_length(ndr, &r->out.values)); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.values, ndr_get_array_size(ndr, &r->out.values)); + } + memcpy(r->out.values, r->in.values, ndr_get_array_size(ndr, &r->out.values) * sizeof(*r->in.values)); + _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.values, 0); + for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { + NDR_CHECK(ndr_pull_QueryMultipleValue(ndr, NDR_SCALARS, &r->out.values[cntr_values_1])); + } + for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { + NDR_CHECK(ndr_pull_QueryMultipleValue(ndr, NDR_BUFFERS, &r->out.values[cntr_values_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); + if (_ptr_buffer) { + NDR_PULL_ALLOC(ndr, r->out.buffer); + } else { + r->out.buffer = NULL; + } + if (r->out.buffer) { + _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->out.buffer)); + if (ndr_get_array_length(ndr, &r->out.buffer) > ndr_get_array_size(ndr, &r->out.buffer)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.buffer), ndr_get_array_length(ndr, &r->out.buffer)); + } + NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_length(ndr, &r->out.buffer))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.buffer_size); + } + _mem_save_buffer_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.buffer_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.values) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.values, r->in.num_values)); + } + if (r->out.values) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.values, r->in.num_values)); + } + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, *r->out.buffer_size)); + } + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.buffer, *r->out.buffer_size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues *r) +{ + uint32_t cntr_values_1; + ndr_print_struct(ndr, name, "winreg_QueryMultipleValues"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_QueryMultipleValues"); + ndr->depth++; + ndr_print_ptr(ndr, "key_handle", r->in.key_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "key_handle", r->in.key_handle); + ndr->depth--; + ndr_print_ptr(ndr, "values", r->in.values); + ndr->depth++; + ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->in.num_values); + ndr->depth++; + for (cntr_values_1=0;cntr_values_1in.num_values;cntr_values_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) { + ndr_print_QueryMultipleValue(ndr, "values", &r->in.values[cntr_values_1]); + free(idx_1); + } + } + ndr->depth--; + ndr->depth--; + ndr_print_uint32(ndr, "num_values", r->in.num_values); + ndr_print_ptr(ndr, "buffer", r->in.buffer); + ndr->depth++; + if (r->in.buffer) { + ndr_print_array_uint8(ndr, "buffer", r->in.buffer, *r->in.buffer_size); + } + ndr->depth--; + ndr_print_ptr(ndr, "buffer_size", r->in.buffer_size); + ndr->depth++; + ndr_print_uint32(ndr, "buffer_size", *r->in.buffer_size); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_QueryMultipleValues"); + ndr->depth++; + ndr_print_ptr(ndr, "values", r->out.values); + ndr->depth++; + ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->in.num_values); + ndr->depth++; + for (cntr_values_1=0;cntr_values_1in.num_values;cntr_values_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) { + ndr_print_QueryMultipleValue(ndr, "values", &r->out.values[cntr_values_1]); + free(idx_1); + } + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + if (r->out.buffer) { + ndr_print_array_uint8(ndr, "buffer", r->out.buffer, *r->out.buffer_size); + } + ndr->depth--; + ndr_print_ptr(ndr, "buffer_size", r->out.buffer_size); + ndr->depth++; + ndr_print_uint32(ndr, "buffer_size", *r->out.buffer_size); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_InitiateSystemShutdownEx(struct ndr_push *ndr, int flags, const struct winreg_InitiateSystemShutdownEx *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname)); + if (r->in.hostname) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message)); + if (r->in.message) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reason)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_InitiateSystemShutdownEx(struct ndr_pull *ndr, int flags, struct winreg_InitiateSystemShutdownEx *r) +{ + uint32_t _ptr_hostname; + uint32_t _ptr_message; + TALLOC_CTX *_mem_save_hostname_0; + TALLOC_CTX *_mem_save_message_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname)); + if (_ptr_hostname) { + NDR_PULL_ALLOC(ndr, r->in.hostname); + } else { + r->in.hostname = NULL; + } + if (r->in.hostname) { + _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message)); + if (_ptr_message) { + NDR_PULL_ALLOC(ndr, r->in.message); + } else { + r->in.message = NULL; + } + if (r->in.message) { + _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reason)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_InitiateSystemShutdownEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdownEx *r) +{ + ndr_print_struct(ndr, name, "winreg_InitiateSystemShutdownEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_InitiateSystemShutdownEx"); + ndr->depth++; + ndr_print_ptr(ndr, "hostname", r->in.hostname); + ndr->depth++; + if (r->in.hostname) { + ndr_print_uint16(ndr, "hostname", *r->in.hostname); + } + ndr->depth--; + ndr_print_ptr(ndr, "message", r->in.message); + ndr->depth++; + if (r->in.message) { + ndr_print_lsa_StringLarge(ndr, "message", r->in.message); + } + ndr->depth--; + ndr_print_uint32(ndr, "timeout", r->in.timeout); + ndr_print_uint8(ndr, "force_apps", r->in.force_apps); + ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot); + ndr_print_uint32(ndr, "reason", r->in.reason); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_InitiateSystemShutdownEx"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_SaveKeyEx(struct ndr_push *ndr, int flags, const struct winreg_SaveKeyEx *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_SaveKeyEx(struct ndr_pull *ndr, int flags, struct winreg_SaveKeyEx *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_SaveKeyEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKeyEx *r) +{ + ndr_print_struct(ndr, name, "winreg_SaveKeyEx"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_SaveKeyEx"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_SaveKeyEx"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_OpenHKPT(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPT *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_OpenHKPT(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPT *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenHKPT(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPT *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenHKPT"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenHKPT"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenHKPT"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_OpenHKPN(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPN *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + 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, r->out.handle)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_OpenHKPN(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPN *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.handle); + ZERO_STRUCTP(r->out.handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_OpenHKPN(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPN *r) +{ + ndr_print_struct(ndr, name, "winreg_OpenHKPN"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_OpenHKPN"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_OpenHKPN"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_winreg_QueryMultipleValues2(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues2 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_QueryMultipleValues2(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues2 *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_QueryMultipleValues2(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues2 *r) +{ + ndr_print_struct(ndr, name, "winreg_QueryMultipleValues2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "winreg_QueryMultipleValues2"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "winreg_QueryMultipleValues2"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call winreg_calls[] = { + { + "winreg_OpenHKCR", + sizeof(struct winreg_OpenHKCR), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCR, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCR, + (ndr_print_function_t) ndr_print_winreg_OpenHKCR, + false, + }, + { + "winreg_OpenHKCU", + sizeof(struct winreg_OpenHKCU), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCU, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCU, + (ndr_print_function_t) ndr_print_winreg_OpenHKCU, + false, + }, + { + "winreg_OpenHKLM", + sizeof(struct winreg_OpenHKLM), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKLM, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKLM, + (ndr_print_function_t) ndr_print_winreg_OpenHKLM, + false, + }, + { + "winreg_OpenHKPD", + sizeof(struct winreg_OpenHKPD), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPD, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPD, + (ndr_print_function_t) ndr_print_winreg_OpenHKPD, + false, + }, + { + "winreg_OpenHKU", + sizeof(struct winreg_OpenHKU), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKU, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKU, + (ndr_print_function_t) ndr_print_winreg_OpenHKU, + false, + }, + { + "winreg_CloseKey", + sizeof(struct winreg_CloseKey), + (ndr_push_flags_fn_t) ndr_push_winreg_CloseKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_CloseKey, + (ndr_print_function_t) ndr_print_winreg_CloseKey, + false, + }, + { + "winreg_CreateKey", + sizeof(struct winreg_CreateKey), + (ndr_push_flags_fn_t) ndr_push_winreg_CreateKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_CreateKey, + (ndr_print_function_t) ndr_print_winreg_CreateKey, + false, + }, + { + "winreg_DeleteKey", + sizeof(struct winreg_DeleteKey), + (ndr_push_flags_fn_t) ndr_push_winreg_DeleteKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteKey, + (ndr_print_function_t) ndr_print_winreg_DeleteKey, + false, + }, + { + "winreg_DeleteValue", + sizeof(struct winreg_DeleteValue), + (ndr_push_flags_fn_t) ndr_push_winreg_DeleteValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteValue, + (ndr_print_function_t) ndr_print_winreg_DeleteValue, + false, + }, + { + "winreg_EnumKey", + sizeof(struct winreg_EnumKey), + (ndr_push_flags_fn_t) ndr_push_winreg_EnumKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_EnumKey, + (ndr_print_function_t) ndr_print_winreg_EnumKey, + false, + }, + { + "winreg_EnumValue", + sizeof(struct winreg_EnumValue), + (ndr_push_flags_fn_t) ndr_push_winreg_EnumValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_EnumValue, + (ndr_print_function_t) ndr_print_winreg_EnumValue, + false, + }, + { + "winreg_FlushKey", + sizeof(struct winreg_FlushKey), + (ndr_push_flags_fn_t) ndr_push_winreg_FlushKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_FlushKey, + (ndr_print_function_t) ndr_print_winreg_FlushKey, + false, + }, + { + "winreg_GetKeySecurity", + sizeof(struct winreg_GetKeySecurity), + (ndr_push_flags_fn_t) ndr_push_winreg_GetKeySecurity, + (ndr_pull_flags_fn_t) ndr_pull_winreg_GetKeySecurity, + (ndr_print_function_t) ndr_print_winreg_GetKeySecurity, + false, + }, + { + "winreg_LoadKey", + sizeof(struct winreg_LoadKey), + (ndr_push_flags_fn_t) ndr_push_winreg_LoadKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_LoadKey, + (ndr_print_function_t) ndr_print_winreg_LoadKey, + false, + }, + { + "winreg_NotifyChangeKeyValue", + sizeof(struct winreg_NotifyChangeKeyValue), + (ndr_push_flags_fn_t) ndr_push_winreg_NotifyChangeKeyValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_NotifyChangeKeyValue, + (ndr_print_function_t) ndr_print_winreg_NotifyChangeKeyValue, + false, + }, + { + "winreg_OpenKey", + sizeof(struct winreg_OpenKey), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenKey, + (ndr_print_function_t) ndr_print_winreg_OpenKey, + false, + }, + { + "winreg_QueryInfoKey", + sizeof(struct winreg_QueryInfoKey), + (ndr_push_flags_fn_t) ndr_push_winreg_QueryInfoKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryInfoKey, + (ndr_print_function_t) ndr_print_winreg_QueryInfoKey, + false, + }, + { + "winreg_QueryValue", + sizeof(struct winreg_QueryValue), + (ndr_push_flags_fn_t) ndr_push_winreg_QueryValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryValue, + (ndr_print_function_t) ndr_print_winreg_QueryValue, + false, + }, + { + "winreg_ReplaceKey", + sizeof(struct winreg_ReplaceKey), + (ndr_push_flags_fn_t) ndr_push_winreg_ReplaceKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_ReplaceKey, + (ndr_print_function_t) ndr_print_winreg_ReplaceKey, + false, + }, + { + "winreg_RestoreKey", + sizeof(struct winreg_RestoreKey), + (ndr_push_flags_fn_t) ndr_push_winreg_RestoreKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_RestoreKey, + (ndr_print_function_t) ndr_print_winreg_RestoreKey, + false, + }, + { + "winreg_SaveKey", + sizeof(struct winreg_SaveKey), + (ndr_push_flags_fn_t) ndr_push_winreg_SaveKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_SaveKey, + (ndr_print_function_t) ndr_print_winreg_SaveKey, + false, + }, + { + "winreg_SetKeySecurity", + sizeof(struct winreg_SetKeySecurity), + (ndr_push_flags_fn_t) ndr_push_winreg_SetKeySecurity, + (ndr_pull_flags_fn_t) ndr_pull_winreg_SetKeySecurity, + (ndr_print_function_t) ndr_print_winreg_SetKeySecurity, + false, + }, + { + "winreg_SetValue", + sizeof(struct winreg_SetValue), + (ndr_push_flags_fn_t) ndr_push_winreg_SetValue, + (ndr_pull_flags_fn_t) ndr_pull_winreg_SetValue, + (ndr_print_function_t) ndr_print_winreg_SetValue, + false, + }, + { + "winreg_UnLoadKey", + sizeof(struct winreg_UnLoadKey), + (ndr_push_flags_fn_t) ndr_push_winreg_UnLoadKey, + (ndr_pull_flags_fn_t) ndr_pull_winreg_UnLoadKey, + (ndr_print_function_t) ndr_print_winreg_UnLoadKey, + false, + }, + { + "winreg_InitiateSystemShutdown", + sizeof(struct winreg_InitiateSystemShutdown), + (ndr_push_flags_fn_t) ndr_push_winreg_InitiateSystemShutdown, + (ndr_pull_flags_fn_t) ndr_pull_winreg_InitiateSystemShutdown, + (ndr_print_function_t) ndr_print_winreg_InitiateSystemShutdown, + false, + }, + { + "winreg_AbortSystemShutdown", + sizeof(struct winreg_AbortSystemShutdown), + (ndr_push_flags_fn_t) ndr_push_winreg_AbortSystemShutdown, + (ndr_pull_flags_fn_t) ndr_pull_winreg_AbortSystemShutdown, + (ndr_print_function_t) ndr_print_winreg_AbortSystemShutdown, + false, + }, + { + "winreg_GetVersion", + sizeof(struct winreg_GetVersion), + (ndr_push_flags_fn_t) ndr_push_winreg_GetVersion, + (ndr_pull_flags_fn_t) ndr_pull_winreg_GetVersion, + (ndr_print_function_t) ndr_print_winreg_GetVersion, + false, + }, + { + "winreg_OpenHKCC", + sizeof(struct winreg_OpenHKCC), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCC, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCC, + (ndr_print_function_t) ndr_print_winreg_OpenHKCC, + false, + }, + { + "winreg_OpenHKDD", + sizeof(struct winreg_OpenHKDD), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKDD, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKDD, + (ndr_print_function_t) ndr_print_winreg_OpenHKDD, + false, + }, + { + "winreg_QueryMultipleValues", + sizeof(struct winreg_QueryMultipleValues), + (ndr_push_flags_fn_t) ndr_push_winreg_QueryMultipleValues, + (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryMultipleValues, + (ndr_print_function_t) ndr_print_winreg_QueryMultipleValues, + false, + }, + { + "winreg_InitiateSystemShutdownEx", + sizeof(struct winreg_InitiateSystemShutdownEx), + (ndr_push_flags_fn_t) ndr_push_winreg_InitiateSystemShutdownEx, + (ndr_pull_flags_fn_t) ndr_pull_winreg_InitiateSystemShutdownEx, + (ndr_print_function_t) ndr_print_winreg_InitiateSystemShutdownEx, + false, + }, + { + "winreg_SaveKeyEx", + sizeof(struct winreg_SaveKeyEx), + (ndr_push_flags_fn_t) ndr_push_winreg_SaveKeyEx, + (ndr_pull_flags_fn_t) ndr_pull_winreg_SaveKeyEx, + (ndr_print_function_t) ndr_print_winreg_SaveKeyEx, + false, + }, + { + "winreg_OpenHKPT", + sizeof(struct winreg_OpenHKPT), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPT, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPT, + (ndr_print_function_t) ndr_print_winreg_OpenHKPT, + false, + }, + { + "winreg_OpenHKPN", + sizeof(struct winreg_OpenHKPN), + (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPN, + (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPN, + (ndr_print_function_t) ndr_print_winreg_OpenHKPN, + false, + }, + { + "winreg_QueryMultipleValues2", + sizeof(struct winreg_QueryMultipleValues2), + (ndr_push_flags_fn_t) ndr_push_winreg_QueryMultipleValues2, + (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryMultipleValues2, + (ndr_print_function_t) ndr_print_winreg_QueryMultipleValues2, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const winreg_endpoint_strings[] = { + "ncacn_np:[\\pipe\\winreg]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array winreg_endpoints = { + .count = 3, + .names = winreg_endpoint_strings +}; + +static const char * const winreg_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array winreg_authservices = { + .count = 1, + .names = winreg_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_winreg = { + .name = "winreg", + .syntax_id = { + {0x338cd001,0x2244,0x31f1,{0xaa,0xaa},{0x90,0x00,0x38,0x00,0x10,0x03}}, + NDR_WINREG_VERSION + }, + .helpstring = NDR_WINREG_HELPSTRING, + .num_calls = 35, + .calls = winreg_calls, + .endpoints = &winreg_endpoints, + .authservices = &winreg_authservices +}; + diff --git a/librpc/gen_ndr/ndr_winreg.h b/librpc/gen_ndr/ndr_winreg.h new file mode 100644 index 0000000000..8dea3ae273 --- /dev/null +++ b/librpc/gen_ndr/ndr_winreg.h @@ -0,0 +1,164 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/winreg.h" + +#ifndef _HEADER_NDR_winreg +#define _HEADER_NDR_winreg + +#define NDR_WINREG_UUID "338cd001-2244-31f1-aaaa-900038001003" +#define NDR_WINREG_VERSION 1.0 +#define NDR_WINREG_NAME "winreg" +#define NDR_WINREG_HELPSTRING "Remote Registry Service" +extern const struct ndr_interface_table ndr_table_winreg; +#define NDR_WINREG_OPENHKCR (0x00) + +#define NDR_WINREG_OPENHKCU (0x01) + +#define NDR_WINREG_OPENHKLM (0x02) + +#define NDR_WINREG_OPENHKPD (0x03) + +#define NDR_WINREG_OPENHKU (0x04) + +#define NDR_WINREG_CLOSEKEY (0x05) + +#define NDR_WINREG_CREATEKEY (0x06) + +#define NDR_WINREG_DELETEKEY (0x07) + +#define NDR_WINREG_DELETEVALUE (0x08) + +#define NDR_WINREG_ENUMKEY (0x09) + +#define NDR_WINREG_ENUMVALUE (0x0a) + +#define NDR_WINREG_FLUSHKEY (0x0b) + +#define NDR_WINREG_GETKEYSECURITY (0x0c) + +#define NDR_WINREG_LOADKEY (0x0d) + +#define NDR_WINREG_NOTIFYCHANGEKEYVALUE (0x0e) + +#define NDR_WINREG_OPENKEY (0x0f) + +#define NDR_WINREG_QUERYINFOKEY (0x10) + +#define NDR_WINREG_QUERYVALUE (0x11) + +#define NDR_WINREG_REPLACEKEY (0x12) + +#define NDR_WINREG_RESTOREKEY (0x13) + +#define NDR_WINREG_SAVEKEY (0x14) + +#define NDR_WINREG_SETKEYSECURITY (0x15) + +#define NDR_WINREG_SETVALUE (0x16) + +#define NDR_WINREG_UNLOADKEY (0x17) + +#define NDR_WINREG_INITIATESYSTEMSHUTDOWN (0x18) + +#define NDR_WINREG_ABORTSYSTEMSHUTDOWN (0x19) + +#define NDR_WINREG_GETVERSION (0x1a) + +#define NDR_WINREG_OPENHKCC (0x1b) + +#define NDR_WINREG_OPENHKDD (0x1c) + +#define NDR_WINREG_QUERYMULTIPLEVALUES (0x1d) + +#define NDR_WINREG_INITIATESYSTEMSHUTDOWNEX (0x1e) + +#define NDR_WINREG_SAVEKEYEX (0x1f) + +#define NDR_WINREG_OPENHKPT (0x20) + +#define NDR_WINREG_OPENHKPN (0x21) + +#define NDR_WINREG_QUERYMULTIPLEVALUES2 (0x22) + +#define NDR_WINREG_CALL_COUNT (35) +void ndr_print_winreg_AccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r); +enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r); +void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r); +enum ndr_err_code ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, const struct winreg_String *r); +enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, struct winreg_String *r); +void ndr_print_winreg_String(struct ndr_print *ndr, const char *name, const struct winreg_String *r); +void ndr_print_KeySecurityData(struct ndr_print *ndr, const char *name, const struct KeySecurityData *r); +void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, const struct winreg_SecBuf *r); +void ndr_print_winreg_CreateAction(struct ndr_print *ndr, const char *name, enum winreg_CreateAction r); +void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name, const struct winreg_StringBuf *r); +enum ndr_err_code ndr_push_winreg_NotifyChangeType(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_winreg_NotifyChangeType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_winreg_NotifyChangeType(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_KeySecurityAttribute(struct ndr_print *ndr, const char *name, const struct KeySecurityAttribute *r); +void ndr_print_QueryMultipleValue(struct ndr_print *ndr, const char *name, const struct QueryMultipleValue *r); +void ndr_print_winreg_OpenHKCR(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCR *r); +void ndr_print_winreg_OpenHKCU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCU *r); +enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r); +enum ndr_err_code ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r); +void ndr_print_winreg_OpenHKLM(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKLM *r); +void ndr_print_winreg_OpenHKPD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPD *r); +void ndr_print_winreg_OpenHKU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKU *r); +enum ndr_err_code ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flags, const struct winreg_CloseKey *r); +enum ndr_err_code ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r); +void ndr_print_winreg_CloseKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CloseKey *r); +enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct winreg_CreateKey *r); +enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r); +void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CreateKey *r); +enum ndr_err_code ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int flags, const struct winreg_DeleteKey *r); +enum ndr_err_code ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r); +void ndr_print_winreg_DeleteKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteKey *r); +void ndr_print_winreg_DeleteValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteValue *r); +enum ndr_err_code ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct winreg_EnumKey *r); +enum ndr_err_code ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r); +void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumKey *r); +enum ndr_err_code ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const struct winreg_EnumValue *r); +enum ndr_err_code ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r); +void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumValue *r); +enum ndr_err_code ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flags, const struct winreg_FlushKey *r); +enum ndr_err_code ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r); +void ndr_print_winreg_FlushKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_FlushKey *r); +enum ndr_err_code ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_GetKeySecurity *r); +enum ndr_err_code ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r); +void ndr_print_winreg_GetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetKeySecurity *r); +void ndr_print_winreg_LoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_LoadKey *r); +enum ndr_err_code ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, const struct winreg_NotifyChangeKeyValue *r); +enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r); +void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_NotifyChangeKeyValue *r); +enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags, const struct winreg_OpenKey *r); +enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r); +void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenKey *r); +enum ndr_err_code ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const struct winreg_QueryInfoKey *r); +enum ndr_err_code ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r); +void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryInfoKey *r); +enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r); +enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r); +void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryValue *r); +void ndr_print_winreg_ReplaceKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_ReplaceKey *r); +void ndr_print_winreg_RestoreKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_RestoreKey *r); +void ndr_print_winreg_SaveKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKey *r); +void ndr_print_winreg_SetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetKeySecurity *r); +void ndr_print_winreg_SetValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetValue *r); +void ndr_print_winreg_UnLoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_UnLoadKey *r); +void ndr_print_winreg_InitiateSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdown *r); +void ndr_print_winreg_AbortSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_AbortSystemShutdown *r); +enum ndr_err_code ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struct winreg_GetVersion *r); +enum ndr_err_code ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r); +void ndr_print_winreg_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetVersion *r); +void ndr_print_winreg_OpenHKCC(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCC *r); +void ndr_print_winreg_OpenHKDD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKDD *r); +enum ndr_err_code ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues *r); +enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues *r); +void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues *r); +void ndr_print_winreg_InitiateSystemShutdownEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdownEx *r); +void ndr_print_winreg_SaveKeyEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKeyEx *r); +void ndr_print_winreg_OpenHKPT(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPT *r); +void ndr_print_winreg_OpenHKPN(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPN *r); +void ndr_print_winreg_QueryMultipleValues2(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues2 *r); +#endif /* _HEADER_NDR_winreg */ diff --git a/librpc/gen_ndr/ndr_wkssvc.c b/librpc/gen_ndr/ndr_wkssvc.c new file mode 100644 index 0000000000..e494f08be0 --- /dev/null +++ b/librpc/gen_ndr/ndr_wkssvc.c @@ -0,0 +1,10679 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_wkssvc.h" + +#include "librpc/gen_ndr/ndr_srvsvc.h" +#include "librpc/gen_ndr/ndr_lsa.h" +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo100(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo100 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo100(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo100 *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_domain_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + } else { + r->server_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->domain_name); + } else { + r->domain_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); + if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (r->domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); + if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo100(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo100 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo100"); + ndr->depth++; + ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->domain_name); + ndr->depth++; + if (r->domain_name) { + ndr_print_string(ndr, "domain_name", r->domain_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "version_major", r->version_major); + ndr_print_uint32(ndr, "version_minor", r->version_minor); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo101(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo101 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->lan_root)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->lan_root) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lan_root, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lan_root, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->lan_root, ndr_charset_length(r->lan_root, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo101(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo101 *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_domain_name_0; + uint32_t _ptr_lan_root; + TALLOC_CTX *_mem_save_lan_root_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + } else { + r->server_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->domain_name); + } else { + r->domain_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lan_root)); + if (_ptr_lan_root) { + NDR_PULL_ALLOC(ndr, r->lan_root); + } else { + r->lan_root = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); + if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (r->domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); + if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + if (r->lan_root) { + _mem_save_lan_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->lan_root, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->lan_root)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->lan_root)); + if (ndr_get_array_length(ndr, &r->lan_root) > ndr_get_array_size(ndr, &r->lan_root)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->lan_root), ndr_get_array_length(ndr, &r->lan_root)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->lan_root), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->lan_root, ndr_get_array_length(ndr, &r->lan_root), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lan_root_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo101(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo101 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo101"); + ndr->depth++; + ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->domain_name); + ndr->depth++; + if (r->domain_name) { + ndr_print_string(ndr, "domain_name", r->domain_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "version_major", r->version_major); + ndr_print_uint32(ndr, "version_minor", r->version_minor); + ndr_print_ptr(ndr, "lan_root", r->lan_root); + ndr->depth++; + if (r->lan_root) { + ndr_print_string(ndr, "lan_root", r->lan_root); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo102(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo102 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->lan_root)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logged_on_users)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->lan_root) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lan_root, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lan_root, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->lan_root, ndr_charset_length(r->lan_root, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo102(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo102 *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_domain_name_0; + uint32_t _ptr_lan_root; + TALLOC_CTX *_mem_save_lan_root_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + } else { + r->server_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->domain_name); + } else { + r->domain_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lan_root)); + if (_ptr_lan_root) { + NDR_PULL_ALLOC(ndr, r->lan_root); + } else { + r->lan_root = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logged_on_users)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); + if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (r->domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); + if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + if (r->lan_root) { + _mem_save_lan_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->lan_root, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->lan_root)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->lan_root)); + if (ndr_get_array_length(ndr, &r->lan_root) > ndr_get_array_size(ndr, &r->lan_root)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->lan_root), ndr_get_array_length(ndr, &r->lan_root)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->lan_root), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->lan_root, ndr_get_array_length(ndr, &r->lan_root), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lan_root_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo102(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo102 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo102"); + ndr->depth++; + ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->domain_name); + ndr->depth++; + if (r->domain_name) { + ndr_print_string(ndr, "domain_name", r->domain_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "version_major", r->version_major); + ndr_print_uint32(ndr, "version_minor", r->version_minor); + ndr_print_ptr(ndr, "lan_root", r->lan_root); + ndr->depth++; + if (r->lan_root) { + ndr_print_string(ndr, "lan_root", r->lan_root); + } + ndr->depth--; + ndr_print_uint32(ndr, "logged_on_users", r->logged_on_users); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo502(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo502 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->char_wait)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->collection_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximum_collection_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keep_connection)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_commands)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_timeout)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size_char_buf)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_threads)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_quota)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_increment)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_maximum)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pipe_increment)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pipe_maximum)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->cache_file_timeout)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dormant_file_limit)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->read_ahead_throughput)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mailslot_buffers)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_srv_announce_buffers)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_illegal_dgram_events)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dgram_event_reset_freq)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->log_election_packets)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_opportunistic_locking)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_unlock_behind)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_close_behind)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_named_pipes)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_lock_read_unlock)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->utilize_nt_caching)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_raw_read)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_raw_write)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_write_raw_data)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_encryption)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_files_deny_write)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_read_only_files)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->force_core_create_mode)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_512_byte_max_transfer)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo502(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo502 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->char_wait)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->collection_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximum_collection_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keep_connection)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_commands)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_timeout)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size_char_buf)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_threads)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_quota)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_increment)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_maximum)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pipe_increment)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pipe_maximum)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->cache_file_timeout)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dormant_file_limit)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->read_ahead_throughput)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_mailslot_buffers)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_srv_announce_buffers)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_illegal_dgram_events)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dgram_event_reset_freq)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->log_election_packets)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_opportunistic_locking)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_unlock_behind)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_close_behind)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_named_pipes)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_lock_read_unlock)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->utilize_nt_caching)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_raw_read)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_raw_write)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_write_raw_data)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_encryption)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_files_deny_write)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_read_only_files)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->force_core_create_mode)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_512_byte_max_transfer)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo502(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo502 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo502"); + ndr->depth++; + ndr_print_uint32(ndr, "char_wait", r->char_wait); + ndr_print_uint32(ndr, "collection_time", r->collection_time); + ndr_print_uint32(ndr, "maximum_collection_count", r->maximum_collection_count); + ndr_print_uint32(ndr, "keep_connection", r->keep_connection); + ndr_print_uint32(ndr, "max_commands", r->max_commands); + ndr_print_uint32(ndr, "session_timeout", r->session_timeout); + ndr_print_uint32(ndr, "size_char_buf", r->size_char_buf); + ndr_print_uint32(ndr, "max_threads", r->max_threads); + ndr_print_uint32(ndr, "lock_quota", r->lock_quota); + ndr_print_uint32(ndr, "lock_increment", r->lock_increment); + ndr_print_uint32(ndr, "lock_maximum", r->lock_maximum); + ndr_print_uint32(ndr, "pipe_increment", r->pipe_increment); + ndr_print_uint32(ndr, "pipe_maximum", r->pipe_maximum); + ndr_print_uint32(ndr, "cache_file_timeout", r->cache_file_timeout); + ndr_print_uint32(ndr, "dormant_file_limit", r->dormant_file_limit); + ndr_print_uint32(ndr, "read_ahead_throughput", r->read_ahead_throughput); + ndr_print_uint32(ndr, "num_mailslot_buffers", r->num_mailslot_buffers); + ndr_print_uint32(ndr, "num_srv_announce_buffers", r->num_srv_announce_buffers); + ndr_print_uint32(ndr, "max_illegal_dgram_events", r->max_illegal_dgram_events); + ndr_print_uint32(ndr, "dgram_event_reset_freq", r->dgram_event_reset_freq); + ndr_print_uint32(ndr, "log_election_packets", r->log_election_packets); + ndr_print_uint32(ndr, "use_opportunistic_locking", r->use_opportunistic_locking); + ndr_print_uint32(ndr, "use_unlock_behind", r->use_unlock_behind); + ndr_print_uint32(ndr, "use_close_behind", r->use_close_behind); + ndr_print_uint32(ndr, "buf_named_pipes", r->buf_named_pipes); + ndr_print_uint32(ndr, "use_lock_read_unlock", r->use_lock_read_unlock); + ndr_print_uint32(ndr, "utilize_nt_caching", r->utilize_nt_caching); + ndr_print_uint32(ndr, "use_raw_read", r->use_raw_read); + ndr_print_uint32(ndr, "use_raw_write", r->use_raw_write); + ndr_print_uint32(ndr, "use_write_raw_data", r->use_write_raw_data); + ndr_print_uint32(ndr, "use_encryption", r->use_encryption); + ndr_print_uint32(ndr, "buf_files_deny_write", r->buf_files_deny_write); + ndr_print_uint32(ndr, "buf_read_only_files", r->buf_read_only_files); + ndr_print_uint32(ndr, "force_core_create_mode", r->force_core_create_mode); + ndr_print_uint32(ndr, "use_512_byte_max_transfer", r->use_512_byte_max_transfer); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1010(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1010 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->char_wait)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1010(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1010 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->char_wait)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1010(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1010 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1010"); + ndr->depth++; + ndr_print_uint32(ndr, "char_wait", r->char_wait); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1011(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1011 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->collection_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1011(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1011 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->collection_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1011(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1011 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1011"); + ndr->depth++; + ndr_print_uint32(ndr, "collection_time", r->collection_time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1012(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1012 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximum_collection_count)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1012(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1012 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximum_collection_count)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1012(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1012 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1012"); + ndr->depth++; + ndr_print_uint32(ndr, "maximum_collection_count", r->maximum_collection_count); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1013(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1013 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keep_connection)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1013(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1013 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keep_connection)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1013(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1013 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1013"); + ndr->depth++; + ndr_print_uint32(ndr, "keep_connection", r->keep_connection); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1018(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1018 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_timeout)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1018(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1018 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_timeout)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1018(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1018 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1018"); + ndr->depth++; + ndr_print_uint32(ndr, "session_timeout", r->session_timeout); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1023(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1023 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size_char_buf)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1023(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1023 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size_char_buf)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1023(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1023 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1023"); + ndr->depth++; + ndr_print_uint32(ndr, "size_char_buf", r->size_char_buf); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1027(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1027 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->errorlog_sz)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1027(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1027 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->errorlog_sz)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1027(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1027 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1027"); + ndr->depth++; + ndr_print_uint32(ndr, "errorlog_sz", r->errorlog_sz); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1028(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1028 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->print_buf_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1028(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1028 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->print_buf_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1028(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1028 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1028"); + ndr->depth++; + ndr_print_uint32(ndr, "print_buf_time", r->print_buf_time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1032(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1032 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->wrk_heuristics)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1032(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1032 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->wrk_heuristics)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1032(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1032 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1032"); + ndr->depth++; + ndr_print_uint32(ndr, "wrk_heuristics", r->wrk_heuristics); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1033(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1033 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_threads)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1033(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1033 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_threads)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1033(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1033 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1033"); + ndr->depth++; + ndr_print_uint32(ndr, "max_threads", r->max_threads); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1041(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1041 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_quota)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1041(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1041 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_quota)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1041(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1041 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1041"); + ndr->depth++; + ndr_print_uint32(ndr, "lock_quota", r->lock_quota); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1042(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1042 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_increment)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1042(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1042 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_increment)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1042(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1042 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1042"); + ndr->depth++; + ndr_print_uint32(ndr, "lock_increment", r->lock_increment); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1043(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1043 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_maximum)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1043(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1043 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_maximum)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1043(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1043 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1043"); + ndr->depth++; + ndr_print_uint32(ndr, "lock_maximum", r->lock_maximum); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1044(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1044 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pipe_increment)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1044(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1044 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pipe_increment)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1044(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1044 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1044"); + ndr->depth++; + ndr_print_uint32(ndr, "pipe_increment", r->pipe_increment); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1045(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1045 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pipe_maximum)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1045(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1045 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pipe_maximum)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1045(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1045 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1045"); + ndr->depth++; + ndr_print_uint32(ndr, "pipe_maximum", r->pipe_maximum); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1046(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1046 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dormant_file_limit)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1046(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1046 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dormant_file_limit)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1046(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1046 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1046"); + ndr->depth++; + ndr_print_uint32(ndr, "dormant_file_limit", r->dormant_file_limit); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1047(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1047 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->cache_file_timeout)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1047(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1047 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->cache_file_timeout)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1047(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1047 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1047"); + ndr->depth++; + ndr_print_uint32(ndr, "cache_file_timeout", r->cache_file_timeout); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1048(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1048 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_opportunistic_locking)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1048(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1048 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_opportunistic_locking)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1048(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1048 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1048"); + ndr->depth++; + ndr_print_uint32(ndr, "use_opportunistic_locking", r->use_opportunistic_locking); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1049(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1049 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_unlock_behind)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1049(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1049 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_unlock_behind)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1049(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1049 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1049"); + ndr->depth++; + ndr_print_uint32(ndr, "use_unlock_behind", r->use_unlock_behind); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1050(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1050 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_close_behind)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1050(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1050 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_close_behind)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1050(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1050 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1050"); + ndr->depth++; + ndr_print_uint32(ndr, "use_close_behind", r->use_close_behind); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1051(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1051 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_named_pipes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1051(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1051 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_named_pipes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1051(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1051 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1051"); + ndr->depth++; + ndr_print_uint32(ndr, "buf_named_pipes", r->buf_named_pipes); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1052(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1052 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_lock_read_unlock)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1052(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1052 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_lock_read_unlock)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1052(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1052 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1052"); + ndr->depth++; + ndr_print_uint32(ndr, "use_lock_read_unlock", r->use_lock_read_unlock); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1053(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1053 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->utilize_nt_caching)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1053(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1053 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->utilize_nt_caching)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1053(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1053 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1053"); + ndr->depth++; + ndr_print_uint32(ndr, "utilize_nt_caching", r->utilize_nt_caching); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1054(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1054 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_raw_read)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1054(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1054 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_raw_read)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1054(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1054 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1054"); + ndr->depth++; + ndr_print_uint32(ndr, "use_raw_read", r->use_raw_read); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1055(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1055 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_raw_write)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1055(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1055 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_raw_write)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1055(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1055 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1055"); + ndr->depth++; + ndr_print_uint32(ndr, "use_raw_write", r->use_raw_write); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1056(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1056 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_write_raw_data)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1056(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1056 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_write_raw_data)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1056(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1056 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1056"); + ndr->depth++; + ndr_print_uint32(ndr, "use_write_raw_data", r->use_write_raw_data); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1057(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1057 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_encryption)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1057(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1057 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_encryption)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1057(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1057 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1057"); + ndr->depth++; + ndr_print_uint32(ndr, "use_encryption", r->use_encryption); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1058(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1058 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_files_deny_write)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1058(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1058 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_files_deny_write)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1058(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1058 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1058"); + ndr->depth++; + ndr_print_uint32(ndr, "buf_files_deny_write", r->buf_files_deny_write); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1059(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1059 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_read_only_files)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1059(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1059 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_read_only_files)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1059(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1059 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1059"); + ndr->depth++; + ndr_print_uint32(ndr, "buf_read_only_files", r->buf_read_only_files); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1060(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1060 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->force_core_create_mode)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1060(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1060 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->force_core_create_mode)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1060(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1060 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1060"); + ndr->depth++; + ndr_print_uint32(ndr, "force_core_create_mode", r->force_core_create_mode); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1061(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1061 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_512_byte_max_transfer)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1061(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1061 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_512_byte_max_transfer)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1061(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1061 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1061"); + ndr->depth++; + ndr_print_uint32(ndr, "use_512_byte_max_transfer", r->use_512_byte_max_transfer); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1062(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1062 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->read_ahead_throughput)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1062(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1062 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->read_ahead_throughput)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1062(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1062 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1062"); + ndr->depth++; + ndr_print_uint32(ndr, "read_ahead_throughput", r->read_ahead_throughput); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetWkstaInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 100: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info100)); + break; } + + case 101: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info101)); + break; } + + case 102: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info102)); + break; } + + case 502: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info502)); + break; } + + case 1010: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1010)); + break; } + + case 1011: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1011)); + break; } + + case 1012: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1012)); + break; } + + case 1013: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1013)); + break; } + + case 1018: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1018)); + break; } + + case 1023: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1023)); + break; } + + case 1027: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1027)); + break; } + + case 1028: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1028)); + break; } + + case 1032: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1032)); + break; } + + case 1033: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1033)); + break; } + + case 1041: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1041)); + break; } + + case 1042: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1042)); + break; } + + case 1043: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1043)); + break; } + + case 1044: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1044)); + break; } + + case 1045: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1045)); + break; } + + case 1046: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1046)); + break; } + + case 1047: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1047)); + break; } + + case 1048: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1048)); + break; } + + case 1049: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1049)); + break; } + + case 1050: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1050)); + break; } + + case 1051: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1051)); + break; } + + case 1052: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1052)); + break; } + + case 1053: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1053)); + break; } + + case 1054: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1054)); + break; } + + case 1055: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1055)); + break; } + + case 1056: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1056)); + break; } + + case 1057: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1057)); + break; } + + case 1058: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1058)); + break; } + + case 1059: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1059)); + break; } + + case 1060: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1060)); + break; } + + case 1061: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1061)); + break; } + + case 1062: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1062)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 100: + if (r->info100) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); + } + break; + + case 101: + if (r->info101) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info101)); + } + break; + + case 102: + if (r->info102) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo102(ndr, NDR_SCALARS|NDR_BUFFERS, r->info102)); + } + break; + + case 502: + if (r->info502) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo502(ndr, NDR_SCALARS, r->info502)); + } + break; + + case 1010: + if (r->info1010) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1010(ndr, NDR_SCALARS, r->info1010)); + } + break; + + case 1011: + if (r->info1011) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1011(ndr, NDR_SCALARS, r->info1011)); + } + break; + + case 1012: + if (r->info1012) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1012(ndr, NDR_SCALARS, r->info1012)); + } + break; + + case 1013: + if (r->info1013) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1013(ndr, NDR_SCALARS, r->info1013)); + } + break; + + case 1018: + if (r->info1018) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1018(ndr, NDR_SCALARS, r->info1018)); + } + break; + + case 1023: + if (r->info1023) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1023(ndr, NDR_SCALARS, r->info1023)); + } + break; + + case 1027: + if (r->info1027) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1027(ndr, NDR_SCALARS, r->info1027)); + } + break; + + case 1028: + if (r->info1028) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1028(ndr, NDR_SCALARS, r->info1028)); + } + break; + + case 1032: + if (r->info1032) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1032(ndr, NDR_SCALARS, r->info1032)); + } + break; + + case 1033: + if (r->info1033) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1033(ndr, NDR_SCALARS, r->info1033)); + } + break; + + case 1041: + if (r->info1041) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1041(ndr, NDR_SCALARS, r->info1041)); + } + break; + + case 1042: + if (r->info1042) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1042(ndr, NDR_SCALARS, r->info1042)); + } + break; + + case 1043: + if (r->info1043) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1043(ndr, NDR_SCALARS, r->info1043)); + } + break; + + case 1044: + if (r->info1044) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1044(ndr, NDR_SCALARS, r->info1044)); + } + break; + + case 1045: + if (r->info1045) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1045(ndr, NDR_SCALARS, r->info1045)); + } + break; + + case 1046: + if (r->info1046) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1046(ndr, NDR_SCALARS, r->info1046)); + } + break; + + case 1047: + if (r->info1047) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1047(ndr, NDR_SCALARS, r->info1047)); + } + break; + + case 1048: + if (r->info1048) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1048(ndr, NDR_SCALARS, r->info1048)); + } + break; + + case 1049: + if (r->info1049) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1049(ndr, NDR_SCALARS, r->info1049)); + } + break; + + case 1050: + if (r->info1050) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1050(ndr, NDR_SCALARS, r->info1050)); + } + break; + + case 1051: + if (r->info1051) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1051(ndr, NDR_SCALARS, r->info1051)); + } + break; + + case 1052: + if (r->info1052) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1052(ndr, NDR_SCALARS, r->info1052)); + } + break; + + case 1053: + if (r->info1053) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1053(ndr, NDR_SCALARS, r->info1053)); + } + break; + + case 1054: + if (r->info1054) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1054(ndr, NDR_SCALARS, r->info1054)); + } + break; + + case 1055: + if (r->info1055) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1055(ndr, NDR_SCALARS, r->info1055)); + } + break; + + case 1056: + if (r->info1056) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1056(ndr, NDR_SCALARS, r->info1056)); + } + break; + + case 1057: + if (r->info1057) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1057(ndr, NDR_SCALARS, r->info1057)); + } + break; + + case 1058: + if (r->info1058) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1058(ndr, NDR_SCALARS, r->info1058)); + } + break; + + case 1059: + if (r->info1059) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1059(ndr, NDR_SCALARS, r->info1059)); + } + break; + + case 1060: + if (r->info1060) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1060(ndr, NDR_SCALARS, r->info1060)); + } + break; + + case 1061: + if (r->info1061) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1061(ndr, NDR_SCALARS, r->info1061)); + } + break; + + case 1062: + if (r->info1062) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1062(ndr, NDR_SCALARS, r->info1062)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetWkstaInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info100_0; + TALLOC_CTX *_mem_save_info101_0; + TALLOC_CTX *_mem_save_info102_0; + TALLOC_CTX *_mem_save_info502_0; + TALLOC_CTX *_mem_save_info1010_0; + TALLOC_CTX *_mem_save_info1011_0; + TALLOC_CTX *_mem_save_info1012_0; + TALLOC_CTX *_mem_save_info1013_0; + TALLOC_CTX *_mem_save_info1018_0; + TALLOC_CTX *_mem_save_info1023_0; + TALLOC_CTX *_mem_save_info1027_0; + TALLOC_CTX *_mem_save_info1028_0; + TALLOC_CTX *_mem_save_info1032_0; + TALLOC_CTX *_mem_save_info1033_0; + TALLOC_CTX *_mem_save_info1041_0; + TALLOC_CTX *_mem_save_info1042_0; + TALLOC_CTX *_mem_save_info1043_0; + TALLOC_CTX *_mem_save_info1044_0; + TALLOC_CTX *_mem_save_info1045_0; + TALLOC_CTX *_mem_save_info1046_0; + TALLOC_CTX *_mem_save_info1047_0; + TALLOC_CTX *_mem_save_info1048_0; + TALLOC_CTX *_mem_save_info1049_0; + TALLOC_CTX *_mem_save_info1050_0; + TALLOC_CTX *_mem_save_info1051_0; + TALLOC_CTX *_mem_save_info1052_0; + TALLOC_CTX *_mem_save_info1053_0; + TALLOC_CTX *_mem_save_info1054_0; + TALLOC_CTX *_mem_save_info1055_0; + TALLOC_CTX *_mem_save_info1056_0; + TALLOC_CTX *_mem_save_info1057_0; + TALLOC_CTX *_mem_save_info1058_0; + TALLOC_CTX *_mem_save_info1059_0; + TALLOC_CTX *_mem_save_info1060_0; + TALLOC_CTX *_mem_save_info1061_0; + TALLOC_CTX *_mem_save_info1062_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 100: { + uint32_t _ptr_info100; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info100)); + if (_ptr_info100) { + NDR_PULL_ALLOC(ndr, r->info100); + } else { + r->info100 = NULL; + } + break; } + + case 101: { + uint32_t _ptr_info101; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info101)); + if (_ptr_info101) { + NDR_PULL_ALLOC(ndr, r->info101); + } else { + r->info101 = NULL; + } + break; } + + case 102: { + uint32_t _ptr_info102; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info102)); + if (_ptr_info102) { + NDR_PULL_ALLOC(ndr, r->info102); + } else { + r->info102 = NULL; + } + break; } + + case 502: { + uint32_t _ptr_info502; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info502)); + if (_ptr_info502) { + NDR_PULL_ALLOC(ndr, r->info502); + } else { + r->info502 = NULL; + } + break; } + + case 1010: { + uint32_t _ptr_info1010; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1010)); + if (_ptr_info1010) { + NDR_PULL_ALLOC(ndr, r->info1010); + } else { + r->info1010 = NULL; + } + break; } + + case 1011: { + uint32_t _ptr_info1011; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1011)); + if (_ptr_info1011) { + NDR_PULL_ALLOC(ndr, r->info1011); + } else { + r->info1011 = NULL; + } + break; } + + case 1012: { + uint32_t _ptr_info1012; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1012)); + if (_ptr_info1012) { + NDR_PULL_ALLOC(ndr, r->info1012); + } else { + r->info1012 = NULL; + } + break; } + + case 1013: { + uint32_t _ptr_info1013; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1013)); + if (_ptr_info1013) { + NDR_PULL_ALLOC(ndr, r->info1013); + } else { + r->info1013 = NULL; + } + break; } + + case 1018: { + uint32_t _ptr_info1018; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1018)); + if (_ptr_info1018) { + NDR_PULL_ALLOC(ndr, r->info1018); + } else { + r->info1018 = NULL; + } + break; } + + case 1023: { + uint32_t _ptr_info1023; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1023)); + if (_ptr_info1023) { + NDR_PULL_ALLOC(ndr, r->info1023); + } else { + r->info1023 = NULL; + } + break; } + + case 1027: { + uint32_t _ptr_info1027; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1027)); + if (_ptr_info1027) { + NDR_PULL_ALLOC(ndr, r->info1027); + } else { + r->info1027 = NULL; + } + break; } + + case 1028: { + uint32_t _ptr_info1028; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1028)); + if (_ptr_info1028) { + NDR_PULL_ALLOC(ndr, r->info1028); + } else { + r->info1028 = NULL; + } + break; } + + case 1032: { + uint32_t _ptr_info1032; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1032)); + if (_ptr_info1032) { + NDR_PULL_ALLOC(ndr, r->info1032); + } else { + r->info1032 = NULL; + } + break; } + + case 1033: { + uint32_t _ptr_info1033; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1033)); + if (_ptr_info1033) { + NDR_PULL_ALLOC(ndr, r->info1033); + } else { + r->info1033 = NULL; + } + break; } + + case 1041: { + uint32_t _ptr_info1041; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1041)); + if (_ptr_info1041) { + NDR_PULL_ALLOC(ndr, r->info1041); + } else { + r->info1041 = NULL; + } + break; } + + case 1042: { + uint32_t _ptr_info1042; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1042)); + if (_ptr_info1042) { + NDR_PULL_ALLOC(ndr, r->info1042); + } else { + r->info1042 = NULL; + } + break; } + + case 1043: { + uint32_t _ptr_info1043; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1043)); + if (_ptr_info1043) { + NDR_PULL_ALLOC(ndr, r->info1043); + } else { + r->info1043 = NULL; + } + break; } + + case 1044: { + uint32_t _ptr_info1044; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1044)); + if (_ptr_info1044) { + NDR_PULL_ALLOC(ndr, r->info1044); + } else { + r->info1044 = NULL; + } + break; } + + case 1045: { + uint32_t _ptr_info1045; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1045)); + if (_ptr_info1045) { + NDR_PULL_ALLOC(ndr, r->info1045); + } else { + r->info1045 = NULL; + } + break; } + + case 1046: { + uint32_t _ptr_info1046; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1046)); + if (_ptr_info1046) { + NDR_PULL_ALLOC(ndr, r->info1046); + } else { + r->info1046 = NULL; + } + break; } + + case 1047: { + uint32_t _ptr_info1047; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1047)); + if (_ptr_info1047) { + NDR_PULL_ALLOC(ndr, r->info1047); + } else { + r->info1047 = NULL; + } + break; } + + case 1048: { + uint32_t _ptr_info1048; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1048)); + if (_ptr_info1048) { + NDR_PULL_ALLOC(ndr, r->info1048); + } else { + r->info1048 = NULL; + } + break; } + + case 1049: { + uint32_t _ptr_info1049; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1049)); + if (_ptr_info1049) { + NDR_PULL_ALLOC(ndr, r->info1049); + } else { + r->info1049 = NULL; + } + break; } + + case 1050: { + uint32_t _ptr_info1050; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1050)); + if (_ptr_info1050) { + NDR_PULL_ALLOC(ndr, r->info1050); + } else { + r->info1050 = NULL; + } + break; } + + case 1051: { + uint32_t _ptr_info1051; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1051)); + if (_ptr_info1051) { + NDR_PULL_ALLOC(ndr, r->info1051); + } else { + r->info1051 = NULL; + } + break; } + + case 1052: { + uint32_t _ptr_info1052; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1052)); + if (_ptr_info1052) { + NDR_PULL_ALLOC(ndr, r->info1052); + } else { + r->info1052 = NULL; + } + break; } + + case 1053: { + uint32_t _ptr_info1053; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1053)); + if (_ptr_info1053) { + NDR_PULL_ALLOC(ndr, r->info1053); + } else { + r->info1053 = NULL; + } + break; } + + case 1054: { + uint32_t _ptr_info1054; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1054)); + if (_ptr_info1054) { + NDR_PULL_ALLOC(ndr, r->info1054); + } else { + r->info1054 = NULL; + } + break; } + + case 1055: { + uint32_t _ptr_info1055; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1055)); + if (_ptr_info1055) { + NDR_PULL_ALLOC(ndr, r->info1055); + } else { + r->info1055 = NULL; + } + break; } + + case 1056: { + uint32_t _ptr_info1056; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1056)); + if (_ptr_info1056) { + NDR_PULL_ALLOC(ndr, r->info1056); + } else { + r->info1056 = NULL; + } + break; } + + case 1057: { + uint32_t _ptr_info1057; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1057)); + if (_ptr_info1057) { + NDR_PULL_ALLOC(ndr, r->info1057); + } else { + r->info1057 = NULL; + } + break; } + + case 1058: { + uint32_t _ptr_info1058; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1058)); + if (_ptr_info1058) { + NDR_PULL_ALLOC(ndr, r->info1058); + } else { + r->info1058 = NULL; + } + break; } + + case 1059: { + uint32_t _ptr_info1059; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1059)); + if (_ptr_info1059) { + NDR_PULL_ALLOC(ndr, r->info1059); + } else { + r->info1059 = NULL; + } + break; } + + case 1060: { + uint32_t _ptr_info1060; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1060)); + if (_ptr_info1060) { + NDR_PULL_ALLOC(ndr, r->info1060); + } else { + r->info1060 = NULL; + } + break; } + + case 1061: { + uint32_t _ptr_info1061; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1061)); + if (_ptr_info1061) { + NDR_PULL_ALLOC(ndr, r->info1061); + } else { + r->info1061 = NULL; + } + break; } + + case 1062: { + uint32_t _ptr_info1062; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1062)); + if (_ptr_info1062) { + NDR_PULL_ALLOC(ndr, r->info1062); + } else { + r->info1062 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 100: + if (r->info100) { + _mem_save_info100_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info100, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info100_0, 0); + } + break; + + case 101: + if (r->info101) { + _mem_save_info101_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info101, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info101)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info101_0, 0); + } + break; + + case 102: + if (r->info102) { + _mem_save_info102_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info102, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo102(ndr, NDR_SCALARS|NDR_BUFFERS, r->info102)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info102_0, 0); + } + break; + + case 502: + if (r->info502) { + _mem_save_info502_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info502, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo502(ndr, NDR_SCALARS, r->info502)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info502_0, 0); + } + break; + + case 1010: + if (r->info1010) { + _mem_save_info1010_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1010, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1010(ndr, NDR_SCALARS, r->info1010)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1010_0, 0); + } + break; + + case 1011: + if (r->info1011) { + _mem_save_info1011_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1011, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1011(ndr, NDR_SCALARS, r->info1011)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1011_0, 0); + } + break; + + case 1012: + if (r->info1012) { + _mem_save_info1012_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1012, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1012(ndr, NDR_SCALARS, r->info1012)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1012_0, 0); + } + break; + + case 1013: + if (r->info1013) { + _mem_save_info1013_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1013, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1013(ndr, NDR_SCALARS, r->info1013)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1013_0, 0); + } + break; + + case 1018: + if (r->info1018) { + _mem_save_info1018_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1018, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1018(ndr, NDR_SCALARS, r->info1018)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1018_0, 0); + } + break; + + case 1023: + if (r->info1023) { + _mem_save_info1023_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1023, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1023(ndr, NDR_SCALARS, r->info1023)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1023_0, 0); + } + break; + + case 1027: + if (r->info1027) { + _mem_save_info1027_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1027, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1027(ndr, NDR_SCALARS, r->info1027)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1027_0, 0); + } + break; + + case 1028: + if (r->info1028) { + _mem_save_info1028_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1028, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1028(ndr, NDR_SCALARS, r->info1028)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1028_0, 0); + } + break; + + case 1032: + if (r->info1032) { + _mem_save_info1032_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1032, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1032(ndr, NDR_SCALARS, r->info1032)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1032_0, 0); + } + break; + + case 1033: + if (r->info1033) { + _mem_save_info1033_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1033, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1033(ndr, NDR_SCALARS, r->info1033)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1033_0, 0); + } + break; + + case 1041: + if (r->info1041) { + _mem_save_info1041_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1041, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1041(ndr, NDR_SCALARS, r->info1041)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1041_0, 0); + } + break; + + case 1042: + if (r->info1042) { + _mem_save_info1042_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1042, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1042(ndr, NDR_SCALARS, r->info1042)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1042_0, 0); + } + break; + + case 1043: + if (r->info1043) { + _mem_save_info1043_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1043, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1043(ndr, NDR_SCALARS, r->info1043)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1043_0, 0); + } + break; + + case 1044: + if (r->info1044) { + _mem_save_info1044_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1044, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1044(ndr, NDR_SCALARS, r->info1044)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1044_0, 0); + } + break; + + case 1045: + if (r->info1045) { + _mem_save_info1045_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1045, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1045(ndr, NDR_SCALARS, r->info1045)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1045_0, 0); + } + break; + + case 1046: + if (r->info1046) { + _mem_save_info1046_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1046, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1046(ndr, NDR_SCALARS, r->info1046)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1046_0, 0); + } + break; + + case 1047: + if (r->info1047) { + _mem_save_info1047_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1047, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1047(ndr, NDR_SCALARS, r->info1047)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1047_0, 0); + } + break; + + case 1048: + if (r->info1048) { + _mem_save_info1048_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1048, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1048(ndr, NDR_SCALARS, r->info1048)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1048_0, 0); + } + break; + + case 1049: + if (r->info1049) { + _mem_save_info1049_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1049, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1049(ndr, NDR_SCALARS, r->info1049)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1049_0, 0); + } + break; + + case 1050: + if (r->info1050) { + _mem_save_info1050_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1050, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1050(ndr, NDR_SCALARS, r->info1050)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1050_0, 0); + } + break; + + case 1051: + if (r->info1051) { + _mem_save_info1051_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1051, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1051(ndr, NDR_SCALARS, r->info1051)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1051_0, 0); + } + break; + + case 1052: + if (r->info1052) { + _mem_save_info1052_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1052, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1052(ndr, NDR_SCALARS, r->info1052)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1052_0, 0); + } + break; + + case 1053: + if (r->info1053) { + _mem_save_info1053_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1053, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1053(ndr, NDR_SCALARS, r->info1053)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1053_0, 0); + } + break; + + case 1054: + if (r->info1054) { + _mem_save_info1054_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1054, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1054(ndr, NDR_SCALARS, r->info1054)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1054_0, 0); + } + break; + + case 1055: + if (r->info1055) { + _mem_save_info1055_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1055, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1055(ndr, NDR_SCALARS, r->info1055)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1055_0, 0); + } + break; + + case 1056: + if (r->info1056) { + _mem_save_info1056_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1056, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1056(ndr, NDR_SCALARS, r->info1056)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1056_0, 0); + } + break; + + case 1057: + if (r->info1057) { + _mem_save_info1057_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1057, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1057(ndr, NDR_SCALARS, r->info1057)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1057_0, 0); + } + break; + + case 1058: + if (r->info1058) { + _mem_save_info1058_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1058, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1058(ndr, NDR_SCALARS, r->info1058)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1058_0, 0); + } + break; + + case 1059: + if (r->info1059) { + _mem_save_info1059_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1059, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1059(ndr, NDR_SCALARS, r->info1059)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1059_0, 0); + } + break; + + case 1060: + if (r->info1060) { + _mem_save_info1060_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1060, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1060(ndr, NDR_SCALARS, r->info1060)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1060_0, 0); + } + break; + + case 1061: + if (r->info1061) { + _mem_save_info1061_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1061, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1061(ndr, NDR_SCALARS, r->info1061)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1061_0, 0); + } + break; + + case 1062: + if (r->info1062) { + _mem_save_info1062_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1062, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1062(ndr, NDR_SCALARS, r->info1062)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1062_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "wkssvc_NetWkstaInfo"); + switch (level) { + case 100: + ndr_print_ptr(ndr, "info100", r->info100); + ndr->depth++; + if (r->info100) { + ndr_print_wkssvc_NetWkstaInfo100(ndr, "info100", r->info100); + } + ndr->depth--; + break; + + case 101: + ndr_print_ptr(ndr, "info101", r->info101); + ndr->depth++; + if (r->info101) { + ndr_print_wkssvc_NetWkstaInfo101(ndr, "info101", r->info101); + } + ndr->depth--; + break; + + case 102: + ndr_print_ptr(ndr, "info102", r->info102); + ndr->depth++; + if (r->info102) { + ndr_print_wkssvc_NetWkstaInfo102(ndr, "info102", r->info102); + } + ndr->depth--; + break; + + case 502: + ndr_print_ptr(ndr, "info502", r->info502); + ndr->depth++; + if (r->info502) { + ndr_print_wkssvc_NetWkstaInfo502(ndr, "info502", r->info502); + } + ndr->depth--; + break; + + case 1010: + ndr_print_ptr(ndr, "info1010", r->info1010); + ndr->depth++; + if (r->info1010) { + ndr_print_wkssvc_NetWkstaInfo1010(ndr, "info1010", r->info1010); + } + ndr->depth--; + break; + + case 1011: + ndr_print_ptr(ndr, "info1011", r->info1011); + ndr->depth++; + if (r->info1011) { + ndr_print_wkssvc_NetWkstaInfo1011(ndr, "info1011", r->info1011); + } + ndr->depth--; + break; + + case 1012: + ndr_print_ptr(ndr, "info1012", r->info1012); + ndr->depth++; + if (r->info1012) { + ndr_print_wkssvc_NetWkstaInfo1012(ndr, "info1012", r->info1012); + } + ndr->depth--; + break; + + case 1013: + ndr_print_ptr(ndr, "info1013", r->info1013); + ndr->depth++; + if (r->info1013) { + ndr_print_wkssvc_NetWkstaInfo1013(ndr, "info1013", r->info1013); + } + ndr->depth--; + break; + + case 1018: + ndr_print_ptr(ndr, "info1018", r->info1018); + ndr->depth++; + if (r->info1018) { + ndr_print_wkssvc_NetWkstaInfo1018(ndr, "info1018", r->info1018); + } + ndr->depth--; + break; + + case 1023: + ndr_print_ptr(ndr, "info1023", r->info1023); + ndr->depth++; + if (r->info1023) { + ndr_print_wkssvc_NetWkstaInfo1023(ndr, "info1023", r->info1023); + } + ndr->depth--; + break; + + case 1027: + ndr_print_ptr(ndr, "info1027", r->info1027); + ndr->depth++; + if (r->info1027) { + ndr_print_wkssvc_NetWkstaInfo1027(ndr, "info1027", r->info1027); + } + ndr->depth--; + break; + + case 1028: + ndr_print_ptr(ndr, "info1028", r->info1028); + ndr->depth++; + if (r->info1028) { + ndr_print_wkssvc_NetWkstaInfo1028(ndr, "info1028", r->info1028); + } + ndr->depth--; + break; + + case 1032: + ndr_print_ptr(ndr, "info1032", r->info1032); + ndr->depth++; + if (r->info1032) { + ndr_print_wkssvc_NetWkstaInfo1032(ndr, "info1032", r->info1032); + } + ndr->depth--; + break; + + case 1033: + ndr_print_ptr(ndr, "info1033", r->info1033); + ndr->depth++; + if (r->info1033) { + ndr_print_wkssvc_NetWkstaInfo1033(ndr, "info1033", r->info1033); + } + ndr->depth--; + break; + + case 1041: + ndr_print_ptr(ndr, "info1041", r->info1041); + ndr->depth++; + if (r->info1041) { + ndr_print_wkssvc_NetWkstaInfo1041(ndr, "info1041", r->info1041); + } + ndr->depth--; + break; + + case 1042: + ndr_print_ptr(ndr, "info1042", r->info1042); + ndr->depth++; + if (r->info1042) { + ndr_print_wkssvc_NetWkstaInfo1042(ndr, "info1042", r->info1042); + } + ndr->depth--; + break; + + case 1043: + ndr_print_ptr(ndr, "info1043", r->info1043); + ndr->depth++; + if (r->info1043) { + ndr_print_wkssvc_NetWkstaInfo1043(ndr, "info1043", r->info1043); + } + ndr->depth--; + break; + + case 1044: + ndr_print_ptr(ndr, "info1044", r->info1044); + ndr->depth++; + if (r->info1044) { + ndr_print_wkssvc_NetWkstaInfo1044(ndr, "info1044", r->info1044); + } + ndr->depth--; + break; + + case 1045: + ndr_print_ptr(ndr, "info1045", r->info1045); + ndr->depth++; + if (r->info1045) { + ndr_print_wkssvc_NetWkstaInfo1045(ndr, "info1045", r->info1045); + } + ndr->depth--; + break; + + case 1046: + ndr_print_ptr(ndr, "info1046", r->info1046); + ndr->depth++; + if (r->info1046) { + ndr_print_wkssvc_NetWkstaInfo1046(ndr, "info1046", r->info1046); + } + ndr->depth--; + break; + + case 1047: + ndr_print_ptr(ndr, "info1047", r->info1047); + ndr->depth++; + if (r->info1047) { + ndr_print_wkssvc_NetWkstaInfo1047(ndr, "info1047", r->info1047); + } + ndr->depth--; + break; + + case 1048: + ndr_print_ptr(ndr, "info1048", r->info1048); + ndr->depth++; + if (r->info1048) { + ndr_print_wkssvc_NetWkstaInfo1048(ndr, "info1048", r->info1048); + } + ndr->depth--; + break; + + case 1049: + ndr_print_ptr(ndr, "info1049", r->info1049); + ndr->depth++; + if (r->info1049) { + ndr_print_wkssvc_NetWkstaInfo1049(ndr, "info1049", r->info1049); + } + ndr->depth--; + break; + + case 1050: + ndr_print_ptr(ndr, "info1050", r->info1050); + ndr->depth++; + if (r->info1050) { + ndr_print_wkssvc_NetWkstaInfo1050(ndr, "info1050", r->info1050); + } + ndr->depth--; + break; + + case 1051: + ndr_print_ptr(ndr, "info1051", r->info1051); + ndr->depth++; + if (r->info1051) { + ndr_print_wkssvc_NetWkstaInfo1051(ndr, "info1051", r->info1051); + } + ndr->depth--; + break; + + case 1052: + ndr_print_ptr(ndr, "info1052", r->info1052); + ndr->depth++; + if (r->info1052) { + ndr_print_wkssvc_NetWkstaInfo1052(ndr, "info1052", r->info1052); + } + ndr->depth--; + break; + + case 1053: + ndr_print_ptr(ndr, "info1053", r->info1053); + ndr->depth++; + if (r->info1053) { + ndr_print_wkssvc_NetWkstaInfo1053(ndr, "info1053", r->info1053); + } + ndr->depth--; + break; + + case 1054: + ndr_print_ptr(ndr, "info1054", r->info1054); + ndr->depth++; + if (r->info1054) { + ndr_print_wkssvc_NetWkstaInfo1054(ndr, "info1054", r->info1054); + } + ndr->depth--; + break; + + case 1055: + ndr_print_ptr(ndr, "info1055", r->info1055); + ndr->depth++; + if (r->info1055) { + ndr_print_wkssvc_NetWkstaInfo1055(ndr, "info1055", r->info1055); + } + ndr->depth--; + break; + + case 1056: + ndr_print_ptr(ndr, "info1056", r->info1056); + ndr->depth++; + if (r->info1056) { + ndr_print_wkssvc_NetWkstaInfo1056(ndr, "info1056", r->info1056); + } + ndr->depth--; + break; + + case 1057: + ndr_print_ptr(ndr, "info1057", r->info1057); + ndr->depth++; + if (r->info1057) { + ndr_print_wkssvc_NetWkstaInfo1057(ndr, "info1057", r->info1057); + } + ndr->depth--; + break; + + case 1058: + ndr_print_ptr(ndr, "info1058", r->info1058); + ndr->depth++; + if (r->info1058) { + ndr_print_wkssvc_NetWkstaInfo1058(ndr, "info1058", r->info1058); + } + ndr->depth--; + break; + + case 1059: + ndr_print_ptr(ndr, "info1059", r->info1059); + ndr->depth++; + if (r->info1059) { + ndr_print_wkssvc_NetWkstaInfo1059(ndr, "info1059", r->info1059); + } + ndr->depth--; + break; + + case 1060: + ndr_print_ptr(ndr, "info1060", r->info1060); + ndr->depth++; + if (r->info1060) { + ndr_print_wkssvc_NetWkstaInfo1060(ndr, "info1060", r->info1060); + } + ndr->depth--; + break; + + case 1061: + ndr_print_ptr(ndr, "info1061", r->info1061); + ndr->depth++; + if (r->info1061) { + ndr_print_wkssvc_NetWkstaInfo1061(ndr, "info1061", r->info1061); + } + ndr->depth--; + break; + + case 1062: + ndr_print_ptr(ndr, "info1062", r->info1062); + ndr->depth++; + if (r->info1062) { + ndr_print_wkssvc_NetWkstaInfo1062(ndr, "info1062", r->info1062); + } + ndr->depth--; + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserInfo0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrWkstaUserInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserInfo0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrWkstaUserInfo0 *r) +{ + uint32_t _ptr_user_name; + TALLOC_CTX *_mem_save_user_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); + if (_ptr_user_name) { + NDR_PULL_ALLOC(ndr, r->user_name); + } else { + r->user_name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user_name) { + _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name)); + if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo0 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserInfo0"); + ndr->depth++; + ndr_print_ptr(ndr, "user_name", r->user_name); + ndr->depth++; + if (r->user_name) { + ndr_print_string(ndr, "user_name", r->user_name); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsersCtr0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaEnumUsersCtr0 *r) +{ + uint32_t cntr_user0_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries_read)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user0)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user0) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries_read)); + for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo0(ndr, NDR_SCALARS, &r->user0[cntr_user0_1])); + } + for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo0(ndr, NDR_BUFFERS, &r->user0[cntr_user0_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsersCtr0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaEnumUsersCtr0 *r) +{ + uint32_t _ptr_user0; + uint32_t cntr_user0_1; + TALLOC_CTX *_mem_save_user0_0; + TALLOC_CTX *_mem_save_user0_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entries_read)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user0)); + if (_ptr_user0) { + NDR_PULL_ALLOC(ndr, r->user0); + } else { + r->user0 = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user0) { + _mem_save_user0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user0)); + NDR_PULL_ALLOC_N(ndr, r->user0, ndr_get_array_size(ndr, &r->user0)); + _mem_save_user0_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0); + for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo0(ndr, NDR_SCALARS, &r->user0[cntr_user0_1])); + } + for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo0(ndr, NDR_BUFFERS, &r->user0[cntr_user0_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_0, 0); + } + if (r->user0) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->user0, r->entries_read)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersCtr0 *r) +{ + uint32_t cntr_user0_1; + ndr_print_struct(ndr, name, "wkssvc_NetWkstaEnumUsersCtr0"); + ndr->depth++; + ndr_print_uint32(ndr, "entries_read", r->entries_read); + ndr_print_ptr(ndr, "user0", r->user0); + ndr->depth++; + if (r->user0) { + ndr->print(ndr, "%s: ARRAY(%d)", "user0", (int)r->entries_read); + ndr->depth++; + for (cntr_user0_1=0;cntr_user0_1entries_read;cntr_user0_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_user0_1) != -1) { + ndr_print_wkssvc_NetrWkstaUserInfo0(ndr, "user0", &r->user0[cntr_user0_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserInfo1(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrWkstaUserInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->logon_domain)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->other_domains)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->logon_server)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->logon_domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->logon_domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->logon_domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->logon_domain, ndr_charset_length(r->logon_domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->other_domains) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->other_domains, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->other_domains, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->other_domains, ndr_charset_length(r->other_domains, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->logon_server) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->logon_server, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->logon_server, ndr_charset_length(r->logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserInfo1(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrWkstaUserInfo1 *r) +{ + uint32_t _ptr_user_name; + TALLOC_CTX *_mem_save_user_name_0; + uint32_t _ptr_logon_domain; + TALLOC_CTX *_mem_save_logon_domain_0; + uint32_t _ptr_other_domains; + TALLOC_CTX *_mem_save_other_domains_0; + uint32_t _ptr_logon_server; + TALLOC_CTX *_mem_save_logon_server_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); + if (_ptr_user_name) { + NDR_PULL_ALLOC(ndr, r->user_name); + } else { + r->user_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_domain)); + if (_ptr_logon_domain) { + NDR_PULL_ALLOC(ndr, r->logon_domain); + } else { + r->logon_domain = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_domains)); + if (_ptr_other_domains) { + NDR_PULL_ALLOC(ndr, r->other_domains); + } else { + r->other_domains = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); + if (_ptr_logon_server) { + NDR_PULL_ALLOC(ndr, r->logon_server); + } else { + r->logon_server = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user_name) { + _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name)); + if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); + } + if (r->logon_domain) { + _mem_save_logon_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->logon_domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->logon_domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->logon_domain)); + if (ndr_get_array_length(ndr, &r->logon_domain) > ndr_get_array_size(ndr, &r->logon_domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->logon_domain), ndr_get_array_length(ndr, &r->logon_domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->logon_domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->logon_domain, ndr_get_array_length(ndr, &r->logon_domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_domain_0, 0); + } + if (r->other_domains) { + _mem_save_other_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->other_domains, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->other_domains)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->other_domains)); + if (ndr_get_array_length(ndr, &r->other_domains) > ndr_get_array_size(ndr, &r->other_domains)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->other_domains), ndr_get_array_length(ndr, &r->other_domains)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->other_domains), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->other_domains, ndr_get_array_length(ndr, &r->other_domains), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_domains_0, 0); + } + if (r->logon_server) { + _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->logon_server, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->logon_server)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->logon_server)); + if (ndr_get_array_length(ndr, &r->logon_server) > ndr_get_array_size(ndr, &r->logon_server)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->logon_server), ndr_get_array_length(ndr, &r->logon_server)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->logon_server), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->logon_server, ndr_get_array_length(ndr, &r->logon_server), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserInfo1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo1 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserInfo1"); + ndr->depth++; + ndr_print_ptr(ndr, "user_name", r->user_name); + ndr->depth++; + if (r->user_name) { + ndr_print_string(ndr, "user_name", r->user_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "logon_domain", r->logon_domain); + ndr->depth++; + if (r->logon_domain) { + ndr_print_string(ndr, "logon_domain", r->logon_domain); + } + ndr->depth--; + ndr_print_ptr(ndr, "other_domains", r->other_domains); + ndr->depth++; + if (r->other_domains) { + ndr_print_string(ndr, "other_domains", r->other_domains); + } + ndr->depth--; + ndr_print_ptr(ndr, "logon_server", r->logon_server); + ndr->depth++; + if (r->logon_server) { + ndr_print_string(ndr, "logon_server", r->logon_server); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsersCtr1(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaEnumUsersCtr1 *r) +{ + uint32_t cntr_user1_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries_read)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user1)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user1) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries_read)); + for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo1(ndr, NDR_SCALARS, &r->user1[cntr_user1_1])); + } + for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo1(ndr, NDR_BUFFERS, &r->user1[cntr_user1_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsersCtr1(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaEnumUsersCtr1 *r) +{ + uint32_t _ptr_user1; + uint32_t cntr_user1_1; + TALLOC_CTX *_mem_save_user1_0; + TALLOC_CTX *_mem_save_user1_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entries_read)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user1)); + if (_ptr_user1) { + NDR_PULL_ALLOC(ndr, r->user1); + } else { + r->user1 = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user1) { + _mem_save_user1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user1)); + NDR_PULL_ALLOC_N(ndr, r->user1, ndr_get_array_size(ndr, &r->user1)); + _mem_save_user1_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0); + for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo1(ndr, NDR_SCALARS, &r->user1[cntr_user1_1])); + } + for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo1(ndr, NDR_BUFFERS, &r->user1[cntr_user1_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_0, 0); + } + if (r->user1) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->user1, r->entries_read)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersCtr1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersCtr1 *r) +{ + uint32_t cntr_user1_1; + ndr_print_struct(ndr, name, "wkssvc_NetWkstaEnumUsersCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "entries_read", r->entries_read); + ndr_print_ptr(ndr, "user1", r->user1); + ndr->depth++; + if (r->user1) { + ndr->print(ndr, "%s: ARRAY(%d)", "user1", (int)r->entries_read); + ndr->depth++; + for (cntr_user1_1=0;cntr_user1_1entries_read;cntr_user1_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_user1_1) != -1) { + ndr_print_wkssvc_NetrWkstaUserInfo1(ndr, "user1", &r->user1[cntr_user1_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsersCtr(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetWkstaEnumUsersCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user1)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->user0) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->user0)); + } + break; + + case 1: + if (r->user1) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->user1)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsersCtr(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetWkstaEnumUsersCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_user0_0; + TALLOC_CTX *_mem_save_user1_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_user0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user0)); + if (_ptr_user0) { + NDR_PULL_ALLOC(ndr, r->user0); + } else { + r->user0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_user1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user1)); + if (_ptr_user1) { + NDR_PULL_ALLOC(ndr, r->user1); + } else { + r->user1 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->user0) { + _mem_save_user0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->user0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_0, 0); + } + break; + + case 1: + if (r->user1) { + _mem_save_user1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->user1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaEnumUsersCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "wkssvc_NetWkstaEnumUsersCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "user0", r->user0); + ndr->depth++; + if (r->user0) { + ndr_print_wkssvc_NetWkstaEnumUsersCtr0(ndr, "user0", r->user0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "user1", r->user1); + ndr->depth++; + if (r->user1) { + ndr_print_wkssvc_NetWkstaEnumUsersCtr1(ndr, "user1", r->user1); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsersInfo(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaEnumUsersInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsersInfo(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaEnumUsersInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersInfo *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaEnumUsersInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_wkssvc_NetWkstaEnumUsersCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserInfo1101(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrWkstaUserInfo1101 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->other_domains)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->other_domains) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->other_domains, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->other_domains, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->other_domains, ndr_charset_length(r->other_domains, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserInfo1101(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrWkstaUserInfo1101 *r) +{ + uint32_t _ptr_other_domains; + TALLOC_CTX *_mem_save_other_domains_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_domains)); + if (_ptr_other_domains) { + NDR_PULL_ALLOC(ndr, r->other_domains); + } else { + r->other_domains = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->other_domains) { + _mem_save_other_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->other_domains, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->other_domains)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->other_domains)); + if (ndr_get_array_length(ndr, &r->other_domains) > ndr_get_array_size(ndr, &r->other_domains)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->other_domains), ndr_get_array_length(ndr, &r->other_domains)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->other_domains), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->other_domains, ndr_get_array_length(ndr, &r->other_domains), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_domains_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserInfo1101(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo1101 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserInfo1101"); + ndr->depth++; + ndr_print_ptr(ndr, "other_domains", r->other_domains); + ndr->depth++; + if (r->other_domains) { + ndr_print_string(ndr, "other_domains", r->other_domains); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserInfo(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetrWkstaUserInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + case 1101: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1101)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->info0) { + NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + } + break; + + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + case 1101: + if (r->info1101) { + NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo1101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1101)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserInfo(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetrWkstaUserInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info0_0; + TALLOC_CTX *_mem_save_info1_0; + TALLOC_CTX *_mem_save_info1101_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_info0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); + if (_ptr_info0) { + NDR_PULL_ALLOC(ndr, r->info0); + } else { + r->info0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + case 1101: { + uint32_t _ptr_info1101; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1101)); + if (_ptr_info1101) { + NDR_PULL_ALLOC(ndr, r->info1101); + } else { + r->info1101 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->info0) { + _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); + } + break; + + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + case 1101: + if (r->info1101) { + _mem_save_info1101_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1101, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo1101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1101)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1101_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserInfo(struct ndr_print *ndr, const char *name, const union wkssvc_NetrWkstaUserInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "wkssvc_NetrWkstaUserInfo"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "info0", r->info0); + ndr->depth++; + if (r->info0) { + ndr_print_wkssvc_NetrWkstaUserInfo0(ndr, "info0", r->info0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_wkssvc_NetrWkstaUserInfo1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + case 1101: + ndr_print_ptr(ndr, "info1101", r->info1101); + ndr->depth++; + if (r->info1101) { + ndr_print_wkssvc_NetrWkstaUserInfo1101(ndr, "info1101", r->info1101); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportInfo0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaTransportInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->quality_of_service)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vc_count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->address)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->wan_link)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->address) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->address, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->address, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->address, ndr_charset_length(r->address, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportInfo0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaTransportInfo0 *r) +{ + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_name_0; + uint32_t _ptr_address; + TALLOC_CTX *_mem_save_address_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->quality_of_service)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vc_count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->name); + } else { + r->name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_address)); + if (_ptr_address) { + NDR_PULL_ALLOC(ndr, r->address); + } else { + r->address = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->wan_link)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); + if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + if (r->address) { + _mem_save_address_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->address, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->address)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->address)); + if (ndr_get_array_length(ndr, &r->address) > ndr_get_array_size(ndr, &r->address)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->address), ndr_get_array_length(ndr, &r->address)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->address), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->address, ndr_get_array_length(ndr, &r->address), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_address_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportInfo0 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaTransportInfo0"); + ndr->depth++; + ndr_print_uint32(ndr, "quality_of_service", r->quality_of_service); + ndr_print_uint32(ndr, "vc_count", r->vc_count); + ndr_print_ptr(ndr, "name", r->name); + ndr->depth++; + if (r->name) { + ndr_print_string(ndr, "name", r->name); + } + ndr->depth--; + ndr_print_ptr(ndr, "address", r->address); + ndr->depth++; + if (r->address) { + ndr_print_string(ndr, "address", r->address); + } + ndr->depth--; + ndr_print_uint32(ndr, "wan_link", r->wan_link); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportCtr0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaTransportCtr0 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportCtr0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaTransportCtr0 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportCtr0 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "wkssvc_NetWkstaTransportCtr0"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_wkssvc_NetWkstaTransportInfo0(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportCtr(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetWkstaTransportCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->ctr0) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportCtr(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetWkstaTransportCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_ctr0_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_ctr0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); + if (_ptr_ctr0) { + NDR_PULL_ALLOC(ndr, r->ctr0); + } else { + r->ctr0 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->ctr0) { + _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaTransportCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "wkssvc_NetWkstaTransportCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "ctr0", r->ctr0); + ndr->depth++; + if (r->ctr0) { + ndr_print_wkssvc_NetWkstaTransportCtr0(ndr, "ctr0", r->ctr0); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportInfo(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaTransportInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportInfo(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaTransportInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportInfo *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaTransportInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_wkssvc_NetWkstaTransportCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseInfo3(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown1)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->unknown1) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown1, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown1, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown1, ndr_charset_length(r->unknown1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->unknown2) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown2, ndr_charset_length(r->unknown2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseInfo3(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseInfo3 *r) +{ + uint32_t _ptr_unknown1; + TALLOC_CTX *_mem_save_unknown1_0; + uint32_t _ptr_unknown2; + TALLOC_CTX *_mem_save_unknown2_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown1)); + if (_ptr_unknown1) { + NDR_PULL_ALLOC(ndr, r->unknown1); + } else { + r->unknown1 = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); + if (_ptr_unknown2) { + NDR_PULL_ALLOC(ndr, r->unknown2); + } else { + r->unknown2 = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->unknown1) { + _mem_save_unknown1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->unknown1, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown1)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown1)); + if (ndr_get_array_length(ndr, &r->unknown1) > ndr_get_array_size(ndr, &r->unknown1)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown1), ndr_get_array_length(ndr, &r->unknown1)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown1), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown1, ndr_get_array_length(ndr, &r->unknown1), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown1_0, 0); + } + if (r->unknown2) { + _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->unknown2, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown2)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown2)); + if (ndr_get_array_length(ndr, &r->unknown2) > ndr_get_array_size(ndr, &r->unknown2)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown2), ndr_get_array_length(ndr, &r->unknown2)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown2, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseInfo3(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo3 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUseInfo3"); + ndr->depth++; + ndr_print_ptr(ndr, "unknown1", r->unknown1); + ndr->depth++; + if (r->unknown1) { + ndr_print_string(ndr, "unknown1", r->unknown1); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown2", r->unknown2); + ndr->depth++; + if (r->unknown2) { + ndr_print_string(ndr, "unknown2", r->unknown2); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseInfo2(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->local)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->asg_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ref_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->local) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->local, ndr_charset_length(r->local, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->remote) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote, ndr_charset_length(r->remote, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->password, ndr_charset_length(r->password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseInfo2(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseInfo2 *r) +{ + uint32_t _ptr_local; + TALLOC_CTX *_mem_save_local_0; + uint32_t _ptr_remote; + TALLOC_CTX *_mem_save_remote_0; + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_password_0; + uint32_t _ptr_user_name; + TALLOC_CTX *_mem_save_user_name_0; + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_domain_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local)); + if (_ptr_local) { + NDR_PULL_ALLOC(ndr, r->local); + } else { + r->local = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote)); + if (_ptr_remote) { + NDR_PULL_ALLOC(ndr, r->remote); + } else { + r->remote = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->password); + } else { + r->password = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->asg_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ref_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); + if (_ptr_user_name) { + NDR_PULL_ALLOC(ndr, r->user_name); + } else { + r->user_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->domain_name); + } else { + r->domain_name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->local) { + _mem_save_local_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->local, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->local)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->local)); + if (ndr_get_array_length(ndr, &r->local) > ndr_get_array_size(ndr, &r->local)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->local), ndr_get_array_length(ndr, &r->local)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_0, 0); + } + if (r->remote) { + _mem_save_remote_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->remote, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->remote)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->remote)); + if (ndr_get_array_length(ndr, &r->remote) > ndr_get_array_size(ndr, &r->remote)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote), ndr_get_array_length(ndr, &r->remote)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_0, 0); + } + if (r->password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->password)); + if (ndr_get_array_length(ndr, &r->password) > ndr_get_array_size(ndr, &r->password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->password), ndr_get_array_length(ndr, &r->password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->password, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + if (r->user_name) { + _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name)); + if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); + } + if (r->domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); + if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseInfo2(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo2 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUseInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "local", r->local); + ndr->depth++; + if (r->local) { + ndr_print_string(ndr, "local", r->local); + } + ndr->depth--; + ndr_print_ptr(ndr, "remote", r->remote); + ndr->depth++; + if (r->remote) { + ndr_print_string(ndr, "remote", r->remote); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->password); + ndr->depth++; + if (r->password) { + ndr_print_string(ndr, "password", r->password); + } + ndr->depth--; + ndr_print_uint32(ndr, "status", r->status); + ndr_print_uint32(ndr, "asg_type", r->asg_type); + ndr_print_uint32(ndr, "ref_count", r->ref_count); + ndr_print_uint32(ndr, "use_count", r->use_count); + ndr_print_ptr(ndr, "user_name", r->user_name); + ndr->depth++; + if (r->user_name) { + ndr_print_string(ndr, "user_name", r->user_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->domain_name); + ndr->depth++; + if (r->domain_name) { + ndr_print_string(ndr, "domain_name", r->domain_name); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseInfo1(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->local)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->asg_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ref_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_count)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->local) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->local, ndr_charset_length(r->local, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->remote) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote, ndr_charset_length(r->remote, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->password, ndr_charset_length(r->password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseInfo1(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseInfo1 *r) +{ + uint32_t _ptr_local; + TALLOC_CTX *_mem_save_local_0; + uint32_t _ptr_remote; + TALLOC_CTX *_mem_save_remote_0; + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_password_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local)); + if (_ptr_local) { + NDR_PULL_ALLOC(ndr, r->local); + } else { + r->local = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote)); + if (_ptr_remote) { + NDR_PULL_ALLOC(ndr, r->remote); + } else { + r->remote = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->password); + } else { + r->password = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->asg_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ref_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_count)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->local) { + _mem_save_local_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->local, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->local)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->local)); + if (ndr_get_array_length(ndr, &r->local) > ndr_get_array_size(ndr, &r->local)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->local), ndr_get_array_length(ndr, &r->local)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_0, 0); + } + if (r->remote) { + _mem_save_remote_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->remote, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->remote)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->remote)); + if (ndr_get_array_length(ndr, &r->remote) > ndr_get_array_size(ndr, &r->remote)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote), ndr_get_array_length(ndr, &r->remote)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_0, 0); + } + if (r->password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->password)); + if (ndr_get_array_length(ndr, &r->password) > ndr_get_array_size(ndr, &r->password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->password), ndr_get_array_length(ndr, &r->password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->password, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseInfo1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo1 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUseInfo1"); + ndr->depth++; + ndr_print_ptr(ndr, "local", r->local); + ndr->depth++; + if (r->local) { + ndr_print_string(ndr, "local", r->local); + } + ndr->depth--; + ndr_print_ptr(ndr, "remote", r->remote); + ndr->depth++; + if (r->remote) { + ndr_print_string(ndr, "remote", r->remote); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->password); + ndr->depth++; + if (r->password) { + ndr_print_string(ndr, "password", r->password); + } + ndr->depth--; + ndr_print_uint32(ndr, "status", r->status); + ndr_print_uint32(ndr, "asg_type", r->asg_type); + ndr_print_uint32(ndr, "ref_count", r->ref_count); + ndr_print_uint32(ndr, "use_count", r->use_count); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseInfo0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseInfo0 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->local)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->local) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->local, ndr_charset_length(r->local, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->remote) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote, ndr_charset_length(r->remote, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseInfo0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseInfo0 *r) +{ + uint32_t _ptr_local; + TALLOC_CTX *_mem_save_local_0; + uint32_t _ptr_remote; + TALLOC_CTX *_mem_save_remote_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local)); + if (_ptr_local) { + NDR_PULL_ALLOC(ndr, r->local); + } else { + r->local = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote)); + if (_ptr_remote) { + NDR_PULL_ALLOC(ndr, r->remote); + } else { + r->remote = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->local) { + _mem_save_local_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->local, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->local)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->local)); + if (ndr_get_array_length(ndr, &r->local) > ndr_get_array_size(ndr, &r->local)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->local), ndr_get_array_length(ndr, &r->local)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_0, 0); + } + if (r->remote) { + _mem_save_remote_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->remote, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->remote)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->remote)); + if (ndr_get_array_length(ndr, &r->remote) > ndr_get_array_size(ndr, &r->remote)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote), ndr_get_array_length(ndr, &r->remote)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo0 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUseInfo0"); + ndr->depth++; + ndr_print_ptr(ndr, "local", r->local); + ndr->depth++; + if (r->local) { + ndr_print_string(ndr, "local", r->local); + } + ndr->depth--; + ndr_print_ptr(ndr, "remote", r->remote); + ndr->depth++; + if (r->remote) { + ndr_print_string(ndr, "remote", r->remote); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseGetInfoCtr(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetrUseGetInfoCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->info0) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + } + break; + + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + case 2: + if (r->info2) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + } + break; + + case 3: + if (r->info3) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseGetInfoCtr(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetrUseGetInfoCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info0_0; + TALLOC_CTX *_mem_save_info1_0; + TALLOC_CTX *_mem_save_info2_0; + TALLOC_CTX *_mem_save_info3_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_info0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); + if (_ptr_info0) { + NDR_PULL_ALLOC(ndr, r->info0); + } else { + r->info0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_info2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_PULL_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + + case 3: { + uint32_t _ptr_info3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); + if (_ptr_info3) { + NDR_PULL_ALLOC(ndr, r->info3); + } else { + r->info3 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->info0) { + _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); + } + break; + + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + case 2: + if (r->info2) { + _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); + } + break; + + case 3: + if (r->info3) { + _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseGetInfoCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetrUseGetInfoCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "wkssvc_NetrUseGetInfoCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "info0", r->info0); + ndr->depth++; + if (r->info0) { + ndr_print_wkssvc_NetrUseInfo0(ndr, "info0", r->info0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_wkssvc_NetrUseInfo1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_wkssvc_NetrUseInfo2(ndr, "info2", r->info2); + } + ndr->depth--; + break; + + case 3: + ndr_print_ptr(ndr, "info3", r->info3); + ndr->depth++; + if (r->info3) { + ndr_print_wkssvc_NetrUseInfo3(ndr, "info3", r->info3); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumCtr2(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseEnumCtr2 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumCtr2(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseEnumCtr2 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr2(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr2 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "wkssvc_NetrUseEnumCtr2"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_wkssvc_NetrUseInfo2(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumCtr1(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseEnumCtr1 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumCtr1(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseEnumCtr1 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr1 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "wkssvc_NetrUseEnumCtr1"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_wkssvc_NetrUseInfo1(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumCtr0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseEnumCtr0 *r) +{ + uint32_t cntr_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_wkssvc_NetrUseInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumCtr0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseEnumCtr0 *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr0 *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "wkssvc_NetrUseEnumCtr0"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_wkssvc_NetrUseInfo0(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumCtr(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetrUseEnumCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 0: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); + break; } + + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 0: + if (r->ctr0) { + NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + } + break; + + case 1: + if (r->ctr1) { + NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + } + break; + + case 2: + if (r->ctr2) { + NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumCtr(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetrUseEnumCtr *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_ctr0_0; + TALLOC_CTX *_mem_save_ctr1_0; + TALLOC_CTX *_mem_save_ctr2_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 0: { + uint32_t _ptr_ctr0; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); + if (_ptr_ctr0) { + NDR_PULL_ALLOC(ndr, r->ctr0); + } else { + r->ctr0 = NULL; + } + break; } + + case 1: { + uint32_t _ptr_ctr1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); + if (_ptr_ctr1) { + NDR_PULL_ALLOC(ndr, r->ctr1); + } else { + r->ctr1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_ctr2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); + if (_ptr_ctr2) { + NDR_PULL_ALLOC(ndr, r->ctr2); + } else { + r->ctr2 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 0: + if (r->ctr0) { + _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); + } + break; + + case 1: + if (r->ctr1) { + _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); + } + break; + + case 2: + if (r->ctr2) { + _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetrUseEnumCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "wkssvc_NetrUseEnumCtr"); + switch (level) { + case 0: + ndr_print_ptr(ndr, "ctr0", r->ctr0); + ndr->depth++; + if (r->ctr0) { + ndr_print_wkssvc_NetrUseEnumCtr0(ndr, "ctr0", r->ctr0); + } + ndr->depth--; + break; + + case 1: + ndr_print_ptr(ndr, "ctr1", r->ctr1); + ndr->depth++; + if (r->ctr1) { + ndr_print_wkssvc_NetrUseEnumCtr1(ndr, "ctr1", r->ctr1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "ctr2", r->ctr2); + ndr->depth++; + if (r->ctr2) { + ndr_print_wkssvc_NetrUseEnumCtr2(ndr, "ctr2", r->ctr2); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumInfo(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseEnumInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumInfo(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseEnumInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); + NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumInfo *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUseEnumInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "level", r->level); + ndr_print_set_switch_value(ndr, &r->ctr, r->level); + ndr_print_wkssvc_NetrUseEnumCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWorkstationStatistics(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrWorkstationStatistics *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown3)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown4)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown5)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown6)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown7)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown9)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown10)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown11)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown12)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown13)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown14)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown15)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown17)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown18)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown19)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown20)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown21)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown22)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown23)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown24)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown25)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown26)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown27)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown28)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown29)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown30)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown31)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown32)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown33)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown34)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown35)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown36)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown37)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown38)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown39)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown40)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWorkstationStatistics(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrWorkstationStatistics *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown4)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown5)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown6)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown7)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown9)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown10)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown11)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown12)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown13)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown14)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown15)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown17)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown18)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown19)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown20)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown21)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown22)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown23)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown24)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown25)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown26)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown27)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown28)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown29)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown30)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown31)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown32)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown33)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown34)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown35)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown36)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown37)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown38)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown39)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown40)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWorkstationStatistics(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWorkstationStatistics *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrWorkstationStatistics"); + ndr->depth++; + ndr_print_hyper(ndr, "unknown1", r->unknown1); + ndr_print_hyper(ndr, "unknown2", r->unknown2); + ndr_print_hyper(ndr, "unknown3", r->unknown3); + ndr_print_hyper(ndr, "unknown4", r->unknown4); + ndr_print_hyper(ndr, "unknown5", r->unknown5); + ndr_print_hyper(ndr, "unknown6", r->unknown6); + ndr_print_hyper(ndr, "unknown7", r->unknown7); + ndr_print_hyper(ndr, "unknown8", r->unknown8); + ndr_print_hyper(ndr, "unknown9", r->unknown9); + ndr_print_hyper(ndr, "unknown10", r->unknown10); + ndr_print_hyper(ndr, "unknown11", r->unknown11); + ndr_print_hyper(ndr, "unknown12", r->unknown12); + ndr_print_hyper(ndr, "unknown13", r->unknown13); + ndr_print_uint32(ndr, "unknown14", r->unknown14); + ndr_print_uint32(ndr, "unknown15", r->unknown15); + ndr_print_uint32(ndr, "unknown16", r->unknown16); + ndr_print_uint32(ndr, "unknown17", r->unknown17); + ndr_print_uint32(ndr, "unknown18", r->unknown18); + ndr_print_uint32(ndr, "unknown19", r->unknown19); + ndr_print_uint32(ndr, "unknown20", r->unknown20); + ndr_print_uint32(ndr, "unknown21", r->unknown21); + ndr_print_uint32(ndr, "unknown22", r->unknown22); + ndr_print_uint32(ndr, "unknown23", r->unknown23); + ndr_print_uint32(ndr, "unknown24", r->unknown24); + ndr_print_uint32(ndr, "unknown25", r->unknown25); + ndr_print_uint32(ndr, "unknown26", r->unknown26); + ndr_print_uint32(ndr, "unknown27", r->unknown27); + ndr_print_uint32(ndr, "unknown28", r->unknown28); + ndr_print_uint32(ndr, "unknown29", r->unknown29); + ndr_print_uint32(ndr, "unknown30", r->unknown30); + ndr_print_uint32(ndr, "unknown31", r->unknown31); + ndr_print_uint32(ndr, "unknown32", r->unknown32); + ndr_print_uint32(ndr, "unknown33", r->unknown33); + ndr_print_uint32(ndr, "unknown34", r->unknown34); + ndr_print_uint32(ndr, "unknown35", r->unknown35); + ndr_print_uint32(ndr, "unknown36", r->unknown36); + ndr_print_uint32(ndr, "unknown37", r->unknown37); + ndr_print_uint32(ndr, "unknown38", r->unknown38); + ndr_print_uint32(ndr, "unknown39", r->unknown39); + ndr_print_uint32(ndr, "unknown40", r->unknown40); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_renameflags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_renameflags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_renameflags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE", WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetValidateNameType(struct ndr_push *ndr, int ndr_flags, enum wkssvc_NetValidateNameType r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetValidateNameType(struct ndr_pull *ndr, int ndr_flags, enum wkssvc_NetValidateNameType *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetValidateNameType(struct ndr_print *ndr, const char *name, enum wkssvc_NetValidateNameType r) +{ + const char *val = NULL; + + switch (r) { + case NetSetupUnknown: val = "NetSetupUnknown"; break; + case NetSetupMachine: val = "NetSetupMachine"; break; + case NetSetupWorkgroup: val = "NetSetupWorkgroup"; break; + case NetSetupDomain: val = "NetSetupDomain"; break; + case NetSetupNonExistentDomain: val = "NetSetupNonExistentDomain"; break; + case NetSetupDnsMachine: val = "NetSetupDnsMachine"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_wkssvc_NetJoinStatus(struct ndr_push *ndr, int ndr_flags, enum wkssvc_NetJoinStatus r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetJoinStatus(struct ndr_pull *ndr, int ndr_flags, enum wkssvc_NetJoinStatus *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetJoinStatus(struct ndr_print *ndr, const char *name, enum wkssvc_NetJoinStatus r) +{ + const char *val = NULL; + + switch (r) { + case NET_SETUP_UNKNOWN_STATUS: val = "NET_SETUP_UNKNOWN_STATUS"; break; + case NET_SETUP_UNJOINED: val = "NET_SETUP_UNJOINED"; break; + case NET_SETUP_WORKGROUP_NAME: val = "NET_SETUP_WORKGROUP_NAME"; break; + case NET_SETUP_DOMAIN_NAME: val = "NET_SETUP_DOMAIN_NAME"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_wkssvc_PasswordBuffer(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_PasswordBuffer *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 524)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_PasswordBuffer(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_PasswordBuffer *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 524)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_PasswordBuffer(struct ndr_print *ndr, const char *name, const struct wkssvc_PasswordBuffer *r) +{ + ndr_print_struct(ndr, name, "wkssvc_PasswordBuffer"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->data, 524); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_wkssvc_joinflags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_joinflags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_joinflags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME", WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT", WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_DEFER_SPN", WKSSVC_JOIN_FLAGS_DEFER_SPN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED", WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_UNSECURE", WKSSVC_JOIN_FLAGS_JOIN_UNSECURE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED", WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_WIN9X_UPGRADE", WKSSVC_JOIN_FLAGS_WIN9X_UPGRADE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE", WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE", WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_TYPE", WKSSVC_JOIN_FLAGS_JOIN_TYPE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_ComputerNameType(struct ndr_push *ndr, int ndr_flags, enum wkssvc_ComputerNameType r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_ComputerNameType(struct ndr_pull *ndr, int ndr_flags, enum wkssvc_ComputerNameType *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_ComputerNameType(struct ndr_print *ndr, const char *name, enum wkssvc_ComputerNameType r) +{ + const char *val = NULL; + + switch (r) { + case NetPrimaryComputerName: val = "NetPrimaryComputerName"; break; + case NetAlternateComputerNames: val = "NetAlternateComputerNames"; break; + case NetAllComputerNames: val = "NetAllComputerNames"; break; + case NetComputerNameTypeMax: val = "NetComputerNameTypeMax"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_wkssvc_ComputerNamesCtr(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_ComputerNamesCtr *r) +{ + uint32_t cntr_computer_name_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->computer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_computer_name_1 = 0; cntr_computer_name_1 < r->count; cntr_computer_name_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->computer_name[cntr_computer_name_1])); + } + for (cntr_computer_name_1 = 0; cntr_computer_name_1 < r->count; cntr_computer_name_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->computer_name[cntr_computer_name_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_ComputerNamesCtr(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_ComputerNamesCtr *r) +{ + uint32_t _ptr_computer_name; + uint32_t cntr_computer_name_1; + TALLOC_CTX *_mem_save_computer_name_0; + TALLOC_CTX *_mem_save_computer_name_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); + if (_ptr_computer_name) { + NDR_PULL_ALLOC(ndr, r->computer_name); + } else { + r->computer_name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->computer_name) { + _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->computer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_name)); + NDR_PULL_ALLOC_N(ndr, r->computer_name, ndr_get_array_size(ndr, &r->computer_name)); + _mem_save_computer_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->computer_name, 0); + for (cntr_computer_name_1 = 0; cntr_computer_name_1 < r->count; cntr_computer_name_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->computer_name[cntr_computer_name_1])); + } + for (cntr_computer_name_1 = 0; cntr_computer_name_1 < r->count; cntr_computer_name_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->computer_name[cntr_computer_name_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); + } + if (r->computer_name) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->computer_name, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_ComputerNamesCtr(struct ndr_print *ndr, const char *name, const struct wkssvc_ComputerNamesCtr *r) +{ + uint32_t cntr_computer_name_1; + ndr_print_struct(ndr, name, "wkssvc_ComputerNamesCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "computer_name", r->computer_name); + ndr->depth++; + if (r->computer_name) { + ndr->print(ndr, "%s: ARRAY(%d)", "computer_name", (int)r->count); + ndr->depth++; + for (cntr_computer_name_1=0;cntr_computer_name_1count;cntr_computer_name_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_computer_name_1) != -1) { + ndr_print_lsa_String(ndr, "computer_name", &r->computer_name[cntr_computer_name_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaGetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetWkstaGetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaGetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetWkstaGetInfo *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaGetInfo *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetWkstaGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetWkstaGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_wkssvc_NetWkstaInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaSetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetWkstaSetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + 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 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 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)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaSetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetWkstaSetInfo *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_parm_error_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.parm_error); + } + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.parm_error); + *r->out.parm_error = *r->in.parm_error; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.parm_error); + } + _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaSetInfo *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaSetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetWkstaSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_wkssvc_NetWkstaInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_ptr(ndr, "parm_error", r->in.parm_error); + ndr->depth++; + ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetWkstaSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "parm_error", r->out.parm_error); + ndr->depth++; + ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsers(struct ndr_push *ndr, int flags, const struct wkssvc_NetWkstaEnumUsers *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.prefmaxlen)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + if (r->out.entries_read == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.entries_read)); + 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)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsers(struct ndr_pull *ndr, int flags, struct wkssvc_NetWkstaEnumUsers *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_entries_read_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.prefmaxlen)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info); + *r->out.info = *r->in.info; + NDR_PULL_ALLOC(ndr, r->out.entries_read); + ZERO_STRUCTP(r->out.entries_read); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.entries_read); + } + _mem_save_entries_read_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.entries_read, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.entries_read)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_read_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsers(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaEnumUsers *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaEnumUsers"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetWkstaEnumUsers"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_wkssvc_NetWkstaEnumUsersInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_uint32(ndr, "prefmaxlen", r->in.prefmaxlen); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetWkstaEnumUsers"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_wkssvc_NetWkstaEnumUsersInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_ptr(ndr, "entries_read", r->out.entries_read); + ndr->depth++; + ndr_print_uint32(ndr, "entries_read", *r->out.entries_read); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserGetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWkstaUserGetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); + if (r->in.unknown) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown, ndr_charset_length(r->in.unknown, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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_NetrWkstaUserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserGetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWkstaUserGetInfo *r) +{ + uint32_t _ptr_unknown; + TALLOC_CTX *_mem_save_unknown_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); + if (_ptr_unknown) { + NDR_PULL_ALLOC(ndr, r->in.unknown); + } else { + r->in.unknown = NULL; + } + if (r->in.unknown) { + _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown)); + if (ndr_get_array_length(ndr, &r->in.unknown) > ndr_get_array_size(ndr, &r->in.unknown)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown), ndr_get_array_length(ndr, &r->in.unknown)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaUserGetInfo *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrWkstaUserGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "unknown", r->in.unknown); + ndr->depth++; + if (r->in.unknown) { + ndr_print_string(ndr, "unknown", r->in.unknown); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrWkstaUserGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_wkssvc_NetrWkstaUserInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserSetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWkstaUserSetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); + if (r->in.unknown) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown, ndr_charset_length(r->in.unknown, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + 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_NetrWkstaUserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_err)); + if (r->in.parm_err) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_err)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_err)); + if (r->out.parm_err) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_err)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserSetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWkstaUserSetInfo *r) +{ + uint32_t _ptr_unknown; + uint32_t _ptr_parm_err; + TALLOC_CTX *_mem_save_unknown_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_parm_err_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); + if (_ptr_unknown) { + NDR_PULL_ALLOC(ndr, r->in.unknown); + } else { + r->in.unknown = NULL; + } + if (r->in.unknown) { + _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown)); + if (ndr_get_array_length(ndr, &r->in.unknown) > ndr_get_array_size(ndr, &r->in.unknown)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown), ndr_get_array_length(ndr, &r->in.unknown)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); + if (_ptr_parm_err) { + NDR_PULL_ALLOC(ndr, r->in.parm_err); + } else { + r->in.parm_err = NULL; + } + if (r->in.parm_err) { + _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_err, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_err)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); + if (_ptr_parm_err) { + NDR_PULL_ALLOC(ndr, r->out.parm_err); + } else { + r->out.parm_err = NULL; + } + if (r->out.parm_err) { + _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_err, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_err)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaUserSetInfo *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserSetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrWkstaUserSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "unknown", r->in.unknown); + ndr->depth++; + if (r->in.unknown) { + ndr_print_string(ndr, "unknown", r->in.unknown); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_wkssvc_NetrWkstaUserInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_ptr(ndr, "parm_err", r->in.parm_err); + ndr->depth++; + if (r->in.parm_err) { + ndr_print_uint32(ndr, "parm_err", *r->in.parm_err); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrWkstaUserSetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "parm_err", r->out.parm_err); + ndr->depth++; + if (r->out.parm_err) { + ndr_print_uint32(ndr, "parm_err", *r->out.parm_err); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportEnum(struct ndr_push *ndr, int flags, const struct wkssvc_NetWkstaTransportEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + 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)); + 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)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportEnum(struct ndr_pull *ndr, int flags, struct wkssvc_NetWkstaTransportEnum *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_total_entries_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info); + *r->out.info = *r->in.info; + NDR_PULL_ALLOC(ndr, r->out.total_entries); + ZERO_STRUCTP(r->out.total_entries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.total_entries); + } + _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaTransportEnum *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetWkstaTransportEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetWkstaTransportEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_wkssvc_NetWkstaTransportInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetWkstaTransportEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_wkssvc_NetWkstaTransportInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_ptr(ndr, "total_entries", r->out.total_entries); + ndr->depth++; + ndr_print_uint32(ndr, "total_entries", *r->out.total_entries); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWkstaTransportAdd(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWkstaTransportAdd *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + if (r->in.info0 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info0)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_err)); + if (r->in.parm_err) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_err)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_err)); + if (r->out.parm_err) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_err)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaTransportAdd(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWkstaTransportAdd *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_parm_err; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_info0_0; + TALLOC_CTX *_mem_save_parm_err_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info0); + } + _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info0)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); + if (_ptr_parm_err) { + NDR_PULL_ALLOC(ndr, r->in.parm_err); + } else { + r->in.parm_err = NULL; + } + if (r->in.parm_err) { + _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_err, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_err)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); + if (_ptr_parm_err) { + NDR_PULL_ALLOC(ndr, r->out.parm_err); + } else { + r->out.parm_err = NULL; + } + if (r->out.parm_err) { + _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_err, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_err)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWkstaTransportAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaTransportAdd *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrWkstaTransportAdd"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrWkstaTransportAdd"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info0", r->in.info0); + ndr->depth++; + ndr_print_wkssvc_NetWkstaTransportInfo0(ndr, "info0", r->in.info0); + ndr->depth--; + ndr_print_ptr(ndr, "parm_err", r->in.parm_err); + ndr->depth++; + if (r->in.parm_err) { + ndr_print_uint32(ndr, "parm_err", *r->in.parm_err); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrWkstaTransportAdd"); + ndr->depth++; + ndr_print_ptr(ndr, "parm_err", r->out.parm_err); + ndr->depth++; + if (r->out.parm_err) { + ndr_print_uint32(ndr, "parm_err", *r->out.parm_err); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWkstaTransportDel(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWkstaTransportDel *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.transport_name)); + if (r->in.transport_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport_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.transport_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.transport_name, ndr_charset_length(r->in.transport_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaTransportDel(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWkstaTransportDel *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_transport_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_transport_name_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport_name)); + if (_ptr_transport_name) { + NDR_PULL_ALLOC(ndr, r->in.transport_name); + } else { + r->in.transport_name = NULL; + } + if (r->in.transport_name) { + _mem_save_transport_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.transport_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.transport_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.transport_name)); + if (ndr_get_array_length(ndr, &r->in.transport_name) > ndr_get_array_size(ndr, &r->in.transport_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.transport_name), ndr_get_array_length(ndr, &r->in.transport_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.transport_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.transport_name, ndr_get_array_length(ndr, &r->in.transport_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown3)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWkstaTransportDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaTransportDel *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrWkstaTransportDel"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrWkstaTransportDel"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "transport_name", r->in.transport_name); + ndr->depth++; + if (r->in.transport_name) { + ndr_print_string(ndr, "transport_name", r->in.transport_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown3", r->in.unknown3); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrWkstaTransportDel"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseAdd(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUseAdd *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + 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_NetrUseGetInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_err)); + if (r->in.parm_err) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_err)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_err)); + if (r->out.parm_err) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_err)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseAdd(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUseAdd *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_parm_err; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_ctr_0; + TALLOC_CTX *_mem_save_parm_err_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.ctr, r->in.level)); + NDR_CHECK(ndr_pull_wkssvc_NetrUseGetInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); + if (_ptr_parm_err) { + NDR_PULL_ALLOC(ndr, r->in.parm_err); + } else { + r->in.parm_err = NULL; + } + if (r->in.parm_err) { + _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_err, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_err)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); + if (_ptr_parm_err) { + NDR_PULL_ALLOC(ndr, r->out.parm_err); + } else { + r->out.parm_err = NULL; + } + if (r->out.parm_err) { + _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_err, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_err)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseAdd *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUseAdd"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrUseAdd"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "ctr", r->in.ctr); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.ctr, r->in.level); + ndr_print_wkssvc_NetrUseGetInfoCtr(ndr, "ctr", r->in.ctr); + ndr->depth--; + ndr_print_ptr(ndr, "parm_err", r->in.parm_err); + ndr->depth++; + if (r->in.parm_err) { + ndr_print_uint32(ndr, "parm_err", *r->in.parm_err); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrUseAdd"); + ndr->depth++; + ndr_print_ptr(ndr, "parm_err", r->out.parm_err); + ndr->depth++; + if (r->out.parm_err) { + ndr_print_uint32(ndr, "parm_err", *r->out.parm_err); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseGetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUseGetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.use_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.use_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.use_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.use_name, ndr_charset_length(r->in.use_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + 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->in.level)); + NDR_CHECK(ndr_push_wkssvc_NetrUseGetInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseGetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUseGetInfo *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_ctr_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.use_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.use_name)); + if (ndr_get_array_length(ndr, &r->in.use_name) > ndr_get_array_size(ndr, &r->in.use_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.use_name), ndr_get_array_length(ndr, &r->in.use_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.use_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.use_name, ndr_get_array_length(ndr, &r->in.use_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, r->in.level)); + NDR_CHECK(ndr_pull_wkssvc_NetrUseGetInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseGetInfo *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUseGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrUseGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "use_name", r->in.use_name); + ndr->depth++; + ndr_print_string(ndr, "use_name", r->in.use_name); + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrUseGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.ctr, r->in.level); + ndr_print_wkssvc_NetrUseGetInfoCtr(ndr, "ctr", r->out.ctr); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseDel(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUseDel *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.use_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.use_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.use_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.use_name, ndr_charset_length(r->in.use_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.force_cond)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseDel(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUseDel *r) +{ + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.use_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.use_name)); + if (ndr_get_array_length(ndr, &r->in.use_name) > ndr_get_array_size(ndr, &r->in.use_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.use_name), ndr_get_array_length(ndr, &r->in.use_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.use_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.use_name, ndr_get_array_length(ndr, &r->in.use_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.force_cond)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseDel *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUseDel"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrUseDel"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "use_name", r->in.use_name); + ndr->depth++; + ndr_print_string(ndr, "use_name", r->in.use_name); + ndr->depth--; + ndr_print_uint32(ndr, "force_cond", r->in.force_cond); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrUseDel"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUseEnum(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUseEnum *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wkssvc_NetrUseEnumInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.prefmaxlen)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); + if (r->in.resume_handle) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + } + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wkssvc_NetrUseEnumInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + if (r->out.entries_read == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.entries_read)); + 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)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnum(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUseEnum *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_resume_handle; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_entries_read_0; + TALLOC_CTX *_mem_save_resume_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.prefmaxlen)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } else { + r->in.resume_handle = NULL; + } + if (r->in.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info); + *r->out.info = *r->in.info; + NDR_PULL_ALLOC(ndr, r->out.entries_read); + ZERO_STRUCTP(r->out.entries_read); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.entries_read); + } + _mem_save_entries_read_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.entries_read, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.entries_read)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_read_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); + if (_ptr_resume_handle) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } else { + r->out.resume_handle = NULL; + } + if (r->out.resume_handle) { + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUseEnum(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseEnum *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUseEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrUseEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_wkssvc_NetrUseEnumInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr_print_uint32(ndr, "prefmaxlen", r->in.prefmaxlen); + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + if (r->in.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrUseEnum"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_wkssvc_NetrUseEnumInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_ptr(ndr, "entries_read", r->out.entries_read); + ndr->depth++; + ndr_print_uint32(ndr, "entries_read", *r->out.entries_read); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + if (r->out.resume_handle) { + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrMessageBufferSend(struct ndr_push *ndr, int flags, const struct wkssvc_NetrMessageBufferSend *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.message_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.message_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.message_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.message_name, ndr_charset_length(r->in.message_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message_sender_name)); + if (r->in.message_sender_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.message_sender_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.message_sender_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.message_sender_name, ndr_charset_length(r->in.message_sender_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->in.message_buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.message_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.message_buffer, r->in.message_size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.message_size)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrMessageBufferSend(struct ndr_pull *ndr, int flags, struct wkssvc_NetrMessageBufferSend *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_message_sender_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_message_sender_name_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.message_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.message_name)); + if (ndr_get_array_length(ndr, &r->in.message_name) > ndr_get_array_size(ndr, &r->in.message_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.message_name), ndr_get_array_length(ndr, &r->in.message_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.message_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.message_name, ndr_get_array_length(ndr, &r->in.message_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message_sender_name)); + if (_ptr_message_sender_name) { + NDR_PULL_ALLOC(ndr, r->in.message_sender_name); + } else { + r->in.message_sender_name = NULL; + } + if (r->in.message_sender_name) { + _mem_save_message_sender_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.message_sender_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.message_sender_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.message_sender_name)); + if (ndr_get_array_length(ndr, &r->in.message_sender_name) > ndr_get_array_size(ndr, &r->in.message_sender_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.message_sender_name), ndr_get_array_length(ndr, &r->in.message_sender_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.message_sender_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.message_sender_name, ndr_get_array_length(ndr, &r->in.message_sender_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_sender_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.message_buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.message_buffer, ndr_get_array_size(ndr, &r->in.message_buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.message_buffer, ndr_get_array_size(ndr, &r->in.message_buffer))); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.message_size)); + if (r->in.message_buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.message_buffer, r->in.message_size)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrMessageBufferSend(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrMessageBufferSend *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrMessageBufferSend"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrMessageBufferSend"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "message_name", r->in.message_name); + ndr->depth++; + ndr_print_string(ndr, "message_name", r->in.message_name); + ndr->depth--; + ndr_print_ptr(ndr, "message_sender_name", r->in.message_sender_name); + ndr->depth++; + if (r->in.message_sender_name) { + ndr_print_string(ndr, "message_sender_name", r->in.message_sender_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "message_buffer", r->in.message_buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "message_buffer", r->in.message_buffer, r->in.message_size); + ndr->depth--; + ndr_print_uint32(ndr, "message_size", r->in.message_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrMessageBufferSend"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrWorkstationStatisticsGet(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWorkstationStatisticsGet *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown2)); + if (r->in.unknown2) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown2, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown2, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown2, ndr_charset_length(r->in.unknown2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown4)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_wkssvc_NetrWorkstationStatistics(ndr, NDR_SCALARS, *r->out.info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrWorkstationStatisticsGet(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWorkstationStatisticsGet *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_unknown2; + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_unknown2_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); + if (_ptr_unknown2) { + NDR_PULL_ALLOC(ndr, r->in.unknown2); + } else { + r->in.unknown2 = NULL; + } + if (r->in.unknown2) { + _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown2, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown2)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown2)); + if (ndr_get_array_length(ndr, &r->in.unknown2) > ndr_get_array_size(ndr, &r->in.unknown2)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown2), ndr_get_array_length(ndr, &r->in.unknown2)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown2), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown2, ndr_get_array_length(ndr, &r->in.unknown2), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown4)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrWorkstationStatistics(ndr, NDR_SCALARS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrWorkstationStatisticsGet(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWorkstationStatisticsGet *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrWorkstationStatisticsGet"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrWorkstationStatisticsGet"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown2", r->in.unknown2); + ndr->depth++; + if (r->in.unknown2) { + ndr_print_string(ndr, "unknown2", r->in.unknown2); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown3", r->in.unknown3); + ndr_print_uint32(ndr, "unknown4", r->in.unknown4); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrWorkstationStatisticsGet"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_wkssvc_NetrWorkstationStatistics(ndr, "info", *r->out.info); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrLogonDomainNameAdd(struct ndr_push *ndr, int flags, const struct wkssvc_NetrLogonDomainNameAdd *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrLogonDomainNameAdd(struct ndr_pull *ndr, int flags, struct wkssvc_NetrLogonDomainNameAdd *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrLogonDomainNameAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrLogonDomainNameAdd *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrLogonDomainNameAdd"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrLogonDomainNameAdd"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + ndr_print_string(ndr, "domain_name", r->in.domain_name); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrLogonDomainNameAdd"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrLogonDomainNameDel(struct ndr_push *ndr, int flags, const struct wkssvc_NetrLogonDomainNameDel *r) +{ + if (flags & NDR_IN) { + 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrLogonDomainNameDel(struct ndr_pull *ndr, int flags, struct wkssvc_NetrLogonDomainNameDel *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrLogonDomainNameDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrLogonDomainNameDel *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrLogonDomainNameDel"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrLogonDomainNameDel"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + ndr_print_string(ndr, "domain_name", r->in.domain_name); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrLogonDomainNameDel"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrJoinDomain(struct ndr_push *ndr, int flags, const struct wkssvc_NetrJoinDomain *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.account_ou)); + if (r->in.account_ou) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_ou, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_ou, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_ou, ndr_charset_length(r->in.account_ou, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); + if (r->in.password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_wkssvc_joinflags(ndr, NDR_SCALARS, r->in.join_flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrJoinDomain(struct ndr_pull *ndr, int flags, struct wkssvc_NetrJoinDomain *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_account_ou; + uint32_t _ptr_Account; + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_account_ou_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_password_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_ou)); + if (_ptr_account_ou) { + NDR_PULL_ALLOC(ndr, r->in.account_ou); + } else { + r->in.account_ou = NULL; + } + if (r->in.account_ou) { + _mem_save_account_ou_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account_ou, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_ou)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_ou)); + if (ndr_get_array_length(ndr, &r->in.account_ou) > ndr_get_array_size(ndr, &r->in.account_ou)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_ou), ndr_get_array_length(ndr, &r->in.account_ou)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_ou), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_ou, ndr_get_array_length(ndr, &r->in.account_ou), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_ou_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->in.password); + } else { + r->in.password = NULL; + } + if (r->in.password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); + if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + NDR_CHECK(ndr_pull_wkssvc_joinflags(ndr, NDR_SCALARS, &r->in.join_flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrJoinDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrJoinDomain *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrJoinDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrJoinDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + ndr_print_string(ndr, "domain_name", r->in.domain_name); + ndr->depth--; + ndr_print_ptr(ndr, "account_ou", r->in.account_ou); + ndr->depth++; + if (r->in.account_ou) { + ndr_print_string(ndr, "account_ou", r->in.account_ou); + } + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->in.password); + ndr->depth++; + if (r->in.password) { + ndr_print_string(ndr, "password", r->in.password); + } + ndr->depth--; + ndr_print_wkssvc_joinflags(ndr, "join_flags", r->in.join_flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrJoinDomain"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUnjoinDomain(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUnjoinDomain *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); + if (r->in.password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_wkssvc_joinflags(ndr, NDR_SCALARS, r->in.unjoin_flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUnjoinDomain(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUnjoinDomain *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_Account; + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_password_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->in.password); + } else { + r->in.password = NULL; + } + if (r->in.password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); + if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + NDR_CHECK(ndr_pull_wkssvc_joinflags(ndr, NDR_SCALARS, &r->in.unjoin_flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUnjoinDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUnjoinDomain *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUnjoinDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrUnjoinDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->in.password); + ndr->depth++; + if (r->in.password) { + ndr_print_string(ndr, "password", r->in.password); + } + ndr->depth--; + ndr_print_wkssvc_joinflags(ndr, "unjoin_flags", r->in.unjoin_flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrUnjoinDomain"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrRenameMachineInDomain(struct ndr_push *ndr, int flags, const struct wkssvc_NetrRenameMachineInDomain *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.NewMachineName)); + if (r->in.NewMachineName) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewMachineName, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewMachineName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.NewMachineName, ndr_charset_length(r->in.NewMachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); + if (r->in.password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_wkssvc_renameflags(ndr, NDR_SCALARS, r->in.RenameOptions)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrRenameMachineInDomain(struct ndr_pull *ndr, int flags, struct wkssvc_NetrRenameMachineInDomain *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_NewMachineName; + uint32_t _ptr_Account; + uint32_t _ptr_password; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_NewMachineName_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_password_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_NewMachineName)); + if (_ptr_NewMachineName) { + NDR_PULL_ALLOC(ndr, r->in.NewMachineName); + } else { + r->in.NewMachineName = NULL; + } + if (r->in.NewMachineName) { + _mem_save_NewMachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.NewMachineName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.NewMachineName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.NewMachineName)); + if (ndr_get_array_length(ndr, &r->in.NewMachineName) > ndr_get_array_size(ndr, &r->in.NewMachineName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.NewMachineName), ndr_get_array_length(ndr, &r->in.NewMachineName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.NewMachineName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.NewMachineName, ndr_get_array_length(ndr, &r->in.NewMachineName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_NewMachineName_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->in.password); + } else { + r->in.password = NULL; + } + if (r->in.password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); + if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + NDR_CHECK(ndr_pull_wkssvc_renameflags(ndr, NDR_SCALARS, &r->in.RenameOptions)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrRenameMachineInDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRenameMachineInDomain *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrRenameMachineInDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrRenameMachineInDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "NewMachineName", r->in.NewMachineName); + ndr->depth++; + if (r->in.NewMachineName) { + ndr_print_string(ndr, "NewMachineName", r->in.NewMachineName); + } + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "password", r->in.password); + ndr->depth++; + if (r->in.password) { + ndr_print_string(ndr, "password", r->in.password); + } + ndr->depth--; + ndr_print_wkssvc_renameflags(ndr, "RenameOptions", r->in.RenameOptions); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrRenameMachineInDomain"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrValidateName(struct ndr_push *ndr, int flags, const struct wkssvc_NetrValidateName *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.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.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.name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Password)); + if (r->in.Password) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Password, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Password, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Password, ndr_charset_length(r->in.Password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_wkssvc_NetValidateNameType(ndr, NDR_SCALARS, r->in.name_type)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrValidateName(struct ndr_pull *ndr, int flags, struct wkssvc_NetrValidateName *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_Account; + uint32_t _ptr_Password; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_Password_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name)); + if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name), ndr_get_array_length(ndr, &r->in.name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Password)); + if (_ptr_Password) { + NDR_PULL_ALLOC(ndr, r->in.Password); + } else { + r->in.Password = NULL; + } + if (r->in.Password) { + _mem_save_Password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Password, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Password)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Password)); + if (ndr_get_array_length(ndr, &r->in.Password) > ndr_get_array_size(ndr, &r->in.Password)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Password), ndr_get_array_length(ndr, &r->in.Password)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Password), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Password, ndr_get_array_length(ndr, &r->in.Password), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Password_0, 0); + } + NDR_CHECK(ndr_pull_wkssvc_NetValidateNameType(ndr, NDR_SCALARS, &r->in.name_type)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrValidateName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrValidateName *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrValidateName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrValidateName"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_string(ndr, "name", r->in.name); + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "Password", r->in.Password); + ndr->depth++; + if (r->in.Password) { + ndr_print_string(ndr, "Password", r->in.Password); + } + ndr->depth--; + ndr_print_wkssvc_NetValidateNameType(ndr, "name_type", r->in.name_type); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrValidateName"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinInformation(struct ndr_push *ndr, int flags, const struct wkssvc_NetrGetJoinInformation *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.name_buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.name_buffer)); + if (*r->in.name_buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.name_buffer, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.name_buffer, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->in.name_buffer, ndr_charset_length(*r->in.name_buffer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + if (flags & NDR_OUT) { + if (r->out.name_buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name_buffer)); + if (*r->out.name_buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name_buffer, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name_buffer, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.name_buffer, ndr_charset_length(*r->out.name_buffer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->out.name_type == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wkssvc_NetJoinStatus(ndr, NDR_SCALARS, *r->out.name_type)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinInformation(struct ndr_pull *ndr, int flags, struct wkssvc_NetrGetJoinInformation *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_name_buffer; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_name_buffer_0; + TALLOC_CTX *_mem_save_name_buffer_1; + TALLOC_CTX *_mem_save_name_type_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.name_buffer); + } + _mem_save_name_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name_buffer, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name_buffer)); + if (_ptr_name_buffer) { + NDR_PULL_ALLOC(ndr, *r->in.name_buffer); + } else { + *r->in.name_buffer = NULL; + } + if (*r->in.name_buffer) { + _mem_save_name_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.name_buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->in.name_buffer)); + NDR_CHECK(ndr_pull_array_length(ndr, r->in.name_buffer)); + if (ndr_get_array_length(ndr, r->in.name_buffer) > ndr_get_array_size(ndr, r->in.name_buffer)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->in.name_buffer), ndr_get_array_length(ndr, r->in.name_buffer)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->in.name_buffer), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->in.name_buffer, ndr_get_array_length(ndr, r->in.name_buffer), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.name_buffer); + *r->out.name_buffer = *r->in.name_buffer; + NDR_PULL_ALLOC(ndr, r->out.name_type); + ZERO_STRUCTP(r->out.name_type); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.name_buffer); + } + _mem_save_name_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.name_buffer, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name_buffer)); + if (_ptr_name_buffer) { + NDR_PULL_ALLOC(ndr, *r->out.name_buffer); + } else { + *r->out.name_buffer = NULL; + } + if (*r->out.name_buffer) { + _mem_save_name_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.name_buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.name_buffer)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.name_buffer)); + if (ndr_get_array_length(ndr, r->out.name_buffer) > ndr_get_array_size(ndr, r->out.name_buffer)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.name_buffer), ndr_get_array_length(ndr, r->out.name_buffer)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.name_buffer), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.name_buffer, ndr_get_array_length(ndr, r->out.name_buffer), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.name_type); + } + _mem_save_name_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.name_type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wkssvc_NetJoinStatus(ndr, NDR_SCALARS, r->out.name_type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_type_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrGetJoinInformation(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinInformation *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrGetJoinInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrGetJoinInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "name_buffer", r->in.name_buffer); + ndr->depth++; + ndr_print_ptr(ndr, "name_buffer", *r->in.name_buffer); + ndr->depth++; + if (*r->in.name_buffer) { + ndr_print_string(ndr, "name_buffer", *r->in.name_buffer); + } + ndr->depth--; + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrGetJoinInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "name_buffer", r->out.name_buffer); + ndr->depth++; + ndr_print_ptr(ndr, "name_buffer", *r->out.name_buffer); + ndr->depth++; + if (*r->out.name_buffer) { + ndr_print_string(ndr, "name_buffer", *r->out.name_buffer); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "name_type", r->out.name_type); + ndr->depth++; + ndr_print_wkssvc_NetJoinStatus(ndr, "name_type", *r->out.name_type); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinableOus(struct ndr_push *ndr, int flags, const struct wkssvc_NetrGetJoinableOus *r) +{ + uint32_t cntr_ous_2; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); + if (r->in.unknown) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown, ndr_charset_length(r->in.unknown, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->in.num_ous == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.num_ous)); + } + if (flags & NDR_OUT) { + if (r->out.num_ous == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); + if (r->out.ous == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ous)); + if (*r->out.ous) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, (*r->out.ous)[cntr_ous_2])); + } + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + if ((*r->out.ous)[cntr_ous_2]) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, (*r->out.ous)[cntr_ous_2], ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus(struct ndr_pull *ndr, int flags, struct wkssvc_NetrGetJoinableOus *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_Account; + uint32_t _ptr_unknown; + uint32_t _ptr_ous; + uint32_t cntr_ous_2; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_unknown_0; + TALLOC_CTX *_mem_save_num_ous_0; + TALLOC_CTX *_mem_save_ous_0; + TALLOC_CTX *_mem_save_ous_1; + TALLOC_CTX *_mem_save_ous_2; + TALLOC_CTX *_mem_save_ous_3; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); + if (_ptr_unknown) { + NDR_PULL_ALLOC(ndr, r->in.unknown); + } else { + r->in.unknown = NULL; + } + if (r->in.unknown) { + _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown)); + if (ndr_get_array_length(ndr, &r->in.unknown) > ndr_get_array_size(ndr, &r->in.unknown)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown), ndr_get_array_length(ndr, &r->in.unknown)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.num_ous); + } + _mem_save_num_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.num_ous, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.num_ous)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.num_ous); + *r->out.num_ous = *r->in.num_ous; + NDR_PULL_ALLOC(ndr, r->out.ous); + ZERO_STRUCTP(r->out.ous); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_ous); + } + _mem_save_num_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_ous, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_ous)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ous); + } + _mem_save_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ous, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); + if (_ptr_ous) { + NDR_PULL_ALLOC(ndr, *r->out.ous); + } else { + *r->out.ous = NULL; + } + if (*r->out.ous) { + _mem_save_ous_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.ous)); + NDR_PULL_ALLOC_N(ndr, *r->out.ous, ndr_get_array_size(ndr, r->out.ous)); + _mem_save_ous_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); + if (_ptr_ous) { + NDR_PULL_ALLOC(ndr, (*r->out.ous)[cntr_ous_2]); + } else { + (*r->out.ous)[cntr_ous_2] = NULL; + } + } + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + if ((*r->out.ous)[cntr_ous_2]) { + _mem_save_ous_3 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, (*r->out.ous)[cntr_ous_2], 0); + NDR_CHECK(ndr_pull_array_size(ndr, &(*r->out.ous)[cntr_ous_2])); + NDR_CHECK(ndr_pull_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); + if (ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]) > ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2])) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2]), ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &(*r->out.ous)[cntr_ous_2], ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_3, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_2, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (*r->out.ous) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)r->out.ous, *r->out.num_ous)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrGetJoinableOus(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus *r) +{ + uint32_t cntr_ous_2; + ndr_print_struct(ndr, name, "wkssvc_NetrGetJoinableOus"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrGetJoinableOus"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + ndr_print_string(ndr, "domain_name", r->in.domain_name); + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown", r->in.unknown); + ndr->depth++; + if (r->in.unknown) { + ndr_print_string(ndr, "unknown", r->in.unknown); + } + ndr->depth--; + ndr_print_ptr(ndr, "num_ous", r->in.num_ous); + ndr->depth++; + ndr_print_uint32(ndr, "num_ous", *r->in.num_ous); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrGetJoinableOus"); + ndr->depth++; + ndr_print_ptr(ndr, "num_ous", r->out.num_ous); + ndr->depth++; + ndr_print_uint32(ndr, "num_ous", *r->out.num_ous); + ndr->depth--; + ndr_print_ptr(ndr, "ous", r->out.ous); + ndr->depth++; + ndr_print_ptr(ndr, "ous", *r->out.ous); + ndr->depth++; + if (*r->out.ous) { + ndr->print(ndr, "%s: ARRAY(%d)", "ous", (int)*r->out.num_ous); + ndr->depth++; + for (cntr_ous_2=0;cntr_ous_2<*r->out.num_ous;cntr_ous_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_ous_2) != -1) { + ndr_print_ptr(ndr, "ous", (*r->out.ous)[cntr_ous_2]); + ndr->depth++; + if ((*r->out.ous)[cntr_ous_2]) { + ndr_print_string(ndr, "ous", (*r->out.ous)[cntr_ous_2]); + } + ndr->depth--; + free(idx_2); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrJoinDomain2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrJoinDomain2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.account_ou)); + if (r->in.account_ou) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_ou, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_ou, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_ou, ndr_charset_length(r->in.account_ou, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.admin_account)); + if (r->in.admin_account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.admin_account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.admin_account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.admin_account, ndr_charset_length(r->in.admin_account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.encrypted_password)); + if (r->in.encrypted_password) { + NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.encrypted_password)); + } + NDR_CHECK(ndr_push_wkssvc_joinflags(ndr, NDR_SCALARS, r->in.join_flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrJoinDomain2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrJoinDomain2 *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_account_ou; + uint32_t _ptr_admin_account; + uint32_t _ptr_encrypted_password; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_account_ou_0; + TALLOC_CTX *_mem_save_admin_account_0; + TALLOC_CTX *_mem_save_encrypted_password_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_ou)); + if (_ptr_account_ou) { + NDR_PULL_ALLOC(ndr, r->in.account_ou); + } else { + r->in.account_ou = NULL; + } + if (r->in.account_ou) { + _mem_save_account_ou_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account_ou, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_ou)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_ou)); + if (ndr_get_array_length(ndr, &r->in.account_ou) > ndr_get_array_size(ndr, &r->in.account_ou)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_ou), ndr_get_array_length(ndr, &r->in.account_ou)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_ou), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_ou, ndr_get_array_length(ndr, &r->in.account_ou), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_ou_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_admin_account)); + if (_ptr_admin_account) { + NDR_PULL_ALLOC(ndr, r->in.admin_account); + } else { + r->in.admin_account = NULL; + } + if (r->in.admin_account) { + _mem_save_admin_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.admin_account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.admin_account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.admin_account)); + if (ndr_get_array_length(ndr, &r->in.admin_account) > ndr_get_array_size(ndr, &r->in.admin_account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.admin_account), ndr_get_array_length(ndr, &r->in.admin_account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.admin_account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.admin_account, ndr_get_array_length(ndr, &r->in.admin_account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_admin_account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_encrypted_password)); + if (_ptr_encrypted_password) { + NDR_PULL_ALLOC(ndr, r->in.encrypted_password); + } else { + r->in.encrypted_password = NULL; + } + if (r->in.encrypted_password) { + _mem_save_encrypted_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.encrypted_password, 0); + NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.encrypted_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_encrypted_password_0, 0); + } + NDR_CHECK(ndr_pull_wkssvc_joinflags(ndr, NDR_SCALARS, &r->in.join_flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrJoinDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrJoinDomain2 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrJoinDomain2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrJoinDomain2"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + ndr_print_string(ndr, "domain_name", r->in.domain_name); + ndr->depth--; + ndr_print_ptr(ndr, "account_ou", r->in.account_ou); + ndr->depth++; + if (r->in.account_ou) { + ndr_print_string(ndr, "account_ou", r->in.account_ou); + } + ndr->depth--; + ndr_print_ptr(ndr, "admin_account", r->in.admin_account); + ndr->depth++; + if (r->in.admin_account) { + ndr_print_string(ndr, "admin_account", r->in.admin_account); + } + ndr->depth--; + ndr_print_ptr(ndr, "encrypted_password", r->in.encrypted_password); + ndr->depth++; + if (r->in.encrypted_password) { + ndr_print_wkssvc_PasswordBuffer(ndr, "encrypted_password", r->in.encrypted_password); + } + ndr->depth--; + ndr_print_wkssvc_joinflags(ndr, "join_flags", r->in.join_flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrJoinDomain2"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrUnjoinDomain2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUnjoinDomain2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.account)); + if (r->in.account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account, ndr_charset_length(r->in.account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.encrypted_password)); + if (r->in.encrypted_password) { + NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.encrypted_password)); + } + NDR_CHECK(ndr_push_wkssvc_joinflags(ndr, NDR_SCALARS, r->in.unjoin_flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrUnjoinDomain2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUnjoinDomain2 *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_account; + uint32_t _ptr_encrypted_password; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_account_0; + TALLOC_CTX *_mem_save_encrypted_password_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account)); + if (_ptr_account) { + NDR_PULL_ALLOC(ndr, r->in.account); + } else { + r->in.account = NULL; + } + if (r->in.account) { + _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account)); + if (ndr_get_array_length(ndr, &r->in.account) > ndr_get_array_size(ndr, &r->in.account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account), ndr_get_array_length(ndr, &r->in.account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account, ndr_get_array_length(ndr, &r->in.account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_encrypted_password)); + if (_ptr_encrypted_password) { + NDR_PULL_ALLOC(ndr, r->in.encrypted_password); + } else { + r->in.encrypted_password = NULL; + } + if (r->in.encrypted_password) { + _mem_save_encrypted_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.encrypted_password, 0); + NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.encrypted_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_encrypted_password_0, 0); + } + NDR_CHECK(ndr_pull_wkssvc_joinflags(ndr, NDR_SCALARS, &r->in.unjoin_flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrUnjoinDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUnjoinDomain2 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrUnjoinDomain2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrUnjoinDomain2"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "account", r->in.account); + ndr->depth++; + if (r->in.account) { + ndr_print_string(ndr, "account", r->in.account); + } + ndr->depth--; + ndr_print_ptr(ndr, "encrypted_password", r->in.encrypted_password); + ndr->depth++; + if (r->in.encrypted_password) { + ndr_print_wkssvc_PasswordBuffer(ndr, "encrypted_password", r->in.encrypted_password); + } + ndr->depth--; + ndr_print_wkssvc_joinflags(ndr, "unjoin_flags", r->in.unjoin_flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrUnjoinDomain2"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrRenameMachineInDomain2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrRenameMachineInDomain2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.NewMachineName)); + if (r->in.NewMachineName) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewMachineName, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewMachineName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.NewMachineName, ndr_charset_length(r->in.NewMachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); + if (r->in.EncryptedPassword) { + NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + } + NDR_CHECK(ndr_push_wkssvc_renameflags(ndr, NDR_SCALARS, r->in.RenameOptions)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrRenameMachineInDomain2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrRenameMachineInDomain2 *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_NewMachineName; + uint32_t _ptr_Account; + uint32_t _ptr_EncryptedPassword; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_NewMachineName_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_EncryptedPassword_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_NewMachineName)); + if (_ptr_NewMachineName) { + NDR_PULL_ALLOC(ndr, r->in.NewMachineName); + } else { + r->in.NewMachineName = NULL; + } + if (r->in.NewMachineName) { + _mem_save_NewMachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.NewMachineName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.NewMachineName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.NewMachineName)); + if (ndr_get_array_length(ndr, &r->in.NewMachineName) > ndr_get_array_size(ndr, &r->in.NewMachineName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.NewMachineName), ndr_get_array_length(ndr, &r->in.NewMachineName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.NewMachineName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.NewMachineName, ndr_get_array_length(ndr, &r->in.NewMachineName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_NewMachineName_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); + if (_ptr_EncryptedPassword) { + NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); + } else { + r->in.EncryptedPassword = NULL; + } + if (r->in.EncryptedPassword) { + _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); + NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); + } + NDR_CHECK(ndr_pull_wkssvc_renameflags(ndr, NDR_SCALARS, &r->in.RenameOptions)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrRenameMachineInDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRenameMachineInDomain2 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrRenameMachineInDomain2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrRenameMachineInDomain2"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "NewMachineName", r->in.NewMachineName); + ndr->depth++; + if (r->in.NewMachineName) { + ndr_print_string(ndr, "NewMachineName", r->in.NewMachineName); + } + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); + ndr->depth++; + if (r->in.EncryptedPassword) { + ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); + } + ndr->depth--; + ndr_print_wkssvc_renameflags(ndr, "RenameOptions", r->in.RenameOptions); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrRenameMachineInDomain2"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrValidateName2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrValidateName2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.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.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.name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); + if (r->in.EncryptedPassword) { + NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + } + NDR_CHECK(ndr_push_wkssvc_NetValidateNameType(ndr, NDR_SCALARS, r->in.name_type)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrValidateName2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrValidateName2 *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_Account; + uint32_t _ptr_EncryptedPassword; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_EncryptedPassword_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name)); + if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name), ndr_get_array_length(ndr, &r->in.name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); + if (_ptr_EncryptedPassword) { + NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); + } else { + r->in.EncryptedPassword = NULL; + } + if (r->in.EncryptedPassword) { + _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); + NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); + } + NDR_CHECK(ndr_pull_wkssvc_NetValidateNameType(ndr, NDR_SCALARS, &r->in.name_type)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrValidateName2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrValidateName2 *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrValidateName2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrValidateName2"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_string(ndr, "name", r->in.name); + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); + ndr->depth++; + if (r->in.EncryptedPassword) { + ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); + } + ndr->depth--; + ndr_print_wkssvc_NetValidateNameType(ndr, "name_type", r->in.name_type); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrValidateName2"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinableOus2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrGetJoinableOus2 *r) +{ + uint32_t cntr_ous_2; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 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))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); + if (r->in.EncryptedPassword) { + NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + } + if (r->in.num_ous == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.num_ous)); + } + if (flags & NDR_OUT) { + if (r->out.num_ous == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); + if (r->out.ous == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ous)); + if (*r->out.ous) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, (*r->out.ous)[cntr_ous_2])); + } + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + if ((*r->out.ous)[cntr_ous_2]) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, (*r->out.ous)[cntr_ous_2], ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrGetJoinableOus2 *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_Account; + uint32_t _ptr_EncryptedPassword; + uint32_t _ptr_ous; + uint32_t cntr_ous_2; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_EncryptedPassword_0; + TALLOC_CTX *_mem_save_num_ous_0; + TALLOC_CTX *_mem_save_ous_0; + TALLOC_CTX *_mem_save_ous_1; + TALLOC_CTX *_mem_save_ous_2; + TALLOC_CTX *_mem_save_ous_3; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); + if (_ptr_EncryptedPassword) { + NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); + } else { + r->in.EncryptedPassword = NULL; + } + if (r->in.EncryptedPassword) { + _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); + NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.num_ous); + } + _mem_save_num_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.num_ous, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.num_ous)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.num_ous); + *r->out.num_ous = *r->in.num_ous; + NDR_PULL_ALLOC(ndr, r->out.ous); + ZERO_STRUCTP(r->out.ous); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_ous); + } + _mem_save_num_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_ous, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_ous)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ous); + } + _mem_save_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ous, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); + if (_ptr_ous) { + NDR_PULL_ALLOC(ndr, *r->out.ous); + } else { + *r->out.ous = NULL; + } + if (*r->out.ous) { + _mem_save_ous_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.ous)); + NDR_PULL_ALLOC_N(ndr, *r->out.ous, ndr_get_array_size(ndr, r->out.ous)); + _mem_save_ous_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); + if (_ptr_ous) { + NDR_PULL_ALLOC(ndr, (*r->out.ous)[cntr_ous_2]); + } else { + (*r->out.ous)[cntr_ous_2] = NULL; + } + } + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + if ((*r->out.ous)[cntr_ous_2]) { + _mem_save_ous_3 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, (*r->out.ous)[cntr_ous_2], 0); + NDR_CHECK(ndr_pull_array_size(ndr, &(*r->out.ous)[cntr_ous_2])); + NDR_CHECK(ndr_pull_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); + if (ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]) > ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2])) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2]), ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &(*r->out.ous)[cntr_ous_2], ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_3, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_2, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (*r->out.ous) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)r->out.ous, *r->out.num_ous)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrGetJoinableOus2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus2 *r) +{ + uint32_t cntr_ous_2; + ndr_print_struct(ndr, name, "wkssvc_NetrGetJoinableOus2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrGetJoinableOus2"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + ndr_print_string(ndr, "domain_name", r->in.domain_name); + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); + ndr->depth++; + if (r->in.EncryptedPassword) { + ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); + } + ndr->depth--; + ndr_print_ptr(ndr, "num_ous", r->in.num_ous); + ndr->depth++; + ndr_print_uint32(ndr, "num_ous", *r->in.num_ous); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrGetJoinableOus2"); + ndr->depth++; + ndr_print_ptr(ndr, "num_ous", r->out.num_ous); + ndr->depth++; + ndr_print_uint32(ndr, "num_ous", *r->out.num_ous); + ndr->depth--; + ndr_print_ptr(ndr, "ous", r->out.ous); + ndr->depth++; + ndr_print_ptr(ndr, "ous", *r->out.ous); + ndr->depth++; + if (*r->out.ous) { + ndr->print(ndr, "%s: ARRAY(%d)", "ous", (int)*r->out.num_ous); + ndr->depth++; + for (cntr_ous_2=0;cntr_ous_2<*r->out.num_ous;cntr_ous_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_ous_2) != -1) { + ndr_print_ptr(ndr, "ous", (*r->out.ous)[cntr_ous_2]); + ndr->depth++; + if ((*r->out.ous)[cntr_ous_2]) { + ndr_print_string(ndr, "ous", (*r->out.ous)[cntr_ous_2]); + } + ndr->depth--; + free(idx_2); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrAddAlternateComputerName(struct ndr_push *ndr, int flags, const struct wkssvc_NetrAddAlternateComputerName *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.NewAlternateMachineName)); + if (r->in.NewAlternateMachineName) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewAlternateMachineName, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewAlternateMachineName, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.NewAlternateMachineName, ndr_charset_length(r->in.NewAlternateMachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); + if (r->in.EncryptedPassword) { + NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrAddAlternateComputerName(struct ndr_pull *ndr, int flags, struct wkssvc_NetrAddAlternateComputerName *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_NewAlternateMachineName; + uint32_t _ptr_Account; + uint32_t _ptr_EncryptedPassword; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_NewAlternateMachineName_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_EncryptedPassword_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_NewAlternateMachineName)); + if (_ptr_NewAlternateMachineName) { + NDR_PULL_ALLOC(ndr, r->in.NewAlternateMachineName); + } else { + r->in.NewAlternateMachineName = NULL; + } + if (r->in.NewAlternateMachineName) { + _mem_save_NewAlternateMachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.NewAlternateMachineName, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.NewAlternateMachineName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.NewAlternateMachineName)); + if (ndr_get_array_length(ndr, &r->in.NewAlternateMachineName) > ndr_get_array_size(ndr, &r->in.NewAlternateMachineName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.NewAlternateMachineName), ndr_get_array_length(ndr, &r->in.NewAlternateMachineName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.NewAlternateMachineName), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.NewAlternateMachineName, ndr_get_array_length(ndr, &r->in.NewAlternateMachineName), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_NewAlternateMachineName_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); + if (_ptr_EncryptedPassword) { + NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); + } else { + r->in.EncryptedPassword = NULL; + } + if (r->in.EncryptedPassword) { + _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); + NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrAddAlternateComputerName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrAddAlternateComputerName *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrAddAlternateComputerName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrAddAlternateComputerName"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "NewAlternateMachineName", r->in.NewAlternateMachineName); + ndr->depth++; + if (r->in.NewAlternateMachineName) { + ndr_print_string(ndr, "NewAlternateMachineName", r->in.NewAlternateMachineName); + } + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); + ndr->depth++; + if (r->in.EncryptedPassword) { + ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); + } + ndr->depth--; + ndr_print_uint32(ndr, "Reserved", r->in.Reserved); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrAddAlternateComputerName"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrRemoveAlternateComputerName(struct ndr_push *ndr, int flags, const struct wkssvc_NetrRemoveAlternateComputerName *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.AlternateMachineNameToRemove)); + if (r->in.AlternateMachineNameToRemove) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.AlternateMachineNameToRemove, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.AlternateMachineNameToRemove, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.AlternateMachineNameToRemove, ndr_charset_length(r->in.AlternateMachineNameToRemove, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); + if (r->in.EncryptedPassword) { + NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrRemoveAlternateComputerName(struct ndr_pull *ndr, int flags, struct wkssvc_NetrRemoveAlternateComputerName *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_AlternateMachineNameToRemove; + uint32_t _ptr_Account; + uint32_t _ptr_EncryptedPassword; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_AlternateMachineNameToRemove_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_EncryptedPassword_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_AlternateMachineNameToRemove)); + if (_ptr_AlternateMachineNameToRemove) { + NDR_PULL_ALLOC(ndr, r->in.AlternateMachineNameToRemove); + } else { + r->in.AlternateMachineNameToRemove = NULL; + } + if (r->in.AlternateMachineNameToRemove) { + _mem_save_AlternateMachineNameToRemove_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.AlternateMachineNameToRemove, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.AlternateMachineNameToRemove)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.AlternateMachineNameToRemove)); + if (ndr_get_array_length(ndr, &r->in.AlternateMachineNameToRemove) > ndr_get_array_size(ndr, &r->in.AlternateMachineNameToRemove)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.AlternateMachineNameToRemove), ndr_get_array_length(ndr, &r->in.AlternateMachineNameToRemove)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.AlternateMachineNameToRemove), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.AlternateMachineNameToRemove, ndr_get_array_length(ndr, &r->in.AlternateMachineNameToRemove), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_AlternateMachineNameToRemove_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); + if (_ptr_EncryptedPassword) { + NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); + } else { + r->in.EncryptedPassword = NULL; + } + if (r->in.EncryptedPassword) { + _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); + NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrRemoveAlternateComputerName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRemoveAlternateComputerName *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrRemoveAlternateComputerName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrRemoveAlternateComputerName"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "AlternateMachineNameToRemove", r->in.AlternateMachineNameToRemove); + ndr->depth++; + if (r->in.AlternateMachineNameToRemove) { + ndr_print_string(ndr, "AlternateMachineNameToRemove", r->in.AlternateMachineNameToRemove); + } + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); + ndr->depth++; + if (r->in.EncryptedPassword) { + ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); + } + ndr->depth--; + ndr_print_uint32(ndr, "Reserved", r->in.Reserved); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrRemoveAlternateComputerName"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrSetPrimaryComputername(struct ndr_push *ndr, int flags, const struct wkssvc_NetrSetPrimaryComputername *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.primary_name)); + if (r->in.primary_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.primary_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.primary_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.primary_name, ndr_charset_length(r->in.primary_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); + if (r->in.Account) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); + if (r->in.EncryptedPassword) { + NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrSetPrimaryComputername(struct ndr_pull *ndr, int flags, struct wkssvc_NetrSetPrimaryComputername *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_primary_name; + uint32_t _ptr_Account; + uint32_t _ptr_EncryptedPassword; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_primary_name_0; + TALLOC_CTX *_mem_save_Account_0; + TALLOC_CTX *_mem_save_EncryptedPassword_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_primary_name)); + if (_ptr_primary_name) { + NDR_PULL_ALLOC(ndr, r->in.primary_name); + } else { + r->in.primary_name = NULL; + } + if (r->in.primary_name) { + _mem_save_primary_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.primary_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.primary_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.primary_name)); + if (ndr_get_array_length(ndr, &r->in.primary_name) > ndr_get_array_size(ndr, &r->in.primary_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.primary_name), ndr_get_array_length(ndr, &r->in.primary_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.primary_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.primary_name, ndr_get_array_length(ndr, &r->in.primary_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_primary_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); + if (_ptr_Account) { + NDR_PULL_ALLOC(ndr, r->in.Account); + } else { + r->in.Account = NULL; + } + if (r->in.Account) { + _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); + if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); + if (_ptr_EncryptedPassword) { + NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); + } else { + r->in.EncryptedPassword = NULL; + } + if (r->in.EncryptedPassword) { + _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); + NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Reserved)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrSetPrimaryComputername(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrSetPrimaryComputername *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrSetPrimaryComputername"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrSetPrimaryComputername"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "primary_name", r->in.primary_name); + ndr->depth++; + if (r->in.primary_name) { + ndr_print_string(ndr, "primary_name", r->in.primary_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "Account", r->in.Account); + ndr->depth++; + if (r->in.Account) { + ndr_print_string(ndr, "Account", r->in.Account); + } + ndr->depth--; + ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); + ndr->depth++; + if (r->in.EncryptedPassword) { + ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); + } + ndr->depth--; + ndr_print_uint32(ndr, "Reserved", r->in.Reserved); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrSetPrimaryComputername"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wkssvc_NetrEnumerateComputerNames(struct ndr_push *ndr, int flags, const struct wkssvc_NetrEnumerateComputerNames *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); + } + NDR_CHECK(ndr_push_wkssvc_ComputerNameType(ndr, NDR_SCALARS, r->in.name_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Reserved)); + } + if (flags & NDR_OUT) { + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); + if (*r->out.ctr) { + NDR_CHECK(ndr_push_wkssvc_ComputerNamesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wkssvc_NetrEnumerateComputerNames(struct ndr_pull *ndr, int flags, struct wkssvc_NetrEnumerateComputerNames *r) +{ + uint32_t _ptr_server_name; + uint32_t _ptr_ctr; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_ctr_0; + TALLOC_CTX *_mem_save_ctr_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_wkssvc_ComputerNameType(ndr, NDR_SCALARS, &r->in.name_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Reserved)); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); + if (_ptr_ctr) { + NDR_PULL_ALLOC(ndr, *r->out.ctr); + } else { + *r->out.ctr = NULL; + } + if (*r->out.ctr) { + _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); + NDR_CHECK(ndr_pull_wkssvc_ComputerNamesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wkssvc_NetrEnumerateComputerNames(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrEnumerateComputerNames *r) +{ + ndr_print_struct(ndr, name, "wkssvc_NetrEnumerateComputerNames"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wkssvc_NetrEnumerateComputerNames"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_wkssvc_ComputerNameType(ndr, "name_type", r->in.name_type); + ndr_print_uint32(ndr, "Reserved", r->in.Reserved); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wkssvc_NetrEnumerateComputerNames"); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", *r->out.ctr); + ndr->depth++; + if (*r->out.ctr) { + ndr_print_wkssvc_ComputerNamesCtr(ndr, "ctr", *r->out.ctr); + } + ndr->depth--; + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call wkssvc_calls[] = { + { + "wkssvc_NetWkstaGetInfo", + sizeof(struct wkssvc_NetWkstaGetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaGetInfo, + (ndr_print_function_t) ndr_print_wkssvc_NetWkstaGetInfo, + false, + }, + { + "wkssvc_NetWkstaSetInfo", + sizeof(struct wkssvc_NetWkstaSetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaSetInfo, + (ndr_print_function_t) ndr_print_wkssvc_NetWkstaSetInfo, + false, + }, + { + "wkssvc_NetWkstaEnumUsers", + sizeof(struct wkssvc_NetWkstaEnumUsers), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaEnumUsers, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaEnumUsers, + (ndr_print_function_t) ndr_print_wkssvc_NetWkstaEnumUsers, + false, + }, + { + "wkssvc_NetrWkstaUserGetInfo", + sizeof(struct wkssvc_NetrWkstaUserGetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaUserGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaUserGetInfo, + (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaUserGetInfo, + false, + }, + { + "wkssvc_NetrWkstaUserSetInfo", + sizeof(struct wkssvc_NetrWkstaUserSetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaUserSetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaUserSetInfo, + (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaUserSetInfo, + false, + }, + { + "wkssvc_NetWkstaTransportEnum", + sizeof(struct wkssvc_NetWkstaTransportEnum), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaTransportEnum, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaTransportEnum, + (ndr_print_function_t) ndr_print_wkssvc_NetWkstaTransportEnum, + false, + }, + { + "wkssvc_NetrWkstaTransportAdd", + sizeof(struct wkssvc_NetrWkstaTransportAdd), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaTransportAdd, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaTransportAdd, + (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaTransportAdd, + false, + }, + { + "wkssvc_NetrWkstaTransportDel", + sizeof(struct wkssvc_NetrWkstaTransportDel), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaTransportDel, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaTransportDel, + (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaTransportDel, + false, + }, + { + "wkssvc_NetrUseAdd", + sizeof(struct wkssvc_NetrUseAdd), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseAdd, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseAdd, + (ndr_print_function_t) ndr_print_wkssvc_NetrUseAdd, + false, + }, + { + "wkssvc_NetrUseGetInfo", + sizeof(struct wkssvc_NetrUseGetInfo), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseGetInfo, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseGetInfo, + (ndr_print_function_t) ndr_print_wkssvc_NetrUseGetInfo, + false, + }, + { + "wkssvc_NetrUseDel", + sizeof(struct wkssvc_NetrUseDel), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseDel, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseDel, + (ndr_print_function_t) ndr_print_wkssvc_NetrUseDel, + false, + }, + { + "wkssvc_NetrUseEnum", + sizeof(struct wkssvc_NetrUseEnum), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseEnum, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseEnum, + (ndr_print_function_t) ndr_print_wkssvc_NetrUseEnum, + false, + }, + { + "wkssvc_NetrMessageBufferSend", + sizeof(struct wkssvc_NetrMessageBufferSend), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrMessageBufferSend, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrMessageBufferSend, + (ndr_print_function_t) ndr_print_wkssvc_NetrMessageBufferSend, + false, + }, + { + "wkssvc_NetrWorkstationStatisticsGet", + sizeof(struct wkssvc_NetrWorkstationStatisticsGet), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWorkstationStatisticsGet, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWorkstationStatisticsGet, + (ndr_print_function_t) ndr_print_wkssvc_NetrWorkstationStatisticsGet, + false, + }, + { + "wkssvc_NetrLogonDomainNameAdd", + sizeof(struct wkssvc_NetrLogonDomainNameAdd), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrLogonDomainNameAdd, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrLogonDomainNameAdd, + (ndr_print_function_t) ndr_print_wkssvc_NetrLogonDomainNameAdd, + false, + }, + { + "wkssvc_NetrLogonDomainNameDel", + sizeof(struct wkssvc_NetrLogonDomainNameDel), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrLogonDomainNameDel, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrLogonDomainNameDel, + (ndr_print_function_t) ndr_print_wkssvc_NetrLogonDomainNameDel, + false, + }, + { + "wkssvc_NetrJoinDomain", + sizeof(struct wkssvc_NetrJoinDomain), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrJoinDomain, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrJoinDomain, + (ndr_print_function_t) ndr_print_wkssvc_NetrJoinDomain, + false, + }, + { + "wkssvc_NetrUnjoinDomain", + sizeof(struct wkssvc_NetrUnjoinDomain), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUnjoinDomain, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUnjoinDomain, + (ndr_print_function_t) ndr_print_wkssvc_NetrUnjoinDomain, + false, + }, + { + "wkssvc_NetrRenameMachineInDomain", + sizeof(struct wkssvc_NetrRenameMachineInDomain), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrRenameMachineInDomain, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrRenameMachineInDomain, + (ndr_print_function_t) ndr_print_wkssvc_NetrRenameMachineInDomain, + false, + }, + { + "wkssvc_NetrValidateName", + sizeof(struct wkssvc_NetrValidateName), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrValidateName, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrValidateName, + (ndr_print_function_t) ndr_print_wkssvc_NetrValidateName, + false, + }, + { + "wkssvc_NetrGetJoinInformation", + sizeof(struct wkssvc_NetrGetJoinInformation), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrGetJoinInformation, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrGetJoinInformation, + (ndr_print_function_t) ndr_print_wkssvc_NetrGetJoinInformation, + false, + }, + { + "wkssvc_NetrGetJoinableOus", + sizeof(struct wkssvc_NetrGetJoinableOus), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrGetJoinableOus, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrGetJoinableOus, + (ndr_print_function_t) ndr_print_wkssvc_NetrGetJoinableOus, + false, + }, + { + "wkssvc_NetrJoinDomain2", + sizeof(struct wkssvc_NetrJoinDomain2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrJoinDomain2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrJoinDomain2, + (ndr_print_function_t) ndr_print_wkssvc_NetrJoinDomain2, + false, + }, + { + "wkssvc_NetrUnjoinDomain2", + sizeof(struct wkssvc_NetrUnjoinDomain2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUnjoinDomain2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUnjoinDomain2, + (ndr_print_function_t) ndr_print_wkssvc_NetrUnjoinDomain2, + false, + }, + { + "wkssvc_NetrRenameMachineInDomain2", + sizeof(struct wkssvc_NetrRenameMachineInDomain2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrRenameMachineInDomain2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrRenameMachineInDomain2, + (ndr_print_function_t) ndr_print_wkssvc_NetrRenameMachineInDomain2, + false, + }, + { + "wkssvc_NetrValidateName2", + sizeof(struct wkssvc_NetrValidateName2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrValidateName2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrValidateName2, + (ndr_print_function_t) ndr_print_wkssvc_NetrValidateName2, + false, + }, + { + "wkssvc_NetrGetJoinableOus2", + sizeof(struct wkssvc_NetrGetJoinableOus2), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrGetJoinableOus2, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrGetJoinableOus2, + (ndr_print_function_t) ndr_print_wkssvc_NetrGetJoinableOus2, + false, + }, + { + "wkssvc_NetrAddAlternateComputerName", + sizeof(struct wkssvc_NetrAddAlternateComputerName), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrAddAlternateComputerName, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrAddAlternateComputerName, + (ndr_print_function_t) ndr_print_wkssvc_NetrAddAlternateComputerName, + false, + }, + { + "wkssvc_NetrRemoveAlternateComputerName", + sizeof(struct wkssvc_NetrRemoveAlternateComputerName), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrRemoveAlternateComputerName, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrRemoveAlternateComputerName, + (ndr_print_function_t) ndr_print_wkssvc_NetrRemoveAlternateComputerName, + false, + }, + { + "wkssvc_NetrSetPrimaryComputername", + sizeof(struct wkssvc_NetrSetPrimaryComputername), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrSetPrimaryComputername, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrSetPrimaryComputername, + (ndr_print_function_t) ndr_print_wkssvc_NetrSetPrimaryComputername, + false, + }, + { + "wkssvc_NetrEnumerateComputerNames", + sizeof(struct wkssvc_NetrEnumerateComputerNames), + (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrEnumerateComputerNames, + (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrEnumerateComputerNames, + (ndr_print_function_t) ndr_print_wkssvc_NetrEnumerateComputerNames, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const wkssvc_endpoint_strings[] = { + "ncacn_np:[\\pipe\\wkssvc]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array wkssvc_endpoints = { + .count = 3, + .names = wkssvc_endpoint_strings +}; + +static const char * const wkssvc_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array wkssvc_authservices = { + .count = 1, + .names = wkssvc_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_wkssvc = { + .name = "wkssvc", + .syntax_id = { + {0x6bffd098,0xa112,0x3610,{0x98,0x33},{0x46,0xc3,0xf8,0x7e,0x34,0x5a}}, + NDR_WKSSVC_VERSION + }, + .helpstring = NDR_WKSSVC_HELPSTRING, + .num_calls = 31, + .calls = wkssvc_calls, + .endpoints = &wkssvc_endpoints, + .authservices = &wkssvc_authservices +}; + diff --git a/librpc/gen_ndr/ndr_wkssvc.h b/librpc/gen_ndr/ndr_wkssvc.h new file mode 100644 index 0000000000..0fa4d3f8d4 --- /dev/null +++ b/librpc/gen_ndr/ndr_wkssvc.h @@ -0,0 +1,175 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/wkssvc.h" + +#ifndef _HEADER_NDR_wkssvc +#define _HEADER_NDR_wkssvc + +#define NDR_WKSSVC_UUID "6bffd098-a112-3610-9833-46c3f87e345a" +#define NDR_WKSSVC_VERSION 1.0 +#define NDR_WKSSVC_NAME "wkssvc" +#define NDR_WKSSVC_HELPSTRING "Workstation Service" +extern const struct ndr_interface_table ndr_table_wkssvc; +#define NDR_WKSSVC_NETWKSTAGETINFO (0x00) + +#define NDR_WKSSVC_NETWKSTASETINFO (0x01) + +#define NDR_WKSSVC_NETWKSTAENUMUSERS (0x02) + +#define NDR_WKSSVC_NETRWKSTAUSERGETINFO (0x03) + +#define NDR_WKSSVC_NETRWKSTAUSERSETINFO (0x04) + +#define NDR_WKSSVC_NETWKSTATRANSPORTENUM (0x05) + +#define NDR_WKSSVC_NETRWKSTATRANSPORTADD (0x06) + +#define NDR_WKSSVC_NETRWKSTATRANSPORTDEL (0x07) + +#define NDR_WKSSVC_NETRUSEADD (0x08) + +#define NDR_WKSSVC_NETRUSEGETINFO (0x09) + +#define NDR_WKSSVC_NETRUSEDEL (0x0a) + +#define NDR_WKSSVC_NETRUSEENUM (0x0b) + +#define NDR_WKSSVC_NETRMESSAGEBUFFERSEND (0x0c) + +#define NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET (0x0d) + +#define NDR_WKSSVC_NETRLOGONDOMAINNAMEADD (0x0e) + +#define NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL (0x0f) + +#define NDR_WKSSVC_NETRJOINDOMAIN (0x10) + +#define NDR_WKSSVC_NETRUNJOINDOMAIN (0x11) + +#define NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN (0x12) + +#define NDR_WKSSVC_NETRVALIDATENAME (0x13) + +#define NDR_WKSSVC_NETRGETJOININFORMATION (0x14) + +#define NDR_WKSSVC_NETRGETJOINABLEOUS (0x15) + +#define NDR_WKSSVC_NETRJOINDOMAIN2 (0x16) + +#define NDR_WKSSVC_NETRUNJOINDOMAIN2 (0x17) + +#define NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2 (0x18) + +#define NDR_WKSSVC_NETRVALIDATENAME2 (0x19) + +#define NDR_WKSSVC_NETRGETJOINABLEOUS2 (0x1a) + +#define NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME (0x1b) + +#define NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME (0x1c) + +#define NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME (0x1d) + +#define NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES (0x1e) + +#define NDR_WKSSVC_CALL_COUNT (31) +void ndr_print_wkssvc_NetWkstaInfo100(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo100 *r); +void ndr_print_wkssvc_NetWkstaInfo101(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo101 *r); +void ndr_print_wkssvc_NetWkstaInfo102(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo102 *r); +void ndr_print_wkssvc_NetWkstaInfo502(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo502 *r); +void ndr_print_wkssvc_NetWkstaInfo1010(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1010 *r); +void ndr_print_wkssvc_NetWkstaInfo1011(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1011 *r); +void ndr_print_wkssvc_NetWkstaInfo1012(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1012 *r); +void ndr_print_wkssvc_NetWkstaInfo1013(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1013 *r); +void ndr_print_wkssvc_NetWkstaInfo1018(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1018 *r); +void ndr_print_wkssvc_NetWkstaInfo1023(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1023 *r); +void ndr_print_wkssvc_NetWkstaInfo1027(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1027 *r); +void ndr_print_wkssvc_NetWkstaInfo1028(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1028 *r); +void ndr_print_wkssvc_NetWkstaInfo1032(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1032 *r); +void ndr_print_wkssvc_NetWkstaInfo1033(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1033 *r); +void ndr_print_wkssvc_NetWkstaInfo1041(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1041 *r); +void ndr_print_wkssvc_NetWkstaInfo1042(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1042 *r); +void ndr_print_wkssvc_NetWkstaInfo1043(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1043 *r); +void ndr_print_wkssvc_NetWkstaInfo1044(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1044 *r); +void ndr_print_wkssvc_NetWkstaInfo1045(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1045 *r); +void ndr_print_wkssvc_NetWkstaInfo1046(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1046 *r); +void ndr_print_wkssvc_NetWkstaInfo1047(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1047 *r); +void ndr_print_wkssvc_NetWkstaInfo1048(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1048 *r); +void ndr_print_wkssvc_NetWkstaInfo1049(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1049 *r); +void ndr_print_wkssvc_NetWkstaInfo1050(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1050 *r); +void ndr_print_wkssvc_NetWkstaInfo1051(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1051 *r); +void ndr_print_wkssvc_NetWkstaInfo1052(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1052 *r); +void ndr_print_wkssvc_NetWkstaInfo1053(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1053 *r); +void ndr_print_wkssvc_NetWkstaInfo1054(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1054 *r); +void ndr_print_wkssvc_NetWkstaInfo1055(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1055 *r); +void ndr_print_wkssvc_NetWkstaInfo1056(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1056 *r); +void ndr_print_wkssvc_NetWkstaInfo1057(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1057 *r); +void ndr_print_wkssvc_NetWkstaInfo1058(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1058 *r); +void ndr_print_wkssvc_NetWkstaInfo1059(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1059 *r); +void ndr_print_wkssvc_NetWkstaInfo1060(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1060 *r); +void ndr_print_wkssvc_NetWkstaInfo1061(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1061 *r); +void ndr_print_wkssvc_NetWkstaInfo1062(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1062 *r); +void ndr_print_wkssvc_NetWkstaInfo(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaInfo *r); +void ndr_print_wkssvc_NetrWkstaUserInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo0 *r); +void ndr_print_wkssvc_NetWkstaEnumUsersCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersCtr0 *r); +void ndr_print_wkssvc_NetrWkstaUserInfo1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo1 *r); +void ndr_print_wkssvc_NetWkstaEnumUsersCtr1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersCtr1 *r); +void ndr_print_wkssvc_NetWkstaEnumUsersCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaEnumUsersCtr *r); +void ndr_print_wkssvc_NetWkstaEnumUsersInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersInfo *r); +void ndr_print_wkssvc_NetrWkstaUserInfo1101(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo1101 *r); +void ndr_print_wkssvc_NetrWkstaUserInfo(struct ndr_print *ndr, const char *name, const union wkssvc_NetrWkstaUserInfo *r); +void ndr_print_wkssvc_NetWkstaTransportInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportInfo0 *r); +void ndr_print_wkssvc_NetWkstaTransportCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportCtr0 *r); +void ndr_print_wkssvc_NetWkstaTransportCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaTransportCtr *r); +void ndr_print_wkssvc_NetWkstaTransportInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportInfo *r); +void ndr_print_wkssvc_NetrUseInfo3(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo3 *r); +void ndr_print_wkssvc_NetrUseInfo2(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo2 *r); +void ndr_print_wkssvc_NetrUseInfo1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo1 *r); +void ndr_print_wkssvc_NetrUseInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo0 *r); +void ndr_print_wkssvc_NetrUseGetInfoCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetrUseGetInfoCtr *r); +void ndr_print_wkssvc_NetrUseEnumCtr2(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr2 *r); +void ndr_print_wkssvc_NetrUseEnumCtr1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr1 *r); +void ndr_print_wkssvc_NetrUseEnumCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr0 *r); +void ndr_print_wkssvc_NetrUseEnumCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetrUseEnumCtr *r); +void ndr_print_wkssvc_NetrUseEnumInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumInfo *r); +void ndr_print_wkssvc_NetrWorkstationStatistics(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWorkstationStatistics *r); +void ndr_print_wkssvc_renameflags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_wkssvc_NetValidateNameType(struct ndr_print *ndr, const char *name, enum wkssvc_NetValidateNameType r); +void ndr_print_wkssvc_NetJoinStatus(struct ndr_print *ndr, const char *name, enum wkssvc_NetJoinStatus r); +void ndr_print_wkssvc_PasswordBuffer(struct ndr_print *ndr, const char *name, const struct wkssvc_PasswordBuffer *r); +void ndr_print_wkssvc_joinflags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_wkssvc_ComputerNameType(struct ndr_print *ndr, const char *name, enum wkssvc_ComputerNameType r); +void ndr_print_wkssvc_ComputerNamesCtr(struct ndr_print *ndr, const char *name, const struct wkssvc_ComputerNamesCtr *r); +void ndr_print_wkssvc_NetWkstaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaGetInfo *r); +void ndr_print_wkssvc_NetWkstaSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaSetInfo *r); +void ndr_print_wkssvc_NetWkstaEnumUsers(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaEnumUsers *r); +void ndr_print_wkssvc_NetrWkstaUserGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaUserGetInfo *r); +void ndr_print_wkssvc_NetrWkstaUserSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaUserSetInfo *r); +void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaTransportEnum *r); +void ndr_print_wkssvc_NetrWkstaTransportAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaTransportAdd *r); +void ndr_print_wkssvc_NetrWkstaTransportDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaTransportDel *r); +void ndr_print_wkssvc_NetrUseAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseAdd *r); +void ndr_print_wkssvc_NetrUseGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseGetInfo *r); +void ndr_print_wkssvc_NetrUseDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseDel *r); +void ndr_print_wkssvc_NetrUseEnum(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseEnum *r); +void ndr_print_wkssvc_NetrMessageBufferSend(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrMessageBufferSend *r); +void ndr_print_wkssvc_NetrWorkstationStatisticsGet(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWorkstationStatisticsGet *r); +void ndr_print_wkssvc_NetrLogonDomainNameAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrLogonDomainNameAdd *r); +void ndr_print_wkssvc_NetrLogonDomainNameDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrLogonDomainNameDel *r); +void ndr_print_wkssvc_NetrJoinDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrJoinDomain *r); +void ndr_print_wkssvc_NetrUnjoinDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUnjoinDomain *r); +void ndr_print_wkssvc_NetrRenameMachineInDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRenameMachineInDomain *r); +void ndr_print_wkssvc_NetrValidateName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrValidateName *r); +void ndr_print_wkssvc_NetrGetJoinInformation(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinInformation *r); +void ndr_print_wkssvc_NetrGetJoinableOus(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus *r); +void ndr_print_wkssvc_NetrJoinDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrJoinDomain2 *r); +void ndr_print_wkssvc_NetrUnjoinDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUnjoinDomain2 *r); +void ndr_print_wkssvc_NetrRenameMachineInDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRenameMachineInDomain2 *r); +void ndr_print_wkssvc_NetrValidateName2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrValidateName2 *r); +void ndr_print_wkssvc_NetrGetJoinableOus2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus2 *r); +void ndr_print_wkssvc_NetrAddAlternateComputerName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrAddAlternateComputerName *r); +void ndr_print_wkssvc_NetrRemoveAlternateComputerName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRemoveAlternateComputerName *r); +void ndr_print_wkssvc_NetrSetPrimaryComputername(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrSetPrimaryComputername *r); +void ndr_print_wkssvc_NetrEnumerateComputerNames(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrEnumerateComputerNames *r); +#endif /* _HEADER_NDR_wkssvc */ diff --git a/librpc/gen_ndr/ndr_xattr.c b/librpc/gen_ndr/ndr_xattr.c new file mode 100644 index 0000000000..75781d763d --- /dev/null +++ b/librpc/gen_ndr/ndr_xattr.c @@ -0,0 +1,773 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_xattr.h" + +#include "librpc/gen_ndr/ndr_security.h" +static enum ndr_err_code ndr_push_xattr_DosInfo1(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_xattr_DosInfo1(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ea_size)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->create_time)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->change_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_DosInfo1(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo1 *r) +{ + ndr_print_struct(ndr, name, "xattr_DosInfo1"); + ndr->depth++; + ndr_print_uint32(ndr, "attrib", r->attrib); + ndr_print_uint32(ndr, "ea_size", r->ea_size); + ndr_print_udlong(ndr, "size", r->size); + ndr_print_udlong(ndr, "alloc_size", r->alloc_size); + ndr_print_NTTIME(ndr, "create_time", r->create_time); + ndr_print_NTTIME(ndr, "change_time", r->change_time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_xattr_DosInfo2Old(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo2Old *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->write_time)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_xattr_DosInfo2Old(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfo2Old *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ea_size)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->create_time)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->change_time)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->write_time)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_DosInfo2Old(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo2Old *r) +{ + ndr_print_struct(ndr, name, "xattr_DosInfo2Old"); + ndr->depth++; + ndr_print_uint32(ndr, "flags", r->flags); + ndr_print_uint32(ndr, "attrib", r->attrib); + ndr_print_uint32(ndr, "ea_size", r->ea_size); + ndr_print_udlong(ndr, "size", r->size); + ndr_print_udlong(ndr, "alloc_size", r->alloc_size); + ndr_print_NTTIME(ndr, "create_time", r->create_time); + ndr_print_NTTIME(ndr, "change_time", r->change_time); + ndr_print_NTTIME(ndr, "write_time", r->write_time); + ndr_print_string(ndr, "name", r->name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_xattr_DosInfo(struct ndr_push *ndr, int ndr_flags, const union xattr_DosInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_xattr_DosInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_xattr_DosInfo2Old(ndr, NDR_SCALARS, &r->oldinfo2)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + case 2: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_xattr_DosInfo(struct ndr_pull *ndr, int ndr_flags, union xattr_DosInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_xattr_DosInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_xattr_DosInfo2Old(ndr, NDR_SCALARS, &r->oldinfo2)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + case 2: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_DosInfo(struct ndr_print *ndr, const char *name, const union xattr_DosInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "xattr_DosInfo"); + switch (level) { + case 1: + ndr_print_xattr_DosInfo1(ndr, "info1", &r->info1); + break; + + case 2: + ndr_print_xattr_DosInfo2Old(ndr, "oldinfo2", &r->oldinfo2); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_xattr_DosAttrib(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosAttrib *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->version)); + NDR_CHECK(ndr_push_xattr_DosInfo(ndr, NDR_SCALARS, &r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosAttrib(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosAttrib *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->version)); + NDR_CHECK(ndr_pull_xattr_DosInfo(ndr, NDR_SCALARS, &r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_DosAttrib(struct ndr_print *ndr, const char *name, const struct xattr_DosAttrib *r) +{ + ndr_print_struct(ndr, name, "xattr_DosAttrib"); + ndr->depth++; + ndr_print_uint16(ndr, "version", r->version); + ndr_print_set_switch_value(ndr, &r->info, r->version); + ndr_print_xattr_DosInfo(ndr, "info", &r->info); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_xattr_EA(struct ndr_push *ndr, int ndr_flags, const struct xattr_EA *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->value)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_xattr_EA(struct ndr_pull *ndr, int ndr_flags, struct xattr_EA *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->value)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_EA(struct ndr_print *ndr, const char *name, const struct xattr_EA *r) +{ + ndr_print_struct(ndr, name, "xattr_EA"); + ndr->depth++; + ndr_print_string(ndr, "name", r->name); + ndr_print_DATA_BLOB(ndr, "value", r->value); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_xattr_DosEAs(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosEAs *r) +{ + uint32_t cntr_eas_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_eas)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->eas)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->eas) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_eas)); + for (cntr_eas_1 = 0; cntr_eas_1 < r->num_eas; cntr_eas_1++) { + NDR_CHECK(ndr_push_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosEAs(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosEAs *r) +{ + uint32_t _ptr_eas; + uint32_t cntr_eas_1; + TALLOC_CTX *_mem_save_eas_0; + TALLOC_CTX *_mem_save_eas_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_eas)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_eas)); + if (_ptr_eas) { + NDR_PULL_ALLOC(ndr, r->eas); + } else { + r->eas = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->eas) { + _mem_save_eas_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->eas)); + NDR_PULL_ALLOC_N(ndr, r->eas, ndr_get_array_size(ndr, &r->eas)); + _mem_save_eas_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0); + for (cntr_eas_1 = 0; cntr_eas_1 < r->num_eas; cntr_eas_1++) { + NDR_CHECK(ndr_pull_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_0, 0); + } + if (r->eas) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->eas, r->num_eas)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_DosEAs(struct ndr_print *ndr, const char *name, const struct xattr_DosEAs *r) +{ + uint32_t cntr_eas_1; + ndr_print_struct(ndr, name, "xattr_DosEAs"); + ndr->depth++; + ndr_print_uint16(ndr, "num_eas", r->num_eas); + ndr_print_ptr(ndr, "eas", r->eas); + ndr->depth++; + if (r->eas) { + ndr->print(ndr, "%s: ARRAY(%d)", "eas", (int)r->num_eas); + ndr->depth++; + for (cntr_eas_1=0;cntr_eas_1num_eas;cntr_eas_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_eas_1) != -1) { + ndr_print_xattr_EA(ndr, "eas", &r->eas[cntr_eas_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_tdb_xattrs(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattrs *r) +{ + uint32_t cntr_eas_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_eas)); + for (cntr_eas_0 = 0; cntr_eas_0 < r->num_eas; cntr_eas_0++) { + NDR_CHECK(ndr_push_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_tdb_xattrs(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattrs *r) +{ + uint32_t cntr_eas_0; + TALLOC_CTX *_mem_save_eas_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_eas)); + NDR_PULL_ALLOC_N(ndr, r->eas, r->num_eas); + _mem_save_eas_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0); + for (cntr_eas_0 = 0; cntr_eas_0 < r->num_eas; cntr_eas_0++) { + NDR_CHECK(ndr_pull_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, const struct tdb_xattrs *r) +{ + uint32_t cntr_eas_0; + ndr_print_struct(ndr, name, "tdb_xattrs"); + ndr->depth++; + ndr_print_uint32(ndr, "num_eas", r->num_eas); + ndr->print(ndr, "%s: ARRAY(%d)", "eas", (int)r->num_eas); + ndr->depth++; + for (cntr_eas_0=0;cntr_eas_0num_eas;cntr_eas_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_eas_0) != -1) { + ndr_print_xattr_EA(ndr, "eas", &r->eas[cntr_eas_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_xattr_DosStream(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStream *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_xattr_DosStream(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStream *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_DosStream(struct ndr_print *ndr, const char *name, const struct xattr_DosStream *r) +{ + ndr_print_struct(ndr, name, "xattr_DosStream"); + ndr->depth++; + ndr_print_uint32(ndr, "flags", r->flags); + ndr_print_udlong(ndr, "size", r->size); + ndr_print_udlong(ndr, "alloc_size", r->alloc_size); + ndr_print_string(ndr, "name", r->name); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_xattr_DosStreams(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStreams *r) +{ + uint32_t cntr_streams_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_streams)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->streams)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->streams) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_streams)); + for (cntr_streams_1 = 0; cntr_streams_1 < r->num_streams; cntr_streams_1++) { + NDR_CHECK(ndr_push_xattr_DosStream(ndr, NDR_SCALARS, &r->streams[cntr_streams_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosStreams(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStreams *r) +{ + uint32_t _ptr_streams; + uint32_t cntr_streams_1; + TALLOC_CTX *_mem_save_streams_0; + TALLOC_CTX *_mem_save_streams_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_streams)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_streams)); + if (_ptr_streams) { + NDR_PULL_ALLOC(ndr, r->streams); + } else { + r->streams = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->streams) { + _mem_save_streams_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->streams, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->streams)); + NDR_PULL_ALLOC_N(ndr, r->streams, ndr_get_array_size(ndr, &r->streams)); + _mem_save_streams_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->streams, 0); + for (cntr_streams_1 = 0; cntr_streams_1 < r->num_streams; cntr_streams_1++) { + NDR_CHECK(ndr_pull_xattr_DosStream(ndr, NDR_SCALARS, &r->streams[cntr_streams_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_streams_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_streams_0, 0); + } + if (r->streams) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->streams, r->num_streams)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_DosStreams(struct ndr_print *ndr, const char *name, const struct xattr_DosStreams *r) +{ + uint32_t cntr_streams_1; + ndr_print_struct(ndr, name, "xattr_DosStreams"); + ndr->depth++; + ndr_print_uint32(ndr, "num_streams", r->num_streams); + ndr_print_ptr(ndr, "streams", r->streams); + ndr->depth++; + if (r->streams) { + ndr->print(ndr, "%s: ARRAY(%d)", "streams", (int)r->num_streams); + ndr->depth++; + for (cntr_streams_1=0;cntr_streams_1num_streams;cntr_streams_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_streams_1) != -1) { + ndr_print_xattr_DosStream(ndr, "streams", &r->streams[cntr_streams_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_descriptor_hash(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor_hash *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sd) { + NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_descriptor_hash(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor_hash *r) +{ + uint32_t _ptr_sd; + TALLOC_CTX *_mem_save_sd_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd)); + if (_ptr_sd) { + NDR_PULL_ALLOC(ndr, r->sd); + } else { + r->sd = NULL; + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sd) { + _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0); + NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_descriptor_hash(struct ndr_print *ndr, const char *name, const struct security_descriptor_hash *r) +{ + ndr_print_struct(ndr, name, "security_descriptor_hash"); + ndr->depth++; + ndr_print_ptr(ndr, "sd", r->sd); + ndr->depth++; + if (r->sd) { + ndr_print_security_descriptor(ndr, "sd", r->sd); + } + ndr->depth--; + ndr_print_array_uint8(ndr, "hash", r->hash, 16); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_xattr_NTACL_Info(struct ndr_push *ndr, int ndr_flags, const union xattr_NTACL_Info *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd_hs)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + if (r->sd) { + NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd)); + } + break; + + case 2: + if (r->sd_hs) { + NDR_CHECK(ndr_push_security_descriptor_hash(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd_hs)); + } + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_xattr_NTACL_Info(struct ndr_pull *ndr, int ndr_flags, union xattr_NTACL_Info *r) +{ + int level; + uint16_t _level; + TALLOC_CTX *_mem_save_sd_0; + TALLOC_CTX *_mem_save_sd_hs_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + uint32_t _ptr_sd; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd)); + if (_ptr_sd) { + NDR_PULL_ALLOC(ndr, r->sd); + } else { + r->sd = NULL; + } + break; } + + case 2: { + uint32_t _ptr_sd_hs; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd_hs)); + if (_ptr_sd_hs) { + NDR_PULL_ALLOC(ndr, r->sd_hs); + } else { + r->sd_hs = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + if (r->sd) { + _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0); + NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0); + } + break; + + case 2: + if (r->sd_hs) { + _mem_save_sd_hs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sd_hs, 0); + NDR_CHECK(ndr_pull_security_descriptor_hash(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd_hs)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_hs_0, 0); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_NTACL_Info(struct ndr_print *ndr, const char *name, const union xattr_NTACL_Info *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "xattr_NTACL_Info"); + switch (level) { + case 1: + ndr_print_ptr(ndr, "sd", r->sd); + ndr->depth++; + if (r->sd) { + ndr_print_security_descriptor(ndr, "sd", r->sd); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "sd_hs", r->sd_hs); + ndr->depth++; + if (r->sd_hs) { + ndr_print_security_descriptor_hash(ndr, "sd_hs", r->sd_hs); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_xattr_NTACL(struct ndr_push *ndr, int ndr_flags, const struct xattr_NTACL *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->version)); + NDR_CHECK(ndr_push_xattr_NTACL_Info(ndr, NDR_SCALARS, &r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_xattr_NTACL_Info(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_xattr_NTACL(struct ndr_pull *ndr, int ndr_flags, struct xattr_NTACL *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->version)); + NDR_CHECK(ndr_pull_xattr_NTACL_Info(ndr, NDR_SCALARS, &r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_xattr_NTACL_Info(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_xattr_NTACL(struct ndr_print *ndr, const char *name, const struct xattr_NTACL *r) +{ + ndr_print_struct(ndr, name, "xattr_NTACL"); + ndr->depth++; + ndr_print_uint16(ndr, "version", r->version); + ndr_print_set_switch_value(ndr, &r->info, r->version); + ndr_print_xattr_NTACL_Info(ndr, "info", &r->info); + ndr->depth--; +} + diff --git a/librpc/gen_ndr/ndr_xattr.h b/librpc/gen_ndr/ndr_xattr.h new file mode 100644 index 0000000000..c565e8513a --- /dev/null +++ b/librpc/gen_ndr/ndr_xattr.h @@ -0,0 +1,34 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/xattr.h" + +#ifndef _HEADER_NDR_xattr +#define _HEADER_NDR_xattr + +#define NDR_XATTR_CALL_COUNT (0) +void ndr_print_xattr_DosInfo1(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo1 *r); +void ndr_print_xattr_DosInfo2Old(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo2Old *r); +void ndr_print_xattr_DosInfo(struct ndr_print *ndr, const char *name, const union xattr_DosInfo *r); +enum ndr_err_code ndr_push_xattr_DosAttrib(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosAttrib *r); +enum ndr_err_code ndr_pull_xattr_DosAttrib(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosAttrib *r); +void ndr_print_xattr_DosAttrib(struct ndr_print *ndr, const char *name, const struct xattr_DosAttrib *r); +void ndr_print_xattr_EA(struct ndr_print *ndr, const char *name, const struct xattr_EA *r); +enum ndr_err_code ndr_push_xattr_DosEAs(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosEAs *r); +enum ndr_err_code ndr_pull_xattr_DosEAs(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosEAs *r); +void ndr_print_xattr_DosEAs(struct ndr_print *ndr, const char *name, const struct xattr_DosEAs *r); +enum ndr_err_code ndr_push_tdb_xattrs(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattrs *r); +enum ndr_err_code ndr_pull_tdb_xattrs(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattrs *r); +void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, const struct tdb_xattrs *r); +void ndr_print_xattr_DosStream(struct ndr_print *ndr, const char *name, const struct xattr_DosStream *r); +enum ndr_err_code ndr_push_xattr_DosStreams(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStreams *r); +enum ndr_err_code ndr_pull_xattr_DosStreams(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStreams *r); +void ndr_print_xattr_DosStreams(struct ndr_print *ndr, const char *name, const struct xattr_DosStreams *r); +enum ndr_err_code ndr_push_security_descriptor_hash(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor_hash *r); +enum ndr_err_code ndr_pull_security_descriptor_hash(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor_hash *r); +void ndr_print_security_descriptor_hash(struct ndr_print *ndr, const char *name, const struct security_descriptor_hash *r); +void ndr_print_xattr_NTACL_Info(struct ndr_print *ndr, const char *name, const union xattr_NTACL_Info *r); +enum ndr_err_code ndr_push_xattr_NTACL(struct ndr_push *ndr, int ndr_flags, const struct xattr_NTACL *r); +enum ndr_err_code ndr_pull_xattr_NTACL(struct ndr_pull *ndr, int ndr_flags, struct xattr_NTACL *r); +void ndr_print_xattr_NTACL(struct ndr_print *ndr, const char *name, const struct xattr_NTACL *r); +#endif /* _HEADER_NDR_xattr */ diff --git a/librpc/gen_ndr/netlogon.h b/librpc/gen_ndr/netlogon.h new file mode 100644 index 0000000000..7fb253446a --- /dev/null +++ b/librpc/gen_ndr/netlogon.h @@ -0,0 +1,1735 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/lsa.h" +#include "librpc/gen_ndr/samr.h" +#include "librpc/gen_ndr/security.h" +#include "librpc/gen_ndr/nbt.h" +#define netr_DeltaEnum8Bit netr_DeltaEnum +#define netr_SamDatabaseID8Bit netr_SamDatabaseID +#ifndef _HEADER_netlogon +#define _HEADER_netlogon + +#define DSGETDC_VALID_FLAGS ( (DS_FORCE_REDISCOVERY|DS_DIRECTORY_SERVICE_REQUIRED|DS_DIRECTORY_SERVICE_PREFERRED|DS_GC_SERVER_REQUIRED|DS_PDC_REQUIRED|DS_BACKGROUND_ONLY|DS_IP_REQUIRED|DS_KDC_REQUIRED|DS_TIMESERV_REQUIRED|DS_WRITABLE_REQUIRED|DS_GOOD_TIMESERV_PREFERRED|DS_AVOID_SELF|DS_ONLY_LDAP_NEEDED|DS_IS_FLAT_NAME|DS_IS_DNS_NAME|DS_RETURN_FLAT_NAME|DS_RETURN_DNS_NAME) ) +#define DS_GFTI_UPDATE_TDO ( 0x1 ) +enum netr_DeltaEnum8Bit; + +enum netr_SamDatabaseID8Bit; + +struct netr_UasInfo { + const char *account_name;/* [unique,charset(UTF16)] */ + uint32_t priv; + uint32_t auth_flags; + uint32_t logon_count; + uint32_t bad_pw_count; + time_t last_logon; + time_t last_logoff; + time_t logoff_time; + time_t kickoff_time; + uint32_t password_age; + time_t pw_can_change; + time_t pw_must_change; + const char *computer;/* [unique,charset(UTF16)] */ + const char *domain;/* [unique,charset(UTF16)] */ + const char *script_path;/* [unique,charset(UTF16)] */ + uint32_t unknown; +}; + +struct netr_UasLogoffInfo { + uint32_t duration; + uint16_t logon_count; +}; + +struct netr_AcctLockStr { + int64_t lockout_duration; + uint64_t reset_count; + uint32_t bad_attempt_lockout; + uint32_t dummy; +}/* [public] */; + +/* bitmap netr_LogonParameterControl */ +#define MSV1_0_CLEARTEXT_PASSWORD_ALLOWED ( 0x00000002 ) +#define MSV1_0_UPDATE_LOGON_STATISTICS ( 0x00000004 ) +#define MSV1_0_RETURN_USER_PARAMETERS ( 0x00000008 ) +#define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT ( 0x00000020 ) +#define MSV1_0_RETURN_PROFILE_PATH ( 0x00000200 ) +#define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT ( 0x00000800 ) + +struct netr_IdentityInfo { + struct lsa_String domain_name; + uint32_t parameter_control; + uint32_t logon_id_low; + uint32_t logon_id_high; + struct lsa_String account_name; + struct lsa_String workstation; +}; + +struct netr_PasswordInfo { + struct netr_IdentityInfo identity_info; + struct samr_Password lmpassword; + struct samr_Password ntpassword; +}; + +struct netr_ChallengeResponse { + uint16_t length; + uint16_t size;/* [value(length)] */ + uint8_t *data;/* [unique,length_is(length),size_is(length)] */ +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct netr_NetworkInfo { + struct netr_IdentityInfo identity_info; + uint8_t challenge[8]; + struct netr_ChallengeResponse nt; + struct netr_ChallengeResponse lm; +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct netr_GenericInfo { + struct netr_IdentityInfo identity_info; + struct lsa_String package_name; + uint32_t length; + uint8_t *data;/* [unique,size_is(length)] */ +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +enum netr_LogonInfoClass +#ifndef USE_UINT_ENUMS + { + NetlogonInteractiveInformation=1, + NetlogonNetworkInformation=2, + NetlogonServiceInformation=3, + NetlogonGenericInformation=4, + NetlogonInteractiveTransitiveInformation=5, + NetlogonNetworkTransitiveInformation=6, + NetlogonServiceTransitiveInformation=7 +} +#else + { __donnot_use_enum_netr_LogonInfoClass=0x7FFFFFFF} +#define NetlogonInteractiveInformation ( 1 ) +#define NetlogonNetworkInformation ( 2 ) +#define NetlogonServiceInformation ( 3 ) +#define NetlogonGenericInformation ( 4 ) +#define NetlogonInteractiveTransitiveInformation ( 5 ) +#define NetlogonNetworkTransitiveInformation ( 6 ) +#define NetlogonServiceTransitiveInformation ( 7 ) +#endif +; + +union netr_LogonLevel { + struct netr_PasswordInfo *password;/* [unique,case(NetlogonInteractiveInformation)] */ + struct netr_NetworkInfo *network;/* [unique,case(NetlogonNetworkInformation)] */ + struct netr_GenericInfo *generic;/* [unique,case(NetlogonGenericInformation)] */ +}/* [public,switch_type(netr_LogonInfoClass)] */; + +struct netr_UserSessionKey { + uint8_t key[16]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct netr_LMSessionKey { + uint8_t key[8]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +/* bitmap netr_UserFlags */ +#define NETLOGON_GUEST ( 0x00000001 ) +#define NETLOGON_NOENCRYPTION ( 0x00000002 ) +#define NETLOGON_CACHED_ACCOUNT ( 0x00000004 ) +#define NETLOGON_USED_LM_PASSWORD ( 0x00000008 ) +#define NETLOGON_EXTRA_SIDS ( 0x00000020 ) +#define NETLOGON_SUBAUTH_SESSION_KEY ( 0x00000040 ) +#define NETLOGON_SERVER_TRUST_ACCOUNT ( 0x00000080 ) +#define NETLOGON_NTLMV2_ENABLED ( 0x00000100 ) +#define NETLOGON_RESOURCE_GROUPS ( 0x00000200 ) +#define NETLOGON_PROFILE_PATH_RETURNED ( 0x00000400 ) +#define NETLOGON_GRACE_LOGON ( 0x01000000 ) + +struct netr_SamBaseInfo { + NTTIME last_logon; + NTTIME last_logoff; + NTTIME acct_expiry; + NTTIME last_password_change; + NTTIME allow_password_change; + NTTIME force_password_change; + struct lsa_String account_name; + struct lsa_String full_name; + struct lsa_String logon_script; + struct lsa_String profile_path; + struct lsa_String home_directory; + struct lsa_String home_drive; + uint16_t logon_count; + uint16_t bad_password_count; + uint32_t rid; + uint32_t primary_gid; + struct samr_RidWithAttributeArray groups; + uint32_t user_flags; + struct netr_UserSessionKey key; + struct lsa_StringLarge logon_server; + struct lsa_StringLarge domain; + struct dom_sid2 *domain_sid;/* [unique] */ + struct netr_LMSessionKey LMSessKey; + uint32_t acct_flags; + uint32_t unknown[7]; +}; + +struct netr_SamInfo2 { + struct netr_SamBaseInfo base; +}; + +struct netr_SidAttr { + struct dom_sid2 *sid;/* [unique] */ + uint32_t attributes; +}; + +struct netr_SamInfo3 { + struct netr_SamBaseInfo base; + uint32_t sidcount; + struct netr_SidAttr *sids;/* [unique,size_is(sidcount)] */ +}/* [public] */; + +struct netr_SamInfo6 { + struct netr_SamBaseInfo base; + uint32_t sidcount; + struct netr_SidAttr *sids;/* [unique,size_is(sidcount)] */ + struct lsa_String forest; + struct lsa_String principle; + uint32_t unknown4[20]; +}; + +struct netr_PacInfo { + uint32_t pac_size; + uint8_t *pac;/* [unique,size_is(pac_size)] */ + struct lsa_String logon_domain; + struct lsa_String logon_server; + struct lsa_String principal_name; + uint32_t auth_size; + uint8_t *auth;/* [unique,size_is(auth_size)] */ + struct netr_UserSessionKey user_session_key; + uint32_t expansionroom[10]; + struct lsa_String unknown1; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; +}; + +struct netr_GenericInfo2 { + uint32_t length; + uint8_t *data;/* [unique,size_is(length)] */ +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +enum netr_ValidationInfoClass +#ifndef USE_UINT_ENUMS + { + NetlogonValidationUasInfo=1, + NetlogonValidationSamInfo=2, + NetlogonValidationSamInfo2=3, + NetlogonValidationGenericInfo2=5, + NetlogonValidationSamInfo4=6 +} +#else + { __donnot_use_enum_netr_ValidationInfoClass=0x7FFFFFFF} +#define NetlogonValidationUasInfo ( 1 ) +#define NetlogonValidationSamInfo ( 2 ) +#define NetlogonValidationSamInfo2 ( 3 ) +#define NetlogonValidationGenericInfo2 ( 5 ) +#define NetlogonValidationSamInfo4 ( 6 ) +#endif +; + +union netr_Validation { + struct netr_SamInfo2 *sam2;/* [unique,case(NetlogonValidationSamInfo)] */ + struct netr_SamInfo3 *sam3;/* [unique,case(NetlogonValidationSamInfo2)] */ + struct netr_PacInfo *pac;/* [unique,case(4)] */ + struct netr_GenericInfo2 *generic;/* [unique,case(NetlogonValidationGenericInfo2)] */ + struct netr_SamInfo6 *sam6;/* [unique,case(NetlogonValidationSamInfo4)] */ +}/* [public,switch_type(uint16)] */; + +struct netr_Credential { + uint8_t data[8]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct netr_Authenticator { + struct netr_Credential cred; + time_t timestamp; +}/* [public] */; + +enum netr_SchannelType; + +enum netr_SamDatabaseID; + +struct netr_DELTA_DELETE_USER { + const char *account_name;/* [unique,charset(UTF16)] */ + struct lsa_String unknown1; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t unknown5; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +struct netr_USER_KEY16 { + uint16_t length; + uint16_t size;/* [value(length)] */ + uint32_t flags; + struct samr_Password pwd; +}; + +struct netr_PasswordHistory { + uint16_t nt_length; + uint16_t nt_size;/* [value(nt_length)] */ + uint32_t nt_flags; + uint16_t lm_length; + uint16_t lm_size;/* [value(lm_length)] */ + uint32_t lm_flags; + uint8_t *nt_history; + uint8_t *lm_history; +}; + +struct netr_USER_KEYS2 { + struct netr_USER_KEY16 lmpassword; + struct netr_USER_KEY16 ntpassword; + struct netr_PasswordHistory history; +}; + +struct netr_USER_KEY_UNION { + struct netr_USER_KEYS2 keys2; +}; + +struct netr_USER_KEYS { + uint32_t version; + struct netr_USER_KEY_UNION keys; +}/* [public] */; + +struct netr_USER_PRIVATE_INFO { + uint8_t SensitiveDataFlag; + uint32_t DataLength; + uint8_t *SensitiveData;/* [unique,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(DataLength)] */ +}; + +struct netr_DELTA_USER { + struct lsa_String account_name; + struct lsa_String full_name; + uint32_t rid; + uint32_t primary_gid; + struct lsa_String home_directory; + struct lsa_String home_drive; + struct lsa_String logon_script; + struct lsa_String description; + struct lsa_String workstations; + NTTIME last_logon; + NTTIME last_logoff; + struct samr_LogonHours logon_hours; + uint16_t bad_password_count; + uint16_t logon_count; + NTTIME last_password_change; + NTTIME acct_expiry; + uint32_t acct_flags; + struct samr_Password lmpassword; + struct samr_Password ntpassword; + uint8_t nt_password_present; + uint8_t lm_password_present; + uint8_t password_expired; + struct lsa_String comment; + struct lsa_BinaryString parameters; + uint16_t country_code; + uint16_t code_page; + struct netr_USER_PRIVATE_INFO user_private_info; + uint32_t SecurityInformation; + struct sec_desc_buf sdbuf; + struct lsa_String profile_path; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t unknown5; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +struct netr_DELTA_DOMAIN { + struct lsa_String domain_name; + struct lsa_String oem_information; + int64_t force_logoff_time; + uint16_t min_password_length; + uint16_t password_history_length; + int64_t max_password_age; + int64_t min_password_age; + uint64_t sequence_num; + NTTIME domain_create_time; + uint32_t SecurityInformation; + struct sec_desc_buf sdbuf; + struct lsa_BinaryString account_lockout; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t logon_to_chgpass; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +struct netr_DELTA_GROUP { + struct lsa_String group_name; + uint32_t rid; + uint32_t attributes; + struct lsa_String description; + uint32_t SecurityInformation; + struct sec_desc_buf sdbuf; + struct lsa_String unknown1; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t unknown5; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +struct netr_DELTA_RENAME { + struct lsa_String OldName; + struct lsa_String NewName; + struct lsa_String unknown1; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t unknown5; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +struct netr_DELTA_GROUP_MEMBER { + uint32_t *rids;/* [unique,size_is(num_rids)] */ + uint32_t *attribs;/* [unique,size_is(num_rids)] */ + uint32_t num_rids; + uint32_t unknown1; + uint32_t unknown2; + uint32_t unknown3; + uint32_t unknown4; +}; + +struct netr_DELTA_ALIAS { + struct lsa_String alias_name; + uint32_t rid; + uint32_t SecurityInformation; + struct sec_desc_buf sdbuf; + struct lsa_String description; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t unknown5; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +struct netr_DELTA_ALIAS_MEMBER { + struct lsa_SidArray sids; + uint32_t unknown1; + uint32_t unknown2; + uint32_t unknown3; + uint32_t unknown4; +}; + +struct netr_QUOTA_LIMITS { + uint32_t pagedpoollimit; + uint32_t nonpagedpoollimit; + uint32_t minimumworkingsetsize; + uint32_t maximumworkingsetsize; + uint32_t pagefilelimit; + NTTIME timelimit; +}; + +struct netr_DELTA_POLICY { + uint32_t maxlogsize; + NTTIME auditretentionperiod; + uint8_t auditingmode; + uint32_t maxauditeventcount; + uint32_t *eventauditoptions;/* [unique,size_is(maxauditeventcount+1)] */ + struct lsa_String primary_domain_name; + struct dom_sid2 *sid;/* [unique] */ + struct netr_QUOTA_LIMITS quota_limits; + uint64_t sequence_num; + NTTIME db_create_time; + uint32_t SecurityInformation; + struct sec_desc_buf sdbuf; + struct lsa_String unknown1; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t unknown5; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +struct netr_DELTA_TRUSTED_DOMAIN { + struct lsa_String domain_name; + uint32_t num_controllers; + struct lsa_String *controller_names;/* [unique,size_is(num_controllers)] */ + uint32_t SecurityInformation; + struct sec_desc_buf sdbuf; + struct lsa_String unknown1; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t posix_offset; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +struct netr_DELTA_DELETE_TRUST { + uint16_t unknown; +}; + +struct netr_DELTA_ACCOUNT { + uint32_t privilege_entries; + uint32_t privilege_control; + uint32_t *privilege_attrib;/* [unique,size_is(privilege_entries)] */ + struct lsa_String *privilege_name;/* [unique,size_is(privilege_entries)] */ + struct netr_QUOTA_LIMITS quotalimits; + uint32_t system_flags; + uint32_t SecurityInformation; + struct sec_desc_buf sdbuf; + struct lsa_String unknown1; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t unknown5; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +struct netr_DELTA_DELETE_ACCOUNT { + uint16_t unknown; +}; + +struct netr_DELTA_DELETE_SECRET { + uint16_t unknown; +}; + +struct netr_CIPHER_VALUE { + uint32_t len; + uint32_t maxlen; + uint8_t *cipher_data;/* [unique,length_is(len),size_is(maxlen)] */ +}; + +struct netr_DELTA_SECRET { + struct netr_CIPHER_VALUE current_cipher; + NTTIME current_cipher_set_time; + struct netr_CIPHER_VALUE old_cipher; + NTTIME old_cipher_set_time; + uint32_t SecurityInformation; + struct sec_desc_buf sdbuf; + struct lsa_String unknown1; + struct lsa_String unknown2; + struct lsa_String unknown3; + struct lsa_String unknown4; + uint32_t unknown5; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; +}; + +enum netr_DeltaEnum +#ifndef USE_UINT_ENUMS + { + NETR_DELTA_DOMAIN=1, + NETR_DELTA_GROUP=2, + NETR_DELTA_DELETE_GROUP=3, + NETR_DELTA_RENAME_GROUP=4, + NETR_DELTA_USER=5, + NETR_DELTA_DELETE_USER=6, + NETR_DELTA_RENAME_USER=7, + NETR_DELTA_GROUP_MEMBER=8, + NETR_DELTA_ALIAS=9, + NETR_DELTA_DELETE_ALIAS=10, + NETR_DELTA_RENAME_ALIAS=11, + NETR_DELTA_ALIAS_MEMBER=12, + NETR_DELTA_POLICY=13, + NETR_DELTA_TRUSTED_DOMAIN=14, + NETR_DELTA_DELETE_TRUST=15, + NETR_DELTA_ACCOUNT=16, + NETR_DELTA_DELETE_ACCOUNT=17, + NETR_DELTA_SECRET=18, + NETR_DELTA_DELETE_SECRET=19, + NETR_DELTA_DELETE_GROUP2=20, + NETR_DELTA_DELETE_USER2=21, + NETR_DELTA_MODIFY_COUNT=22 +} +#else + { __donnot_use_enum_netr_DeltaEnum=0x7FFFFFFF} +#define NETR_DELTA_DOMAIN ( 1 ) +#define NETR_DELTA_GROUP ( 2 ) +#define NETR_DELTA_DELETE_GROUP ( 3 ) +#define NETR_DELTA_RENAME_GROUP ( 4 ) +#define NETR_DELTA_USER ( 5 ) +#define NETR_DELTA_DELETE_USER ( 6 ) +#define NETR_DELTA_RENAME_USER ( 7 ) +#define NETR_DELTA_GROUP_MEMBER ( 8 ) +#define NETR_DELTA_ALIAS ( 9 ) +#define NETR_DELTA_DELETE_ALIAS ( 10 ) +#define NETR_DELTA_RENAME_ALIAS ( 11 ) +#define NETR_DELTA_ALIAS_MEMBER ( 12 ) +#define NETR_DELTA_POLICY ( 13 ) +#define NETR_DELTA_TRUSTED_DOMAIN ( 14 ) +#define NETR_DELTA_DELETE_TRUST ( 15 ) +#define NETR_DELTA_ACCOUNT ( 16 ) +#define NETR_DELTA_DELETE_ACCOUNT ( 17 ) +#define NETR_DELTA_SECRET ( 18 ) +#define NETR_DELTA_DELETE_SECRET ( 19 ) +#define NETR_DELTA_DELETE_GROUP2 ( 20 ) +#define NETR_DELTA_DELETE_USER2 ( 21 ) +#define NETR_DELTA_MODIFY_COUNT ( 22 ) +#endif +; + +union netr_DELTA_UNION { + struct netr_DELTA_DOMAIN *domain;/* [unique,case(NETR_DELTA_DOMAIN)] */ + struct netr_DELTA_GROUP *group;/* [unique,case(NETR_DELTA_GROUP)] */ + struct netr_DELTA_RENAME *rename_group;/* [unique,case(NETR_DELTA_RENAME_GROUP)] */ + struct netr_DELTA_USER *user;/* [unique,case(NETR_DELTA_USER)] */ + struct netr_DELTA_RENAME *rename_user;/* [unique,case(NETR_DELTA_RENAME_USER)] */ + struct netr_DELTA_GROUP_MEMBER *group_member;/* [unique,case(NETR_DELTA_GROUP_MEMBER)] */ + struct netr_DELTA_ALIAS *alias;/* [unique,case(NETR_DELTA_ALIAS)] */ + struct netr_DELTA_RENAME *rename_alias;/* [unique,case(NETR_DELTA_RENAME_ALIAS)] */ + struct netr_DELTA_ALIAS_MEMBER *alias_member;/* [unique,case(NETR_DELTA_ALIAS_MEMBER)] */ + struct netr_DELTA_POLICY *policy;/* [unique,case(NETR_DELTA_POLICY)] */ + struct netr_DELTA_TRUSTED_DOMAIN *trusted_domain;/* [unique,case(NETR_DELTA_TRUSTED_DOMAIN)] */ + struct netr_DELTA_DELETE_TRUST delete_trust;/* [case(NETR_DELTA_DELETE_TRUST)] */ + struct netr_DELTA_ACCOUNT *account;/* [unique,case(NETR_DELTA_ACCOUNT)] */ + struct netr_DELTA_DELETE_ACCOUNT delete_account;/* [case(NETR_DELTA_DELETE_ACCOUNT)] */ + struct netr_DELTA_SECRET *secret;/* [unique,case(NETR_DELTA_SECRET)] */ + struct netr_DELTA_DELETE_SECRET delete_secret;/* [case(NETR_DELTA_DELETE_SECRET)] */ + struct netr_DELTA_DELETE_USER *delete_group;/* [unique,case(NETR_DELTA_DELETE_GROUP2)] */ + struct netr_DELTA_DELETE_USER *delete_user;/* [unique,case(NETR_DELTA_DELETE_USER2)] */ + uint64_t *modified_count;/* [unique,case(NETR_DELTA_MODIFY_COUNT)] */ +}/* [switch_type(netr_DeltaEnum)] */; + +union netr_DELTA_ID_UNION { + uint32_t rid;/* [case(NETR_DELTA_DOMAIN)] */ + struct dom_sid2 *sid;/* [unique,case(NETR_DELTA_POLICY)] */ + const char *name;/* [unique,charset(UTF16),case(NETR_DELTA_SECRET)] */ +}/* [switch_type(netr_DeltaEnum)] */; + +struct netr_DELTA_ENUM { + enum netr_DeltaEnum delta_type; + union netr_DELTA_ID_UNION delta_id_union;/* [switch_is(delta_type)] */ + union netr_DELTA_UNION delta_union;/* [switch_is(delta_type)] */ +}; + +struct netr_DELTA_ENUM_ARRAY { + uint32_t num_deltas; + struct netr_DELTA_ENUM *delta_enum;/* [unique,size_is(num_deltas)] */ +}; + +struct netr_UAS_INFO_0 { + uint8_t computer_name[16]; + uint32_t timecreated; + uint32_t serial_number; +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct netr_AccountBuffer { + DATA_BLOB blob;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}; + +/* bitmap netr_InfoFlags */ +#define NETLOGON_CTRL_REPL_NEEDED ( 0x0001 ) +#define NETLOGON_CTRL_REPL_IN_PROGRESS ( 0x0002 ) +#define NETLOGON_CTRL_REPL_FULL_SYNC ( 0x0004 ) + +struct netr_NETLOGON_INFO_1 { + uint32_t flags; + uint32_t pdc_connection_status; +}; + +struct netr_NETLOGON_INFO_2 { + uint32_t flags; + uint32_t pdc_connection_status; + const char *trusted_dc_name;/* [unique,charset(UTF16)] */ + uint32_t tc_connection_status; +}; + +struct netr_NETLOGON_INFO_3 { + uint32_t flags; + uint32_t logon_attempts; + uint32_t unknown1; + uint32_t unknown2; + uint32_t unknown3; + uint32_t unknown4; + uint32_t unknown5; +}; + +union netr_CONTROL_QUERY_INFORMATION { + struct netr_NETLOGON_INFO_1 *info1;/* [unique,case] */ + struct netr_NETLOGON_INFO_2 *info2;/* [unique,case(2)] */ + struct netr_NETLOGON_INFO_3 *info3;/* [unique,case(3)] */ +}; + +enum netr_LogonControlCode +#ifndef USE_UINT_ENUMS + { + NETLOGON_CONTROL_SYNC=2, + NETLOGON_CONTROL_REDISCOVER=5, + NETLOGON_CONTROL_TC_QUERY=6, + NETLOGON_CONTROL_TRANSPORT_NOTIFY=7, + NETLOGON_CONTROL_SET_DBFLAG=65534 +} +#else + { __donnot_use_enum_netr_LogonControlCode=0x7FFFFFFF} +#define NETLOGON_CONTROL_SYNC ( 2 ) +#define NETLOGON_CONTROL_REDISCOVER ( 5 ) +#define NETLOGON_CONTROL_TC_QUERY ( 6 ) +#define NETLOGON_CONTROL_TRANSPORT_NOTIFY ( 7 ) +#define NETLOGON_CONTROL_SET_DBFLAG ( 65534 ) +#endif +; + +union netr_CONTROL_DATA_INFORMATION { + const char *domain;/* [unique,charset(UTF16),case(NETLOGON_CONTROL_REDISCOVER)] */ + uint32_t debug_level;/* [case(NETLOGON_CONTROL_SET_DBFLAG)] */ +}; + +/* bitmap netr_NegotiateFlags */ +#define NETLOGON_NEG_ACCOUNT_LOCKOUT ( 0x00000001 ) +#define NETLOGON_NEG_PERSISTENT_SAMREPL ( 0x00000002 ) +#define NETLOGON_NEG_ARCFOUR ( 0x00000004 ) +#define NETLOGON_NEG_PROMOTION_COUNT ( 0x00000008 ) +#define NETLOGON_NEG_CHANGELOG_BDC ( 0x00000010 ) +#define NETLOGON_NEG_FULL_SYNC_REPL ( 0x00000020 ) +#define NETLOGON_NEG_MULTIPLE_SIDS ( 0x00000040 ) +#define NETLOGON_NEG_REDO ( 0x00000080 ) +#define NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL ( 0x00000100 ) +#define NETLOGON_NEG_SEND_PASSWORD_INFO_PDC ( 0x00000200 ) +#define NETLOGON_NEG_GENERIC_PASSTHROUGH ( 0x00000400 ) +#define NETLOGON_NEG_CONCURRENT_RPC ( 0x00000800 ) +#define NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL ( 0x00001000 ) +#define NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL ( 0x00002000 ) +#define NETLOGON_NEG_128BIT ( 0x00004000 ) +#define NETLOGON_NEG_TRANSITIVE_TRUSTS ( 0x00008000 ) +#define NETLOGON_NEG_DNS_DOMAIN_TRUSTS ( 0x00010000 ) +#define NETLOGON_NEG_PASSWORD_SET2 ( 0x00020000 ) +#define NETLOGON_NEG_GETDOMAININFO ( 0x00040000 ) +#define NETLOGON_NEG_CROSS_FOREST_TRUSTS ( 0x00080000 ) +#define NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION ( 0x00100000 ) +#define NETLOGON_NEG_RODC_PASSTHROUGH ( 0x00200000 ) +#define NETLOGON_NEG_AUTHENTICATED_RPC_LSASS ( 0x20000000 ) +#define NETLOGON_NEG_SCHANNEL ( 0x40000000 ) + +/* bitmap netr_ChangeLogFlags */ +#define NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED ( 0x0001 ) +#define NETR_CHANGELOG_CHANGED_PASSWORD ( 0x0002 ) +#define NETR_CHANGELOG_SID_INCLUDED ( 0x0004 ) +#define NETR_CHANGELOG_NAME_INCLUDED ( 0x0008 ) +#define NETR_CHANGELOG_FIRST_PROMOTION_OBJ ( 0x0010 ) + +union netr_ChangeLogObject { + struct dom_sid object_sid;/* [case(NETR_CHANGELOG_SID_INCLUDED)] */ + const char * object_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM),case(NETR_CHANGELOG_NAME_INCLUDED)] */ +}/* [nodiscriminant] */; + +struct netr_ChangeLogEntry { + uint32_t serial_number1; + uint32_t serial_number2; + uint32_t object_rid; + uint16_t flags; + enum netr_SamDatabaseID8Bit db_index; + enum netr_DeltaEnum8Bit delta_type; + union netr_ChangeLogObject object;/* [switch_is(flags&(NETR_CHANGELOG_SID_INCLUDED|NETR_CHANGELOG_NAME_INCLUDED))] */ +}/* [gensize,public] */; + +struct netr_Blob { + uint32_t length; + uint8_t *data;/* [unique,size_is(length)] */ +}; + +/* bitmap netr_DsRGetDCName_flags */ +#define DS_FORCE_REDISCOVERY ( 0x00000001 ) +#define DS_DIRECTORY_SERVICE_REQUIRED ( 0x00000010 ) +#define DS_DIRECTORY_SERVICE_PREFERRED ( 0x00000020 ) +#define DS_GC_SERVER_REQUIRED ( 0x00000040 ) +#define DS_PDC_REQUIRED ( 0x00000080 ) +#define DS_BACKGROUND_ONLY ( 0x00000100 ) +#define DS_IP_REQUIRED ( 0x00000200 ) +#define DS_KDC_REQUIRED ( 0x00000400 ) +#define DS_TIMESERV_REQUIRED ( 0x00000800 ) +#define DS_WRITABLE_REQUIRED ( 0x00001000 ) +#define DS_GOOD_TIMESERV_PREFERRED ( 0x00002000 ) +#define DS_AVOID_SELF ( 0x00004000 ) +#define DS_ONLY_LDAP_NEEDED ( 0x00008000 ) +#define DS_IS_FLAT_NAME ( 0x00010000 ) +#define DS_IS_DNS_NAME ( 0x00020000 ) +#define DS_TRY_NEXTCLOSEST_SITE ( 0x00040000 ) +#define DS_DIRECTORY_SERVICE_6_REQUIRED ( 0x00080000 ) +#define DS_RETURN_DNS_NAME ( 0x40000000 ) +#define DS_RETURN_FLAT_NAME ( 0x80000000 ) + +enum netr_DsRGetDCNameInfo_AddressType +#ifndef USE_UINT_ENUMS + { + DS_ADDRESS_TYPE_INET=1, + DS_ADDRESS_TYPE_NETBIOS=2 +} +#else + { __donnot_use_enum_netr_DsRGetDCNameInfo_AddressType=0x7FFFFFFF} +#define DS_ADDRESS_TYPE_INET ( 1 ) +#define DS_ADDRESS_TYPE_NETBIOS ( 2 ) +#endif +; + +/* bitmap netr_DsR_DcFlags */ +#define DS_SERVER_PDC ( NBT_SERVER_PDC ) +#define DS_SERVER_GC ( NBT_SERVER_GC ) +#define DS_SERVER_LDAP ( NBT_SERVER_LDAP ) +#define DS_SERVER_DS ( NBT_SERVER_DS ) +#define DS_SERVER_KDC ( NBT_SERVER_KDC ) +#define DS_SERVER_TIMESERV ( NBT_SERVER_TIMESERV ) +#define DS_SERVER_CLOSEST ( NBT_SERVER_CLOSEST ) +#define DS_SERVER_WRITABLE ( NBT_SERVER_WRITABLE ) +#define DS_SERVER_GOOD_TIMESERV ( NBT_SERVER_GOOD_TIMESERV ) +#define DS_SERVER_NDNC ( NBT_SERVER_NDNC ) +#define DS_SERVER_SELECT_SECRET_DOMAIN_6 ( NBT_SERVER_SELECT_SECRET_DOMAIN_6 ) +#define DS_SERVER_FULL_SECRET_DOMAIN_6 ( NBT_SERVER_FULL_SECRET_DOMAIN_6 ) +#define DS_DNS_CONTROLLER ( 0x20000000 ) +#define DS_DNS_DOMAIN ( 0x40000000 ) +#define DS_DNS_FOREST ( 0x80000000 ) + +struct netr_DsRGetDCNameInfo { + const char *dc_unc;/* [unique,charset(UTF16)] */ + const char *dc_address;/* [unique,charset(UTF16)] */ + enum netr_DsRGetDCNameInfo_AddressType dc_address_type; + struct GUID domain_guid; + const char *domain_name;/* [unique,charset(UTF16)] */ + const char *forest_name;/* [unique,charset(UTF16)] */ + uint32_t dc_flags; + const char *dc_site_name;/* [unique,charset(UTF16)] */ + const char *client_site_name;/* [unique,charset(UTF16)] */ +}/* [public] */; + +/* bitmap netr_TrustFlags */ +#define NETR_TRUST_FLAG_IN_FOREST ( 0x00000001 ) +#define NETR_TRUST_FLAG_OUTBOUND ( 0x00000002 ) +#define NETR_TRUST_FLAG_TREEROOT ( 0x00000004 ) +#define NETR_TRUST_FLAG_PRIMARY ( 0x00000008 ) +#define NETR_TRUST_FLAG_NATIVE ( 0x00000010 ) +#define NETR_TRUST_FLAG_INBOUND ( 0x00000020 ) +#define NETR_TRUST_FLAG_MIT_KRB5 ( 0x00000080 ) +#define NETR_TRUST_FLAG_AES ( 0x00000100 ) + +struct netr_BinaryString { + uint16_t length; + uint16_t size; + uint16_t *data;/* [unique,length_is(length/2),size_is(size/2)] */ +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct netr_DomainQuery1 { + struct netr_Blob blob; + const char *workstation_domain;/* [unique,charset(UTF16)] */ + const char *workstation_site;/* [unique,charset(UTF16)] */ + const char *unknown1;/* [unique,charset(UTF16)] */ + const char *unknown2;/* [unique,charset(UTF16)] */ + const char *unknown3;/* [unique,charset(UTF16)] */ + const char *unknown4;/* [unique,charset(UTF16)] */ + struct netr_BinaryString blob2; + struct lsa_String product; + struct lsa_String unknown5; + struct lsa_String unknown6; + uint32_t unknown7[4]; +}; + +union netr_DomainQuery { + struct netr_DomainQuery1 *query1;/* [unique,case] */ +}; + +struct netr_trust_extension { + uint32_t length;/* [value(8)] */ + uint32_t dummy;/* [value(0)] */ + uint32_t size;/* [value(8)] */ + uint32_t flags; + uint32_t parent_index; + uint32_t trust_type; + uint32_t trust_attributes; +}; + +struct netr_trust_extension_container { + uint16_t length; + uint16_t size;/* [value(length)] */ + struct netr_trust_extension *info;/* [unique] */ +}; + +struct netr_DomainTrustInfo { + struct lsa_String domainname; + struct lsa_String fulldomainname; + struct lsa_String forest; + struct GUID guid; + struct dom_sid2 *sid;/* [unique] */ + struct netr_trust_extension_container trust_extension; + struct lsa_String dummystring[3]; + uint32_t dummy[4]; +}; + +struct netr_LsaPolicyInfo { + uint32_t policy_size; + uint8_t *policy;/* [unique,size_is(policy_size)] */ +}; + +/* bitmap netr_WorkstationFlags */ +#define NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS ( 0x00000001 ) +#define NETR_WS_FLAG_HANDLES_SPN_UPDATE ( 0x00000002 ) + +struct netr_DomainInfo1 { + struct netr_DomainTrustInfo domaininfo; + uint32_t num_trusts; + struct netr_DomainTrustInfo *trusts;/* [unique,size_is(num_trusts)] */ + struct netr_LsaPolicyInfo lsa_policy; + struct lsa_String dns_hostname; + struct lsa_String dummystring[3]; + uint32_t workstation_flags; + uint32_t supported_enc_types; + uint32_t dummy[2]; +}; + +union netr_DomainInfo { + struct netr_DomainInfo1 *info1;/* [unique,case] */ + struct netr_DomainInfo1 *info2;/* [unique,case(2)] */ +}; + +struct netr_CryptPassword { + uint8_t data[512]; + uint32_t length; +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct netr_DsRAddressToSitenamesWCtr { + uint32_t count; + struct lsa_String *sitename;/* [unique,size_is(count)] */ +}; + +struct netr_DsRAddress { + uint8_t *buffer;/* [unique,size_is(size)] */ + uint32_t size; +}; + +enum netr_TrustType +#ifndef USE_UINT_ENUMS + { + NETR_TRUST_TYPE_DOWNLEVEL=1, + NETR_TRUST_TYPE_UPLEVEL=2, + NETR_TRUST_TYPE_MIT=3, + NETR_TRUST_TYPE_DCE=4 +} +#else + { __donnot_use_enum_netr_TrustType=0x7FFFFFFF} +#define NETR_TRUST_TYPE_DOWNLEVEL ( 1 ) +#define NETR_TRUST_TYPE_UPLEVEL ( 2 ) +#define NETR_TRUST_TYPE_MIT ( 3 ) +#define NETR_TRUST_TYPE_DCE ( 4 ) +#endif +; + +/* bitmap netr_TrustAttributes */ +#define NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE ( 0x00000001 ) +#define NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY ( 0x00000002 ) +#define NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN ( 0x00000004 ) +#define NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE ( 0x00000008 ) +#define NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION ( 0x00000010 ) +#define NETR_TRUST_ATTRIBUTE_WITHIN_FOREST ( 0x00000020 ) +#define NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL ( 0x00000040 ) + +struct netr_DomainTrust { + const char *netbios_name;/* [unique,charset(UTF16)] */ + const char *dns_name;/* [unique,charset(UTF16)] */ + uint32_t trust_flags; + uint32_t parent_index; + enum netr_TrustType trust_type; + uint32_t trust_attributes; + struct dom_sid2 *sid;/* [unique] */ + struct GUID guid; +}; + +struct netr_DomainTrustList { + uint32_t count; + struct netr_DomainTrust *array;/* [unique,size_is(count)] */ +}; + +struct netr_DsRAddressToSitenamesExWCtr { + uint32_t count; + struct lsa_String *sitename;/* [unique,size_is(count)] */ + struct lsa_String *subnetname;/* [unique,size_is(count)] */ +}; + +struct DcSitesCtr { + uint32_t num_sites; + struct lsa_String *sites;/* [unique,size_is(num_sites)] */ +}; + +struct netr_TrustInfo { + uint32_t count; + uint32_t *data;/* [unique,size_is(count)] */ + uint32_t entry_count; + struct lsa_String *entries;/* [unique,size_is(count)] */ +}; + + +struct netr_LogonUasLogon { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + const char *workstation;/* [charset(UTF16)] */ + } in; + + struct { + struct netr_UasInfo **info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_LogonUasLogoff { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + const char *workstation;/* [charset(UTF16)] */ + } in; + + struct { + struct netr_UasLogoffInfo *info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_LogonSamLogon { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *computer_name;/* [unique,charset(UTF16)] */ + struct netr_Authenticator *credential;/* [unique] */ + enum netr_LogonInfoClass logon_level; + union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */ + uint16_t validation_level; + struct netr_Authenticator *return_authenticator;/* [unique] */ + } in; + + struct { + union netr_Validation *validation;/* [ref,switch_is(validation_level)] */ + uint8_t *authoritative;/* [ref] */ + struct netr_Authenticator *return_authenticator;/* [unique] */ + NTSTATUS result; + } out; + +}; + + +struct netr_LogonSamLogoff { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *computer_name;/* [unique,charset(UTF16)] */ + struct netr_Authenticator *credential;/* [unique] */ + enum netr_LogonInfoClass logon_level; + union netr_LogonLevel logon;/* [switch_is(logon_level)] */ + struct netr_Authenticator *return_authenticator;/* [unique] */ + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [unique] */ + NTSTATUS result; + } out; + +}; + + +struct netr_ServerReqChallenge { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Credential *credentials;/* [ref] */ + } in; + + struct { + struct netr_Credential *return_credentials;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_ServerAuthenticate { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Credential *credentials;/* [ref] */ + } in; + + struct { + struct netr_Credential *return_credentials;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_ServerPasswordSet { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + struct samr_Password *new_password;/* [ref] */ + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_DatabaseDeltas { + struct { + const char *logon_server;/* [charset(UTF16)] */ + const char *computername;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + enum netr_SamDatabaseID database_id; + uint32_t preferredmaximumlength; + struct netr_Authenticator *return_authenticator;/* [ref] */ + uint64_t *sequence_num;/* [ref] */ + } in; + + struct { + struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + uint64_t *sequence_num;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_DatabaseSync { + struct { + const char *logon_server;/* [charset(UTF16)] */ + const char *computername;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + enum netr_SamDatabaseID database_id; + uint32_t preferredmaximumlength; + struct netr_Authenticator *return_authenticator;/* [ref] */ + uint32_t *sync_context;/* [ref] */ + } in; + + struct { + struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + uint32_t *sync_context;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_AccountDeltas { + struct { + const char *logon_server;/* [unique,charset(UTF16)] */ + const char *computername;/* [charset(UTF16)] */ + struct netr_Authenticator credential; + struct netr_UAS_INFO_0 uas; + uint32_t count; + uint32_t level; + uint32_t buffersize; + struct netr_Authenticator *return_authenticator;/* [ref] */ + } in; + + struct { + struct netr_AccountBuffer *buffer;/* [ref,subcontext(4)] */ + uint32_t *count_returned;/* [ref] */ + uint32_t *total_entries;/* [ref] */ + struct netr_UAS_INFO_0 *recordid;/* [ref] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_AccountSync { + struct { + const char *logon_server;/* [unique,charset(UTF16)] */ + const char *computername;/* [charset(UTF16)] */ + struct netr_Authenticator credential; + uint32_t reference; + uint32_t level; + uint32_t buffersize; + struct netr_Authenticator *return_authenticator;/* [ref] */ + struct netr_UAS_INFO_0 *recordid;/* [ref] */ + } in; + + struct { + struct netr_AccountBuffer *buffer;/* [ref,subcontext(4)] */ + uint32_t *count_returned;/* [ref] */ + uint32_t *total_entries;/* [ref] */ + uint32_t *next_reference;/* [ref] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + struct netr_UAS_INFO_0 *recordid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_GetDcName { + struct { + const char *logon_server;/* [charset(UTF16)] */ + const char *domainname;/* [unique,charset(UTF16)] */ + } in; + + struct { + const char **dcname;/* [ref,charset(UTF16)] */ + WERROR result; + } out; + +}; + + +struct netr_LogonControl { + struct { + const char *logon_server;/* [unique,charset(UTF16)] */ + enum netr_LogonControlCode function_code; + uint32_t level; + } in; + + struct { + union netr_CONTROL_QUERY_INFORMATION *info;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct netr_GetAnyDCName { + struct { + const char *logon_server;/* [unique,charset(UTF16)] */ + const char *domainname;/* [unique,charset(UTF16)] */ + } in; + + struct { + const char **dcname;/* [ref,charset(UTF16)] */ + WERROR result; + } out; + +}; + + +struct netr_LogonControl2 { + struct { + const char *logon_server;/* [unique,charset(UTF16)] */ + enum netr_LogonControlCode function_code; + uint32_t level; + union netr_CONTROL_DATA_INFORMATION *data;/* [ref,switch_is(function_code)] */ + } in; + + struct { + union netr_CONTROL_QUERY_INFORMATION *query;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct netr_ServerAuthenticate2 { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Credential *credentials;/* [ref] */ + uint32_t *negotiate_flags;/* [ref] */ + } in; + + struct { + struct netr_Credential *return_credentials;/* [ref] */ + uint32_t *negotiate_flags;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_DatabaseSync2 { + struct { + const char *logon_server;/* [charset(UTF16)] */ + const char *computername;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + enum netr_SamDatabaseID database_id; + uint16_t restart_state; + uint32_t preferredmaximumlength; + struct netr_Authenticator *return_authenticator;/* [ref] */ + uint32_t *sync_context;/* [ref] */ + } in; + + struct { + struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + uint32_t *sync_context;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_DatabaseRedo { + struct { + const char *logon_server;/* [charset(UTF16)] */ + const char *computername;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + struct netr_ChangeLogEntry change_log_entry;/* [subcontext_size(change_log_entry_size),subcontext(4)] */ + uint32_t change_log_entry_size;/* [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->flags))] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + } in; + + struct { + struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_LogonControl2Ex { + struct { + const char *logon_server;/* [unique,charset(UTF16)] */ + uint32_t function_code; + uint32_t level; + union netr_CONTROL_DATA_INFORMATION data;/* [switch_is(function_code)] */ + } in; + + struct { + union netr_CONTROL_QUERY_INFORMATION *query;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct netr_NetrEnumerateTrustedDomains { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + } in; + + struct { + struct netr_Blob *trusted_domains_blob;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_DsRGetDCName { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [unique,charset(UTF16)] */ + struct GUID *domain_guid;/* [unique] */ + struct GUID *site_guid;/* [unique] */ + uint32_t flags; + } in; + + struct { + struct netr_DsRGetDCNameInfo **info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_NETRLOGONDUMMYROUTINE1 { + struct { + WERROR result; + } out; + +}; + + +struct netr_NETRLOGONSETSERVICEBITS { + struct { + WERROR result; + } out; + +}; + + +struct netr_LogonGetTrustRid { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [unique,charset(UTF16)] */ + } in; + + struct { + uint32_t *rid;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_NETRLOGONCOMPUTESERVERDIGEST { + struct { + WERROR result; + } out; + +}; + + +struct netr_NETRLOGONCOMPUTECLIENTDIGEST { + struct { + WERROR result; + } out; + +}; + + +struct netr_ServerAuthenticate3 { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Credential *credentials;/* [ref] */ + uint32_t *negotiate_flags;/* [ref] */ + } in; + + struct { + struct netr_Credential *return_credentials;/* [ref] */ + uint32_t *rid;/* [ref] */ + uint32_t *negotiate_flags;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_DsRGetDCNameEx { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [unique,charset(UTF16)] */ + struct GUID *domain_guid;/* [unique] */ + const char *site_name;/* [unique,charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + struct netr_DsRGetDCNameInfo **info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_DsRGetSiteName { + struct { + const char *computer_name;/* [unique,charset(UTF16)] */ + } in; + + struct { + const char **site;/* [ref,charset(UTF16)] */ + WERROR result; + } out; + +}; + + +struct netr_LogonGetDomainInfo { + struct { + const char *server_name;/* [charset(UTF16)] */ + const char *computer_name;/* [unique,charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + uint32_t level; + union netr_DomainQuery query;/* [switch_is(level)] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + } in; + + struct { + union netr_DomainInfo *info;/* [ref,switch_is(level)] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_ServerPasswordSet2 { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + struct netr_CryptPassword *new_password;/* [ref] */ + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_ServerPasswordGet { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [ref] */ + struct samr_Password *password;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_NETRLOGONSENDTOSAM { + struct { + WERROR result; + } out; + +}; + + +struct netr_DsRAddressToSitenamesW { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t count;/* [range(0,32000)] */ + struct netr_DsRAddress *addresses;/* [ref,size_is(count)] */ + } in; + + struct { + struct netr_DsRAddressToSitenamesWCtr **ctr;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_DsRGetDCNameEx2 { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *client_account;/* [unique,charset(UTF16)] */ + uint32_t mask; + const char *domain_name;/* [unique,charset(UTF16)] */ + struct GUID *domain_guid;/* [unique] */ + const char *site_name;/* [unique,charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + struct netr_DsRGetDCNameInfo **info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN { + struct { + WERROR result; + } out; + +}; + + +struct netr_NetrEnumerateTrustedDomainsEx { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + } in; + + struct { + struct netr_DomainTrustList *dom_trust_list;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_DsRAddressToSitenamesExW { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t count;/* [range(0,32000)] */ + struct netr_DsRAddress *addresses;/* [ref,size_is(count)] */ + } in; + + struct { + struct netr_DsRAddressToSitenamesExWCtr **ctr;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_DsrGetDcSiteCoverageW { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + } in; + + struct { + struct DcSitesCtr **ctr;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_LogonSamLogonEx { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *computer_name;/* [unique,charset(UTF16)] */ + enum netr_LogonInfoClass logon_level; + union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */ + uint16_t validation_level; + uint32_t *flags;/* [ref] */ + } in; + + struct { + union netr_Validation *validation;/* [ref,switch_is(validation_level)] */ + uint8_t *authoritative;/* [ref] */ + uint32_t *flags;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_DsrEnumerateDomainTrusts { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t trust_flags; + } in; + + struct { + struct netr_DomainTrustList *trusts;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_DsrDeregisterDNSHostRecords { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain;/* [unique,charset(UTF16)] */ + struct GUID *domain_guid;/* [unique] */ + struct GUID *dsa_guid;/* [unique] */ + const char *dns_host;/* [ref,charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct netr_ServerTrustPasswordsGet { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [ref] */ + struct samr_Password *password;/* [ref] */ + struct samr_Password *password2;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_DsRGetForestTrustInformation { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *trusted_domain_name;/* [unique,charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + struct lsa_ForestTrustInformation **forest_trust_info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_GetForestTrustInformation { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *trusted_domain_name;/* [ref,charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + uint32_t flags; + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [ref] */ + struct lsa_ForestTrustInformation **forest_trust_info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct netr_LogonSamLogonWithFlags { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *computer_name;/* [unique,charset(UTF16)] */ + struct netr_Authenticator *credential;/* [unique] */ + enum netr_LogonInfoClass logon_level; + union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */ + uint16_t validation_level; + struct netr_Authenticator *return_authenticator;/* [unique] */ + uint32_t *flags;/* [ref] */ + } in; + + struct { + union netr_Validation *validation;/* [ref,switch_is(validation_level)] */ + uint8_t *authoritative;/* [ref] */ + struct netr_Authenticator *return_authenticator;/* [unique] */ + uint32_t *flags;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct netr_ServerGetTrustInfo { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [ref,charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [ref,charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [ref] */ + struct samr_Password *new_owf_password;/* [ref] */ + struct samr_Password *old_owf_password;/* [ref] */ + struct netr_TrustInfo **trust_info;/* [ref] */ + NTSTATUS result; + } out; + +}; + +#endif /* _HEADER_netlogon */ diff --git a/librpc/gen_ndr/ntsvcs.h b/librpc/gen_ndr/ntsvcs.h new file mode 100644 index 0000000000..5021aa2252 --- /dev/null +++ b/librpc/gen_ndr/ntsvcs.h @@ -0,0 +1,591 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/winreg.h" +#ifndef _HEADER_ntsvcs +#define _HEADER_ntsvcs + +#define DEV_REGPROP_DESC ( 1 ) +struct PNP_HwProfInfo { + uint32_t profile_handle; + uint16_t friendly_name[80]; + uint32_t flags; +}; + + +struct PNP_Disconnect { + struct { + WERROR result; + } out; + +}; + + +struct PNP_Connect { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetVersion { + struct { + uint16_t *version;/* [ref] */ + WERROR result; + } out; + +}; + + +struct PNP_GetGlobalState { + struct { + WERROR result; + } out; + +}; + + +struct PNP_InitDetection { + struct { + WERROR result; + } out; + +}; + + +struct PNP_ReportLogOn { + struct { + WERROR result; + } out; + +}; + + +struct PNP_ValidateDeviceInstance { + struct { + const char *devicepath;/* [ref,charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetRootDeviceInstance { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetRelatedDeviceInstance { + struct { + WERROR result; + } out; + +}; + + +struct PNP_EnumerateSubKeys { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetDeviceList { + struct { + const char *filter;/* [unique,charset(UTF16)] */ + uint32_t flags; + uint32_t *length;/* [ref] */ + } in; + + struct { + uint16_t *buffer;/* [ref,length_is(*length),size_is(*length)] */ + uint32_t *length;/* [ref] */ + WERROR result; + } out; + +}; + + +struct PNP_GetDeviceListSize { + struct { + const char *devicename;/* [unique,charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + uint32_t *size;/* [ref] */ + WERROR result; + } out; + +}; + + +struct PNP_GetDepth { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetDeviceRegProp { + struct { + const char *devicepath;/* [ref,charset(UTF16)] */ + uint32_t property; + uint32_t flags; + enum winreg_Type *reg_data_type;/* [ref] */ + uint32_t *buffer_size;/* [ref] */ + uint32_t *needed;/* [ref] */ + } in; + + struct { + uint8_t *buffer;/* [ref,length_is(*buffer_size),size_is(*buffer_size)] */ + enum winreg_Type *reg_data_type;/* [ref] */ + uint32_t *buffer_size;/* [ref] */ + uint32_t *needed;/* [ref] */ + WERROR result; + } out; + +}; + + +struct PNP_SetDeviceRegProp { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetClassInstance { + struct { + WERROR result; + } out; + +}; + + +struct PNP_CreateKey { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DeleteRegistryKey { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetClassCount { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetClassName { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DeleteClassKey { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetInterfaceDeviceAlias { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetInterfaceDeviceList { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetInterfaceDeviceListSize { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RegisterDeviceClassAssociation { + struct { + WERROR result; + } out; + +}; + + +struct PNP_UnregisterDeviceClassAssociation { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetClassRegProp { + struct { + WERROR result; + } out; + +}; + + +struct PNP_SetClassRegProp { + struct { + WERROR result; + } out; + +}; + + +struct PNP_CreateDevInst { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DeviceInstanceAction { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetDeviceStatus { + struct { + WERROR result; + } out; + +}; + + +struct PNP_SetDeviceProblem { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DisableDevInst { + struct { + WERROR result; + } out; + +}; + + +struct PNP_UninstallDevInst { + struct { + WERROR result; + } out; + +}; + + +struct PNP_AddID { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RegisterDriver { + struct { + WERROR result; + } out; + +}; + + +struct PNP_QueryRemove { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RequestDeviceEject { + struct { + WERROR result; + } out; + +}; + + +struct PNP_IsDockStationPresent { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RequestEjectPC { + struct { + WERROR result; + } out; + +}; + + +struct PNP_HwProfFlags { + struct { + uint32_t action; + const char *devicepath;/* [ref,charset(UTF16)] */ + uint32_t config; + const char *unknown5;/* [unique,charset(UTF16)] */ + uint32_t name_length; + uint32_t flags; + uint32_t *profile_flags;/* [ref] */ + uint16_t *veto_type;/* [unique] */ + } in; + + struct { + const char **unknown5a;/* [unique,charset(UTF16)] */ + uint32_t *profile_flags;/* [ref] */ + uint16_t *veto_type;/* [unique] */ + WERROR result; + } out; + +}; + + +struct PNP_GetHwProfInfo { + struct { + uint32_t idx; + uint32_t size; + uint32_t flags; + struct PNP_HwProfInfo *info;/* [ref] */ + } in; + + struct { + struct PNP_HwProfInfo *info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct PNP_AddEmptyLogConf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_FreeLogConf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetFirstLogConf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetNextLogConf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetLogConfPriority { + struct { + WERROR result; + } out; + +}; + + +struct PNP_AddResDes { + struct { + WERROR result; + } out; + +}; + + +struct PNP_FreeResDes { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetNextResDes { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetResDesData { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetResDesDataSize { + struct { + WERROR result; + } out; + +}; + + +struct PNP_ModifyResDes { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DetectResourceLimit { + struct { + WERROR result; + } out; + +}; + + +struct PNP_QueryResConfList { + struct { + WERROR result; + } out; + +}; + + +struct PNP_SetHwProf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_QueryArbitratorFreeData { + struct { + WERROR result; + } out; + +}; + + +struct PNP_QueryArbitratorFreeSize { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RunDetection { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RegisterNotification { + struct { + WERROR result; + } out; + +}; + + +struct PNP_UnregisterNotification { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetCustomDevProp { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetVersionInternal { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetBlockedDriverInfo { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetServerSideDeviceInstallFlags { + struct { + WERROR result; + } out; + +}; + +#endif /* _HEADER_ntsvcs */ diff --git a/librpc/gen_ndr/samr.h b/librpc/gen_ndr/samr.h new file mode 100644 index 0000000000..3116f26d8c --- /dev/null +++ b/librpc/gen_ndr/samr.h @@ -0,0 +1,1827 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/lsa.h" +#include "librpc/gen_ndr/security.h" +#ifndef _HEADER_samr +#define _HEADER_samr + +#define SAMR_ACCESS_ALL_ACCESS ( 0x0000003F ) +#define GENERIC_RIGHTS_SAM_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ACCESS_ALL_ACCESS) ) +#define GENERIC_RIGHTS_SAM_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_ACCESS_ENUM_DOMAINS) ) +#define GENERIC_RIGHTS_SAM_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ACCESS_CREATE_DOMAIN|SAMR_ACCESS_INITIALIZE_SERVER|SAMR_ACCESS_SHUTDOWN_SERVER) ) +#define GENERIC_RIGHTS_SAM_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ACCESS_OPEN_DOMAIN|SAMR_ACCESS_CONNECT_TO_SERVER) ) +#define SAMR_USER_ACCESS_ALL_ACCESS ( 0x000007FF ) +#define GENERIC_RIGHTS_USER_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_USER_ACCESS_ALL_ACCESS) ) +#define GENERIC_RIGHTS_USER_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP|SAMR_USER_ACCESS_GET_GROUPS|SAMR_USER_ACCESS_GET_ATTRIBUTES|SAMR_USER_ACCESS_GET_LOGONINFO|SAMR_USER_ACCESS_GET_LOCALE) ) +#define GENERIC_RIGHTS_USER_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_USER_ACCESS_CHANGE_PASSWORD|SAMR_USER_ACCESS_SET_LOC_COM|SAMR_USER_ACCESS_SET_ATTRIBUTES|SAMR_USER_ACCESS_SET_PASSWORD|SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP) ) +#define GENERIC_RIGHTS_USER_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_USER_ACCESS_CHANGE_PASSWORD|SAMR_USER_ACCESS_GET_NAME_ETC) ) +#define SAMR_DOMAIN_ACCESS_ALL_ACCESS ( 0x000007FF ) +#define GENERIC_RIGHTS_DOMAIN_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_DOMAIN_ACCESS_ALL_ACCESS) ) +#define GENERIC_RIGHTS_DOMAIN_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2) ) +#define GENERIC_RIGHTS_DOMAIN_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_DOMAIN_ACCESS_SET_INFO_3|SAMR_DOMAIN_ACCESS_CREATE_ALIAS|SAMR_DOMAIN_ACCESS_CREATE_GROUP|SAMR_DOMAIN_ACCESS_CREATE_USER|SAMR_DOMAIN_ACCESS_SET_INFO_2|SAMR_DOMAIN_ACCESS_SET_INFO_1) ) +#define GENERIC_RIGHTS_DOMAIN_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT|SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1) ) +#define SAMR_GROUP_ACCESS_ALL_ACCESS ( 0x0000001F ) +#define GENERIC_RIGHTS_GROUP_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_GROUP_ACCESS_ALL_ACCESS) ) +#define GENERIC_RIGHTS_GROUP_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_GROUP_ACCESS_GET_MEMBERS) ) +#define GENERIC_RIGHTS_GROUP_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_GROUP_ACCESS_REMOVE_MEMBER|SAMR_GROUP_ACCESS_ADD_MEMBER|SAMR_GROUP_ACCESS_SET_INFO) ) +#define GENERIC_RIGHTS_GROUP_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_GROUP_ACCESS_LOOKUP_INFO) ) +#define SAMR_ALIAS_ACCESS_ALL_ACCESS ( 0x0000001F ) +#define GENERIC_RIGHTS_ALIAS_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ALIAS_ACCESS_ALL_ACCESS) ) +#define GENERIC_RIGHTS_ALIAS_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_ALIAS_ACCESS_GET_MEMBERS) ) +#define GENERIC_RIGHTS_ALIAS_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ALIAS_ACCESS_REMOVE_MEMBER|SAMR_ALIAS_ACCESS_ADD_MEMBER|SAMR_ALIAS_ACCESS_SET_INFO) ) +#define GENERIC_RIGHTS_ALIAS_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ALIAS_ACCESS_LOOKUP_INFO) ) +#define SAMR_ENUM_USERS_MULTIPLIER ( 54 ) +#define PASS_MUST_CHANGE_AT_NEXT_LOGON ( 0x01 ) +#define PASS_DONT_CHANGE_AT_NEXT_LOGON ( 0x00 ) +enum netr_SamDatabaseID +#ifndef USE_UINT_ENUMS + { + SAM_DATABASE_DOMAIN=0, + SAM_DATABASE_BUILTIN=1, + SAM_DATABASE_PRIVS=2 +} +#else + { __donnot_use_enum_netr_SamDatabaseID=0x7FFFFFFF} +#define SAM_DATABASE_DOMAIN ( 0 ) +#define SAM_DATABASE_BUILTIN ( 1 ) +#define SAM_DATABASE_PRIVS ( 2 ) +#endif +; + +enum samr_RejectReason +#ifndef USE_UINT_ENUMS + { + SAMR_REJECT_OTHER=0, + SAMR_REJECT_TOO_SHORT=1, + SAMR_REJECT_IN_HISTORY=2, + SAMR_REJECT_COMPLEXITY=5 +} +#else + { __donnot_use_enum_samr_RejectReason=0x7FFFFFFF} +#define SAMR_REJECT_OTHER ( 0 ) +#define SAMR_REJECT_TOO_SHORT ( 1 ) +#define SAMR_REJECT_IN_HISTORY ( 2 ) +#define SAMR_REJECT_COMPLEXITY ( 5 ) +#endif +; + +/* bitmap samr_AcctFlags */ +#define ACB_DISABLED ( 0x00000001 ) +#define ACB_HOMDIRREQ ( 0x00000002 ) +#define ACB_PWNOTREQ ( 0x00000004 ) +#define ACB_TEMPDUP ( 0x00000008 ) +#define ACB_NORMAL ( 0x00000010 ) +#define ACB_MNS ( 0x00000020 ) +#define ACB_DOMTRUST ( 0x00000040 ) +#define ACB_WSTRUST ( 0x00000080 ) +#define ACB_SVRTRUST ( 0x00000100 ) +#define ACB_PWNOEXP ( 0x00000200 ) +#define ACB_AUTOLOCK ( 0x00000400 ) +#define ACB_ENC_TXT_PWD_ALLOWED ( 0x00000800 ) +#define ACB_SMARTCARD_REQUIRED ( 0x00001000 ) +#define ACB_TRUSTED_FOR_DELEGATION ( 0x00002000 ) +#define ACB_NOT_DELEGATED ( 0x00004000 ) +#define ACB_USE_DES_KEY_ONLY ( 0x00008000 ) +#define ACB_DONT_REQUIRE_PREAUTH ( 0x00010000 ) +#define ACB_PW_EXPIRED ( 0x00020000 ) +#define ACB_NO_AUTH_DATA_REQD ( 0x00080000 ) + +/* bitmap samr_ConnectAccessMask */ +#define SAMR_ACCESS_CONNECT_TO_SERVER ( 0x00000001 ) +#define SAMR_ACCESS_SHUTDOWN_SERVER ( 0x00000002 ) +#define SAMR_ACCESS_INITIALIZE_SERVER ( 0x00000004 ) +#define SAMR_ACCESS_CREATE_DOMAIN ( 0x00000008 ) +#define SAMR_ACCESS_ENUM_DOMAINS ( 0x00000010 ) +#define SAMR_ACCESS_OPEN_DOMAIN ( 0x00000020 ) + +/* bitmap samr_UserAccessMask */ +#define SAMR_USER_ACCESS_GET_NAME_ETC ( 0x00000001 ) +#define SAMR_USER_ACCESS_GET_LOCALE ( 0x00000002 ) +#define SAMR_USER_ACCESS_SET_LOC_COM ( 0x00000004 ) +#define SAMR_USER_ACCESS_GET_LOGONINFO ( 0x00000008 ) +#define SAMR_USER_ACCESS_GET_ATTRIBUTES ( 0x00000010 ) +#define SAMR_USER_ACCESS_SET_ATTRIBUTES ( 0x00000020 ) +#define SAMR_USER_ACCESS_CHANGE_PASSWORD ( 0x00000040 ) +#define SAMR_USER_ACCESS_SET_PASSWORD ( 0x00000080 ) +#define SAMR_USER_ACCESS_GET_GROUPS ( 0x00000100 ) +#define SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP ( 0x00000200 ) +#define SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP ( 0x00000400 ) + +/* bitmap samr_DomainAccessMask */ +#define SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1 ( 0x00000001 ) +#define SAMR_DOMAIN_ACCESS_SET_INFO_1 ( 0x00000002 ) +#define SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2 ( 0x00000004 ) +#define SAMR_DOMAIN_ACCESS_SET_INFO_2 ( 0x00000008 ) +#define SAMR_DOMAIN_ACCESS_CREATE_USER ( 0x00000010 ) +#define SAMR_DOMAIN_ACCESS_CREATE_GROUP ( 0x00000020 ) +#define SAMR_DOMAIN_ACCESS_CREATE_ALIAS ( 0x00000040 ) +#define SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS ( 0x00000080 ) +#define SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS ( 0x00000100 ) +#define SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT ( 0x00000200 ) +#define SAMR_DOMAIN_ACCESS_SET_INFO_3 ( 0x00000400 ) + +/* bitmap samr_GroupAccessMask */ +#define SAMR_GROUP_ACCESS_LOOKUP_INFO ( 0x00000001 ) +#define SAMR_GROUP_ACCESS_SET_INFO ( 0x00000002 ) +#define SAMR_GROUP_ACCESS_ADD_MEMBER ( 0x00000004 ) +#define SAMR_GROUP_ACCESS_REMOVE_MEMBER ( 0x00000008 ) +#define SAMR_GROUP_ACCESS_GET_MEMBERS ( 0x00000010 ) + +/* bitmap samr_AliasAccessMask */ +#define SAMR_ALIAS_ACCESS_ADD_MEMBER ( 0x00000001 ) +#define SAMR_ALIAS_ACCESS_REMOVE_MEMBER ( 0x00000002 ) +#define SAMR_ALIAS_ACCESS_GET_MEMBERS ( 0x00000004 ) +#define SAMR_ALIAS_ACCESS_LOOKUP_INFO ( 0x00000008 ) +#define SAMR_ALIAS_ACCESS_SET_INFO ( 0x00000010 ) + +struct samr_SamEntry { + uint32_t idx; + struct lsa_String name; +}; + +struct samr_SamArray { + uint32_t count; + struct samr_SamEntry *entries;/* [unique,size_is(count)] */ +}; + +enum samr_Role +#ifndef USE_UINT_ENUMS + { + SAMR_ROLE_STANDALONE=0, + SAMR_ROLE_DOMAIN_MEMBER=1, + SAMR_ROLE_DOMAIN_BDC=2, + SAMR_ROLE_DOMAIN_PDC=3 +} +#else + { __donnot_use_enum_samr_Role=0x7FFFFFFF} +#define SAMR_ROLE_STANDALONE ( 0 ) +#define SAMR_ROLE_DOMAIN_MEMBER ( 1 ) +#define SAMR_ROLE_DOMAIN_BDC ( 2 ) +#define SAMR_ROLE_DOMAIN_PDC ( 3 ) +#endif +; + +/* bitmap samr_PasswordProperties */ +#define DOMAIN_PASSWORD_COMPLEX ( 0x00000001 ) +#define DOMAIN_PASSWORD_NO_ANON_CHANGE ( 0x00000002 ) +#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE ( 0x00000004 ) +#define DOMAIN_PASSWORD_LOCKOUT_ADMINS ( 0x00000008 ) +#define DOMAIN_PASSWORD_STORE_CLEARTEXT ( 0x00000010 ) +#define DOMAIN_REFUSE_PASSWORD_CHANGE ( 0x00000020 ) + +enum samr_DomainServerState +#ifndef USE_UINT_ENUMS + { + DOMAIN_SERVER_ENABLED=1, + DOMAIN_SERVER_DISABLED=2 +} +#else + { __donnot_use_enum_samr_DomainServerState=0x7FFFFFFF} +#define DOMAIN_SERVER_ENABLED ( 1 ) +#define DOMAIN_SERVER_DISABLED ( 2 ) +#endif +; + +struct samr_DomInfo1 { + uint16_t min_password_length; + uint16_t password_history_length; + uint32_t password_properties; + int64_t max_password_age; + int64_t min_password_age; +}; + +struct samr_DomGeneralInformation { + NTTIME force_logoff_time; + struct lsa_String oem_information; + struct lsa_String domain_name; + struct lsa_String primary; + uint64_t sequence_num; + enum samr_DomainServerState domain_server_state; + enum samr_Role role; + uint32_t unknown3; + uint32_t num_users; + uint32_t num_groups; + uint32_t num_aliases; +}; + +struct samr_DomInfo3 { + NTTIME force_logoff_time; +}; + +struct samr_DomOEMInformation { + struct lsa_String oem_information; +}; + +struct samr_DomInfo5 { + struct lsa_String domain_name; +}; + +struct samr_DomInfo6 { + struct lsa_String primary; +}; + +struct samr_DomInfo7 { + enum samr_Role role; +}; + +struct samr_DomInfo8 { + uint64_t sequence_num; + NTTIME domain_create_time; +}; + +struct samr_DomInfo9 { + enum samr_DomainServerState domain_server_state; +}; + +struct samr_DomGeneralInformation2 { + struct samr_DomGeneralInformation general; + uint64_t lockout_duration; + uint64_t lockout_window; + uint16_t lockout_threshold; +}; + +struct samr_DomInfo12 { + uint64_t lockout_duration; + uint64_t lockout_window; + uint16_t lockout_threshold; +}; + +struct samr_DomInfo13 { + uint64_t sequence_num; + NTTIME domain_create_time; + uint64_t modified_count_at_last_promotion; +}; + +union samr_DomainInfo { + struct samr_DomInfo1 info1;/* [case] */ + struct samr_DomGeneralInformation general;/* [case(2)] */ + struct samr_DomInfo3 info3;/* [case(3)] */ + struct samr_DomOEMInformation oem;/* [case(4)] */ + struct samr_DomInfo5 info5;/* [case(5)] */ + struct samr_DomInfo6 info6;/* [case(6)] */ + struct samr_DomInfo7 info7;/* [case(7)] */ + struct samr_DomInfo8 info8;/* [case(8)] */ + struct samr_DomInfo9 info9;/* [case(9)] */ + struct samr_DomGeneralInformation2 general2;/* [case(11)] */ + struct samr_DomInfo12 info12;/* [case(12)] */ + struct samr_DomInfo13 info13;/* [case(13)] */ +}/* [switch_type(uint16)] */; + +struct samr_Ids { + uint32_t count;/* [range(0,1024)] */ + uint32_t *ids;/* [unique,size_is(count)] */ +}; + +/* bitmap samr_GroupAttrs */ +#define SE_GROUP_MANDATORY ( 0x00000001 ) +#define SE_GROUP_ENABLED_BY_DEFAULT ( 0x00000002 ) +#define SE_GROUP_ENABLED ( 0x00000004 ) +#define SE_GROUP_OWNER ( 0x00000008 ) +#define SE_GROUP_USE_FOR_DENY_ONLY ( 0x00000010 ) +#define SE_GROUP_RESOURCE ( 0x20000000 ) +#define SE_GROUP_LOGON_ID ( 0xC0000000 ) + +struct samr_GroupInfoAll { + struct lsa_String name; + uint32_t attributes; + uint32_t num_members; + struct lsa_String description; +}; + +struct samr_GroupInfoAttributes { + uint32_t attributes; +}; + +struct samr_GroupInfoDescription { + struct lsa_String description; +}; + +enum samr_GroupInfoEnum +#ifndef USE_UINT_ENUMS + { + GROUPINFOALL=1, + GROUPINFONAME=2, + GROUPINFOATTRIBUTES=3, + GROUPINFODESCRIPTION=4, + GROUPINFOALL2=5 +} +#else + { __donnot_use_enum_samr_GroupInfoEnum=0x7FFFFFFF} +#define GROUPINFOALL ( 1 ) +#define GROUPINFONAME ( 2 ) +#define GROUPINFOATTRIBUTES ( 3 ) +#define GROUPINFODESCRIPTION ( 4 ) +#define GROUPINFOALL2 ( 5 ) +#endif +; + +union samr_GroupInfo { + struct samr_GroupInfoAll all;/* [case(GROUPINFOALL)] */ + struct lsa_String name;/* [case(GROUPINFONAME)] */ + struct samr_GroupInfoAttributes attributes;/* [case(GROUPINFOATTRIBUTES)] */ + struct lsa_String description;/* [case(GROUPINFODESCRIPTION)] */ + struct samr_GroupInfoAll all2;/* [case(GROUPINFOALL2)] */ +}/* [switch_type(samr_GroupInfoEnum)] */; + +struct samr_RidTypeArray { + uint32_t count; + uint32_t *rids;/* [unique,size_is(count)] */ + uint32_t *types;/* [unique,size_is(count)] */ +}; + +struct samr_AliasInfoAll { + struct lsa_String name; + uint32_t num_members; + struct lsa_String description; +}; + +enum samr_AliasInfoEnum +#ifndef USE_UINT_ENUMS + { + ALIASINFOALL=1, + ALIASINFONAME=2, + ALIASINFODESCRIPTION=3 +} +#else + { __donnot_use_enum_samr_AliasInfoEnum=0x7FFFFFFF} +#define ALIASINFOALL ( 1 ) +#define ALIASINFONAME ( 2 ) +#define ALIASINFODESCRIPTION ( 3 ) +#endif +; + +union samr_AliasInfo { + struct samr_AliasInfoAll all;/* [case(ALIASINFOALL)] */ + struct lsa_String name;/* [case(ALIASINFONAME)] */ + struct lsa_String description;/* [case(ALIASINFODESCRIPTION)] */ +}/* [switch_type(samr_AliasInfoEnum)] */; + +struct samr_UserInfo1 { + struct lsa_String account_name; + struct lsa_String full_name; + uint32_t primary_gid; + struct lsa_String description; + struct lsa_String comment; +}; + +struct samr_UserInfo2 { + struct lsa_String comment; + struct lsa_String unknown; + uint16_t country_code; + uint16_t code_page; +}; + +struct samr_LogonHours { + uint16_t units_per_week; + uint8_t *bits;/* [unique,length_is(units_per_week/8),size_is(1260)] */ +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct samr_UserInfo3 { + struct lsa_String account_name; + struct lsa_String full_name; + uint32_t rid; + uint32_t primary_gid; + struct lsa_String home_directory; + struct lsa_String home_drive; + struct lsa_String logon_script; + struct lsa_String profile_path; + struct lsa_String workstations; + NTTIME last_logon; + NTTIME last_logoff; + NTTIME last_password_change; + NTTIME allow_password_change; + NTTIME force_password_change; + struct samr_LogonHours logon_hours; + uint16_t bad_password_count; + uint16_t logon_count; + uint32_t acct_flags; +}; + +struct samr_UserInfo4 { + struct samr_LogonHours logon_hours; +}; + +struct samr_UserInfo5 { + struct lsa_String account_name; + struct lsa_String full_name; + uint32_t rid; + uint32_t primary_gid; + struct lsa_String home_directory; + struct lsa_String home_drive; + struct lsa_String logon_script; + struct lsa_String profile_path; + struct lsa_String description; + struct lsa_String workstations; + NTTIME last_logon; + NTTIME last_logoff; + struct samr_LogonHours logon_hours; + uint16_t bad_password_count; + uint16_t logon_count; + NTTIME last_password_change; + NTTIME acct_expiry; + uint32_t acct_flags; +}; + +struct samr_UserInfo6 { + struct lsa_String account_name; + struct lsa_String full_name; +}; + +struct samr_UserInfo7 { + struct lsa_String account_name; +}; + +struct samr_UserInfo8 { + struct lsa_String full_name; +}; + +struct samr_UserInfo9 { + uint32_t primary_gid; +}; + +struct samr_UserInfo10 { + struct lsa_String home_directory; + struct lsa_String home_drive; +}; + +struct samr_UserInfo11 { + struct lsa_String logon_script; +}; + +struct samr_UserInfo12 { + struct lsa_String profile_path; +}; + +struct samr_UserInfo13 { + struct lsa_String description; +}; + +struct samr_UserInfo14 { + struct lsa_String workstations; +}; + +struct samr_UserInfo16 { + uint32_t acct_flags; +}; + +struct samr_UserInfo17 { + NTTIME acct_expiry; +}; + +struct samr_Password { + uint8_t hash[16]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct samr_UserInfo18 { + struct samr_Password nt_pwd; + struct samr_Password lm_pwd; + uint8_t nt_pwd_active; + uint8_t lm_pwd_active; + uint8_t password_expired; +}; + +struct samr_UserInfo20 { + struct lsa_BinaryString parameters; +}; + +/* bitmap samr_FieldsPresent */ +#define SAMR_FIELD_ACCOUNT_NAME ( 0x00000001 ) +#define SAMR_FIELD_FULL_NAME ( 0x00000002 ) +#define SAMR_FIELD_RID ( 0x00000004 ) +#define SAMR_FIELD_PRIMARY_GID ( 0x00000008 ) +#define SAMR_FIELD_DESCRIPTION ( 0x00000010 ) +#define SAMR_FIELD_COMMENT ( 0x00000020 ) +#define SAMR_FIELD_HOME_DIRECTORY ( 0x00000040 ) +#define SAMR_FIELD_HOME_DRIVE ( 0x00000080 ) +#define SAMR_FIELD_LOGON_SCRIPT ( 0x00000100 ) +#define SAMR_FIELD_PROFILE_PATH ( 0x00000200 ) +#define SAMR_FIELD_WORKSTATIONS ( 0x00000400 ) +#define SAMR_FIELD_LAST_LOGON ( 0x00000800 ) +#define SAMR_FIELD_LAST_LOGOFF ( 0x00001000 ) +#define SAMR_FIELD_LOGON_HOURS ( 0x00002000 ) +#define SAMR_FIELD_BAD_PWD_COUNT ( 0x00004000 ) +#define SAMR_FIELD_NUM_LOGONS ( 0x00008000 ) +#define SAMR_FIELD_ALLOW_PWD_CHANGE ( 0x00010000 ) +#define SAMR_FIELD_FORCE_PWD_CHANGE ( 0x00020000 ) +#define SAMR_FIELD_LAST_PWD_CHANGE ( 0x00040000 ) +#define SAMR_FIELD_ACCT_EXPIRY ( 0x00080000 ) +#define SAMR_FIELD_ACCT_FLAGS ( 0x00100000 ) +#define SAMR_FIELD_PARAMETERS ( 0x00200000 ) +#define SAMR_FIELD_COUNTRY_CODE ( 0x00400000 ) +#define SAMR_FIELD_CODE_PAGE ( 0x00800000 ) +#define SAMR_FIELD_NT_PASSWORD_PRESENT ( 0x01000000 ) +#define SAMR_FIELD_LM_PASSWORD_PRESENT ( 0x02000000 ) +#define SAMR_FIELD_PRIVATE_DATA ( 0x04000000 ) +#define SAMR_FIELD_EXPIRED_FLAG ( 0x08000000 ) +#define SAMR_FIELD_SEC_DESC ( 0x10000000 ) +#define SAMR_FIELD_OWF_PWD ( 0x20000000 ) + +struct samr_UserInfo21 { + NTTIME last_logon; + NTTIME last_logoff; + NTTIME last_password_change; + NTTIME acct_expiry; + NTTIME allow_password_change; + NTTIME force_password_change; + struct lsa_String account_name; + struct lsa_String full_name; + struct lsa_String home_directory; + struct lsa_String home_drive; + struct lsa_String logon_script; + struct lsa_String profile_path; + struct lsa_String description; + struct lsa_String workstations; + struct lsa_String comment; + struct lsa_BinaryString parameters; + struct lsa_BinaryString lm_owf_password; + struct lsa_BinaryString nt_owf_password; + struct lsa_String unknown3; + uint32_t buf_count; + uint8_t *buffer;/* [unique,size_is(buf_count)] */ + uint32_t rid; + uint32_t primary_gid; + uint32_t acct_flags; + uint32_t fields_present; + struct samr_LogonHours logon_hours; + uint16_t bad_password_count; + uint16_t logon_count; + uint16_t country_code; + uint16_t code_page; + uint8_t lm_password_set; + uint8_t nt_password_set; + uint8_t password_expired; + uint8_t unknown4; +}; + +struct samr_CryptPassword { + uint8_t data[516]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct samr_UserInfo23 { + struct samr_UserInfo21 info; + struct samr_CryptPassword password; +}; + +struct samr_UserInfo24 { + struct samr_CryptPassword password; + uint8_t password_expired; +}; + +struct samr_CryptPasswordEx { + uint8_t data[532]; +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct samr_UserInfo25 { + struct samr_UserInfo21 info; + struct samr_CryptPasswordEx password; +}; + +struct samr_UserInfo26 { + struct samr_CryptPasswordEx password; + uint8_t password_expired; +}; + +union samr_UserInfo { + struct samr_UserInfo1 info1;/* [case] */ + struct samr_UserInfo2 info2;/* [case(2)] */ + struct samr_UserInfo3 info3;/* [case(3)] */ + struct samr_UserInfo4 info4;/* [case(4)] */ + struct samr_UserInfo5 info5;/* [case(5)] */ + struct samr_UserInfo6 info6;/* [case(6)] */ + struct samr_UserInfo7 info7;/* [case(7)] */ + struct samr_UserInfo8 info8;/* [case(8)] */ + struct samr_UserInfo9 info9;/* [case(9)] */ + struct samr_UserInfo10 info10;/* [case(10)] */ + struct samr_UserInfo11 info11;/* [case(11)] */ + struct samr_UserInfo12 info12;/* [case(12)] */ + struct samr_UserInfo13 info13;/* [case(13)] */ + struct samr_UserInfo14 info14;/* [case(14)] */ + struct samr_UserInfo16 info16;/* [case(16)] */ + struct samr_UserInfo17 info17;/* [case(17)] */ + struct samr_UserInfo18 info18;/* [case(18)] */ + struct samr_UserInfo20 info20;/* [case(20)] */ + struct samr_UserInfo21 info21;/* [case(21)] */ + struct samr_UserInfo23 info23;/* [case(23)] */ + struct samr_UserInfo24 info24;/* [case(24)] */ + struct samr_UserInfo25 info25;/* [case(25)] */ + struct samr_UserInfo26 info26;/* [case(26)] */ +}/* [switch_type(uint16)] */; + +struct samr_RidWithAttribute { + uint32_t rid; + uint32_t attributes; +}/* [public] */; + +struct samr_RidWithAttributeArray { + uint32_t count; + struct samr_RidWithAttribute *rids;/* [unique,size_is(count)] */ +}/* [public] */; + +struct samr_DispEntryGeneral { + uint32_t idx; + uint32_t rid; + uint32_t acct_flags; + struct lsa_String account_name; + struct lsa_String description; + struct lsa_String full_name; +}; + +struct samr_DispInfoGeneral { + uint32_t count; + struct samr_DispEntryGeneral *entries;/* [unique,size_is(count)] */ +}; + +struct samr_DispEntryFull { + uint32_t idx; + uint32_t rid; + uint32_t acct_flags; + struct lsa_String account_name; + struct lsa_String description; +}; + +struct samr_DispInfoFull { + uint32_t count; + struct samr_DispEntryFull *entries;/* [unique,size_is(count)] */ +}; + +struct samr_DispEntryFullGroup { + uint32_t idx; + uint32_t rid; + uint32_t acct_flags; + struct lsa_String account_name; + struct lsa_String description; +}; + +struct samr_DispInfoFullGroups { + uint32_t count; + struct samr_DispEntryFullGroup *entries;/* [unique,size_is(count)] */ +}; + +struct samr_DispEntryAscii { + uint32_t idx; + struct lsa_AsciiStringLarge account_name; +}; + +struct samr_DispInfoAscii { + uint32_t count; + struct samr_DispEntryAscii *entries;/* [unique,size_is(count)] */ +}; + +union samr_DispInfo { + struct samr_DispInfoGeneral info1;/* [case] */ + struct samr_DispInfoFull info2;/* [case(2)] */ + struct samr_DispInfoFullGroups info3;/* [case(3)] */ + struct samr_DispInfoAscii info4;/* [case(4)] */ + struct samr_DispInfoAscii info5;/* [case(5)] */ +}/* [switch_type(uint16)] */; + +struct samr_PwInfo { + uint16_t min_password_length; + uint32_t password_properties; +}; + +enum samr_ConnectVersion +#ifndef USE_UINT_ENUMS + { + SAMR_CONNECT_PRE_W2K=1, + SAMR_CONNECT_W2K=2, + SAMR_CONNECT_AFTER_W2K=3 +} +#else + { __donnot_use_enum_samr_ConnectVersion=0x7FFFFFFF} +#define SAMR_CONNECT_PRE_W2K ( 1 ) +#define SAMR_CONNECT_W2K ( 2 ) +#define SAMR_CONNECT_AFTER_W2K ( 3 ) +#endif +; + +enum samr_RejectReason; + +struct samr_ChangeReject { + enum samr_RejectReason reason; + uint32_t unknown1; + uint32_t unknown2; +}; + +struct samr_ConnectInfo1 { + enum samr_ConnectVersion client_version; + uint32_t unknown2; +}; + +union samr_ConnectInfo { + struct samr_ConnectInfo1 info1;/* [case] */ +}; + +/* bitmap samr_ValidateFieldsPresent */ +#define SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET ( 0x00000001 ) +#define SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME ( 0x00000002 ) +#define SAMR_VALIDATE_FIELD_LOCKOUT_TIME ( 0x00000004 ) +#define SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT ( 0x00000008 ) +#define SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH ( 0x00000010 ) +#define SAMR_VALIDATE_FIELD_PASSWORD_HISTORY ( 0x00000020 ) + +enum samr_ValidatePasswordLevel +#ifndef USE_UINT_ENUMS + { + NetValidateAuthentication=1, + NetValidatePasswordChange=2, + NetValidatePasswordReset=3 +} +#else + { __donnot_use_enum_samr_ValidatePasswordLevel=0x7FFFFFFF} +#define NetValidateAuthentication ( 1 ) +#define NetValidatePasswordChange ( 2 ) +#define NetValidatePasswordReset ( 3 ) +#endif +; + +enum samr_ValidationStatus +#ifndef USE_UINT_ENUMS + { + SAMR_VALIDATION_STATUS_SUCCESS=0, + SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE=1, + SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT=2, + SAMR_VALIDATION_STATUS_BAD_PASSWORD=4, + SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT=5, + SAMR_VALIDATION_STATUS_PWD_TOO_SHORT=6, + SAMR_VALIDATION_STATUS_PWD_TOO_LONG=7, + SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH=8, + SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT=9 +} +#else + { __donnot_use_enum_samr_ValidationStatus=0x7FFFFFFF} +#define SAMR_VALIDATION_STATUS_SUCCESS ( 0 ) +#define SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE ( 1 ) +#define SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT ( 2 ) +#define SAMR_VALIDATION_STATUS_BAD_PASSWORD ( 4 ) +#define SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT ( 5 ) +#define SAMR_VALIDATION_STATUS_PWD_TOO_SHORT ( 6 ) +#define SAMR_VALIDATION_STATUS_PWD_TOO_LONG ( 7 ) +#define SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH ( 8 ) +#define SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT ( 9 ) +#endif +; + +struct samr_ValidationBlob { + uint32_t length; + uint8_t *data;/* [unique,size_is(length)] */ +}; + +struct samr_ValidatePasswordInfo { + uint32_t fields_present; + NTTIME last_password_change; + NTTIME bad_password_time; + NTTIME lockout_time; + uint32_t bad_pwd_count; + uint32_t pwd_history_len; + struct samr_ValidationBlob *pwd_history;/* [unique,size_is(pwd_history_len)] */ +}; + +struct samr_ValidatePasswordRepCtr { + struct samr_ValidatePasswordInfo info; + enum samr_ValidationStatus status; +}; + +union samr_ValidatePasswordRep { + struct samr_ValidatePasswordRepCtr ctr1;/* [case] */ + struct samr_ValidatePasswordRepCtr ctr2;/* [case(2)] */ + struct samr_ValidatePasswordRepCtr ctr3;/* [case(3)] */ +}/* [switch_type(uint16)] */; + +struct samr_ValidatePasswordReq3 { + struct samr_ValidatePasswordInfo info; + struct lsa_StringLarge password; + struct lsa_StringLarge account; + struct samr_ValidationBlob hash; + uint8_t pwd_must_change_at_next_logon; + uint8_t clear_lockout; +}; + +struct samr_ValidatePasswordReq2 { + struct samr_ValidatePasswordInfo info; + struct lsa_StringLarge password; + struct lsa_StringLarge account; + struct samr_ValidationBlob hash; + uint8_t password_matched; +}; + +struct samr_ValidatePasswordReq1 { + struct samr_ValidatePasswordInfo info; + uint8_t password_matched; +}; + +union samr_ValidatePasswordReq { + struct samr_ValidatePasswordReq1 req1;/* [case] */ + struct samr_ValidatePasswordReq2 req2;/* [case(2)] */ + struct samr_ValidatePasswordReq3 req3;/* [case(3)] */ +}/* [switch_type(uint16)] */; + + +struct samr_Connect { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Close { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetSecurity { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t sec_info; + struct sec_desc_buf *sdbuf;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_QuerySecurity { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t sec_info; + } in; + + struct { + struct sec_desc_buf **sdbuf;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Shutdown { + struct { + struct policy_handle *connect_handle;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_LookupDomain { + struct { + struct policy_handle *connect_handle;/* [ref] */ + struct lsa_String *domain_name;/* [ref] */ + } in; + + struct { + struct dom_sid2 **sid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_EnumDomains { + struct { + struct policy_handle *connect_handle;/* [ref] */ + uint32_t buf_size; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct samr_SamArray **sam;/* [ref] */ + uint32_t *num_entries;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_OpenDomain { + struct { + struct policy_handle *connect_handle;/* [ref] */ + uint32_t access_mask; + struct dom_sid2 *sid;/* [ref] */ + } in; + + struct { + struct policy_handle *domain_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDomainInfo { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + } in; + + struct { + union samr_DomainInfo **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetDomainInfo { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + union samr_DomainInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_CreateDomainGroup { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_String *name;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *group_handle;/* [ref] */ + uint32_t *rid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_EnumDomainGroups { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t max_size; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct samr_SamArray **sam;/* [ref] */ + uint32_t *num_entries;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_CreateUser { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_String *account_name;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *user_handle;/* [ref] */ + uint32_t *rid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_EnumDomainUsers { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t acct_flags; + uint32_t max_size; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct samr_SamArray **sam;/* [ref] */ + uint32_t *num_entries;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_CreateDomAlias { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_String *alias_name;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *alias_handle;/* [ref] */ + uint32_t *rid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_EnumDomainAliases { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t max_size; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct samr_SamArray **sam;/* [ref] */ + uint32_t *num_entries;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_GetAliasMembership { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_SidArray *sids;/* [ref] */ + } in; + + struct { + struct samr_Ids *rids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_LookupNames { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t num_names;/* [range(0,1000)] */ + struct lsa_String *names;/* [length_is(num_names),size_is(1000)] */ + } in; + + struct { + struct samr_Ids *rids;/* [ref] */ + struct samr_Ids *types;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_LookupRids { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t num_rids;/* [range(0,1000)] */ + uint32_t *rids;/* [length_is(num_rids),size_is(1000)] */ + } in; + + struct { + struct lsa_Strings *names;/* [ref] */ + struct samr_Ids *types;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_OpenGroup { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t access_mask; + uint32_t rid; + } in; + + struct { + struct policy_handle *group_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryGroupInfo { + struct { + struct policy_handle *group_handle;/* [ref] */ + enum samr_GroupInfoEnum level; + } in; + + struct { + union samr_GroupInfo **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetGroupInfo { + struct { + struct policy_handle *group_handle;/* [ref] */ + enum samr_GroupInfoEnum level; + union samr_GroupInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_AddGroupMember { + struct { + struct policy_handle *group_handle;/* [ref] */ + uint32_t rid; + uint32_t flags; + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteDomainGroup { + struct { + struct policy_handle *group_handle;/* [ref] */ + } in; + + struct { + struct policy_handle *group_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteGroupMember { + struct { + struct policy_handle *group_handle;/* [ref] */ + uint32_t rid; + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_QueryGroupMember { + struct { + struct policy_handle *group_handle;/* [ref] */ + } in; + + struct { + struct samr_RidTypeArray **rids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetMemberAttributesOfGroup { + struct { + struct policy_handle *group_handle;/* [ref] */ + uint32_t unknown1; + uint32_t unknown2; + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_OpenAlias { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t access_mask; + uint32_t rid; + } in; + + struct { + struct policy_handle *alias_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryAliasInfo { + struct { + struct policy_handle *alias_handle;/* [ref] */ + enum samr_AliasInfoEnum level; + } in; + + struct { + union samr_AliasInfo **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetAliasInfo { + struct { + struct policy_handle *alias_handle;/* [ref] */ + enum samr_AliasInfoEnum level; + union samr_AliasInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteDomAlias { + struct { + struct policy_handle *alias_handle;/* [ref] */ + } in; + + struct { + struct policy_handle *alias_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_AddAliasMember { + struct { + struct policy_handle *alias_handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteAliasMember { + struct { + struct policy_handle *alias_handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetMembersInAlias { + struct { + struct policy_handle *alias_handle;/* [ref] */ + } in; + + struct { + struct lsa_SidArray *sids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_OpenUser { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t access_mask; + uint32_t rid; + } in; + + struct { + struct policy_handle *user_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteUser { + struct { + struct policy_handle *user_handle;/* [ref] */ + } in; + + struct { + struct policy_handle *user_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryUserInfo { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint16_t level; + } in; + + struct { + union samr_UserInfo **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetUserInfo { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint16_t level; + union samr_UserInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_ChangePasswordUser { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint8_t lm_present; + struct samr_Password *old_lm_crypted;/* [unique] */ + struct samr_Password *new_lm_crypted;/* [unique] */ + uint8_t nt_present; + struct samr_Password *old_nt_crypted;/* [unique] */ + struct samr_Password *new_nt_crypted;/* [unique] */ + uint8_t cross1_present; + struct samr_Password *nt_cross;/* [unique] */ + uint8_t cross2_present; + struct samr_Password *lm_cross;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetGroupsForUser { + struct { + struct policy_handle *user_handle;/* [ref] */ + } in; + + struct { + struct samr_RidWithAttributeArray **rids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDisplayInfo { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + uint32_t start_idx; + uint32_t max_entries; + uint32_t buf_size; + } in; + + struct { + uint32_t *total_size;/* [ref] */ + uint32_t *returned_size;/* [ref] */ + union samr_DispInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_GetDisplayEnumerationIndex { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + struct lsa_String *name;/* [ref] */ + } in; + + struct { + uint32_t *idx;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_TestPrivateFunctionsDomain { + struct { + struct policy_handle *domain_handle;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_TestPrivateFunctionsUser { + struct { + struct policy_handle *user_handle;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetUserPwInfo { + struct { + struct policy_handle *user_handle;/* [ref] */ + } in; + + struct { + struct samr_PwInfo *info;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_RemoveMemberFromForeignDomain { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDomainInfo2 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + } in; + + struct { + union samr_DomainInfo **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryUserInfo2 { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint16_t level; + } in; + + struct { + union samr_UserInfo **info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDisplayInfo2 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + uint32_t start_idx; + uint32_t max_entries; + uint32_t buf_size; + } in; + + struct { + uint32_t *total_size;/* [ref] */ + uint32_t *returned_size;/* [ref] */ + union samr_DispInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_GetDisplayEnumerationIndex2 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + struct lsa_String *name;/* [ref] */ + } in; + + struct { + uint32_t *idx;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_CreateUser2 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_String *account_name;/* [ref] */ + uint32_t acct_flags; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *user_handle;/* [ref] */ + uint32_t *access_granted;/* [ref] */ + uint32_t *rid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDisplayInfo3 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + uint32_t start_idx; + uint32_t max_entries; + uint32_t buf_size; + } in; + + struct { + uint32_t *total_size;/* [ref] */ + uint32_t *returned_size;/* [ref] */ + union samr_DispInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_AddMultipleMembersToAlias { + struct { + struct policy_handle *alias_handle;/* [ref] */ + struct lsa_SidArray *sids;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_RemoveMultipleMembersFromAlias { + struct { + struct policy_handle *alias_handle;/* [ref] */ + struct lsa_SidArray *sids;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_OemChangePasswordUser2 { + struct { + struct lsa_AsciiString *server;/* [unique] */ + struct lsa_AsciiString *account;/* [ref] */ + struct samr_CryptPassword *password;/* [unique] */ + struct samr_Password *hash;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_ChangePasswordUser2 { + struct { + struct lsa_String *server;/* [unique] */ + struct lsa_String *account;/* [ref] */ + struct samr_CryptPassword *nt_password;/* [unique] */ + struct samr_Password *nt_verifier;/* [unique] */ + uint8_t lm_change; + struct samr_CryptPassword *lm_password;/* [unique] */ + struct samr_Password *lm_verifier;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetDomPwInfo { + struct { + struct lsa_String *domain_name;/* [unique] */ + } in; + + struct { + struct samr_PwInfo *info;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Connect2 { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetUserInfo2 { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint16_t level; + union samr_UserInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_SetBootKeyInformation { + struct { + struct policy_handle *connect_handle;/* [ref] */ + uint32_t unknown1; + uint32_t unknown2; + uint32_t unknown3; + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetBootKeyInformation { + struct { + struct policy_handle *domain_handle;/* [ref] */ + } in; + + struct { + uint32_t *unknown;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Connect3 { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + uint32_t unknown; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Connect4 { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + enum samr_ConnectVersion client_version; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_ChangePasswordUser3 { + struct { + struct lsa_String *server;/* [unique] */ + struct lsa_String *account;/* [ref] */ + struct samr_CryptPassword *nt_password;/* [unique] */ + struct samr_Password *nt_verifier;/* [unique] */ + uint8_t lm_change; + struct samr_CryptPassword *lm_password;/* [unique] */ + struct samr_Password *lm_verifier;/* [unique] */ + struct samr_CryptPassword *password3;/* [unique] */ + } in; + + struct { + struct samr_DomInfo1 **dominfo;/* [ref] */ + struct samr_ChangeReject **reject;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Connect5 { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + uint32_t access_mask; + uint32_t level_in; + union samr_ConnectInfo *info_in;/* [ref,switch_is(level_in)] */ + } in; + + struct { + uint32_t *level_out;/* [ref] */ + union samr_ConnectInfo *info_out;/* [ref,switch_is(*level_out)] */ + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_RidToSid { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t rid; + } in; + + struct { + struct dom_sid2 **sid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetDsrmPassword { + struct { + struct lsa_String *name;/* [unique] */ + uint32_t unknown; + struct samr_Password *hash;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_ValidatePassword { + struct { + enum samr_ValidatePasswordLevel level; + union samr_ValidatePasswordReq *req;/* [ref,switch_is(level)] */ + } in; + + struct { + union samr_ValidatePasswordRep **rep;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + +#endif /* _HEADER_samr */ diff --git a/librpc/gen_ndr/security.h b/librpc/gen_ndr/security.h new file mode 100644 index 0000000000..2b422608ea --- /dev/null +++ b/librpc/gen_ndr/security.h @@ -0,0 +1,354 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/misc.h" +#define dom_sid2 dom_sid +#define dom_sid28 dom_sid +#define dom_sid0 dom_sid +#ifndef _HEADER_security +#define _HEADER_security + +#define SEC_MASK_GENERIC ( 0xF0000000 ) +#define SEC_MASK_FLAGS ( 0x0F000000 ) +#define SEC_MASK_STANDARD ( 0x00FF0000 ) +#define SEC_MASK_SPECIFIC ( 0x0000FFFF ) +#define SEC_GENERIC_ALL ( 0x10000000 ) +#define SEC_GENERIC_EXECUTE ( 0x20000000 ) +#define SEC_GENERIC_WRITE ( 0x40000000 ) +#define SEC_GENERIC_READ ( 0x80000000 ) +#define SEC_FLAG_SYSTEM_SECURITY ( 0x01000000 ) +#define SEC_FLAG_MAXIMUM_ALLOWED ( 0x02000000 ) +#define SEC_STD_DELETE ( 0x00010000 ) +#define SEC_STD_READ_CONTROL ( 0x00020000 ) +#define SEC_STD_WRITE_DAC ( 0x00040000 ) +#define SEC_STD_WRITE_OWNER ( 0x00080000 ) +#define SEC_STD_SYNCHRONIZE ( 0x00100000 ) +#define SEC_STD_REQUIRED ( 0x000F0000 ) +#define SEC_STD_ALL ( 0x001F0000 ) +#define SEC_FILE_READ_DATA ( 0x00000001 ) +#define SEC_FILE_WRITE_DATA ( 0x00000002 ) +#define SEC_FILE_APPEND_DATA ( 0x00000004 ) +#define SEC_FILE_READ_EA ( 0x00000008 ) +#define SEC_FILE_WRITE_EA ( 0x00000010 ) +#define SEC_FILE_EXECUTE ( 0x00000020 ) +#define SEC_FILE_READ_ATTRIBUTE ( 0x00000080 ) +#define SEC_FILE_WRITE_ATTRIBUTE ( 0x00000100 ) +#define SEC_FILE_ALL ( 0x000001ff ) +#define SEC_DIR_LIST ( 0x00000001 ) +#define SEC_DIR_ADD_FILE ( 0x00000002 ) +#define SEC_DIR_ADD_SUBDIR ( 0x00000004 ) +#define SEC_DIR_READ_EA ( 0x00000008 ) +#define SEC_DIR_WRITE_EA ( 0x00000010 ) +#define SEC_DIR_TRAVERSE ( 0x00000020 ) +#define SEC_DIR_DELETE_CHILD ( 0x00000040 ) +#define SEC_DIR_READ_ATTRIBUTE ( 0x00000080 ) +#define SEC_DIR_WRITE_ATTRIBUTE ( 0x00000100 ) +#define SEC_REG_QUERY_VALUE ( 0x00000001 ) +#define SEC_REG_SET_VALUE ( 0x00000002 ) +#define SEC_REG_CREATE_SUBKEY ( 0x00000004 ) +#define SEC_REG_ENUM_SUBKEYS ( 0x00000008 ) +#define SEC_REG_NOTIFY ( 0x00000010 ) +#define SEC_REG_CREATE_LINK ( 0x00000020 ) +#define SEC_ADS_CREATE_CHILD ( 0x00000001 ) +#define SEC_ADS_DELETE_CHILD ( 0x00000002 ) +#define SEC_ADS_LIST ( 0x00000004 ) +#define SEC_ADS_SELF_WRITE ( 0x00000008 ) +#define SEC_ADS_READ_PROP ( 0x00000010 ) +#define SEC_ADS_WRITE_PROP ( 0x00000020 ) +#define SEC_ADS_DELETE_TREE ( 0x00000040 ) +#define SEC_ADS_LIST_OBJECT ( 0x00000080 ) +#define SEC_ADS_CONTROL_ACCESS ( 0x00000100 ) +#define SEC_MASK_INVALID ( 0x0ce0fe00 ) +#define SEC_RIGHTS_FILE_READ ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_READ_EA ) +#define SEC_RIGHTS_FILE_WRITE ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_WRITE_DATA|SEC_FILE_WRITE_ATTRIBUTE|SEC_FILE_WRITE_EA|SEC_FILE_APPEND_DATA ) +#define SEC_RIGHTS_FILE_EXECUTE ( SEC_STD_SYNCHRONIZE|SEC_STD_READ_CONTROL|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_EXECUTE ) +#define SEC_RIGHTS_FILE_ALL ( SEC_STD_ALL|SEC_FILE_ALL ) +#define SEC_RIGHTS_DIR_READ ( SEC_RIGHTS_FILE_READ ) +#define SEC_RIGHTS_DIR_WRITE ( SEC_RIGHTS_FILE_WRITE ) +#define SEC_RIGHTS_DIR_EXECUTE ( SEC_RIGHTS_FILE_EXECUTE ) +#define SEC_RIGHTS_DIR_ALL ( SEC_RIGHTS_FILE_ALL ) +#define STANDARD_RIGHTS_ALL_ACCESS ( SEC_STD_ALL ) +#define STANDARD_RIGHTS_MODIFY_ACCESS ( SEC_STD_READ_CONTROL ) +#define STANDARD_RIGHTS_EXECUTE_ACCESS ( SEC_STD_READ_CONTROL ) +#define STANDARD_RIGHTS_READ_ACCESS ( SEC_STD_READ_CONTROL ) +#define STANDARD_RIGHTS_WRITE_ACCESS ( (SEC_STD_WRITE_OWNER|SEC_STD_WRITE_DAC|SEC_STD_DELETE) ) +#define STANDARD_RIGHTS_REQUIRED_ACCESS ( (SEC_STD_DELETE|SEC_STD_READ_CONTROL|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER) ) +#define SID_NULL ( "S-1-0-0" ) +#define NAME_WORLD ( "WORLD" ) +#define SID_WORLD_DOMAIN ( "S-1-1" ) +#define SID_WORLD ( "S-1-1-0" ) +#define SID_CREATOR_OWNER_DOMAIN ( "S-1-3" ) +#define SID_CREATOR_OWNER ( "S-1-3-0" ) +#define SID_CREATOR_GROUP ( "S-1-3-1" ) +#define SID_OWNER_RIGHTS ( "S-1-3-4" ) +#define NAME_NT_AUTHORITY ( "NT AUTHORITY" ) +#define SID_NT_AUTHORITY ( "S-1-5" ) +#define SID_NT_DIALUP ( "S-1-5-1" ) +#define SID_NT_NETWORK ( "S-1-5-2" ) +#define SID_NT_BATCH ( "S-1-5-3" ) +#define SID_NT_INTERACTIVE ( "S-1-5-4" ) +#define SID_NT_SERVICE ( "S-1-5-6" ) +#define SID_NT_ANONYMOUS ( "S-1-5-7" ) +#define SID_NT_PROXY ( "S-1-5-8" ) +#define SID_NT_ENTERPRISE_DCS ( "S-1-5-9" ) +#define SID_NT_SELF ( "S-1-5-10" ) +#define SID_NT_AUTHENTICATED_USERS ( "S-1-5-11" ) +#define SID_NT_RESTRICTED ( "S-1-5-12" ) +#define SID_NT_TERMINAL_SERVER_USERS ( "S-1-5-13" ) +#define SID_NT_REMOTE_INTERACTIVE ( "S-1-5-14" ) +#define SID_NT_THIS_ORGANISATION ( "S-1-5-15" ) +#define SID_NT_IUSR ( "S-1-5-17" ) +#define SID_NT_SYSTEM ( "S-1-5-18" ) +#define SID_NT_LOCAL_SERVICE ( "S-1-5-19" ) +#define SID_NT_NETWORK_SERVICE ( "S-1-5-20" ) +#define SID_NT_DIGEST_AUTHENTICATION ( "S-1-5-64-21" ) +#define SID_NT_NTLM_AUTHENTICATION ( "S-1-5-64-10" ) +#define SID_NT_SCHANNEL_AUTHENTICATION ( "S-1-5-64-14" ) +#define SID_NT_OTHER_ORGANISATION ( "S-1-5-1000" ) +#define NAME_BUILTIN ( "BUILTIN" ) +#define SID_BUILTIN ( "S-1-5-32" ) +#define SID_BUILTIN_ADMINISTRATORS ( "S-1-5-32-544" ) +#define SID_BUILTIN_USERS ( "S-1-5-32-545" ) +#define SID_BUILTIN_GUESTS ( "S-1-5-32-546" ) +#define SID_BUILTIN_POWER_USERS ( "S-1-5-32-547" ) +#define SID_BUILTIN_ACCOUNT_OPERATORS ( "S-1-5-32-548" ) +#define SID_BUILTIN_SERVER_OPERATORS ( "S-1-5-32-549" ) +#define SID_BUILTIN_PRINT_OPERATORS ( "S-1-5-32-550" ) +#define SID_BUILTIN_BACKUP_OPERATORS ( "S-1-5-32-551" ) +#define SID_BUILTIN_REPLICATOR ( "S-1-5-32-552" ) +#define SID_BUILTIN_RAS_SERVERS ( "S-1-5-32-553" ) +#define SID_BUILTIN_PREW2K ( "S-1-5-32-554" ) +#define DOMAIN_RID_LOGON ( 9 ) +#define DOMAIN_RID_ADMINISTRATOR ( 500 ) +#define DOMAIN_RID_GUEST ( 501 ) +#define DOMAIN_RID_ADMINS ( 512 ) +#define DOMAIN_RID_USERS ( 513 ) +#define DOMAIN_RID_DOMAIN_MEMBERS ( 515 ) +#define DOMAIN_RID_DCS ( 516 ) +#define DOMAIN_RID_CERT_ADMINS ( 517 ) +#define DOMAIN_RID_SCHEMA_ADMINS ( 518 ) +#define DOMAIN_RID_ENTERPRISE_ADMINS ( 519 ) +#define NT4_ACL_REVISION ( SECURITY_ACL_REVISION_NT4 ) +#define SD_REVISION ( SECURITY_DESCRIPTOR_REVISION_1 ) +struct dom_sid { + uint8_t sid_rev_num; + int8_t num_auths;/* [range(0,15)] */ + uint8_t id_auth[6]; + uint32_t sub_auths[15]; +}/* [noprint,gensize,nopull,public,nopush,nosize] */; + +enum sec_privilege +#ifndef USE_UINT_ENUMS + { + SEC_PRIV_SECURITY=1, + SEC_PRIV_BACKUP=2, + SEC_PRIV_RESTORE=3, + SEC_PRIV_SYSTEMTIME=4, + SEC_PRIV_SHUTDOWN=5, + SEC_PRIV_REMOTE_SHUTDOWN=6, + SEC_PRIV_TAKE_OWNERSHIP=7, + SEC_PRIV_DEBUG=8, + SEC_PRIV_SYSTEM_ENVIRONMENT=9, + SEC_PRIV_SYSTEM_PROFILE=10, + SEC_PRIV_PROFILE_SINGLE_PROCESS=11, + SEC_PRIV_INCREASE_BASE_PRIORITY=12, + SEC_PRIV_LOAD_DRIVER=13, + SEC_PRIV_CREATE_PAGEFILE=14, + SEC_PRIV_INCREASE_QUOTA=15, + SEC_PRIV_CHANGE_NOTIFY=16, + SEC_PRIV_UNDOCK=17, + SEC_PRIV_MANAGE_VOLUME=18, + SEC_PRIV_IMPERSONATE=19, + SEC_PRIV_CREATE_GLOBAL=20, + SEC_PRIV_ENABLE_DELEGATION=21, + SEC_PRIV_INTERACTIVE_LOGON=22, + SEC_PRIV_NETWORK_LOGON=23, + SEC_PRIV_REMOTE_INTERACTIVE_LOGON=24 +} +#else + { __donnot_use_enum_sec_privilege=0x7FFFFFFF} +#define SEC_PRIV_SECURITY ( 1 ) +#define SEC_PRIV_BACKUP ( 2 ) +#define SEC_PRIV_RESTORE ( 3 ) +#define SEC_PRIV_SYSTEMTIME ( 4 ) +#define SEC_PRIV_SHUTDOWN ( 5 ) +#define SEC_PRIV_REMOTE_SHUTDOWN ( 6 ) +#define SEC_PRIV_TAKE_OWNERSHIP ( 7 ) +#define SEC_PRIV_DEBUG ( 8 ) +#define SEC_PRIV_SYSTEM_ENVIRONMENT ( 9 ) +#define SEC_PRIV_SYSTEM_PROFILE ( 10 ) +#define SEC_PRIV_PROFILE_SINGLE_PROCESS ( 11 ) +#define SEC_PRIV_INCREASE_BASE_PRIORITY ( 12 ) +#define SEC_PRIV_LOAD_DRIVER ( 13 ) +#define SEC_PRIV_CREATE_PAGEFILE ( 14 ) +#define SEC_PRIV_INCREASE_QUOTA ( 15 ) +#define SEC_PRIV_CHANGE_NOTIFY ( 16 ) +#define SEC_PRIV_UNDOCK ( 17 ) +#define SEC_PRIV_MANAGE_VOLUME ( 18 ) +#define SEC_PRIV_IMPERSONATE ( 19 ) +#define SEC_PRIV_CREATE_GLOBAL ( 20 ) +#define SEC_PRIV_ENABLE_DELEGATION ( 21 ) +#define SEC_PRIV_INTERACTIVE_LOGON ( 22 ) +#define SEC_PRIV_NETWORK_LOGON ( 23 ) +#define SEC_PRIV_REMOTE_INTERACTIVE_LOGON ( 24 ) +#endif +; + +/* bitmap security_ace_flags */ +#define SEC_ACE_FLAG_OBJECT_INHERIT ( 0x01 ) +#define SEC_ACE_FLAG_CONTAINER_INHERIT ( 0x02 ) +#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT ( 0x04 ) +#define SEC_ACE_FLAG_INHERIT_ONLY ( 0x08 ) +#define SEC_ACE_FLAG_INHERITED_ACE ( 0x10 ) +#define SEC_ACE_FLAG_VALID_INHERIT ( 0x0f ) +#define SEC_ACE_FLAG_SUCCESSFUL_ACCESS ( 0x40 ) +#define SEC_ACE_FLAG_FAILED_ACCESS ( 0x80 ) + +enum security_ace_type +#ifndef USE_UINT_ENUMS + { + SEC_ACE_TYPE_ACCESS_ALLOWED=0, + SEC_ACE_TYPE_ACCESS_DENIED=1, + SEC_ACE_TYPE_SYSTEM_AUDIT=2, + SEC_ACE_TYPE_SYSTEM_ALARM=3, + SEC_ACE_TYPE_ALLOWED_COMPOUND=4, + SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT=5, + SEC_ACE_TYPE_ACCESS_DENIED_OBJECT=6, + SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT=7, + SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT=8 +} +#else + { __donnot_use_enum_security_ace_type=0x7FFFFFFF} +#define SEC_ACE_TYPE_ACCESS_ALLOWED ( 0 ) +#define SEC_ACE_TYPE_ACCESS_DENIED ( 1 ) +#define SEC_ACE_TYPE_SYSTEM_AUDIT ( 2 ) +#define SEC_ACE_TYPE_SYSTEM_ALARM ( 3 ) +#define SEC_ACE_TYPE_ALLOWED_COMPOUND ( 4 ) +#define SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT ( 5 ) +#define SEC_ACE_TYPE_ACCESS_DENIED_OBJECT ( 6 ) +#define SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT ( 7 ) +#define SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT ( 8 ) +#endif +; + +/* bitmap security_ace_object_flags */ +#define SEC_ACE_OBJECT_TYPE_PRESENT ( 0x00000001 ) +#define SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT ( 0x00000002 ) + +union security_ace_object_type { + struct GUID type;/* [case(SEC_ACE_OBJECT_TYPE_PRESENT)] */ +}/* [nodiscriminant] */; + +union security_ace_object_inherited_type { + struct GUID inherited_type;/* [case(SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] */ +}/* [nodiscriminant] */; + +struct security_ace_object { + uint32_t flags; + union security_ace_object_type type;/* [switch_is(flags&SEC_ACE_OBJECT_TYPE_PRESENT)] */ + union security_ace_object_inherited_type inherited_type;/* [switch_is(flags&SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] */ +}; + +union security_ace_object_ctr { + struct security_ace_object object;/* [case(SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT)] */ +}/* [public,nodiscriminant] */; + +struct security_ace { + enum security_ace_type type; + uint8_t flags; + uint16_t size;/* [value(ndr_size_security_ace(r,ndr->flags))] */ + uint32_t access_mask; + union security_ace_object_ctr object;/* [switch_is(type)] */ + struct dom_sid trustee; +}/* [gensize,public,nopull,nosize] */; + +enum security_acl_revision +#ifndef USE_UINT_ENUMS + { + SECURITY_ACL_REVISION_NT4=2, + SECURITY_ACL_REVISION_ADS=4 +} +#else + { __donnot_use_enum_security_acl_revision=0x7FFFFFFF} +#define SECURITY_ACL_REVISION_NT4 ( 2 ) +#define SECURITY_ACL_REVISION_ADS ( 4 ) +#endif +; + +struct security_acl { + enum security_acl_revision revision; + uint16_t size;/* [value(ndr_size_security_acl(r,ndr->flags))] */ + uint32_t num_aces;/* [range(0,1000)] */ + struct security_ace *aces; +}/* [gensize,public,nosize] */; + +enum security_descriptor_revision +#ifndef USE_UINT_ENUMS + { + SECURITY_DESCRIPTOR_REVISION_1=1 +} +#else + { __donnot_use_enum_security_descriptor_revision=0x7FFFFFFF} +#define SECURITY_DESCRIPTOR_REVISION_1 ( 1 ) +#endif +; + +/* bitmap security_descriptor_type */ +#define SEC_DESC_OWNER_DEFAULTED ( 0x0001 ) +#define SEC_DESC_GROUP_DEFAULTED ( 0x0002 ) +#define SEC_DESC_DACL_PRESENT ( 0x0004 ) +#define SEC_DESC_DACL_DEFAULTED ( 0x0008 ) +#define SEC_DESC_SACL_PRESENT ( 0x0010 ) +#define SEC_DESC_SACL_DEFAULTED ( 0x0020 ) +#define SEC_DESC_DACL_TRUSTED ( 0x0040 ) +#define SEC_DESC_SERVER_SECURITY ( 0x0080 ) +#define SEC_DESC_DACL_AUTO_INHERIT_REQ ( 0x0100 ) +#define SEC_DESC_SACL_AUTO_INHERIT_REQ ( 0x0200 ) +#define SEC_DESC_DACL_AUTO_INHERITED ( 0x0400 ) +#define SEC_DESC_SACL_AUTO_INHERITED ( 0x0800 ) +#define SEC_DESC_DACL_PROTECTED ( 0x1000 ) +#define SEC_DESC_SACL_PROTECTED ( 0x2000 ) +#define SEC_DESC_RM_CONTROL_VALID ( 0x4000 ) +#define SEC_DESC_SELF_RELATIVE ( 0x8000 ) + +struct security_descriptor { + enum security_descriptor_revision revision; + uint16_t type; + struct dom_sid *owner_sid;/* [relative] */ + struct dom_sid *group_sid;/* [relative] */ + struct security_acl *sacl;/* [relative] */ + struct security_acl *dacl;/* [relative] */ +}/* [gensize,public,flag(LIBNDR_FLAG_LITTLE_ENDIAN),nosize] */; + +struct sec_desc_buf { + uint32_t sd_size;/* [value(ndr_size_security_descriptor(sd,ndr->flags)),range(0,0x40000)] */ + struct security_descriptor *sd;/* [unique,subcontext(4)] */ +}/* [public] */; + +struct security_token { + struct dom_sid *user_sid;/* [unique] */ + struct dom_sid *group_sid;/* [unique] */ + uint32_t num_sids; + struct dom_sid **sids;/* [unique,size_is(num_sids)] */ + uint64_t privilege_mask; +}/* [public] */; + +/* bitmap security_secinfo */ +#define SECINFO_OWNER ( 0x00000001 ) +#define SECINFO_GROUP ( 0x00000002 ) +#define SECINFO_DACL ( 0x00000004 ) +#define SECINFO_SACL ( 0x00000008 ) +#define SECINFO_UNPROTECTED_SACL ( 0x10000000 ) +#define SECINFO_UNPROTECTED_DACL ( 0x20000000 ) +#define SECINFO_PROTECTED_SACL ( 0x40000000 ) +#define SECINFO_PROTECTED_DACL ( 0x80000000 ) + +/* bitmap kerb_EncTypes */ +#define KERB_ENCTYPE_DES_CBC_CRC ( 0x00000001 ) +#define KERB_ENCTYPE_DES_CBC_MD5 ( 0x00000002 ) +#define KERB_ENCTYPE_RC4_HMAC_MD5 ( 0x00000004 ) +#define KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96 ( 0x00000008 ) +#define KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96 ( 0x00000010 ) + +#endif /* _HEADER_security */ diff --git a/librpc/gen_ndr/srv_dfs.c b/librpc/gen_ndr/srv_dfs.c new file mode 100644 index 0000000000..d58272084a --- /dev/null +++ b/librpc/gen_ndr/srv_dfs.c @@ -0,0 +1,1754 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_dfs.h" + +static bool api_dfs_GetManagerVersion(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_GetManagerVersion *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_GETMANAGERVERSION]; + + r = talloc(talloc_tos(), struct dfs_GetManagerVersion); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_GetManagerVersion, r); + } + + ZERO_STRUCT(r->out); + r->out.version = talloc_zero(r, enum dfs_ManagerVersion); + if (r->out.version == NULL) { + talloc_free(r); + return false; + } + + _dfs_GetManagerVersion(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_GetManagerVersion, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_Add(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_Add *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_ADD]; + + r = talloc(talloc_tos(), struct dfs_Add); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Add, r); + } + + r->out.result = _dfs_Add(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Add, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_Remove(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_Remove *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_REMOVE]; + + r = talloc(talloc_tos(), struct dfs_Remove); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Remove, r); + } + + r->out.result = _dfs_Remove(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Remove, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_SetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_SetInfo *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_SETINFO]; + + r = talloc(talloc_tos(), struct dfs_SetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_SetInfo, r); + } + + r->out.result = _dfs_SetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_SetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_GetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_GetInfo *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_GETINFO]; + + r = talloc(talloc_tos(), struct dfs_GetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_GetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union dfs_Info); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _dfs_GetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_GetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_Enum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_Enum *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_ENUM]; + + r = talloc(talloc_tos(), struct dfs_Enum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Enum, r); + } + + ZERO_STRUCT(r->out); + r->out.info = r->in.info; + r->out.total = r->in.total; + r->out.result = _dfs_Enum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Enum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_Rename(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_Rename *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_RENAME]; + + r = talloc(talloc_tos(), struct dfs_Rename); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Rename, r); + } + + r->out.result = _dfs_Rename(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Rename, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_Move(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_Move *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_MOVE]; + + r = talloc(talloc_tos(), struct dfs_Move); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Move, r); + } + + r->out.result = _dfs_Move(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Move, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_ManagerGetConfigInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_ManagerGetConfigInfo *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERGETCONFIGINFO]; + + r = talloc(talloc_tos(), struct dfs_ManagerGetConfigInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_ManagerGetConfigInfo, r); + } + + r->out.result = _dfs_ManagerGetConfigInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_ManagerGetConfigInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_ManagerSendSiteInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_ManagerSendSiteInfo *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERSENDSITEINFO]; + + r = talloc(talloc_tos(), struct dfs_ManagerSendSiteInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_ManagerSendSiteInfo, r); + } + + r->out.result = _dfs_ManagerSendSiteInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_ManagerSendSiteInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_AddFtRoot(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_AddFtRoot *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_ADDFTROOT]; + + r = talloc(talloc_tos(), struct dfs_AddFtRoot); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_AddFtRoot, r); + } + + ZERO_STRUCT(r->out); + r->out.unknown2 = r->in.unknown2; + r->out.result = _dfs_AddFtRoot(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_AddFtRoot, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_RemoveFtRoot(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_RemoveFtRoot *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_REMOVEFTROOT]; + + r = talloc(talloc_tos(), struct dfs_RemoveFtRoot); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_RemoveFtRoot, r); + } + + ZERO_STRUCT(r->out); + r->out.unknown = r->in.unknown; + r->out.result = _dfs_RemoveFtRoot(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_AddStdRoot(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_AddStdRoot *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_ADDSTDROOT]; + + r = talloc(talloc_tos(), struct dfs_AddStdRoot); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_AddStdRoot, r); + } + + r->out.result = _dfs_AddStdRoot(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_AddStdRoot, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_RemoveStdRoot(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_RemoveStdRoot *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_REMOVESTDROOT]; + + r = talloc(talloc_tos(), struct dfs_RemoveStdRoot); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_RemoveStdRoot, r); + } + + r->out.result = _dfs_RemoveStdRoot(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_RemoveStdRoot, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_ManagerInitialize(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_ManagerInitialize *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERINITIALIZE]; + + r = talloc(talloc_tos(), struct dfs_ManagerInitialize); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_ManagerInitialize, r); + } + + r->out.result = _dfs_ManagerInitialize(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_ManagerInitialize, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_AddStdRootForced(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_AddStdRootForced *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_ADDSTDROOTFORCED]; + + r = talloc(talloc_tos(), struct dfs_AddStdRootForced); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_AddStdRootForced, r); + } + + r->out.result = _dfs_AddStdRootForced(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_AddStdRootForced, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_GetDcAddress(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_GetDcAddress *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_GETDCADDRESS]; + + r = talloc(talloc_tos(), struct dfs_GetDcAddress); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, r); + } + + ZERO_STRUCT(r->out); + r->out.server_fullname = r->in.server_fullname; + r->out.is_root = r->in.is_root; + r->out.ttl = r->in.ttl; + r->out.result = _dfs_GetDcAddress(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_SetDcAddress(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_SetDcAddress *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_SETDCADDRESS]; + + r = talloc(talloc_tos(), struct dfs_SetDcAddress); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_SetDcAddress, r); + } + + r->out.result = _dfs_SetDcAddress(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_SetDcAddress, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_FlushFtTable(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_FlushFtTable *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_FLUSHFTTABLE]; + + r = talloc(talloc_tos(), struct dfs_FlushFtTable); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_FlushFtTable, r); + } + + r->out.result = _dfs_FlushFtTable(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_FlushFtTable, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_Add2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_Add2 *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_ADD2]; + + r = talloc(talloc_tos(), struct dfs_Add2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Add2, r); + } + + r->out.result = _dfs_Add2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Add2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_Remove2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_Remove2 *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_REMOVE2]; + + r = talloc(talloc_tos(), struct dfs_Remove2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_Remove2, r); + } + + r->out.result = _dfs_Remove2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_Remove2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_EnumEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_EnumEx *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_ENUMEX]; + + r = talloc(talloc_tos(), struct dfs_EnumEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_EnumEx, r); + } + + ZERO_STRUCT(r->out); + r->out.info = r->in.info; + r->out.total = r->in.total; + r->out.result = _dfs_EnumEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_EnumEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dfs_SetInfo2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dfs_SetInfo2 *r; + + call = &ndr_table_netdfs.calls[NDR_DFS_SETINFO2]; + + r = talloc(talloc_tos(), struct dfs_SetInfo2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dfs_SetInfo2, r); + } + + r->out.result = _dfs_SetInfo2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dfs_SetInfo2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_netdfs_cmds[] = +{ + {"DFS_GETMANAGERVERSION", NDR_DFS_GETMANAGERVERSION, api_dfs_GetManagerVersion}, + {"DFS_ADD", NDR_DFS_ADD, api_dfs_Add}, + {"DFS_REMOVE", NDR_DFS_REMOVE, api_dfs_Remove}, + {"DFS_SETINFO", NDR_DFS_SETINFO, api_dfs_SetInfo}, + {"DFS_GETINFO", NDR_DFS_GETINFO, api_dfs_GetInfo}, + {"DFS_ENUM", NDR_DFS_ENUM, api_dfs_Enum}, + {"DFS_RENAME", NDR_DFS_RENAME, api_dfs_Rename}, + {"DFS_MOVE", NDR_DFS_MOVE, api_dfs_Move}, + {"DFS_MANAGERGETCONFIGINFO", NDR_DFS_MANAGERGETCONFIGINFO, api_dfs_ManagerGetConfigInfo}, + {"DFS_MANAGERSENDSITEINFO", NDR_DFS_MANAGERSENDSITEINFO, api_dfs_ManagerSendSiteInfo}, + {"DFS_ADDFTROOT", NDR_DFS_ADDFTROOT, api_dfs_AddFtRoot}, + {"DFS_REMOVEFTROOT", NDR_DFS_REMOVEFTROOT, api_dfs_RemoveFtRoot}, + {"DFS_ADDSTDROOT", NDR_DFS_ADDSTDROOT, api_dfs_AddStdRoot}, + {"DFS_REMOVESTDROOT", NDR_DFS_REMOVESTDROOT, api_dfs_RemoveStdRoot}, + {"DFS_MANAGERINITIALIZE", NDR_DFS_MANAGERINITIALIZE, api_dfs_ManagerInitialize}, + {"DFS_ADDSTDROOTFORCED", NDR_DFS_ADDSTDROOTFORCED, api_dfs_AddStdRootForced}, + {"DFS_GETDCADDRESS", NDR_DFS_GETDCADDRESS, api_dfs_GetDcAddress}, + {"DFS_SETDCADDRESS", NDR_DFS_SETDCADDRESS, api_dfs_SetDcAddress}, + {"DFS_FLUSHFTTABLE", NDR_DFS_FLUSHFTTABLE, api_dfs_FlushFtTable}, + {"DFS_ADD2", NDR_DFS_ADD2, api_dfs_Add2}, + {"DFS_REMOVE2", NDR_DFS_REMOVE2, api_dfs_Remove2}, + {"DFS_ENUMEX", NDR_DFS_ENUMEX, api_dfs_EnumEx}, + {"DFS_SETINFO2", NDR_DFS_SETINFO2, api_dfs_SetInfo2}, +}; + +void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_netdfs_cmds; + *n_fns = sizeof(api_netdfs_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_netdfs_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "netdfs", "netdfs", &ndr_table_netdfs.syntax_id, api_netdfs_cmds, sizeof(api_netdfs_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_dfs.h b/librpc/gen_ndr/srv_dfs.h new file mode 100644 index 0000000000..e4d7a99c73 --- /dev/null +++ b/librpc/gen_ndr/srv_dfs.h @@ -0,0 +1,29 @@ +#include "librpc/gen_ndr/ndr_dfs.h" +#ifndef __SRV_NETDFS__ +#define __SRV_NETDFS__ +void _dfs_GetManagerVersion(pipes_struct *p, struct dfs_GetManagerVersion *r); +WERROR _dfs_Add(pipes_struct *p, struct dfs_Add *r); +WERROR _dfs_Remove(pipes_struct *p, struct dfs_Remove *r); +WERROR _dfs_SetInfo(pipes_struct *p, struct dfs_SetInfo *r); +WERROR _dfs_GetInfo(pipes_struct *p, struct dfs_GetInfo *r); +WERROR _dfs_Enum(pipes_struct *p, struct dfs_Enum *r); +WERROR _dfs_Rename(pipes_struct *p, struct dfs_Rename *r); +WERROR _dfs_Move(pipes_struct *p, struct dfs_Move *r); +WERROR _dfs_ManagerGetConfigInfo(pipes_struct *p, struct dfs_ManagerGetConfigInfo *r); +WERROR _dfs_ManagerSendSiteInfo(pipes_struct *p, struct dfs_ManagerSendSiteInfo *r); +WERROR _dfs_AddFtRoot(pipes_struct *p, struct dfs_AddFtRoot *r); +WERROR _dfs_RemoveFtRoot(pipes_struct *p, struct dfs_RemoveFtRoot *r); +WERROR _dfs_AddStdRoot(pipes_struct *p, struct dfs_AddStdRoot *r); +WERROR _dfs_RemoveStdRoot(pipes_struct *p, struct dfs_RemoveStdRoot *r); +WERROR _dfs_ManagerInitialize(pipes_struct *p, struct dfs_ManagerInitialize *r); +WERROR _dfs_AddStdRootForced(pipes_struct *p, struct dfs_AddStdRootForced *r); +WERROR _dfs_GetDcAddress(pipes_struct *p, struct dfs_GetDcAddress *r); +WERROR _dfs_SetDcAddress(pipes_struct *p, struct dfs_SetDcAddress *r); +WERROR _dfs_FlushFtTable(pipes_struct *p, struct dfs_FlushFtTable *r); +WERROR _dfs_Add2(pipes_struct *p, struct dfs_Add2 *r); +WERROR _dfs_Remove2(pipes_struct *p, struct dfs_Remove2 *r); +WERROR _dfs_EnumEx(pipes_struct *p, struct dfs_EnumEx *r); +WERROR _dfs_SetInfo2(pipes_struct *p, struct dfs_SetInfo2 *r); +void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_netdfs_init(void); +#endif /* __SRV_NETDFS__ */ diff --git a/librpc/gen_ndr/srv_dssetup.c b/librpc/gen_ndr/srv_dssetup.c new file mode 100644 index 0000000000..62123b826c --- /dev/null +++ b/librpc/gen_ndr/srv_dssetup.c @@ -0,0 +1,845 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_dssetup.h" + +static bool api_dssetup_DsRoleGetPrimaryDomainInformation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleGetPrimaryDomainInformation *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleGetPrimaryDomainInformation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union dssetup_DsRoleInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _dssetup_DsRoleGetPrimaryDomainInformation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleDnsNameToFlatName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleDnsNameToFlatName *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleDnsNameToFlatName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDnsNameToFlatName, r); + } + + r->out.result = _dssetup_DsRoleDnsNameToFlatName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDnsNameToFlatName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleDcAsDc(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleDcAsDc *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASDC]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsDc); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsDc, r); + } + + r->out.result = _dssetup_DsRoleDcAsDc(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsDc, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleDcAsReplica(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleDcAsReplica *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASREPLICA]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsReplica); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsReplica, r); + } + + r->out.result = _dssetup_DsRoleDcAsReplica(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsReplica, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleDemoteDc(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleDemoteDc *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDEMOTEDC]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleDemoteDc); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDemoteDc, r); + } + + r->out.result = _dssetup_DsRoleDemoteDc(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDemoteDc, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleGetDcOperationProgress(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleGetDcOperationProgress *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationProgress); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationProgress, r); + } + + r->out.result = _dssetup_DsRoleGetDcOperationProgress(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationProgress, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleGetDcOperationResults(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleGetDcOperationResults *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationResults); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationResults, r); + } + + r->out.result = _dssetup_DsRoleGetDcOperationResults(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationResults, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleCancel(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleCancel *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLECANCEL]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleCancel); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleCancel, r); + } + + r->out.result = _dssetup_DsRoleCancel(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleCancel, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleServerSaveStateForUpgrade(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleServerSaveStateForUpgrade *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleServerSaveStateForUpgrade); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, r); + } + + r->out.result = _dssetup_DsRoleServerSaveStateForUpgrade(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleUpgradeDownlevelServer(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleUpgradeDownlevelServer *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleUpgradeDownlevelServer); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, r); + } + + r->out.result = _dssetup_DsRoleUpgradeDownlevelServer(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_dssetup_DsRoleAbortDownlevelServerUpgrade(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct dssetup_DsRoleAbortDownlevelServerUpgrade *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleAbortDownlevelServerUpgrade); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, r); + } + + r->out.result = _dssetup_DsRoleAbortDownlevelServerUpgrade(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_dssetup_cmds[] = +{ + {"DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION", NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION, api_dssetup_DsRoleGetPrimaryDomainInformation}, + {"DSSETUP_DSROLEDNSNAMETOFLATNAME", NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME, api_dssetup_DsRoleDnsNameToFlatName}, + {"DSSETUP_DSROLEDCASDC", NDR_DSSETUP_DSROLEDCASDC, api_dssetup_DsRoleDcAsDc}, + {"DSSETUP_DSROLEDCASREPLICA", NDR_DSSETUP_DSROLEDCASREPLICA, api_dssetup_DsRoleDcAsReplica}, + {"DSSETUP_DSROLEDEMOTEDC", NDR_DSSETUP_DSROLEDEMOTEDC, api_dssetup_DsRoleDemoteDc}, + {"DSSETUP_DSROLEGETDCOPERATIONPROGRESS", NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS, api_dssetup_DsRoleGetDcOperationProgress}, + {"DSSETUP_DSROLEGETDCOPERATIONRESULTS", NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS, api_dssetup_DsRoleGetDcOperationResults}, + {"DSSETUP_DSROLECANCEL", NDR_DSSETUP_DSROLECANCEL, api_dssetup_DsRoleCancel}, + {"DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE", NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE, api_dssetup_DsRoleServerSaveStateForUpgrade}, + {"DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER", NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER, api_dssetup_DsRoleUpgradeDownlevelServer}, + {"DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE", NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE, api_dssetup_DsRoleAbortDownlevelServerUpgrade}, +}; + +void dssetup_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_dssetup_cmds; + *n_fns = sizeof(api_dssetup_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_dssetup_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "dssetup", "dssetup", &ndr_table_dssetup.syntax_id, api_dssetup_cmds, sizeof(api_dssetup_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_dssetup.h b/librpc/gen_ndr/srv_dssetup.h new file mode 100644 index 0000000000..3233899eac --- /dev/null +++ b/librpc/gen_ndr/srv_dssetup.h @@ -0,0 +1,17 @@ +#include "librpc/gen_ndr/ndr_dssetup.h" +#ifndef __SRV_DSSETUP__ +#define __SRV_DSSETUP__ +WERROR _dssetup_DsRoleGetPrimaryDomainInformation(pipes_struct *p, struct dssetup_DsRoleGetPrimaryDomainInformation *r); +WERROR _dssetup_DsRoleDnsNameToFlatName(pipes_struct *p, struct dssetup_DsRoleDnsNameToFlatName *r); +WERROR _dssetup_DsRoleDcAsDc(pipes_struct *p, struct dssetup_DsRoleDcAsDc *r); +WERROR _dssetup_DsRoleDcAsReplica(pipes_struct *p, struct dssetup_DsRoleDcAsReplica *r); +WERROR _dssetup_DsRoleDemoteDc(pipes_struct *p, struct dssetup_DsRoleDemoteDc *r); +WERROR _dssetup_DsRoleGetDcOperationProgress(pipes_struct *p, struct dssetup_DsRoleGetDcOperationProgress *r); +WERROR _dssetup_DsRoleGetDcOperationResults(pipes_struct *p, struct dssetup_DsRoleGetDcOperationResults *r); +WERROR _dssetup_DsRoleCancel(pipes_struct *p, struct dssetup_DsRoleCancel *r); +WERROR _dssetup_DsRoleServerSaveStateForUpgrade(pipes_struct *p, struct dssetup_DsRoleServerSaveStateForUpgrade *r); +WERROR _dssetup_DsRoleUpgradeDownlevelServer(pipes_struct *p, struct dssetup_DsRoleUpgradeDownlevelServer *r); +WERROR _dssetup_DsRoleAbortDownlevelServerUpgrade(pipes_struct *p, struct dssetup_DsRoleAbortDownlevelServerUpgrade *r); +void dssetup_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_dssetup_init(void); +#endif /* __SRV_DSSETUP__ */ diff --git a/librpc/gen_ndr/srv_echo.c b/librpc/gen_ndr/srv_echo.c new file mode 100644 index 0000000000..970398dc71 --- /dev/null +++ b/librpc/gen_ndr/srv_echo.c @@ -0,0 +1,805 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_echo.h" + +static bool api_echo_AddOne(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_AddOne *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_ADDONE]; + + r = talloc(talloc_tos(), struct echo_AddOne); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_AddOne, r); + } + + ZERO_STRUCT(r->out); + r->out.out_data = talloc_zero(r, uint32_t); + if (r->out.out_data == NULL) { + talloc_free(r); + return false; + } + + _echo_AddOne(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_AddOne, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_echo_EchoData(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_EchoData *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_ECHODATA]; + + r = talloc(talloc_tos(), struct echo_EchoData); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_EchoData, r); + } + + ZERO_STRUCT(r->out); + r->out.out_data = talloc_zero_array(r, uint8_t, r->in.len); + if (r->out.out_data == NULL) { + talloc_free(r); + return false; + } + + _echo_EchoData(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_EchoData, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_echo_SinkData(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_SinkData *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_SINKDATA]; + + r = talloc(talloc_tos(), struct echo_SinkData); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_SinkData, r); + } + + _echo_SinkData(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_SinkData, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_echo_SourceData(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_SourceData *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_SOURCEDATA]; + + r = talloc(talloc_tos(), struct echo_SourceData); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_SourceData, r); + } + + ZERO_STRUCT(r->out); + r->out.data = talloc_zero_array(r, uint8_t, r->in.len); + if (r->out.data == NULL) { + talloc_free(r); + return false; + } + + _echo_SourceData(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_SourceData, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_echo_TestCall(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_TestCall *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL]; + + r = talloc(talloc_tos(), struct echo_TestCall); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestCall, r); + } + + ZERO_STRUCT(r->out); + r->out.s2 = talloc_zero(r, const char *); + if (r->out.s2 == NULL) { + talloc_free(r); + return false; + } + + _echo_TestCall(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestCall, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_echo_TestCall2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_TestCall2 *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL2]; + + r = talloc(talloc_tos(), struct echo_TestCall2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestCall2, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union echo_Info); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _echo_TestCall2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestCall2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_echo_TestSleep(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_TestSleep *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSLEEP]; + + r = talloc(talloc_tos(), struct echo_TestSleep); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestSleep, r); + } + + r->out.result = _echo_TestSleep(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestSleep, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_echo_TestEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_TestEnum *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTENUM]; + + r = talloc(talloc_tos(), struct echo_TestEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.foo1 = r->in.foo1; + r->out.foo2 = r->in.foo2; + r->out.foo3 = r->in.foo3; + _echo_TestEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_echo_TestSurrounding(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_TestSurrounding *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSURROUNDING]; + + r = talloc(talloc_tos(), struct echo_TestSurrounding); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestSurrounding, r); + } + + ZERO_STRUCT(r->out); + r->out.data = r->in.data; + _echo_TestSurrounding(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_echo_TestDoublePointer(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct echo_TestDoublePointer *r; + + call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTDOUBLEPOINTER]; + + r = talloc(talloc_tos(), struct echo_TestDoublePointer); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, r); + } + + r->out.result = _echo_TestDoublePointer(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_rpcecho_cmds[] = +{ + {"ECHO_ADDONE", NDR_ECHO_ADDONE, api_echo_AddOne}, + {"ECHO_ECHODATA", NDR_ECHO_ECHODATA, api_echo_EchoData}, + {"ECHO_SINKDATA", NDR_ECHO_SINKDATA, api_echo_SinkData}, + {"ECHO_SOURCEDATA", NDR_ECHO_SOURCEDATA, api_echo_SourceData}, + {"ECHO_TESTCALL", NDR_ECHO_TESTCALL, api_echo_TestCall}, + {"ECHO_TESTCALL2", NDR_ECHO_TESTCALL2, api_echo_TestCall2}, + {"ECHO_TESTSLEEP", NDR_ECHO_TESTSLEEP, api_echo_TestSleep}, + {"ECHO_TESTENUM", NDR_ECHO_TESTENUM, api_echo_TestEnum}, + {"ECHO_TESTSURROUNDING", NDR_ECHO_TESTSURROUNDING, api_echo_TestSurrounding}, + {"ECHO_TESTDOUBLEPOINTER", NDR_ECHO_TESTDOUBLEPOINTER, api_echo_TestDoublePointer}, +}; + +void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_rpcecho_cmds; + *n_fns = sizeof(api_rpcecho_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_rpcecho_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "rpcecho", "rpcecho", &ndr_table_rpcecho.syntax_id, api_rpcecho_cmds, sizeof(api_rpcecho_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_echo.h b/librpc/gen_ndr/srv_echo.h new file mode 100644 index 0000000000..c3b0336652 --- /dev/null +++ b/librpc/gen_ndr/srv_echo.h @@ -0,0 +1,16 @@ +#include "librpc/gen_ndr/ndr_echo.h" +#ifndef __SRV_RPCECHO__ +#define __SRV_RPCECHO__ +void _echo_AddOne(pipes_struct *p, struct echo_AddOne *r); +void _echo_EchoData(pipes_struct *p, struct echo_EchoData *r); +void _echo_SinkData(pipes_struct *p, struct echo_SinkData *r); +void _echo_SourceData(pipes_struct *p, struct echo_SourceData *r); +void _echo_TestCall(pipes_struct *p, struct echo_TestCall *r); +NTSTATUS _echo_TestCall2(pipes_struct *p, struct echo_TestCall2 *r); +uint32 _echo_TestSleep(pipes_struct *p, struct echo_TestSleep *r); +void _echo_TestEnum(pipes_struct *p, struct echo_TestEnum *r); +void _echo_TestSurrounding(pipes_struct *p, struct echo_TestSurrounding *r); +uint16 _echo_TestDoublePointer(pipes_struct *p, struct echo_TestDoublePointer *r); +void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_rpcecho_init(void); +#endif /* __SRV_RPCECHO__ */ diff --git a/librpc/gen_ndr/srv_epmapper.c b/librpc/gen_ndr/srv_epmapper.c new file mode 100644 index 0000000000..a31d89b8e8 --- /dev/null +++ b/librpc/gen_ndr/srv_epmapper.c @@ -0,0 +1,646 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_epmapper.h" + +static bool api_epm_Insert(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct epm_Insert *r; + + call = &ndr_table_epmapper.calls[NDR_EPM_INSERT]; + + r = talloc(talloc_tos(), struct epm_Insert); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_Insert, r); + } + + r->out.result = _epm_Insert(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_Insert, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_epm_Delete(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct epm_Delete *r; + + call = &ndr_table_epmapper.calls[NDR_EPM_DELETE]; + + r = talloc(talloc_tos(), struct epm_Delete); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_Delete, r); + } + + r->out.result = _epm_Delete(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_Delete, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_epm_Lookup(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct epm_Lookup *r; + + call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUP]; + + r = talloc(talloc_tos(), struct epm_Lookup); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_Lookup, r); + } + + ZERO_STRUCT(r->out); + r->out.entry_handle = r->in.entry_handle; + r->out.num_ents = talloc_zero(r, uint32_t); + if (r->out.num_ents == NULL) { + talloc_free(r); + return false; + } + + r->out.entries = talloc_zero_array(r, struct epm_entry_t, r->in.max_ents); + if (r->out.entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _epm_Lookup(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_Lookup, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_epm_Map(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct epm_Map *r; + + call = &ndr_table_epmapper.calls[NDR_EPM_MAP]; + + r = talloc(talloc_tos(), struct epm_Map); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_Map, r); + } + + ZERO_STRUCT(r->out); + r->out.entry_handle = r->in.entry_handle; + r->out.num_towers = talloc_zero(r, uint32_t); + if (r->out.num_towers == NULL) { + talloc_free(r); + return false; + } + + r->out.towers = talloc_zero_array(r, struct epm_twr_p_t, r->in.max_towers); + if (r->out.towers == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _epm_Map(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_Map, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_epm_LookupHandleFree(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct epm_LookupHandleFree *r; + + call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUPHANDLEFREE]; + + r = talloc(talloc_tos(), struct epm_LookupHandleFree); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, r); + } + + ZERO_STRUCT(r->out); + r->out.entry_handle = r->in.entry_handle; + r->out.result = _epm_LookupHandleFree(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_epm_InqObject(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct epm_InqObject *r; + + call = &ndr_table_epmapper.calls[NDR_EPM_INQOBJECT]; + + r = talloc(talloc_tos(), struct epm_InqObject); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_InqObject, r); + } + + r->out.result = _epm_InqObject(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_InqObject, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_epm_MgmtDelete(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct epm_MgmtDelete *r; + + call = &ndr_table_epmapper.calls[NDR_EPM_MGMTDELETE]; + + r = talloc(talloc_tos(), struct epm_MgmtDelete); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_MgmtDelete, r); + } + + r->out.result = _epm_MgmtDelete(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_epm_MapAuth(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct epm_MapAuth *r; + + call = &ndr_table_epmapper.calls[NDR_EPM_MAPAUTH]; + + r = talloc(talloc_tos(), struct epm_MapAuth); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(epm_MapAuth, r); + } + + r->out.result = _epm_MapAuth(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(epm_MapAuth, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_epmapper_cmds[] = +{ + {"EPM_INSERT", NDR_EPM_INSERT, api_epm_Insert}, + {"EPM_DELETE", NDR_EPM_DELETE, api_epm_Delete}, + {"EPM_LOOKUP", NDR_EPM_LOOKUP, api_epm_Lookup}, + {"EPM_MAP", NDR_EPM_MAP, api_epm_Map}, + {"EPM_LOOKUPHANDLEFREE", NDR_EPM_LOOKUPHANDLEFREE, api_epm_LookupHandleFree}, + {"EPM_INQOBJECT", NDR_EPM_INQOBJECT, api_epm_InqObject}, + {"EPM_MGMTDELETE", NDR_EPM_MGMTDELETE, api_epm_MgmtDelete}, + {"EPM_MAPAUTH", NDR_EPM_MAPAUTH, api_epm_MapAuth}, +}; + +void epmapper_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_epmapper_cmds; + *n_fns = sizeof(api_epmapper_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_epmapper_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "epmapper", "epmapper", &ndr_table_epmapper.syntax_id, api_epmapper_cmds, sizeof(api_epmapper_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_epmapper.h b/librpc/gen_ndr/srv_epmapper.h new file mode 100644 index 0000000000..e0d0105b78 --- /dev/null +++ b/librpc/gen_ndr/srv_epmapper.h @@ -0,0 +1,14 @@ +#include "librpc/gen_ndr/ndr_epmapper.h" +#ifndef __SRV_EPMAPPER__ +#define __SRV_EPMAPPER__ +uint32 _epm_Insert(pipes_struct *p, struct epm_Insert *r); +uint32 _epm_Delete(pipes_struct *p, struct epm_Delete *r); +uint32 _epm_Lookup(pipes_struct *p, struct epm_Lookup *r); +uint32 _epm_Map(pipes_struct *p, struct epm_Map *r); +uint32 _epm_LookupHandleFree(pipes_struct *p, struct epm_LookupHandleFree *r); +uint32 _epm_InqObject(pipes_struct *p, struct epm_InqObject *r); +uint32 _epm_MgmtDelete(pipes_struct *p, struct epm_MgmtDelete *r); +uint32 _epm_MapAuth(pipes_struct *p, struct epm_MapAuth *r); +void epmapper_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_epmapper_init(void); +#endif /* __SRV_EPMAPPER__ */ diff --git a/librpc/gen_ndr/srv_eventlog.c b/librpc/gen_ndr/srv_eventlog.c new file mode 100644 index 0000000000..b9a4a2e9ed --- /dev/null +++ b/librpc/gen_ndr/srv_eventlog.c @@ -0,0 +1,1842 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_eventlog.h" + +static bool api_eventlog_ClearEventLogW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_ClearEventLogW *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGW]; + + r = talloc(talloc_tos(), struct eventlog_ClearEventLogW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, r); + } + + r->out.result = _eventlog_ClearEventLogW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_BackupEventLogW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_BackupEventLogW *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGW]; + + r = talloc(talloc_tos(), struct eventlog_BackupEventLogW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, r); + } + + r->out.result = _eventlog_BackupEventLogW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_CloseEventLog(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_CloseEventLog *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLOSEEVENTLOG]; + + r = talloc(talloc_tos(), struct eventlog_CloseEventLog); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = r->in.handle; + r->out.result = _eventlog_CloseEventLog(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_DeregisterEventSource(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_DeregisterEventSource *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTEREVENTSOURCE]; + + r = talloc(talloc_tos(), struct eventlog_DeregisterEventSource); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, r); + } + + r->out.result = _eventlog_DeregisterEventSource(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_GetNumRecords(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_GetNumRecords *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETNUMRECORDS]; + + r = talloc(talloc_tos(), struct eventlog_GetNumRecords); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, r); + } + + ZERO_STRUCT(r->out); + r->out.number = talloc_zero(r, uint32_t); + if (r->out.number == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _eventlog_GetNumRecords(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_GetOldestRecord(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_GetOldestRecord *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETOLDESTRECORD]; + + r = talloc(talloc_tos(), struct eventlog_GetOldestRecord); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, r); + } + + ZERO_STRUCT(r->out); + r->out.oldest_entry = talloc_zero(r, uint32_t); + if (r->out.oldest_entry == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _eventlog_GetOldestRecord(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_ChangeNotify(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_ChangeNotify *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CHANGENOTIFY]; + + r = talloc(talloc_tos(), struct eventlog_ChangeNotify); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, r); + } + + r->out.result = _eventlog_ChangeNotify(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_OpenEventLogW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_OpenEventLogW *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGW]; + + r = talloc(talloc_tos(), struct eventlog_OpenEventLogW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _eventlog_OpenEventLogW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_RegisterEventSourceW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_RegisterEventSourceW *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEW]; + + r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, r); + } + + r->out.result = _eventlog_RegisterEventSourceW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_OpenBackupEventLogW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_OpenBackupEventLogW *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGW]; + + r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, r); + } + + r->out.result = _eventlog_OpenBackupEventLogW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_ReadEventLogW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_ReadEventLogW *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGW]; + + r = talloc(talloc_tos(), struct eventlog_ReadEventLogW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, r); + } + + ZERO_STRUCT(r->out); + r->out.data = talloc_zero_array(r, uint8_t, r->in.number_of_bytes); + if (r->out.data == NULL) { + talloc_free(r); + return false; + } + + r->out.sent_size = talloc_zero(r, uint32_t); + if (r->out.sent_size == NULL) { + talloc_free(r); + return false; + } + + r->out.real_size = talloc_zero(r, uint32_t); + if (r->out.real_size == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _eventlog_ReadEventLogW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_ReportEventW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_ReportEventW *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTW]; + + r = talloc(talloc_tos(), struct eventlog_ReportEventW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, r); + } + + r->out.result = _eventlog_ReportEventW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_ClearEventLogA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_ClearEventLogA *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGA]; + + r = talloc(talloc_tos(), struct eventlog_ClearEventLogA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, r); + } + + r->out.result = _eventlog_ClearEventLogA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_BackupEventLogA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_BackupEventLogA *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGA]; + + r = talloc(talloc_tos(), struct eventlog_BackupEventLogA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, r); + } + + r->out.result = _eventlog_BackupEventLogA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_OpenEventLogA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_OpenEventLogA *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGA]; + + r = talloc(talloc_tos(), struct eventlog_OpenEventLogA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, r); + } + + r->out.result = _eventlog_OpenEventLogA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_RegisterEventSourceA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_RegisterEventSourceA *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEA]; + + r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, r); + } + + r->out.result = _eventlog_RegisterEventSourceA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_OpenBackupEventLogA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_OpenBackupEventLogA *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGA]; + + r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, r); + } + + r->out.result = _eventlog_OpenBackupEventLogA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_ReadEventLogA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_ReadEventLogA *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGA]; + + r = talloc(talloc_tos(), struct eventlog_ReadEventLogA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, r); + } + + r->out.result = _eventlog_ReadEventLogA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_ReportEventA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_ReportEventA *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTA]; + + r = talloc(talloc_tos(), struct eventlog_ReportEventA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, r); + } + + r->out.result = _eventlog_ReportEventA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_RegisterClusterSvc(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_RegisterClusterSvc *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTERCLUSTERSVC]; + + r = talloc(talloc_tos(), struct eventlog_RegisterClusterSvc); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, r); + } + + r->out.result = _eventlog_RegisterClusterSvc(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_DeregisterClusterSvc(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_DeregisterClusterSvc *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTERCLUSTERSVC]; + + r = talloc(talloc_tos(), struct eventlog_DeregisterClusterSvc); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, r); + } + + r->out.result = _eventlog_DeregisterClusterSvc(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_WriteClusterEvents(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_WriteClusterEvents *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_WRITECLUSTEREVENTS]; + + r = talloc(talloc_tos(), struct eventlog_WriteClusterEvents); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, r); + } + + r->out.result = _eventlog_WriteClusterEvents(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_GetLogIntormation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_GetLogIntormation *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETLOGINTORMATION]; + + r = talloc(talloc_tos(), struct eventlog_GetLogIntormation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_GetLogIntormation, r); + } + + r->out.result = _eventlog_GetLogIntormation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_eventlog_FlushEventLog(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct eventlog_FlushEventLog *r; + + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_FLUSHEVENTLOG]; + + r = talloc(talloc_tos(), struct eventlog_FlushEventLog); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, r); + } + + r->out.result = _eventlog_FlushEventLog(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_eventlog_cmds[] = +{ + {"EVENTLOG_CLEAREVENTLOGW", NDR_EVENTLOG_CLEAREVENTLOGW, api_eventlog_ClearEventLogW}, + {"EVENTLOG_BACKUPEVENTLOGW", NDR_EVENTLOG_BACKUPEVENTLOGW, api_eventlog_BackupEventLogW}, + {"EVENTLOG_CLOSEEVENTLOG", NDR_EVENTLOG_CLOSEEVENTLOG, api_eventlog_CloseEventLog}, + {"EVENTLOG_DEREGISTEREVENTSOURCE", NDR_EVENTLOG_DEREGISTEREVENTSOURCE, api_eventlog_DeregisterEventSource}, + {"EVENTLOG_GETNUMRECORDS", NDR_EVENTLOG_GETNUMRECORDS, api_eventlog_GetNumRecords}, + {"EVENTLOG_GETOLDESTRECORD", NDR_EVENTLOG_GETOLDESTRECORD, api_eventlog_GetOldestRecord}, + {"EVENTLOG_CHANGENOTIFY", NDR_EVENTLOG_CHANGENOTIFY, api_eventlog_ChangeNotify}, + {"EVENTLOG_OPENEVENTLOGW", NDR_EVENTLOG_OPENEVENTLOGW, api_eventlog_OpenEventLogW}, + {"EVENTLOG_REGISTEREVENTSOURCEW", NDR_EVENTLOG_REGISTEREVENTSOURCEW, api_eventlog_RegisterEventSourceW}, + {"EVENTLOG_OPENBACKUPEVENTLOGW", NDR_EVENTLOG_OPENBACKUPEVENTLOGW, api_eventlog_OpenBackupEventLogW}, + {"EVENTLOG_READEVENTLOGW", NDR_EVENTLOG_READEVENTLOGW, api_eventlog_ReadEventLogW}, + {"EVENTLOG_REPORTEVENTW", NDR_EVENTLOG_REPORTEVENTW, api_eventlog_ReportEventW}, + {"EVENTLOG_CLEAREVENTLOGA", NDR_EVENTLOG_CLEAREVENTLOGA, api_eventlog_ClearEventLogA}, + {"EVENTLOG_BACKUPEVENTLOGA", NDR_EVENTLOG_BACKUPEVENTLOGA, api_eventlog_BackupEventLogA}, + {"EVENTLOG_OPENEVENTLOGA", NDR_EVENTLOG_OPENEVENTLOGA, api_eventlog_OpenEventLogA}, + {"EVENTLOG_REGISTEREVENTSOURCEA", NDR_EVENTLOG_REGISTEREVENTSOURCEA, api_eventlog_RegisterEventSourceA}, + {"EVENTLOG_OPENBACKUPEVENTLOGA", NDR_EVENTLOG_OPENBACKUPEVENTLOGA, api_eventlog_OpenBackupEventLogA}, + {"EVENTLOG_READEVENTLOGA", NDR_EVENTLOG_READEVENTLOGA, api_eventlog_ReadEventLogA}, + {"EVENTLOG_REPORTEVENTA", NDR_EVENTLOG_REPORTEVENTA, api_eventlog_ReportEventA}, + {"EVENTLOG_REGISTERCLUSTERSVC", NDR_EVENTLOG_REGISTERCLUSTERSVC, api_eventlog_RegisterClusterSvc}, + {"EVENTLOG_DEREGISTERCLUSTERSVC", NDR_EVENTLOG_DEREGISTERCLUSTERSVC, api_eventlog_DeregisterClusterSvc}, + {"EVENTLOG_WRITECLUSTEREVENTS", NDR_EVENTLOG_WRITECLUSTEREVENTS, api_eventlog_WriteClusterEvents}, + {"EVENTLOG_GETLOGINTORMATION", NDR_EVENTLOG_GETLOGINTORMATION, api_eventlog_GetLogIntormation}, + {"EVENTLOG_FLUSHEVENTLOG", NDR_EVENTLOG_FLUSHEVENTLOG, api_eventlog_FlushEventLog}, +}; + +void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_eventlog_cmds; + *n_fns = sizeof(api_eventlog_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_eventlog_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "eventlog", "eventlog", &ndr_table_eventlog.syntax_id, api_eventlog_cmds, sizeof(api_eventlog_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_eventlog.h b/librpc/gen_ndr/srv_eventlog.h new file mode 100644 index 0000000000..6957c66beb --- /dev/null +++ b/librpc/gen_ndr/srv_eventlog.h @@ -0,0 +1,30 @@ +#include "librpc/gen_ndr/ndr_eventlog.h" +#ifndef __SRV_EVENTLOG__ +#define __SRV_EVENTLOG__ +NTSTATUS _eventlog_ClearEventLogW(pipes_struct *p, struct eventlog_ClearEventLogW *r); +NTSTATUS _eventlog_BackupEventLogW(pipes_struct *p, struct eventlog_BackupEventLogW *r); +NTSTATUS _eventlog_CloseEventLog(pipes_struct *p, struct eventlog_CloseEventLog *r); +NTSTATUS _eventlog_DeregisterEventSource(pipes_struct *p, struct eventlog_DeregisterEventSource *r); +NTSTATUS _eventlog_GetNumRecords(pipes_struct *p, struct eventlog_GetNumRecords *r); +NTSTATUS _eventlog_GetOldestRecord(pipes_struct *p, struct eventlog_GetOldestRecord *r); +NTSTATUS _eventlog_ChangeNotify(pipes_struct *p, struct eventlog_ChangeNotify *r); +NTSTATUS _eventlog_OpenEventLogW(pipes_struct *p, struct eventlog_OpenEventLogW *r); +NTSTATUS _eventlog_RegisterEventSourceW(pipes_struct *p, struct eventlog_RegisterEventSourceW *r); +NTSTATUS _eventlog_OpenBackupEventLogW(pipes_struct *p, struct eventlog_OpenBackupEventLogW *r); +NTSTATUS _eventlog_ReadEventLogW(pipes_struct *p, struct eventlog_ReadEventLogW *r); +NTSTATUS _eventlog_ReportEventW(pipes_struct *p, struct eventlog_ReportEventW *r); +NTSTATUS _eventlog_ClearEventLogA(pipes_struct *p, struct eventlog_ClearEventLogA *r); +NTSTATUS _eventlog_BackupEventLogA(pipes_struct *p, struct eventlog_BackupEventLogA *r); +NTSTATUS _eventlog_OpenEventLogA(pipes_struct *p, struct eventlog_OpenEventLogA *r); +NTSTATUS _eventlog_RegisterEventSourceA(pipes_struct *p, struct eventlog_RegisterEventSourceA *r); +NTSTATUS _eventlog_OpenBackupEventLogA(pipes_struct *p, struct eventlog_OpenBackupEventLogA *r); +NTSTATUS _eventlog_ReadEventLogA(pipes_struct *p, struct eventlog_ReadEventLogA *r); +NTSTATUS _eventlog_ReportEventA(pipes_struct *p, struct eventlog_ReportEventA *r); +NTSTATUS _eventlog_RegisterClusterSvc(pipes_struct *p, struct eventlog_RegisterClusterSvc *r); +NTSTATUS _eventlog_DeregisterClusterSvc(pipes_struct *p, struct eventlog_DeregisterClusterSvc *r); +NTSTATUS _eventlog_WriteClusterEvents(pipes_struct *p, struct eventlog_WriteClusterEvents *r); +NTSTATUS _eventlog_GetLogIntormation(pipes_struct *p, struct eventlog_GetLogIntormation *r); +NTSTATUS _eventlog_FlushEventLog(pipes_struct *p, struct eventlog_FlushEventLog *r); +void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_eventlog_init(void); +#endif /* __SRV_EVENTLOG__ */ diff --git a/librpc/gen_ndr/srv_initshutdown.c b/librpc/gen_ndr/srv_initshutdown.c new file mode 100644 index 0000000000..51098074ac --- /dev/null +++ b/librpc/gen_ndr/srv_initshutdown.c @@ -0,0 +1,246 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_initshutdown.h" + +static bool api_initshutdown_Init(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct initshutdown_Init *r; + + call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INIT]; + + r = talloc(talloc_tos(), struct initshutdown_Init); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(initshutdown_Init, r); + } + + r->out.result = _initshutdown_Init(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(initshutdown_Init, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_initshutdown_Abort(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct initshutdown_Abort *r; + + call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_ABORT]; + + r = talloc(talloc_tos(), struct initshutdown_Abort); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(initshutdown_Abort, r); + } + + r->out.result = _initshutdown_Abort(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(initshutdown_Abort, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_initshutdown_InitEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct initshutdown_InitEx *r; + + call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INITEX]; + + r = talloc(talloc_tos(), struct initshutdown_InitEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(initshutdown_InitEx, r); + } + + r->out.result = _initshutdown_InitEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_initshutdown_cmds[] = +{ + {"INITSHUTDOWN_INIT", NDR_INITSHUTDOWN_INIT, api_initshutdown_Init}, + {"INITSHUTDOWN_ABORT", NDR_INITSHUTDOWN_ABORT, api_initshutdown_Abort}, + {"INITSHUTDOWN_INITEX", NDR_INITSHUTDOWN_INITEX, api_initshutdown_InitEx}, +}; + +void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_initshutdown_cmds; + *n_fns = sizeof(api_initshutdown_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_initshutdown_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", &ndr_table_initshutdown.syntax_id, api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_initshutdown.h b/librpc/gen_ndr/srv_initshutdown.h new file mode 100644 index 0000000000..be3ea25271 --- /dev/null +++ b/librpc/gen_ndr/srv_initshutdown.h @@ -0,0 +1,9 @@ +#include "librpc/gen_ndr/ndr_initshutdown.h" +#ifndef __SRV_INITSHUTDOWN__ +#define __SRV_INITSHUTDOWN__ +WERROR _initshutdown_Init(pipes_struct *p, struct initshutdown_Init *r); +WERROR _initshutdown_Abort(pipes_struct *p, struct initshutdown_Abort *r); +WERROR _initshutdown_InitEx(pipes_struct *p, struct initshutdown_InitEx *r); +void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_initshutdown_init(void); +#endif /* __SRV_INITSHUTDOWN__ */ diff --git a/librpc/gen_ndr/srv_lsa.c b/librpc/gen_ndr/srv_lsa.c new file mode 100644 index 0000000000..c30f276800 --- /dev/null +++ b/librpc/gen_ndr/srv_lsa.c @@ -0,0 +1,6389 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_lsa.h" + +static bool api_lsa_Close(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_Close *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSE]; + + r = talloc(talloc_tos(), struct lsa_Close); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_Close, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = r->in.handle; + r->out.result = _lsa_Close(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_Close, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_Delete(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_Delete *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_DELETE]; + + r = talloc(talloc_tos(), struct lsa_Delete); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_Delete, r); + } + + r->out.result = _lsa_Delete(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_Delete, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_EnumPrivs(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_EnumPrivs *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVS]; + + r = talloc(talloc_tos(), struct lsa_EnumPrivs); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumPrivs, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.privs = talloc_zero(r, struct lsa_PrivArray); + if (r->out.privs == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_EnumPrivs(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_QuerySecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_QuerySecurity *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECURITY]; + + r = talloc(talloc_tos(), struct lsa_QuerySecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QuerySecurity, r); + } + + ZERO_STRUCT(r->out); + r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *); + if (r->out.sdbuf == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_QuerySecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetSecObj(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetSecObj *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECOBJ]; + + r = talloc(talloc_tos(), struct lsa_SetSecObj); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetSecObj, r); + } + + r->out.result = _lsa_SetSecObj(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_ChangePassword(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_ChangePassword *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CHANGEPASSWORD]; + + r = talloc(talloc_tos(), struct lsa_ChangePassword); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_ChangePassword, r); + } + + r->out.result = _lsa_ChangePassword(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_OpenPolicy(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_OpenPolicy *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY]; + + r = talloc(talloc_tos(), struct lsa_OpenPolicy); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_OpenPolicy(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_QueryInfoPolicy(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_QueryInfoPolicy *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY]; + + r = talloc(talloc_tos(), struct lsa_QueryInfoPolicy); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union lsa_PolicyInformation *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_QueryInfoPolicy(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetInfoPolicy(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetInfoPolicy *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY]; + + r = talloc(talloc_tos(), struct lsa_SetInfoPolicy); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, r); + } + + r->out.result = _lsa_SetInfoPolicy(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_ClearAuditLog(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_ClearAuditLog *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CLEARAUDITLOG]; + + r = talloc(talloc_tos(), struct lsa_ClearAuditLog); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, r); + } + + r->out.result = _lsa_ClearAuditLog(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CreateAccount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CreateAccount *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREATEACCOUNT]; + + r = talloc(talloc_tos(), struct lsa_CreateAccount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateAccount, r); + } + + ZERO_STRUCT(r->out); + r->out.acct_handle = talloc_zero(r, struct policy_handle); + if (r->out.acct_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_CreateAccount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_EnumAccounts(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_EnumAccounts *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTS]; + + r = talloc(talloc_tos(), struct lsa_EnumAccounts); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.sids = talloc_zero(r, struct lsa_SidArray); + if (r->out.sids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_EnumAccounts(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CreateTrustedDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CreateTrustedDomain *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAIN]; + + r = talloc(talloc_tos(), struct lsa_CreateTrustedDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, r); + } + + ZERO_STRUCT(r->out); + r->out.trustdom_handle = talloc_zero(r, struct policy_handle); + if (r->out.trustdom_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_CreateTrustedDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_EnumTrustDom(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_EnumTrustDom *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTDOM]; + + r = talloc(talloc_tos(), struct lsa_EnumTrustDom); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.domains = talloc_zero(r, struct lsa_DomainList); + if (r->out.domains == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_EnumTrustDom(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupNames(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupNames *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES]; + + r = talloc(talloc_tos(), struct lsa_LookupNames); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupNames, r); + } + + ZERO_STRUCT(r->out); + r->out.sids = r->in.sids; + r->out.count = r->in.count; + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); + if (r->out.domains == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupNames(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupNames, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupSids(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupSids *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS]; + + r = talloc(talloc_tos(), struct lsa_LookupSids); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupSids, r); + } + + ZERO_STRUCT(r->out); + r->out.names = r->in.names; + r->out.count = r->in.count; + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); + if (r->out.domains == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupSids(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupSids, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CreateSecret(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CreateSecret *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREATESECRET]; + + r = talloc(talloc_tos(), struct lsa_CreateSecret); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateSecret, r); + } + + ZERO_STRUCT(r->out); + r->out.sec_handle = talloc_zero(r, struct policy_handle); + if (r->out.sec_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_CreateSecret(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_OpenAccount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_OpenAccount *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_OPENACCOUNT]; + + r = talloc(talloc_tos(), struct lsa_OpenAccount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenAccount, r); + } + + ZERO_STRUCT(r->out); + r->out.acct_handle = talloc_zero(r, struct policy_handle); + if (r->out.acct_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_OpenAccount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_EnumPrivsAccount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_EnumPrivsAccount *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVSACCOUNT]; + + r = talloc(talloc_tos(), struct lsa_EnumPrivsAccount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, r); + } + + ZERO_STRUCT(r->out); + r->out.privs = talloc_zero(r, struct lsa_PrivilegeSet *); + if (r->out.privs == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_EnumPrivsAccount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_AddPrivilegesToAccount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_AddPrivilegesToAccount *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_ADDPRIVILEGESTOACCOUNT]; + + r = talloc(talloc_tos(), struct lsa_AddPrivilegesToAccount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, r); + } + + r->out.result = _lsa_AddPrivilegesToAccount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_RemovePrivilegesFromAccount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_RemovePrivilegesFromAccount *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT]; + + r = talloc(talloc_tos(), struct lsa_RemovePrivilegesFromAccount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, r); + } + + r->out.result = _lsa_RemovePrivilegesFromAccount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_GetQuotasForAccount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_GetQuotasForAccount *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_GETQUOTASFORACCOUNT]; + + r = talloc(talloc_tos(), struct lsa_GetQuotasForAccount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, r); + } + + r->out.result = _lsa_GetQuotasForAccount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetQuotasForAccount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetQuotasForAccount *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETQUOTASFORACCOUNT]; + + r = talloc(talloc_tos(), struct lsa_SetQuotasForAccount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, r); + } + + r->out.result = _lsa_SetQuotasForAccount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_GetSystemAccessAccount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_GetSystemAccessAccount *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_GETSYSTEMACCESSACCOUNT]; + + r = talloc(talloc_tos(), struct lsa_GetSystemAccessAccount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, r); + } + + ZERO_STRUCT(r->out); + r->out.access_mask = talloc_zero(r, uint32_t); + if (r->out.access_mask == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_GetSystemAccessAccount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetSystemAccessAccount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetSystemAccessAccount *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETSYSTEMACCESSACCOUNT]; + + r = talloc(talloc_tos(), struct lsa_SetSystemAccessAccount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, r); + } + + r->out.result = _lsa_SetSystemAccessAccount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_OpenTrustedDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_OpenTrustedDomain *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAIN]; + + r = talloc(talloc_tos(), struct lsa_OpenTrustedDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, r); + } + + ZERO_STRUCT(r->out); + r->out.trustdom_handle = talloc_zero(r, struct policy_handle); + if (r->out.trustdom_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_OpenTrustedDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_QueryTrustedDomainInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_QueryTrustedDomainInfo *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFO]; + + r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_QueryTrustedDomainInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetInformationTrustedDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetInformationTrustedDomain *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN]; + + r = talloc(talloc_tos(), struct lsa_SetInformationTrustedDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, r); + } + + r->out.result = _lsa_SetInformationTrustedDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_OpenSecret(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_OpenSecret *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_OPENSECRET]; + + r = talloc(talloc_tos(), struct lsa_OpenSecret); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenSecret, r); + } + + ZERO_STRUCT(r->out); + r->out.sec_handle = talloc_zero(r, struct policy_handle); + if (r->out.sec_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_OpenSecret(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetSecret(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetSecret *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECRET]; + + r = talloc(talloc_tos(), struct lsa_SetSecret); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetSecret, r); + } + + r->out.result = _lsa_SetSecret(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetSecret, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_QuerySecret(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_QuerySecret *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECRET]; + + r = talloc(talloc_tos(), struct lsa_QuerySecret); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QuerySecret, r); + } + + ZERO_STRUCT(r->out); + r->out.new_val = r->in.new_val; + r->out.new_mtime = r->in.new_mtime; + r->out.old_val = r->in.old_val; + r->out.old_mtime = r->in.old_mtime; + r->out.result = _lsa_QuerySecret(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupPrivValue(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupPrivValue *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVVALUE]; + + r = talloc(talloc_tos(), struct lsa_LookupPrivValue); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, r); + } + + ZERO_STRUCT(r->out); + r->out.luid = talloc_zero(r, struct lsa_LUID); + if (r->out.luid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupPrivValue(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupPrivName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupPrivName *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVNAME]; + + r = talloc(talloc_tos(), struct lsa_LookupPrivName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, r); + } + + ZERO_STRUCT(r->out); + r->out.name = talloc_zero(r, struct lsa_StringLarge *); + if (r->out.name == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupPrivName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupPrivDisplayName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupPrivDisplayName *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVDISPLAYNAME]; + + r = talloc(talloc_tos(), struct lsa_LookupPrivDisplayName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, r); + } + + ZERO_STRUCT(r->out); + r->out.disp_name = talloc_zero(r, struct lsa_StringLarge *); + if (r->out.disp_name == NULL) { + talloc_free(r); + return false; + } + + r->out.returned_language_id = talloc_zero(r, uint16_t); + if (r->out.returned_language_id == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupPrivDisplayName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_DeleteObject(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_DeleteObject *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_DELETEOBJECT]; + + r = talloc(talloc_tos(), struct lsa_DeleteObject); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_DeleteObject, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = r->in.handle; + r->out.result = _lsa_DeleteObject(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_EnumAccountsWithUserRight(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_EnumAccountsWithUserRight *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT]; + + r = talloc(talloc_tos(), struct lsa_EnumAccountsWithUserRight); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, r); + } + + ZERO_STRUCT(r->out); + r->out.sids = talloc_zero(r, struct lsa_SidArray); + if (r->out.sids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_EnumAccountsWithUserRight(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_EnumAccountRights(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_EnumAccountRights *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTRIGHTS]; + + r = talloc(talloc_tos(), struct lsa_EnumAccountRights); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, r); + } + + ZERO_STRUCT(r->out); + r->out.rights = talloc_zero(r, struct lsa_RightSet); + if (r->out.rights == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_EnumAccountRights(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_AddAccountRights(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_AddAccountRights *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_ADDACCOUNTRIGHTS]; + + r = talloc(talloc_tos(), struct lsa_AddAccountRights); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, r); + } + + r->out.result = _lsa_AddAccountRights(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_RemoveAccountRights(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_RemoveAccountRights *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEACCOUNTRIGHTS]; + + r = talloc(talloc_tos(), struct lsa_RemoveAccountRights); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, r); + } + + r->out.result = _lsa_RemoveAccountRights(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_QueryTrustedDomainInfoBySid *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID]; + + r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfoBySid); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_QueryTrustedDomainInfoBySid(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetTrustedDomainInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetTrustedDomainInfo *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFO]; + + r = talloc(talloc_tos(), struct lsa_SetTrustedDomainInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, r); + } + + r->out.result = _lsa_SetTrustedDomainInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_DeleteTrustedDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_DeleteTrustedDomain *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_DELETETRUSTEDDOMAIN]; + + r = talloc(talloc_tos(), struct lsa_DeleteTrustedDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, r); + } + + r->out.result = _lsa_DeleteTrustedDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_StorePrivateData(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_StorePrivateData *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_STOREPRIVATEDATA]; + + r = talloc(talloc_tos(), struct lsa_StorePrivateData); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, r); + } + + r->out.result = _lsa_StorePrivateData(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_RetrievePrivateData(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_RetrievePrivateData *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_RETRIEVEPRIVATEDATA]; + + r = talloc(talloc_tos(), struct lsa_RetrievePrivateData); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, r); + } + + r->out.result = _lsa_RetrievePrivateData(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_OpenPolicy2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_OpenPolicy2 *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY2]; + + r = talloc(talloc_tos(), struct lsa_OpenPolicy2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_OpenPolicy2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_GetUserName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_GetUserName *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_GETUSERNAME]; + + r = talloc(talloc_tos(), struct lsa_GetUserName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_GetUserName, r); + } + + ZERO_STRUCT(r->out); + r->out.account_name = r->in.account_name; + r->out.authority_name = r->in.authority_name; + r->out.result = _lsa_GetUserName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_GetUserName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_QueryInfoPolicy2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_QueryInfoPolicy2 *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY2]; + + r = talloc(talloc_tos(), struct lsa_QueryInfoPolicy2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union lsa_PolicyInformation *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_QueryInfoPolicy2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetInfoPolicy2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetInfoPolicy2 *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY2]; + + r = talloc(talloc_tos(), struct lsa_SetInfoPolicy2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, r); + } + + r->out.result = _lsa_SetInfoPolicy2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_QueryTrustedDomainInfoByName *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME]; + + r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfoByName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_QueryTrustedDomainInfoByName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetTrustedDomainInfoByName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetTrustedDomainInfoByName *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFOBYNAME]; + + r = talloc(talloc_tos(), struct lsa_SetTrustedDomainInfoByName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, r); + } + + r->out.result = _lsa_SetTrustedDomainInfoByName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_EnumTrustedDomainsEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_EnumTrustedDomainsEx *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTEDDOMAINSEX]; + + r = talloc(talloc_tos(), struct lsa_EnumTrustedDomainsEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.domains = talloc_zero(r, struct lsa_DomainListEx); + if (r->out.domains == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_EnumTrustedDomainsEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CreateTrustedDomainEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CreateTrustedDomainEx *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX]; + + r = talloc(talloc_tos(), struct lsa_CreateTrustedDomainEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, r); + } + + ZERO_STRUCT(r->out); + r->out.trustdom_handle = talloc_zero(r, struct policy_handle); + if (r->out.trustdom_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_CreateTrustedDomainEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CloseTrustedDomainEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CloseTrustedDomainEx *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSETRUSTEDDOMAINEX]; + + r = talloc(talloc_tos(), struct lsa_CloseTrustedDomainEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = r->in.handle; + r->out.result = _lsa_CloseTrustedDomainEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_QueryDomainInformationPolicy(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_QueryDomainInformationPolicy *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYDOMAININFORMATIONPOLICY]; + + r = talloc(talloc_tos(), struct lsa_QueryDomainInformationPolicy); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union lsa_DomainInformationPolicy *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_QueryDomainInformationPolicy(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_SetDomainInformationPolicy(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_SetDomainInformationPolicy *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_SETDOMAININFORMATIONPOLICY]; + + r = talloc(talloc_tos(), struct lsa_SetDomainInformationPolicy); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, r); + } + + r->out.result = _lsa_SetDomainInformationPolicy(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_OpenTrustedDomainByName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_OpenTrustedDomainByName *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAINBYNAME]; + + r = talloc(talloc_tos(), struct lsa_OpenTrustedDomainByName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, r); + } + + ZERO_STRUCT(r->out); + r->out.trustdom_handle = talloc_zero(r, struct policy_handle); + if (r->out.trustdom_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_OpenTrustedDomainByName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_TestCall(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_TestCall *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_TESTCALL]; + + r = talloc(talloc_tos(), struct lsa_TestCall); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_TestCall, r); + } + + r->out.result = _lsa_TestCall(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_TestCall, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupSids2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupSids2 *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS2]; + + r = talloc(talloc_tos(), struct lsa_LookupSids2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupSids2, r); + } + + ZERO_STRUCT(r->out); + r->out.names = r->in.names; + r->out.count = r->in.count; + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); + if (r->out.domains == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupSids2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupNames2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupNames2 *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES2]; + + r = talloc(talloc_tos(), struct lsa_LookupNames2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupNames2, r); + } + + ZERO_STRUCT(r->out); + r->out.sids = r->in.sids; + r->out.count = r->in.count; + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); + if (r->out.domains == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupNames2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CreateTrustedDomainEx2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CreateTrustedDomainEx2 *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX2]; + + r = talloc(talloc_tos(), struct lsa_CreateTrustedDomainEx2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, r); + } + + ZERO_STRUCT(r->out); + r->out.trustdom_handle = talloc_zero(r, struct policy_handle); + if (r->out.trustdom_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_CreateTrustedDomainEx2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRWRITE(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRWRITE *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITE]; + + r = talloc(talloc_tos(), struct lsa_CREDRWRITE); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, r); + } + + r->out.result = _lsa_CREDRWRITE(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRREAD(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRREAD *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREAD]; + + r = talloc(talloc_tos(), struct lsa_CREDRREAD); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, r); + } + + r->out.result = _lsa_CREDRREAD(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRENUMERATE(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRENUMERATE *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRENUMERATE]; + + r = talloc(talloc_tos(), struct lsa_CREDRENUMERATE); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, r); + } + + r->out.result = _lsa_CREDRENUMERATE(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRWRITEDOMAINCREDENTIALS *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITEDOMAINCREDENTIALS]; + + r = talloc(talloc_tos(), struct lsa_CREDRWRITEDOMAINCREDENTIALS); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, r); + } + + r->out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRREADDOMAINCREDENTIALS *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREADDOMAINCREDENTIALS]; + + r = talloc(talloc_tos(), struct lsa_CREDRREADDOMAINCREDENTIALS); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, r); + } + + r->out.result = _lsa_CREDRREADDOMAINCREDENTIALS(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRDELETE(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRDELETE *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRDELETE]; + + r = talloc(talloc_tos(), struct lsa_CREDRDELETE); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, r); + } + + r->out.result = _lsa_CREDRDELETE(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRGETTARGETINFO(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRGETTARGETINFO *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETTARGETINFO]; + + r = talloc(talloc_tos(), struct lsa_CREDRGETTARGETINFO); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, r); + } + + r->out.result = _lsa_CREDRGETTARGETINFO(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRPROFILELOADED(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRPROFILELOADED *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRPROFILELOADED]; + + r = talloc(talloc_tos(), struct lsa_CREDRPROFILELOADED); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, r); + } + + r->out.result = _lsa_CREDRPROFILELOADED(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupNames3(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupNames3 *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES3]; + + r = talloc(talloc_tos(), struct lsa_LookupNames3); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupNames3, r); + } + + ZERO_STRUCT(r->out); + r->out.sids = r->in.sids; + r->out.count = r->in.count; + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); + if (r->out.domains == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupNames3(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRGETSESSIONTYPES *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETSESSIONTYPES]; + + r = talloc(talloc_tos(), struct lsa_CREDRGETSESSIONTYPES); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, r); + } + + r->out.result = _lsa_CREDRGETSESSIONTYPES(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LSARREGISTERAUDITEVENT *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LSARREGISTERAUDITEVENT]; + + r = talloc(talloc_tos(), struct lsa_LSARREGISTERAUDITEVENT); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, r); + } + + r->out.result = _lsa_LSARREGISTERAUDITEVENT(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LSARGENAUDITEVENT(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LSARGENAUDITEVENT *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LSARGENAUDITEVENT]; + + r = talloc(talloc_tos(), struct lsa_LSARGENAUDITEVENT); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, r); + } + + r->out.result = _lsa_LSARGENAUDITEVENT(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LSARUNREGISTERAUDITEVENT *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LSARUNREGISTERAUDITEVENT]; + + r = talloc(talloc_tos(), struct lsa_LSARUNREGISTERAUDITEVENT); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, r); + } + + r->out.result = _lsa_LSARUNREGISTERAUDITEVENT(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_lsaRQueryForestTrustInformation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_lsaRQueryForestTrustInformation *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION]; + + r = talloc(talloc_tos(), struct lsa_lsaRQueryForestTrustInformation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *); + if (r->out.forest_trust_info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_lsaRQueryForestTrustInformation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LSARSETFORESTTRUSTINFORMATION *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LSARSETFORESTTRUSTINFORMATION]; + + r = talloc(talloc_tos(), struct lsa_LSARSETFORESTTRUSTINFORMATION); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, r); + } + + r->out.result = _lsa_LSARSETFORESTTRUSTINFORMATION(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_CREDRRENAME(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_CREDRRENAME *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRRENAME]; + + r = talloc(talloc_tos(), struct lsa_CREDRRENAME); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, r); + } + + r->out.result = _lsa_CREDRRENAME(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupSids3(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupSids3 *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS3]; + + r = talloc(talloc_tos(), struct lsa_LookupSids3); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupSids3, r); + } + + ZERO_STRUCT(r->out); + r->out.names = r->in.names; + r->out.count = r->in.count; + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); + if (r->out.domains == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupSids3(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LookupNames4(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LookupNames4 *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES4]; + + r = talloc(talloc_tos(), struct lsa_LookupNames4); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LookupNames4, r); + } + + ZERO_STRUCT(r->out); + r->out.sids = r->in.sids; + r->out.count = r->in.count; + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); + if (r->out.domains == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _lsa_LookupNames4(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LSAROPENPOLICYSCE(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LSAROPENPOLICYSCE *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LSAROPENPOLICYSCE]; + + r = talloc(talloc_tos(), struct lsa_LSAROPENPOLICYSCE); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSAROPENPOLICYSCE, r); + } + + r->out.result = _lsa_LSAROPENPOLICYSCE(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE]; + + r = talloc(talloc_tos(), struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, r); + } + + r->out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE]; + + r = talloc(talloc_tos(), struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, r); + } + + r->out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct lsa_LSARADTREPORTSECURITYEVENT *r; + + call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREPORTSECURITYEVENT]; + + r = talloc(talloc_tos(), struct lsa_LSARADTREPORTSECURITYEVENT); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, r); + } + + r->out.result = _lsa_LSARADTREPORTSECURITYEVENT(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_lsarpc_cmds[] = +{ + {"LSA_CLOSE", NDR_LSA_CLOSE, api_lsa_Close}, + {"LSA_DELETE", NDR_LSA_DELETE, api_lsa_Delete}, + {"LSA_ENUMPRIVS", NDR_LSA_ENUMPRIVS, api_lsa_EnumPrivs}, + {"LSA_QUERYSECURITY", NDR_LSA_QUERYSECURITY, api_lsa_QuerySecurity}, + {"LSA_SETSECOBJ", NDR_LSA_SETSECOBJ, api_lsa_SetSecObj}, + {"LSA_CHANGEPASSWORD", NDR_LSA_CHANGEPASSWORD, api_lsa_ChangePassword}, + {"LSA_OPENPOLICY", NDR_LSA_OPENPOLICY, api_lsa_OpenPolicy}, + {"LSA_QUERYINFOPOLICY", NDR_LSA_QUERYINFOPOLICY, api_lsa_QueryInfoPolicy}, + {"LSA_SETINFOPOLICY", NDR_LSA_SETINFOPOLICY, api_lsa_SetInfoPolicy}, + {"LSA_CLEARAUDITLOG", NDR_LSA_CLEARAUDITLOG, api_lsa_ClearAuditLog}, + {"LSA_CREATEACCOUNT", NDR_LSA_CREATEACCOUNT, api_lsa_CreateAccount}, + {"LSA_ENUMACCOUNTS", NDR_LSA_ENUMACCOUNTS, api_lsa_EnumAccounts}, + {"LSA_CREATETRUSTEDDOMAIN", NDR_LSA_CREATETRUSTEDDOMAIN, api_lsa_CreateTrustedDomain}, + {"LSA_ENUMTRUSTDOM", NDR_LSA_ENUMTRUSTDOM, api_lsa_EnumTrustDom}, + {"LSA_LOOKUPNAMES", NDR_LSA_LOOKUPNAMES, api_lsa_LookupNames}, + {"LSA_LOOKUPSIDS", NDR_LSA_LOOKUPSIDS, api_lsa_LookupSids}, + {"LSA_CREATESECRET", NDR_LSA_CREATESECRET, api_lsa_CreateSecret}, + {"LSA_OPENACCOUNT", NDR_LSA_OPENACCOUNT, api_lsa_OpenAccount}, + {"LSA_ENUMPRIVSACCOUNT", NDR_LSA_ENUMPRIVSACCOUNT, api_lsa_EnumPrivsAccount}, + {"LSA_ADDPRIVILEGESTOACCOUNT", NDR_LSA_ADDPRIVILEGESTOACCOUNT, api_lsa_AddPrivilegesToAccount}, + {"LSA_REMOVEPRIVILEGESFROMACCOUNT", NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT, api_lsa_RemovePrivilegesFromAccount}, + {"LSA_GETQUOTASFORACCOUNT", NDR_LSA_GETQUOTASFORACCOUNT, api_lsa_GetQuotasForAccount}, + {"LSA_SETQUOTASFORACCOUNT", NDR_LSA_SETQUOTASFORACCOUNT, api_lsa_SetQuotasForAccount}, + {"LSA_GETSYSTEMACCESSACCOUNT", NDR_LSA_GETSYSTEMACCESSACCOUNT, api_lsa_GetSystemAccessAccount}, + {"LSA_SETSYSTEMACCESSACCOUNT", NDR_LSA_SETSYSTEMACCESSACCOUNT, api_lsa_SetSystemAccessAccount}, + {"LSA_OPENTRUSTEDDOMAIN", NDR_LSA_OPENTRUSTEDDOMAIN, api_lsa_OpenTrustedDomain}, + {"LSA_QUERYTRUSTEDDOMAININFO", NDR_LSA_QUERYTRUSTEDDOMAININFO, api_lsa_QueryTrustedDomainInfo}, + {"LSA_SETINFORMATIONTRUSTEDDOMAIN", NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN, api_lsa_SetInformationTrustedDomain}, + {"LSA_OPENSECRET", NDR_LSA_OPENSECRET, api_lsa_OpenSecret}, + {"LSA_SETSECRET", NDR_LSA_SETSECRET, api_lsa_SetSecret}, + {"LSA_QUERYSECRET", NDR_LSA_QUERYSECRET, api_lsa_QuerySecret}, + {"LSA_LOOKUPPRIVVALUE", NDR_LSA_LOOKUPPRIVVALUE, api_lsa_LookupPrivValue}, + {"LSA_LOOKUPPRIVNAME", NDR_LSA_LOOKUPPRIVNAME, api_lsa_LookupPrivName}, + {"LSA_LOOKUPPRIVDISPLAYNAME", NDR_LSA_LOOKUPPRIVDISPLAYNAME, api_lsa_LookupPrivDisplayName}, + {"LSA_DELETEOBJECT", NDR_LSA_DELETEOBJECT, api_lsa_DeleteObject}, + {"LSA_ENUMACCOUNTSWITHUSERRIGHT", NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT, api_lsa_EnumAccountsWithUserRight}, + {"LSA_ENUMACCOUNTRIGHTS", NDR_LSA_ENUMACCOUNTRIGHTS, api_lsa_EnumAccountRights}, + {"LSA_ADDACCOUNTRIGHTS", NDR_LSA_ADDACCOUNTRIGHTS, api_lsa_AddAccountRights}, + {"LSA_REMOVEACCOUNTRIGHTS", NDR_LSA_REMOVEACCOUNTRIGHTS, api_lsa_RemoveAccountRights}, + {"LSA_QUERYTRUSTEDDOMAININFOBYSID", NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID, api_lsa_QueryTrustedDomainInfoBySid}, + {"LSA_SETTRUSTEDDOMAININFO", NDR_LSA_SETTRUSTEDDOMAININFO, api_lsa_SetTrustedDomainInfo}, + {"LSA_DELETETRUSTEDDOMAIN", NDR_LSA_DELETETRUSTEDDOMAIN, api_lsa_DeleteTrustedDomain}, + {"LSA_STOREPRIVATEDATA", NDR_LSA_STOREPRIVATEDATA, api_lsa_StorePrivateData}, + {"LSA_RETRIEVEPRIVATEDATA", NDR_LSA_RETRIEVEPRIVATEDATA, api_lsa_RetrievePrivateData}, + {"LSA_OPENPOLICY2", NDR_LSA_OPENPOLICY2, api_lsa_OpenPolicy2}, + {"LSA_GETUSERNAME", NDR_LSA_GETUSERNAME, api_lsa_GetUserName}, + {"LSA_QUERYINFOPOLICY2", NDR_LSA_QUERYINFOPOLICY2, api_lsa_QueryInfoPolicy2}, + {"LSA_SETINFOPOLICY2", NDR_LSA_SETINFOPOLICY2, api_lsa_SetInfoPolicy2}, + {"LSA_QUERYTRUSTEDDOMAININFOBYNAME", NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME, api_lsa_QueryTrustedDomainInfoByName}, + {"LSA_SETTRUSTEDDOMAININFOBYNAME", NDR_LSA_SETTRUSTEDDOMAININFOBYNAME, api_lsa_SetTrustedDomainInfoByName}, + {"LSA_ENUMTRUSTEDDOMAINSEX", NDR_LSA_ENUMTRUSTEDDOMAINSEX, api_lsa_EnumTrustedDomainsEx}, + {"LSA_CREATETRUSTEDDOMAINEX", NDR_LSA_CREATETRUSTEDDOMAINEX, api_lsa_CreateTrustedDomainEx}, + {"LSA_CLOSETRUSTEDDOMAINEX", NDR_LSA_CLOSETRUSTEDDOMAINEX, api_lsa_CloseTrustedDomainEx}, + {"LSA_QUERYDOMAININFORMATIONPOLICY", NDR_LSA_QUERYDOMAININFORMATIONPOLICY, api_lsa_QueryDomainInformationPolicy}, + {"LSA_SETDOMAININFORMATIONPOLICY", NDR_LSA_SETDOMAININFORMATIONPOLICY, api_lsa_SetDomainInformationPolicy}, + {"LSA_OPENTRUSTEDDOMAINBYNAME", NDR_LSA_OPENTRUSTEDDOMAINBYNAME, api_lsa_OpenTrustedDomainByName}, + {"LSA_TESTCALL", NDR_LSA_TESTCALL, api_lsa_TestCall}, + {"LSA_LOOKUPSIDS2", NDR_LSA_LOOKUPSIDS2, api_lsa_LookupSids2}, + {"LSA_LOOKUPNAMES2", NDR_LSA_LOOKUPNAMES2, api_lsa_LookupNames2}, + {"LSA_CREATETRUSTEDDOMAINEX2", NDR_LSA_CREATETRUSTEDDOMAINEX2, api_lsa_CreateTrustedDomainEx2}, + {"LSA_CREDRWRITE", NDR_LSA_CREDRWRITE, api_lsa_CREDRWRITE}, + {"LSA_CREDRREAD", NDR_LSA_CREDRREAD, api_lsa_CREDRREAD}, + {"LSA_CREDRENUMERATE", NDR_LSA_CREDRENUMERATE, api_lsa_CREDRENUMERATE}, + {"LSA_CREDRWRITEDOMAINCREDENTIALS", NDR_LSA_CREDRWRITEDOMAINCREDENTIALS, api_lsa_CREDRWRITEDOMAINCREDENTIALS}, + {"LSA_CREDRREADDOMAINCREDENTIALS", NDR_LSA_CREDRREADDOMAINCREDENTIALS, api_lsa_CREDRREADDOMAINCREDENTIALS}, + {"LSA_CREDRDELETE", NDR_LSA_CREDRDELETE, api_lsa_CREDRDELETE}, + {"LSA_CREDRGETTARGETINFO", NDR_LSA_CREDRGETTARGETINFO, api_lsa_CREDRGETTARGETINFO}, + {"LSA_CREDRPROFILELOADED", NDR_LSA_CREDRPROFILELOADED, api_lsa_CREDRPROFILELOADED}, + {"LSA_LOOKUPNAMES3", NDR_LSA_LOOKUPNAMES3, api_lsa_LookupNames3}, + {"LSA_CREDRGETSESSIONTYPES", NDR_LSA_CREDRGETSESSIONTYPES, api_lsa_CREDRGETSESSIONTYPES}, + {"LSA_LSARREGISTERAUDITEVENT", NDR_LSA_LSARREGISTERAUDITEVENT, api_lsa_LSARREGISTERAUDITEVENT}, + {"LSA_LSARGENAUDITEVENT", NDR_LSA_LSARGENAUDITEVENT, api_lsa_LSARGENAUDITEVENT}, + {"LSA_LSARUNREGISTERAUDITEVENT", NDR_LSA_LSARUNREGISTERAUDITEVENT, api_lsa_LSARUNREGISTERAUDITEVENT}, + {"LSA_LSARQUERYFORESTTRUSTINFORMATION", NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION, api_lsa_lsaRQueryForestTrustInformation}, + {"LSA_LSARSETFORESTTRUSTINFORMATION", NDR_LSA_LSARSETFORESTTRUSTINFORMATION, api_lsa_LSARSETFORESTTRUSTINFORMATION}, + {"LSA_CREDRRENAME", NDR_LSA_CREDRRENAME, api_lsa_CREDRRENAME}, + {"LSA_LOOKUPSIDS3", NDR_LSA_LOOKUPSIDS3, api_lsa_LookupSids3}, + {"LSA_LOOKUPNAMES4", NDR_LSA_LOOKUPNAMES4, api_lsa_LookupNames4}, + {"LSA_LSAROPENPOLICYSCE", NDR_LSA_LSAROPENPOLICYSCE, api_lsa_LSAROPENPOLICYSCE}, + {"LSA_LSARADTREGISTERSECURITYEVENTSOURCE", NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE}, + {"LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE", NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE}, + {"LSA_LSARADTREPORTSECURITYEVENT", NDR_LSA_LSARADTREPORTSECURITYEVENT, api_lsa_LSARADTREPORTSECURITYEVENT}, +}; + +void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_lsarpc_cmds; + *n_fns = sizeof(api_lsarpc_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_lsarpc_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "lsarpc", "lsarpc", &ndr_table_lsarpc.syntax_id, api_lsarpc_cmds, sizeof(api_lsarpc_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_lsa.h b/librpc/gen_ndr/srv_lsa.h new file mode 100644 index 0000000000..223ee5e970 --- /dev/null +++ b/librpc/gen_ndr/srv_lsa.h @@ -0,0 +1,88 @@ +#include "librpc/gen_ndr/ndr_lsa.h" +#ifndef __SRV_LSARPC__ +#define __SRV_LSARPC__ +NTSTATUS _lsa_Close(pipes_struct *p, struct lsa_Close *r); +NTSTATUS _lsa_Delete(pipes_struct *p, struct lsa_Delete *r); +NTSTATUS _lsa_EnumPrivs(pipes_struct *p, struct lsa_EnumPrivs *r); +NTSTATUS _lsa_QuerySecurity(pipes_struct *p, struct lsa_QuerySecurity *r); +NTSTATUS _lsa_SetSecObj(pipes_struct *p, struct lsa_SetSecObj *r); +NTSTATUS _lsa_ChangePassword(pipes_struct *p, struct lsa_ChangePassword *r); +NTSTATUS _lsa_OpenPolicy(pipes_struct *p, struct lsa_OpenPolicy *r); +NTSTATUS _lsa_QueryInfoPolicy(pipes_struct *p, struct lsa_QueryInfoPolicy *r); +NTSTATUS _lsa_SetInfoPolicy(pipes_struct *p, struct lsa_SetInfoPolicy *r); +NTSTATUS _lsa_ClearAuditLog(pipes_struct *p, struct lsa_ClearAuditLog *r); +NTSTATUS _lsa_CreateAccount(pipes_struct *p, struct lsa_CreateAccount *r); +NTSTATUS _lsa_EnumAccounts(pipes_struct *p, struct lsa_EnumAccounts *r); +NTSTATUS _lsa_CreateTrustedDomain(pipes_struct *p, struct lsa_CreateTrustedDomain *r); +NTSTATUS _lsa_EnumTrustDom(pipes_struct *p, struct lsa_EnumTrustDom *r); +NTSTATUS _lsa_LookupNames(pipes_struct *p, struct lsa_LookupNames *r); +NTSTATUS _lsa_LookupSids(pipes_struct *p, struct lsa_LookupSids *r); +NTSTATUS _lsa_CreateSecret(pipes_struct *p, struct lsa_CreateSecret *r); +NTSTATUS _lsa_OpenAccount(pipes_struct *p, struct lsa_OpenAccount *r); +NTSTATUS _lsa_EnumPrivsAccount(pipes_struct *p, struct lsa_EnumPrivsAccount *r); +NTSTATUS _lsa_AddPrivilegesToAccount(pipes_struct *p, struct lsa_AddPrivilegesToAccount *r); +NTSTATUS _lsa_RemovePrivilegesFromAccount(pipes_struct *p, struct lsa_RemovePrivilegesFromAccount *r); +NTSTATUS _lsa_GetQuotasForAccount(pipes_struct *p, struct lsa_GetQuotasForAccount *r); +NTSTATUS _lsa_SetQuotasForAccount(pipes_struct *p, struct lsa_SetQuotasForAccount *r); +NTSTATUS _lsa_GetSystemAccessAccount(pipes_struct *p, struct lsa_GetSystemAccessAccount *r); +NTSTATUS _lsa_SetSystemAccessAccount(pipes_struct *p, struct lsa_SetSystemAccessAccount *r); +NTSTATUS _lsa_OpenTrustedDomain(pipes_struct *p, struct lsa_OpenTrustedDomain *r); +NTSTATUS _lsa_QueryTrustedDomainInfo(pipes_struct *p, struct lsa_QueryTrustedDomainInfo *r); +NTSTATUS _lsa_SetInformationTrustedDomain(pipes_struct *p, struct lsa_SetInformationTrustedDomain *r); +NTSTATUS _lsa_OpenSecret(pipes_struct *p, struct lsa_OpenSecret *r); +NTSTATUS _lsa_SetSecret(pipes_struct *p, struct lsa_SetSecret *r); +NTSTATUS _lsa_QuerySecret(pipes_struct *p, struct lsa_QuerySecret *r); +NTSTATUS _lsa_LookupPrivValue(pipes_struct *p, struct lsa_LookupPrivValue *r); +NTSTATUS _lsa_LookupPrivName(pipes_struct *p, struct lsa_LookupPrivName *r); +NTSTATUS _lsa_LookupPrivDisplayName(pipes_struct *p, struct lsa_LookupPrivDisplayName *r); +NTSTATUS _lsa_DeleteObject(pipes_struct *p, struct lsa_DeleteObject *r); +NTSTATUS _lsa_EnumAccountsWithUserRight(pipes_struct *p, struct lsa_EnumAccountsWithUserRight *r); +NTSTATUS _lsa_EnumAccountRights(pipes_struct *p, struct lsa_EnumAccountRights *r); +NTSTATUS _lsa_AddAccountRights(pipes_struct *p, struct lsa_AddAccountRights *r); +NTSTATUS _lsa_RemoveAccountRights(pipes_struct *p, struct lsa_RemoveAccountRights *r); +NTSTATUS _lsa_QueryTrustedDomainInfoBySid(pipes_struct *p, struct lsa_QueryTrustedDomainInfoBySid *r); +NTSTATUS _lsa_SetTrustedDomainInfo(pipes_struct *p, struct lsa_SetTrustedDomainInfo *r); +NTSTATUS _lsa_DeleteTrustedDomain(pipes_struct *p, struct lsa_DeleteTrustedDomain *r); +NTSTATUS _lsa_StorePrivateData(pipes_struct *p, struct lsa_StorePrivateData *r); +NTSTATUS _lsa_RetrievePrivateData(pipes_struct *p, struct lsa_RetrievePrivateData *r); +NTSTATUS _lsa_OpenPolicy2(pipes_struct *p, struct lsa_OpenPolicy2 *r); +NTSTATUS _lsa_GetUserName(pipes_struct *p, struct lsa_GetUserName *r); +NTSTATUS _lsa_QueryInfoPolicy2(pipes_struct *p, struct lsa_QueryInfoPolicy2 *r); +NTSTATUS _lsa_SetInfoPolicy2(pipes_struct *p, struct lsa_SetInfoPolicy2 *r); +NTSTATUS _lsa_QueryTrustedDomainInfoByName(pipes_struct *p, struct lsa_QueryTrustedDomainInfoByName *r); +NTSTATUS _lsa_SetTrustedDomainInfoByName(pipes_struct *p, struct lsa_SetTrustedDomainInfoByName *r); +NTSTATUS _lsa_EnumTrustedDomainsEx(pipes_struct *p, struct lsa_EnumTrustedDomainsEx *r); +NTSTATUS _lsa_CreateTrustedDomainEx(pipes_struct *p, struct lsa_CreateTrustedDomainEx *r); +NTSTATUS _lsa_CloseTrustedDomainEx(pipes_struct *p, struct lsa_CloseTrustedDomainEx *r); +NTSTATUS _lsa_QueryDomainInformationPolicy(pipes_struct *p, struct lsa_QueryDomainInformationPolicy *r); +NTSTATUS _lsa_SetDomainInformationPolicy(pipes_struct *p, struct lsa_SetDomainInformationPolicy *r); +NTSTATUS _lsa_OpenTrustedDomainByName(pipes_struct *p, struct lsa_OpenTrustedDomainByName *r); +NTSTATUS _lsa_TestCall(pipes_struct *p, struct lsa_TestCall *r); +NTSTATUS _lsa_LookupSids2(pipes_struct *p, struct lsa_LookupSids2 *r); +NTSTATUS _lsa_LookupNames2(pipes_struct *p, struct lsa_LookupNames2 *r); +NTSTATUS _lsa_CreateTrustedDomainEx2(pipes_struct *p, struct lsa_CreateTrustedDomainEx2 *r); +NTSTATUS _lsa_CREDRWRITE(pipes_struct *p, struct lsa_CREDRWRITE *r); +NTSTATUS _lsa_CREDRREAD(pipes_struct *p, struct lsa_CREDRREAD *r); +NTSTATUS _lsa_CREDRENUMERATE(pipes_struct *p, struct lsa_CREDRENUMERATE *r); +NTSTATUS _lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p, struct lsa_CREDRWRITEDOMAINCREDENTIALS *r); +NTSTATUS _lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p, struct lsa_CREDRREADDOMAINCREDENTIALS *r); +NTSTATUS _lsa_CREDRDELETE(pipes_struct *p, struct lsa_CREDRDELETE *r); +NTSTATUS _lsa_CREDRGETTARGETINFO(pipes_struct *p, struct lsa_CREDRGETTARGETINFO *r); +NTSTATUS _lsa_CREDRPROFILELOADED(pipes_struct *p, struct lsa_CREDRPROFILELOADED *r); +NTSTATUS _lsa_LookupNames3(pipes_struct *p, struct lsa_LookupNames3 *r); +NTSTATUS _lsa_CREDRGETSESSIONTYPES(pipes_struct *p, struct lsa_CREDRGETSESSIONTYPES *r); +NTSTATUS _lsa_LSARREGISTERAUDITEVENT(pipes_struct *p, struct lsa_LSARREGISTERAUDITEVENT *r); +NTSTATUS _lsa_LSARGENAUDITEVENT(pipes_struct *p, struct lsa_LSARGENAUDITEVENT *r); +NTSTATUS _lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p, struct lsa_LSARUNREGISTERAUDITEVENT *r); +NTSTATUS _lsa_lsaRQueryForestTrustInformation(pipes_struct *p, struct lsa_lsaRQueryForestTrustInformation *r); +NTSTATUS _lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p, struct lsa_LSARSETFORESTTRUSTINFORMATION *r); +NTSTATUS _lsa_CREDRRENAME(pipes_struct *p, struct lsa_CREDRRENAME *r); +NTSTATUS _lsa_LookupSids3(pipes_struct *p, struct lsa_LookupSids3 *r); +NTSTATUS _lsa_LookupNames4(pipes_struct *p, struct lsa_LookupNames4 *r); +NTSTATUS _lsa_LSAROPENPOLICYSCE(pipes_struct *p, struct lsa_LSAROPENPOLICYSCE *r); +NTSTATUS _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p, struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r); +NTSTATUS _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p, struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r); +NTSTATUS _lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p, struct lsa_LSARADTREPORTSECURITYEVENT *r); +void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_lsarpc_init(void); +#endif /* __SRV_LSARPC__ */ diff --git a/librpc/gen_ndr/srv_netlogon.c b/librpc/gen_ndr/srv_netlogon.c new file mode 100644 index 0000000000..8cb461e94d --- /dev/null +++ b/librpc/gen_ndr/srv_netlogon.c @@ -0,0 +1,3896 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_netlogon.h" + +static bool api_netr_LogonUasLogon(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonUasLogon *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGON]; + + r = talloc(talloc_tos(), struct netr_LogonUasLogon); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonUasLogon, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct netr_UasInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonUasLogon(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonUasLogoff(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonUasLogoff *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGOFF]; + + r = talloc(talloc_tos(), struct netr_LogonUasLogoff); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct netr_UasLogoffInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonUasLogoff(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonSamLogon(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonSamLogon *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGON]; + + r = talloc(talloc_tos(), struct netr_LogonSamLogon); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.validation = talloc_zero(r, union netr_Validation); + if (r->out.validation == NULL) { + talloc_free(r); + return false; + } + + r->out.authoritative = talloc_zero(r, uint8_t); + if (r->out.authoritative == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonSamLogon(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonSamLogoff(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonSamLogoff *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGOFF]; + + r = talloc(talloc_tos(), struct netr_LogonSamLogoff); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.result = _netr_LogonSamLogoff(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_ServerReqChallenge(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_ServerReqChallenge *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERREQCHALLENGE]; + + r = talloc(talloc_tos(), struct netr_ServerReqChallenge); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, r); + } + + ZERO_STRUCT(r->out); + r->out.return_credentials = talloc_zero(r, struct netr_Credential); + if (r->out.return_credentials == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerReqChallenge(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_ServerAuthenticate(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_ServerAuthenticate *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE]; + + r = talloc(talloc_tos(), struct netr_ServerAuthenticate); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, r); + } + + ZERO_STRUCT(r->out); + r->out.return_credentials = talloc_zero(r, struct netr_Credential); + if (r->out.return_credentials == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerAuthenticate(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_ServerPasswordSet(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_ServerPasswordSet *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET]; + + r = talloc(talloc_tos(), struct netr_ServerPasswordSet); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); + if (r->out.return_authenticator == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerPasswordSet(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DatabaseDeltas(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DatabaseDeltas *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEDELTAS]; + + r = talloc(talloc_tos(), struct netr_DatabaseDeltas); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.sequence_num = r->in.sequence_num; + r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); + if (r->out.delta_enum_array == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DatabaseDeltas(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DatabaseSync(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DatabaseSync *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC]; + + r = talloc(talloc_tos(), struct netr_DatabaseSync); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DatabaseSync, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.sync_context = r->in.sync_context; + r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); + if (r->out.delta_enum_array == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DatabaseSync(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_AccountDeltas(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_AccountDeltas *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTDELTAS]; + + r = talloc(talloc_tos(), struct netr_AccountDeltas); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_AccountDeltas, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.buffer = talloc_zero(r, struct netr_AccountBuffer); + if (r->out.buffer == NULL) { + talloc_free(r); + return false; + } + + r->out.count_returned = talloc_zero(r, uint32_t); + if (r->out.count_returned == NULL) { + talloc_free(r); + return false; + } + + r->out.total_entries = talloc_zero(r, uint32_t); + if (r->out.total_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.recordid = talloc_zero(r, struct netr_UAS_INFO_0); + if (r->out.recordid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_AccountDeltas(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_AccountSync(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_AccountSync *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTSYNC]; + + r = talloc(talloc_tos(), struct netr_AccountSync); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_AccountSync, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.recordid = r->in.recordid; + r->out.buffer = talloc_zero(r, struct netr_AccountBuffer); + if (r->out.buffer == NULL) { + talloc_free(r); + return false; + } + + r->out.count_returned = talloc_zero(r, uint32_t); + if (r->out.count_returned == NULL) { + talloc_free(r); + return false; + } + + r->out.total_entries = talloc_zero(r, uint32_t); + if (r->out.total_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.next_reference = talloc_zero(r, uint32_t); + if (r->out.next_reference == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_AccountSync(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_AccountSync, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_GetDcName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_GetDcName *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_GETDCNAME]; + + r = talloc(talloc_tos(), struct netr_GetDcName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_GetDcName, r); + } + + ZERO_STRUCT(r->out); + r->out.dcname = talloc_zero(r, const char *); + if (r->out.dcname == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_GetDcName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_GetDcName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonControl(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonControl *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL]; + + r = talloc(talloc_tos(), struct netr_LogonControl); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonControl, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonControl(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonControl, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_GetAnyDCName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_GetAnyDCName *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_GETANYDCNAME]; + + r = talloc(talloc_tos(), struct netr_GetAnyDCName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, r); + } + + ZERO_STRUCT(r->out); + r->out.dcname = talloc_zero(r, const char *); + if (r->out.dcname == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_GetAnyDCName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonControl2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonControl2 *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2]; + + r = talloc(talloc_tos(), struct netr_LogonControl2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonControl2, r); + } + + ZERO_STRUCT(r->out); + r->out.query = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION); + if (r->out.query == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonControl2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonControl2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_ServerAuthenticate2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_ServerAuthenticate2 *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE2]; + + r = talloc(talloc_tos(), struct netr_ServerAuthenticate2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, r); + } + + ZERO_STRUCT(r->out); + r->out.negotiate_flags = r->in.negotiate_flags; + r->out.return_credentials = talloc_zero(r, struct netr_Credential); + if (r->out.return_credentials == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerAuthenticate2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DatabaseSync2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DatabaseSync2 *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC2]; + + r = talloc(talloc_tos(), struct netr_DatabaseSync2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.sync_context = r->in.sync_context; + r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); + if (r->out.delta_enum_array == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DatabaseSync2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DatabaseRedo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DatabaseRedo *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEREDO]; + + r = talloc(talloc_tos(), struct netr_DatabaseRedo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); + if (r->out.delta_enum_array == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DatabaseRedo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonControl2Ex(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonControl2Ex *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2EX]; + + r = talloc(talloc_tos(), struct netr_LogonControl2Ex); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, r); + } + + ZERO_STRUCT(r->out); + r->out.query = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION); + if (r->out.query == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonControl2Ex(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_NetrEnumerateTrustedDomains(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_NetrEnumerateTrustedDomains *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINS]; + + r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomains); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, r); + } + + ZERO_STRUCT(r->out); + r->out.trusted_domains_blob = talloc_zero(r, struct netr_Blob); + if (r->out.trusted_domains_blob == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_NetrEnumerateTrustedDomains(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsRGetDCName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsRGetDCName *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAME]; + + r = talloc(talloc_tos(), struct netr_DsRGetDCName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DsRGetDCName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_NETRLOGONDUMMYROUTINE1 *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONDUMMYROUTINE1]; + + r = talloc(talloc_tos(), struct netr_NETRLOGONDUMMYROUTINE1); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, r); + } + + r->out.result = _netr_NETRLOGONDUMMYROUTINE1(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_NETRLOGONSETSERVICEBITS *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSETSERVICEBITS]; + + r = talloc(talloc_tos(), struct netr_NETRLOGONSETSERVICEBITS); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, r); + } + + r->out.result = _netr_NETRLOGONSETSERVICEBITS(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonGetTrustRid(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonGetTrustRid *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETTRUSTRID]; + + r = talloc(talloc_tos(), struct netr_LogonGetTrustRid); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, r); + } + + ZERO_STRUCT(r->out); + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonGetTrustRid(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_NETRLOGONCOMPUTESERVERDIGEST *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST]; + + r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTESERVERDIGEST); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, r); + } + + r->out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST]; + + r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTECLIENTDIGEST); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, r); + } + + r->out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_ServerAuthenticate3(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_ServerAuthenticate3 *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE3]; + + r = talloc(talloc_tos(), struct netr_ServerAuthenticate3); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, r); + } + + ZERO_STRUCT(r->out); + r->out.negotiate_flags = r->in.negotiate_flags; + r->out.return_credentials = talloc_zero(r, struct netr_Credential); + if (r->out.return_credentials == NULL) { + talloc_free(r); + return false; + } + + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerAuthenticate3(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsRGetDCNameEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsRGetDCNameEx *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX]; + + r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DsRGetDCNameEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsRGetSiteName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsRGetSiteName *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETSITENAME]; + + r = talloc(talloc_tos(), struct netr_DsRGetSiteName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, r); + } + + ZERO_STRUCT(r->out); + r->out.site = talloc_zero(r, const char *); + if (r->out.site == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DsRGetSiteName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonGetDomainInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonGetDomainInfo *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETDOMAININFO]; + + r = talloc(talloc_tos(), struct netr_LogonGetDomainInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.info = talloc_zero(r, union netr_DomainInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonGetDomainInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_ServerPasswordSet2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_ServerPasswordSet2 *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET2]; + + r = talloc(talloc_tos(), struct netr_ServerPasswordSet2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); + if (r->out.return_authenticator == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerPasswordSet2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_ServerPasswordGet(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_ServerPasswordGet *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDGET]; + + r = talloc(talloc_tos(), struct netr_ServerPasswordGet); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); + if (r->out.return_authenticator == NULL) { + talloc_free(r); + return false; + } + + r->out.password = talloc_zero(r, struct samr_Password); + if (r->out.password == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerPasswordGet(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_NETRLOGONSENDTOSAM(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_NETRLOGONSENDTOSAM *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSENDTOSAM]; + + r = talloc(talloc_tos(), struct netr_NETRLOGONSENDTOSAM); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, r); + } + + r->out.result = _netr_NETRLOGONSENDTOSAM(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsRAddressToSitenamesW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsRAddressToSitenamesW *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESW]; + + r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, r); + } + + ZERO_STRUCT(r->out); + r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesWCtr *); + if (r->out.ctr == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DsRAddressToSitenamesW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsRGetDCNameEx2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsRGetDCNameEx2 *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX2]; + + r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DsRGetDCNameEx2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN]; + + r = talloc(talloc_tos(), struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, r); + } + + r->out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_NetrEnumerateTrustedDomainsEx *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX]; + + r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomainsEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r); + } + + ZERO_STRUCT(r->out); + r->out.dom_trust_list = talloc_zero(r, struct netr_DomainTrustList); + if (r->out.dom_trust_list == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_NetrEnumerateTrustedDomainsEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsRAddressToSitenamesExW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsRAddressToSitenamesExW *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESEXW]; + + r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesExW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, r); + } + + ZERO_STRUCT(r->out); + r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesExWCtr *); + if (r->out.ctr == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DsRAddressToSitenamesExW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsrGetDcSiteCoverageW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsrGetDcSiteCoverageW *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCSITECOVERAGEW]; + + r = talloc(talloc_tos(), struct netr_DsrGetDcSiteCoverageW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, r); + } + + ZERO_STRUCT(r->out); + r->out.ctr = talloc_zero(r, struct DcSitesCtr *); + if (r->out.ctr == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DsrGetDcSiteCoverageW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonSamLogonEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonSamLogonEx *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONEX]; + + r = talloc(talloc_tos(), struct netr_LogonSamLogonEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, r); + } + + ZERO_STRUCT(r->out); + r->out.flags = r->in.flags; + r->out.validation = talloc_zero(r, union netr_Validation); + if (r->out.validation == NULL) { + talloc_free(r); + return false; + } + + r->out.authoritative = talloc_zero(r, uint8_t); + if (r->out.authoritative == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonSamLogonEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsrEnumerateDomainTrusts(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsrEnumerateDomainTrusts *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRENUMERATEDOMAINTRUSTS]; + + r = talloc(talloc_tos(), struct netr_DsrEnumerateDomainTrusts); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, r); + } + + ZERO_STRUCT(r->out); + r->out.trusts = talloc_zero(r, struct netr_DomainTrustList); + if (r->out.trusts == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DsrEnumerateDomainTrusts(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsrDeregisterDNSHostRecords(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsrDeregisterDNSHostRecords *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS]; + + r = talloc(talloc_tos(), struct netr_DsrDeregisterDNSHostRecords); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, r); + } + + r->out.result = _netr_DsrDeregisterDNSHostRecords(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_ServerTrustPasswordsGet(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_ServerTrustPasswordsGet *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERTRUSTPASSWORDSGET]; + + r = talloc(talloc_tos(), struct netr_ServerTrustPasswordsGet); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); + if (r->out.return_authenticator == NULL) { + talloc_free(r); + return false; + } + + r->out.password = talloc_zero(r, struct samr_Password); + if (r->out.password == NULL) { + talloc_free(r); + return false; + } + + r->out.password2 = talloc_zero(r, struct samr_Password); + if (r->out.password2 == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerTrustPasswordsGet(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_DsRGetForestTrustInformation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_DsRGetForestTrustInformation *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETFORESTTRUSTINFORMATION]; + + r = talloc(talloc_tos(), struct netr_DsRGetForestTrustInformation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *); + if (r->out.forest_trust_info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_DsRGetForestTrustInformation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_GetForestTrustInformation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_GetForestTrustInformation *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_GETFORESTTRUSTINFORMATION]; + + r = talloc(talloc_tos(), struct netr_GetForestTrustInformation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); + if (r->out.return_authenticator == NULL) { + talloc_free(r); + return false; + } + + r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *); + if (r->out.forest_trust_info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_GetForestTrustInformation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_LogonSamLogonWithFlags(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_LogonSamLogonWithFlags *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONWITHFLAGS]; + + r = talloc(talloc_tos(), struct netr_LogonSamLogonWithFlags); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.flags = r->in.flags; + r->out.validation = talloc_zero(r, union netr_Validation); + if (r->out.validation == NULL) { + talloc_free(r); + return false; + } + + r->out.authoritative = talloc_zero(r, uint8_t); + if (r->out.authoritative == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonSamLogonWithFlags(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_netr_ServerGetTrustInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct netr_ServerGetTrustInfo *r; + + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERGETTRUSTINFO]; + + r = talloc(talloc_tos(), struct netr_ServerGetTrustInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); + if (r->out.return_authenticator == NULL) { + talloc_free(r); + return false; + } + + r->out.new_owf_password = talloc_zero(r, struct samr_Password); + if (r->out.new_owf_password == NULL) { + talloc_free(r); + return false; + } + + r->out.old_owf_password = talloc_zero(r, struct samr_Password); + if (r->out.old_owf_password == NULL) { + talloc_free(r); + return false; + } + + r->out.trust_info = talloc_zero(r, struct netr_TrustInfo *); + if (r->out.trust_info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerGetTrustInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_netlogon_cmds[] = +{ + {"NETR_LOGONUASLOGON", NDR_NETR_LOGONUASLOGON, api_netr_LogonUasLogon}, + {"NETR_LOGONUASLOGOFF", NDR_NETR_LOGONUASLOGOFF, api_netr_LogonUasLogoff}, + {"NETR_LOGONSAMLOGON", NDR_NETR_LOGONSAMLOGON, api_netr_LogonSamLogon}, + {"NETR_LOGONSAMLOGOFF", NDR_NETR_LOGONSAMLOGOFF, api_netr_LogonSamLogoff}, + {"NETR_SERVERREQCHALLENGE", NDR_NETR_SERVERREQCHALLENGE, api_netr_ServerReqChallenge}, + {"NETR_SERVERAUTHENTICATE", NDR_NETR_SERVERAUTHENTICATE, api_netr_ServerAuthenticate}, + {"NETR_SERVERPASSWORDSET", NDR_NETR_SERVERPASSWORDSET, api_netr_ServerPasswordSet}, + {"NETR_DATABASEDELTAS", NDR_NETR_DATABASEDELTAS, api_netr_DatabaseDeltas}, + {"NETR_DATABASESYNC", NDR_NETR_DATABASESYNC, api_netr_DatabaseSync}, + {"NETR_ACCOUNTDELTAS", NDR_NETR_ACCOUNTDELTAS, api_netr_AccountDeltas}, + {"NETR_ACCOUNTSYNC", NDR_NETR_ACCOUNTSYNC, api_netr_AccountSync}, + {"NETR_GETDCNAME", NDR_NETR_GETDCNAME, api_netr_GetDcName}, + {"NETR_LOGONCONTROL", NDR_NETR_LOGONCONTROL, api_netr_LogonControl}, + {"NETR_GETANYDCNAME", NDR_NETR_GETANYDCNAME, api_netr_GetAnyDCName}, + {"NETR_LOGONCONTROL2", NDR_NETR_LOGONCONTROL2, api_netr_LogonControl2}, + {"NETR_SERVERAUTHENTICATE2", NDR_NETR_SERVERAUTHENTICATE2, api_netr_ServerAuthenticate2}, + {"NETR_DATABASESYNC2", NDR_NETR_DATABASESYNC2, api_netr_DatabaseSync2}, + {"NETR_DATABASEREDO", NDR_NETR_DATABASEREDO, api_netr_DatabaseRedo}, + {"NETR_LOGONCONTROL2EX", NDR_NETR_LOGONCONTROL2EX, api_netr_LogonControl2Ex}, + {"NETR_NETRENUMERATETRUSTEDDOMAINS", NDR_NETR_NETRENUMERATETRUSTEDDOMAINS, api_netr_NetrEnumerateTrustedDomains}, + {"NETR_DSRGETDCNAME", NDR_NETR_DSRGETDCNAME, api_netr_DsRGetDCName}, + {"NETR_NETRLOGONDUMMYROUTINE1", NDR_NETR_NETRLOGONDUMMYROUTINE1, api_netr_NETRLOGONDUMMYROUTINE1}, + {"NETR_NETRLOGONSETSERVICEBITS", NDR_NETR_NETRLOGONSETSERVICEBITS, api_netr_NETRLOGONSETSERVICEBITS}, + {"NETR_LOGONGETTRUSTRID", NDR_NETR_LOGONGETTRUSTRID, api_netr_LogonGetTrustRid}, + {"NETR_NETRLOGONCOMPUTESERVERDIGEST", NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST, api_netr_NETRLOGONCOMPUTESERVERDIGEST}, + {"NETR_NETRLOGONCOMPUTECLIENTDIGEST", NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST, api_netr_NETRLOGONCOMPUTECLIENTDIGEST}, + {"NETR_SERVERAUTHENTICATE3", NDR_NETR_SERVERAUTHENTICATE3, api_netr_ServerAuthenticate3}, + {"NETR_DSRGETDCNAMEEX", NDR_NETR_DSRGETDCNAMEEX, api_netr_DsRGetDCNameEx}, + {"NETR_DSRGETSITENAME", NDR_NETR_DSRGETSITENAME, api_netr_DsRGetSiteName}, + {"NETR_LOGONGETDOMAININFO", NDR_NETR_LOGONGETDOMAININFO, api_netr_LogonGetDomainInfo}, + {"NETR_SERVERPASSWORDSET2", NDR_NETR_SERVERPASSWORDSET2, api_netr_ServerPasswordSet2}, + {"NETR_SERVERPASSWORDGET", NDR_NETR_SERVERPASSWORDGET, api_netr_ServerPasswordGet}, + {"NETR_NETRLOGONSENDTOSAM", NDR_NETR_NETRLOGONSENDTOSAM, api_netr_NETRLOGONSENDTOSAM}, + {"NETR_DSRADDRESSTOSITENAMESW", NDR_NETR_DSRADDRESSTOSITENAMESW, api_netr_DsRAddressToSitenamesW}, + {"NETR_DSRGETDCNAMEEX2", NDR_NETR_DSRGETDCNAMEEX2, api_netr_DsRGetDCNameEx2}, + {"NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN", NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN, api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN}, + {"NETR_NETRENUMERATETRUSTEDDOMAINSEX", NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX, api_netr_NetrEnumerateTrustedDomainsEx}, + {"NETR_DSRADDRESSTOSITENAMESEXW", NDR_NETR_DSRADDRESSTOSITENAMESEXW, api_netr_DsRAddressToSitenamesExW}, + {"NETR_DSRGETDCSITECOVERAGEW", NDR_NETR_DSRGETDCSITECOVERAGEW, api_netr_DsrGetDcSiteCoverageW}, + {"NETR_LOGONSAMLOGONEX", NDR_NETR_LOGONSAMLOGONEX, api_netr_LogonSamLogonEx}, + {"NETR_DSRENUMERATEDOMAINTRUSTS", NDR_NETR_DSRENUMERATEDOMAINTRUSTS, api_netr_DsrEnumerateDomainTrusts}, + {"NETR_DSRDEREGISTERDNSHOSTRECORDS", NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS, api_netr_DsrDeregisterDNSHostRecords}, + {"NETR_SERVERTRUSTPASSWORDSGET", NDR_NETR_SERVERTRUSTPASSWORDSGET, api_netr_ServerTrustPasswordsGet}, + {"NETR_DSRGETFORESTTRUSTINFORMATION", NDR_NETR_DSRGETFORESTTRUSTINFORMATION, api_netr_DsRGetForestTrustInformation}, + {"NETR_GETFORESTTRUSTINFORMATION", NDR_NETR_GETFORESTTRUSTINFORMATION, api_netr_GetForestTrustInformation}, + {"NETR_LOGONSAMLOGONWITHFLAGS", NDR_NETR_LOGONSAMLOGONWITHFLAGS, api_netr_LogonSamLogonWithFlags}, + {"NETR_SERVERGETTRUSTINFO", NDR_NETR_SERVERGETTRUSTINFO, api_netr_ServerGetTrustInfo}, +}; + +void netlogon_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_netlogon_cmds; + *n_fns = sizeof(api_netlogon_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_netlogon_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "netlogon", "netlogon", &ndr_table_netlogon.syntax_id, api_netlogon_cmds, sizeof(api_netlogon_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_netlogon.h b/librpc/gen_ndr/srv_netlogon.h new file mode 100644 index 0000000000..cd68d12f1e --- /dev/null +++ b/librpc/gen_ndr/srv_netlogon.h @@ -0,0 +1,53 @@ +#include "librpc/gen_ndr/ndr_netlogon.h" +#ifndef __SRV_NETLOGON__ +#define __SRV_NETLOGON__ +WERROR _netr_LogonUasLogon(pipes_struct *p, struct netr_LogonUasLogon *r); +WERROR _netr_LogonUasLogoff(pipes_struct *p, struct netr_LogonUasLogoff *r); +NTSTATUS _netr_LogonSamLogon(pipes_struct *p, struct netr_LogonSamLogon *r); +NTSTATUS _netr_LogonSamLogoff(pipes_struct *p, struct netr_LogonSamLogoff *r); +NTSTATUS _netr_ServerReqChallenge(pipes_struct *p, struct netr_ServerReqChallenge *r); +NTSTATUS _netr_ServerAuthenticate(pipes_struct *p, struct netr_ServerAuthenticate *r); +NTSTATUS _netr_ServerPasswordSet(pipes_struct *p, struct netr_ServerPasswordSet *r); +NTSTATUS _netr_DatabaseDeltas(pipes_struct *p, struct netr_DatabaseDeltas *r); +NTSTATUS _netr_DatabaseSync(pipes_struct *p, struct netr_DatabaseSync *r); +NTSTATUS _netr_AccountDeltas(pipes_struct *p, struct netr_AccountDeltas *r); +NTSTATUS _netr_AccountSync(pipes_struct *p, struct netr_AccountSync *r); +WERROR _netr_GetDcName(pipes_struct *p, struct netr_GetDcName *r); +WERROR _netr_LogonControl(pipes_struct *p, struct netr_LogonControl *r); +WERROR _netr_GetAnyDCName(pipes_struct *p, struct netr_GetAnyDCName *r); +WERROR _netr_LogonControl2(pipes_struct *p, struct netr_LogonControl2 *r); +NTSTATUS _netr_ServerAuthenticate2(pipes_struct *p, struct netr_ServerAuthenticate2 *r); +NTSTATUS _netr_DatabaseSync2(pipes_struct *p, struct netr_DatabaseSync2 *r); +NTSTATUS _netr_DatabaseRedo(pipes_struct *p, struct netr_DatabaseRedo *r); +WERROR _netr_LogonControl2Ex(pipes_struct *p, struct netr_LogonControl2Ex *r); +WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p, struct netr_NetrEnumerateTrustedDomains *r); +WERROR _netr_DsRGetDCName(pipes_struct *p, struct netr_DsRGetDCName *r); +WERROR _netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p, struct netr_NETRLOGONDUMMYROUTINE1 *r); +WERROR _netr_NETRLOGONSETSERVICEBITS(pipes_struct *p, struct netr_NETRLOGONSETSERVICEBITS *r); +WERROR _netr_LogonGetTrustRid(pipes_struct *p, struct netr_LogonGetTrustRid *r); +WERROR _netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r); +WERROR _netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p, struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r); +NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p, struct netr_ServerAuthenticate3 *r); +WERROR _netr_DsRGetDCNameEx(pipes_struct *p, struct netr_DsRGetDCNameEx *r); +WERROR _netr_DsRGetSiteName(pipes_struct *p, struct netr_DsRGetSiteName *r); +NTSTATUS _netr_LogonGetDomainInfo(pipes_struct *p, struct netr_LogonGetDomainInfo *r); +NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p, struct netr_ServerPasswordSet2 *r); +WERROR _netr_ServerPasswordGet(pipes_struct *p, struct netr_ServerPasswordGet *r); +WERROR _netr_NETRLOGONSENDTOSAM(pipes_struct *p, struct netr_NETRLOGONSENDTOSAM *r); +WERROR _netr_DsRAddressToSitenamesW(pipes_struct *p, struct netr_DsRAddressToSitenamesW *r); +WERROR _netr_DsRGetDCNameEx2(pipes_struct *p, struct netr_DsRGetDCNameEx2 *r); +WERROR _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r); +WERROR _netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p, struct netr_NetrEnumerateTrustedDomainsEx *r); +WERROR _netr_DsRAddressToSitenamesExW(pipes_struct *p, struct netr_DsRAddressToSitenamesExW *r); +WERROR _netr_DsrGetDcSiteCoverageW(pipes_struct *p, struct netr_DsrGetDcSiteCoverageW *r); +NTSTATUS _netr_LogonSamLogonEx(pipes_struct *p, struct netr_LogonSamLogonEx *r); +WERROR _netr_DsrEnumerateDomainTrusts(pipes_struct *p, struct netr_DsrEnumerateDomainTrusts *r); +WERROR _netr_DsrDeregisterDNSHostRecords(pipes_struct *p, struct netr_DsrDeregisterDNSHostRecords *r); +NTSTATUS _netr_ServerTrustPasswordsGet(pipes_struct *p, struct netr_ServerTrustPasswordsGet *r); +WERROR _netr_DsRGetForestTrustInformation(pipes_struct *p, struct netr_DsRGetForestTrustInformation *r); +WERROR _netr_GetForestTrustInformation(pipes_struct *p, struct netr_GetForestTrustInformation *r); +NTSTATUS _netr_LogonSamLogonWithFlags(pipes_struct *p, struct netr_LogonSamLogonWithFlags *r); +NTSTATUS _netr_ServerGetTrustInfo(pipes_struct *p, struct netr_ServerGetTrustInfo *r); +void netlogon_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_netlogon_init(void); +#endif /* __SRV_NETLOGON__ */ diff --git a/librpc/gen_ndr/srv_ntsvcs.c b/librpc/gen_ndr/srv_ntsvcs.c new file mode 100644 index 0000000000..288f3ed5d7 --- /dev/null +++ b/librpc/gen_ndr/srv_ntsvcs.c @@ -0,0 +1,4877 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_ntsvcs.h" + +static bool api_PNP_Disconnect(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_Disconnect *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DISCONNECT]; + + r = talloc(talloc_tos(), struct PNP_Disconnect); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_Disconnect, r); + } + + r->out.result = _PNP_Disconnect(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_Disconnect, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_Connect(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_Connect *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_CONNECT]; + + r = talloc(talloc_tos(), struct PNP_Connect); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_Connect, r); + } + + r->out.result = _PNP_Connect(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_Connect, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetVersion(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetVersion *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETVERSION]; + + r = talloc(talloc_tos(), struct PNP_GetVersion); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetVersion, r); + } + + ZERO_STRUCT(r->out); + r->out.version = talloc_zero(r, uint16_t); + if (r->out.version == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _PNP_GetVersion(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetVersion, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetGlobalState(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetGlobalState *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETGLOBALSTATE]; + + r = talloc(talloc_tos(), struct PNP_GetGlobalState); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, r); + } + + r->out.result = _PNP_GetGlobalState(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_InitDetection(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_InitDetection *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_INITDETECTION]; + + r = talloc(talloc_tos(), struct PNP_InitDetection); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_InitDetection, r); + } + + r->out.result = _PNP_InitDetection(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_InitDetection, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_ReportLogOn(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_ReportLogOn *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REPORTLOGON]; + + r = talloc(talloc_tos(), struct PNP_ReportLogOn); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, r); + } + + r->out.result = _PNP_ReportLogOn(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_ValidateDeviceInstance(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_ValidateDeviceInstance *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_VALIDATEDEVICEINSTANCE]; + + r = talloc(talloc_tos(), struct PNP_ValidateDeviceInstance); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, r); + } + + r->out.result = _PNP_ValidateDeviceInstance(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetRootDeviceInstance(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetRootDeviceInstance *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETROOTDEVICEINSTANCE]; + + r = talloc(talloc_tos(), struct PNP_GetRootDeviceInstance); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, r); + } + + r->out.result = _PNP_GetRootDeviceInstance(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetRelatedDeviceInstance(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetRelatedDeviceInstance *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETRELATEDDEVICEINSTANCE]; + + r = talloc(talloc_tos(), struct PNP_GetRelatedDeviceInstance); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, r); + } + + r->out.result = _PNP_GetRelatedDeviceInstance(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_EnumerateSubKeys(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_EnumerateSubKeys *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ENUMERATESUBKEYS]; + + r = talloc(talloc_tos(), struct PNP_EnumerateSubKeys); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, r); + } + + r->out.result = _PNP_EnumerateSubKeys(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetDeviceList(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetDeviceList *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICELIST]; + + r = talloc(talloc_tos(), struct PNP_GetDeviceList); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, r); + } + + ZERO_STRUCT(r->out); + r->out.length = r->in.length; + r->out.buffer = talloc_zero_array(r, uint16_t, *r->out.length); + if (r->out.buffer == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _PNP_GetDeviceList(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetDeviceListSize(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetDeviceListSize *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICELISTSIZE]; + + r = talloc(talloc_tos(), struct PNP_GetDeviceListSize); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, r); + } + + ZERO_STRUCT(r->out); + r->out.size = talloc_zero(r, uint32_t); + if (r->out.size == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _PNP_GetDeviceListSize(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetDepth(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetDepth *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEPTH]; + + r = talloc(talloc_tos(), struct PNP_GetDepth); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDepth, r); + } + + r->out.result = _PNP_GetDepth(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDepth, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetDeviceRegProp(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetDeviceRegProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICEREGPROP]; + + r = talloc(talloc_tos(), struct PNP_GetDeviceRegProp); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, r); + } + + ZERO_STRUCT(r->out); + r->out.reg_data_type = r->in.reg_data_type; + r->out.buffer_size = r->in.buffer_size; + r->out.needed = r->in.needed; + r->out.buffer = talloc_zero_array(r, uint8_t, *r->out.buffer_size); + if (r->out.buffer == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _PNP_GetDeviceRegProp(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_SetDeviceRegProp(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_SetDeviceRegProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_SETDEVICEREGPROP]; + + r = talloc(talloc_tos(), struct PNP_SetDeviceRegProp); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, r); + } + + r->out.result = _PNP_SetDeviceRegProp(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetClassInstance(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetClassInstance *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSINSTANCE]; + + r = talloc(talloc_tos(), struct PNP_GetClassInstance); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, r); + } + + r->out.result = _PNP_GetClassInstance(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_CreateKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_CreateKey *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_CREATEKEY]; + + r = talloc(talloc_tos(), struct PNP_CreateKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_CreateKey, r); + } + + r->out.result = _PNP_CreateKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_CreateKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_DeleteRegistryKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_DeleteRegistryKey *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DELETEREGISTRYKEY]; + + r = talloc(talloc_tos(), struct PNP_DeleteRegistryKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, r); + } + + r->out.result = _PNP_DeleteRegistryKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetClassCount(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetClassCount *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSCOUNT]; + + r = talloc(talloc_tos(), struct PNP_GetClassCount); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassCount, r); + } + + r->out.result = _PNP_GetClassCount(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetClassName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetClassName *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSNAME]; + + r = talloc(talloc_tos(), struct PNP_GetClassName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassName, r); + } + + r->out.result = _PNP_GetClassName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_DeleteClassKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_DeleteClassKey *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DELETECLASSKEY]; + + r = talloc(talloc_tos(), struct PNP_DeleteClassKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, r); + } + + r->out.result = _PNP_DeleteClassKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetInterfaceDeviceAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetInterfaceDeviceAlias *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETINTERFACEDEVICEALIAS]; + + r = talloc(talloc_tos(), struct PNP_GetInterfaceDeviceAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, r); + } + + r->out.result = _PNP_GetInterfaceDeviceAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetInterfaceDeviceList(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetInterfaceDeviceList *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETINTERFACEDEVICELIST]; + + r = talloc(talloc_tos(), struct PNP_GetInterfaceDeviceList); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, r); + } + + r->out.result = _PNP_GetInterfaceDeviceList(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetInterfaceDeviceListSize(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetInterfaceDeviceListSize *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETINTERFACEDEVICELISTSIZE]; + + r = talloc(talloc_tos(), struct PNP_GetInterfaceDeviceListSize); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, r); + } + + r->out.result = _PNP_GetInterfaceDeviceListSize(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_RegisterDeviceClassAssociation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_RegisterDeviceClassAssociation *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REGISTERDEVICECLASSASSOCIATION]; + + r = talloc(talloc_tos(), struct PNP_RegisterDeviceClassAssociation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, r); + } + + r->out.result = _PNP_RegisterDeviceClassAssociation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_UnregisterDeviceClassAssociation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_UnregisterDeviceClassAssociation *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION]; + + r = talloc(talloc_tos(), struct PNP_UnregisterDeviceClassAssociation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, r); + } + + r->out.result = _PNP_UnregisterDeviceClassAssociation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetClassRegProp(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetClassRegProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSREGPROP]; + + r = talloc(talloc_tos(), struct PNP_GetClassRegProp); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, r); + } + + r->out.result = _PNP_GetClassRegProp(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_SetClassRegProp(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_SetClassRegProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_SETCLASSREGPROP]; + + r = talloc(talloc_tos(), struct PNP_SetClassRegProp); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, r); + } + + r->out.result = _PNP_SetClassRegProp(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_CreateDevInst(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_CreateDevInst *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_CREATEDEVINST]; + + r = talloc(talloc_tos(), struct PNP_CreateDevInst); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, r); + } + + r->out.result = _PNP_CreateDevInst(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_DeviceInstanceAction(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_DeviceInstanceAction *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DEVICEINSTANCEACTION]; + + r = talloc(talloc_tos(), struct PNP_DeviceInstanceAction); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, r); + } + + r->out.result = _PNP_DeviceInstanceAction(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetDeviceStatus(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetDeviceStatus *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICESTATUS]; + + r = talloc(talloc_tos(), struct PNP_GetDeviceStatus); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, r); + } + + r->out.result = _PNP_GetDeviceStatus(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_SetDeviceProblem(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_SetDeviceProblem *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_SETDEVICEPROBLEM]; + + r = talloc(talloc_tos(), struct PNP_SetDeviceProblem); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, r); + } + + r->out.result = _PNP_SetDeviceProblem(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_DisableDevInst(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_DisableDevInst *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DISABLEDEVINST]; + + r = talloc(talloc_tos(), struct PNP_DisableDevInst); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, r); + } + + r->out.result = _PNP_DisableDevInst(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_UninstallDevInst(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_UninstallDevInst *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_UNINSTALLDEVINST]; + + r = talloc(talloc_tos(), struct PNP_UninstallDevInst); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, r); + } + + r->out.result = _PNP_UninstallDevInst(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_AddID(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_AddID *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ADDID]; + + r = talloc(talloc_tos(), struct PNP_AddID); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_AddID, r); + } + + r->out.result = _PNP_AddID(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_AddID, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_RegisterDriver(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_RegisterDriver *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REGISTERDRIVER]; + + r = talloc(talloc_tos(), struct PNP_RegisterDriver); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, r); + } + + r->out.result = _PNP_RegisterDriver(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_QueryRemove(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_QueryRemove *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYREMOVE]; + + r = talloc(talloc_tos(), struct PNP_QueryRemove); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryRemove, r); + } + + r->out.result = _PNP_QueryRemove(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_RequestDeviceEject(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_RequestDeviceEject *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REQUESTDEVICEEJECT]; + + r = talloc(talloc_tos(), struct PNP_RequestDeviceEject); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, r); + } + + r->out.result = _PNP_RequestDeviceEject(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_IsDockStationPresent(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_IsDockStationPresent *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ISDOCKSTATIONPRESENT]; + + r = talloc(talloc_tos(), struct PNP_IsDockStationPresent); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, r); + } + + r->out.result = _PNP_IsDockStationPresent(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_RequestEjectPC(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_RequestEjectPC *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REQUESTEJECTPC]; + + r = talloc(talloc_tos(), struct PNP_RequestEjectPC); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, r); + } + + r->out.result = _PNP_RequestEjectPC(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_HwProfFlags(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_HwProfFlags *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_HWPROFFLAGS]; + + r = talloc(talloc_tos(), struct PNP_HwProfFlags); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, r); + } + + ZERO_STRUCT(r->out); + r->out.profile_flags = r->in.profile_flags; + r->out.veto_type = r->in.veto_type; + r->out.unknown5a = talloc_zero(r, const char *); + if (r->out.unknown5a == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _PNP_HwProfFlags(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetHwProfInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetHwProfInfo *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETHWPROFINFO]; + + r = talloc(talloc_tos(), struct PNP_GetHwProfInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = r->in.info; + r->out.result = _PNP_GetHwProfInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_AddEmptyLogConf(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_AddEmptyLogConf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ADDEMPTYLOGCONF]; + + r = talloc(talloc_tos(), struct PNP_AddEmptyLogConf); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, r); + } + + r->out.result = _PNP_AddEmptyLogConf(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_FreeLogConf(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_FreeLogConf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_FREELOGCONF]; + + r = talloc(talloc_tos(), struct PNP_FreeLogConf); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, r); + } + + r->out.result = _PNP_FreeLogConf(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetFirstLogConf(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetFirstLogConf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETFIRSTLOGCONF]; + + r = talloc(talloc_tos(), struct PNP_GetFirstLogConf); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, r); + } + + r->out.result = _PNP_GetFirstLogConf(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetNextLogConf(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetNextLogConf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETNEXTLOGCONF]; + + r = talloc(talloc_tos(), struct PNP_GetNextLogConf); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, r); + } + + r->out.result = _PNP_GetNextLogConf(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetLogConfPriority(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetLogConfPriority *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETLOGCONFPRIORITY]; + + r = talloc(talloc_tos(), struct PNP_GetLogConfPriority); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, r); + } + + r->out.result = _PNP_GetLogConfPriority(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_AddResDes(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_AddResDes *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ADDRESDES]; + + r = talloc(talloc_tos(), struct PNP_AddResDes); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_AddResDes, r); + } + + r->out.result = _PNP_AddResDes(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_AddResDes, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_FreeResDes(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_FreeResDes *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_FREERESDES]; + + r = talloc(talloc_tos(), struct PNP_FreeResDes); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_FreeResDes, r); + } + + r->out.result = _PNP_FreeResDes(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetNextResDes(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetNextResDes *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETNEXTRESDES]; + + r = talloc(talloc_tos(), struct PNP_GetNextResDes); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, r); + } + + r->out.result = _PNP_GetNextResDes(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetResDesData(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetResDesData *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETRESDESDATA]; + + r = talloc(talloc_tos(), struct PNP_GetResDesData); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetResDesData, r); + } + + r->out.result = _PNP_GetResDesData(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetResDesDataSize(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetResDesDataSize *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETRESDESDATASIZE]; + + r = talloc(talloc_tos(), struct PNP_GetResDesDataSize); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, r); + } + + r->out.result = _PNP_GetResDesDataSize(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_ModifyResDes(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_ModifyResDes *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_MODIFYRESDES]; + + r = talloc(talloc_tos(), struct PNP_ModifyResDes); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, r); + } + + r->out.result = _PNP_ModifyResDes(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_DetectResourceLimit(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_DetectResourceLimit *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DETECTRESOURCELIMIT]; + + r = talloc(talloc_tos(), struct PNP_DetectResourceLimit); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, r); + } + + r->out.result = _PNP_DetectResourceLimit(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_QueryResConfList(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_QueryResConfList *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYRESCONFLIST]; + + r = talloc(talloc_tos(), struct PNP_QueryResConfList); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, r); + } + + r->out.result = _PNP_QueryResConfList(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_SetHwProf(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_SetHwProf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_SETHWPROF]; + + r = talloc(talloc_tos(), struct PNP_SetHwProf); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetHwProf, r); + } + + r->out.result = _PNP_SetHwProf(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_QueryArbitratorFreeData(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_QueryArbitratorFreeData *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYARBITRATORFREEDATA]; + + r = talloc(talloc_tos(), struct PNP_QueryArbitratorFreeData); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, r); + } + + r->out.result = _PNP_QueryArbitratorFreeData(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_QueryArbitratorFreeSize(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_QueryArbitratorFreeSize *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYARBITRATORFREESIZE]; + + r = talloc(talloc_tos(), struct PNP_QueryArbitratorFreeSize); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, r); + } + + r->out.result = _PNP_QueryArbitratorFreeSize(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_RunDetection(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_RunDetection *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_RUNDETECTION]; + + r = talloc(talloc_tos(), struct PNP_RunDetection); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RunDetection, r); + } + + r->out.result = _PNP_RunDetection(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RunDetection, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_RegisterNotification(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_RegisterNotification *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REGISTERNOTIFICATION]; + + r = talloc(talloc_tos(), struct PNP_RegisterNotification); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, r); + } + + r->out.result = _PNP_RegisterNotification(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_UnregisterNotification(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_UnregisterNotification *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_UNREGISTERNOTIFICATION]; + + r = talloc(talloc_tos(), struct PNP_UnregisterNotification); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, r); + } + + r->out.result = _PNP_UnregisterNotification(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetCustomDevProp(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetCustomDevProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCUSTOMDEVPROP]; + + r = talloc(talloc_tos(), struct PNP_GetCustomDevProp); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, r); + } + + r->out.result = _PNP_GetCustomDevProp(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetVersionInternal(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetVersionInternal *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETVERSIONINTERNAL]; + + r = talloc(talloc_tos(), struct PNP_GetVersionInternal); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, r); + } + + r->out.result = _PNP_GetVersionInternal(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetBlockedDriverInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetBlockedDriverInfo *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETBLOCKEDDRIVERINFO]; + + r = talloc(talloc_tos(), struct PNP_GetBlockedDriverInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetBlockedDriverInfo, r); + } + + r->out.result = _PNP_GetBlockedDriverInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetBlockedDriverInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_PNP_GetServerSideDeviceInstallFlags(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct PNP_GetServerSideDeviceInstallFlags *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS]; + + r = talloc(talloc_tos(), struct PNP_GetServerSideDeviceInstallFlags); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetServerSideDeviceInstallFlags, r); + } + + r->out.result = _PNP_GetServerSideDeviceInstallFlags(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetServerSideDeviceInstallFlags, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_ntsvcs_cmds[] = +{ + {"PNP_DISCONNECT", NDR_PNP_DISCONNECT, api_PNP_Disconnect}, + {"PNP_CONNECT", NDR_PNP_CONNECT, api_PNP_Connect}, + {"PNP_GETVERSION", NDR_PNP_GETVERSION, api_PNP_GetVersion}, + {"PNP_GETGLOBALSTATE", NDR_PNP_GETGLOBALSTATE, api_PNP_GetGlobalState}, + {"PNP_INITDETECTION", NDR_PNP_INITDETECTION, api_PNP_InitDetection}, + {"PNP_REPORTLOGON", NDR_PNP_REPORTLOGON, api_PNP_ReportLogOn}, + {"PNP_VALIDATEDEVICEINSTANCE", NDR_PNP_VALIDATEDEVICEINSTANCE, api_PNP_ValidateDeviceInstance}, + {"PNP_GETROOTDEVICEINSTANCE", NDR_PNP_GETROOTDEVICEINSTANCE, api_PNP_GetRootDeviceInstance}, + {"PNP_GETRELATEDDEVICEINSTANCE", NDR_PNP_GETRELATEDDEVICEINSTANCE, api_PNP_GetRelatedDeviceInstance}, + {"PNP_ENUMERATESUBKEYS", NDR_PNP_ENUMERATESUBKEYS, api_PNP_EnumerateSubKeys}, + {"PNP_GETDEVICELIST", NDR_PNP_GETDEVICELIST, api_PNP_GetDeviceList}, + {"PNP_GETDEVICELISTSIZE", NDR_PNP_GETDEVICELISTSIZE, api_PNP_GetDeviceListSize}, + {"PNP_GETDEPTH", NDR_PNP_GETDEPTH, api_PNP_GetDepth}, + {"PNP_GETDEVICEREGPROP", NDR_PNP_GETDEVICEREGPROP, api_PNP_GetDeviceRegProp}, + {"PNP_SETDEVICEREGPROP", NDR_PNP_SETDEVICEREGPROP, api_PNP_SetDeviceRegProp}, + {"PNP_GETCLASSINSTANCE", NDR_PNP_GETCLASSINSTANCE, api_PNP_GetClassInstance}, + {"PNP_CREATEKEY", NDR_PNP_CREATEKEY, api_PNP_CreateKey}, + {"PNP_DELETEREGISTRYKEY", NDR_PNP_DELETEREGISTRYKEY, api_PNP_DeleteRegistryKey}, + {"PNP_GETCLASSCOUNT", NDR_PNP_GETCLASSCOUNT, api_PNP_GetClassCount}, + {"PNP_GETCLASSNAME", NDR_PNP_GETCLASSNAME, api_PNP_GetClassName}, + {"PNP_DELETECLASSKEY", NDR_PNP_DELETECLASSKEY, api_PNP_DeleteClassKey}, + {"PNP_GETINTERFACEDEVICEALIAS", NDR_PNP_GETINTERFACEDEVICEALIAS, api_PNP_GetInterfaceDeviceAlias}, + {"PNP_GETINTERFACEDEVICELIST", NDR_PNP_GETINTERFACEDEVICELIST, api_PNP_GetInterfaceDeviceList}, + {"PNP_GETINTERFACEDEVICELISTSIZE", NDR_PNP_GETINTERFACEDEVICELISTSIZE, api_PNP_GetInterfaceDeviceListSize}, + {"PNP_REGISTERDEVICECLASSASSOCIATION", NDR_PNP_REGISTERDEVICECLASSASSOCIATION, api_PNP_RegisterDeviceClassAssociation}, + {"PNP_UNREGISTERDEVICECLASSASSOCIATION", NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION, api_PNP_UnregisterDeviceClassAssociation}, + {"PNP_GETCLASSREGPROP", NDR_PNP_GETCLASSREGPROP, api_PNP_GetClassRegProp}, + {"PNP_SETCLASSREGPROP", NDR_PNP_SETCLASSREGPROP, api_PNP_SetClassRegProp}, + {"PNP_CREATEDEVINST", NDR_PNP_CREATEDEVINST, api_PNP_CreateDevInst}, + {"PNP_DEVICEINSTANCEACTION", NDR_PNP_DEVICEINSTANCEACTION, api_PNP_DeviceInstanceAction}, + {"PNP_GETDEVICESTATUS", NDR_PNP_GETDEVICESTATUS, api_PNP_GetDeviceStatus}, + {"PNP_SETDEVICEPROBLEM", NDR_PNP_SETDEVICEPROBLEM, api_PNP_SetDeviceProblem}, + {"PNP_DISABLEDEVINST", NDR_PNP_DISABLEDEVINST, api_PNP_DisableDevInst}, + {"PNP_UNINSTALLDEVINST", NDR_PNP_UNINSTALLDEVINST, api_PNP_UninstallDevInst}, + {"PNP_ADDID", NDR_PNP_ADDID, api_PNP_AddID}, + {"PNP_REGISTERDRIVER", NDR_PNP_REGISTERDRIVER, api_PNP_RegisterDriver}, + {"PNP_QUERYREMOVE", NDR_PNP_QUERYREMOVE, api_PNP_QueryRemove}, + {"PNP_REQUESTDEVICEEJECT", NDR_PNP_REQUESTDEVICEEJECT, api_PNP_RequestDeviceEject}, + {"PNP_ISDOCKSTATIONPRESENT", NDR_PNP_ISDOCKSTATIONPRESENT, api_PNP_IsDockStationPresent}, + {"PNP_REQUESTEJECTPC", NDR_PNP_REQUESTEJECTPC, api_PNP_RequestEjectPC}, + {"PNP_HWPROFFLAGS", NDR_PNP_HWPROFFLAGS, api_PNP_HwProfFlags}, + {"PNP_GETHWPROFINFO", NDR_PNP_GETHWPROFINFO, api_PNP_GetHwProfInfo}, + {"PNP_ADDEMPTYLOGCONF", NDR_PNP_ADDEMPTYLOGCONF, api_PNP_AddEmptyLogConf}, + {"PNP_FREELOGCONF", NDR_PNP_FREELOGCONF, api_PNP_FreeLogConf}, + {"PNP_GETFIRSTLOGCONF", NDR_PNP_GETFIRSTLOGCONF, api_PNP_GetFirstLogConf}, + {"PNP_GETNEXTLOGCONF", NDR_PNP_GETNEXTLOGCONF, api_PNP_GetNextLogConf}, + {"PNP_GETLOGCONFPRIORITY", NDR_PNP_GETLOGCONFPRIORITY, api_PNP_GetLogConfPriority}, + {"PNP_ADDRESDES", NDR_PNP_ADDRESDES, api_PNP_AddResDes}, + {"PNP_FREERESDES", NDR_PNP_FREERESDES, api_PNP_FreeResDes}, + {"PNP_GETNEXTRESDES", NDR_PNP_GETNEXTRESDES, api_PNP_GetNextResDes}, + {"PNP_GETRESDESDATA", NDR_PNP_GETRESDESDATA, api_PNP_GetResDesData}, + {"PNP_GETRESDESDATASIZE", NDR_PNP_GETRESDESDATASIZE, api_PNP_GetResDesDataSize}, + {"PNP_MODIFYRESDES", NDR_PNP_MODIFYRESDES, api_PNP_ModifyResDes}, + {"PNP_DETECTRESOURCELIMIT", NDR_PNP_DETECTRESOURCELIMIT, api_PNP_DetectResourceLimit}, + {"PNP_QUERYRESCONFLIST", NDR_PNP_QUERYRESCONFLIST, api_PNP_QueryResConfList}, + {"PNP_SETHWPROF", NDR_PNP_SETHWPROF, api_PNP_SetHwProf}, + {"PNP_QUERYARBITRATORFREEDATA", NDR_PNP_QUERYARBITRATORFREEDATA, api_PNP_QueryArbitratorFreeData}, + {"PNP_QUERYARBITRATORFREESIZE", NDR_PNP_QUERYARBITRATORFREESIZE, api_PNP_QueryArbitratorFreeSize}, + {"PNP_RUNDETECTION", NDR_PNP_RUNDETECTION, api_PNP_RunDetection}, + {"PNP_REGISTERNOTIFICATION", NDR_PNP_REGISTERNOTIFICATION, api_PNP_RegisterNotification}, + {"PNP_UNREGISTERNOTIFICATION", NDR_PNP_UNREGISTERNOTIFICATION, api_PNP_UnregisterNotification}, + {"PNP_GETCUSTOMDEVPROP", NDR_PNP_GETCUSTOMDEVPROP, api_PNP_GetCustomDevProp}, + {"PNP_GETVERSIONINTERNAL", NDR_PNP_GETVERSIONINTERNAL, api_PNP_GetVersionInternal}, + {"PNP_GETBLOCKEDDRIVERINFO", NDR_PNP_GETBLOCKEDDRIVERINFO, api_PNP_GetBlockedDriverInfo}, + {"PNP_GETSERVERSIDEDEVICEINSTALLFLAGS", NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS, api_PNP_GetServerSideDeviceInstallFlags}, +}; + +void ntsvcs_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_ntsvcs_cmds; + *n_fns = sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_ntsvcs_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "ntsvcs", "ntsvcs", &ndr_table_ntsvcs.syntax_id, api_ntsvcs_cmds, sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_ntsvcs.h b/librpc/gen_ndr/srv_ntsvcs.h new file mode 100644 index 0000000000..c3969b11da --- /dev/null +++ b/librpc/gen_ndr/srv_ntsvcs.h @@ -0,0 +1,71 @@ +#include "librpc/gen_ndr/ndr_ntsvcs.h" +#ifndef __SRV_NTSVCS__ +#define __SRV_NTSVCS__ +WERROR _PNP_Disconnect(pipes_struct *p, struct PNP_Disconnect *r); +WERROR _PNP_Connect(pipes_struct *p, struct PNP_Connect *r); +WERROR _PNP_GetVersion(pipes_struct *p, struct PNP_GetVersion *r); +WERROR _PNP_GetGlobalState(pipes_struct *p, struct PNP_GetGlobalState *r); +WERROR _PNP_InitDetection(pipes_struct *p, struct PNP_InitDetection *r); +WERROR _PNP_ReportLogOn(pipes_struct *p, struct PNP_ReportLogOn *r); +WERROR _PNP_ValidateDeviceInstance(pipes_struct *p, struct PNP_ValidateDeviceInstance *r); +WERROR _PNP_GetRootDeviceInstance(pipes_struct *p, struct PNP_GetRootDeviceInstance *r); +WERROR _PNP_GetRelatedDeviceInstance(pipes_struct *p, struct PNP_GetRelatedDeviceInstance *r); +WERROR _PNP_EnumerateSubKeys(pipes_struct *p, struct PNP_EnumerateSubKeys *r); +WERROR _PNP_GetDeviceList(pipes_struct *p, struct PNP_GetDeviceList *r); +WERROR _PNP_GetDeviceListSize(pipes_struct *p, struct PNP_GetDeviceListSize *r); +WERROR _PNP_GetDepth(pipes_struct *p, struct PNP_GetDepth *r); +WERROR _PNP_GetDeviceRegProp(pipes_struct *p, struct PNP_GetDeviceRegProp *r); +WERROR _PNP_SetDeviceRegProp(pipes_struct *p, struct PNP_SetDeviceRegProp *r); +WERROR _PNP_GetClassInstance(pipes_struct *p, struct PNP_GetClassInstance *r); +WERROR _PNP_CreateKey(pipes_struct *p, struct PNP_CreateKey *r); +WERROR _PNP_DeleteRegistryKey(pipes_struct *p, struct PNP_DeleteRegistryKey *r); +WERROR _PNP_GetClassCount(pipes_struct *p, struct PNP_GetClassCount *r); +WERROR _PNP_GetClassName(pipes_struct *p, struct PNP_GetClassName *r); +WERROR _PNP_DeleteClassKey(pipes_struct *p, struct PNP_DeleteClassKey *r); +WERROR _PNP_GetInterfaceDeviceAlias(pipes_struct *p, struct PNP_GetInterfaceDeviceAlias *r); +WERROR _PNP_GetInterfaceDeviceList(pipes_struct *p, struct PNP_GetInterfaceDeviceList *r); +WERROR _PNP_GetInterfaceDeviceListSize(pipes_struct *p, struct PNP_GetInterfaceDeviceListSize *r); +WERROR _PNP_RegisterDeviceClassAssociation(pipes_struct *p, struct PNP_RegisterDeviceClassAssociation *r); +WERROR _PNP_UnregisterDeviceClassAssociation(pipes_struct *p, struct PNP_UnregisterDeviceClassAssociation *r); +WERROR _PNP_GetClassRegProp(pipes_struct *p, struct PNP_GetClassRegProp *r); +WERROR _PNP_SetClassRegProp(pipes_struct *p, struct PNP_SetClassRegProp *r); +WERROR _PNP_CreateDevInst(pipes_struct *p, struct PNP_CreateDevInst *r); +WERROR _PNP_DeviceInstanceAction(pipes_struct *p, struct PNP_DeviceInstanceAction *r); +WERROR _PNP_GetDeviceStatus(pipes_struct *p, struct PNP_GetDeviceStatus *r); +WERROR _PNP_SetDeviceProblem(pipes_struct *p, struct PNP_SetDeviceProblem *r); +WERROR _PNP_DisableDevInst(pipes_struct *p, struct PNP_DisableDevInst *r); +WERROR _PNP_UninstallDevInst(pipes_struct *p, struct PNP_UninstallDevInst *r); +WERROR _PNP_AddID(pipes_struct *p, struct PNP_AddID *r); +WERROR _PNP_RegisterDriver(pipes_struct *p, struct PNP_RegisterDriver *r); +WERROR _PNP_QueryRemove(pipes_struct *p, struct PNP_QueryRemove *r); +WERROR _PNP_RequestDeviceEject(pipes_struct *p, struct PNP_RequestDeviceEject *r); +WERROR _PNP_IsDockStationPresent(pipes_struct *p, struct PNP_IsDockStationPresent *r); +WERROR _PNP_RequestEjectPC(pipes_struct *p, struct PNP_RequestEjectPC *r); +WERROR _PNP_HwProfFlags(pipes_struct *p, struct PNP_HwProfFlags *r); +WERROR _PNP_GetHwProfInfo(pipes_struct *p, struct PNP_GetHwProfInfo *r); +WERROR _PNP_AddEmptyLogConf(pipes_struct *p, struct PNP_AddEmptyLogConf *r); +WERROR _PNP_FreeLogConf(pipes_struct *p, struct PNP_FreeLogConf *r); +WERROR _PNP_GetFirstLogConf(pipes_struct *p, struct PNP_GetFirstLogConf *r); +WERROR _PNP_GetNextLogConf(pipes_struct *p, struct PNP_GetNextLogConf *r); +WERROR _PNP_GetLogConfPriority(pipes_struct *p, struct PNP_GetLogConfPriority *r); +WERROR _PNP_AddResDes(pipes_struct *p, struct PNP_AddResDes *r); +WERROR _PNP_FreeResDes(pipes_struct *p, struct PNP_FreeResDes *r); +WERROR _PNP_GetNextResDes(pipes_struct *p, struct PNP_GetNextResDes *r); +WERROR _PNP_GetResDesData(pipes_struct *p, struct PNP_GetResDesData *r); +WERROR _PNP_GetResDesDataSize(pipes_struct *p, struct PNP_GetResDesDataSize *r); +WERROR _PNP_ModifyResDes(pipes_struct *p, struct PNP_ModifyResDes *r); +WERROR _PNP_DetectResourceLimit(pipes_struct *p, struct PNP_DetectResourceLimit *r); +WERROR _PNP_QueryResConfList(pipes_struct *p, struct PNP_QueryResConfList *r); +WERROR _PNP_SetHwProf(pipes_struct *p, struct PNP_SetHwProf *r); +WERROR _PNP_QueryArbitratorFreeData(pipes_struct *p, struct PNP_QueryArbitratorFreeData *r); +WERROR _PNP_QueryArbitratorFreeSize(pipes_struct *p, struct PNP_QueryArbitratorFreeSize *r); +WERROR _PNP_RunDetection(pipes_struct *p, struct PNP_RunDetection *r); +WERROR _PNP_RegisterNotification(pipes_struct *p, struct PNP_RegisterNotification *r); +WERROR _PNP_UnregisterNotification(pipes_struct *p, struct PNP_UnregisterNotification *r); +WERROR _PNP_GetCustomDevProp(pipes_struct *p, struct PNP_GetCustomDevProp *r); +WERROR _PNP_GetVersionInternal(pipes_struct *p, struct PNP_GetVersionInternal *r); +WERROR _PNP_GetBlockedDriverInfo(pipes_struct *p, struct PNP_GetBlockedDriverInfo *r); +WERROR _PNP_GetServerSideDeviceInstallFlags(pipes_struct *p, struct PNP_GetServerSideDeviceInstallFlags *r); +void ntsvcs_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_ntsvcs_init(void); +#endif /* __SRV_NTSVCS__ */ diff --git a/librpc/gen_ndr/srv_samr.c b/librpc/gen_ndr/srv_samr.c new file mode 100644 index 0000000000..f4facd2914 --- /dev/null +++ b/librpc/gen_ndr/srv_samr.c @@ -0,0 +1,5482 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_samr.h" + +static bool api_samr_Connect(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT]; + + r = talloc(talloc_tos(), struct samr_Connect); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect, r); + } + + ZERO_STRUCT(r->out); + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Close(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Close *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CLOSE]; + + r = talloc(talloc_tos(), struct samr_Close); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Close, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = r->in.handle; + r->out.result = _samr_Close(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Close, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetSecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetSecurity *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETSECURITY]; + + r = talloc(talloc_tos(), struct samr_SetSecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetSecurity, r); + } + + r->out.result = _samr_SetSecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetSecurity, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QuerySecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QuerySecurity *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYSECURITY]; + + r = talloc(talloc_tos(), struct samr_QuerySecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QuerySecurity, r); + } + + ZERO_STRUCT(r->out); + r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *); + if (r->out.sdbuf == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QuerySecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Shutdown(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Shutdown *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SHUTDOWN]; + + r = talloc(talloc_tos(), struct samr_Shutdown); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Shutdown, r); + } + + r->out.result = _samr_Shutdown(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Shutdown, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_LookupDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_LookupDomain *r; + + call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPDOMAIN]; + + r = talloc(talloc_tos(), struct samr_LookupDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupDomain, r); + } + + ZERO_STRUCT(r->out); + r->out.sid = talloc_zero(r, struct dom_sid2 *); + if (r->out.sid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_LookupDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_EnumDomains(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_EnumDomains *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINS]; + + r = talloc(talloc_tos(), struct samr_EnumDomains); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomains, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.sam = talloc_zero(r, struct samr_SamArray *); + if (r->out.sam == NULL) { + talloc_free(r); + return false; + } + + r->out.num_entries = talloc_zero(r, uint32_t); + if (r->out.num_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_EnumDomains(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomains, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OpenDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OpenDomain *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OPENDOMAIN]; + + r = talloc(talloc_tos(), struct samr_OpenDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenDomain, r); + } + + ZERO_STRUCT(r->out); + r->out.domain_handle = talloc_zero(r, struct policy_handle); + if (r->out.domain_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_OpenDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDomainInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDomainInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO]; + + r = talloc(talloc_tos(), struct samr_QueryDomainInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_DomainInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDomainInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetDomainInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetDomainInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETDOMAININFO]; + + r = talloc(talloc_tos(), struct samr_SetDomainInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, r); + } + + r->out.result = _samr_SetDomainInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_CreateDomainGroup(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_CreateDomainGroup *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMAINGROUP]; + + r = talloc(talloc_tos(), struct samr_CreateDomainGroup); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, r); + } + + ZERO_STRUCT(r->out); + r->out.group_handle = talloc_zero(r, struct policy_handle); + if (r->out.group_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_CreateDomainGroup(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_EnumDomainGroups(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_EnumDomainGroups *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINGROUPS]; + + r = talloc(talloc_tos(), struct samr_EnumDomainGroups); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.sam = talloc_zero(r, struct samr_SamArray *); + if (r->out.sam == NULL) { + talloc_free(r); + return false; + } + + r->out.num_entries = talloc_zero(r, uint32_t); + if (r->out.num_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_EnumDomainGroups(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_CreateUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_CreateUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER]; + + r = talloc(talloc_tos(), struct samr_CreateUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateUser, r); + } + + ZERO_STRUCT(r->out); + r->out.user_handle = talloc_zero(r, struct policy_handle); + if (r->out.user_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_CreateUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateUser, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_EnumDomainUsers(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_EnumDomainUsers *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINUSERS]; + + r = talloc(talloc_tos(), struct samr_EnumDomainUsers); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.sam = talloc_zero(r, struct samr_SamArray *); + if (r->out.sam == NULL) { + talloc_free(r); + return false; + } + + r->out.num_entries = talloc_zero(r, uint32_t); + if (r->out.num_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_EnumDomainUsers(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_CreateDomAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_CreateDomAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMALIAS]; + + r = talloc(talloc_tos(), struct samr_CreateDomAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, r); + } + + ZERO_STRUCT(r->out); + r->out.alias_handle = talloc_zero(r, struct policy_handle); + if (r->out.alias_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_CreateDomAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_EnumDomainAliases(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_EnumDomainAliases *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINALIASES]; + + r = talloc(talloc_tos(), struct samr_EnumDomainAliases); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.sam = talloc_zero(r, struct samr_SamArray *); + if (r->out.sam == NULL) { + talloc_free(r); + return false; + } + + r->out.num_entries = talloc_zero(r, uint32_t); + if (r->out.num_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_EnumDomainAliases(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetAliasMembership(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetAliasMembership *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETALIASMEMBERSHIP]; + + r = talloc(talloc_tos(), struct samr_GetAliasMembership); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, r); + } + + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(r, struct samr_Ids); + if (r->out.rids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetAliasMembership(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_LookupNames(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_LookupNames *r; + + call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPNAMES]; + + r = talloc(talloc_tos(), struct samr_LookupNames); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupNames, r); + } + + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(r, struct samr_Ids); + if (r->out.rids == NULL) { + talloc_free(r); + return false; + } + + r->out.types = talloc_zero(r, struct samr_Ids); + if (r->out.types == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_LookupNames(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupNames, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_LookupRids(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_LookupRids *r; + + call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPRIDS]; + + r = talloc(talloc_tos(), struct samr_LookupRids); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupRids, r); + } + + ZERO_STRUCT(r->out); + r->out.names = talloc_zero(r, struct lsa_Strings); + if (r->out.names == NULL) { + talloc_free(r); + return false; + } + + r->out.types = talloc_zero(r, struct samr_Ids); + if (r->out.types == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_LookupRids(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupRids, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OpenGroup(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OpenGroup *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OPENGROUP]; + + r = talloc(talloc_tos(), struct samr_OpenGroup); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenGroup, r); + } + + ZERO_STRUCT(r->out); + r->out.group_handle = talloc_zero(r, struct policy_handle); + if (r->out.group_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_OpenGroup(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenGroup, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryGroupInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryGroupInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPINFO]; + + r = talloc(talloc_tos(), struct samr_QueryGroupInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_GroupInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryGroupInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetGroupInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetGroupInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETGROUPINFO]; + + r = talloc(talloc_tos(), struct samr_SetGroupInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, r); + } + + r->out.result = _samr_SetGroupInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_AddGroupMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_AddGroupMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ADDGROUPMEMBER]; + + r = talloc(talloc_tos(), struct samr_AddGroupMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddGroupMember, r); + } + + r->out.result = _samr_AddGroupMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteDomainGroup(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteDomainGroup *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMAINGROUP]; + + r = talloc(talloc_tos(), struct samr_DeleteDomainGroup); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, r); + } + + ZERO_STRUCT(r->out); + r->out.group_handle = r->in.group_handle; + r->out.result = _samr_DeleteDomainGroup(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteGroupMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteGroupMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEGROUPMEMBER]; + + r = talloc(talloc_tos(), struct samr_DeleteGroupMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, r); + } + + r->out.result = _samr_DeleteGroupMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryGroupMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryGroupMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPMEMBER]; + + r = talloc(talloc_tos(), struct samr_QueryGroupMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, r); + } + + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(r, struct samr_RidTypeArray *); + if (r->out.rids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryGroupMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetMemberAttributesOfGroup(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetMemberAttributesOfGroup *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP]; + + r = talloc(talloc_tos(), struct samr_SetMemberAttributesOfGroup); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, r); + } + + r->out.result = _samr_SetMemberAttributesOfGroup(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OpenAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OpenAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OPENALIAS]; + + r = talloc(talloc_tos(), struct samr_OpenAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenAlias, r); + } + + ZERO_STRUCT(r->out); + r->out.alias_handle = talloc_zero(r, struct policy_handle); + if (r->out.alias_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_OpenAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenAlias, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryAliasInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryAliasInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYALIASINFO]; + + r = talloc(talloc_tos(), struct samr_QueryAliasInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_AliasInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryAliasInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetAliasInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetAliasInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETALIASINFO]; + + r = talloc(talloc_tos(), struct samr_SetAliasInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, r); + } + + r->out.result = _samr_SetAliasInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteDomAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteDomAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMALIAS]; + + r = talloc(talloc_tos(), struct samr_DeleteDomAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, r); + } + + ZERO_STRUCT(r->out); + r->out.alias_handle = r->in.alias_handle; + r->out.result = _samr_DeleteDomAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_AddAliasMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_AddAliasMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ADDALIASMEMBER]; + + r = talloc(talloc_tos(), struct samr_AddAliasMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddAliasMember, r); + } + + r->out.result = _samr_AddAliasMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteAliasMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteAliasMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEALIASMEMBER]; + + r = talloc(talloc_tos(), struct samr_DeleteAliasMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, r); + } + + r->out.result = _samr_DeleteAliasMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetMembersInAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetMembersInAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETMEMBERSINALIAS]; + + r = talloc(talloc_tos(), struct samr_GetMembersInAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, r); + } + + ZERO_STRUCT(r->out); + r->out.sids = talloc_zero(r, struct lsa_SidArray); + if (r->out.sids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetMembersInAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OpenUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OpenUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OPENUSER]; + + r = talloc(talloc_tos(), struct samr_OpenUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenUser, r); + } + + ZERO_STRUCT(r->out); + r->out.user_handle = talloc_zero(r, struct policy_handle); + if (r->out.user_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_OpenUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenUser, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEUSER]; + + r = talloc(talloc_tos(), struct samr_DeleteUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteUser, r); + } + + ZERO_STRUCT(r->out); + r->out.user_handle = r->in.user_handle; + r->out.result = _samr_DeleteUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteUser, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryUserInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryUserInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO]; + + r = talloc(talloc_tos(), struct samr_QueryUserInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_UserInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryUserInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetUserInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetUserInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO]; + + r = talloc(talloc_tos(), struct samr_SetUserInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetUserInfo, r); + } + + r->out.result = _samr_SetUserInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_ChangePasswordUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_ChangePasswordUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER]; + + r = talloc(talloc_tos(), struct samr_ChangePasswordUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, r); + } + + r->out.result = _samr_ChangePasswordUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetGroupsForUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetGroupsForUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETGROUPSFORUSER]; + + r = talloc(talloc_tos(), struct samr_GetGroupsForUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, r); + } + + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(r, struct samr_RidWithAttributeArray *); + if (r->out.rids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetGroupsForUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDisplayInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDisplayInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO]; + + r = talloc(talloc_tos(), struct samr_QueryDisplayInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.total_size = talloc_zero(r, uint32_t); + if (r->out.total_size == NULL) { + talloc_free(r); + return false; + } + + r->out.returned_size = talloc_zero(r, uint32_t); + if (r->out.returned_size == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero(r, union samr_DispInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDisplayInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetDisplayEnumerationIndex(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetDisplayEnumerationIndex *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX]; + + r = talloc(talloc_tos(), struct samr_GetDisplayEnumerationIndex); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, r); + } + + ZERO_STRUCT(r->out); + r->out.idx = talloc_zero(r, uint32_t); + if (r->out.idx == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetDisplayEnumerationIndex(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_TestPrivateFunctionsDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_TestPrivateFunctionsDomain *r; + + call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN]; + + r = talloc(talloc_tos(), struct samr_TestPrivateFunctionsDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, r); + } + + r->out.result = _samr_TestPrivateFunctionsDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_TestPrivateFunctionsUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_TestPrivateFunctionsUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSUSER]; + + r = talloc(talloc_tos(), struct samr_TestPrivateFunctionsUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, r); + } + + r->out.result = _samr_TestPrivateFunctionsUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetUserPwInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetUserPwInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETUSERPWINFO]; + + r = talloc(talloc_tos(), struct samr_GetUserPwInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct samr_PwInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetUserPwInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_RemoveMemberFromForeignDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_RemoveMemberFromForeignDomain *r; + + call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN]; + + r = talloc(talloc_tos(), struct samr_RemoveMemberFromForeignDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, r); + } + + r->out.result = _samr_RemoveMemberFromForeignDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDomainInfo2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDomainInfo2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO2]; + + r = talloc(talloc_tos(), struct samr_QueryDomainInfo2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_DomainInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDomainInfo2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryUserInfo2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryUserInfo2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO2]; + + r = talloc(talloc_tos(), struct samr_QueryUserInfo2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_UserInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryUserInfo2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDisplayInfo2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDisplayInfo2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO2]; + + r = talloc(talloc_tos(), struct samr_QueryDisplayInfo2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, r); + } + + ZERO_STRUCT(r->out); + r->out.total_size = talloc_zero(r, uint32_t); + if (r->out.total_size == NULL) { + talloc_free(r); + return false; + } + + r->out.returned_size = talloc_zero(r, uint32_t); + if (r->out.returned_size == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero(r, union samr_DispInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDisplayInfo2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetDisplayEnumerationIndex2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetDisplayEnumerationIndex2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX2]; + + r = talloc(talloc_tos(), struct samr_GetDisplayEnumerationIndex2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, r); + } + + ZERO_STRUCT(r->out); + r->out.idx = talloc_zero(r, uint32_t); + if (r->out.idx == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetDisplayEnumerationIndex2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_CreateUser2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_CreateUser2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER2]; + + r = talloc(talloc_tos(), struct samr_CreateUser2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateUser2, r); + } + + ZERO_STRUCT(r->out); + r->out.user_handle = talloc_zero(r, struct policy_handle); + if (r->out.user_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.access_granted = talloc_zero(r, uint32_t); + if (r->out.access_granted == NULL) { + talloc_free(r); + return false; + } + + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_CreateUser2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateUser2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDisplayInfo3(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDisplayInfo3 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO3]; + + r = talloc(talloc_tos(), struct samr_QueryDisplayInfo3); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, r); + } + + ZERO_STRUCT(r->out); + r->out.total_size = talloc_zero(r, uint32_t); + if (r->out.total_size == NULL) { + talloc_free(r); + return false; + } + + r->out.returned_size = talloc_zero(r, uint32_t); + if (r->out.returned_size == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero(r, union samr_DispInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDisplayInfo3(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_AddMultipleMembersToAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_AddMultipleMembersToAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS]; + + r = talloc(talloc_tos(), struct samr_AddMultipleMembersToAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, r); + } + + r->out.result = _samr_AddMultipleMembersToAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_RemoveMultipleMembersFromAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_RemoveMultipleMembersFromAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS]; + + r = talloc(talloc_tos(), struct samr_RemoveMultipleMembersFromAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, r); + } + + r->out.result = _samr_RemoveMultipleMembersFromAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OemChangePasswordUser2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OemChangePasswordUser2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OEMCHANGEPASSWORDUSER2]; + + r = talloc(talloc_tos(), struct samr_OemChangePasswordUser2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, r); + } + + r->out.result = _samr_OemChangePasswordUser2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_ChangePasswordUser2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_ChangePasswordUser2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER2]; + + r = talloc(talloc_tos(), struct samr_ChangePasswordUser2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, r); + } + + r->out.result = _samr_ChangePasswordUser2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetDomPwInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetDomPwInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETDOMPWINFO]; + + r = talloc(talloc_tos(), struct samr_GetDomPwInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct samr_PwInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetDomPwInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Connect2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT2]; + + r = talloc(talloc_tos(), struct samr_Connect2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect2, r); + } + + ZERO_STRUCT(r->out); + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetUserInfo2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetUserInfo2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO2]; + + r = talloc(talloc_tos(), struct samr_SetUserInfo2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, r); + } + + r->out.result = _samr_SetUserInfo2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetBootKeyInformation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetBootKeyInformation *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETBOOTKEYINFORMATION]; + + r = talloc(talloc_tos(), struct samr_SetBootKeyInformation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, r); + } + + r->out.result = _samr_SetBootKeyInformation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetBootKeyInformation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetBootKeyInformation *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETBOOTKEYINFORMATION]; + + r = talloc(talloc_tos(), struct samr_GetBootKeyInformation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.unknown = talloc_zero(r, uint32_t); + if (r->out.unknown == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetBootKeyInformation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Connect3(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect3 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT3]; + + r = talloc(talloc_tos(), struct samr_Connect3); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect3, r); + } + + ZERO_STRUCT(r->out); + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect3(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect3, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Connect4(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect4 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT4]; + + r = talloc(talloc_tos(), struct samr_Connect4); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect4, r); + } + + ZERO_STRUCT(r->out); + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect4(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect4, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_ChangePasswordUser3(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_ChangePasswordUser3 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER3]; + + r = talloc(talloc_tos(), struct samr_ChangePasswordUser3); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, r); + } + + ZERO_STRUCT(r->out); + r->out.dominfo = talloc_zero(r, struct samr_DomInfo1 *); + if (r->out.dominfo == NULL) { + talloc_free(r); + return false; + } + + r->out.reject = talloc_zero(r, struct samr_ChangeReject *); + if (r->out.reject == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_ChangePasswordUser3(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Connect5(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect5 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT5]; + + r = talloc(talloc_tos(), struct samr_Connect5); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect5, r); + } + + ZERO_STRUCT(r->out); + r->out.level_out = talloc_zero(r, uint32_t); + if (r->out.level_out == NULL) { + talloc_free(r); + return false; + } + + r->out.info_out = talloc_zero(r, union samr_ConnectInfo); + if (r->out.info_out == NULL) { + talloc_free(r); + return false; + } + + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect5(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect5, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_RidToSid(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_RidToSid *r; + + call = &ndr_table_samr.calls[NDR_SAMR_RIDTOSID]; + + r = talloc(talloc_tos(), struct samr_RidToSid); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RidToSid, r); + } + + ZERO_STRUCT(r->out); + r->out.sid = talloc_zero(r, struct dom_sid2 *); + if (r->out.sid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_RidToSid(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RidToSid, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetDsrmPassword(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetDsrmPassword *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETDSRMPASSWORD]; + + r = talloc(talloc_tos(), struct samr_SetDsrmPassword); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, r); + } + + r->out.result = _samr_SetDsrmPassword(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_ValidatePassword(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_ValidatePassword *r; + + call = &ndr_table_samr.calls[NDR_SAMR_VALIDATEPASSWORD]; + + r = talloc(talloc_tos(), struct samr_ValidatePassword); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ValidatePassword, r); + } + + ZERO_STRUCT(r->out); + r->out.rep = talloc_zero(r, union samr_ValidatePasswordRep *); + if (r->out.rep == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_ValidatePassword(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_samr_cmds[] = +{ + {"SAMR_CONNECT", NDR_SAMR_CONNECT, api_samr_Connect}, + {"SAMR_CLOSE", NDR_SAMR_CLOSE, api_samr_Close}, + {"SAMR_SETSECURITY", NDR_SAMR_SETSECURITY, api_samr_SetSecurity}, + {"SAMR_QUERYSECURITY", NDR_SAMR_QUERYSECURITY, api_samr_QuerySecurity}, + {"SAMR_SHUTDOWN", NDR_SAMR_SHUTDOWN, api_samr_Shutdown}, + {"SAMR_LOOKUPDOMAIN", NDR_SAMR_LOOKUPDOMAIN, api_samr_LookupDomain}, + {"SAMR_ENUMDOMAINS", NDR_SAMR_ENUMDOMAINS, api_samr_EnumDomains}, + {"SAMR_OPENDOMAIN", NDR_SAMR_OPENDOMAIN, api_samr_OpenDomain}, + {"SAMR_QUERYDOMAININFO", NDR_SAMR_QUERYDOMAININFO, api_samr_QueryDomainInfo}, + {"SAMR_SETDOMAININFO", NDR_SAMR_SETDOMAININFO, api_samr_SetDomainInfo}, + {"SAMR_CREATEDOMAINGROUP", NDR_SAMR_CREATEDOMAINGROUP, api_samr_CreateDomainGroup}, + {"SAMR_ENUMDOMAINGROUPS", NDR_SAMR_ENUMDOMAINGROUPS, api_samr_EnumDomainGroups}, + {"SAMR_CREATEUSER", NDR_SAMR_CREATEUSER, api_samr_CreateUser}, + {"SAMR_ENUMDOMAINUSERS", NDR_SAMR_ENUMDOMAINUSERS, api_samr_EnumDomainUsers}, + {"SAMR_CREATEDOMALIAS", NDR_SAMR_CREATEDOMALIAS, api_samr_CreateDomAlias}, + {"SAMR_ENUMDOMAINALIASES", NDR_SAMR_ENUMDOMAINALIASES, api_samr_EnumDomainAliases}, + {"SAMR_GETALIASMEMBERSHIP", NDR_SAMR_GETALIASMEMBERSHIP, api_samr_GetAliasMembership}, + {"SAMR_LOOKUPNAMES", NDR_SAMR_LOOKUPNAMES, api_samr_LookupNames}, + {"SAMR_LOOKUPRIDS", NDR_SAMR_LOOKUPRIDS, api_samr_LookupRids}, + {"SAMR_OPENGROUP", NDR_SAMR_OPENGROUP, api_samr_OpenGroup}, + {"SAMR_QUERYGROUPINFO", NDR_SAMR_QUERYGROUPINFO, api_samr_QueryGroupInfo}, + {"SAMR_SETGROUPINFO", NDR_SAMR_SETGROUPINFO, api_samr_SetGroupInfo}, + {"SAMR_ADDGROUPMEMBER", NDR_SAMR_ADDGROUPMEMBER, api_samr_AddGroupMember}, + {"SAMR_DELETEDOMAINGROUP", NDR_SAMR_DELETEDOMAINGROUP, api_samr_DeleteDomainGroup}, + {"SAMR_DELETEGROUPMEMBER", NDR_SAMR_DELETEGROUPMEMBER, api_samr_DeleteGroupMember}, + {"SAMR_QUERYGROUPMEMBER", NDR_SAMR_QUERYGROUPMEMBER, api_samr_QueryGroupMember}, + {"SAMR_SETMEMBERATTRIBUTESOFGROUP", NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, api_samr_SetMemberAttributesOfGroup}, + {"SAMR_OPENALIAS", NDR_SAMR_OPENALIAS, api_samr_OpenAlias}, + {"SAMR_QUERYALIASINFO", NDR_SAMR_QUERYALIASINFO, api_samr_QueryAliasInfo}, + {"SAMR_SETALIASINFO", NDR_SAMR_SETALIASINFO, api_samr_SetAliasInfo}, + {"SAMR_DELETEDOMALIAS", NDR_SAMR_DELETEDOMALIAS, api_samr_DeleteDomAlias}, + {"SAMR_ADDALIASMEMBER", NDR_SAMR_ADDALIASMEMBER, api_samr_AddAliasMember}, + {"SAMR_DELETEALIASMEMBER", NDR_SAMR_DELETEALIASMEMBER, api_samr_DeleteAliasMember}, + {"SAMR_GETMEMBERSINALIAS", NDR_SAMR_GETMEMBERSINALIAS, api_samr_GetMembersInAlias}, + {"SAMR_OPENUSER", NDR_SAMR_OPENUSER, api_samr_OpenUser}, + {"SAMR_DELETEUSER", NDR_SAMR_DELETEUSER, api_samr_DeleteUser}, + {"SAMR_QUERYUSERINFO", NDR_SAMR_QUERYUSERINFO, api_samr_QueryUserInfo}, + {"SAMR_SETUSERINFO", NDR_SAMR_SETUSERINFO, api_samr_SetUserInfo}, + {"SAMR_CHANGEPASSWORDUSER", NDR_SAMR_CHANGEPASSWORDUSER, api_samr_ChangePasswordUser}, + {"SAMR_GETGROUPSFORUSER", NDR_SAMR_GETGROUPSFORUSER, api_samr_GetGroupsForUser}, + {"SAMR_QUERYDISPLAYINFO", NDR_SAMR_QUERYDISPLAYINFO, api_samr_QueryDisplayInfo}, + {"SAMR_GETDISPLAYENUMERATIONINDEX", NDR_SAMR_GETDISPLAYENUMERATIONINDEX, api_samr_GetDisplayEnumerationIndex}, + {"SAMR_TESTPRIVATEFUNCTIONSDOMAIN", NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, api_samr_TestPrivateFunctionsDomain}, + {"SAMR_TESTPRIVATEFUNCTIONSUSER", NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, api_samr_TestPrivateFunctionsUser}, + {"SAMR_GETUSERPWINFO", NDR_SAMR_GETUSERPWINFO, api_samr_GetUserPwInfo}, + {"SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN", NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, api_samr_RemoveMemberFromForeignDomain}, + {"SAMR_QUERYDOMAININFO2", NDR_SAMR_QUERYDOMAININFO2, api_samr_QueryDomainInfo2}, + {"SAMR_QUERYUSERINFO2", NDR_SAMR_QUERYUSERINFO2, api_samr_QueryUserInfo2}, + {"SAMR_QUERYDISPLAYINFO2", NDR_SAMR_QUERYDISPLAYINFO2, api_samr_QueryDisplayInfo2}, + {"SAMR_GETDISPLAYENUMERATIONINDEX2", NDR_SAMR_GETDISPLAYENUMERATIONINDEX2, api_samr_GetDisplayEnumerationIndex2}, + {"SAMR_CREATEUSER2", NDR_SAMR_CREATEUSER2, api_samr_CreateUser2}, + {"SAMR_QUERYDISPLAYINFO3", NDR_SAMR_QUERYDISPLAYINFO3, api_samr_QueryDisplayInfo3}, + {"SAMR_ADDMULTIPLEMEMBERSTOALIAS", NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS, api_samr_AddMultipleMembersToAlias}, + {"SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS", NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS, api_samr_RemoveMultipleMembersFromAlias}, + {"SAMR_OEMCHANGEPASSWORDUSER2", NDR_SAMR_OEMCHANGEPASSWORDUSER2, api_samr_OemChangePasswordUser2}, + {"SAMR_CHANGEPASSWORDUSER2", NDR_SAMR_CHANGEPASSWORDUSER2, api_samr_ChangePasswordUser2}, + {"SAMR_GETDOMPWINFO", NDR_SAMR_GETDOMPWINFO, api_samr_GetDomPwInfo}, + {"SAMR_CONNECT2", NDR_SAMR_CONNECT2, api_samr_Connect2}, + {"SAMR_SETUSERINFO2", NDR_SAMR_SETUSERINFO2, api_samr_SetUserInfo2}, + {"SAMR_SETBOOTKEYINFORMATION", NDR_SAMR_SETBOOTKEYINFORMATION, api_samr_SetBootKeyInformation}, + {"SAMR_GETBOOTKEYINFORMATION", NDR_SAMR_GETBOOTKEYINFORMATION, api_samr_GetBootKeyInformation}, + {"SAMR_CONNECT3", NDR_SAMR_CONNECT3, api_samr_Connect3}, + {"SAMR_CONNECT4", NDR_SAMR_CONNECT4, api_samr_Connect4}, + {"SAMR_CHANGEPASSWORDUSER3", NDR_SAMR_CHANGEPASSWORDUSER3, api_samr_ChangePasswordUser3}, + {"SAMR_CONNECT5", NDR_SAMR_CONNECT5, api_samr_Connect5}, + {"SAMR_RIDTOSID", NDR_SAMR_RIDTOSID, api_samr_RidToSid}, + {"SAMR_SETDSRMPASSWORD", NDR_SAMR_SETDSRMPASSWORD, api_samr_SetDsrmPassword}, + {"SAMR_VALIDATEPASSWORD", NDR_SAMR_VALIDATEPASSWORD, api_samr_ValidatePassword}, +}; + +void samr_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_samr_cmds; + *n_fns = sizeof(api_samr_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_samr_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "samr", "samr", &ndr_table_samr.syntax_id, api_samr_cmds, sizeof(api_samr_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_samr.h b/librpc/gen_ndr/srv_samr.h new file mode 100644 index 0000000000..7d5cdd745d --- /dev/null +++ b/librpc/gen_ndr/srv_samr.h @@ -0,0 +1,74 @@ +#include "librpc/gen_ndr/ndr_samr.h" +#ifndef __SRV_SAMR__ +#define __SRV_SAMR__ +NTSTATUS _samr_Connect(pipes_struct *p, struct samr_Connect *r); +NTSTATUS _samr_Close(pipes_struct *p, struct samr_Close *r); +NTSTATUS _samr_SetSecurity(pipes_struct *p, struct samr_SetSecurity *r); +NTSTATUS _samr_QuerySecurity(pipes_struct *p, struct samr_QuerySecurity *r); +NTSTATUS _samr_Shutdown(pipes_struct *p, struct samr_Shutdown *r); +NTSTATUS _samr_LookupDomain(pipes_struct *p, struct samr_LookupDomain *r); +NTSTATUS _samr_EnumDomains(pipes_struct *p, struct samr_EnumDomains *r); +NTSTATUS _samr_OpenDomain(pipes_struct *p, struct samr_OpenDomain *r); +NTSTATUS _samr_QueryDomainInfo(pipes_struct *p, struct samr_QueryDomainInfo *r); +NTSTATUS _samr_SetDomainInfo(pipes_struct *p, struct samr_SetDomainInfo *r); +NTSTATUS _samr_CreateDomainGroup(pipes_struct *p, struct samr_CreateDomainGroup *r); +NTSTATUS _samr_EnumDomainGroups(pipes_struct *p, struct samr_EnumDomainGroups *r); +NTSTATUS _samr_CreateUser(pipes_struct *p, struct samr_CreateUser *r); +NTSTATUS _samr_EnumDomainUsers(pipes_struct *p, struct samr_EnumDomainUsers *r); +NTSTATUS _samr_CreateDomAlias(pipes_struct *p, struct samr_CreateDomAlias *r); +NTSTATUS _samr_EnumDomainAliases(pipes_struct *p, struct samr_EnumDomainAliases *r); +NTSTATUS _samr_GetAliasMembership(pipes_struct *p, struct samr_GetAliasMembership *r); +NTSTATUS _samr_LookupNames(pipes_struct *p, struct samr_LookupNames *r); +NTSTATUS _samr_LookupRids(pipes_struct *p, struct samr_LookupRids *r); +NTSTATUS _samr_OpenGroup(pipes_struct *p, struct samr_OpenGroup *r); +NTSTATUS _samr_QueryGroupInfo(pipes_struct *p, struct samr_QueryGroupInfo *r); +NTSTATUS _samr_SetGroupInfo(pipes_struct *p, struct samr_SetGroupInfo *r); +NTSTATUS _samr_AddGroupMember(pipes_struct *p, struct samr_AddGroupMember *r); +NTSTATUS _samr_DeleteDomainGroup(pipes_struct *p, struct samr_DeleteDomainGroup *r); +NTSTATUS _samr_DeleteGroupMember(pipes_struct *p, struct samr_DeleteGroupMember *r); +NTSTATUS _samr_QueryGroupMember(pipes_struct *p, struct samr_QueryGroupMember *r); +NTSTATUS _samr_SetMemberAttributesOfGroup(pipes_struct *p, struct samr_SetMemberAttributesOfGroup *r); +NTSTATUS _samr_OpenAlias(pipes_struct *p, struct samr_OpenAlias *r); +NTSTATUS _samr_QueryAliasInfo(pipes_struct *p, struct samr_QueryAliasInfo *r); +NTSTATUS _samr_SetAliasInfo(pipes_struct *p, struct samr_SetAliasInfo *r); +NTSTATUS _samr_DeleteDomAlias(pipes_struct *p, struct samr_DeleteDomAlias *r); +NTSTATUS _samr_AddAliasMember(pipes_struct *p, struct samr_AddAliasMember *r); +NTSTATUS _samr_DeleteAliasMember(pipes_struct *p, struct samr_DeleteAliasMember *r); +NTSTATUS _samr_GetMembersInAlias(pipes_struct *p, struct samr_GetMembersInAlias *r); +NTSTATUS _samr_OpenUser(pipes_struct *p, struct samr_OpenUser *r); +NTSTATUS _samr_DeleteUser(pipes_struct *p, struct samr_DeleteUser *r); +NTSTATUS _samr_QueryUserInfo(pipes_struct *p, struct samr_QueryUserInfo *r); +NTSTATUS _samr_SetUserInfo(pipes_struct *p, struct samr_SetUserInfo *r); +NTSTATUS _samr_ChangePasswordUser(pipes_struct *p, struct samr_ChangePasswordUser *r); +NTSTATUS _samr_GetGroupsForUser(pipes_struct *p, struct samr_GetGroupsForUser *r); +NTSTATUS _samr_QueryDisplayInfo(pipes_struct *p, struct samr_QueryDisplayInfo *r); +NTSTATUS _samr_GetDisplayEnumerationIndex(pipes_struct *p, struct samr_GetDisplayEnumerationIndex *r); +NTSTATUS _samr_TestPrivateFunctionsDomain(pipes_struct *p, struct samr_TestPrivateFunctionsDomain *r); +NTSTATUS _samr_TestPrivateFunctionsUser(pipes_struct *p, struct samr_TestPrivateFunctionsUser *r); +NTSTATUS _samr_GetUserPwInfo(pipes_struct *p, struct samr_GetUserPwInfo *r); +NTSTATUS _samr_RemoveMemberFromForeignDomain(pipes_struct *p, struct samr_RemoveMemberFromForeignDomain *r); +NTSTATUS _samr_QueryDomainInfo2(pipes_struct *p, struct samr_QueryDomainInfo2 *r); +NTSTATUS _samr_QueryUserInfo2(pipes_struct *p, struct samr_QueryUserInfo2 *r); +NTSTATUS _samr_QueryDisplayInfo2(pipes_struct *p, struct samr_QueryDisplayInfo2 *r); +NTSTATUS _samr_GetDisplayEnumerationIndex2(pipes_struct *p, struct samr_GetDisplayEnumerationIndex2 *r); +NTSTATUS _samr_CreateUser2(pipes_struct *p, struct samr_CreateUser2 *r); +NTSTATUS _samr_QueryDisplayInfo3(pipes_struct *p, struct samr_QueryDisplayInfo3 *r); +NTSTATUS _samr_AddMultipleMembersToAlias(pipes_struct *p, struct samr_AddMultipleMembersToAlias *r); +NTSTATUS _samr_RemoveMultipleMembersFromAlias(pipes_struct *p, struct samr_RemoveMultipleMembersFromAlias *r); +NTSTATUS _samr_OemChangePasswordUser2(pipes_struct *p, struct samr_OemChangePasswordUser2 *r); +NTSTATUS _samr_ChangePasswordUser2(pipes_struct *p, struct samr_ChangePasswordUser2 *r); +NTSTATUS _samr_GetDomPwInfo(pipes_struct *p, struct samr_GetDomPwInfo *r); +NTSTATUS _samr_Connect2(pipes_struct *p, struct samr_Connect2 *r); +NTSTATUS _samr_SetUserInfo2(pipes_struct *p, struct samr_SetUserInfo2 *r); +NTSTATUS _samr_SetBootKeyInformation(pipes_struct *p, struct samr_SetBootKeyInformation *r); +NTSTATUS _samr_GetBootKeyInformation(pipes_struct *p, struct samr_GetBootKeyInformation *r); +NTSTATUS _samr_Connect3(pipes_struct *p, struct samr_Connect3 *r); +NTSTATUS _samr_Connect4(pipes_struct *p, struct samr_Connect4 *r); +NTSTATUS _samr_ChangePasswordUser3(pipes_struct *p, struct samr_ChangePasswordUser3 *r); +NTSTATUS _samr_Connect5(pipes_struct *p, struct samr_Connect5 *r); +NTSTATUS _samr_RidToSid(pipes_struct *p, struct samr_RidToSid *r); +NTSTATUS _samr_SetDsrmPassword(pipes_struct *p, struct samr_SetDsrmPassword *r); +NTSTATUS _samr_ValidatePassword(pipes_struct *p, struct samr_ValidatePassword *r); +void samr_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_samr_init(void); +#endif /* __SRV_SAMR__ */ diff --git a/librpc/gen_ndr/srv_srvsvc.c b/librpc/gen_ndr/srv_srvsvc.c new file mode 100644 index 0000000000..59f51ba774 --- /dev/null +++ b/librpc/gen_ndr/srv_srvsvc.c @@ -0,0 +1,4196 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_srvsvc.h" + +static bool api_srvsvc_NetCharDevEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetCharDevEnum *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVENUM]; + + r = talloc(talloc_tos(), struct srvsvc_NetCharDevEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.info_ctr = r->in.info_ctr; + r->out.resume_handle = r->in.resume_handle; + r->out.totalentries = talloc_zero(r, uint32_t); + if (r->out.totalentries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetCharDevEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetCharDevGetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetCharDevGetInfo *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVGETINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NetCharDevGetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevGetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union srvsvc_NetCharDevInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetCharDevGetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevGetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetCharDevControl(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetCharDevControl *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVCONTROL]; + + r = talloc(talloc_tos(), struct srvsvc_NetCharDevControl); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevControl, r); + } + + r->out.result = _srvsvc_NetCharDevControl(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevControl, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetCharDevQEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetCharDevQEnum *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQENUM]; + + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.info_ctr = r->in.info_ctr; + r->out.resume_handle = r->in.resume_handle; + r->out.totalentries = talloc_zero(r, uint32_t); + if (r->out.totalentries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetCharDevQEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetCharDevQGetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetCharDevQGetInfo *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQGETINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQGetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQGetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union srvsvc_NetCharDevQInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetCharDevQGetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQGetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetCharDevQSetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetCharDevQSetInfo *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQSETINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQSetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQSetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.parm_error = r->in.parm_error; + r->out.result = _srvsvc_NetCharDevQSetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQSetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetCharDevQPurge(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetCharDevQPurge *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQPURGE]; + + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQPurge); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurge, r); + } + + r->out.result = _srvsvc_NetCharDevQPurge(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurge, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetCharDevQPurgeSelf(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetCharDevQPurgeSelf *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQPURGESELF]; + + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQPurgeSelf); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurgeSelf, r); + } + + r->out.result = _srvsvc_NetCharDevQPurgeSelf(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurgeSelf, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetConnEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetConnEnum *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCONNENUM]; + + r = talloc(talloc_tos(), struct srvsvc_NetConnEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetConnEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.info_ctr = r->in.info_ctr; + r->out.resume_handle = r->in.resume_handle; + r->out.totalentries = talloc_zero(r, uint32_t); + if (r->out.totalentries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetConnEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetConnEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetFileEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetFileEnum *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETFILEENUM]; + + r = talloc(talloc_tos(), struct srvsvc_NetFileEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetFileEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.info_ctr = r->in.info_ctr; + r->out.resume_handle = r->in.resume_handle; + r->out.totalentries = talloc_zero(r, uint32_t); + if (r->out.totalentries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetFileEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetFileEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetFileGetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetFileGetInfo *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETFILEGETINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NetFileGetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetFileGetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union srvsvc_NetFileInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetFileGetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetFileGetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetFileClose(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetFileClose *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETFILECLOSE]; + + r = talloc(talloc_tos(), struct srvsvc_NetFileClose); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetFileClose, r); + } + + r->out.result = _srvsvc_NetFileClose(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetFileClose, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetSessEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetSessEnum *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSESSENUM]; + + r = talloc(talloc_tos(), struct srvsvc_NetSessEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSessEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.info_ctr = r->in.info_ctr; + r->out.resume_handle = r->in.resume_handle; + r->out.totalentries = talloc_zero(r, uint32_t); + if (r->out.totalentries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetSessEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSessEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetSessDel(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetSessDel *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSESSDEL]; + + r = talloc(talloc_tos(), struct srvsvc_NetSessDel); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSessDel, r); + } + + r->out.result = _srvsvc_NetSessDel(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSessDel, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareAdd(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareAdd *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREADD]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareAdd); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareAdd, r); + } + + ZERO_STRUCT(r->out); + r->out.parm_error = r->in.parm_error; + r->out.result = _srvsvc_NetShareAdd(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareAdd, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareEnumAll(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareEnumAll *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREENUMALL]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareEnumAll); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnumAll, r); + } + + ZERO_STRUCT(r->out); + r->out.info_ctr = r->in.info_ctr; + r->out.resume_handle = r->in.resume_handle; + r->out.totalentries = talloc_zero(r, uint32_t); + if (r->out.totalentries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetShareEnumAll(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnumAll, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareGetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareGetInfo *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREGETINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareGetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareGetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union srvsvc_NetShareInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetShareGetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareGetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareSetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareSetInfo *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHARESETINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareSetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareSetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.parm_error = r->in.parm_error; + r->out.result = _srvsvc_NetShareSetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareSetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareDel(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareDel *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDEL]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareDel); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareDel, r); + } + + r->out.result = _srvsvc_NetShareDel(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDel, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareDelSticky(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareDelSticky *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDELSTICKY]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareDelSticky); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelSticky, r); + } + + r->out.result = _srvsvc_NetShareDelSticky(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelSticky, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareCheck(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareCheck *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHARECHECK]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareCheck); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareCheck, r); + } + + ZERO_STRUCT(r->out); + r->out.type = talloc_zero(r, enum srvsvc_ShareType); + if (r->out.type == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetShareCheck(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareCheck, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetSrvGetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetSrvGetInfo *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSRVGETINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NetSrvGetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSrvGetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union srvsvc_NetSrvInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetSrvGetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvGetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetSrvSetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetSrvSetInfo *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSRVSETINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NetSrvSetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSrvSetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.parm_error = r->in.parm_error; + r->out.result = _srvsvc_NetSrvSetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvSetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetDiskEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetDiskEnum *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETDISKENUM]; + + r = talloc(talloc_tos(), struct srvsvc_NetDiskEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetDiskEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.info = r->in.info; + r->out.resume_handle = r->in.resume_handle; + r->out.totalentries = talloc_zero(r, uint32_t); + if (r->out.totalentries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetDiskEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetDiskEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetServerStatisticsGet(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetServerStatisticsGet *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSERVERSTATISTICSGET]; + + r = talloc(talloc_tos(), struct srvsvc_NetServerStatisticsGet); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetServerStatisticsGet, r); + } + + ZERO_STRUCT(r->out); + r->out.stats = talloc_zero(r, struct srvsvc_Statistics *); + if (r->out.stats == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetServerStatisticsGet(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetServerStatisticsGet, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetTransportAdd(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetTransportAdd *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETTRANSPORTADD]; + + r = talloc(talloc_tos(), struct srvsvc_NetTransportAdd); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetTransportAdd, r); + } + + r->out.result = _srvsvc_NetTransportAdd(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportAdd, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetTransportEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetTransportEnum *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETTRANSPORTENUM]; + + r = talloc(talloc_tos(), struct srvsvc_NetTransportEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetTransportEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.transports = r->in.transports; + r->out.resume_handle = r->in.resume_handle; + r->out.totalentries = talloc_zero(r, uint32_t); + if (r->out.totalentries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetTransportEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetTransportDel(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetTransportDel *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETTRANSPORTDEL]; + + r = talloc(talloc_tos(), struct srvsvc_NetTransportDel); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetTransportDel, r); + } + + r->out.result = _srvsvc_NetTransportDel(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportDel, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetRemoteTOD(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetRemoteTOD *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETREMOTETOD]; + + r = talloc(talloc_tos(), struct srvsvc_NetRemoteTOD); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetRemoteTOD, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct srvsvc_NetRemoteTODInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetRemoteTOD(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetRemoteTOD, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetSetServiceBits(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetSetServiceBits *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSETSERVICEBITS]; + + r = talloc(talloc_tos(), struct srvsvc_NetSetServiceBits); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSetServiceBits, r); + } + + r->out.result = _srvsvc_NetSetServiceBits(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSetServiceBits, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetPathType(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetPathType *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPATHTYPE]; + + r = talloc(talloc_tos(), struct srvsvc_NetPathType); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetPathType, r); + } + + ZERO_STRUCT(r->out); + r->out.pathtype = talloc_zero(r, uint32_t); + if (r->out.pathtype == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetPathType(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetPathType, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetPathCanonicalize(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetPathCanonicalize *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPATHCANONICALIZE]; + + r = talloc(talloc_tos(), struct srvsvc_NetPathCanonicalize); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetPathCanonicalize, r); + } + + ZERO_STRUCT(r->out); + r->out.pathtype = r->in.pathtype; + r->out.can_path = talloc_zero_array(r, uint8_t, r->in.maxbuf); + if (r->out.can_path == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetPathCanonicalize(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCanonicalize, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetPathCompare(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetPathCompare *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPATHCOMPARE]; + + r = talloc(talloc_tos(), struct srvsvc_NetPathCompare); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetPathCompare, r); + } + + r->out.result = _srvsvc_NetPathCompare(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCompare, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetNameValidate(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetNameValidate *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETNAMEVALIDATE]; + + r = talloc(talloc_tos(), struct srvsvc_NetNameValidate); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetNameValidate, r); + } + + r->out.result = _srvsvc_NetNameValidate(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetNameValidate, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRPRNAMECANONICALIZE *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRPRNAMECANONICALIZE]; + + r = talloc(talloc_tos(), struct srvsvc_NETRPRNAMECANONICALIZE); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, r); + } + + r->out.result = _srvsvc_NETRPRNAMECANONICALIZE(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetPRNameCompare(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetPRNameCompare *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPRNAMECOMPARE]; + + r = talloc(talloc_tos(), struct srvsvc_NetPRNameCompare); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetPRNameCompare, r); + } + + r->out.result = _srvsvc_NetPRNameCompare(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetPRNameCompare, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareEnum *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREENUM]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.info_ctr = r->in.info_ctr; + r->out.resume_handle = r->in.resume_handle; + r->out.totalentries = talloc_zero(r, uint32_t); + if (r->out.totalentries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetShareEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareDelStart(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareDelStart *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDELSTART]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareDelStart); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelStart, r); + } + + ZERO_STRUCT(r->out); + r->out.hnd = talloc_zero(r, struct policy_handle); + if (r->out.hnd == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetShareDelStart(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelStart, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetShareDelCommit(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetShareDelCommit *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDELCOMMIT]; + + r = talloc(talloc_tos(), struct srvsvc_NetShareDelCommit); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelCommit, r); + } + + ZERO_STRUCT(r->out); + r->out.hnd = r->in.hnd; + r->out.result = _srvsvc_NetShareDelCommit(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelCommit, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetGetFileSecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetGetFileSecurity *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETGETFILESECURITY]; + + r = talloc(talloc_tos(), struct srvsvc_NetGetFileSecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetGetFileSecurity, r); + } + + ZERO_STRUCT(r->out); + r->out.sd_buf = talloc_zero(r, struct sec_desc_buf *); + if (r->out.sd_buf == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _srvsvc_NetGetFileSecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetGetFileSecurity, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetSetFileSecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetSetFileSecurity *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSETFILESECURITY]; + + r = talloc(talloc_tos(), struct srvsvc_NetSetFileSecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetSetFileSecurity, r); + } + + r->out.result = _srvsvc_NetSetFileSecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetSetFileSecurity, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetServerTransportAddEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetServerTransportAddEx *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSERVERTRANSPORTADDEX]; + + r = talloc(talloc_tos(), struct srvsvc_NetServerTransportAddEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetServerTransportAddEx, r); + } + + r->out.result = _srvsvc_NetServerTransportAddEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetServerTransportAddEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NetServerSetServiceBitsEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NetServerSetServiceBitsEx *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSERVERSETSERVICEBITSEX]; + + r = talloc(talloc_tos(), struct srvsvc_NetServerSetServiceBitsEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NetServerSetServiceBitsEx, r); + } + + r->out.result = _srvsvc_NetServerSetServiceBitsEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NetServerSetServiceBitsEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSGETVERSION(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSGETVERSION *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSGETVERSION]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSGETVERSION); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSGETVERSION, r); + } + + r->out.result = _srvsvc_NETRDFSGETVERSION(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSGETVERSION, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSCREATELOCALPARTITION *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSCREATELOCALPARTITION]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSCREATELOCALPARTITION); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, r); + } + + r->out.result = _srvsvc_NETRDFSCREATELOCALPARTITION(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSDELETELOCALPARTITION *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSDELETELOCALPARTITION]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSDELETELOCALPARTITION); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, r); + } + + r->out.result = _srvsvc_NETRDFSDELETELOCALPARTITION(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSSETLOCALVOLUMESTATE); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, r); + } + + r->out.result = _srvsvc_NETRDFSSETLOCALVOLUMESTATE(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSSETSERVERINFO *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSSETSERVERINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSSETSERVERINFO); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETSERVERINFO, r); + } + + r->out.result = _srvsvc_NETRDFSSETSERVERINFO(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETSERVERINFO, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSCREATEEXITPOINT *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSCREATEEXITPOINT]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSCREATEEXITPOINT); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, r); + } + + r->out.result = _srvsvc_NETRDFSCREATEEXITPOINT(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSDELETEEXITPOINT *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSDELETEEXITPOINT]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSDELETEEXITPOINT); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, r); + } + + r->out.result = _srvsvc_NETRDFSDELETEEXITPOINT(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSMODIFYPREFIX *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSMODIFYPREFIX]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSMODIFYPREFIX); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, r); + } + + r->out.result = _srvsvc_NETRDFSMODIFYPREFIX(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSFIXLOCALVOLUME *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSFIXLOCALVOLUME]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSFIXLOCALVOLUME); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, r); + } + + r->out.result = _srvsvc_NETRDFSFIXLOCALVOLUME(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO]; + + r = talloc(talloc_tos(), struct srvsvc_NETRDFSMANAGERREPORTSITEINFO); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, r); + } + + r->out.result = _srvsvc_NETRDFSMANAGERREPORTSITEINFO(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct srvsvc_NETRSERVERTRANSPORTDELEX *r; + + call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRSERVERTRANSPORTDELEX]; + + r = talloc(talloc_tos(), struct srvsvc_NETRSERVERTRANSPORTDELEX); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, r); + } + + r->out.result = _srvsvc_NETRSERVERTRANSPORTDELEX(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_srvsvc_cmds[] = +{ + {"SRVSVC_NETCHARDEVENUM", NDR_SRVSVC_NETCHARDEVENUM, api_srvsvc_NetCharDevEnum}, + {"SRVSVC_NETCHARDEVGETINFO", NDR_SRVSVC_NETCHARDEVGETINFO, api_srvsvc_NetCharDevGetInfo}, + {"SRVSVC_NETCHARDEVCONTROL", NDR_SRVSVC_NETCHARDEVCONTROL, api_srvsvc_NetCharDevControl}, + {"SRVSVC_NETCHARDEVQENUM", NDR_SRVSVC_NETCHARDEVQENUM, api_srvsvc_NetCharDevQEnum}, + {"SRVSVC_NETCHARDEVQGETINFO", NDR_SRVSVC_NETCHARDEVQGETINFO, api_srvsvc_NetCharDevQGetInfo}, + {"SRVSVC_NETCHARDEVQSETINFO", NDR_SRVSVC_NETCHARDEVQSETINFO, api_srvsvc_NetCharDevQSetInfo}, + {"SRVSVC_NETCHARDEVQPURGE", NDR_SRVSVC_NETCHARDEVQPURGE, api_srvsvc_NetCharDevQPurge}, + {"SRVSVC_NETCHARDEVQPURGESELF", NDR_SRVSVC_NETCHARDEVQPURGESELF, api_srvsvc_NetCharDevQPurgeSelf}, + {"SRVSVC_NETCONNENUM", NDR_SRVSVC_NETCONNENUM, api_srvsvc_NetConnEnum}, + {"SRVSVC_NETFILEENUM", NDR_SRVSVC_NETFILEENUM, api_srvsvc_NetFileEnum}, + {"SRVSVC_NETFILEGETINFO", NDR_SRVSVC_NETFILEGETINFO, api_srvsvc_NetFileGetInfo}, + {"SRVSVC_NETFILECLOSE", NDR_SRVSVC_NETFILECLOSE, api_srvsvc_NetFileClose}, + {"SRVSVC_NETSESSENUM", NDR_SRVSVC_NETSESSENUM, api_srvsvc_NetSessEnum}, + {"SRVSVC_NETSESSDEL", NDR_SRVSVC_NETSESSDEL, api_srvsvc_NetSessDel}, + {"SRVSVC_NETSHAREADD", NDR_SRVSVC_NETSHAREADD, api_srvsvc_NetShareAdd}, + {"SRVSVC_NETSHAREENUMALL", NDR_SRVSVC_NETSHAREENUMALL, api_srvsvc_NetShareEnumAll}, + {"SRVSVC_NETSHAREGETINFO", NDR_SRVSVC_NETSHAREGETINFO, api_srvsvc_NetShareGetInfo}, + {"SRVSVC_NETSHARESETINFO", NDR_SRVSVC_NETSHARESETINFO, api_srvsvc_NetShareSetInfo}, + {"SRVSVC_NETSHAREDEL", NDR_SRVSVC_NETSHAREDEL, api_srvsvc_NetShareDel}, + {"SRVSVC_NETSHAREDELSTICKY", NDR_SRVSVC_NETSHAREDELSTICKY, api_srvsvc_NetShareDelSticky}, + {"SRVSVC_NETSHARECHECK", NDR_SRVSVC_NETSHARECHECK, api_srvsvc_NetShareCheck}, + {"SRVSVC_NETSRVGETINFO", NDR_SRVSVC_NETSRVGETINFO, api_srvsvc_NetSrvGetInfo}, + {"SRVSVC_NETSRVSETINFO", NDR_SRVSVC_NETSRVSETINFO, api_srvsvc_NetSrvSetInfo}, + {"SRVSVC_NETDISKENUM", NDR_SRVSVC_NETDISKENUM, api_srvsvc_NetDiskEnum}, + {"SRVSVC_NETSERVERSTATISTICSGET", NDR_SRVSVC_NETSERVERSTATISTICSGET, api_srvsvc_NetServerStatisticsGet}, + {"SRVSVC_NETTRANSPORTADD", NDR_SRVSVC_NETTRANSPORTADD, api_srvsvc_NetTransportAdd}, + {"SRVSVC_NETTRANSPORTENUM", NDR_SRVSVC_NETTRANSPORTENUM, api_srvsvc_NetTransportEnum}, + {"SRVSVC_NETTRANSPORTDEL", NDR_SRVSVC_NETTRANSPORTDEL, api_srvsvc_NetTransportDel}, + {"SRVSVC_NETREMOTETOD", NDR_SRVSVC_NETREMOTETOD, api_srvsvc_NetRemoteTOD}, + {"SRVSVC_NETSETSERVICEBITS", NDR_SRVSVC_NETSETSERVICEBITS, api_srvsvc_NetSetServiceBits}, + {"SRVSVC_NETPATHTYPE", NDR_SRVSVC_NETPATHTYPE, api_srvsvc_NetPathType}, + {"SRVSVC_NETPATHCANONICALIZE", NDR_SRVSVC_NETPATHCANONICALIZE, api_srvsvc_NetPathCanonicalize}, + {"SRVSVC_NETPATHCOMPARE", NDR_SRVSVC_NETPATHCOMPARE, api_srvsvc_NetPathCompare}, + {"SRVSVC_NETNAMEVALIDATE", NDR_SRVSVC_NETNAMEVALIDATE, api_srvsvc_NetNameValidate}, + {"SRVSVC_NETRPRNAMECANONICALIZE", NDR_SRVSVC_NETRPRNAMECANONICALIZE, api_srvsvc_NETRPRNAMECANONICALIZE}, + {"SRVSVC_NETPRNAMECOMPARE", NDR_SRVSVC_NETPRNAMECOMPARE, api_srvsvc_NetPRNameCompare}, + {"SRVSVC_NETSHAREENUM", NDR_SRVSVC_NETSHAREENUM, api_srvsvc_NetShareEnum}, + {"SRVSVC_NETSHAREDELSTART", NDR_SRVSVC_NETSHAREDELSTART, api_srvsvc_NetShareDelStart}, + {"SRVSVC_NETSHAREDELCOMMIT", NDR_SRVSVC_NETSHAREDELCOMMIT, api_srvsvc_NetShareDelCommit}, + {"SRVSVC_NETGETFILESECURITY", NDR_SRVSVC_NETGETFILESECURITY, api_srvsvc_NetGetFileSecurity}, + {"SRVSVC_NETSETFILESECURITY", NDR_SRVSVC_NETSETFILESECURITY, api_srvsvc_NetSetFileSecurity}, + {"SRVSVC_NETSERVERTRANSPORTADDEX", NDR_SRVSVC_NETSERVERTRANSPORTADDEX, api_srvsvc_NetServerTransportAddEx}, + {"SRVSVC_NETSERVERSETSERVICEBITSEX", NDR_SRVSVC_NETSERVERSETSERVICEBITSEX, api_srvsvc_NetServerSetServiceBitsEx}, + {"SRVSVC_NETRDFSGETVERSION", NDR_SRVSVC_NETRDFSGETVERSION, api_srvsvc_NETRDFSGETVERSION}, + {"SRVSVC_NETRDFSCREATELOCALPARTITION", NDR_SRVSVC_NETRDFSCREATELOCALPARTITION, api_srvsvc_NETRDFSCREATELOCALPARTITION}, + {"SRVSVC_NETRDFSDELETELOCALPARTITION", NDR_SRVSVC_NETRDFSDELETELOCALPARTITION, api_srvsvc_NETRDFSDELETELOCALPARTITION}, + {"SRVSVC_NETRDFSSETLOCALVOLUMESTATE", NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE, api_srvsvc_NETRDFSSETLOCALVOLUMESTATE}, + {"SRVSVC_NETRDFSSETSERVERINFO", NDR_SRVSVC_NETRDFSSETSERVERINFO, api_srvsvc_NETRDFSSETSERVERINFO}, + {"SRVSVC_NETRDFSCREATEEXITPOINT", NDR_SRVSVC_NETRDFSCREATEEXITPOINT, api_srvsvc_NETRDFSCREATEEXITPOINT}, + {"SRVSVC_NETRDFSDELETEEXITPOINT", NDR_SRVSVC_NETRDFSDELETEEXITPOINT, api_srvsvc_NETRDFSDELETEEXITPOINT}, + {"SRVSVC_NETRDFSMODIFYPREFIX", NDR_SRVSVC_NETRDFSMODIFYPREFIX, api_srvsvc_NETRDFSMODIFYPREFIX}, + {"SRVSVC_NETRDFSFIXLOCALVOLUME", NDR_SRVSVC_NETRDFSFIXLOCALVOLUME, api_srvsvc_NETRDFSFIXLOCALVOLUME}, + {"SRVSVC_NETRDFSMANAGERREPORTSITEINFO", NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO, api_srvsvc_NETRDFSMANAGERREPORTSITEINFO}, + {"SRVSVC_NETRSERVERTRANSPORTDELEX", NDR_SRVSVC_NETRSERVERTRANSPORTDELEX, api_srvsvc_NETRSERVERTRANSPORTDELEX}, +}; + +void srvsvc_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_srvsvc_cmds; + *n_fns = sizeof(api_srvsvc_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_srvsvc_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "srvsvc", "srvsvc", &ndr_table_srvsvc.syntax_id, api_srvsvc_cmds, sizeof(api_srvsvc_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_srvsvc.h b/librpc/gen_ndr/srv_srvsvc.h new file mode 100644 index 0000000000..1e1ebb1904 --- /dev/null +++ b/librpc/gen_ndr/srv_srvsvc.h @@ -0,0 +1,60 @@ +#include "librpc/gen_ndr/ndr_srvsvc.h" +#ifndef __SRV_SRVSVC__ +#define __SRV_SRVSVC__ +WERROR _srvsvc_NetCharDevEnum(pipes_struct *p, struct srvsvc_NetCharDevEnum *r); +WERROR _srvsvc_NetCharDevGetInfo(pipes_struct *p, struct srvsvc_NetCharDevGetInfo *r); +WERROR _srvsvc_NetCharDevControl(pipes_struct *p, struct srvsvc_NetCharDevControl *r); +WERROR _srvsvc_NetCharDevQEnum(pipes_struct *p, struct srvsvc_NetCharDevQEnum *r); +WERROR _srvsvc_NetCharDevQGetInfo(pipes_struct *p, struct srvsvc_NetCharDevQGetInfo *r); +WERROR _srvsvc_NetCharDevQSetInfo(pipes_struct *p, struct srvsvc_NetCharDevQSetInfo *r); +WERROR _srvsvc_NetCharDevQPurge(pipes_struct *p, struct srvsvc_NetCharDevQPurge *r); +WERROR _srvsvc_NetCharDevQPurgeSelf(pipes_struct *p, struct srvsvc_NetCharDevQPurgeSelf *r); +WERROR _srvsvc_NetConnEnum(pipes_struct *p, struct srvsvc_NetConnEnum *r); +WERROR _srvsvc_NetFileEnum(pipes_struct *p, struct srvsvc_NetFileEnum *r); +WERROR _srvsvc_NetFileGetInfo(pipes_struct *p, struct srvsvc_NetFileGetInfo *r); +WERROR _srvsvc_NetFileClose(pipes_struct *p, struct srvsvc_NetFileClose *r); +WERROR _srvsvc_NetSessEnum(pipes_struct *p, struct srvsvc_NetSessEnum *r); +WERROR _srvsvc_NetSessDel(pipes_struct *p, struct srvsvc_NetSessDel *r); +WERROR _srvsvc_NetShareAdd(pipes_struct *p, struct srvsvc_NetShareAdd *r); +WERROR _srvsvc_NetShareEnumAll(pipes_struct *p, struct srvsvc_NetShareEnumAll *r); +WERROR _srvsvc_NetShareGetInfo(pipes_struct *p, struct srvsvc_NetShareGetInfo *r); +WERROR _srvsvc_NetShareSetInfo(pipes_struct *p, struct srvsvc_NetShareSetInfo *r); +WERROR _srvsvc_NetShareDel(pipes_struct *p, struct srvsvc_NetShareDel *r); +WERROR _srvsvc_NetShareDelSticky(pipes_struct *p, struct srvsvc_NetShareDelSticky *r); +WERROR _srvsvc_NetShareCheck(pipes_struct *p, struct srvsvc_NetShareCheck *r); +WERROR _srvsvc_NetSrvGetInfo(pipes_struct *p, struct srvsvc_NetSrvGetInfo *r); +WERROR _srvsvc_NetSrvSetInfo(pipes_struct *p, struct srvsvc_NetSrvSetInfo *r); +WERROR _srvsvc_NetDiskEnum(pipes_struct *p, struct srvsvc_NetDiskEnum *r); +WERROR _srvsvc_NetServerStatisticsGet(pipes_struct *p, struct srvsvc_NetServerStatisticsGet *r); +WERROR _srvsvc_NetTransportAdd(pipes_struct *p, struct srvsvc_NetTransportAdd *r); +WERROR _srvsvc_NetTransportEnum(pipes_struct *p, struct srvsvc_NetTransportEnum *r); +WERROR _srvsvc_NetTransportDel(pipes_struct *p, struct srvsvc_NetTransportDel *r); +WERROR _srvsvc_NetRemoteTOD(pipes_struct *p, struct srvsvc_NetRemoteTOD *r); +WERROR _srvsvc_NetSetServiceBits(pipes_struct *p, struct srvsvc_NetSetServiceBits *r); +WERROR _srvsvc_NetPathType(pipes_struct *p, struct srvsvc_NetPathType *r); +WERROR _srvsvc_NetPathCanonicalize(pipes_struct *p, struct srvsvc_NetPathCanonicalize *r); +WERROR _srvsvc_NetPathCompare(pipes_struct *p, struct srvsvc_NetPathCompare *r); +WERROR _srvsvc_NetNameValidate(pipes_struct *p, struct srvsvc_NetNameValidate *r); +WERROR _srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p, struct srvsvc_NETRPRNAMECANONICALIZE *r); +WERROR _srvsvc_NetPRNameCompare(pipes_struct *p, struct srvsvc_NetPRNameCompare *r); +WERROR _srvsvc_NetShareEnum(pipes_struct *p, struct srvsvc_NetShareEnum *r); +WERROR _srvsvc_NetShareDelStart(pipes_struct *p, struct srvsvc_NetShareDelStart *r); +WERROR _srvsvc_NetShareDelCommit(pipes_struct *p, struct srvsvc_NetShareDelCommit *r); +WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p, struct srvsvc_NetGetFileSecurity *r); +WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p, struct srvsvc_NetSetFileSecurity *r); +WERROR _srvsvc_NetServerTransportAddEx(pipes_struct *p, struct srvsvc_NetServerTransportAddEx *r); +WERROR _srvsvc_NetServerSetServiceBitsEx(pipes_struct *p, struct srvsvc_NetServerSetServiceBitsEx *r); +WERROR _srvsvc_NETRDFSGETVERSION(pipes_struct *p, struct srvsvc_NETRDFSGETVERSION *r); +WERROR _srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p, struct srvsvc_NETRDFSCREATELOCALPARTITION *r); +WERROR _srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p, struct srvsvc_NETRDFSDELETELOCALPARTITION *r); +WERROR _srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p, struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r); +WERROR _srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p, struct srvsvc_NETRDFSSETSERVERINFO *r); +WERROR _srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p, struct srvsvc_NETRDFSCREATEEXITPOINT *r); +WERROR _srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p, struct srvsvc_NETRDFSDELETEEXITPOINT *r); +WERROR _srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p, struct srvsvc_NETRDFSMODIFYPREFIX *r); +WERROR _srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p, struct srvsvc_NETRDFSFIXLOCALVOLUME *r); +WERROR _srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p, struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r); +WERROR _srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p, struct srvsvc_NETRSERVERTRANSPORTDELEX *r); +void srvsvc_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_srvsvc_init(void); +#endif /* __SRV_SRVSVC__ */ diff --git a/librpc/gen_ndr/srv_svcctl.c b/librpc/gen_ndr/srv_svcctl.c new file mode 100644 index 0000000000..5b30bf00f7 --- /dev/null +++ b/librpc/gen_ndr/srv_svcctl.c @@ -0,0 +1,3615 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_svcctl.h" + +static bool api_svcctl_CloseServiceHandle(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_CloseServiceHandle *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_CLOSESERVICEHANDLE]; + + r = talloc(talloc_tos(), struct svcctl_CloseServiceHandle); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = r->in.handle; + r->out.result = _svcctl_CloseServiceHandle(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_ControlService(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_ControlService *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_CONTROLSERVICE]; + + r = talloc(talloc_tos(), struct svcctl_ControlService); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ControlService, r); + } + + ZERO_STRUCT(r->out); + r->out.service_status = talloc_zero(r, struct SERVICE_STATUS); + if (r->out.service_status == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_ControlService(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ControlService, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_DeleteService(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_DeleteService *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_DELETESERVICE]; + + r = talloc(talloc_tos(), struct svcctl_DeleteService); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_DeleteService, r); + } + + r->out.result = _svcctl_DeleteService(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_LockServiceDatabase(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_LockServiceDatabase *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_LOCKSERVICEDATABASE]; + + r = talloc(talloc_tos(), struct svcctl_LockServiceDatabase); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, r); + } + + ZERO_STRUCT(r->out); + r->out.lock = talloc_zero(r, struct policy_handle); + if (r->out.lock == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_LockServiceDatabase(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_QueryServiceObjectSecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_QueryServiceObjectSecurity *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY]; + + r = talloc(talloc_tos(), struct svcctl_QueryServiceObjectSecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, r); + } + + ZERO_STRUCT(r->out); + r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buffer_size); + if (r->out.buffer == NULL) { + talloc_free(r); + return false; + } + + r->out.needed = talloc_zero(r, uint32_t); + if (r->out.needed == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_QueryServiceObjectSecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_SetServiceObjectSecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_SetServiceObjectSecurity *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICEOBJECTSECURITY]; + + r = talloc(talloc_tos(), struct svcctl_SetServiceObjectSecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, r); + } + + r->out.result = _svcctl_SetServiceObjectSecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_QueryServiceStatus(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_QueryServiceStatus *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUS]; + + r = talloc(talloc_tos(), struct svcctl_QueryServiceStatus); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, r); + } + + ZERO_STRUCT(r->out); + r->out.service_status = talloc_zero(r, struct SERVICE_STATUS); + if (r->out.service_status == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_QueryServiceStatus(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_SetServiceStatus(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_SetServiceStatus *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICESTATUS]; + + r = talloc(talloc_tos(), struct svcctl_SetServiceStatus); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, r); + } + + r->out.result = _svcctl_SetServiceStatus(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_UnlockServiceDatabase(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_UnlockServiceDatabase *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_UNLOCKSERVICEDATABASE]; + + r = talloc(talloc_tos(), struct svcctl_UnlockServiceDatabase); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, r); + } + + ZERO_STRUCT(r->out); + r->out.lock = r->in.lock; + r->out.result = _svcctl_UnlockServiceDatabase(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_NotifyBootConfigStatus(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_NotifyBootConfigStatus *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS]; + + r = talloc(talloc_tos(), struct svcctl_NotifyBootConfigStatus); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, r); + } + + r->out.result = _svcctl_NotifyBootConfigStatus(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_SCSetServiceBitsW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_SCSetServiceBitsW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSW]; + + r = talloc(talloc_tos(), struct svcctl_SCSetServiceBitsW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, r); + } + + r->out.result = _svcctl_SCSetServiceBitsW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_ChangeServiceConfigW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_ChangeServiceConfigW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGW]; + + r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfigW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, r); + } + + ZERO_STRUCT(r->out); + r->out.tag_id = talloc_zero(r, uint32_t); + if (r->out.tag_id == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_ChangeServiceConfigW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_CreateServiceW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_CreateServiceW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEW]; + + r = talloc(talloc_tos(), struct svcctl_CreateServiceW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, r); + } + + ZERO_STRUCT(r->out); + r->out.TagId = r->in.TagId; + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_CreateServiceW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_EnumDependentServicesW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_EnumDependentServicesW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESW]; + + r = talloc(talloc_tos(), struct svcctl_EnumDependentServicesW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, r); + } + + ZERO_STRUCT(r->out); + r->out.service_status = talloc_zero_array(r, uint8_t, r->in.buf_size); + if (r->out.service_status == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.services_returned = talloc_zero(r, uint32_t); + if (r->out.services_returned == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_EnumDependentServicesW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_EnumServicesStatusW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_EnumServicesStatusW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSW]; + + r = talloc(talloc_tos(), struct svcctl_EnumServicesStatusW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.service = talloc_zero_array(r, uint8_t, r->in.buf_size); + if (r->out.service == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.services_returned = talloc_zero(r, uint32_t); + if (r->out.services_returned == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_EnumServicesStatusW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_OpenSCManagerW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_OpenSCManagerW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERW]; + + r = talloc(talloc_tos(), struct svcctl_OpenSCManagerW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_OpenSCManagerW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_OpenServiceW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_OpenServiceW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEW]; + + r = talloc(talloc_tos(), struct svcctl_OpenServiceW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_OpenServiceW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_QueryServiceConfigW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_QueryServiceConfigW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGW]; + + r = talloc(talloc_tos(), struct svcctl_QueryServiceConfigW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, r); + } + + ZERO_STRUCT(r->out); + r->out.query = talloc_zero(r, struct QUERY_SERVICE_CONFIG); + if (r->out.query == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_QueryServiceConfigW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_QueryServiceLockStatusW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_QueryServiceLockStatusW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSW]; + + r = talloc(talloc_tos(), struct svcctl_QueryServiceLockStatusW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, r); + } + + ZERO_STRUCT(r->out); + r->out.lock_status = talloc_zero(r, struct SERVICE_LOCK_STATUS); + if (r->out.lock_status == NULL) { + talloc_free(r); + return false; + } + + r->out.required_buf_size = talloc_zero(r, uint32_t); + if (r->out.required_buf_size == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_QueryServiceLockStatusW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_StartServiceW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_StartServiceW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEW]; + + r = talloc(talloc_tos(), struct svcctl_StartServiceW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, r); + } + + r->out.result = _svcctl_StartServiceW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_GetServiceDisplayNameW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_GetServiceDisplayNameW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEW]; + + r = talloc(talloc_tos(), struct svcctl_GetServiceDisplayNameW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, r); + } + + ZERO_STRUCT(r->out); + r->out.display_name_length = r->in.display_name_length; + r->out.display_name = talloc_zero(r, const char *); + if (r->out.display_name == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_GetServiceDisplayNameW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_GetServiceKeyNameW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_GetServiceKeyNameW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEW]; + + r = talloc(talloc_tos(), struct svcctl_GetServiceKeyNameW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, r); + } + + ZERO_STRUCT(r->out); + r->out.display_name_length = r->in.display_name_length; + r->out.key_name = talloc_zero(r, const char *); + if (r->out.key_name == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_GetServiceKeyNameW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_SCSetServiceBitsA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_SCSetServiceBitsA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSA]; + + r = talloc(talloc_tos(), struct svcctl_SCSetServiceBitsA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, r); + } + + r->out.result = _svcctl_SCSetServiceBitsA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_ChangeServiceConfigA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_ChangeServiceConfigA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGA]; + + r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfigA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, r); + } + + ZERO_STRUCT(r->out); + r->out.tag_id = talloc_zero(r, uint32_t); + if (r->out.tag_id == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_ChangeServiceConfigA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_CreateServiceA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_CreateServiceA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEA]; + + r = talloc(talloc_tos(), struct svcctl_CreateServiceA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, r); + } + + ZERO_STRUCT(r->out); + r->out.TagId = talloc_zero(r, uint32_t); + if (r->out.TagId == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_CreateServiceA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_EnumDependentServicesA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_EnumDependentServicesA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESA]; + + r = talloc(talloc_tos(), struct svcctl_EnumDependentServicesA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, r); + } + + ZERO_STRUCT(r->out); + r->out.service_status = talloc_zero(r, struct ENUM_SERVICE_STATUS); + if (r->out.service_status == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.services_returned = talloc_zero(r, uint32_t); + if (r->out.services_returned == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_EnumDependentServicesA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_EnumServicesStatusA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_EnumServicesStatusA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSA]; + + r = talloc(talloc_tos(), struct svcctl_EnumServicesStatusA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.service = talloc_zero_array(r, uint8_t, r->in.buf_size); + if (r->out.service == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.services_returned = talloc_zero(r, uint32_t); + if (r->out.services_returned == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_EnumServicesStatusA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_OpenSCManagerA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_OpenSCManagerA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERA]; + + r = talloc(talloc_tos(), struct svcctl_OpenSCManagerA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_OpenSCManagerA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_OpenServiceA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_OpenServiceA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEA]; + + r = talloc(talloc_tos(), struct svcctl_OpenServiceA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, r); + } + + r->out.result = _svcctl_OpenServiceA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_QueryServiceConfigA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_QueryServiceConfigA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGA]; + + r = talloc(talloc_tos(), struct svcctl_QueryServiceConfigA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, r); + } + + ZERO_STRUCT(r->out); + r->out.query = talloc_zero_array(r, uint8_t, r->in.buf_size); + if (r->out.query == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_QueryServiceConfigA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_QueryServiceLockStatusA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_QueryServiceLockStatusA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSA]; + + r = talloc(talloc_tos(), struct svcctl_QueryServiceLockStatusA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, r); + } + + ZERO_STRUCT(r->out); + r->out.lock_status = talloc_zero(r, struct SERVICE_LOCK_STATUS); + if (r->out.lock_status == NULL) { + talloc_free(r); + return false; + } + + r->out.required_buf_size = talloc_zero(r, uint32_t); + if (r->out.required_buf_size == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_QueryServiceLockStatusA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_StartServiceA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_StartServiceA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEA]; + + r = talloc(talloc_tos(), struct svcctl_StartServiceA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, r); + } + + r->out.result = _svcctl_StartServiceA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_GetServiceDisplayNameA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_GetServiceDisplayNameA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEA]; + + r = talloc(talloc_tos(), struct svcctl_GetServiceDisplayNameA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, r); + } + + ZERO_STRUCT(r->out); + r->out.display_name_length = r->in.display_name_length; + r->out.display_name = talloc_zero(r, const char *); + if (r->out.display_name == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_GetServiceDisplayNameA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_GetServiceKeyNameA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_GetServiceKeyNameA *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEA]; + + r = talloc(talloc_tos(), struct svcctl_GetServiceKeyNameA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, r); + } + + ZERO_STRUCT(r->out); + r->out.display_name_length = r->in.display_name_length; + r->out.key_name = talloc_zero(r, const char *); + if (r->out.key_name == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_GetServiceKeyNameA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_GetCurrentGroupeStateW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_GetCurrentGroupeStateW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETCURRENTGROUPESTATEW]; + + r = talloc(talloc_tos(), struct svcctl_GetCurrentGroupeStateW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, r); + } + + r->out.result = _svcctl_GetCurrentGroupeStateW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_EnumServiceGroupW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_EnumServiceGroupW *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICEGROUPW]; + + r = talloc(talloc_tos(), struct svcctl_EnumServiceGroupW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, r); + } + + r->out.result = _svcctl_EnumServiceGroupW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_ChangeServiceConfig2A(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_ChangeServiceConfig2A *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2A]; + + r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfig2A); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, r); + } + + r->out.result = _svcctl_ChangeServiceConfig2A(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_ChangeServiceConfig2W(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_ChangeServiceConfig2W *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2W]; + + r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfig2W); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, r); + } + + r->out.result = _svcctl_ChangeServiceConfig2W(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_QueryServiceConfig2A(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_QueryServiceConfig2A *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2A]; + + r = talloc(talloc_tos(), struct svcctl_QueryServiceConfig2A); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, r); + } + + ZERO_STRUCT(r->out); + r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size); + if (r->out.buffer == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_QueryServiceConfig2A(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_QueryServiceConfig2W(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_QueryServiceConfig2W *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2W]; + + r = talloc(talloc_tos(), struct svcctl_QueryServiceConfig2W); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, r); + } + + ZERO_STRUCT(r->out); + r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size); + if (r->out.buffer == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_QueryServiceConfig2W(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_QueryServiceStatusEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_QueryServiceStatusEx *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUSEX]; + + r = talloc(talloc_tos(), struct svcctl_QueryServiceStatusEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, r); + } + + ZERO_STRUCT(r->out); + r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size); + if (r->out.buffer == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _svcctl_QueryServiceStatusEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_EnumServicesStatusExA(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct EnumServicesStatusExA *r; + + call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXA]; + + r = talloc(talloc_tos(), struct EnumServicesStatusExA); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.services = talloc_zero_array(r, uint8_t, r->in.buf_size); + if (r->out.services == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.service_returned = talloc_zero(r, uint32_t); + if (r->out.service_returned == NULL) { + talloc_free(r); + return false; + } + + r->out.group_name = talloc_zero(r, const char *); + if (r->out.group_name == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _EnumServicesStatusExA(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_EnumServicesStatusExW(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct EnumServicesStatusExW *r; + + call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXW]; + + r = talloc(talloc_tos(), struct EnumServicesStatusExW); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.services = talloc_zero_array(r, uint8_t, r->in.buf_size); + if (r->out.services == NULL) { + talloc_free(r); + return false; + } + + r->out.bytes_needed = talloc_zero(r, uint32_t); + if (r->out.bytes_needed == NULL) { + talloc_free(r); + return false; + } + + r->out.service_returned = talloc_zero(r, uint32_t); + if (r->out.service_returned == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _EnumServicesStatusExW(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_svcctl_SCSendTSMessage(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct svcctl_SCSendTSMessage *r; + + call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSENDTSMESSAGE]; + + r = talloc(talloc_tos(), struct svcctl_SCSendTSMessage); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, r); + } + + r->out.result = _svcctl_SCSendTSMessage(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_svcctl_cmds[] = +{ + {"SVCCTL_CLOSESERVICEHANDLE", NDR_SVCCTL_CLOSESERVICEHANDLE, api_svcctl_CloseServiceHandle}, + {"SVCCTL_CONTROLSERVICE", NDR_SVCCTL_CONTROLSERVICE, api_svcctl_ControlService}, + {"SVCCTL_DELETESERVICE", NDR_SVCCTL_DELETESERVICE, api_svcctl_DeleteService}, + {"SVCCTL_LOCKSERVICEDATABASE", NDR_SVCCTL_LOCKSERVICEDATABASE, api_svcctl_LockServiceDatabase}, + {"SVCCTL_QUERYSERVICEOBJECTSECURITY", NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY, api_svcctl_QueryServiceObjectSecurity}, + {"SVCCTL_SETSERVICEOBJECTSECURITY", NDR_SVCCTL_SETSERVICEOBJECTSECURITY, api_svcctl_SetServiceObjectSecurity}, + {"SVCCTL_QUERYSERVICESTATUS", NDR_SVCCTL_QUERYSERVICESTATUS, api_svcctl_QueryServiceStatus}, + {"SVCCTL_SETSERVICESTATUS", NDR_SVCCTL_SETSERVICESTATUS, api_svcctl_SetServiceStatus}, + {"SVCCTL_UNLOCKSERVICEDATABASE", NDR_SVCCTL_UNLOCKSERVICEDATABASE, api_svcctl_UnlockServiceDatabase}, + {"SVCCTL_NOTIFYBOOTCONFIGSTATUS", NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS, api_svcctl_NotifyBootConfigStatus}, + {"SVCCTL_SCSETSERVICEBITSW", NDR_SVCCTL_SCSETSERVICEBITSW, api_svcctl_SCSetServiceBitsW}, + {"SVCCTL_CHANGESERVICECONFIGW", NDR_SVCCTL_CHANGESERVICECONFIGW, api_svcctl_ChangeServiceConfigW}, + {"SVCCTL_CREATESERVICEW", NDR_SVCCTL_CREATESERVICEW, api_svcctl_CreateServiceW}, + {"SVCCTL_ENUMDEPENDENTSERVICESW", NDR_SVCCTL_ENUMDEPENDENTSERVICESW, api_svcctl_EnumDependentServicesW}, + {"SVCCTL_ENUMSERVICESSTATUSW", NDR_SVCCTL_ENUMSERVICESSTATUSW, api_svcctl_EnumServicesStatusW}, + {"SVCCTL_OPENSCMANAGERW", NDR_SVCCTL_OPENSCMANAGERW, api_svcctl_OpenSCManagerW}, + {"SVCCTL_OPENSERVICEW", NDR_SVCCTL_OPENSERVICEW, api_svcctl_OpenServiceW}, + {"SVCCTL_QUERYSERVICECONFIGW", NDR_SVCCTL_QUERYSERVICECONFIGW, api_svcctl_QueryServiceConfigW}, + {"SVCCTL_QUERYSERVICELOCKSTATUSW", NDR_SVCCTL_QUERYSERVICELOCKSTATUSW, api_svcctl_QueryServiceLockStatusW}, + {"SVCCTL_STARTSERVICEW", NDR_SVCCTL_STARTSERVICEW, api_svcctl_StartServiceW}, + {"SVCCTL_GETSERVICEDISPLAYNAMEW", NDR_SVCCTL_GETSERVICEDISPLAYNAMEW, api_svcctl_GetServiceDisplayNameW}, + {"SVCCTL_GETSERVICEKEYNAMEW", NDR_SVCCTL_GETSERVICEKEYNAMEW, api_svcctl_GetServiceKeyNameW}, + {"SVCCTL_SCSETSERVICEBITSA", NDR_SVCCTL_SCSETSERVICEBITSA, api_svcctl_SCSetServiceBitsA}, + {"SVCCTL_CHANGESERVICECONFIGA", NDR_SVCCTL_CHANGESERVICECONFIGA, api_svcctl_ChangeServiceConfigA}, + {"SVCCTL_CREATESERVICEA", NDR_SVCCTL_CREATESERVICEA, api_svcctl_CreateServiceA}, + {"SVCCTL_ENUMDEPENDENTSERVICESA", NDR_SVCCTL_ENUMDEPENDENTSERVICESA, api_svcctl_EnumDependentServicesA}, + {"SVCCTL_ENUMSERVICESSTATUSA", NDR_SVCCTL_ENUMSERVICESSTATUSA, api_svcctl_EnumServicesStatusA}, + {"SVCCTL_OPENSCMANAGERA", NDR_SVCCTL_OPENSCMANAGERA, api_svcctl_OpenSCManagerA}, + {"SVCCTL_OPENSERVICEA", NDR_SVCCTL_OPENSERVICEA, api_svcctl_OpenServiceA}, + {"SVCCTL_QUERYSERVICECONFIGA", NDR_SVCCTL_QUERYSERVICECONFIGA, api_svcctl_QueryServiceConfigA}, + {"SVCCTL_QUERYSERVICELOCKSTATUSA", NDR_SVCCTL_QUERYSERVICELOCKSTATUSA, api_svcctl_QueryServiceLockStatusA}, + {"SVCCTL_STARTSERVICEA", NDR_SVCCTL_STARTSERVICEA, api_svcctl_StartServiceA}, + {"SVCCTL_GETSERVICEDISPLAYNAMEA", NDR_SVCCTL_GETSERVICEDISPLAYNAMEA, api_svcctl_GetServiceDisplayNameA}, + {"SVCCTL_GETSERVICEKEYNAMEA", NDR_SVCCTL_GETSERVICEKEYNAMEA, api_svcctl_GetServiceKeyNameA}, + {"SVCCTL_GETCURRENTGROUPESTATEW", NDR_SVCCTL_GETCURRENTGROUPESTATEW, api_svcctl_GetCurrentGroupeStateW}, + {"SVCCTL_ENUMSERVICEGROUPW", NDR_SVCCTL_ENUMSERVICEGROUPW, api_svcctl_EnumServiceGroupW}, + {"SVCCTL_CHANGESERVICECONFIG2A", NDR_SVCCTL_CHANGESERVICECONFIG2A, api_svcctl_ChangeServiceConfig2A}, + {"SVCCTL_CHANGESERVICECONFIG2W", NDR_SVCCTL_CHANGESERVICECONFIG2W, api_svcctl_ChangeServiceConfig2W}, + {"SVCCTL_QUERYSERVICECONFIG2A", NDR_SVCCTL_QUERYSERVICECONFIG2A, api_svcctl_QueryServiceConfig2A}, + {"SVCCTL_QUERYSERVICECONFIG2W", NDR_SVCCTL_QUERYSERVICECONFIG2W, api_svcctl_QueryServiceConfig2W}, + {"SVCCTL_QUERYSERVICESTATUSEX", NDR_SVCCTL_QUERYSERVICESTATUSEX, api_svcctl_QueryServiceStatusEx}, + {"ENUMSERVICESSTATUSEXA", NDR_ENUMSERVICESSTATUSEXA, api_EnumServicesStatusExA}, + {"ENUMSERVICESSTATUSEXW", NDR_ENUMSERVICESSTATUSEXW, api_EnumServicesStatusExW}, + {"SVCCTL_SCSENDTSMESSAGE", NDR_SVCCTL_SCSENDTSMESSAGE, api_svcctl_SCSendTSMessage}, +}; + +void svcctl_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_svcctl_cmds; + *n_fns = sizeof(api_svcctl_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_svcctl_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "svcctl", "svcctl", &ndr_table_svcctl.syntax_id, api_svcctl_cmds, sizeof(api_svcctl_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_svcctl.h b/librpc/gen_ndr/srv_svcctl.h new file mode 100644 index 0000000000..ca63ebe970 --- /dev/null +++ b/librpc/gen_ndr/srv_svcctl.h @@ -0,0 +1,50 @@ +#include "librpc/gen_ndr/ndr_svcctl.h" +#ifndef __SRV_SVCCTL__ +#define __SRV_SVCCTL__ +WERROR _svcctl_CloseServiceHandle(pipes_struct *p, struct svcctl_CloseServiceHandle *r); +WERROR _svcctl_ControlService(pipes_struct *p, struct svcctl_ControlService *r); +WERROR _svcctl_DeleteService(pipes_struct *p, struct svcctl_DeleteService *r); +WERROR _svcctl_LockServiceDatabase(pipes_struct *p, struct svcctl_LockServiceDatabase *r); +WERROR _svcctl_QueryServiceObjectSecurity(pipes_struct *p, struct svcctl_QueryServiceObjectSecurity *r); +WERROR _svcctl_SetServiceObjectSecurity(pipes_struct *p, struct svcctl_SetServiceObjectSecurity *r); +WERROR _svcctl_QueryServiceStatus(pipes_struct *p, struct svcctl_QueryServiceStatus *r); +WERROR _svcctl_SetServiceStatus(pipes_struct *p, struct svcctl_SetServiceStatus *r); +WERROR _svcctl_UnlockServiceDatabase(pipes_struct *p, struct svcctl_UnlockServiceDatabase *r); +WERROR _svcctl_NotifyBootConfigStatus(pipes_struct *p, struct svcctl_NotifyBootConfigStatus *r); +WERROR _svcctl_SCSetServiceBitsW(pipes_struct *p, struct svcctl_SCSetServiceBitsW *r); +WERROR _svcctl_ChangeServiceConfigW(pipes_struct *p, struct svcctl_ChangeServiceConfigW *r); +WERROR _svcctl_CreateServiceW(pipes_struct *p, struct svcctl_CreateServiceW *r); +WERROR _svcctl_EnumDependentServicesW(pipes_struct *p, struct svcctl_EnumDependentServicesW *r); +WERROR _svcctl_EnumServicesStatusW(pipes_struct *p, struct svcctl_EnumServicesStatusW *r); +WERROR _svcctl_OpenSCManagerW(pipes_struct *p, struct svcctl_OpenSCManagerW *r); +WERROR _svcctl_OpenServiceW(pipes_struct *p, struct svcctl_OpenServiceW *r); +WERROR _svcctl_QueryServiceConfigW(pipes_struct *p, struct svcctl_QueryServiceConfigW *r); +WERROR _svcctl_QueryServiceLockStatusW(pipes_struct *p, struct svcctl_QueryServiceLockStatusW *r); +WERROR _svcctl_StartServiceW(pipes_struct *p, struct svcctl_StartServiceW *r); +WERROR _svcctl_GetServiceDisplayNameW(pipes_struct *p, struct svcctl_GetServiceDisplayNameW *r); +WERROR _svcctl_GetServiceKeyNameW(pipes_struct *p, struct svcctl_GetServiceKeyNameW *r); +WERROR _svcctl_SCSetServiceBitsA(pipes_struct *p, struct svcctl_SCSetServiceBitsA *r); +WERROR _svcctl_ChangeServiceConfigA(pipes_struct *p, struct svcctl_ChangeServiceConfigA *r); +WERROR _svcctl_CreateServiceA(pipes_struct *p, struct svcctl_CreateServiceA *r); +WERROR _svcctl_EnumDependentServicesA(pipes_struct *p, struct svcctl_EnumDependentServicesA *r); +WERROR _svcctl_EnumServicesStatusA(pipes_struct *p, struct svcctl_EnumServicesStatusA *r); +WERROR _svcctl_OpenSCManagerA(pipes_struct *p, struct svcctl_OpenSCManagerA *r); +WERROR _svcctl_OpenServiceA(pipes_struct *p, struct svcctl_OpenServiceA *r); +WERROR _svcctl_QueryServiceConfigA(pipes_struct *p, struct svcctl_QueryServiceConfigA *r); +WERROR _svcctl_QueryServiceLockStatusA(pipes_struct *p, struct svcctl_QueryServiceLockStatusA *r); +WERROR _svcctl_StartServiceA(pipes_struct *p, struct svcctl_StartServiceA *r); +WERROR _svcctl_GetServiceDisplayNameA(pipes_struct *p, struct svcctl_GetServiceDisplayNameA *r); +WERROR _svcctl_GetServiceKeyNameA(pipes_struct *p, struct svcctl_GetServiceKeyNameA *r); +WERROR _svcctl_GetCurrentGroupeStateW(pipes_struct *p, struct svcctl_GetCurrentGroupeStateW *r); +WERROR _svcctl_EnumServiceGroupW(pipes_struct *p, struct svcctl_EnumServiceGroupW *r); +WERROR _svcctl_ChangeServiceConfig2A(pipes_struct *p, struct svcctl_ChangeServiceConfig2A *r); +WERROR _svcctl_ChangeServiceConfig2W(pipes_struct *p, struct svcctl_ChangeServiceConfig2W *r); +WERROR _svcctl_QueryServiceConfig2A(pipes_struct *p, struct svcctl_QueryServiceConfig2A *r); +WERROR _svcctl_QueryServiceConfig2W(pipes_struct *p, struct svcctl_QueryServiceConfig2W *r); +WERROR _svcctl_QueryServiceStatusEx(pipes_struct *p, struct svcctl_QueryServiceStatusEx *r); +WERROR _EnumServicesStatusExA(pipes_struct *p, struct EnumServicesStatusExA *r); +WERROR _EnumServicesStatusExW(pipes_struct *p, struct EnumServicesStatusExW *r); +WERROR _svcctl_SCSendTSMessage(pipes_struct *p, struct svcctl_SCSendTSMessage *r); +void svcctl_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_svcctl_init(void); +#endif /* __SRV_SVCCTL__ */ diff --git a/librpc/gen_ndr/srv_winreg.c b/librpc/gen_ndr/srv_winreg.c new file mode 100644 index 0000000000..ac70b41219 --- /dev/null +++ b/librpc/gen_ndr/srv_winreg.c @@ -0,0 +1,2772 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_winreg.h" + +static bool api_winreg_OpenHKCR(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenHKCR *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCR]; + + r = talloc(talloc_tos(), struct winreg_OpenHKCR); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenHKCR(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_OpenHKCU(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenHKCU *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCU]; + + r = talloc(talloc_tos(), struct winreg_OpenHKCU); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenHKCU(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_OpenHKLM(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenHKLM *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKLM]; + + r = talloc(talloc_tos(), struct winreg_OpenHKLM); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenHKLM(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_OpenHKPD(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenHKPD *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPD]; + + r = talloc(talloc_tos(), struct winreg_OpenHKPD); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenHKPD(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_OpenHKU(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenHKU *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKU]; + + r = talloc(talloc_tos(), struct winreg_OpenHKU); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKU, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenHKU(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_CloseKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_CloseKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_CLOSEKEY]; + + r = talloc(talloc_tos(), struct winreg_CloseKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_CloseKey, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = r->in.handle; + r->out.result = _winreg_CloseKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_CloseKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_CreateKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_CreateKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_CREATEKEY]; + + r = talloc(talloc_tos(), struct winreg_CreateKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_CreateKey, r); + } + + ZERO_STRUCT(r->out); + r->out.action_taken = r->in.action_taken; + r->out.new_handle = talloc_zero(r, struct policy_handle); + if (r->out.new_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_CreateKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_CreateKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_DeleteKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_DeleteKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_DELETEKEY]; + + r = talloc(talloc_tos(), struct winreg_DeleteKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_DeleteKey, r); + } + + r->out.result = _winreg_DeleteKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_DeleteValue(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_DeleteValue *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_DELETEVALUE]; + + r = talloc(talloc_tos(), struct winreg_DeleteValue); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_DeleteValue, r); + } + + r->out.result = _winreg_DeleteValue(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_EnumKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_EnumKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_ENUMKEY]; + + r = talloc(talloc_tos(), struct winreg_EnumKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_EnumKey, r); + } + + ZERO_STRUCT(r->out); + r->out.name = r->in.name; + r->out.keyclass = r->in.keyclass; + r->out.last_changed_time = r->in.last_changed_time; + r->out.result = _winreg_EnumKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_EnumKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_EnumValue(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_EnumValue *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_ENUMVALUE]; + + r = talloc(talloc_tos(), struct winreg_EnumValue); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_EnumValue, r); + } + + ZERO_STRUCT(r->out); + r->out.name = r->in.name; + r->out.type = r->in.type; + r->out.value = r->in.value; + r->out.size = r->in.size; + r->out.length = r->in.length; + r->out.result = _winreg_EnumValue(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_EnumValue, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_FlushKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_FlushKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_FLUSHKEY]; + + r = talloc(talloc_tos(), struct winreg_FlushKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_FlushKey, r); + } + + r->out.result = _winreg_FlushKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_FlushKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_GetKeySecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_GetKeySecurity *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_GETKEYSECURITY]; + + r = talloc(talloc_tos(), struct winreg_GetKeySecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, r); + } + + ZERO_STRUCT(r->out); + r->out.sd = r->in.sd; + r->out.result = _winreg_GetKeySecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_LoadKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_LoadKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_LOADKEY]; + + r = talloc(talloc_tos(), struct winreg_LoadKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_LoadKey, r); + } + + r->out.result = _winreg_LoadKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_LoadKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_NotifyChangeKeyValue(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_NotifyChangeKeyValue *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_NOTIFYCHANGEKEYVALUE]; + + r = talloc(talloc_tos(), struct winreg_NotifyChangeKeyValue); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, r); + } + + r->out.result = _winreg_NotifyChangeKeyValue(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_OpenKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENKEY]; + + r = talloc(talloc_tos(), struct winreg_OpenKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenKey, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_QueryInfoKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_QueryInfoKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_QUERYINFOKEY]; + + r = talloc(talloc_tos(), struct winreg_QueryInfoKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, r); + } + + ZERO_STRUCT(r->out); + r->out.classname = r->in.classname; + r->out.num_subkeys = talloc_zero(r, uint32_t); + if (r->out.num_subkeys == NULL) { + talloc_free(r); + return false; + } + + r->out.max_subkeylen = talloc_zero(r, uint32_t); + if (r->out.max_subkeylen == NULL) { + talloc_free(r); + return false; + } + + r->out.max_classlen = talloc_zero(r, uint32_t); + if (r->out.max_classlen == NULL) { + talloc_free(r); + return false; + } + + r->out.num_values = talloc_zero(r, uint32_t); + if (r->out.num_values == NULL) { + talloc_free(r); + return false; + } + + r->out.max_valnamelen = talloc_zero(r, uint32_t); + if (r->out.max_valnamelen == NULL) { + talloc_free(r); + return false; + } + + r->out.max_valbufsize = talloc_zero(r, uint32_t); + if (r->out.max_valbufsize == NULL) { + talloc_free(r); + return false; + } + + r->out.secdescsize = talloc_zero(r, uint32_t); + if (r->out.secdescsize == NULL) { + talloc_free(r); + return false; + } + + r->out.last_changed_time = talloc_zero(r, NTTIME); + if (r->out.last_changed_time == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_QueryInfoKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_QueryValue(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_QueryValue *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_QUERYVALUE]; + + r = talloc(talloc_tos(), struct winreg_QueryValue); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_QueryValue, r); + } + + ZERO_STRUCT(r->out); + r->out.type = r->in.type; + r->out.data = r->in.data; + r->out.data_size = r->in.data_size; + r->out.data_length = r->in.data_length; + r->out.result = _winreg_QueryValue(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_QueryValue, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_ReplaceKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_ReplaceKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_REPLACEKEY]; + + r = talloc(talloc_tos(), struct winreg_ReplaceKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, r); + } + + r->out.result = _winreg_ReplaceKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_RestoreKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_RestoreKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_RESTOREKEY]; + + r = talloc(talloc_tos(), struct winreg_RestoreKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_RestoreKey, r); + } + + r->out.result = _winreg_RestoreKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_SaveKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_SaveKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEY]; + + r = talloc(talloc_tos(), struct winreg_SaveKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_SaveKey, r); + } + + r->out.result = _winreg_SaveKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_SaveKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_SetKeySecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_SetKeySecurity *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_SETKEYSECURITY]; + + r = talloc(talloc_tos(), struct winreg_SetKeySecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, r); + } + + r->out.result = _winreg_SetKeySecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_SetValue(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_SetValue *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_SETVALUE]; + + r = talloc(talloc_tos(), struct winreg_SetValue); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_SetValue, r); + } + + r->out.result = _winreg_SetValue(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_SetValue, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_UnLoadKey(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_UnLoadKey *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_UNLOADKEY]; + + r = talloc(talloc_tos(), struct winreg_UnLoadKey); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, r); + } + + r->out.result = _winreg_UnLoadKey(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_InitiateSystemShutdown(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_InitiateSystemShutdown *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWN]; + + r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdown); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, r); + } + + r->out.result = _winreg_InitiateSystemShutdown(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_AbortSystemShutdown(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_AbortSystemShutdown *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_ABORTSYSTEMSHUTDOWN]; + + r = talloc(talloc_tos(), struct winreg_AbortSystemShutdown); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, r); + } + + r->out.result = _winreg_AbortSystemShutdown(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_GetVersion(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_GetVersion *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_GETVERSION]; + + r = talloc(talloc_tos(), struct winreg_GetVersion); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_GetVersion, r); + } + + ZERO_STRUCT(r->out); + r->out.version = talloc_zero(r, uint32_t); + if (r->out.version == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_GetVersion(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_GetVersion, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_OpenHKCC(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenHKCC *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCC]; + + r = talloc(talloc_tos(), struct winreg_OpenHKCC); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenHKCC(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_OpenHKDD(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenHKDD *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKDD]; + + r = talloc(talloc_tos(), struct winreg_OpenHKDD); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenHKDD(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_QueryMultipleValues(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_QueryMultipleValues *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES]; + + r = talloc(talloc_tos(), struct winreg_QueryMultipleValues); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, r); + } + + ZERO_STRUCT(r->out); + r->out.values = r->in.values; + r->out.buffer = r->in.buffer; + r->out.buffer_size = r->in.buffer_size; + r->out.result = _winreg_QueryMultipleValues(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_InitiateSystemShutdownEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_InitiateSystemShutdownEx *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWNEX]; + + r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdownEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, r); + } + + r->out.result = _winreg_InitiateSystemShutdownEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_SaveKeyEx(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_SaveKeyEx *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEYEX]; + + r = talloc(talloc_tos(), struct winreg_SaveKeyEx); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, r); + } + + r->out.result = _winreg_SaveKeyEx(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_OpenHKPT(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenHKPT *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPT]; + + r = talloc(talloc_tos(), struct winreg_OpenHKPT); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenHKPT(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_OpenHKPN(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_OpenHKPN *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPN]; + + r = talloc(talloc_tos(), struct winreg_OpenHKPN); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = talloc_zero(r, struct policy_handle); + if (r->out.handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _winreg_OpenHKPN(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_winreg_QueryMultipleValues2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct winreg_QueryMultipleValues2 *r; + + call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES2]; + + r = talloc(talloc_tos(), struct winreg_QueryMultipleValues2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, r); + } + + r->out.result = _winreg_QueryMultipleValues2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_winreg_cmds[] = +{ + {"WINREG_OPENHKCR", NDR_WINREG_OPENHKCR, api_winreg_OpenHKCR}, + {"WINREG_OPENHKCU", NDR_WINREG_OPENHKCU, api_winreg_OpenHKCU}, + {"WINREG_OPENHKLM", NDR_WINREG_OPENHKLM, api_winreg_OpenHKLM}, + {"WINREG_OPENHKPD", NDR_WINREG_OPENHKPD, api_winreg_OpenHKPD}, + {"WINREG_OPENHKU", NDR_WINREG_OPENHKU, api_winreg_OpenHKU}, + {"WINREG_CLOSEKEY", NDR_WINREG_CLOSEKEY, api_winreg_CloseKey}, + {"WINREG_CREATEKEY", NDR_WINREG_CREATEKEY, api_winreg_CreateKey}, + {"WINREG_DELETEKEY", NDR_WINREG_DELETEKEY, api_winreg_DeleteKey}, + {"WINREG_DELETEVALUE", NDR_WINREG_DELETEVALUE, api_winreg_DeleteValue}, + {"WINREG_ENUMKEY", NDR_WINREG_ENUMKEY, api_winreg_EnumKey}, + {"WINREG_ENUMVALUE", NDR_WINREG_ENUMVALUE, api_winreg_EnumValue}, + {"WINREG_FLUSHKEY", NDR_WINREG_FLUSHKEY, api_winreg_FlushKey}, + {"WINREG_GETKEYSECURITY", NDR_WINREG_GETKEYSECURITY, api_winreg_GetKeySecurity}, + {"WINREG_LOADKEY", NDR_WINREG_LOADKEY, api_winreg_LoadKey}, + {"WINREG_NOTIFYCHANGEKEYVALUE", NDR_WINREG_NOTIFYCHANGEKEYVALUE, api_winreg_NotifyChangeKeyValue}, + {"WINREG_OPENKEY", NDR_WINREG_OPENKEY, api_winreg_OpenKey}, + {"WINREG_QUERYINFOKEY", NDR_WINREG_QUERYINFOKEY, api_winreg_QueryInfoKey}, + {"WINREG_QUERYVALUE", NDR_WINREG_QUERYVALUE, api_winreg_QueryValue}, + {"WINREG_REPLACEKEY", NDR_WINREG_REPLACEKEY, api_winreg_ReplaceKey}, + {"WINREG_RESTOREKEY", NDR_WINREG_RESTOREKEY, api_winreg_RestoreKey}, + {"WINREG_SAVEKEY", NDR_WINREG_SAVEKEY, api_winreg_SaveKey}, + {"WINREG_SETKEYSECURITY", NDR_WINREG_SETKEYSECURITY, api_winreg_SetKeySecurity}, + {"WINREG_SETVALUE", NDR_WINREG_SETVALUE, api_winreg_SetValue}, + {"WINREG_UNLOADKEY", NDR_WINREG_UNLOADKEY, api_winreg_UnLoadKey}, + {"WINREG_INITIATESYSTEMSHUTDOWN", NDR_WINREG_INITIATESYSTEMSHUTDOWN, api_winreg_InitiateSystemShutdown}, + {"WINREG_ABORTSYSTEMSHUTDOWN", NDR_WINREG_ABORTSYSTEMSHUTDOWN, api_winreg_AbortSystemShutdown}, + {"WINREG_GETVERSION", NDR_WINREG_GETVERSION, api_winreg_GetVersion}, + {"WINREG_OPENHKCC", NDR_WINREG_OPENHKCC, api_winreg_OpenHKCC}, + {"WINREG_OPENHKDD", NDR_WINREG_OPENHKDD, api_winreg_OpenHKDD}, + {"WINREG_QUERYMULTIPLEVALUES", NDR_WINREG_QUERYMULTIPLEVALUES, api_winreg_QueryMultipleValues}, + {"WINREG_INITIATESYSTEMSHUTDOWNEX", NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, api_winreg_InitiateSystemShutdownEx}, + {"WINREG_SAVEKEYEX", NDR_WINREG_SAVEKEYEX, api_winreg_SaveKeyEx}, + {"WINREG_OPENHKPT", NDR_WINREG_OPENHKPT, api_winreg_OpenHKPT}, + {"WINREG_OPENHKPN", NDR_WINREG_OPENHKPN, api_winreg_OpenHKPN}, + {"WINREG_QUERYMULTIPLEVALUES2", NDR_WINREG_QUERYMULTIPLEVALUES2, api_winreg_QueryMultipleValues2}, +}; + +void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_winreg_cmds; + *n_fns = sizeof(api_winreg_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_winreg_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "winreg", "winreg", &ndr_table_winreg.syntax_id, api_winreg_cmds, sizeof(api_winreg_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_winreg.h b/librpc/gen_ndr/srv_winreg.h new file mode 100644 index 0000000000..decfb2589d --- /dev/null +++ b/librpc/gen_ndr/srv_winreg.h @@ -0,0 +1,41 @@ +#include "librpc/gen_ndr/ndr_winreg.h" +#ifndef __SRV_WINREG__ +#define __SRV_WINREG__ +WERROR _winreg_OpenHKCR(pipes_struct *p, struct winreg_OpenHKCR *r); +WERROR _winreg_OpenHKCU(pipes_struct *p, struct winreg_OpenHKCU *r); +WERROR _winreg_OpenHKLM(pipes_struct *p, struct winreg_OpenHKLM *r); +WERROR _winreg_OpenHKPD(pipes_struct *p, struct winreg_OpenHKPD *r); +WERROR _winreg_OpenHKU(pipes_struct *p, struct winreg_OpenHKU *r); +WERROR _winreg_CloseKey(pipes_struct *p, struct winreg_CloseKey *r); +WERROR _winreg_CreateKey(pipes_struct *p, struct winreg_CreateKey *r); +WERROR _winreg_DeleteKey(pipes_struct *p, struct winreg_DeleteKey *r); +WERROR _winreg_DeleteValue(pipes_struct *p, struct winreg_DeleteValue *r); +WERROR _winreg_EnumKey(pipes_struct *p, struct winreg_EnumKey *r); +WERROR _winreg_EnumValue(pipes_struct *p, struct winreg_EnumValue *r); +WERROR _winreg_FlushKey(pipes_struct *p, struct winreg_FlushKey *r); +WERROR _winreg_GetKeySecurity(pipes_struct *p, struct winreg_GetKeySecurity *r); +WERROR _winreg_LoadKey(pipes_struct *p, struct winreg_LoadKey *r); +WERROR _winreg_NotifyChangeKeyValue(pipes_struct *p, struct winreg_NotifyChangeKeyValue *r); +WERROR _winreg_OpenKey(pipes_struct *p, struct winreg_OpenKey *r); +WERROR _winreg_QueryInfoKey(pipes_struct *p, struct winreg_QueryInfoKey *r); +WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r); +WERROR _winreg_ReplaceKey(pipes_struct *p, struct winreg_ReplaceKey *r); +WERROR _winreg_RestoreKey(pipes_struct *p, struct winreg_RestoreKey *r); +WERROR _winreg_SaveKey(pipes_struct *p, struct winreg_SaveKey *r); +WERROR _winreg_SetKeySecurity(pipes_struct *p, struct winreg_SetKeySecurity *r); +WERROR _winreg_SetValue(pipes_struct *p, struct winreg_SetValue *r); +WERROR _winreg_UnLoadKey(pipes_struct *p, struct winreg_UnLoadKey *r); +WERROR _winreg_InitiateSystemShutdown(pipes_struct *p, struct winreg_InitiateSystemShutdown *r); +WERROR _winreg_AbortSystemShutdown(pipes_struct *p, struct winreg_AbortSystemShutdown *r); +WERROR _winreg_GetVersion(pipes_struct *p, struct winreg_GetVersion *r); +WERROR _winreg_OpenHKCC(pipes_struct *p, struct winreg_OpenHKCC *r); +WERROR _winreg_OpenHKDD(pipes_struct *p, struct winreg_OpenHKDD *r); +WERROR _winreg_QueryMultipleValues(pipes_struct *p, struct winreg_QueryMultipleValues *r); +WERROR _winreg_InitiateSystemShutdownEx(pipes_struct *p, struct winreg_InitiateSystemShutdownEx *r); +WERROR _winreg_SaveKeyEx(pipes_struct *p, struct winreg_SaveKeyEx *r); +WERROR _winreg_OpenHKPT(pipes_struct *p, struct winreg_OpenHKPT *r); +WERROR _winreg_OpenHKPN(pipes_struct *p, struct winreg_OpenHKPN *r); +WERROR _winreg_QueryMultipleValues2(pipes_struct *p, struct winreg_QueryMultipleValues2 *r); +void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_winreg_init(void); +#endif /* __SRV_WINREG__ */ diff --git a/librpc/gen_ndr/srv_wkssvc.c b/librpc/gen_ndr/srv_wkssvc.c new file mode 100644 index 0000000000..61a5be081f --- /dev/null +++ b/librpc/gen_ndr/srv_wkssvc.c @@ -0,0 +1,2412 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_wkssvc.h" + +static bool api_wkssvc_NetWkstaGetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetWkstaGetInfo *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTAGETINFO]; + + r = talloc(talloc_tos(), struct wkssvc_NetWkstaGetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union wkssvc_NetWkstaInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetWkstaGetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetWkstaSetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetWkstaSetInfo *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTASETINFO]; + + r = talloc(talloc_tos(), struct wkssvc_NetWkstaSetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.parm_error = r->in.parm_error; + r->out.result = _wkssvc_NetWkstaSetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetWkstaEnumUsers(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetWkstaEnumUsers *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTAENUMUSERS]; + + r = talloc(talloc_tos(), struct wkssvc_NetWkstaEnumUsers); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, r); + } + + ZERO_STRUCT(r->out); + r->out.info = r->in.info; + r->out.resume_handle = r->in.resume_handle; + r->out.entries_read = talloc_zero(r, uint32_t); + if (r->out.entries_read == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetWkstaEnumUsers(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrWkstaUserGetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrWkstaUserGetInfo *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTAUSERGETINFO]; + + r = talloc(talloc_tos(), struct wkssvc_NetrWkstaUserGetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union wkssvc_NetrWkstaUserInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetrWkstaUserGetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrWkstaUserSetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrWkstaUserSetInfo *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTAUSERSETINFO]; + + r = talloc(talloc_tos(), struct wkssvc_NetrWkstaUserSetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.parm_err = r->in.parm_err; + r->out.result = _wkssvc_NetrWkstaUserSetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetWkstaTransportEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetWkstaTransportEnum *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTATRANSPORTENUM]; + + r = talloc(talloc_tos(), struct wkssvc_NetWkstaTransportEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.info = r->in.info; + r->out.resume_handle = r->in.resume_handle; + r->out.total_entries = talloc_zero(r, uint32_t); + if (r->out.total_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetWkstaTransportEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrWkstaTransportAdd(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrWkstaTransportAdd *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTATRANSPORTADD]; + + r = talloc(talloc_tos(), struct wkssvc_NetrWkstaTransportAdd); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, r); + } + + ZERO_STRUCT(r->out); + r->out.parm_err = r->in.parm_err; + r->out.result = _wkssvc_NetrWkstaTransportAdd(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrWkstaTransportDel(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrWkstaTransportDel *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTATRANSPORTDEL]; + + r = talloc(talloc_tos(), struct wkssvc_NetrWkstaTransportDel); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, r); + } + + r->out.result = _wkssvc_NetrWkstaTransportDel(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrUseAdd(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrUseAdd *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEADD]; + + r = talloc(talloc_tos(), struct wkssvc_NetrUseAdd); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, r); + } + + ZERO_STRUCT(r->out); + r->out.parm_err = r->in.parm_err; + r->out.result = _wkssvc_NetrUseAdd(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrUseGetInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrUseGetInfo *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEGETINFO]; + + r = talloc(talloc_tos(), struct wkssvc_NetrUseGetInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.ctr = talloc_zero(r, union wkssvc_NetrUseGetInfoCtr); + if (r->out.ctr == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetrUseGetInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrUseDel(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrUseDel *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEDEL]; + + r = talloc(talloc_tos(), struct wkssvc_NetrUseDel); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, r); + } + + r->out.result = _wkssvc_NetrUseDel(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrUseEnum(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrUseEnum *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEENUM]; + + r = talloc(talloc_tos(), struct wkssvc_NetrUseEnum); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, r); + } + + ZERO_STRUCT(r->out); + r->out.info = r->in.info; + r->out.resume_handle = r->in.resume_handle; + r->out.entries_read = talloc_zero(r, uint32_t); + if (r->out.entries_read == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetrUseEnum(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrMessageBufferSend(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrMessageBufferSend *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRMESSAGEBUFFERSEND]; + + r = talloc(talloc_tos(), struct wkssvc_NetrMessageBufferSend); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, r); + } + + r->out.result = _wkssvc_NetrMessageBufferSend(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrWorkstationStatisticsGet(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrWorkstationStatisticsGet *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET]; + + r = talloc(talloc_tos(), struct wkssvc_NetrWorkstationStatisticsGet); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct wkssvc_NetrWorkstationStatistics *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetrWorkstationStatisticsGet(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrLogonDomainNameAdd(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrLogonDomainNameAdd *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRLOGONDOMAINNAMEADD]; + + r = talloc(talloc_tos(), struct wkssvc_NetrLogonDomainNameAdd); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, r); + } + + r->out.result = _wkssvc_NetrLogonDomainNameAdd(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrLogonDomainNameDel(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrLogonDomainNameDel *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL]; + + r = talloc(talloc_tos(), struct wkssvc_NetrLogonDomainNameDel); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, r); + } + + r->out.result = _wkssvc_NetrLogonDomainNameDel(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrJoinDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrJoinDomain *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRJOINDOMAIN]; + + r = talloc(talloc_tos(), struct wkssvc_NetrJoinDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, r); + } + + r->out.result = _wkssvc_NetrJoinDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrUnjoinDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrUnjoinDomain *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUNJOINDOMAIN]; + + r = talloc(talloc_tos(), struct wkssvc_NetrUnjoinDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, r); + } + + r->out.result = _wkssvc_NetrUnjoinDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrRenameMachineInDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrRenameMachineInDomain *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN]; + + r = talloc(talloc_tos(), struct wkssvc_NetrRenameMachineInDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, r); + } + + r->out.result = _wkssvc_NetrRenameMachineInDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrValidateName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrValidateName *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRVALIDATENAME]; + + r = talloc(talloc_tos(), struct wkssvc_NetrValidateName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, r); + } + + r->out.result = _wkssvc_NetrValidateName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrGetJoinInformation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrGetJoinInformation *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOININFORMATION]; + + r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinInformation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.name_buffer = r->in.name_buffer; + r->out.name_type = talloc_zero(r, enum wkssvc_NetJoinStatus); + if (r->out.name_type == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetrGetJoinInformation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrGetJoinableOus(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrGetJoinableOus *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOINABLEOUS]; + + r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinableOus); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, r); + } + + ZERO_STRUCT(r->out); + r->out.num_ous = r->in.num_ous; + r->out.ous = talloc_zero(r, const char **); + if (r->out.ous == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetrGetJoinableOus(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrJoinDomain2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrJoinDomain2 *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRJOINDOMAIN2]; + + r = talloc(talloc_tos(), struct wkssvc_NetrJoinDomain2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, r); + } + + r->out.result = _wkssvc_NetrJoinDomain2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrUnjoinDomain2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrUnjoinDomain2 *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUNJOINDOMAIN2]; + + r = talloc(talloc_tos(), struct wkssvc_NetrUnjoinDomain2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, r); + } + + r->out.result = _wkssvc_NetrUnjoinDomain2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrRenameMachineInDomain2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrRenameMachineInDomain2 *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2]; + + r = talloc(talloc_tos(), struct wkssvc_NetrRenameMachineInDomain2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, r); + } + + r->out.result = _wkssvc_NetrRenameMachineInDomain2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrValidateName2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrValidateName2 *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRVALIDATENAME2]; + + r = talloc(talloc_tos(), struct wkssvc_NetrValidateName2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, r); + } + + r->out.result = _wkssvc_NetrValidateName2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrGetJoinableOus2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrGetJoinableOus2 *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOINABLEOUS2]; + + r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinableOus2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, r); + } + + ZERO_STRUCT(r->out); + r->out.num_ous = r->in.num_ous; + r->out.ous = talloc_zero(r, const char **); + if (r->out.ous == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetrGetJoinableOus2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrAddAlternateComputerName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrAddAlternateComputerName *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME]; + + r = talloc(talloc_tos(), struct wkssvc_NetrAddAlternateComputerName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, r); + } + + r->out.result = _wkssvc_NetrAddAlternateComputerName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrRemoveAlternateComputerName *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME]; + + r = talloc(talloc_tos(), struct wkssvc_NetrRemoveAlternateComputerName); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, r); + } + + r->out.result = _wkssvc_NetrRemoveAlternateComputerName(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrSetPrimaryComputername(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrSetPrimaryComputername *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME]; + + r = talloc(talloc_tos(), struct wkssvc_NetrSetPrimaryComputername); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, r); + } + + r->out.result = _wkssvc_NetrSetPrimaryComputername(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_wkssvc_NetrEnumerateComputerNames(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct wkssvc_NetrEnumerateComputerNames *r; + + call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES]; + + r = talloc(talloc_tos(), struct wkssvc_NetrEnumerateComputerNames); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r, NULL); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, r); + } + + ZERO_STRUCT(r->out); + r->out.ctr = talloc_zero(r, struct wkssvc_ComputerNamesCtr *); + if (r->out.ctr == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wkssvc_NetrEnumerateComputerNames(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, r); + } + + push = ndr_push_init_ctx(r, NULL); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_wkssvc_cmds[] = +{ + {"WKSSVC_NETWKSTAGETINFO", NDR_WKSSVC_NETWKSTAGETINFO, api_wkssvc_NetWkstaGetInfo}, + {"WKSSVC_NETWKSTASETINFO", NDR_WKSSVC_NETWKSTASETINFO, api_wkssvc_NetWkstaSetInfo}, + {"WKSSVC_NETWKSTAENUMUSERS", NDR_WKSSVC_NETWKSTAENUMUSERS, api_wkssvc_NetWkstaEnumUsers}, + {"WKSSVC_NETRWKSTAUSERGETINFO", NDR_WKSSVC_NETRWKSTAUSERGETINFO, api_wkssvc_NetrWkstaUserGetInfo}, + {"WKSSVC_NETRWKSTAUSERSETINFO", NDR_WKSSVC_NETRWKSTAUSERSETINFO, api_wkssvc_NetrWkstaUserSetInfo}, + {"WKSSVC_NETWKSTATRANSPORTENUM", NDR_WKSSVC_NETWKSTATRANSPORTENUM, api_wkssvc_NetWkstaTransportEnum}, + {"WKSSVC_NETRWKSTATRANSPORTADD", NDR_WKSSVC_NETRWKSTATRANSPORTADD, api_wkssvc_NetrWkstaTransportAdd}, + {"WKSSVC_NETRWKSTATRANSPORTDEL", NDR_WKSSVC_NETRWKSTATRANSPORTDEL, api_wkssvc_NetrWkstaTransportDel}, + {"WKSSVC_NETRUSEADD", NDR_WKSSVC_NETRUSEADD, api_wkssvc_NetrUseAdd}, + {"WKSSVC_NETRUSEGETINFO", NDR_WKSSVC_NETRUSEGETINFO, api_wkssvc_NetrUseGetInfo}, + {"WKSSVC_NETRUSEDEL", NDR_WKSSVC_NETRUSEDEL, api_wkssvc_NetrUseDel}, + {"WKSSVC_NETRUSEENUM", NDR_WKSSVC_NETRUSEENUM, api_wkssvc_NetrUseEnum}, + {"WKSSVC_NETRMESSAGEBUFFERSEND", NDR_WKSSVC_NETRMESSAGEBUFFERSEND, api_wkssvc_NetrMessageBufferSend}, + {"WKSSVC_NETRWORKSTATIONSTATISTICSGET", NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET, api_wkssvc_NetrWorkstationStatisticsGet}, + {"WKSSVC_NETRLOGONDOMAINNAMEADD", NDR_WKSSVC_NETRLOGONDOMAINNAMEADD, api_wkssvc_NetrLogonDomainNameAdd}, + {"WKSSVC_NETRLOGONDOMAINNAMEDEL", NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL, api_wkssvc_NetrLogonDomainNameDel}, + {"WKSSVC_NETRJOINDOMAIN", NDR_WKSSVC_NETRJOINDOMAIN, api_wkssvc_NetrJoinDomain}, + {"WKSSVC_NETRUNJOINDOMAIN", NDR_WKSSVC_NETRUNJOINDOMAIN, api_wkssvc_NetrUnjoinDomain}, + {"WKSSVC_NETRRENAMEMACHINEINDOMAIN", NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN, api_wkssvc_NetrRenameMachineInDomain}, + {"WKSSVC_NETRVALIDATENAME", NDR_WKSSVC_NETRVALIDATENAME, api_wkssvc_NetrValidateName}, + {"WKSSVC_NETRGETJOININFORMATION", NDR_WKSSVC_NETRGETJOININFORMATION, api_wkssvc_NetrGetJoinInformation}, + {"WKSSVC_NETRGETJOINABLEOUS", NDR_WKSSVC_NETRGETJOINABLEOUS, api_wkssvc_NetrGetJoinableOus}, + {"WKSSVC_NETRJOINDOMAIN2", NDR_WKSSVC_NETRJOINDOMAIN2, api_wkssvc_NetrJoinDomain2}, + {"WKSSVC_NETRUNJOINDOMAIN2", NDR_WKSSVC_NETRUNJOINDOMAIN2, api_wkssvc_NetrUnjoinDomain2}, + {"WKSSVC_NETRRENAMEMACHINEINDOMAIN2", NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2, api_wkssvc_NetrRenameMachineInDomain2}, + {"WKSSVC_NETRVALIDATENAME2", NDR_WKSSVC_NETRVALIDATENAME2, api_wkssvc_NetrValidateName2}, + {"WKSSVC_NETRGETJOINABLEOUS2", NDR_WKSSVC_NETRGETJOINABLEOUS2, api_wkssvc_NetrGetJoinableOus2}, + {"WKSSVC_NETRADDALTERNATECOMPUTERNAME", NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME, api_wkssvc_NetrAddAlternateComputerName}, + {"WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME", NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME, api_wkssvc_NetrRemoveAlternateComputerName}, + {"WKSSVC_NETRSETPRIMARYCOMPUTERNAME", NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME, api_wkssvc_NetrSetPrimaryComputername}, + {"WKSSVC_NETRENUMERATECOMPUTERNAMES", NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES, api_wkssvc_NetrEnumerateComputerNames}, +}; + +void wkssvc_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_wkssvc_cmds; + *n_fns = sizeof(api_wkssvc_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_wkssvc_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "wkssvc", "wkssvc", &ndr_table_wkssvc.syntax_id, api_wkssvc_cmds, sizeof(api_wkssvc_cmds) / sizeof(struct api_struct)); +} diff --git a/librpc/gen_ndr/srv_wkssvc.h b/librpc/gen_ndr/srv_wkssvc.h new file mode 100644 index 0000000000..f1d0b94c26 --- /dev/null +++ b/librpc/gen_ndr/srv_wkssvc.h @@ -0,0 +1,37 @@ +#include "librpc/gen_ndr/ndr_wkssvc.h" +#ifndef __SRV_WKSSVC__ +#define __SRV_WKSSVC__ +WERROR _wkssvc_NetWkstaGetInfo(pipes_struct *p, struct wkssvc_NetWkstaGetInfo *r); +WERROR _wkssvc_NetWkstaSetInfo(pipes_struct *p, struct wkssvc_NetWkstaSetInfo *r); +WERROR _wkssvc_NetWkstaEnumUsers(pipes_struct *p, struct wkssvc_NetWkstaEnumUsers *r); +WERROR _wkssvc_NetrWkstaUserGetInfo(pipes_struct *p, struct wkssvc_NetrWkstaUserGetInfo *r); +WERROR _wkssvc_NetrWkstaUserSetInfo(pipes_struct *p, struct wkssvc_NetrWkstaUserSetInfo *r); +WERROR _wkssvc_NetWkstaTransportEnum(pipes_struct *p, struct wkssvc_NetWkstaTransportEnum *r); +WERROR _wkssvc_NetrWkstaTransportAdd(pipes_struct *p, struct wkssvc_NetrWkstaTransportAdd *r); +WERROR _wkssvc_NetrWkstaTransportDel(pipes_struct *p, struct wkssvc_NetrWkstaTransportDel *r); +WERROR _wkssvc_NetrUseAdd(pipes_struct *p, struct wkssvc_NetrUseAdd *r); +WERROR _wkssvc_NetrUseGetInfo(pipes_struct *p, struct wkssvc_NetrUseGetInfo *r); +WERROR _wkssvc_NetrUseDel(pipes_struct *p, struct wkssvc_NetrUseDel *r); +WERROR _wkssvc_NetrUseEnum(pipes_struct *p, struct wkssvc_NetrUseEnum *r); +WERROR _wkssvc_NetrMessageBufferSend(pipes_struct *p, struct wkssvc_NetrMessageBufferSend *r); +WERROR _wkssvc_NetrWorkstationStatisticsGet(pipes_struct *p, struct wkssvc_NetrWorkstationStatisticsGet *r); +WERROR _wkssvc_NetrLogonDomainNameAdd(pipes_struct *p, struct wkssvc_NetrLogonDomainNameAdd *r); +WERROR _wkssvc_NetrLogonDomainNameDel(pipes_struct *p, struct wkssvc_NetrLogonDomainNameDel *r); +WERROR _wkssvc_NetrJoinDomain(pipes_struct *p, struct wkssvc_NetrJoinDomain *r); +WERROR _wkssvc_NetrUnjoinDomain(pipes_struct *p, struct wkssvc_NetrUnjoinDomain *r); +WERROR _wkssvc_NetrRenameMachineInDomain(pipes_struct *p, struct wkssvc_NetrRenameMachineInDomain *r); +WERROR _wkssvc_NetrValidateName(pipes_struct *p, struct wkssvc_NetrValidateName *r); +WERROR _wkssvc_NetrGetJoinInformation(pipes_struct *p, struct wkssvc_NetrGetJoinInformation *r); +WERROR _wkssvc_NetrGetJoinableOus(pipes_struct *p, struct wkssvc_NetrGetJoinableOus *r); +WERROR _wkssvc_NetrJoinDomain2(pipes_struct *p, struct wkssvc_NetrJoinDomain2 *r); +WERROR _wkssvc_NetrUnjoinDomain2(pipes_struct *p, struct wkssvc_NetrUnjoinDomain2 *r); +WERROR _wkssvc_NetrRenameMachineInDomain2(pipes_struct *p, struct wkssvc_NetrRenameMachineInDomain2 *r); +WERROR _wkssvc_NetrValidateName2(pipes_struct *p, struct wkssvc_NetrValidateName2 *r); +WERROR _wkssvc_NetrGetJoinableOus2(pipes_struct *p, struct wkssvc_NetrGetJoinableOus2 *r); +WERROR _wkssvc_NetrAddAlternateComputerName(pipes_struct *p, struct wkssvc_NetrAddAlternateComputerName *r); +WERROR _wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p, struct wkssvc_NetrRemoveAlternateComputerName *r); +WERROR _wkssvc_NetrSetPrimaryComputername(pipes_struct *p, struct wkssvc_NetrSetPrimaryComputername *r); +WERROR _wkssvc_NetrEnumerateComputerNames(pipes_struct *p, struct wkssvc_NetrEnumerateComputerNames *r); +void wkssvc_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_wkssvc_init(void); +#endif /* __SRV_WKSSVC__ */ diff --git a/librpc/gen_ndr/srvsvc.h b/librpc/gen_ndr/srvsvc.h new file mode 100644 index 0000000000..6467f72a5b --- /dev/null +++ b/librpc/gen_ndr/srvsvc.h @@ -0,0 +1,1806 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/security.h" +#include "librpc/gen_ndr/svcctl.h" +#ifndef _HEADER_srvsvc +#define _HEADER_srvsvc + +#define STYPE_TEMPORARY ( 0x40000000 ) +#define STYPE_HIDDEN ( 0x80000000 ) +#define SHARE_1005_CSC_POLICY_MASK ( 0x00000030 ) +#define SHARE_1005_CSC_POLICY_SHIFT ( 4 ) +struct srvsvc_NetCharDevInfo0 { + const char *device;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetCharDevCtr0 { + uint32_t count; + struct srvsvc_NetCharDevInfo0 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetCharDevInfo1 { + const char *device;/* [unique,charset(UTF16)] */ + uint32_t status; + const char *user;/* [unique,charset(UTF16)] */ + uint32_t time; +}; + +struct srvsvc_NetCharDevCtr1 { + uint32_t count; + struct srvsvc_NetCharDevInfo1 *array;/* [unique,size_is(count)] */ +}; + +union srvsvc_NetCharDevInfo { + struct srvsvc_NetCharDevInfo0 *info0;/* [unique,case(0)] */ + struct srvsvc_NetCharDevInfo1 *info1;/* [unique,case] */ +}; + +union srvsvc_NetCharDevCtr { + struct srvsvc_NetCharDevCtr0 *ctr0;/* [unique,case(0)] */ + struct srvsvc_NetCharDevCtr1 *ctr1;/* [unique,case] */ +}; + +struct srvsvc_NetCharDevInfoCtr { + uint32_t level; + union srvsvc_NetCharDevCtr ctr;/* [switch_is(level)] */ +}; + +struct srvsvc_NetCharDevQInfo0 { + const char *device;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetCharDevQCtr0 { + uint32_t count; + struct srvsvc_NetCharDevQInfo0 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetCharDevQInfo1 { + const char *device;/* [unique,charset(UTF16)] */ + uint32_t priority; + const char *devices;/* [unique,charset(UTF16)] */ + uint32_t users; + uint32_t num_ahead; +}; + +struct srvsvc_NetCharDevQCtr1 { + uint32_t count; + struct srvsvc_NetCharDevQInfo1 *array;/* [unique,size_is(count)] */ +}; + +union srvsvc_NetCharDevQInfo { + struct srvsvc_NetCharDevQInfo0 *info0;/* [unique,case(0)] */ + struct srvsvc_NetCharDevQInfo1 *info1;/* [unique,case] */ +}; + +union srvsvc_NetCharDevQCtr { + struct srvsvc_NetCharDevQCtr0 *ctr0;/* [unique,case(0)] */ + struct srvsvc_NetCharDevQCtr1 *ctr1;/* [unique,case] */ +}; + +struct srvsvc_NetCharDevQInfoCtr { + uint32_t level; + union srvsvc_NetCharDevQCtr ctr;/* [switch_is(level)] */ +}; + +struct srvsvc_NetConnInfo0 { + uint32_t conn_id; +}; + +struct srvsvc_NetConnCtr0 { + uint32_t count; + struct srvsvc_NetConnInfo0 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetConnInfo1 { + uint32_t conn_id; + uint32_t conn_type; + uint32_t num_open; + uint32_t num_users; + uint32_t conn_time; + const char *user;/* [unique,charset(UTF16)] */ + const char *share;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetConnCtr1 { + uint32_t count; + struct srvsvc_NetConnInfo1 *array;/* [unique,size_is(count)] */ +}; + +union srvsvc_NetConnCtr { + struct srvsvc_NetConnCtr0 *ctr0;/* [unique,case(0)] */ + struct srvsvc_NetConnCtr1 *ctr1;/* [unique,case] */ +}; + +struct srvsvc_NetConnInfoCtr { + uint32_t level; + union srvsvc_NetConnCtr ctr;/* [switch_is(level)] */ +}; + +struct srvsvc_NetFileInfo2 { + uint32_t fid; +}; + +struct srvsvc_NetFileCtr2 { + uint32_t count; + struct srvsvc_NetFileInfo2 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetFileInfo3 { + uint32_t fid; + uint32_t permissions; + uint32_t num_locks; + const char *path;/* [unique,charset(UTF16)] */ + const char *user;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetFileCtr3 { + uint32_t count; + struct srvsvc_NetFileInfo3 *array;/* [unique,size_is(count)] */ +}; + +union srvsvc_NetFileInfo { + struct srvsvc_NetFileInfo2 *info2;/* [unique,case(2)] */ + struct srvsvc_NetFileInfo3 *info3;/* [unique,case(3)] */ +}; + +union srvsvc_NetFileCtr { + struct srvsvc_NetFileCtr2 *ctr2;/* [unique,case(2)] */ + struct srvsvc_NetFileCtr3 *ctr3;/* [unique,case(3)] */ +}; + +struct srvsvc_NetFileInfoCtr { + uint32_t level; + union srvsvc_NetFileCtr ctr;/* [switch_is(level)] */ +}; + +struct srvsvc_NetSessInfo0 { + const char *client;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetSessCtr0 { + uint32_t count; + struct srvsvc_NetSessInfo0 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetSessInfo1 { + const char *client;/* [unique,charset(UTF16)] */ + const char *user;/* [unique,charset(UTF16)] */ + uint32_t num_open; + uint32_t time; + uint32_t idle_time; + uint32_t user_flags; +}; + +struct srvsvc_NetSessCtr1 { + uint32_t count; + struct srvsvc_NetSessInfo1 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetSessInfo2 { + const char *client;/* [unique,charset(UTF16)] */ + const char *user;/* [unique,charset(UTF16)] */ + uint32_t num_open; + uint32_t time; + uint32_t idle_time; + uint32_t user_flags; + const char *client_type;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetSessCtr2 { + uint32_t count; + struct srvsvc_NetSessInfo2 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetSessInfo10 { + const char *client;/* [unique,charset(UTF16)] */ + const char *user;/* [unique,charset(UTF16)] */ + uint32_t time; + uint32_t idle_time; +}; + +struct srvsvc_NetSessCtr10 { + uint32_t count; + struct srvsvc_NetSessInfo10 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetSessInfo502 { + const char *client;/* [unique,charset(UTF16)] */ + const char *user;/* [unique,charset(UTF16)] */ + uint32_t num_open; + uint32_t time; + uint32_t idle_time; + uint32_t user_flags; + const char *client_type;/* [unique,charset(UTF16)] */ + const char *transport;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetSessCtr502 { + uint32_t count; + struct srvsvc_NetSessInfo502 *array;/* [unique,size_is(count)] */ +}; + +union srvsvc_NetSessCtr { + struct srvsvc_NetSessCtr0 *ctr0;/* [unique,case(0)] */ + struct srvsvc_NetSessCtr1 *ctr1;/* [unique,case] */ + struct srvsvc_NetSessCtr2 *ctr2;/* [unique,case(2)] */ + struct srvsvc_NetSessCtr10 *ctr10;/* [unique,case(10)] */ + struct srvsvc_NetSessCtr502 *ctr502;/* [unique,case(502)] */ +}; + +struct srvsvc_NetSessInfoCtr { + uint32_t level; + union srvsvc_NetSessCtr ctr;/* [switch_is(level)] */ +}; + +enum srvsvc_ShareType +#ifndef USE_UINT_ENUMS + { + STYPE_DISKTREE=0, + STYPE_DISKTREE_TEMPORARY=STYPE_DISKTREE|STYPE_TEMPORARY, + STYPE_DISKTREE_HIDDEN=STYPE_DISKTREE|STYPE_HIDDEN, + STYPE_PRINTQ=1, + STYPE_PRINTQ_TEMPORARY=STYPE_PRINTQ|STYPE_TEMPORARY, + STYPE_PRINTQ_HIDDEN=STYPE_PRINTQ|STYPE_HIDDEN, + STYPE_DEVICE=2, + STYPE_DEVICE_TEMPORARY=STYPE_DEVICE|STYPE_TEMPORARY, + STYPE_DEVICE_HIDDEN=STYPE_DEVICE|STYPE_HIDDEN, + STYPE_IPC=3, + STYPE_IPC_TEMPORARY=STYPE_IPC|STYPE_TEMPORARY, + STYPE_IPC_HIDDEN=STYPE_IPC|STYPE_HIDDEN +} +#else + { __donnot_use_enum_srvsvc_ShareType=0x7FFFFFFF} +#define STYPE_DISKTREE ( 0 ) +#define STYPE_DISKTREE_TEMPORARY ( STYPE_DISKTREE|STYPE_TEMPORARY ) +#define STYPE_DISKTREE_HIDDEN ( STYPE_DISKTREE|STYPE_HIDDEN ) +#define STYPE_PRINTQ ( 1 ) +#define STYPE_PRINTQ_TEMPORARY ( STYPE_PRINTQ|STYPE_TEMPORARY ) +#define STYPE_PRINTQ_HIDDEN ( STYPE_PRINTQ|STYPE_HIDDEN ) +#define STYPE_DEVICE ( 2 ) +#define STYPE_DEVICE_TEMPORARY ( STYPE_DEVICE|STYPE_TEMPORARY ) +#define STYPE_DEVICE_HIDDEN ( STYPE_DEVICE|STYPE_HIDDEN ) +#define STYPE_IPC ( 3 ) +#define STYPE_IPC_TEMPORARY ( STYPE_IPC|STYPE_TEMPORARY ) +#define STYPE_IPC_HIDDEN ( STYPE_IPC|STYPE_HIDDEN ) +#endif +; + +struct srvsvc_NetShareInfo0 { + const char *name;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetShareCtr0 { + uint32_t count; + struct srvsvc_NetShareInfo0 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetShareInfo1 { + const char *name;/* [unique,charset(UTF16)] */ + enum srvsvc_ShareType type; + const char *comment;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetShareCtr1 { + uint32_t count; + struct srvsvc_NetShareInfo1 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetShareInfo2 { + const char *name;/* [unique,charset(UTF16)] */ + enum srvsvc_ShareType type; + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t permissions; + uint32_t max_users; + uint32_t current_users; + const char *path;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetShareCtr2 { + uint32_t count; + struct srvsvc_NetShareInfo2 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetShareInfo501 { + const char *name;/* [unique,charset(UTF16)] */ + enum srvsvc_ShareType type; + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t csc_policy; +}; + +struct srvsvc_NetShareCtr501 { + uint32_t count; + struct srvsvc_NetShareInfo501 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetShareInfo502 { + const char *name;/* [unique,charset(UTF16)] */ + enum srvsvc_ShareType type; + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t permissions; + uint32_t max_users; + uint32_t current_users; + const char *path;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ + struct sec_desc_buf sd_buf; +}; + +struct srvsvc_NetShareCtr502 { + uint32_t count; + struct srvsvc_NetShareInfo502 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetShareInfo1004 { + const char *comment;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetShareCtr1004 { + uint32_t count; + struct srvsvc_NetShareInfo1004 *array;/* [unique,size_is(count)] */ +}; + +/* bitmap NetShareInfo1005Flags */ +#define SHARE_1005_IN_DFS ( 0x00000001 ) +#define SHARE_1005_DFS_ROOT ( 0x00000002 ) + +struct srvsvc_NetShareInfo1005 { + uint32_t dfs_flags; +}; + +struct srvsvc_NetShareCtr1005 { + uint32_t count; + struct srvsvc_NetShareInfo1005 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetShareInfo1006 { + uint32_t max_users; +}; + +struct srvsvc_NetShareCtr1006 { + uint32_t count; + struct srvsvc_NetShareInfo1006 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetShareInfo1007 { + uint32_t flags; + const char *alternate_directory_name;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetShareCtr1007 { + uint32_t count; + struct srvsvc_NetShareInfo1007 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetShareCtr1501 { + uint32_t count; + struct sec_desc_buf *array;/* [unique,size_is(count)] */ +}; + +union srvsvc_NetShareInfo { + struct srvsvc_NetShareInfo0 *info0;/* [unique,case(0)] */ + struct srvsvc_NetShareInfo1 *info1;/* [unique,case] */ + struct srvsvc_NetShareInfo2 *info2;/* [unique,case(2)] */ + struct srvsvc_NetShareInfo501 *info501;/* [unique,case(501)] */ + struct srvsvc_NetShareInfo502 *info502;/* [unique,case(502)] */ + struct srvsvc_NetShareInfo1004 *info1004;/* [unique,case(1004)] */ + struct srvsvc_NetShareInfo1005 *info1005;/* [unique,case(1005)] */ + struct srvsvc_NetShareInfo1006 *info1006;/* [unique,case(1006)] */ + struct srvsvc_NetShareInfo1007 *info1007;/* [unique,case(1007)] */ + struct sec_desc_buf *info1501;/* [unique,case(1501)] */ +}; + +union srvsvc_NetShareCtr { + struct srvsvc_NetShareCtr0 *ctr0;/* [unique,case(0)] */ + struct srvsvc_NetShareCtr1 *ctr1;/* [unique,case] */ + struct srvsvc_NetShareCtr2 *ctr2;/* [unique,case(2)] */ + struct srvsvc_NetShareCtr501 *ctr501;/* [unique,case(501)] */ + struct srvsvc_NetShareCtr502 *ctr502;/* [unique,case(502)] */ + struct srvsvc_NetShareCtr1004 *ctr1004;/* [unique,case(1004)] */ + struct srvsvc_NetShareCtr1005 *ctr1005;/* [unique,case(1005)] */ + struct srvsvc_NetShareCtr1006 *ctr1006;/* [unique,case(1006)] */ + struct srvsvc_NetShareCtr1007 *ctr1007;/* [unique,case(1007)] */ + struct srvsvc_NetShareCtr1501 *ctr1501;/* [unique,case(1501)] */ +}; + +struct srvsvc_NetShareInfoCtr { + uint32_t level; + union srvsvc_NetShareCtr ctr;/* [switch_is(level)] */ +}; + +enum srvsvc_PlatformId +#ifndef USE_UINT_ENUMS + { + PLATFORM_ID_DOS=300, + PLATFORM_ID_OS2=400, + PLATFORM_ID_NT=500, + PLATFORM_ID_OSF=600, + PLATFORM_ID_VMS=700 +} +#else + { __donnot_use_enum_srvsvc_PlatformId=0x7FFFFFFF} +#define PLATFORM_ID_DOS ( 300 ) +#define PLATFORM_ID_OS2 ( 400 ) +#define PLATFORM_ID_NT ( 500 ) +#define PLATFORM_ID_OSF ( 600 ) +#define PLATFORM_ID_VMS ( 700 ) +#endif +; + +struct srvsvc_NetSrvInfo100 { + enum srvsvc_PlatformId platform_id; + const char *server_name;/* [unique,charset(UTF16)] */ +}/* [public] */; + +struct srvsvc_NetSrvInfo101 { + enum srvsvc_PlatformId platform_id; + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t version_major; + uint32_t version_minor; + uint32_t server_type; + const char *comment;/* [unique,charset(UTF16)] */ +}/* [public] */; + +struct srvsvc_NetSrvInfo102 { + enum srvsvc_PlatformId platform_id; + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t version_major; + uint32_t version_minor; + uint32_t server_type; + const char *comment;/* [unique,charset(UTF16)] */ + uint32_t users; + uint32_t disc; + uint32_t hidden; + uint32_t announce; + uint32_t anndelta; + uint32_t licenses; + const char *userpath;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetSrvInfo402 { + uint32_t ulist_mtime; + uint32_t glist_mtime; + uint32_t alist_mtime; + const char *alerts;/* [unique,charset(UTF16)] */ + uint32_t security; + uint32_t numadmin; + uint32_t lanmask; + const char *guestaccount;/* [unique,charset(UTF16)] */ + uint32_t chdevs; + uint32_t chdevqs; + uint32_t chdevjobs; + uint32_t connections; + uint32_t shares; + uint32_t openfiles; + uint32_t sessopen; + uint32_t sesssvc; + uint32_t sessreqs; + uint32_t opensearch; + uint32_t activelocks; + uint32_t numreqbufs; + uint32_t sizereqbufs; + uint32_t numbigbufs; + uint32_t numfiletasks; + uint32_t alertsched; + uint32_t erroralert; + uint32_t logonalert; + uint32_t accessalert; + uint32_t diskalert; + uint32_t netioalert; + uint32_t maxaudits; + const char *srvheuristics;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetSrvInfo403 { + uint32_t ulist_mtime; + uint32_t glist_mtime; + uint32_t alist_mtime; + const char *alerts;/* [unique,charset(UTF16)] */ + uint32_t security; + uint32_t numadmin; + uint32_t lanmask; + const char *guestaccount;/* [unique,charset(UTF16)] */ + uint32_t chdevs; + uint32_t chdevqs; + uint32_t chdevjobs; + uint32_t connections; + uint32_t shares; + uint32_t openfiles; + uint32_t sessopen; + uint32_t sesssvc; + uint32_t sessreqs; + uint32_t opensearch; + uint32_t activelocks; + uint32_t numreqbufs; + uint32_t sizereqbufs; + uint32_t numbigbufs; + uint32_t numfiletasks; + uint32_t alertsched; + uint32_t erroralert; + uint32_t logonalert; + uint32_t accessalert; + uint32_t diskalert; + uint32_t netioalert; + uint32_t maxaudits; + const char *srvheuristics;/* [unique,charset(UTF16)] */ + uint32_t auditedevents; + uint32_t auditprofile; + const char *autopath;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetSrvInfo502 { + uint32_t sessopen; + uint32_t sesssvc; + uint32_t opensearch; + uint32_t sizereqbufs; + uint32_t initworkitems; + uint32_t maxworkitems; + uint32_t rawworkitems; + uint32_t irpstacksize; + uint32_t maxrawbuflen; + uint32_t sessusers; + uint32_t sessconns; + uint32_t maxpagedmemoryusage; + uint32_t maxnonpagedmemoryusage; + uint32_t enablesoftcompat; + uint32_t enableforcedlogoff; + uint32_t timesource; + uint32_t acceptdownlevelapis; + uint32_t lmannounce; +}; + +struct srvsvc_NetSrvInfo503 { + uint32_t sessopen; + uint32_t sesssvc; + uint32_t opensearch; + uint32_t sizereqbufs; + uint32_t initworkitems; + uint32_t maxworkitems; + uint32_t rawworkitems; + uint32_t irpstacksize; + uint32_t maxrawbuflen; + uint32_t sessusers; + uint32_t sessconns; + uint32_t maxpagedmemoryusage; + uint32_t maxnonpagedmemoryusage; + uint32_t enablesoftcompat; + uint32_t enableforcedlogoff; + uint32_t timesource; + uint32_t acceptdownlevelapis; + uint32_t lmannounce; + const char *domain;/* [unique,charset(UTF16)] */ + uint32_t maxcopyreadlen; + uint32_t maxcopywritelen; + uint32_t minkeepsearch; + uint32_t maxkeepsearch; + uint32_t minkeepcomplsearch; + uint32_t maxkeepcomplsearch; + uint32_t threadcountadd; + uint32_t numlockthreads; + uint32_t scavtimeout; + uint32_t minrcvqueue; + uint32_t minfreeworkitems; + uint32_t xactmemsize; + uint32_t threadpriority; + uint32_t maxmpxct; + uint32_t oplockbreakwait; + uint32_t oplockbreakresponsewait; + uint32_t enableoplocks; + uint32_t enableoplockforceclose; + uint32_t enablefcbopens; + uint32_t enableraw; + uint32_t enablesharednetdrives; + uint32_t minfreeconnections; + uint32_t maxfreeconnections; +}; + +struct srvsvc_NetSrvInfo599 { + uint32_t sessopen; + uint32_t sesssvc; + uint32_t opensearch; + uint32_t sizereqbufs; + uint32_t initworkitems; + uint32_t maxworkitems; + uint32_t rawworkitems; + uint32_t irpstacksize; + uint32_t maxrawbuflen; + uint32_t sessusers; + uint32_t sessconns; + uint32_t maxpagedmemoryusage; + uint32_t maxnonpagedmemoryusage; + uint32_t enablesoftcompat; + uint32_t enableforcedlogoff; + uint32_t timesource; + uint32_t acceptdownlevelapis; + uint32_t lmannounce; + const char *domain;/* [unique,charset(UTF16)] */ + uint32_t maxcopyreadlen; + uint32_t maxcopywritelen; + uint32_t minkeepsearch; + uint32_t minkeepcomplsearch; + uint32_t maxkeepcomplsearch; + uint32_t threadcountadd; + uint32_t numlockthreads; + uint32_t scavtimeout; + uint32_t minrcvqueue; + uint32_t minfreeworkitems; + uint32_t xactmemsize; + uint32_t threadpriority; + uint32_t maxmpxct; + uint32_t oplockbreakwait; + uint32_t oplockbreakresponsewait; + uint32_t enableoplocks; + uint32_t enableoplockforceclose; + uint32_t enablefcbopens; + uint32_t enableraw; + uint32_t enablesharednetdrives; + uint32_t minfreeconnections; + uint32_t maxfreeconnections; + uint32_t initsesstable; + uint32_t initconntable; + uint32_t initfiletable; + uint32_t initsearchtable; + uint32_t alertsched; + uint32_t errortreshold; + uint32_t networkerrortreshold; + uint32_t diskspacetreshold; + uint32_t reserved; + uint32_t maxlinkdelay; + uint32_t minlinkthroughput; + uint32_t linkinfovalidtime; + uint32_t scavqosinfoupdatetime; + uint32_t maxworkitemidletime; +}; + +struct srvsvc_NetSrvInfo1005 { + const char *comment;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetSrvInfo1010 { + uint32_t disc; +}; + +struct srvsvc_NetSrvInfo1016 { + uint32_t hidden; +}; + +struct srvsvc_NetSrvInfo1017 { + uint32_t announce; +}; + +struct srvsvc_NetSrvInfo1018 { + uint32_t anndelta; +}; + +struct srvsvc_NetSrvInfo1107 { + uint32_t users; +}; + +struct srvsvc_NetSrvInfo1501 { + uint32_t sessopens; +}; + +struct srvsvc_NetSrvInfo1502 { + uint32_t sessvcs; +}; + +struct srvsvc_NetSrvInfo1503 { + uint32_t opensearch; +}; + +struct srvsvc_NetSrvInfo1506 { + uint32_t maxworkitems; +}; + +struct srvsvc_NetSrvInfo1509 { + uint32_t maxrawbuflen; +}; + +struct srvsvc_NetSrvInfo1510 { + uint32_t sessusers; +}; + +struct srvsvc_NetSrvInfo1511 { + uint32_t sesscons; +}; + +struct srvsvc_NetSrvInfo1512 { + uint32_t maxnonpagedmemoryusage; +}; + +struct srvsvc_NetSrvInfo1513 { + uint32_t maxpagedmemoryusage; +}; + +struct srvsvc_NetSrvInfo1514 { + uint32_t enablesoftcompat; +}; + +struct srvsvc_NetSrvInfo1515 { + uint32_t enableforcedlogoff; +}; + +struct srvsvc_NetSrvInfo1516 { + uint32_t timesource; +}; + +struct srvsvc_NetSrvInfo1518 { + uint32_t lmannounce; +}; + +struct srvsvc_NetSrvInfo1520 { + uint32_t maxcopyreadlen; +}; + +struct srvsvc_NetSrvInfo1521 { + uint32_t maxcopywritelen; +}; + +struct srvsvc_NetSrvInfo1522 { + uint32_t minkeepsearch; +}; + +struct srvsvc_NetSrvInfo1523 { + uint32_t maxkeepsearch; +}; + +struct srvsvc_NetSrvInfo1524 { + uint32_t minkeepcomplsearch; +}; + +struct srvsvc_NetSrvInfo1525 { + uint32_t maxkeepcomplsearch; +}; + +struct srvsvc_NetSrvInfo1528 { + uint32_t scavtimeout; +}; + +struct srvsvc_NetSrvInfo1529 { + uint32_t minrcvqueue; +}; + +struct srvsvc_NetSrvInfo1530 { + uint32_t minfreeworkitems; +}; + +struct srvsvc_NetSrvInfo1533 { + uint32_t maxmpxct; +}; + +struct srvsvc_NetSrvInfo1534 { + uint32_t oplockbreakwait; +}; + +struct srvsvc_NetSrvInfo1535 { + uint32_t oplockbreakresponsewait; +}; + +struct srvsvc_NetSrvInfo1536 { + uint32_t enableoplocks; +}; + +struct srvsvc_NetSrvInfo1537 { + uint32_t enableoplockforceclose; +}; + +struct srvsvc_NetSrvInfo1538 { + uint32_t enablefcbopens; +}; + +struct srvsvc_NetSrvInfo1539 { + uint32_t enableraw; +}; + +struct srvsvc_NetSrvInfo1540 { + uint32_t enablesharednetdrives; +}; + +struct srvsvc_NetSrvInfo1541 { + uint32_t minfreeconnections; +}; + +struct srvsvc_NetSrvInfo1542 { + uint32_t maxfreeconnections; +}; + +struct srvsvc_NetSrvInfo1543 { + uint32_t initsesstable; +}; + +struct srvsvc_NetSrvInfo1544 { + uint32_t initconntable; +}; + +struct srvsvc_NetSrvInfo1545 { + uint32_t initfiletable; +}; + +struct srvsvc_NetSrvInfo1546 { + uint32_t initsearchtable; +}; + +struct srvsvc_NetSrvInfo1547 { + uint32_t alertsched; +}; + +struct srvsvc_NetSrvInfo1548 { + uint32_t errortreshold; +}; + +struct srvsvc_NetSrvInfo1549 { + uint32_t networkerrortreshold; +}; + +struct srvsvc_NetSrvInfo1550 { + uint32_t diskspacetreshold; +}; + +struct srvsvc_NetSrvInfo1552 { + uint32_t maxlinkdelay; +}; + +struct srvsvc_NetSrvInfo1553 { + uint32_t minlinkthroughput; +}; + +struct srvsvc_NetSrvInfo1554 { + uint32_t linkinfovalidtime; +}; + +struct srvsvc_NetSrvInfo1555 { + uint32_t scavqosinfoupdatetime; +}; + +struct srvsvc_NetSrvInfo1556 { + uint32_t maxworkitemidletime; +}; + +union srvsvc_NetSrvInfo { + struct srvsvc_NetSrvInfo100 *info100;/* [unique,case(100)] */ + struct srvsvc_NetSrvInfo101 *info101;/* [unique,case(101)] */ + struct srvsvc_NetSrvInfo102 *info102;/* [unique,case(102)] */ + struct srvsvc_NetSrvInfo402 *info402;/* [unique,case(402)] */ + struct srvsvc_NetSrvInfo403 *info403;/* [unique,case(403)] */ + struct srvsvc_NetSrvInfo502 *info502;/* [unique,case(502)] */ + struct srvsvc_NetSrvInfo503 *info503;/* [unique,case(503)] */ + struct srvsvc_NetSrvInfo599 *info599;/* [unique,case(599)] */ + struct srvsvc_NetSrvInfo1005 *info1005;/* [unique,case(1005)] */ + struct srvsvc_NetSrvInfo1010 *info1010;/* [unique,case(1010)] */ + struct srvsvc_NetSrvInfo1016 *info1016;/* [unique,case(1016)] */ + struct srvsvc_NetSrvInfo1017 *info1017;/* [unique,case(1017)] */ + struct srvsvc_NetSrvInfo1018 *info1018;/* [unique,case(1018)] */ + struct srvsvc_NetSrvInfo1107 *info1107;/* [unique,case(1107)] */ + struct srvsvc_NetSrvInfo1501 *info1501;/* [unique,case(1501)] */ + struct srvsvc_NetSrvInfo1502 *info1502;/* [unique,case(1502)] */ + struct srvsvc_NetSrvInfo1503 *info1503;/* [unique,case(1503)] */ + struct srvsvc_NetSrvInfo1506 *info1506;/* [unique,case(1506)] */ + struct srvsvc_NetSrvInfo1509 *info1509;/* [unique,case(1509)] */ + struct srvsvc_NetSrvInfo1510 *info1510;/* [unique,case(1510)] */ + struct srvsvc_NetSrvInfo1511 *info1511;/* [unique,case(1511)] */ + struct srvsvc_NetSrvInfo1512 *info1512;/* [unique,case(1512)] */ + struct srvsvc_NetSrvInfo1513 *info1513;/* [unique,case(1513)] */ + struct srvsvc_NetSrvInfo1514 *info1514;/* [unique,case(1514)] */ + struct srvsvc_NetSrvInfo1515 *info1515;/* [unique,case(1515)] */ + struct srvsvc_NetSrvInfo1516 *info1516;/* [unique,case(1516)] */ + struct srvsvc_NetSrvInfo1518 *info1518;/* [unique,case(1518)] */ + struct srvsvc_NetSrvInfo1520 *info1520;/* [unique,case(1520)] */ + struct srvsvc_NetSrvInfo1521 *info1521;/* [unique,case(1521)] */ + struct srvsvc_NetSrvInfo1522 *info1522;/* [unique,case(1522)] */ + struct srvsvc_NetSrvInfo1523 *info1523;/* [unique,case(1523)] */ + struct srvsvc_NetSrvInfo1524 *info1524;/* [unique,case(1524)] */ + struct srvsvc_NetSrvInfo1525 *info1525;/* [unique,case(1525)] */ + struct srvsvc_NetSrvInfo1528 *info1528;/* [unique,case(1528)] */ + struct srvsvc_NetSrvInfo1529 *info1529;/* [unique,case(1529)] */ + struct srvsvc_NetSrvInfo1530 *info1530;/* [unique,case(1530)] */ + struct srvsvc_NetSrvInfo1533 *info1533;/* [unique,case(1533)] */ + struct srvsvc_NetSrvInfo1534 *info1534;/* [unique,case(1534)] */ + struct srvsvc_NetSrvInfo1535 *info1535;/* [unique,case(1535)] */ + struct srvsvc_NetSrvInfo1536 *info1536;/* [unique,case(1536)] */ + struct srvsvc_NetSrvInfo1537 *info1537;/* [unique,case(1537)] */ + struct srvsvc_NetSrvInfo1538 *info1538;/* [unique,case(1538)] */ + struct srvsvc_NetSrvInfo1539 *info1539;/* [unique,case(1539)] */ + struct srvsvc_NetSrvInfo1540 *info1540;/* [unique,case(1540)] */ + struct srvsvc_NetSrvInfo1541 *info1541;/* [unique,case(1541)] */ + struct srvsvc_NetSrvInfo1542 *info1542;/* [unique,case(1542)] */ + struct srvsvc_NetSrvInfo1543 *info1543;/* [unique,case(1543)] */ + struct srvsvc_NetSrvInfo1544 *info1544;/* [unique,case(1544)] */ + struct srvsvc_NetSrvInfo1545 *info1545;/* [unique,case(1545)] */ + struct srvsvc_NetSrvInfo1546 *info1546;/* [unique,case(1546)] */ + struct srvsvc_NetSrvInfo1547 *info1547;/* [unique,case(1547)] */ + struct srvsvc_NetSrvInfo1548 *info1548;/* [unique,case(1548)] */ + struct srvsvc_NetSrvInfo1549 *info1549;/* [unique,case(1549)] */ + struct srvsvc_NetSrvInfo1550 *info1550;/* [unique,case(1550)] */ + struct srvsvc_NetSrvInfo1552 *info1552;/* [unique,case(1552)] */ + struct srvsvc_NetSrvInfo1553 *info1553;/* [unique,case(1553)] */ + struct srvsvc_NetSrvInfo1554 *info1554;/* [unique,case(1554)] */ + struct srvsvc_NetSrvInfo1555 *info1555;/* [unique,case(1555)] */ + struct srvsvc_NetSrvInfo1556 *info1556;/* [unique,case(1556)] */ +}; + +struct srvsvc_NetDiskInfo0 { + uint32_t __disk_offset;/* [value(0)] */ + uint32_t __disk_length;/* [value(strlen(disk)+1)] */ + const char *disk;/* [charset(UTF16)] */ +}; + +struct srvsvc_NetDiskInfo { + uint32_t count; + struct srvsvc_NetDiskInfo0 *disks;/* [unique,length_is(count),size_is(count)] */ +}; + +struct srvsvc_Statistics { + uint32_t start; + uint32_t fopens; + uint32_t devopens; + uint32_t jobsqueued; + uint32_t sopens; + uint32_t stimeouts; + uint32_t serrorout; + uint32_t pwerrors; + uint32_t permerrors; + uint32_t syserrors; + uint32_t bytessent_low; + uint32_t bytessent_high; + uint32_t bytesrcvd_low; + uint32_t bytesrcvd_high; + uint32_t avresponse; + uint32_t reqbufneed; + uint32_t bigbufneed; +}; + +struct srvsvc_NetTransportInfo0 { + uint32_t vcs; + const char *name;/* [unique,charset(UTF16)] */ + uint8_t *addr;/* [unique,size_is(addr_len)] */ + uint32_t addr_len; + const char *net_addr;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetTransportCtr0 { + uint32_t count; + struct srvsvc_NetTransportInfo0 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetTransportInfo1 { + uint32_t vcs; + const char *name;/* [unique,charset(UTF16)] */ + uint8_t *addr;/* [unique,size_is(addr_len)] */ + uint32_t addr_len; + const char *net_addr;/* [unique,charset(UTF16)] */ + const char *domain;/* [unique,charset(UTF16)] */ +}; + +struct srvsvc_NetTransportCtr1 { + uint32_t count; + struct srvsvc_NetTransportInfo1 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetTransportInfo2 { + uint32_t vcs; + const char *name;/* [unique,charset(UTF16)] */ + uint8_t *addr;/* [unique,size_is(addr_len)] */ + uint32_t addr_len; + const char *net_addr;/* [unique,charset(UTF16)] */ + const char *domain;/* [unique,charset(UTF16)] */ + uint32_t unknown; +}; + +struct srvsvc_NetTransportCtr2 { + uint32_t count; + struct srvsvc_NetTransportInfo2 *array;/* [unique,size_is(count)] */ +}; + +struct srvsvc_NetTransportInfo3 { + uint32_t vcs; + const char *name;/* [unique,charset(UTF16)] */ + uint8_t *addr;/* [unique,size_is(addr_len)] */ + uint32_t addr_len; + const char *net_addr;/* [unique,charset(UTF16)] */ + const char *domain;/* [unique,charset(UTF16)] */ + uint32_t unknown1; + uint32_t unknown2; + uint8_t unknown3[256]; +}; + +struct srvsvc_NetTransportCtr3 { + uint32_t count; + struct srvsvc_NetTransportInfo3 *array;/* [unique,size_is(count)] */ +}; + +union srvsvc_NetTransportCtr { + struct srvsvc_NetTransportCtr0 *ctr0;/* [unique,case(0)] */ + struct srvsvc_NetTransportCtr1 *ctr1;/* [unique,case] */ + struct srvsvc_NetTransportCtr2 *ctr2;/* [unique,case(2)] */ + struct srvsvc_NetTransportCtr3 *ctr3;/* [unique,case(3)] */ +}; + +struct srvsvc_NetTransportInfoCtr { + uint32_t level; + union srvsvc_NetTransportCtr ctr;/* [switch_is(level)] */ +}; + +struct srvsvc_NetRemoteTODInfo { + uint32_t elapsed; + uint32_t msecs; + uint32_t hours; + uint32_t mins; + uint32_t secs; + uint32_t hunds; + int32_t timezone; + uint32_t tinterval; + uint32_t day; + uint32_t month; + uint32_t year; + uint32_t weekday; +}; + +union srvsvc_NetTransportInfo { + struct srvsvc_NetTransportInfo0 info0;/* [case(0)] */ + struct srvsvc_NetTransportInfo1 info1;/* [case] */ + struct srvsvc_NetTransportInfo2 info2;/* [case(2)] */ + struct srvsvc_NetTransportInfo3 info3;/* [case(3)] */ +}/* [switch_type(uint32)] */; + + +struct srvsvc_NetCharDevEnum { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t max_buffer; + struct srvsvc_NetCharDevInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *totalentries;/* [ref] */ + struct srvsvc_NetCharDevInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetCharDevGetInfo { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *device_name;/* [charset(UTF16)] */ + uint32_t level; + } in; + + struct { + union srvsvc_NetCharDevInfo *info;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetCharDevControl { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *device_name;/* [charset(UTF16)] */ + uint32_t opcode; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetCharDevQEnum { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *user;/* [unique,charset(UTF16)] */ + uint32_t max_buffer; + struct srvsvc_NetCharDevQInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *totalentries;/* [ref] */ + struct srvsvc_NetCharDevQInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetCharDevQGetInfo { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *queue_name;/* [charset(UTF16)] */ + const char *user;/* [charset(UTF16)] */ + uint32_t level; + } in; + + struct { + union srvsvc_NetCharDevQInfo *info;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetCharDevQSetInfo { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *queue_name;/* [charset(UTF16)] */ + uint32_t level; + union srvsvc_NetCharDevQInfo info;/* [switch_is(level)] */ + uint32_t *parm_error;/* [unique] */ + } in; + + struct { + uint32_t *parm_error;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetCharDevQPurge { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *queue_name;/* [charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetCharDevQPurgeSelf { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *queue_name;/* [charset(UTF16)] */ + const char *computer_name;/* [charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetConnEnum { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *path;/* [unique,charset(UTF16)] */ + uint32_t max_buffer; + struct srvsvc_NetConnInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *totalentries;/* [ref] */ + struct srvsvc_NetConnInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetFileEnum { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *path;/* [unique,charset(UTF16)] */ + const char *user;/* [unique,charset(UTF16)] */ + uint32_t max_buffer; + struct srvsvc_NetFileInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *totalentries;/* [ref] */ + struct srvsvc_NetFileInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetFileGetInfo { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t fid; + uint32_t level; + } in; + + struct { + union srvsvc_NetFileInfo *info;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetFileClose { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t fid; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetSessEnum { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *client;/* [unique,charset(UTF16)] */ + const char *user;/* [unique,charset(UTF16)] */ + uint32_t max_buffer; + struct srvsvc_NetSessInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *totalentries;/* [ref] */ + struct srvsvc_NetSessInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetSessDel { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *client;/* [unique,charset(UTF16)] */ + const char *user;/* [unique,charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareAdd { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t level; + union srvsvc_NetShareInfo *info;/* [ref,switch_is(level)] */ + uint32_t *parm_error;/* [unique] */ + } in; + + struct { + uint32_t *parm_error;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareEnumAll { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t max_buffer; + struct srvsvc_NetShareInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *totalentries;/* [ref] */ + struct srvsvc_NetShareInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareGetInfo { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *share_name;/* [charset(UTF16)] */ + uint32_t level; + } in; + + struct { + union srvsvc_NetShareInfo *info;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareSetInfo { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *share_name;/* [charset(UTF16)] */ + uint32_t level; + union srvsvc_NetShareInfo *info;/* [ref,switch_is(level)] */ + uint32_t *parm_error;/* [unique] */ + } in; + + struct { + uint32_t *parm_error;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareDel { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *share_name;/* [charset(UTF16)] */ + uint32_t reserved; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareDelSticky { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *share_name;/* [charset(UTF16)] */ + uint32_t reserved; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareCheck { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *device_name;/* [charset(UTF16)] */ + } in; + + struct { + enum srvsvc_ShareType *type;/* [ref] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetSrvGetInfo { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t level; + } in; + + struct { + union srvsvc_NetSrvInfo *info;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetSrvSetInfo { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t level; + union srvsvc_NetSrvInfo *info;/* [ref,switch_is(level)] */ + uint32_t *parm_error;/* [unique] */ + } in; + + struct { + uint32_t *parm_error;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetDiskEnum { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t level; + uint32_t maxlen; + struct srvsvc_NetDiskInfo *info;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *totalentries;/* [ref] */ + struct srvsvc_NetDiskInfo *info;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetServerStatisticsGet { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *service;/* [unique,charset(UTF16)] */ + uint32_t level; + uint32_t options; + } in; + + struct { + struct srvsvc_Statistics **stats;/* [ref] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetTransportAdd { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t level; + union srvsvc_NetTransportInfo info;/* [switch_is(level)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetTransportEnum { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t max_buffer; + struct srvsvc_NetTransportInfoCtr *transports;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *totalentries;/* [ref] */ + struct srvsvc_NetTransportInfoCtr *transports;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetTransportDel { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t level; + struct srvsvc_NetTransportInfo0 *info0;/* [ref] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetRemoteTOD { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + } in; + + struct { + struct srvsvc_NetRemoteTODInfo **info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetSetServiceBits { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *transport;/* [unique,charset(UTF16)] */ + uint32_t servicebits; + uint32_t updateimmediately; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetPathType { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *path;/* [charset(UTF16)] */ + uint32_t pathflags; + } in; + + struct { + uint32_t *pathtype;/* [ref] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetPathCanonicalize { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *path;/* [charset(UTF16)] */ + uint32_t maxbuf; + const char *prefix;/* [charset(UTF16)] */ + uint32_t pathflags; + uint32_t *pathtype;/* [ref] */ + } in; + + struct { + uint8_t *can_path;/* [size_is(maxbuf)] */ + uint32_t *pathtype;/* [ref] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetPathCompare { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *path1;/* [charset(UTF16)] */ + const char *path2;/* [charset(UTF16)] */ + uint32_t pathtype; + uint32_t pathflags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetNameValidate { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *name;/* [charset(UTF16)] */ + uint32_t name_type; + uint32_t flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRPRNAMECANONICALIZE { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetPRNameCompare { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *name1;/* [charset(UTF16)] */ + const char *name2;/* [charset(UTF16)] */ + uint32_t name_type; + uint32_t flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareEnum { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t max_buffer; + struct srvsvc_NetShareInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *totalentries;/* [ref] */ + struct srvsvc_NetShareInfoCtr *info_ctr;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareDelStart { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *share;/* [charset(UTF16)] */ + uint32_t reserved; + } in; + + struct { + struct policy_handle *hnd;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetShareDelCommit { + struct { + struct policy_handle *hnd;/* [unique] */ + } in; + + struct { + struct policy_handle *hnd;/* [unique] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetGetFileSecurity { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *share;/* [unique,charset(UTF16)] */ + const char *file;/* [charset(UTF16)] */ + uint32_t securityinformation; + } in; + + struct { + struct sec_desc_buf **sd_buf;/* [ref] */ + WERROR result; + } out; + +}; + + +struct srvsvc_NetSetFileSecurity { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *share;/* [unique,charset(UTF16)] */ + const char *file;/* [charset(UTF16)] */ + uint32_t securityinformation; + struct sec_desc_buf *sd_buf;/* [ref] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetServerTransportAddEx { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + uint32_t level; + union srvsvc_NetTransportInfo info;/* [switch_is(level)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NetServerSetServiceBitsEx { + struct { + const char *server_unc;/* [unique,charset(UTF16)] */ + const char *emulated_server_unc;/* [unique,charset(UTF16)] */ + const char *transport;/* [unique,charset(UTF16)] */ + uint32_t servicebitsofinterest; + uint32_t servicebits; + uint32_t updateimmediately; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSGETVERSION { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSCREATELOCALPARTITION { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSDELETELOCALPARTITION { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSSETLOCALVOLUMESTATE { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSSETSERVERINFO { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSCREATEEXITPOINT { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSDELETEEXITPOINT { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSMODIFYPREFIX { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSFIXLOCALVOLUME { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRDFSMANAGERREPORTSITEINFO { + struct { + WERROR result; + } out; + +}; + + +struct srvsvc_NETRSERVERTRANSPORTDELEX { + struct { + WERROR result; + } out; + +}; + +#endif /* _HEADER_srvsvc */ diff --git a/librpc/gen_ndr/svcctl.h b/librpc/gen_ndr/svcctl.h new file mode 100644 index 0000000000..9baa122e56 --- /dev/null +++ b/librpc/gen_ndr/svcctl.h @@ -0,0 +1,811 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/security.h" +#ifndef _HEADER_svcctl +#define _HEADER_svcctl + +#define SERVICE_TYPE_KERNEL_DRIVER ( 0x01 ) +#define SERVICE_TYPE_FS_DRIVER ( 0x02 ) +#define SERVICE_TYPE_ADAPTER ( 0x04 ) +#define SERVICE_TYPE_RECOGNIZER_DRIVER ( 0x08 ) +#define SERVICE_TYPE_DRIVER ( SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER ) +#define SERVICE_TYPE_WIN32_OWN_PROCESS ( 0x10 ) +#define SERVICE_TYPE_WIN32_SHARE_PROCESS ( 0x20 ) +#define SERVICE_TYPE_WIN32 ( SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS ) +#define SERVICE_STATE_ACTIVE ( 0x01 ) +#define SERVICE_STATE_INACTIVE ( 0x02 ) +#define SERVICE_STATE_ALL ( 0x03 ) +#define SV_TYPE_ALL ( 0xFFFFFFFF ) +#define SC_MANAGER_READ_ACCESS ( (SEC_STD_READ_CONTROL|SC_RIGHT_MGR_CONNECT|SC_RIGHT_MGR_ENUMERATE_SERVICE|SC_RIGHT_MGR_QUERY_LOCK_STATUS) ) +#define SC_MANAGER_EXECUTE_ACCESS ( SC_MANAGER_READ_ACCESS ) +#define SC_MANAGER_WRITE_ACCESS ( (SEC_STD_REQUIRED|SC_MANAGER_READ_ACCESS|SC_RIGHT_MGR_CREATE_SERVICE|SC_RIGHT_MGR_LOCK|SC_RIGHT_MGR_MODIFY_BOOT_CONFIG) ) +#define SC_MANAGER_ALL_ACCESS ( SC_MANAGER_WRITE_ACCESS ) +#define SERVICE_READ_ACCESS ( (SEC_STD_READ_CONTROL|SC_RIGHT_SVC_ENUMERATE_DEPENDENTS|SC_RIGHT_SVC_INTERROGATE|SC_RIGHT_SVC_QUERY_CONFIG|SC_RIGHT_SVC_QUERY_STATUS|SC_RIGHT_SVC_USER_DEFINED_CONTROL) ) +#define SERVICE_EXECUTE_ACCESS ( (SERVICE_READ_ACCESS|SC_RIGHT_SVC_START|SC_RIGHT_SVC_STOP|SC_RIGHT_SVC_PAUSE_CONTINUE) ) +#define SERVICE_WRITE_ACCESS ( (SEC_STD_REQUIRED|SERVICE_READ_ACCESS|SERVICE_EXECUTE_ACCESS|SC_RIGHT_SVC_CHANGE_CONFIG) ) +#define SERVICE_ALL_ACCESS ( SERVICE_WRITE_ACCESS ) +struct SERVICE_LOCK_STATUS { + uint32_t is_locked; + const char *lock_owner;/* [unique,charset(UTF16)] */ + uint32_t lock_duration; +}; + +struct SERVICE_STATUS { + uint32_t type; + uint32_t state; + uint32_t controls_accepted; + WERROR win32_exit_code; + uint32_t service_exit_code; + uint32_t check_point; + uint32_t wait_hint; +}; + +struct ENUM_SERVICE_STATUS { + const char * service_name;/* [relative,flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + const char * display_name;/* [relative,flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + struct SERVICE_STATUS status; +}; + +/* bitmap svcctl_ServerType */ +#define SV_TYPE_WORKSTATION ( 0x00000001 ) +#define SV_TYPE_SERVER ( 0x00000002 ) +#define SV_TYPE_SQLSERVER ( 0x00000004 ) +#define SV_TYPE_DOMAIN_CTRL ( 0x00000008 ) +#define SV_TYPE_DOMAIN_BAKCTRL ( 0x00000010 ) +#define SV_TYPE_TIME_SOURCE ( 0x00000020 ) +#define SV_TYPE_AFP ( 0x00000040 ) +#define SV_TYPE_NOVELL ( 0x00000080 ) +#define SV_TYPE_DOMAIN_MEMBER ( 0x00000100 ) +#define SV_TYPE_PRINTQ_SERVER ( 0x00000200 ) +#define SV_TYPE_DIALIN_SERVER ( 0x00000400 ) +#define SV_TYPE_SERVER_UNIX ( 0x00000800 ) +#define SV_TYPE_NT ( 0x00001000 ) +#define SV_TYPE_WFW ( 0x00002000 ) +#define SV_TYPE_SERVER_MFPN ( 0x00004000 ) +#define SV_TYPE_SERVER_NT ( 0x00008000 ) +#define SV_TYPE_POTENTIAL_BROWSER ( 0x00010000 ) +#define SV_TYPE_BACKUP_BROWSER ( 0x00020000 ) +#define SV_TYPE_MASTER_BROWSER ( 0x00040000 ) +#define SV_TYPE_DOMAIN_MASTER ( 0x00080000 ) +#define SV_TYPE_SERVER_OSF ( 0x00100000 ) +#define SV_TYPE_SERVER_VMS ( 0x00200000 ) +#define SV_TYPE_WIN95_PLUS ( 0x00400000 ) +#define SV_TYPE_DFS_SERVER ( 0x00800000 ) +#define SV_TYPE_ALTERNATE_XPORT ( 0x20000000 ) +#define SV_TYPE_LOCAL_LIST_ONLY ( 0x40000000 ) +#define SV_TYPE_DOMAIN_ENUM ( 0x80000000 ) + +enum SERVICE_CONTROL +#ifndef USE_UINT_ENUMS + { + SVCCTL_CONTROL_STOP=0x00000001, + SVCCTL_CONTROL_PAUSE=0x00000002, + SVCCTL_CONTROL_CONTINUE=0x00000003, + SVCCTL_CONTROL_INTERROGATE=0x00000004, + SVCCTL_CONTROL_SHUTDOWN=0x00000005 +} +#else + { __donnot_use_enum_SERVICE_CONTROL=0x7FFFFFFF} +#define SVCCTL_CONTROL_STOP ( 0x00000001 ) +#define SVCCTL_CONTROL_PAUSE ( 0x00000002 ) +#define SVCCTL_CONTROL_CONTINUE ( 0x00000003 ) +#define SVCCTL_CONTROL_INTERROGATE ( 0x00000004 ) +#define SVCCTL_CONTROL_SHUTDOWN ( 0x00000005 ) +#endif +; + +/* bitmap svcctl_MgrAccessMask */ +#define SC_RIGHT_MGR_CONNECT ( 0x0001 ) +#define SC_RIGHT_MGR_CREATE_SERVICE ( 0x0002 ) +#define SC_RIGHT_MGR_ENUMERATE_SERVICE ( 0x0004 ) +#define SC_RIGHT_MGR_LOCK ( 0x0008 ) +#define SC_RIGHT_MGR_QUERY_LOCK_STATUS ( 0x0010 ) +#define SC_RIGHT_MGR_MODIFY_BOOT_CONFIG ( 0x0020 ) + +/* bitmap svcctl_ServiceAccessMask */ +#define SC_RIGHT_SVC_QUERY_CONFIG ( 0x0001 ) +#define SC_RIGHT_SVC_CHANGE_CONFIG ( 0x0002 ) +#define SC_RIGHT_SVC_QUERY_STATUS ( 0x0004 ) +#define SC_RIGHT_SVC_ENUMERATE_DEPENDENTS ( 0x0008 ) +#define SC_RIGHT_SVC_START ( 0x0010 ) +#define SC_RIGHT_SVC_STOP ( 0x0020 ) +#define SC_RIGHT_SVC_PAUSE_CONTINUE ( 0x0040 ) +#define SC_RIGHT_SVC_INTERROGATE ( 0x0080 ) +#define SC_RIGHT_SVC_USER_DEFINED_CONTROL ( 0x0100 ) + +struct QUERY_SERVICE_CONFIG { + uint32_t service_type; + uint32_t start_type; + uint32_t error_control; + const char *executablepath;/* [unique,range(0,8192),charset(UTF16)] */ + const char *loadordergroup;/* [unique,range(0,8192),charset(UTF16)] */ + uint32_t tag_id; + const char *dependencies;/* [unique,range(0,8192),charset(UTF16)] */ + const char *startname;/* [unique,range(0,8192),charset(UTF16)] */ + const char *displayname;/* [unique,range(0,8192),charset(UTF16)] */ +}/* [gensize,public] */; + + +struct svcctl_CloseServiceHandle { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_ControlService { + struct { + struct policy_handle *handle;/* [ref] */ + enum SERVICE_CONTROL control; + } in; + + struct { + struct SERVICE_STATUS *service_status;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_DeleteService { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct svcctl_LockServiceDatabase { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *lock;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_QueryServiceObjectSecurity { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t security_flags; + uint32_t buffer_size;/* [range(0,0x40000)] */ + } in; + + struct { + uint8_t *buffer;/* [ref,size_is(buffer_size)] */ + uint32_t *needed;/* [ref,range(0,0x40000)] */ + WERROR result; + } out; + +}; + + +struct svcctl_SetServiceObjectSecurity { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t security_flags; + uint8_t *buffer;/* [ref,size_is(buffer_size)] */ + uint32_t buffer_size; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct svcctl_QueryServiceStatus { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct SERVICE_STATUS *service_status;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_SetServiceStatus { + struct { + WERROR result; + } out; + +}; + + +struct svcctl_UnlockServiceDatabase { + struct { + struct policy_handle *lock;/* [ref] */ + } in; + + struct { + struct policy_handle *lock;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_NotifyBootConfigStatus { + struct { + WERROR result; + } out; + +}; + + +struct svcctl_SCSetServiceBitsW { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t bits; + uint32_t bitson; + uint32_t immediate; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct svcctl_ChangeServiceConfigW { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t type; + uint32_t start; + uint32_t error; + const char *binary_path;/* [unique,charset(UTF16)] */ + const char *load_order_group;/* [unique,charset(UTF16)] */ + const char *dependencies;/* [unique,charset(UTF16)] */ + const char *service_start_name;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ + const char *display_name;/* [unique,charset(UTF16)] */ + } in; + + struct { + uint32_t *tag_id;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_CreateServiceW { + struct { + struct policy_handle *scmanager_handle;/* [ref] */ + const char *ServiceName;/* [charset(UTF16)] */ + const char *DisplayName;/* [unique,charset(UTF16)] */ + uint32_t desired_access; + uint32_t type; + uint32_t start_type; + uint32_t error_control; + const char *binary_path;/* [charset(UTF16)] */ + const char *LoadOrderGroupKey;/* [unique,charset(UTF16)] */ + uint8_t *dependencies;/* [unique,size_is(dependencies_size)] */ + uint32_t dependencies_size; + const char *service_start_name;/* [unique,charset(UTF16)] */ + uint8_t *password;/* [unique,size_is(password_size)] */ + uint32_t password_size; + uint32_t *TagId;/* [unique] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t *TagId;/* [unique] */ + WERROR result; + } out; + +}; + + +struct svcctl_EnumDependentServicesW { + struct { + struct policy_handle *service;/* [ref] */ + uint32_t state; + uint32_t buf_size;/* [range(0,0x40000)] */ + } in; + + struct { + uint8_t *service_status;/* [ref,size_is(buf_size)] */ + uint32_t *bytes_needed;/* [ref,range(0,0x40000)] */ + uint32_t *services_returned;/* [ref,range(0,0x40000)] */ + WERROR result; + } out; + +}; + + +struct svcctl_EnumServicesStatusW { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t type; + uint32_t state; + uint32_t buf_size;/* [range(0,262144)] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint8_t *service;/* [ref,size_is(buf_size)] */ + uint32_t *bytes_needed;/* [ref,range(0,262144)] */ + uint32_t *services_returned;/* [ref,range(0,262144)] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct svcctl_OpenSCManagerW { + struct { + const char *MachineName;/* [unique,charset(UTF16)] */ + const char *DatabaseName;/* [unique,charset(UTF16)] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_OpenServiceW { + struct { + struct policy_handle *scmanager_handle;/* [ref] */ + const char *ServiceName;/* [charset(UTF16)] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_QueryServiceConfigW { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t buf_size;/* [range(0,8192)] */ + } in; + + struct { + struct QUERY_SERVICE_CONFIG *query;/* [ref] */ + uint32_t *bytes_needed;/* [ref,range(0,8192)] */ + WERROR result; + } out; + +}; + + +struct svcctl_QueryServiceLockStatusW { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t buf_size; + } in; + + struct { + struct SERVICE_LOCK_STATUS *lock_status;/* [ref] */ + uint32_t *required_buf_size;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_StartServiceW { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t NumArgs; + const char *Arguments;/* [unique,charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct svcctl_GetServiceDisplayNameW { + struct { + struct policy_handle *handle;/* [ref] */ + const char *service_name;/* [unique,charset(UTF16)] */ + uint32_t *display_name_length;/* [unique] */ + } in; + + struct { + const char **display_name;/* [ref,charset(UTF16)] */ + uint32_t *display_name_length;/* [unique] */ + WERROR result; + } out; + +}; + + +struct svcctl_GetServiceKeyNameW { + struct { + struct policy_handle *handle;/* [ref] */ + const char *service_name;/* [unique,charset(UTF16)] */ + uint32_t *display_name_length;/* [unique] */ + } in; + + struct { + const char **key_name;/* [ref,charset(UTF16)] */ + uint32_t *display_name_length;/* [unique] */ + WERROR result; + } out; + +}; + + +struct svcctl_SCSetServiceBitsA { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t bits; + uint32_t bitson; + uint32_t immediate; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct svcctl_ChangeServiceConfigA { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t type; + uint32_t start; + uint32_t error; + const char *binary_path;/* [unique,charset(UTF16)] */ + const char *load_order_group;/* [unique,charset(UTF16)] */ + const char *dependencies;/* [unique,charset(UTF16)] */ + const char *service_start_name;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ + const char *display_name;/* [unique,charset(UTF16)] */ + } in; + + struct { + uint32_t *tag_id;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_CreateServiceA { + struct { + struct policy_handle *handle;/* [ref] */ + const char *ServiceName;/* [unique,charset(UTF16)] */ + const char *DisplayName;/* [unique,charset(UTF16)] */ + uint32_t desired_access; + uint32_t type; + uint32_t start_type; + uint32_t error_control; + const char *binary_path;/* [unique,charset(UTF16)] */ + const char *LoadOrderGroupKey;/* [unique,charset(UTF16)] */ + const char *dependencies;/* [unique,charset(UTF16)] */ + const char *service_start_name;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ + } in; + + struct { + uint32_t *TagId;/* [unique] */ + WERROR result; + } out; + +}; + + +struct svcctl_EnumDependentServicesA { + struct { + struct policy_handle *service;/* [ref] */ + uint32_t state; + uint32_t buf_size; + } in; + + struct { + struct ENUM_SERVICE_STATUS *service_status;/* [unique] */ + uint32_t *bytes_needed;/* [ref] */ + uint32_t *services_returned;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_EnumServicesStatusA { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t type; + uint32_t state; + uint32_t buf_size; + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint8_t *service;/* [size_is(buf_size)] */ + uint32_t *bytes_needed;/* [ref] */ + uint32_t *services_returned;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct svcctl_OpenSCManagerA { + struct { + const char *MachineName;/* [unique,charset(UTF16)] */ + const char *DatabaseName;/* [unique,charset(UTF16)] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_OpenServiceA { + struct { + struct policy_handle *scmanager_handle;/* [ref] */ + const char *ServiceName;/* [unique,charset(UTF16)] */ + uint32_t access_mask; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct svcctl_QueryServiceConfigA { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t buf_size; + } in; + + struct { + uint8_t *query; + uint32_t *bytes_needed;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_QueryServiceLockStatusA { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t buf_size; + } in; + + struct { + struct SERVICE_LOCK_STATUS *lock_status;/* [ref] */ + uint32_t *required_buf_size;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_StartServiceA { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t NumArgs; + const char *Arguments;/* [unique,charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct svcctl_GetServiceDisplayNameA { + struct { + struct policy_handle *handle;/* [ref] */ + const char *service_name;/* [unique,charset(UTF16)] */ + uint32_t *display_name_length;/* [unique] */ + } in; + + struct { + const char **display_name;/* [ref,charset(UTF16)] */ + uint32_t *display_name_length;/* [unique] */ + WERROR result; + } out; + +}; + + +struct svcctl_GetServiceKeyNameA { + struct { + struct policy_handle *handle;/* [ref] */ + const char *service_name;/* [unique,charset(UTF16)] */ + uint32_t *display_name_length;/* [unique] */ + } in; + + struct { + const char **key_name;/* [ref,charset(UTF16)] */ + uint32_t *display_name_length;/* [unique] */ + WERROR result; + } out; + +}; + + +struct svcctl_GetCurrentGroupeStateW { + struct { + WERROR result; + } out; + +}; + + +struct svcctl_EnumServiceGroupW { + struct { + WERROR result; + } out; + +}; + + +struct svcctl_ChangeServiceConfig2A { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t info_level; + uint8_t *info;/* [unique] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct svcctl_ChangeServiceConfig2W { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t info_level; + uint8_t *info;/* [unique] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct svcctl_QueryServiceConfig2A { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t info_level; + uint32_t buf_size; + } in; + + struct { + uint8_t *buffer; + uint32_t *bytes_needed;/* [ref] */ + WERROR result; + } out; + +}; + + +struct svcctl_QueryServiceConfig2W { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t info_level; + uint32_t buf_size;/* [range(0,8192)] */ + } in; + + struct { + uint8_t *buffer;/* [ref,size_is(buf_size)] */ + uint32_t *bytes_needed;/* [ref,range(0,8192)] */ + WERROR result; + } out; + +}; + + +struct svcctl_QueryServiceStatusEx { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t info_level; + uint32_t buf_size;/* [range(0,8192)] */ + } in; + + struct { + uint8_t *buffer;/* [ref,size_is(buf_size)] */ + uint32_t *bytes_needed;/* [ref,range(0,8192)] */ + WERROR result; + } out; + +}; + + +struct EnumServicesStatusExA { + struct { + struct policy_handle *scmanager;/* [ref] */ + uint32_t info_level; + uint32_t type; + uint32_t state; + uint32_t buf_size; + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint8_t *services; + uint32_t *bytes_needed;/* [ref] */ + uint32_t *service_returned;/* [ref] */ + const char **group_name;/* [ref,charset(UTF16)] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct EnumServicesStatusExW { + struct { + struct policy_handle *scmanager;/* [ref] */ + uint32_t info_level; + uint32_t type; + uint32_t state; + uint32_t buf_size;/* [range(0,262144)] */ + const char *group_name;/* [unique,charset(UTF16)] */ + uint32_t *resume_handle;/* [unique,range(0,262144)] */ + } in; + + struct { + uint8_t *services;/* [ref,size_is(buf_size)] */ + uint32_t *bytes_needed;/* [ref,range(0,262144)] */ + uint32_t *service_returned;/* [ref,range(0,262144)] */ + uint32_t *resume_handle;/* [unique,range(0,262144)] */ + WERROR result; + } out; + +}; + + +struct svcctl_SCSendTSMessage { + struct { + WERROR result; + } out; + +}; + +#endif /* _HEADER_svcctl */ diff --git a/librpc/gen_ndr/tables.c b/librpc/gen_ndr/tables.c new file mode 100644 index 0000000000..f2064d95ac --- /dev/null +++ b/librpc/gen_ndr/tables.c @@ -0,0 +1,83 @@ + +/* Automatically generated by tables.pl. DO NOT EDIT */ + +#include "includes.h" +#include "librpc/ndr/libndr.h" +#include "librpc/ndr/ndr_table.h" +#include "librpc/gen_ndr/ndr_dfs.h" +#include "librpc/gen_ndr/ndr_drsblobs.h" +#include "librpc/gen_ndr/ndr_drsuapi.h" +#include "librpc/gen_ndr/ndr_dssetup.h" +#include "librpc/gen_ndr/ndr_echo.h" +#include "librpc/gen_ndr/ndr_epmapper.h" +#include "librpc/gen_ndr/ndr_eventlog.h" +#include "librpc/gen_ndr/ndr_initshutdown.h" +#include "librpc/gen_ndr/ndr_krb5pac.h" +#include "librpc/gen_ndr/ndr_lsa.h" +#include "librpc/gen_ndr/ndr_netlogon.h" +#include "librpc/gen_ndr/ndr_ntsvcs.h" +#include "librpc/gen_ndr/ndr_samr.h" +#include "librpc/gen_ndr/ndr_srvsvc.h" +#include "librpc/gen_ndr/ndr_svcctl.h" +#include "librpc/gen_ndr/ndr_winreg.h" +#include "librpc/gen_ndr/ndr_wkssvc.h" + +NTSTATUS ndr_table_register_builtin_tables(void) +{ + NTSTATUS status; + + status = ndr_table_register(&ndr_table_netdfs); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_drsblobs); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_drsuapi); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_dssetup); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_rpcecho); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_epmapper); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_eventlog); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_initshutdown); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_krb5pac); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_lsarpc); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_netlogon); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_ntsvcs); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_samr); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_srvsvc); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_svcctl); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_winreg); + if (NT_STATUS_IS_ERR(status)) return status; + + status = ndr_table_register(&ndr_table_wkssvc); + if (NT_STATUS_IS_ERR(status)) return status; + + + + return NT_STATUS_OK; +} diff --git a/librpc/gen_ndr/winreg.h b/librpc/gen_ndr/winreg.h new file mode 100644 index 0000000000..a98120ccf5 --- /dev/null +++ b/librpc/gen_ndr/winreg.h @@ -0,0 +1,623 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/lsa.h" +#include "librpc/gen_ndr/security.h" +#ifndef _HEADER_winreg +#define _HEADER_winreg + +/* bitmap winreg_AccessMask */ +#define KEY_QUERY_VALUE ( 0x00001 ) +#define KEY_SET_VALUE ( 0x00002 ) +#define KEY_CREATE_SUB_KEY ( 0x00004 ) +#define KEY_ENUMERATE_SUB_KEYS ( 0x00008 ) +#define KEY_NOTIFY ( 0x00010 ) +#define KEY_CREATE_LINK ( 0x00020 ) +#define KEY_WOW64_64KEY ( 0x00100 ) +#define KEY_WOW64_32KEY ( 0x00200 ) + +enum winreg_Type +#ifndef USE_UINT_ENUMS + { + REG_NONE=0, + REG_SZ=1, + REG_EXPAND_SZ=2, + REG_BINARY=3, + REG_DWORD=4, + REG_DWORD_BIG_ENDIAN=5, + REG_LINK=6, + REG_MULTI_SZ=7, + REG_RESOURCE_LIST=8, + REG_FULL_RESOURCE_DESCRIPTOR=9, + REG_RESOURCE_REQUIREMENTS_LIST=10, + REG_QWORD=11 +} +#else + { __donnot_use_enum_winreg_Type=0x7FFFFFFF} +#define REG_NONE ( 0 ) +#define REG_SZ ( 1 ) +#define REG_EXPAND_SZ ( 2 ) +#define REG_BINARY ( 3 ) +#define REG_DWORD ( 4 ) +#define REG_DWORD_BIG_ENDIAN ( 5 ) +#define REG_LINK ( 6 ) +#define REG_MULTI_SZ ( 7 ) +#define REG_RESOURCE_LIST ( 8 ) +#define REG_FULL_RESOURCE_DESCRIPTOR ( 9 ) +#define REG_RESOURCE_REQUIREMENTS_LIST ( 10 ) +#define REG_QWORD ( 11 ) +#endif +; + +struct winreg_String { + uint16_t name_len;/* [value(strlen_m_term(name)*2)] */ + uint16_t name_size;/* [value(strlen_m_term(name)*2)] */ + const char *name;/* [unique,charset(UTF16)] */ +}/* [public] */; + +struct KeySecurityData { + uint8_t *data;/* [unique,length_is(len),size_is(size)] */ + uint32_t size; + uint32_t len; +}; + +struct winreg_SecBuf { + uint32_t length; + struct KeySecurityData sd; + uint8_t inherit; +}; + +enum winreg_CreateAction +#ifndef USE_UINT_ENUMS + { + REG_ACTION_NONE=0, + REG_CREATED_NEW_KEY=1, + REG_OPENED_EXISTING_KEY=2 +} +#else + { __donnot_use_enum_winreg_CreateAction=0x7FFFFFFF} +#define REG_ACTION_NONE ( 0 ) +#define REG_CREATED_NEW_KEY ( 1 ) +#define REG_OPENED_EXISTING_KEY ( 2 ) +#endif +; + +struct winreg_StringBuf { + uint16_t length;/* [value(strlen_m_term(name)*2)] */ + uint16_t size; + const char *name;/* [unique,length_is(length/2),charset(UTF16),size_is(size/2)] */ +}; + +/* bitmap winreg_NotifyChangeType */ +#define REG_NOTIFY_CHANGE_NAME ( 0x00000001 ) +#define REG_NOTIFY_CHANGE_ATTRIBUTES ( 0x00000002 ) +#define REG_NOTIFY_CHANGE_LAST_SET ( 0x00000004 ) +#define REG_NOTIFY_CHANGE_SECURITY ( 0x00000008 ) + +struct KeySecurityAttribute { + uint32_t data_size; + struct KeySecurityData sec_data; + uint8_t inherit; +}; + +struct QueryMultipleValue { + struct winreg_String *name;/* [unique] */ + enum winreg_Type type; + uint32_t offset; + uint32_t length; +}; + + +struct winreg_OpenHKCR { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_OpenHKCU { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_OpenHKLM { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_OpenHKPD { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_OpenHKU { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_CloseKey { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_CreateKey { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String name; + struct winreg_String keyclass; + uint32_t options; + uint32_t access_mask; + struct winreg_SecBuf *secdesc;/* [unique] */ + enum winreg_CreateAction *action_taken;/* [unique] */ + } in; + + struct { + struct policy_handle *new_handle;/* [ref] */ + enum winreg_CreateAction *action_taken;/* [unique] */ + WERROR result; + } out; + +}; + + +struct winreg_DeleteKey { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String key; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_DeleteValue { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String value; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_EnumKey { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t enum_index; + struct winreg_StringBuf *name;/* [ref] */ + struct winreg_StringBuf *keyclass;/* [unique] */ + NTTIME *last_changed_time;/* [unique] */ + } in; + + struct { + struct winreg_StringBuf *name;/* [ref] */ + struct winreg_StringBuf *keyclass;/* [unique] */ + NTTIME *last_changed_time;/* [unique] */ + WERROR result; + } out; + +}; + + +struct winreg_EnumValue { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t enum_index; + struct winreg_StringBuf *name;/* [ref] */ + enum winreg_Type *type;/* [unique] */ + uint8_t *value;/* [unique,length_is(*length),size_is(*size)] */ + uint32_t *size;/* [unique] */ + uint32_t *length;/* [unique] */ + } in; + + struct { + struct winreg_StringBuf *name;/* [ref] */ + enum winreg_Type *type;/* [unique] */ + uint8_t *value;/* [unique,length_is(*length),size_is(*size)] */ + uint32_t *size;/* [unique] */ + uint32_t *length;/* [unique] */ + WERROR result; + } out; + +}; + + +struct winreg_FlushKey { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_GetKeySecurity { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t sec_info; + struct KeySecurityData *sd;/* [ref] */ + } in; + + struct { + struct KeySecurityData *sd;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_LoadKey { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String *keyname;/* [unique] */ + struct winreg_String *filename;/* [unique] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_NotifyChangeKeyValue { + struct { + struct policy_handle *handle;/* [ref] */ + uint8_t watch_subtree; + uint32_t notify_filter; + uint32_t unknown; + struct winreg_String string1; + struct winreg_String string2; + uint32_t unknown2; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_OpenKey { + struct { + struct policy_handle *parent_handle;/* [ref] */ + struct winreg_String keyname; + uint32_t unknown; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_QueryInfoKey { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String *classname;/* [ref] */ + } in; + + struct { + uint32_t *num_subkeys;/* [ref] */ + uint32_t *max_subkeylen;/* [ref] */ + uint32_t *max_classlen;/* [ref] */ + uint32_t *num_values;/* [ref] */ + uint32_t *max_valnamelen;/* [ref] */ + uint32_t *max_valbufsize;/* [ref] */ + uint32_t *secdescsize;/* [ref] */ + NTTIME *last_changed_time;/* [ref] */ + struct winreg_String *classname;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_QueryValue { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String *value_name;/* [ref] */ + enum winreg_Type *type;/* [unique] */ + uint8_t *data;/* [unique,length_is(*data_length),size_is(*data_size)] */ + uint32_t *data_size;/* [unique] */ + uint32_t *data_length;/* [unique] */ + } in; + + struct { + enum winreg_Type *type;/* [unique] */ + uint8_t *data;/* [unique,length_is(*data_length),size_is(*data_size)] */ + uint32_t *data_size;/* [unique] */ + uint32_t *data_length;/* [unique] */ + WERROR result; + } out; + +}; + + +struct winreg_ReplaceKey { + struct { + WERROR result; + } out; + +}; + + +struct winreg_RestoreKey { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String *filename;/* [ref] */ + uint32_t flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_SaveKey { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String *filename;/* [ref] */ + struct KeySecurityAttribute *sec_attrib;/* [unique] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_SetKeySecurity { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t sec_info; + struct KeySecurityData *sd;/* [ref] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_SetValue { + struct { + struct policy_handle *handle;/* [ref] */ + struct winreg_String name; + enum winreg_Type type; + uint8_t *data;/* [ref,size_is(size)] */ + uint32_t size; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_UnLoadKey { + struct { + WERROR result; + } out; + +}; + + +struct winreg_InitiateSystemShutdown { + struct { + uint16_t *hostname;/* [unique] */ + struct lsa_StringLarge *message;/* [unique] */ + uint32_t timeout; + uint8_t force_apps; + uint8_t do_reboot; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_AbortSystemShutdown { + struct { + uint16_t *server;/* [unique] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_GetVersion { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + uint32_t *version;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_OpenHKCC { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_OpenHKDD { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_QueryMultipleValues { + struct { + struct policy_handle *key_handle;/* [ref] */ + uint32_t num_values; + struct QueryMultipleValue *values;/* [ref,length_is(num_values),size_is(num_values)] */ + uint8_t *buffer;/* [unique,length_is(*buffer_size),size_is(*buffer_size)] */ + uint32_t *buffer_size;/* [ref] */ + } in; + + struct { + struct QueryMultipleValue *values;/* [ref,length_is(num_values),size_is(num_values)] */ + uint8_t *buffer;/* [unique,length_is(*buffer_size),size_is(*buffer_size)] */ + uint32_t *buffer_size;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_InitiateSystemShutdownEx { + struct { + uint16_t *hostname;/* [unique] */ + struct lsa_StringLarge *message;/* [unique] */ + uint32_t timeout; + uint8_t force_apps; + uint8_t do_reboot; + uint32_t reason; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct winreg_SaveKeyEx { + struct { + WERROR result; + } out; + +}; + + +struct winreg_OpenHKPT { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_OpenHKPN { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + WERROR result; + } out; + +}; + + +struct winreg_QueryMultipleValues2 { + struct { + WERROR result; + } out; + +}; + +#endif /* _HEADER_winreg */ diff --git a/librpc/gen_ndr/wkssvc.h b/librpc/gen_ndr/wkssvc.h new file mode 100644 index 0000000000..07b4c40e83 --- /dev/null +++ b/librpc/gen_ndr/wkssvc.h @@ -0,0 +1,981 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/srvsvc.h" +#include "librpc/gen_ndr/lsa.h" +#ifndef _HEADER_wkssvc +#define _HEADER_wkssvc + +enum srvsvc_PlatformId; + +struct wkssvc_NetWkstaInfo100 { + enum srvsvc_PlatformId platform_id; + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [unique,charset(UTF16)] */ + uint32_t version_major; + uint32_t version_minor; +}; + +struct wkssvc_NetWkstaInfo101 { + enum srvsvc_PlatformId platform_id; + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [unique,charset(UTF16)] */ + uint32_t version_major; + uint32_t version_minor; + const char *lan_root;/* [unique,charset(UTF16)] */ +}; + +struct wkssvc_NetWkstaInfo102 { + enum srvsvc_PlatformId platform_id; + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [unique,charset(UTF16)] */ + uint32_t version_major; + uint32_t version_minor; + const char *lan_root;/* [unique,charset(UTF16)] */ + uint32_t logged_on_users; +}; + +struct wkssvc_NetWkstaInfo502 { + uint32_t char_wait; + uint32_t collection_time; + uint32_t maximum_collection_count; + uint32_t keep_connection; + uint32_t max_commands; + uint32_t session_timeout; + uint32_t size_char_buf; + uint32_t max_threads; + uint32_t lock_quota; + uint32_t lock_increment; + uint32_t lock_maximum; + uint32_t pipe_increment; + uint32_t pipe_maximum; + uint32_t cache_file_timeout; + uint32_t dormant_file_limit; + uint32_t read_ahead_throughput; + uint32_t num_mailslot_buffers; + uint32_t num_srv_announce_buffers; + uint32_t max_illegal_dgram_events; + uint32_t dgram_event_reset_freq; + uint32_t log_election_packets; + uint32_t use_opportunistic_locking; + uint32_t use_unlock_behind; + uint32_t use_close_behind; + uint32_t buf_named_pipes; + uint32_t use_lock_read_unlock; + uint32_t utilize_nt_caching; + uint32_t use_raw_read; + uint32_t use_raw_write; + uint32_t use_write_raw_data; + uint32_t use_encryption; + uint32_t buf_files_deny_write; + uint32_t buf_read_only_files; + uint32_t force_core_create_mode; + uint32_t use_512_byte_max_transfer; +}; + +struct wkssvc_NetWkstaInfo1010 { + uint32_t char_wait; +}; + +struct wkssvc_NetWkstaInfo1011 { + uint32_t collection_time; +}; + +struct wkssvc_NetWkstaInfo1012 { + uint32_t maximum_collection_count; +}; + +struct wkssvc_NetWkstaInfo1013 { + uint32_t keep_connection; +}; + +struct wkssvc_NetWkstaInfo1018 { + uint32_t session_timeout; +}; + +struct wkssvc_NetWkstaInfo1023 { + uint32_t size_char_buf; +}; + +struct wkssvc_NetWkstaInfo1027 { + uint32_t errorlog_sz; +}; + +struct wkssvc_NetWkstaInfo1028 { + uint32_t print_buf_time; +}; + +struct wkssvc_NetWkstaInfo1032 { + uint32_t wrk_heuristics; +}; + +struct wkssvc_NetWkstaInfo1033 { + uint32_t max_threads; +}; + +struct wkssvc_NetWkstaInfo1041 { + uint32_t lock_quota; +}; + +struct wkssvc_NetWkstaInfo1042 { + uint32_t lock_increment; +}; + +struct wkssvc_NetWkstaInfo1043 { + uint32_t lock_maximum; +}; + +struct wkssvc_NetWkstaInfo1044 { + uint32_t pipe_increment; +}; + +struct wkssvc_NetWkstaInfo1045 { + uint32_t pipe_maximum; +}; + +struct wkssvc_NetWkstaInfo1046 { + uint32_t dormant_file_limit; +}; + +struct wkssvc_NetWkstaInfo1047 { + uint32_t cache_file_timeout; +}; + +struct wkssvc_NetWkstaInfo1048 { + uint32_t use_opportunistic_locking; +}; + +struct wkssvc_NetWkstaInfo1049 { + uint32_t use_unlock_behind; +}; + +struct wkssvc_NetWkstaInfo1050 { + uint32_t use_close_behind; +}; + +struct wkssvc_NetWkstaInfo1051 { + uint32_t buf_named_pipes; +}; + +struct wkssvc_NetWkstaInfo1052 { + uint32_t use_lock_read_unlock; +}; + +struct wkssvc_NetWkstaInfo1053 { + uint32_t utilize_nt_caching; +}; + +struct wkssvc_NetWkstaInfo1054 { + uint32_t use_raw_read; +}; + +struct wkssvc_NetWkstaInfo1055 { + uint32_t use_raw_write; +}; + +struct wkssvc_NetWkstaInfo1056 { + uint32_t use_write_raw_data; +}; + +struct wkssvc_NetWkstaInfo1057 { + uint32_t use_encryption; +}; + +struct wkssvc_NetWkstaInfo1058 { + uint32_t buf_files_deny_write; +}; + +struct wkssvc_NetWkstaInfo1059 { + uint32_t buf_read_only_files; +}; + +struct wkssvc_NetWkstaInfo1060 { + uint32_t force_core_create_mode; +}; + +struct wkssvc_NetWkstaInfo1061 { + uint32_t use_512_byte_max_transfer; +}; + +struct wkssvc_NetWkstaInfo1062 { + uint32_t read_ahead_throughput; +}; + +union wkssvc_NetWkstaInfo { + struct wkssvc_NetWkstaInfo100 *info100;/* [unique,case(100)] */ + struct wkssvc_NetWkstaInfo101 *info101;/* [unique,case(101)] */ + struct wkssvc_NetWkstaInfo102 *info102;/* [unique,case(102)] */ + struct wkssvc_NetWkstaInfo502 *info502;/* [unique,case(502)] */ + struct wkssvc_NetWkstaInfo1010 *info1010;/* [unique,case(1010)] */ + struct wkssvc_NetWkstaInfo1011 *info1011;/* [unique,case(1011)] */ + struct wkssvc_NetWkstaInfo1012 *info1012;/* [unique,case(1012)] */ + struct wkssvc_NetWkstaInfo1013 *info1013;/* [unique,case(1013)] */ + struct wkssvc_NetWkstaInfo1018 *info1018;/* [unique,case(1018)] */ + struct wkssvc_NetWkstaInfo1023 *info1023;/* [unique,case(1023)] */ + struct wkssvc_NetWkstaInfo1027 *info1027;/* [unique,case(1027)] */ + struct wkssvc_NetWkstaInfo1028 *info1028;/* [unique,case(1028)] */ + struct wkssvc_NetWkstaInfo1032 *info1032;/* [unique,case(1032)] */ + struct wkssvc_NetWkstaInfo1033 *info1033;/* [unique,case(1033)] */ + struct wkssvc_NetWkstaInfo1041 *info1041;/* [unique,case(1041)] */ + struct wkssvc_NetWkstaInfo1042 *info1042;/* [unique,case(1042)] */ + struct wkssvc_NetWkstaInfo1043 *info1043;/* [unique,case(1043)] */ + struct wkssvc_NetWkstaInfo1044 *info1044;/* [unique,case(1044)] */ + struct wkssvc_NetWkstaInfo1045 *info1045;/* [unique,case(1045)] */ + struct wkssvc_NetWkstaInfo1046 *info1046;/* [unique,case(1046)] */ + struct wkssvc_NetWkstaInfo1047 *info1047;/* [unique,case(1047)] */ + struct wkssvc_NetWkstaInfo1048 *info1048;/* [unique,case(1048)] */ + struct wkssvc_NetWkstaInfo1049 *info1049;/* [unique,case(1049)] */ + struct wkssvc_NetWkstaInfo1050 *info1050;/* [unique,case(1050)] */ + struct wkssvc_NetWkstaInfo1051 *info1051;/* [unique,case(1051)] */ + struct wkssvc_NetWkstaInfo1052 *info1052;/* [unique,case(1052)] */ + struct wkssvc_NetWkstaInfo1053 *info1053;/* [unique,case(1053)] */ + struct wkssvc_NetWkstaInfo1054 *info1054;/* [unique,case(1054)] */ + struct wkssvc_NetWkstaInfo1055 *info1055;/* [unique,case(1055)] */ + struct wkssvc_NetWkstaInfo1056 *info1056;/* [unique,case(1056)] */ + struct wkssvc_NetWkstaInfo1057 *info1057;/* [unique,case(1057)] */ + struct wkssvc_NetWkstaInfo1058 *info1058;/* [unique,case(1058)] */ + struct wkssvc_NetWkstaInfo1059 *info1059;/* [unique,case(1059)] */ + struct wkssvc_NetWkstaInfo1060 *info1060;/* [unique,case(1060)] */ + struct wkssvc_NetWkstaInfo1061 *info1061;/* [unique,case(1061)] */ + struct wkssvc_NetWkstaInfo1062 *info1062;/* [unique,case(1062)] */ +}; + +struct wkssvc_NetrWkstaUserInfo0 { + const char *user_name;/* [unique,charset(UTF16)] */ +}; + +struct wkssvc_NetWkstaEnumUsersCtr0 { + uint32_t entries_read; + struct wkssvc_NetrWkstaUserInfo0 *user0;/* [unique,size_is(entries_read)] */ +}; + +struct wkssvc_NetrWkstaUserInfo1 { + const char *user_name;/* [unique,charset(UTF16)] */ + const char *logon_domain;/* [unique,charset(UTF16)] */ + const char *other_domains;/* [unique,charset(UTF16)] */ + const char *logon_server;/* [unique,charset(UTF16)] */ +}; + +struct wkssvc_NetWkstaEnumUsersCtr1 { + uint32_t entries_read; + struct wkssvc_NetrWkstaUserInfo1 *user1;/* [unique,size_is(entries_read)] */ +}; + +union wkssvc_NetWkstaEnumUsersCtr { + struct wkssvc_NetWkstaEnumUsersCtr0 *user0;/* [unique,case(0)] */ + struct wkssvc_NetWkstaEnumUsersCtr1 *user1;/* [unique,case] */ +}/* [switch_type(uint32)] */; + +struct wkssvc_NetWkstaEnumUsersInfo { + uint32_t level; + union wkssvc_NetWkstaEnumUsersCtr ctr;/* [switch_is(level)] */ +}; + +struct wkssvc_NetrWkstaUserInfo1101 { + const char *other_domains;/* [unique,charset(UTF16)] */ +}; + +union wkssvc_NetrWkstaUserInfo { + struct wkssvc_NetrWkstaUserInfo0 *info0;/* [unique,case(0)] */ + struct wkssvc_NetrWkstaUserInfo1 *info1;/* [unique,case] */ + struct wkssvc_NetrWkstaUserInfo1101 *info1101;/* [unique,case(1101)] */ +}/* [switch_type(uint32)] */; + +struct wkssvc_NetWkstaTransportInfo0 { + uint32_t quality_of_service; + uint32_t vc_count; + const char *name;/* [unique,charset(UTF16)] */ + const char *address;/* [unique,charset(UTF16)] */ + uint32_t wan_link; +}; + +struct wkssvc_NetWkstaTransportCtr0 { + uint32_t count; + struct wkssvc_NetWkstaTransportInfo0 *array;/* [unique,size_is(count)] */ +}; + +union wkssvc_NetWkstaTransportCtr { + struct wkssvc_NetWkstaTransportCtr0 *ctr0;/* [unique,case(0)] */ +}; + +struct wkssvc_NetWkstaTransportInfo { + uint32_t level; + union wkssvc_NetWkstaTransportCtr ctr;/* [switch_is(level)] */ +}; + +struct wkssvc_NetrUseInfo3 { + const char *unknown1;/* [unique,charset(UTF16)] */ + const char *unknown2;/* [unique,charset(UTF16)] */ +}; + +struct wkssvc_NetrUseInfo2 { + const char *local;/* [unique,charset(UTF16)] */ + const char *remote;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ + uint32_t status; + uint32_t asg_type; + uint32_t ref_count; + uint32_t use_count; + const char *user_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [unique,charset(UTF16)] */ +}; + +struct wkssvc_NetrUseInfo1 { + const char *local;/* [unique,charset(UTF16)] */ + const char *remote;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ + uint32_t status; + uint32_t asg_type; + uint32_t ref_count; + uint32_t use_count; +}; + +struct wkssvc_NetrUseInfo0 { + const char *local;/* [unique,charset(UTF16)] */ + const char *remote;/* [unique,charset(UTF16)] */ +}; + +union wkssvc_NetrUseGetInfoCtr { + struct wkssvc_NetrUseInfo0 *info0;/* [unique,case(0)] */ + struct wkssvc_NetrUseInfo1 *info1;/* [unique,case] */ + struct wkssvc_NetrUseInfo2 *info2;/* [unique,case(2)] */ + struct wkssvc_NetrUseInfo3 *info3;/* [unique,case(3)] */ +}/* [switch_type(uint32)] */; + +struct wkssvc_NetrUseEnumCtr2 { + uint32_t count; + struct wkssvc_NetrUseInfo2 *array;/* [unique,size_is(count)] */ +}; + +struct wkssvc_NetrUseEnumCtr1 { + uint32_t count; + struct wkssvc_NetrUseInfo1 *array;/* [unique,size_is(count)] */ +}; + +struct wkssvc_NetrUseEnumCtr0 { + uint32_t count; + struct wkssvc_NetrUseInfo0 *array;/* [unique,size_is(count)] */ +}; + +union wkssvc_NetrUseEnumCtr { + struct wkssvc_NetrUseEnumCtr0 *ctr0;/* [unique,case(0)] */ + struct wkssvc_NetrUseEnumCtr1 *ctr1;/* [unique,case] */ + struct wkssvc_NetrUseEnumCtr2 *ctr2;/* [unique,case(2)] */ +}/* [switch_type(uint32)] */; + +struct wkssvc_NetrUseEnumInfo { + uint32_t level; + union wkssvc_NetrUseEnumCtr ctr;/* [switch_is(level)] */ +}; + +struct wkssvc_NetrWorkstationStatistics { + uint64_t unknown1; + uint64_t unknown2; + uint64_t unknown3; + uint64_t unknown4; + uint64_t unknown5; + uint64_t unknown6; + uint64_t unknown7; + uint64_t unknown8; + uint64_t unknown9; + uint64_t unknown10; + uint64_t unknown11; + uint64_t unknown12; + uint64_t unknown13; + uint32_t unknown14; + uint32_t unknown15; + uint32_t unknown16; + uint32_t unknown17; + uint32_t unknown18; + uint32_t unknown19; + uint32_t unknown20; + uint32_t unknown21; + uint32_t unknown22; + uint32_t unknown23; + uint32_t unknown24; + uint32_t unknown25; + uint32_t unknown26; + uint32_t unknown27; + uint32_t unknown28; + uint32_t unknown29; + uint32_t unknown30; + uint32_t unknown31; + uint32_t unknown32; + uint32_t unknown33; + uint32_t unknown34; + uint32_t unknown35; + uint32_t unknown36; + uint32_t unknown37; + uint32_t unknown38; + uint32_t unknown39; + uint32_t unknown40; +}; + +/* bitmap wkssvc_renameflags */ +#define WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE ( 0x00000002 ) + +enum wkssvc_NetValidateNameType +#ifndef USE_UINT_ENUMS + { + NetSetupUnknown=0, + NetSetupMachine=1, + NetSetupWorkgroup=2, + NetSetupDomain=3, + NetSetupNonExistentDomain=4, + NetSetupDnsMachine=5 +} +#else + { __donnot_use_enum_wkssvc_NetValidateNameType=0x7FFFFFFF} +#define NetSetupUnknown ( 0 ) +#define NetSetupMachine ( 1 ) +#define NetSetupWorkgroup ( 2 ) +#define NetSetupDomain ( 3 ) +#define NetSetupNonExistentDomain ( 4 ) +#define NetSetupDnsMachine ( 5 ) +#endif +; + +enum wkssvc_NetJoinStatus +#ifndef USE_UINT_ENUMS + { + NET_SETUP_UNKNOWN_STATUS=0, + NET_SETUP_UNJOINED=1, + NET_SETUP_WORKGROUP_NAME=2, + NET_SETUP_DOMAIN_NAME=3 +} +#else + { __donnot_use_enum_wkssvc_NetJoinStatus=0x7FFFFFFF} +#define NET_SETUP_UNKNOWN_STATUS ( 0 ) +#define NET_SETUP_UNJOINED ( 1 ) +#define NET_SETUP_WORKGROUP_NAME ( 2 ) +#define NET_SETUP_DOMAIN_NAME ( 3 ) +#endif +; + +struct wkssvc_PasswordBuffer { + uint8_t data[524]; +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +/* bitmap wkssvc_joinflags */ +#define WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME ( 0x00000400 ) +#define WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT ( 0x00000200 ) +#define WKSSVC_JOIN_FLAGS_DEFER_SPN ( 0x00000100 ) +#define WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED ( 0x00000080 ) +#define WKSSVC_JOIN_FLAGS_JOIN_UNSECURE ( 0x00000040 ) +#define WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED ( 0x00000020 ) +#define WKSSVC_JOIN_FLAGS_WIN9X_UPGRADE ( 0x00000010 ) +#define WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE ( 0x00000004 ) +#define WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE ( 0x00000002 ) +#define WKSSVC_JOIN_FLAGS_JOIN_TYPE ( 0x00000001 ) + +enum wkssvc_ComputerNameType +#ifndef USE_UINT_ENUMS + { + NetPrimaryComputerName=0, + NetAlternateComputerNames=1, + NetAllComputerNames=2, + NetComputerNameTypeMax=3 +} +#else + { __donnot_use_enum_wkssvc_ComputerNameType=0x7FFFFFFF} +#define NetPrimaryComputerName ( 0 ) +#define NetAlternateComputerNames ( 1 ) +#define NetAllComputerNames ( 2 ) +#define NetComputerNameTypeMax ( 3 ) +#endif +; + +struct wkssvc_ComputerNamesCtr { + uint32_t count; + struct lsa_String *computer_name;/* [unique,size_is(count)] */ +}; + + +struct wkssvc_NetWkstaGetInfo { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t level; + } in; + + struct { + union wkssvc_NetWkstaInfo *info;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetWkstaSetInfo { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t level; + union wkssvc_NetWkstaInfo *info;/* [ref,switch_is(level)] */ + uint32_t *parm_error;/* [ref] */ + } in; + + struct { + uint32_t *parm_error;/* [ref] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetWkstaEnumUsers { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t prefmaxlen; + struct wkssvc_NetWkstaEnumUsersInfo *info;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *entries_read;/* [ref] */ + struct wkssvc_NetWkstaEnumUsersInfo *info;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrWkstaUserGetInfo { + struct { + const char *unknown;/* [unique,charset(UTF16)] */ + uint32_t level; + } in; + + struct { + union wkssvc_NetrWkstaUserInfo *info;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrWkstaUserSetInfo { + struct { + const char *unknown;/* [unique,charset(UTF16)] */ + uint32_t level; + union wkssvc_NetrWkstaUserInfo *info;/* [ref,switch_is(level)] */ + uint32_t *parm_err;/* [unique] */ + } in; + + struct { + uint32_t *parm_err;/* [unique] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetWkstaTransportEnum { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t max_buffer; + struct wkssvc_NetWkstaTransportInfo *info;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *total_entries;/* [ref] */ + struct wkssvc_NetWkstaTransportInfo *info;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrWkstaTransportAdd { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t level; + struct wkssvc_NetWkstaTransportInfo0 *info0;/* [ref] */ + uint32_t *parm_err;/* [unique] */ + } in; + + struct { + uint32_t *parm_err;/* [unique] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrWkstaTransportDel { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *transport_name;/* [unique,charset(UTF16)] */ + uint32_t unknown3; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrUseAdd { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t level; + union wkssvc_NetrUseGetInfoCtr *ctr;/* [ref,switch_is(level)] */ + uint32_t *parm_err;/* [unique] */ + } in; + + struct { + uint32_t *parm_err;/* [unique] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrUseGetInfo { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *use_name;/* [ref,charset(UTF16)] */ + uint32_t level; + } in; + + struct { + union wkssvc_NetrUseGetInfoCtr *ctr;/* [ref,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrUseDel { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *use_name;/* [ref,charset(UTF16)] */ + uint32_t force_cond; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrUseEnum { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t prefmaxlen; + struct wkssvc_NetrUseEnumInfo *info;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + } in; + + struct { + uint32_t *entries_read;/* [ref] */ + struct wkssvc_NetrUseEnumInfo *info;/* [ref] */ + uint32_t *resume_handle;/* [unique] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrMessageBufferSend { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *message_name;/* [ref,charset(UTF16)] */ + const char *message_sender_name;/* [unique,charset(UTF16)] */ + uint8_t *message_buffer;/* [ref,size_is(message_size)] */ + uint32_t message_size; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrWorkstationStatisticsGet { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *unknown2;/* [unique,charset(UTF16)] */ + uint32_t unknown3; + uint32_t unknown4; + } in; + + struct { + struct wkssvc_NetrWorkstationStatistics **info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrLogonDomainNameAdd { + struct { + const char *domain_name;/* [ref,charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrLogonDomainNameDel { + struct { + const char *domain_name;/* [ref,charset(UTF16)] */ + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrJoinDomain { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [ref,charset(UTF16)] */ + const char *account_ou;/* [unique,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ + uint32_t join_flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrUnjoinDomain { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ + uint32_t unjoin_flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrRenameMachineInDomain { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *NewMachineName;/* [unique,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + const char *password;/* [unique,charset(UTF16)] */ + uint32_t RenameOptions; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrValidateName { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *name;/* [ref,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + const char *Password;/* [unique,charset(UTF16)] */ + enum wkssvc_NetValidateNameType name_type; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrGetJoinInformation { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char **name_buffer;/* [ref,charset(UTF16)] */ + } in; + + struct { + enum wkssvc_NetJoinStatus *name_type;/* [ref] */ + const char **name_buffer;/* [ref,charset(UTF16)] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrGetJoinableOus { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [ref,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + const char *unknown;/* [unique,charset(UTF16)] */ + uint32_t *num_ous;/* [ref] */ + } in; + + struct { + const char ***ous;/* [ref,charset(UTF16),size_is(,*num_ous)] */ + uint32_t *num_ous;/* [ref] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrJoinDomain2 { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [ref,charset(UTF16)] */ + const char *account_ou;/* [unique,charset(UTF16)] */ + const char *admin_account;/* [unique,charset(UTF16)] */ + struct wkssvc_PasswordBuffer *encrypted_password;/* [unique] */ + uint32_t join_flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrUnjoinDomain2 { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account;/* [unique,charset(UTF16)] */ + struct wkssvc_PasswordBuffer *encrypted_password;/* [unique] */ + uint32_t unjoin_flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrRenameMachineInDomain2 { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *NewMachineName;/* [unique,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ + uint32_t RenameOptions; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrValidateName2 { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *name;/* [ref,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ + enum wkssvc_NetValidateNameType name_type; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrGetJoinableOus2 { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [ref,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ + uint32_t *num_ous;/* [ref] */ + } in; + + struct { + const char ***ous;/* [ref,charset(UTF16),size_is(,*num_ous)] */ + uint32_t *num_ous;/* [ref] */ + WERROR result; + } out; + +}; + + +struct wkssvc_NetrAddAlternateComputerName { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *NewAlternateMachineName;/* [unique,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ + uint32_t Reserved; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrRemoveAlternateComputerName { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *AlternateMachineNameToRemove;/* [unique,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ + uint32_t Reserved; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrSetPrimaryComputername { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *primary_name;/* [unique,charset(UTF16)] */ + const char *Account;/* [unique,charset(UTF16)] */ + struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ + uint32_t Reserved; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct wkssvc_NetrEnumerateComputerNames { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + enum wkssvc_ComputerNameType name_type; + uint32_t Reserved; + } in; + + struct { + struct wkssvc_ComputerNamesCtr **ctr;/* [ref] */ + WERROR result; + } out; + +}; + +#endif /* _HEADER_wkssvc */ diff --git a/librpc/gen_ndr/xattr.h b/librpc/gen_ndr/xattr.h new file mode 100644 index 0000000000..1148a0acec --- /dev/null +++ b/librpc/gen_ndr/xattr.h @@ -0,0 +1,91 @@ +/* header auto-generated by pidl */ + +#include + +#include "librpc/gen_ndr/security.h" +#ifndef _HEADER_xattr +#define _HEADER_xattr + +#define XATTR_DOSATTRIB_NAME ( "user.DosAttrib" ) +#define XATTR_DOSATTRIB_ESTIMATED_SIZE ( 64 ) +#define XATTR_DOSEAS_NAME ( "user.DosEAs" ) +#define XATTR_DOSSTREAMS_NAME ( "user.DosStreams" ) +#define XATTR_STREAM_FLAG_INTERNAL ( 0x00000001 ) +#define XATTR_DOSSTREAM_PREFIX ( "user.DosStream." ) +#define XATTR_MAX_STREAM_SIZE ( 0x4000 ) +#define XATTR_MAX_STREAM_SIZE_TDB ( 0x100000 ) +#define XATTR_NTACL_NAME ( "security.NTACL" ) +struct xattr_DosInfo1 { + uint32_t attrib; + uint32_t ea_size; + uint64_t size; + uint64_t alloc_size; + NTTIME create_time; + NTTIME change_time; +}; + +struct xattr_DosInfo2Old { + uint32_t flags; + uint32_t attrib; + uint32_t ea_size; + uint64_t size; + uint64_t alloc_size; + NTTIME create_time; + NTTIME change_time; + NTTIME write_time; + const char * name;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +union xattr_DosInfo { + struct xattr_DosInfo1 info1;/* [case] */ + struct xattr_DosInfo2Old oldinfo2;/* [case(2)] */ +}/* [switch_type(uint16)] */; + +struct xattr_DosAttrib { + uint16_t version; + union xattr_DosInfo info;/* [switch_is(version)] */ +}/* [public] */; + +struct xattr_EA { + const char * name;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */ + DATA_BLOB value; +}; + +struct xattr_DosEAs { + uint16_t num_eas; + struct xattr_EA *eas;/* [unique,size_is(num_eas)] */ +}/* [public] */; + +struct tdb_xattrs { + uint32_t num_eas; + struct xattr_EA *eas; +}/* [public] */; + +struct xattr_DosStream { + uint32_t flags; + uint64_t size; + uint64_t alloc_size; + const char * name;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */ +}; + +struct xattr_DosStreams { + uint32_t num_streams; + struct xattr_DosStream *streams;/* [unique,size_is(num_streams)] */ +}/* [public] */; + +struct security_descriptor_hash { + struct security_descriptor *sd;/* [unique] */ + uint8_t hash[16]; +}/* [public] */; + +union xattr_NTACL_Info { + struct security_descriptor *sd;/* [unique,case] */ + struct security_descriptor_hash *sd_hs;/* [unique,case(2)] */ +}/* [switch_type(uint16)] */; + +struct xattr_NTACL { + uint16_t version; + union xattr_NTACL_Info info;/* [switch_is(version)] */ +}/* [public] */; + +#endif /* _HEADER_xattr */ diff --git a/source3/Makefile.in b/source3/Makefile.in index d02246befb..fa5bf8b6a1 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -256,9 +256,9 @@ PASSCHANGE_OBJ = libsmb/passchange.o LIBNDR_DRSUAPI_OBJ = ../librpc/ndr/ndr_drsuapi.o \ ../librpc/ndr/ndr_compression.o \ - librpc/gen_ndr/ndr_drsuapi.o \ + ../librpc/gen_ndr/ndr_drsuapi.o \ ../librpc/ndr/ndr_drsblobs.o \ - librpc/gen_ndr/ndr_drsblobs.o + ../librpc/gen_ndr/ndr_drsblobs.o ZLIB_OBJ = @ZLIB_OBJS@ @@ -272,8 +272,8 @@ DRSUAPI_OBJ = $(LIBNDR_DRSUAPI_OBJ) \ LIBNDR_OBJ = ../librpc/ndr/ndr_basic.o \ ../librpc/ndr/ndr.o \ ../librpc/ndr/ndr_misc.o \ - librpc/gen_ndr/ndr_misc.o \ - librpc/gen_ndr/ndr_security.o \ + ../librpc/gen_ndr/ndr_misc.o \ + ../librpc/gen_ndr/ndr_security.o \ ../librpc/ndr/ndr_sec_helper.o \ librpc/ndr/ndr_string.o \ librpc/ndr/sid.o \ @@ -282,27 +282,27 @@ LIBNDR_OBJ = ../librpc/ndr/ndr_basic.o \ RPCCLIENT_NDR_OBJ = rpc_client/ndr.o -LIBNDR_GEN_OBJ0 = librpc/gen_ndr/ndr_samr.o \ - librpc/gen_ndr/ndr_lsa.o +LIBNDR_GEN_OBJ0 = ../librpc/gen_ndr/ndr_samr.o \ + ../librpc/gen_ndr/ndr_lsa.o -LIBNDR_GEN_OBJ1 = librpc/gen_ndr/ndr_netlogon.o \ +LIBNDR_GEN_OBJ1 = ../librpc/gen_ndr/ndr_netlogon.o \ ../librpc/ndr/ndr_netlogon.o -LIBNDR_GEN_OBJ = librpc/gen_ndr/ndr_wkssvc.o \ +LIBNDR_GEN_OBJ = ../librpc/gen_ndr/ndr_wkssvc.o \ $(LIBNDR_GEN_OBJ0) \ - librpc/gen_ndr/ndr_dfs.o \ - librpc/gen_ndr/ndr_echo.o \ - librpc/gen_ndr/ndr_winreg.o \ - librpc/gen_ndr/ndr_initshutdown.o \ - librpc/gen_ndr/ndr_srvsvc.o \ - librpc/gen_ndr/ndr_eventlog.o \ + ../librpc/gen_ndr/ndr_dfs.o \ + ../librpc/gen_ndr/ndr_echo.o \ + ../librpc/gen_ndr/ndr_winreg.o \ + ../librpc/gen_ndr/ndr_initshutdown.o \ + ../librpc/gen_ndr/ndr_srvsvc.o \ + ../librpc/gen_ndr/ndr_eventlog.o \ $(LIBNDR_GEN_OBJ1) \ - librpc/gen_ndr/ndr_dssetup.o \ - librpc/gen_ndr/ndr_notify.o \ - librpc/gen_ndr/ndr_xattr.o \ - librpc/gen_ndr/ndr_epmapper.o \ - librpc/gen_ndr/ndr_named_pipe_auth.o \ - librpc/gen_ndr/ndr_ntsvcs.o + ../librpc/gen_ndr/ndr_dssetup.o \ + ../librpc/gen_ndr/ndr_notify.o \ + ../librpc/gen_ndr/ndr_xattr.o \ + ../librpc/gen_ndr/ndr_epmapper.o \ + ../librpc/gen_ndr/ndr_named_pipe_auth.o \ + ../librpc/gen_ndr/ndr_ntsvcs.o RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o @@ -399,15 +399,15 @@ LIBADS_OBJ = libads/ldap.o libads/ldap_printer.o \ LIBADS_SERVER_OBJ = libads/kerberos_verify.o libads/authdata.o \ ../librpc/ndr/ndr_krb5pac.o \ - librpc/gen_ndr/ndr_krb5pac.o + ../librpc/gen_ndr/ndr_krb5pac.o SECRETS_OBJ = passdb/secrets.o passdb/machine_sid.o LIBNBT_OBJ = ../libcli/nbt/nbtname.o \ ../libcli/netlogon.o \ ../libcli/ndr_netlogon.o \ - librpc/gen_ndr/ndr_nbt.o \ - librpc/gen_ndr/ndr_svcctl.o + ../librpc/gen_ndr/ndr_nbt.o \ + ../librpc/gen_ndr/ndr_svcctl.o LIBNMB_OBJ = libsmb/unexpected.o libsmb/namecache.o libsmb/nmblib.o \ libsmb/namequery.o libsmb/conncache.o libads/dns.o @@ -459,21 +459,21 @@ LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \ librpc/rpc/dcerpc.o \ ../librpc/rpc/binding.o -LIBMSRPC_GEN_OBJ = librpc/gen_ndr/cli_lsa.o \ - librpc/gen_ndr/cli_dfs.o \ - librpc/gen_ndr/cli_echo.o \ - librpc/gen_ndr/cli_srvsvc.o \ - librpc/gen_ndr/cli_svcctl.o \ - librpc/gen_ndr/cli_winreg.o \ - librpc/gen_ndr/cli_initshutdown.o \ - librpc/gen_ndr/cli_eventlog.o \ - librpc/gen_ndr/cli_wkssvc.o \ - librpc/gen_ndr/cli_netlogon.o \ - librpc/gen_ndr/cli_samr.o \ - librpc/gen_ndr/cli_dssetup.o \ - librpc/gen_ndr/cli_ntsvcs.o \ - librpc/gen_ndr/cli_epmapper.o \ - librpc/gen_ndr/cli_drsuapi.o \ +LIBMSRPC_GEN_OBJ = ../librpc/gen_ndr/cli_lsa.o \ + ../librpc/gen_ndr/cli_dfs.o \ + ../librpc/gen_ndr/cli_echo.o \ + ../librpc/gen_ndr/cli_srvsvc.o \ + ../librpc/gen_ndr/cli_svcctl.o \ + ../librpc/gen_ndr/cli_winreg.o \ + ../librpc/gen_ndr/cli_initshutdown.o \ + ../librpc/gen_ndr/cli_eventlog.o \ + ../librpc/gen_ndr/cli_wkssvc.o \ + ../librpc/gen_ndr/cli_netlogon.o \ + ../librpc/gen_ndr/cli_samr.o \ + ../librpc/gen_ndr/cli_dssetup.o \ + ../librpc/gen_ndr/cli_ntsvcs.o \ + ../librpc/gen_ndr/cli_epmapper.o \ + ../librpc/gen_ndr/cli_drsuapi.o \ $(LIBNDR_GEN_OBJ) \ $(RPCCLIENT_NDR_OBJ) @@ -527,47 +527,47 @@ REG_FULL_OBJ = $(REG_SMBCONF_OBJ) \ registry/reg_util_legacy.o -RPC_LSA_OBJ = rpc_server/srv_lsa_nt.o librpc/gen_ndr/srv_lsa.o +RPC_LSA_OBJ = rpc_server/srv_lsa_nt.o ../librpc/gen_ndr/srv_lsa.o RPC_NETLOG_OBJ = rpc_server/srv_netlog_nt.o \ - librpc/gen_ndr/srv_netlogon.o + ../librpc/gen_ndr/srv_netlogon.o RPC_SAMR_OBJ = rpc_server/srv_samr_nt.o \ rpc_server/srv_samr_util.o \ - librpc/gen_ndr/srv_samr.o + ../librpc/gen_ndr/srv_samr.o -RPC_INITSHUTDOWN_OBJ = librpc/gen_ndr/srv_initshutdown.o rpc_server/srv_initshutdown_nt.o +RPC_INITSHUTDOWN_OBJ = ../librpc/gen_ndr/srv_initshutdown.o rpc_server/srv_initshutdown_nt.o RPC_REG_OBJ = rpc_server/srv_winreg_nt.o \ - librpc/gen_ndr/srv_winreg.o + ../librpc/gen_ndr/srv_winreg.o -RPC_DSSETUP_OBJ = rpc_server/srv_dssetup_nt.o librpc/gen_ndr/srv_dssetup.o +RPC_DSSETUP_OBJ = rpc_server/srv_dssetup_nt.o ../librpc/gen_ndr/srv_dssetup.o RPC_SVC_OBJ = rpc_server/srv_srvsvc_nt.o \ - librpc/gen_ndr/srv_srvsvc.o + ../librpc/gen_ndr/srv_srvsvc.o -RPC_WKS_OBJ = librpc/gen_ndr/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o +RPC_WKS_OBJ = ../librpc/gen_ndr/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o RPC_SVCCTL_OBJ = rpc_server/srv_svcctl.o rpc_server/srv_svcctl_nt.o \ - librpc/gen_ndr/srv_svcctl.o \ + ../librpc/gen_ndr/srv_svcctl.o \ services/svc_spoolss.o services/svc_rcinit.o services/services_db.o \ services/svc_netlogon.o services/svc_winreg.o \ services/svc_wins.o RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs.o rpc_server/srv_ntsvcs_nt.o \ - librpc/gen_ndr/srv_ntsvcs.o + ../librpc/gen_ndr/srv_ntsvcs.o -RPC_DFS_OBJ = librpc/gen_ndr/srv_dfs.o rpc_server/srv_dfs_nt.o +RPC_DFS_OBJ = ../librpc/gen_ndr/srv_dfs.o rpc_server/srv_dfs_nt.o RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog.o rpc_server/srv_eventlog_nt.o \ - rpc_server/srv_eventlog_lib.o librpc/gen_ndr/srv_eventlog.o + rpc_server/srv_eventlog_lib.o ../librpc/gen_ndr/srv_eventlog.o RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o \ rpc_server/srv_pipe.o rpc_server/srv_lsa_hnd.o -RPC_ECHO_OBJ = rpc_server/srv_echo_nt.o librpc/gen_ndr/srv_echo.o +RPC_ECHO_OBJ = rpc_server/srv_echo_nt.o ../librpc/gen_ndr/srv_echo.o RPC_SERVER_OBJ = @RPC_STATIC@ $(RPC_PIPE_OBJ) @@ -998,10 +998,10 @@ NDRDUMP_OBJ = ../librpc/tools/ndrdump.o \ $(PARAM_OBJ) $(LIBNDR_GEN_OBJ) \ $(LIBSAMBA_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \ $(LIBNDR_DRSUAPI_OBJ) $(COMPRESSION_OBJ) \ - librpc/gen_ndr/ndr_svcctl.o \ + ../librpc/gen_ndr/ndr_svcctl.o \ librpc/gen_ndr/tables.o ../librpc/ndr/ndr_table.o \ ../librpc/ndr/ndr_krb5pac.o \ - librpc/gen_ndr/ndr_krb5pac.o ../lib/util/asn1.o + ../librpc/gen_ndr/ndr_krb5pac.o ../lib/util/asn1.o DEBUG2HTML_OBJ = utils/debug2html.o utils/debugparse.o @@ -1227,7 +1227,7 @@ modules:: SHOWFLAGS $(MODULES) ##################################################################### ## Perl IDL Compiler samba3-idl:: - @PIDL_OUTPUTDIR="librpc/gen_ndr" PIDL_ARGS="$(PIDL_ARGS)" CPP="$(CPP)" PIDL="../pidl/pidl" \ + @PIDL_OUTPUTDIR="../librpc/gen_ndr" PIDL_ARGS="$(PIDL_ARGS)" CPP="$(CPP)" PIDL="../pidl/pidl" \ srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh ../librpc/idl/lsa.idl \ ../librpc/idl/dfs.idl ../librpc/idl/echo.idl ../librpc/idl/winreg.idl \ ../librpc/idl/initshutdown.idl ../librpc/idl/srvsvc.idl ../librpc/idl/svcctl.idl \ diff --git a/source3/librpc/gen_ndr/cli_dfs.c b/source3/librpc/gen_ndr/cli_dfs.c deleted file mode 100644 index 81ec14694a..0000000000 --- a/source3/librpc/gen_ndr/cli_dfs.c +++ /dev/null @@ -1,1099 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_dfs.h" - -NTSTATUS rpccli_dfs_GetManagerVersion(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - enum dfs_ManagerVersion *version /* [out] [ref] */) -{ - struct dfs_GetManagerVersion r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_GetManagerVersion, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_GETMANAGERVERSION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_GetManagerVersion, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *version = *r.out.version; - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_dfs_Add(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *path /* [in] [ref,charset(UTF16)] */, - const char *server /* [in] [ref,charset(UTF16)] */, - const char *share /* [in] [unique,charset(UTF16)] */, - const char *comment /* [in] [unique,charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct dfs_Add r; - NTSTATUS status; - - /* In parameters */ - r.in.path = path; - r.in.server = server; - r.in.share = share; - r.in.comment = comment; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Add, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_ADD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Add, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_Remove(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *dfs_entry_path /* [in] [ref,charset(UTF16)] */, - const char *servername /* [in] [unique,charset(UTF16)] */, - const char *sharename /* [in] [unique,charset(UTF16)] */, - WERROR *werror) -{ - struct dfs_Remove r; - NTSTATUS status; - - /* In parameters */ - r.in.dfs_entry_path = dfs_entry_path; - r.in.servername = servername; - r.in.sharename = sharename; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Remove, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_REMOVE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Remove, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_SetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *dfs_entry_path /* [in] [charset(UTF16)] */, - const char *servername /* [in] [unique,charset(UTF16)] */, - const char *sharename /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union dfs_Info *info /* [in] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct dfs_SetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.dfs_entry_path = dfs_entry_path; - r.in.servername = servername; - r.in.sharename = sharename; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_SetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_SETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_SetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *dfs_entry_path /* [in] [charset(UTF16)] */, - const char *servername /* [in] [unique,charset(UTF16)] */, - const char *sharename /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union dfs_Info *info /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct dfs_GetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.dfs_entry_path = dfs_entry_path; - r.in.servername = servername; - r.in.sharename = sharename; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_GetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_GETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_GetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t level /* [in] */, - uint32_t bufsize /* [in] */, - struct dfs_EnumStruct *info /* [in,out] [unique] */, - uint32_t *total /* [in,out] [unique] */, - WERROR *werror) -{ - struct dfs_Enum r; - NTSTATUS status; - - /* In parameters */ - r.in.level = level; - r.in.bufsize = bufsize; - r.in.info = info; - r.in.total = total; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Enum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_ENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Enum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } - if (total && r.out.total) { - *total = *r.out.total; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_Rename(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dfs_Rename r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Rename, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_RENAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Rename, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_Move(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dfs_Move r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Move, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_MOVE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Move, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dfs_ManagerGetConfigInfo r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_ManagerGetConfigInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_MANAGERGETCONFIGINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_ManagerGetConfigInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_ManagerSendSiteInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dfs_ManagerSendSiteInfo r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_ManagerSendSiteInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_MANAGERSENDSITEINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_ManagerSendSiteInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *dns_servername /* [in] [charset(UTF16)] */, - const char *dfsname /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - const char *comment /* [in] [charset(UTF16)] */, - const char *dfs_config_dn /* [in] [charset(UTF16)] */, - uint8_t unknown1 /* [in] */, - uint32_t flags /* [in] */, - struct dfs_UnknownStruct **unknown2 /* [in,out] [unique] */, - WERROR *werror) -{ - struct dfs_AddFtRoot r; - NTSTATUS status; - - /* In parameters */ - r.in.servername = servername; - r.in.dns_servername = dns_servername; - r.in.dfsname = dfsname; - r.in.rootshare = rootshare; - r.in.comment = comment; - r.in.dfs_config_dn = dfs_config_dn; - r.in.unknown1 = unknown1; - r.in.flags = flags; - r.in.unknown2 = unknown2; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_AddFtRoot, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_ADDFTROOT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_AddFtRoot, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (unknown2 && r.out.unknown2) { - *unknown2 = *r.out.unknown2; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *dns_servername /* [in] [charset(UTF16)] */, - const char *dfsname /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - uint32_t flags /* [in] */, - struct dfs_UnknownStruct **unknown /* [in,out] [unique] */, - WERROR *werror) -{ - struct dfs_RemoveFtRoot r; - NTSTATUS status; - - /* In parameters */ - r.in.servername = servername; - r.in.dns_servername = dns_servername; - r.in.dfsname = dfsname; - r.in.rootshare = rootshare; - r.in.flags = flags; - r.in.unknown = unknown; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_RemoveFtRoot, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_REMOVEFTROOT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (unknown && r.out.unknown) { - *unknown = *r.out.unknown; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_AddStdRoot(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - const char *comment /* [in] [charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct dfs_AddStdRoot r; - NTSTATUS status; - - /* In parameters */ - r.in.servername = servername; - r.in.rootshare = rootshare; - r.in.comment = comment; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_AddStdRoot, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_ADDSTDROOT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_AddStdRoot, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_RemoveStdRoot(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct dfs_RemoveStdRoot r; - NTSTATUS status; - - /* In parameters */ - r.in.servername = servername; - r.in.rootshare = rootshare; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_RemoveStdRoot, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_REMOVESTDROOT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_RemoveStdRoot, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_ManagerInitialize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [ref,charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct dfs_ManagerInitialize r; - NTSTATUS status; - - /* In parameters */ - r.in.servername = servername; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_ManagerInitialize, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_MANAGERINITIALIZE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_ManagerInitialize, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - const char *comment /* [in] [charset(UTF16)] */, - const char *store /* [in] [charset(UTF16)] */, - WERROR *werror) -{ - struct dfs_AddStdRootForced r; - NTSTATUS status; - - /* In parameters */ - r.in.servername = servername; - r.in.rootshare = rootshare; - r.in.comment = comment; - r.in.store = store; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_AddStdRootForced, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_ADDSTDROOTFORCED, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_AddStdRootForced, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char **server_fullname /* [in,out] [ref,charset(UTF16)] */, - uint8_t *is_root /* [in,out] [ref] */, - uint32_t *ttl /* [in,out] [ref] */, - WERROR *werror) -{ - struct dfs_GetDcAddress r; - NTSTATUS status; - - /* In parameters */ - r.in.servername = servername; - r.in.server_fullname = server_fullname; - r.in.is_root = is_root; - r.in.ttl = ttl; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_GETDCADDRESS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *server_fullname = *r.out.server_fullname; - *is_root = *r.out.is_root; - *ttl = *r.out.ttl; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *server_fullname /* [in] [charset(UTF16)] */, - uint32_t flags /* [in] */, - uint32_t ttl /* [in] */, - WERROR *werror) -{ - struct dfs_SetDcAddress r; - NTSTATUS status; - - /* In parameters */ - r.in.servername = servername; - r.in.server_fullname = server_fullname; - r.in.flags = flags; - r.in.ttl = ttl; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_SetDcAddress, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_SETDCADDRESS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_SetDcAddress, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - WERROR *werror) -{ - struct dfs_FlushFtTable r; - NTSTATUS status; - - /* In parameters */ - r.in.servername = servername; - r.in.rootshare = rootshare; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_FlushFtTable, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_FLUSHFTTABLE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_FlushFtTable, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_Add2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dfs_Add2 r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Add2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_ADD2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Add2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dfs_Remove2 r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Remove2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_REMOVE2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Remove2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *dfs_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - uint32_t bufsize /* [in] */, - struct dfs_EnumStruct *info /* [in,out] [unique] */, - uint32_t *total /* [in,out] [unique] */, - WERROR *werror) -{ - struct dfs_EnumEx r; - NTSTATUS status; - - /* In parameters */ - r.in.dfs_name = dfs_name; - r.in.level = level; - r.in.bufsize = bufsize; - r.in.info = info; - r.in.total = total; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_EnumEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_ENUMEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_EnumEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } - if (total && r.out.total) { - *total = *r.out.total; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dfs_SetInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dfs_SetInfo2 r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_SetInfo2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netdfs, - NDR_DFS_SETINFO2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_SetInfo2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - diff --git a/source3/librpc/gen_ndr/cli_dfs.h b/source3/librpc/gen_ndr/cli_dfs.h deleted file mode 100644 index 0c862099bf..0000000000 --- a/source3/librpc/gen_ndr/cli_dfs.h +++ /dev/null @@ -1,138 +0,0 @@ -#include "librpc/gen_ndr/ndr_dfs.h" -#ifndef __CLI_NETDFS__ -#define __CLI_NETDFS__ -NTSTATUS rpccli_dfs_GetManagerVersion(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - enum dfs_ManagerVersion *version /* [out] [ref] */); -NTSTATUS rpccli_dfs_Add(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *path /* [in] [ref,charset(UTF16)] */, - const char *server /* [in] [ref,charset(UTF16)] */, - const char *share /* [in] [unique,charset(UTF16)] */, - const char *comment /* [in] [unique,charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_dfs_Remove(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *dfs_entry_path /* [in] [ref,charset(UTF16)] */, - const char *servername /* [in] [unique,charset(UTF16)] */, - const char *sharename /* [in] [unique,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_dfs_SetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *dfs_entry_path /* [in] [charset(UTF16)] */, - const char *servername /* [in] [unique,charset(UTF16)] */, - const char *sharename /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union dfs_Info *info /* [in] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *dfs_entry_path /* [in] [charset(UTF16)] */, - const char *servername /* [in] [unique,charset(UTF16)] */, - const char *sharename /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union dfs_Info *info /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t level /* [in] */, - uint32_t bufsize /* [in] */, - struct dfs_EnumStruct *info /* [in,out] [unique] */, - uint32_t *total /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_dfs_Rename(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dfs_Move(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dfs_ManagerGetConfigInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dfs_ManagerSendSiteInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *dns_servername /* [in] [charset(UTF16)] */, - const char *dfsname /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - const char *comment /* [in] [charset(UTF16)] */, - const char *dfs_config_dn /* [in] [charset(UTF16)] */, - uint8_t unknown1 /* [in] */, - uint32_t flags /* [in] */, - struct dfs_UnknownStruct **unknown2 /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *dns_servername /* [in] [charset(UTF16)] */, - const char *dfsname /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - uint32_t flags /* [in] */, - struct dfs_UnknownStruct **unknown /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_dfs_AddStdRoot(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - const char *comment /* [in] [charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_dfs_RemoveStdRoot(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_dfs_ManagerInitialize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [ref,charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - const char *comment /* [in] [charset(UTF16)] */, - const char *store /* [in] [charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char **server_fullname /* [in,out] [ref,charset(UTF16)] */, - uint8_t *is_root /* [in,out] [ref] */, - uint32_t *ttl /* [in,out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *server_fullname /* [in] [charset(UTF16)] */, - uint32_t flags /* [in] */, - uint32_t ttl /* [in] */, - WERROR *werror); -NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *servername /* [in] [charset(UTF16)] */, - const char *rootshare /* [in] [charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_dfs_Add2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dfs_Remove2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *dfs_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - uint32_t bufsize /* [in] */, - struct dfs_EnumStruct *info /* [in,out] [unique] */, - uint32_t *total /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_dfs_SetInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -#endif /* __CLI_NETDFS__ */ diff --git a/source3/librpc/gen_ndr/cli_drsuapi.c b/source3/librpc/gen_ndr/cli_drsuapi.c deleted file mode 100644 index 57d7a25d9c..0000000000 --- a/source3/librpc/gen_ndr/cli_drsuapi.c +++ /dev/null @@ -1,1167 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_drsuapi.h" - -NTSTATUS rpccli_drsuapi_DsBind(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct GUID *bind_guid /* [in] [unique] */, - struct drsuapi_DsBindInfoCtr *bind_info /* [in,out] [unique] */, - struct policy_handle *bind_handle /* [out] [ref] */, - WERROR *werror) -{ - struct drsuapi_DsBind r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_guid = bind_guid; - r.in.bind_info = bind_info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsBind, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSBIND, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsBind, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (bind_info && r.out.bind_info) { - *bind_info = *r.out.bind_info; - } - *bind_handle = *r.out.bind_handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsUnbind(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in,out] [ref] */, - WERROR *werror) -{ - struct drsuapi_DsUnbind r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsUnbind, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSUNBIND, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsUnbind, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *bind_handle = *r.out.bind_handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsReplicaSync(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsReplicaSyncRequest req /* [in] [switch_is(level)] */, - WERROR *werror) -{ - struct drsuapi_DsReplicaSync r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsReplicaSync, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSREPLICASYNC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaSync, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsGetNCChanges(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsGetNCChangesRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetNCChangesCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_DsGetNCChanges r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsGetNCChanges, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSGETNCCHANGES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNCChanges, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsReplicaUpdateRefsRequest req /* [in] [switch_is(level)] */, - WERROR *werror) -{ - struct drsuapi_DsReplicaUpdateRefs r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsReplicaUpdateRefs, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSREPLICAUPDATEREFS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaUpdateRefs, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_REPLICA_ADD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_REPLICA_ADD r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_ADD, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_REPLICA_ADD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_ADD, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_REPLICA_DEL(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_REPLICA_DEL r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_DEL, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_REPLICA_DEL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_DEL, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_REPLICA_MODIFY(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_REPLICA_MODIFY r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_MODIFY, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_REPLICA_MODIFY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_MODIFY, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_VERIFY_NAMES r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_VERIFY_NAMES, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_VERIFY_NAMES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_VERIFY_NAMES, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsGetMemberships(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsGetMembershipsRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetMembershipsCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_DsGetMemberships r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsGetMemberships, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSGETMEMBERSHIPS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsGetMemberships, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_INTER_DOMAIN_MOVE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_INTER_DOMAIN_MOVE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_INTER_DOMAIN_MOVE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - uint32_t level /* [in] */, - union drsuapi_DsGetNT4ChangeLogRequest *req /* [in] [ref,switch_is(level)] */, - uint32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetNT4ChangeLogInfo *info /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_DsGetNT4ChangeLog r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsGetNT4ChangeLog, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSGETNT4CHANGELOG, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNT4ChangeLog, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsNameRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsNameCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_DsCrackNames r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsCrackNames, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSCRACKNAMES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsCrackNames, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsWriteAccountSpn(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsWriteAccountSpnRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsWriteAccountSpnResult *res /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_DsWriteAccountSpn r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsWriteAccountSpn, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSWRITEACCOUNTSPN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsWriteAccountSpn, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *res = *r.out.res; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsRemoveDSServerRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsRemoveDSServerResult *res /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_DsRemoveDSServer r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsRemoveDSServer, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSREMOVEDSSERVER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsRemoveDSServer, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *res = *r.out.res; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_REMOVE_DS_DOMAIN r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_REMOVE_DS_DOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_REMOVE_DS_DOMAIN, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsGetDCInfoRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetDCInfoCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_DsGetDomainControllerInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsGetDomainControllerInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsGetDomainControllerInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsAddEntry(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsAddEntryRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsAddEntryCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_DsAddEntry r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsAddEntry, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSADDENTRY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsAddEntry, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_EXECUTE_KCC(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_EXECUTE_KCC r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_EXECUTE_KCC, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_EXECUTE_KCC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_EXECUTE_KCC, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsReplicaGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - enum drsuapi_DsReplicaGetInfoLevel level /* [in] */, - union drsuapi_DsReplicaGetInfoRequest *req /* [in] [ref,switch_is(level)] */, - enum drsuapi_DsReplicaInfoType *info_type /* [out] [ref] */, - union drsuapi_DsReplicaInfo *info /* [out] [ref,switch_is(*info_type)] */, - WERROR *werror) -{ - struct drsuapi_DsReplicaGetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsReplicaGetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSREPLICAGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaGetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info_type = *r.out.info_type; - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_ADD_SID_HISTORY r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_ADD_SID_HISTORY, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_ADD_SID_HISTORY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_ADD_SID_HISTORY, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_DsGetMemberships2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsGetMemberships2Request *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetMemberships2Ctr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_DsGetMemberships2 r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_DsGetMemberships2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_DSGETMEMBERSHIPS2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_DsGetMemberships2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_REPLICA_VERIFY_OBJECTS r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_REPLICA_VERIFY_OBJECTS, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_REPLICA_VERIFY_OBJECTS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_REPLICA_VERIFY_OBJECTS, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct DRSUAPI_GET_OBJECT_EXISTENCE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(DRSUAPI_GET_OBJECT_EXISTENCE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_GET_OBJECT_EXISTENCE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(DRSUAPI_GET_OBJECT_EXISTENCE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_drsuapi_QuerySitesByCost(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_QuerySitesByCostRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_QuerySitesByCostCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror) -{ - struct drsuapi_QuerySitesByCost r; - NTSTATUS status; - - /* In parameters */ - r.in.bind_handle = bind_handle; - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(drsuapi_QuerySitesByCost, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_drsuapi, - NDR_DRSUAPI_QUERYSITESBYCOST, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(drsuapi_QuerySitesByCost, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - diff --git a/source3/librpc/gen_ndr/cli_drsuapi.h b/source3/librpc/gen_ndr/cli_drsuapi.h deleted file mode 100644 index ab7375f4ca..0000000000 --- a/source3/librpc/gen_ndr/cli_drsuapi.h +++ /dev/null @@ -1,144 +0,0 @@ -#include "librpc/gen_ndr/ndr_drsuapi.h" -#ifndef __CLI_DRSUAPI__ -#define __CLI_DRSUAPI__ -NTSTATUS rpccli_drsuapi_DsBind(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct GUID *bind_guid /* [in] [unique] */, - struct drsuapi_DsBindInfoCtr *bind_info /* [in,out] [unique] */, - struct policy_handle *bind_handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsUnbind(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in,out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsReplicaSync(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsReplicaSyncRequest req /* [in] [switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsGetNCChanges(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsGetNCChangesRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetNCChangesCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsReplicaUpdateRefsRequest req /* [in] [switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_REPLICA_ADD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_REPLICA_DEL(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_REPLICA_MODIFY(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsGetMemberships(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsGetMembershipsRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetMembershipsCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - uint32_t level /* [in] */, - union drsuapi_DsGetNT4ChangeLogRequest *req /* [in] [ref,switch_is(level)] */, - uint32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetNT4ChangeLogInfo *info /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsNameRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsNameCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsWriteAccountSpn(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsWriteAccountSpnRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsWriteAccountSpnResult *res /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsRemoveDSServerRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsRemoveDSServerResult *res /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsGetDCInfoRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetDCInfoCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsAddEntry(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsAddEntryRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsAddEntryCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_EXECUTE_KCC(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsReplicaGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - enum drsuapi_DsReplicaGetInfoLevel level /* [in] */, - union drsuapi_DsReplicaGetInfoRequest *req /* [in] [ref,switch_is(level)] */, - enum drsuapi_DsReplicaInfoType *info_type /* [out] [ref] */, - union drsuapi_DsReplicaInfo *info /* [out] [ref,switch_is(*info_type)] */, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_drsuapi_DsGetMemberships2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_DsGetMemberships2Request *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_DsGetMemberships2Ctr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_drsuapi_QuerySitesByCost(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *bind_handle /* [in] [ref] */, - int32_t level /* [in] */, - union drsuapi_QuerySitesByCostRequest *req /* [in] [ref,switch_is(level)] */, - int32_t *level_out /* [out] [ref] */, - union drsuapi_QuerySitesByCostCtr *ctr /* [out] [ref,switch_is(*level_out)] */, - WERROR *werror); -#endif /* __CLI_DRSUAPI__ */ diff --git a/source3/librpc/gen_ndr/cli_dssetup.c b/source3/librpc/gen_ndr/cli_dssetup.c deleted file mode 100644 index 5526f8d59b..0000000000 --- a/source3/librpc/gen_ndr/cli_dssetup.c +++ /dev/null @@ -1,465 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_dssetup.h" - -NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - enum dssetup_DsRoleInfoLevel level /* [in] */, - union dssetup_DsRoleInfo *info /* [out] [unique,switch_is(level)] */, - WERROR *werror) -{ - struct dssetup_DsRoleGetPrimaryDomainInformation r; - NTSTATUS status; - - /* In parameters */ - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleDnsNameToFlatName r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleDnsNameToFlatName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDnsNameToFlatName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleDcAsDc(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleDcAsDc r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsDc, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLEDCASDC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsDc, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleDcAsReplica(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleDcAsReplica r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsReplica, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLEDCASREPLICA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsReplica, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleDemoteDc(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleDemoteDc r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleDemoteDc, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLEDEMOTEDC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDemoteDc, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleGetDcOperationProgress r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationProgress, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationProgress, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleGetDcOperationResults r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationResults, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationResults, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleCancel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleCancel r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleCancel, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLECANCEL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleCancel, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleServerSaveStateForUpgrade r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleUpgradeDownlevelServer r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct dssetup_DsRoleAbortDownlevelServerUpgrade r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_dssetup, - NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - diff --git a/source3/librpc/gen_ndr/cli_dssetup.h b/source3/librpc/gen_ndr/cli_dssetup.h deleted file mode 100644 index e2dca43360..0000000000 --- a/source3/librpc/gen_ndr/cli_dssetup.h +++ /dev/null @@ -1,39 +0,0 @@ -#include "librpc/gen_ndr/ndr_dssetup.h" -#ifndef __CLI_DSSETUP__ -#define __CLI_DSSETUP__ -NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - enum dssetup_DsRoleInfoLevel level /* [in] */, - union dssetup_DsRoleInfo *info /* [out] [unique,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleDcAsDc(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleDcAsReplica(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleDemoteDc(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleCancel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -#endif /* __CLI_DSSETUP__ */ diff --git a/source3/librpc/gen_ndr/cli_echo.c b/source3/librpc/gen_ndr/cli_echo.c deleted file mode 100644 index a775825f5f..0000000000 --- a/source3/librpc/gen_ndr/cli_echo.c +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_echo.h" - -NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t in_data /* [in] */, - uint32_t *out_data /* [out] [ref] */) -{ - struct echo_AddOne r; - NTSTATUS status; - - /* In parameters */ - r.in.in_data = in_data; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_AddOne, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_ADDONE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_AddOne, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *out_data = *r.out.out_data; - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t len /* [in] */, - uint8_t *in_data /* [in] [size_is(len)] */, - uint8_t *out_data /* [out] [size_is(len)] */) -{ - struct echo_EchoData r; - NTSTATUS status; - - /* In parameters */ - r.in.len = len; - r.in.in_data = in_data; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_EchoData, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_ECHODATA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_EchoData, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(out_data, r.out.out_data, r.in.len * sizeof(*out_data)); - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t len /* [in] */, - uint8_t *data /* [in] [size_is(len)] */) -{ - struct echo_SinkData r; - NTSTATUS status; - - /* In parameters */ - r.in.len = len; - r.in.data = data; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_SinkData, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_SINKDATA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_SinkData, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t len /* [in] */, - uint8_t *data /* [out] [size_is(len)] */) -{ - struct echo_SourceData r; - NTSTATUS status; - - /* In parameters */ - r.in.len = len; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_SourceData, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_SOURCEDATA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_SourceData, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(data, r.out.data, r.in.len * sizeof(*data)); - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *s1 /* [in] [ref,charset(UTF16)] */, - const char **s2 /* [out] [ref,charset(UTF16)] */) -{ - struct echo_TestCall r; - NTSTATUS status; - - /* In parameters */ - r.in.s1 = s1; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestCall, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_TESTCALL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestCall, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *s2 = *r.out.s2; - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t level /* [in] */, - union echo_Info *info /* [out] [ref,switch_is(level)] */) -{ - struct echo_TestCall2 r; - NTSTATUS status; - - /* In parameters */ - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestCall2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_TESTCALL2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestCall2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t seconds /* [in] */) -{ - struct echo_TestSleep r; - NTSTATUS status; - - /* In parameters */ - r.in.seconds = seconds; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestSleep, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_TESTSLEEP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestSleep, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - enum echo_Enum1 *foo1 /* [in,out] [ref] */, - struct echo_Enum2 *foo2 /* [in,out] [ref] */, - union echo_Enum3 *foo3 /* [in,out] [ref,switch_is(*foo1)] */) -{ - struct echo_TestEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.foo1 = foo1; - r.in.foo2 = foo2; - r.in.foo3 = foo3; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_TESTENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *foo1 = *r.out.foo1; - *foo2 = *r.out.foo2; - *foo3 = *r.out.foo3; - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct echo_Surrounding *data /* [in,out] [ref] */) -{ - struct echo_TestSurrounding r; - NTSTATUS status; - - /* In parameters */ - r.in.data = data; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_TESTSURROUNDING, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *data = *r.out.data; - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_echo_TestDoublePointer(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t ***data /* [in] [ref] */) -{ - struct echo_TestDoublePointer r; - NTSTATUS status; - - /* In parameters */ - r.in.data = data; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_rpcecho, - NDR_ECHO_TESTDOUBLEPOINTER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return NT_STATUS_OK; -} - diff --git a/source3/librpc/gen_ndr/cli_echo.h b/source3/librpc/gen_ndr/cli_echo.h deleted file mode 100644 index 9da13e97f6..0000000000 --- a/source3/librpc/gen_ndr/cli_echo.h +++ /dev/null @@ -1,43 +0,0 @@ -#include "librpc/gen_ndr/ndr_echo.h" -#ifndef __CLI_RPCECHO__ -#define __CLI_RPCECHO__ -NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t in_data /* [in] */, - uint32_t *out_data /* [out] [ref] */); -NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t len /* [in] */, - uint8_t *in_data /* [in] [size_is(len)] */, - uint8_t *out_data /* [out] [size_is(len)] */); -NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t len /* [in] */, - uint8_t *data /* [in] [size_is(len)] */); -NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t len /* [in] */, - uint8_t *data /* [out] [size_is(len)] */); -NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *s1 /* [in] [ref,charset(UTF16)] */, - const char **s2 /* [out] [ref,charset(UTF16)] */); -NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t level /* [in] */, - union echo_Info *info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t seconds /* [in] */); -NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - enum echo_Enum1 *foo1 /* [in,out] [ref] */, - struct echo_Enum2 *foo2 /* [in,out] [ref] */, - union echo_Enum3 *foo3 /* [in,out] [ref,switch_is(*foo1)] */); -NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct echo_Surrounding *data /* [in,out] [ref] */); -NTSTATUS rpccli_echo_TestDoublePointer(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t ***data /* [in] [ref] */); -#endif /* __CLI_RPCECHO__ */ diff --git a/source3/librpc/gen_ndr/cli_epmapper.c b/source3/librpc/gen_ndr/cli_epmapper.c deleted file mode 100644 index 19673ab659..0000000000 --- a/source3/librpc/gen_ndr/cli_epmapper.c +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_epmapper.h" - -NTSTATUS rpccli_epm_Insert(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t num_ents /* [in] */, - struct epm_entry_t *entries /* [in] [size_is(num_ents)] */, - uint32_t replace /* [in] */) -{ - struct epm_Insert r; - NTSTATUS status; - - /* In parameters */ - r.in.num_ents = num_ents; - r.in.entries = entries; - r.in.replace = replace; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_Insert, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_epmapper, - NDR_EPM_INSERT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_Insert, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_epm_Delete(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t num_ents /* [in] */, - struct epm_entry_t *entries /* [in] [size_is(num_ents)] */) -{ - struct epm_Delete r; - NTSTATUS status; - - /* In parameters */ - r.in.num_ents = num_ents; - r.in.entries = entries; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_Delete, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_epmapper, - NDR_EPM_DELETE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_Delete, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t inquiry_type /* [in] */, - struct GUID *object /* [in] [ptr] */, - struct rpc_if_id_t *interface_id /* [in] [ptr] */, - uint32_t vers_option /* [in] */, - struct policy_handle *entry_handle /* [in,out] [ref] */, - uint32_t max_ents /* [in] */, - uint32_t *num_ents /* [out] [ref] */, - struct epm_entry_t *entries /* [out] [length_is(*num_ents),size_is(max_ents)] */) -{ - struct epm_Lookup r; - NTSTATUS status; - - /* In parameters */ - r.in.inquiry_type = inquiry_type; - r.in.object = object; - r.in.interface_id = interface_id; - r.in.vers_option = vers_option; - r.in.entry_handle = entry_handle; - r.in.max_ents = max_ents; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_Lookup, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_epmapper, - NDR_EPM_LOOKUP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_Lookup, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *entry_handle = *r.out.entry_handle; - *num_ents = *r.out.num_ents; - memcpy(entries, r.out.entries, r.in.max_ents * sizeof(*entries)); - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct GUID *object /* [in] [ptr] */, - struct epm_twr_t *map_tower /* [in] [ptr] */, - struct policy_handle *entry_handle /* [in,out] [ref] */, - uint32_t max_towers /* [in] */, - uint32_t *num_towers /* [out] [ref] */, - struct epm_twr_p_t *towers /* [out] [length_is(*num_towers),size_is(max_towers)] */) -{ - struct epm_Map r; - NTSTATUS status; - - /* In parameters */ - r.in.object = object; - r.in.map_tower = map_tower; - r.in.entry_handle = entry_handle; - r.in.max_towers = max_towers; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_Map, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_epmapper, - NDR_EPM_MAP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_Map, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *entry_handle = *r.out.entry_handle; - *num_towers = *r.out.num_towers; - memcpy(towers, r.out.towers, r.in.max_towers * sizeof(*towers)); - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_epm_LookupHandleFree(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *entry_handle /* [in,out] [ref] */) -{ - struct epm_LookupHandleFree r; - NTSTATUS status; - - /* In parameters */ - r.in.entry_handle = entry_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_epmapper, - NDR_EPM_LOOKUPHANDLEFREE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *entry_handle = *r.out.entry_handle; - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_epm_InqObject(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct GUID *epm_object /* [in] [ref] */) -{ - struct epm_InqObject r; - NTSTATUS status; - - /* In parameters */ - r.in.epm_object = epm_object; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_InqObject, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_epmapper, - NDR_EPM_INQOBJECT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_InqObject, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_epm_MgmtDelete(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t object_speced /* [in] */, - struct GUID *object /* [in] [ptr] */, - struct epm_twr_t *tower /* [in] [ptr] */) -{ - struct epm_MgmtDelete r; - NTSTATUS status; - - /* In parameters */ - r.in.object_speced = object_speced; - r.in.object = object; - r.in.tower = tower; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_MgmtDelete, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_epmapper, - NDR_EPM_MGMTDELETE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return NT_STATUS_OK; -} - -NTSTATUS rpccli_epm_MapAuth(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct epm_MapAuth r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_MapAuth, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_epmapper, - NDR_EPM_MAPAUTH, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_MapAuth, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return NT_STATUS_OK; -} - diff --git a/source3/librpc/gen_ndr/cli_epmapper.h b/source3/librpc/gen_ndr/cli_epmapper.h deleted file mode 100644 index 44884fad7e..0000000000 --- a/source3/librpc/gen_ndr/cli_epmapper.h +++ /dev/null @@ -1,44 +0,0 @@ -#include "librpc/gen_ndr/ndr_epmapper.h" -#ifndef __CLI_EPMAPPER__ -#define __CLI_EPMAPPER__ -NTSTATUS rpccli_epm_Insert(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t num_ents /* [in] */, - struct epm_entry_t *entries /* [in] [size_is(num_ents)] */, - uint32_t replace /* [in] */); -NTSTATUS rpccli_epm_Delete(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t num_ents /* [in] */, - struct epm_entry_t *entries /* [in] [size_is(num_ents)] */); -NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t inquiry_type /* [in] */, - struct GUID *object /* [in] [ptr] */, - struct rpc_if_id_t *interface_id /* [in] [ptr] */, - uint32_t vers_option /* [in] */, - struct policy_handle *entry_handle /* [in,out] [ref] */, - uint32_t max_ents /* [in] */, - uint32_t *num_ents /* [out] [ref] */, - struct epm_entry_t *entries /* [out] [length_is(*num_ents),size_is(max_ents)] */); -NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct GUID *object /* [in] [ptr] */, - struct epm_twr_t *map_tower /* [in] [ptr] */, - struct policy_handle *entry_handle /* [in,out] [ref] */, - uint32_t max_towers /* [in] */, - uint32_t *num_towers /* [out] [ref] */, - struct epm_twr_p_t *towers /* [out] [length_is(*num_towers),size_is(max_towers)] */); -NTSTATUS rpccli_epm_LookupHandleFree(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *entry_handle /* [in,out] [ref] */); -NTSTATUS rpccli_epm_InqObject(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct GUID *epm_object /* [in] [ref] */); -NTSTATUS rpccli_epm_MgmtDelete(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t object_speced /* [in] */, - struct GUID *object /* [in] [ptr] */, - struct epm_twr_t *tower /* [in] [ptr] */); -NTSTATUS rpccli_epm_MapAuth(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -#endif /* __CLI_EPMAPPER__ */ diff --git a/source3/librpc/gen_ndr/cli_eventlog.c b/source3/librpc/gen_ndr/cli_eventlog.c deleted file mode 100644 index 02d8fb2e65..0000000000 --- a/source3/librpc/gen_ndr/cli_eventlog.c +++ /dev/null @@ -1,915 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_eventlog.h" - -NTSTATUS rpccli_eventlog_ClearEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *backupfile /* [in] [unique] */) -{ - struct eventlog_ClearEventLogW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.backupfile = backupfile; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_CLEAREVENTLOGW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_BackupEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_BackupEventLogW r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_BACKUPEVENTLOGW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_CloseEventLog(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */) -{ - struct eventlog_CloseEventLog r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_CLOSEEVENTLOG, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_DeregisterEventSource(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_DeregisterEventSource r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_DEREGISTEREVENTSOURCE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *number /* [out] [ref] */) -{ - struct eventlog_GetNumRecords r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_GETNUMRECORDS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *number = *r.out.number; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *oldest_entry /* [out] [ref] */) -{ - struct eventlog_GetOldestRecord r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_GETOLDESTRECORD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *oldest_entry = *r.out.oldest_entry; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_ChangeNotify r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_CHANGENOTIFY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */, - struct lsa_String *logname /* [in] [ref] */, - struct lsa_String *servername /* [in] [ref] */, - uint32_t major_version /* [in] */, - uint32_t minor_version /* [in] */, - struct policy_handle *handle /* [out] [ref] */) -{ - struct eventlog_OpenEventLogW r; - NTSTATUS status; - - /* In parameters */ - r.in.unknown0 = unknown0; - r.in.logname = logname; - r.in.servername = servername; - r.in.major_version = major_version; - r.in.minor_version = minor_version; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_OPENEVENTLOGW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_RegisterEventSourceW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_RegisterEventSourceW r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_REGISTEREVENTSOURCEW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_OpenBackupEventLogW r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_OPENBACKUPEVENTLOGW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_ReadEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t flags /* [in] */, - uint32_t offset /* [in] */, - uint32_t number_of_bytes /* [in] [range(0,0x7FFFF)] */, - uint8_t *data /* [out] [ref,size_is(number_of_bytes)] */, - uint32_t *sent_size /* [out] [ref] */, - uint32_t *real_size /* [out] [ref] */) -{ - struct eventlog_ReadEventLogW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.flags = flags; - r.in.offset = offset; - r.in.number_of_bytes = number_of_bytes; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_READEVENTLOGW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(data, r.out.data, r.in.number_of_bytes * sizeof(*data)); - *sent_size = *r.out.sent_size; - *real_size = *r.out.real_size; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_ReportEventW r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_REPORTEVENTW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_ClearEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_ClearEventLogA r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_CLEAREVENTLOGA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_BackupEventLogA r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_BACKUPEVENTLOGA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_OpenEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_OpenEventLogA r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_OPENEVENTLOGA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_RegisterEventSourceA r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_REGISTEREVENTSOURCEA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_OpenBackupEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_OpenBackupEventLogA r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_OPENBACKUPEVENTLOGA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_ReadEventLogA r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_READEVENTLOGA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_ReportEventA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_ReportEventA r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_REPORTEVENTA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_RegisterClusterSvc r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_REGISTERCLUSTERSVC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_DeregisterClusterSvc r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_DEREGISTERCLUSTERSVC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_WriteClusterEvents r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_WRITECLUSTEREVENTS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_GetLogIntormation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct eventlog_GetLogIntormation r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_GetLogIntormation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_GETLOGINTORMATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_eventlog_FlushEventLog(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */) -{ - struct eventlog_FlushEventLog r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_eventlog, - NDR_EVENTLOG_FLUSHEVENTLOG, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - diff --git a/source3/librpc/gen_ndr/cli_eventlog.h b/source3/librpc/gen_ndr/cli_eventlog.h deleted file mode 100644 index 0594a06f59..0000000000 --- a/source3/librpc/gen_ndr/cli_eventlog.h +++ /dev/null @@ -1,73 +0,0 @@ -#include "librpc/gen_ndr/ndr_eventlog.h" -#ifndef __CLI_EVENTLOG__ -#define __CLI_EVENTLOG__ -NTSTATUS rpccli_eventlog_ClearEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *backupfile /* [in] [unique] */); -NTSTATUS rpccli_eventlog_BackupEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_CloseEventLog(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */); -NTSTATUS rpccli_eventlog_DeregisterEventSource(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *number /* [out] [ref] */); -NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *oldest_entry /* [out] [ref] */); -NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct eventlog_OpenUnknown0 *unknown0 /* [in] [unique] */, - struct lsa_String *logname /* [in] [ref] */, - struct lsa_String *servername /* [in] [ref] */, - uint32_t major_version /* [in] */, - uint32_t minor_version /* [in] */, - struct policy_handle *handle /* [out] [ref] */); -NTSTATUS rpccli_eventlog_RegisterEventSourceW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_OpenBackupEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_ReadEventLogW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t flags /* [in] */, - uint32_t offset /* [in] */, - uint32_t number_of_bytes /* [in] [range(0,0x7FFFF)] */, - uint8_t *data /* [out] [ref,size_is(number_of_bytes)] */, - uint32_t *sent_size /* [out] [ref] */, - uint32_t *real_size /* [out] [ref] */); -NTSTATUS rpccli_eventlog_ReportEventW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_ClearEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_BackupEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_OpenEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_RegisterEventSourceA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_OpenBackupEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_ReadEventLogA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_ReportEventA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_RegisterClusterSvc(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_GetLogIntormation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_FlushEventLog(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */); -#endif /* __CLI_EVENTLOG__ */ diff --git a/source3/librpc/gen_ndr/cli_initshutdown.c b/source3/librpc/gen_ndr/cli_initshutdown.c deleted file mode 100644 index bc8ca5b5f1..0000000000 --- a/source3/librpc/gen_ndr/cli_initshutdown.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_initshutdown.h" - -NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *hostname /* [in] [unique] */, - struct lsa_StringLarge *message /* [in] [unique] */, - uint32_t timeout /* [in] */, - uint8_t force_apps /* [in] */, - uint8_t do_reboot /* [in] */, - WERROR *werror) -{ - struct initshutdown_Init r; - NTSTATUS status; - - /* In parameters */ - r.in.hostname = hostname; - r.in.message = message; - r.in.timeout = timeout; - r.in.force_apps = force_apps; - r.in.do_reboot = do_reboot; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(initshutdown_Init, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_initshutdown, - NDR_INITSHUTDOWN_INIT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(initshutdown_Init, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *server /* [in] [unique] */, - WERROR *werror) -{ - struct initshutdown_Abort r; - NTSTATUS status; - - /* In parameters */ - r.in.server = server; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(initshutdown_Abort, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_initshutdown, - NDR_INITSHUTDOWN_ABORT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(initshutdown_Abort, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_initshutdown_InitEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *hostname /* [in] [unique] */, - struct lsa_StringLarge *message /* [in] [unique] */, - uint32_t timeout /* [in] */, - uint8_t force_apps /* [in] */, - uint8_t do_reboot /* [in] */, - uint32_t reason /* [in] */, - WERROR *werror) -{ - struct initshutdown_InitEx r; - NTSTATUS status; - - /* In parameters */ - r.in.hostname = hostname; - r.in.message = message; - r.in.timeout = timeout; - r.in.force_apps = force_apps; - r.in.do_reboot = do_reboot; - r.in.reason = reason; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(initshutdown_InitEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_initshutdown, - NDR_INITSHUTDOWN_INITEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - diff --git a/source3/librpc/gen_ndr/cli_initshutdown.h b/source3/librpc/gen_ndr/cli_initshutdown.h deleted file mode 100644 index e2eb9daabe..0000000000 --- a/source3/librpc/gen_ndr/cli_initshutdown.h +++ /dev/null @@ -1,25 +0,0 @@ -#include "librpc/gen_ndr/ndr_initshutdown.h" -#ifndef __CLI_INITSHUTDOWN__ -#define __CLI_INITSHUTDOWN__ -NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *hostname /* [in] [unique] */, - struct lsa_StringLarge *message /* [in] [unique] */, - uint32_t timeout /* [in] */, - uint8_t force_apps /* [in] */, - uint8_t do_reboot /* [in] */, - WERROR *werror); -NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *server /* [in] [unique] */, - WERROR *werror); -NTSTATUS rpccli_initshutdown_InitEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *hostname /* [in] [unique] */, - struct lsa_StringLarge *message /* [in] [unique] */, - uint32_t timeout /* [in] */, - uint8_t force_apps /* [in] */, - uint8_t do_reboot /* [in] */, - uint32_t reason /* [in] */, - WERROR *werror); -#endif /* __CLI_INITSHUTDOWN__ */ diff --git a/source3/librpc/gen_ndr/cli_lsa.c b/source3/librpc/gen_ndr/cli_lsa.c deleted file mode 100644 index e7775b1bfe..0000000000 --- a/source3/librpc/gen_ndr/cli_lsa.c +++ /dev/null @@ -1,3435 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_lsa.h" - -NTSTATUS rpccli_lsa_Close(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */) -{ - struct lsa_Close r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_Close, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CLOSE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_Close, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_Delete(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */) -{ - struct lsa_Delete r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_Delete, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_DELETE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_Delete, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_EnumPrivs(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct lsa_PrivArray *privs /* [out] [ref] */, - uint32_t max_count /* [in] */) -{ - struct lsa_EnumPrivs r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.resume_handle = resume_handle; - r.in.max_count = max_count; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumPrivs, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_ENUMPRIVS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *resume_handle = *r.out.resume_handle; - *privs = *r.out.privs; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct sec_desc_buf **sdbuf /* [out] [ref] */) -{ - struct lsa_QuerySecurity r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sec_info = sec_info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QuerySecurity, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_QUERYSECURITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sdbuf = *r.out.sdbuf; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct sec_desc_buf *sdbuf /* [in] [ref] */) -{ - struct lsa_SetSecObj r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sec_info = sec_info; - r.in.sdbuf = sdbuf; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetSecObj, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETSECOBJ, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_ChangePassword r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_ChangePassword, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CHANGEPASSWORD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - struct lsa_ObjectAttribute *attr /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */) -{ - struct lsa_OpenPolicy r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.attr = attr; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_OPENPOLICY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum lsa_PolicyInfo level /* [in] */, - union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */) -{ - struct lsa_QueryInfoPolicy r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_QUERYINFOPOLICY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetInfoPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum lsa_PolicyInfo level /* [in] */, - union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */) -{ - struct lsa_SetInfoPolicy r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETINFOPOLICY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_ClearAuditLog r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CLEARAUDITLOG, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *acct_handle /* [out] [ref] */) -{ - struct lsa_CreateAccount r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sid = sid; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateAccount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREATEACCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *acct_handle = *r.out.acct_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct lsa_SidArray *sids /* [out] [ref] */, - uint32_t num_entries /* [in] [range(0,8192)] */) -{ - struct lsa_EnumAccounts r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.resume_handle = resume_handle; - r.in.num_entries = num_entries; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_ENUMACCOUNTS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *resume_handle = *r.out.resume_handle; - *sids = *r.out.sids; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CreateTrustedDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *policy_handle /* [in] [ref] */, - struct lsa_DomainInfo *info /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */) -{ - struct lsa_CreateTrustedDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.policy_handle = policy_handle; - r.in.info = info; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREATETRUSTEDDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *trustdom_handle = *r.out.trustdom_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct lsa_DomainList *domains /* [out] [ref] */, - uint32_t max_size /* [in] */) -{ - struct lsa_EnumTrustDom r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.resume_handle = resume_handle; - r.in.max_size = max_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_ENUMTRUSTDOM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *resume_handle = *r.out.resume_handle; - *domains = *r.out.domains; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [size_is(num_names)] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransSidArray *sids /* [in,out] [ref] */, - enum lsa_LookupNamesLevel level /* [in] */, - uint32_t *count /* [in,out] [ref] */) -{ - struct lsa_LookupNames r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.num_names = num_names; - r.in.names = names; - r.in.sids = sids; - r.in.level = level; - r.in.count = count; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupNames, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPNAMES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupNames, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *domains = *r.out.domains; - *sids = *r.out.sids; - *count = *r.out.count; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransNameArray *names /* [in,out] [ref] */, - uint16_t level /* [in] */, - uint32_t *count /* [in,out] [ref] */) -{ - struct lsa_LookupSids r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sids = sids; - r.in.names = names; - r.in.level = level; - r.in.count = count; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupSids, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPSIDS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupSids, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *domains = *r.out.domains; - *names = *r.out.names; - *count = *r.out.count; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CreateSecret(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String name /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *sec_handle /* [out] [ref] */) -{ - struct lsa_CreateSecret r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.name = name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateSecret, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREATESECRET, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sec_handle = *r.out.sec_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *acct_handle /* [out] [ref] */) -{ - struct lsa_OpenAccount r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sid = sid; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenAccount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_OPENACCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *acct_handle = *r.out.acct_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_PrivilegeSet **privs /* [out] [ref] */) -{ - struct lsa_EnumPrivsAccount r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_ENUMPRIVSACCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *privs = *r.out.privs; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_AddPrivilegesToAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_PrivilegeSet *privs /* [in] [ref] */) -{ - struct lsa_AddPrivilegesToAccount r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.privs = privs; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_ADDPRIVILEGESTOACCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint8_t remove_all /* [in] */, - struct lsa_PrivilegeSet *privs /* [in] [unique] */) -{ - struct lsa_RemovePrivilegesFromAccount r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.remove_all = remove_all; - r.in.privs = privs; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_GetQuotasForAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_GetQuotasForAccount r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_GETQUOTASFORACCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_SetQuotasForAccount r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETQUOTASFORACCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *access_mask /* [out] [ref] */) -{ - struct lsa_GetSystemAccessAccount r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_GETSYSTEMACCESSACCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *access_mask = *r.out.access_mask; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t access_mask /* [in] */) -{ - struct lsa_SetSystemAccessAccount r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETSYSTEMACCESSACCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */) -{ - struct lsa_OpenTrustedDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sid = sid; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_OPENTRUSTEDDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *trustdom_handle = *r.out.trustdom_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *trustdom_handle /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */) -{ - struct lsa_QueryTrustedDomainInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.trustdom_handle = trustdom_handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_QUERYTRUSTEDDOMAININFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *trustdom_handle /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */) -{ - struct lsa_SetInformationTrustedDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.trustdom_handle = trustdom_handle; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String name /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *sec_handle /* [out] [ref] */) -{ - struct lsa_OpenSecret r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.name = name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenSecret, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_OPENSECRET, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sec_handle = *r.out.sec_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetSecret(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *sec_handle /* [in] [ref] */, - struct lsa_DATA_BUF *new_val /* [in] [unique] */, - struct lsa_DATA_BUF *old_val /* [in] [unique] */) -{ - struct lsa_SetSecret r; - NTSTATUS status; - - /* In parameters */ - r.in.sec_handle = sec_handle; - r.in.new_val = new_val; - r.in.old_val = old_val; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetSecret, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETSECRET, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetSecret, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *sec_handle /* [in] [ref] */, - struct lsa_DATA_BUF_PTR *new_val /* [in,out] [unique] */, - NTTIME *new_mtime /* [in,out] [unique] */, - struct lsa_DATA_BUF_PTR *old_val /* [in,out] [unique] */, - NTTIME *old_mtime /* [in,out] [unique] */) -{ - struct lsa_QuerySecret r; - NTSTATUS status; - - /* In parameters */ - r.in.sec_handle = sec_handle; - r.in.new_val = new_val; - r.in.new_mtime = new_mtime; - r.in.old_val = old_val; - r.in.old_mtime = old_mtime; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QuerySecret, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_QUERYSECRET, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (new_val && r.out.new_val) { - *new_val = *r.out.new_val; - } - if (new_mtime && r.out.new_mtime) { - *new_mtime = *r.out.new_mtime; - } - if (old_val && r.out.old_val) { - *old_val = *r.out.old_val; - } - if (old_mtime && r.out.old_mtime) { - *old_mtime = *r.out.old_mtime; - } - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupPrivValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *name /* [in] [ref] */, - struct lsa_LUID *luid /* [out] [ref] */) -{ - struct lsa_LookupPrivValue r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.name = name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPPRIVVALUE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *luid = *r.out.luid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_LUID *luid /* [in] [ref] */, - struct lsa_StringLarge **name /* [out] [ref] */) -{ - struct lsa_LookupPrivName r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.luid = luid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPPRIVNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *name = *r.out.name; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *name /* [in] [ref] */, - uint16_t language_id /* [in] */, - uint16_t language_id_sys /* [in] */, - struct lsa_StringLarge **disp_name /* [out] [ref] */, - uint16_t *returned_language_id /* [out] [ref] */) -{ - struct lsa_LookupPrivDisplayName r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.name = name; - r.in.language_id = language_id; - r.in.language_id_sys = language_id_sys; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPPRIVDISPLAYNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *disp_name = *r.out.disp_name; - *returned_language_id = *r.out.returned_language_id; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */) -{ - struct lsa_DeleteObject r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_DeleteObject, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_DELETEOBJECT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *name /* [in] [unique] */, - struct lsa_SidArray *sids /* [out] [ref] */) -{ - struct lsa_EnumAccountsWithUserRight r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.name = name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sids = *r.out.sids; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_EnumAccountRights(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - struct lsa_RightSet *rights /* [out] [ref] */) -{ - struct lsa_EnumAccountRights r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sid = sid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_ENUMACCOUNTRIGHTS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *rights = *r.out.rights; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_AddAccountRights(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - struct lsa_RightSet *rights /* [in] [ref] */) -{ - struct lsa_AddAccountRights r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sid = sid; - r.in.rights = rights; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_ADDACCOUNTRIGHTS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - uint8_t remove_all /* [in] */, - struct lsa_RightSet *rights /* [in] [ref] */) -{ - struct lsa_RemoveAccountRights r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sid = sid; - r.in.remove_all = remove_all; - r.in.rights = rights; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_REMOVEACCOUNTRIGHTS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *dom_sid /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */) -{ - struct lsa_QueryTrustedDomainInfoBySid r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.dom_sid = dom_sid; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *dom_sid /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */) -{ - struct lsa_SetTrustedDomainInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.dom_sid = dom_sid; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETTRUSTEDDOMAININFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *dom_sid /* [in] [ref] */) -{ - struct lsa_DeleteTrustedDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.dom_sid = dom_sid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_DELETETRUSTEDDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_StorePrivateData r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_STOREPRIVATEDATA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_RetrievePrivateData r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_RETRIEVEPRIVATEDATA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - struct lsa_ObjectAttribute *attr /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */) -{ - struct lsa_OpenPolicy2 r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.attr = attr; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_OPENPOLICY2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - struct lsa_String **account_name /* [in,out] [ref] */, - struct lsa_String **authority_name /* [in,out] [unique] */) -{ - struct lsa_GetUserName r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.account_name = account_name; - r.in.authority_name = authority_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_GetUserName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_GETUSERNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_GetUserName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *account_name = *r.out.account_name; - if (authority_name && r.out.authority_name) { - *authority_name = *r.out.authority_name; - } - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum lsa_PolicyInfo level /* [in] */, - union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */) -{ - struct lsa_QueryInfoPolicy2 r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_QUERYINFOPOLICY2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum lsa_PolicyInfo level /* [in] */, - union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */) -{ - struct lsa_SetInfoPolicy2 r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETINFOPOLICY2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *trusted_domain /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */) -{ - struct lsa_QueryTrustedDomainInfoByName r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.trusted_domain = trusted_domain; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String trusted_domain /* [in] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo *info /* [in] [unique,switch_is(level)] */) -{ - struct lsa_SetTrustedDomainInfoByName r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.trusted_domain = trusted_domain; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETTRUSTEDDOMAININFOBYNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct lsa_DomainListEx *domains /* [out] [ref] */, - uint32_t max_size /* [in] */) -{ - struct lsa_EnumTrustedDomainsEx r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.resume_handle = resume_handle; - r.in.max_size = max_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_ENUMTRUSTEDDOMAINSEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *resume_handle = *r.out.resume_handle; - *domains = *r.out.domains; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *policy_handle /* [in] [ref] */, - struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */, - struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */) -{ - struct lsa_CreateTrustedDomainEx r; - NTSTATUS status; - - /* In parameters */ - r.in.policy_handle = policy_handle; - r.in.info = info; - r.in.auth_info = auth_info; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREATETRUSTEDDOMAINEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *trustdom_handle = *r.out.trustdom_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */) -{ - struct lsa_CloseTrustedDomainEx r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CLOSETRUSTEDDOMAINEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint16_t level /* [in] */, - union lsa_DomainInformationPolicy **info /* [out] [ref,switch_is(level)] */) -{ - struct lsa_QueryDomainInformationPolicy r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_QUERYDOMAININFORMATIONPOLICY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint16_t level /* [in] */, - union lsa_DomainInformationPolicy *info /* [in] [unique,switch_is(level)] */) -{ - struct lsa_SetDomainInformationPolicy r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_SETDOMAININFORMATIONPOLICY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_OpenTrustedDomainByName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String name /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */) -{ - struct lsa_OpenTrustedDomainByName r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.name = name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_OPENTRUSTEDDOMAINBYNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *trustdom_handle = *r.out.trustdom_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_TestCall(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_TestCall r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_TestCall, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_TESTCALL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_TestCall, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransNameArray2 *names /* [in,out] [ref] */, - uint16_t level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t unknown1 /* [in] */, - uint32_t unknown2 /* [in] */) -{ - struct lsa_LookupSids2 r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sids = sids; - r.in.names = names; - r.in.level = level; - r.in.count = count; - r.in.unknown1 = unknown1; - r.in.unknown2 = unknown2; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupSids2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPSIDS2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *domains = *r.out.domains; - *names = *r.out.names; - *count = *r.out.count; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [size_is(num_names)] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransSidArray2 *sids /* [in,out] [ref] */, - enum lsa_LookupNamesLevel level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t lookup_options /* [in] */, - uint32_t client_revision /* [in] */) -{ - struct lsa_LookupNames2 r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.num_names = num_names; - r.in.names = names; - r.in.sids = sids; - r.in.level = level; - r.in.count = count; - r.in.lookup_options = lookup_options; - r.in.client_revision = client_revision; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupNames2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPNAMES2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *domains = *r.out.domains; - *sids = *r.out.sids; - *count = *r.out.count; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *policy_handle /* [in] [ref] */, - struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */, - struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */) -{ - struct lsa_CreateTrustedDomainEx2 r; - NTSTATUS status; - - /* In parameters */ - r.in.policy_handle = policy_handle; - r.in.info = info; - r.in.auth_info = auth_info; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREATETRUSTEDDOMAINEX2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *trustdom_handle = *r.out.trustdom_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRWRITE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRWRITE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRREAD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRREAD r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRREAD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRENUMERATE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRENUMERATE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRWRITEDOMAINCREDENTIALS r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRWRITEDOMAINCREDENTIALS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRREADDOMAINCREDENTIALS r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRREADDOMAINCREDENTIALS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRDELETE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRDELETE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRGETTARGETINFO(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRGETTARGETINFO r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRGETTARGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRPROFILELOADED(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRPROFILELOADED r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRPROFILELOADED, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [size_is(num_names)] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransSidArray3 *sids /* [in,out] [ref] */, - enum lsa_LookupNamesLevel level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t lookup_options /* [in] */, - uint32_t client_revision /* [in] */) -{ - struct lsa_LookupNames3 r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.num_names = num_names; - r.in.names = names; - r.in.sids = sids; - r.in.level = level; - r.in.count = count; - r.in.lookup_options = lookup_options; - r.in.client_revision = client_revision; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupNames3, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPNAMES3, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *domains = *r.out.domains; - *sids = *r.out.sids; - *count = *r.out.count; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRGETSESSIONTYPES r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRGETSESSIONTYPES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_LSARREGISTERAUDITEVENT r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LSARREGISTERAUDITEVENT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_LSARGENAUDITEVENT r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LSARGENAUDITEVENT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_LSARUNREGISTERAUDITEVENT r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LSARUNREGISTERAUDITEVENT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *trusted_domain_name /* [in] [ref] */, - uint16_t unknown /* [in] */, - struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */) -{ - struct lsa_lsaRQueryForestTrustInformation r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.trusted_domain_name = trusted_domain_name; - r.in.unknown = unknown; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *forest_trust_info = *r.out.forest_trust_info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_LSARSETFORESTTRUSTINFORMATION r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LSARSETFORESTTRUSTINFORMATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_CREDRRENAME r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_CREDRRENAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_SidArray *sids /* [in] [ref] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransNameArray2 *names /* [in,out] [ref] */, - uint16_t level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t unknown1 /* [in] */, - uint32_t unknown2 /* [in] */) -{ - struct lsa_LookupSids3 r; - NTSTATUS status; - - /* In parameters */ - r.in.sids = sids; - r.in.names = names; - r.in.level = level; - r.in.count = count; - r.in.unknown1 = unknown1; - r.in.unknown2 = unknown2; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupSids3, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPSIDS3, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *domains = *r.out.domains; - *names = *r.out.names; - *count = *r.out.count; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [size_is(num_names)] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransSidArray3 *sids /* [in,out] [ref] */, - enum lsa_LookupNamesLevel level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t lookup_options /* [in] */, - uint32_t client_revision /* [in] */) -{ - struct lsa_LookupNames4 r; - NTSTATUS status; - - /* In parameters */ - r.in.num_names = num_names; - r.in.names = names; - r.in.sids = sids; - r.in.level = level; - r.in.count = count; - r.in.lookup_options = lookup_options; - r.in.client_revision = client_revision; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupNames4, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LOOKUPNAMES4, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *domains = *r.out.domains; - *sids = *r.out.sids; - *count = *r.out.count; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_LSAROPENPOLICYSCE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSAROPENPOLICYSCE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LSAROPENPOLICYSCE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_lsa_LSARADTREPORTSECURITYEVENT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) -{ - struct lsa_LSARADTREPORTSECURITYEVENT r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_lsarpc, - NDR_LSA_LSARADTREPORTSECURITYEVENT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - diff --git a/source3/librpc/gen_ndr/cli_lsa.h b/source3/librpc/gen_ndr/cli_lsa.h deleted file mode 100644 index 554182c6db..0000000000 --- a/source3/librpc/gen_ndr/cli_lsa.h +++ /dev/null @@ -1,387 +0,0 @@ -#include "librpc/gen_ndr/ndr_lsa.h" -#ifndef __CLI_LSARPC__ -#define __CLI_LSARPC__ -NTSTATUS rpccli_lsa_Close(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */); -NTSTATUS rpccli_lsa_Delete(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */); -NTSTATUS rpccli_lsa_EnumPrivs(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct lsa_PrivArray *privs /* [out] [ref] */, - uint32_t max_count /* [in] */); -NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct sec_desc_buf **sdbuf /* [out] [ref] */); -NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct sec_desc_buf *sdbuf /* [in] [ref] */); -NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - struct lsa_ObjectAttribute *attr /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum lsa_PolicyInfo level /* [in] */, - union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_SetInfoPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum lsa_PolicyInfo level /* [in] */, - union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *acct_handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct lsa_SidArray *sids /* [out] [ref] */, - uint32_t num_entries /* [in] [range(0,8192)] */); -NTSTATUS rpccli_lsa_CreateTrustedDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *policy_handle /* [in] [ref] */, - struct lsa_DomainInfo *info /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct lsa_DomainList *domains /* [out] [ref] */, - uint32_t max_size /* [in] */); -NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [size_is(num_names)] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransSidArray *sids /* [in,out] [ref] */, - enum lsa_LookupNamesLevel level /* [in] */, - uint32_t *count /* [in,out] [ref] */); -NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransNameArray *names /* [in,out] [ref] */, - uint16_t level /* [in] */, - uint32_t *count /* [in,out] [ref] */); -NTSTATUS rpccli_lsa_CreateSecret(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String name /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *sec_handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *acct_handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_PrivilegeSet **privs /* [out] [ref] */); -NTSTATUS rpccli_lsa_AddPrivilegesToAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_PrivilegeSet *privs /* [in] [ref] */); -NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint8_t remove_all /* [in] */, - struct lsa_PrivilegeSet *privs /* [in] [unique] */); -NTSTATUS rpccli_lsa_GetQuotasForAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *access_mask /* [out] [ref] */); -NTSTATUS rpccli_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t access_mask /* [in] */); -NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *trustdom_handle /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *trustdom_handle /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String name /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *sec_handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_SetSecret(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *sec_handle /* [in] [ref] */, - struct lsa_DATA_BUF *new_val /* [in] [unique] */, - struct lsa_DATA_BUF *old_val /* [in] [unique] */); -NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *sec_handle /* [in] [ref] */, - struct lsa_DATA_BUF_PTR *new_val /* [in,out] [unique] */, - NTTIME *new_mtime /* [in,out] [unique] */, - struct lsa_DATA_BUF_PTR *old_val /* [in,out] [unique] */, - NTTIME *old_mtime /* [in,out] [unique] */); -NTSTATUS rpccli_lsa_LookupPrivValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *name /* [in] [ref] */, - struct lsa_LUID *luid /* [out] [ref] */); -NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_LUID *luid /* [in] [ref] */, - struct lsa_StringLarge **name /* [out] [ref] */); -NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *name /* [in] [ref] */, - uint16_t language_id /* [in] */, - uint16_t language_id_sys /* [in] */, - struct lsa_StringLarge **disp_name /* [out] [ref] */, - uint16_t *returned_language_id /* [out] [ref] */); -NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */); -NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *name /* [in] [unique] */, - struct lsa_SidArray *sids /* [out] [ref] */); -NTSTATUS rpccli_lsa_EnumAccountRights(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - struct lsa_RightSet *rights /* [out] [ref] */); -NTSTATUS rpccli_lsa_AddAccountRights(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - struct lsa_RightSet *rights /* [in] [ref] */); -NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */, - uint8_t remove_all /* [in] */, - struct lsa_RightSet *rights /* [in] [ref] */); -NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *dom_sid /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *dom_sid /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct dom_sid2 *dom_sid /* [in] [ref] */); -NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - struct lsa_ObjectAttribute *attr /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - struct lsa_String **account_name /* [in,out] [ref] */, - struct lsa_String **authority_name /* [in,out] [unique] */); -NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum lsa_PolicyInfo level /* [in] */, - union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum lsa_PolicyInfo level /* [in] */, - union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *trusted_domain /* [in] [ref] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String trusted_domain /* [in] */, - enum lsa_TrustDomInfoEnum level /* [in] */, - union lsa_TrustedDomainInfo *info /* [in] [unique,switch_is(level)] */); -NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct lsa_DomainListEx *domains /* [out] [ref] */, - uint32_t max_size /* [in] */); -NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *policy_handle /* [in] [ref] */, - struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */, - struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */); -NTSTATUS rpccli_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint16_t level /* [in] */, - union lsa_DomainInformationPolicy **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint16_t level /* [in] */, - union lsa_DomainInformationPolicy *info /* [in] [unique,switch_is(level)] */); -NTSTATUS rpccli_lsa_OpenTrustedDomainByName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String name /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_TestCall(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransNameArray2 *names /* [in,out] [ref] */, - uint16_t level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t unknown1 /* [in] */, - uint32_t unknown2 /* [in] */); -NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [size_is(num_names)] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransSidArray2 *sids /* [in,out] [ref] */, - enum lsa_LookupNamesLevel level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t lookup_options /* [in] */, - uint32_t client_revision /* [in] */); -NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *policy_handle /* [in] [ref] */, - struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */, - struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *trustdom_handle /* [out] [ref] */); -NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_CREDRREAD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_CREDRGETTARGETINFO(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_CREDRPROFILELOADED(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [size_is(num_names)] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransSidArray3 *sids /* [in,out] [ref] */, - enum lsa_LookupNamesLevel level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t lookup_options /* [in] */, - uint32_t client_revision /* [in] */); -NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct lsa_String *trusted_domain_name /* [in] [ref] */, - uint16_t unknown /* [in] */, - struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */); -NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_SidArray *sids /* [in] [ref] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransNameArray2 *names /* [in,out] [ref] */, - uint16_t level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t unknown1 /* [in] */, - uint32_t unknown2 /* [in] */); -NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [size_is(num_names)] */, - struct lsa_RefDomainList **domains /* [out] [ref] */, - struct lsa_TransSidArray3 *sids /* [in,out] [ref] */, - enum lsa_LookupNamesLevel level /* [in] */, - uint32_t *count /* [in,out] [ref] */, - uint32_t lookup_options /* [in] */, - uint32_t client_revision /* [in] */); -NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LSARADTREPORTSECURITYEVENT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); -#endif /* __CLI_LSARPC__ */ diff --git a/source3/librpc/gen_ndr/cli_netlogon.c b/source3/librpc/gen_ndr/cli_netlogon.c deleted file mode 100644 index 1ce4e67c56..0000000000 --- a/source3/librpc/gen_ndr/cli_netlogon.c +++ /dev/null @@ -1,2352 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_netlogon.h" - -NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - const char *workstation /* [in] [charset(UTF16)] */, - struct netr_UasInfo **info /* [out] [ref] */, - WERROR *werror) -{ - struct netr_LogonUasLogon r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.workstation = workstation; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonUasLogon, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONUASLOGON, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - const char *workstation /* [in] [charset(UTF16)] */, - struct netr_UasLogoffInfo *info /* [out] [ref] */, - WERROR *werror) -{ - struct netr_LogonUasLogoff r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.workstation = workstation; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONUASLOGOFF, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [unique] */, - struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, - enum netr_LogonInfoClass logon_level /* [in] */, - union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, - uint16_t validation_level /* [in] */, - union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, - uint8_t *authoritative /* [out] [ref] */) -{ - struct netr_LogonSamLogon r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.computer_name = computer_name; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.logon_level = logon_level; - r.in.logon = logon; - r.in.validation_level = validation_level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONSAMLOGON, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (return_authenticator && r.out.return_authenticator) { - *return_authenticator = *r.out.return_authenticator; - } - *validation = *r.out.validation; - *authoritative = *r.out.authoritative; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [unique] */, - struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, - enum netr_LogonInfoClass logon_level /* [in] */, - union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */) -{ - struct netr_LogonSamLogoff r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.computer_name = computer_name; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.logon_level = logon_level; - r.in.logon = logon; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONSAMLOGOFF, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (return_authenticator && r.out.return_authenticator) { - *return_authenticator = *r.out.return_authenticator; - } - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Credential *credentials /* [in] [ref] */, - struct netr_Credential *return_credentials /* [out] [ref] */) -{ - struct netr_ServerReqChallenge r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.computer_name = computer_name; - r.in.credentials = credentials; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_SERVERREQCHALLENGE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_credentials = *r.out.return_credentials; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Credential *credentials /* [in] [ref] */, - struct netr_Credential *return_credentials /* [out] [ref] */) -{ - struct netr_ServerAuthenticate r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.secure_channel_type = secure_channel_type; - r.in.computer_name = computer_name; - r.in.credentials = credentials; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_SERVERAUTHENTICATE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_credentials = *r.out.return_credentials; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct samr_Password *new_password /* [in] [ref] */) -{ - struct netr_ServerPasswordSet r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.secure_channel_type = secure_channel_type; - r.in.computer_name = computer_name; - r.in.credential = credential; - r.in.new_password = new_password; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_SERVERPASSWORDSET, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - enum netr_SamDatabaseID database_id /* [in] */, - uint64_t *sequence_num /* [in,out] [ref] */, - struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, - uint32_t preferredmaximumlength /* [in] */) -{ - struct netr_DatabaseDeltas r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.computername = computername; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.database_id = database_id; - r.in.sequence_num = sequence_num; - r.in.preferredmaximumlength = preferredmaximumlength; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DATABASEDELTAS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *sequence_num = *r.out.sequence_num; - *delta_enum_array = *r.out.delta_enum_array; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - enum netr_SamDatabaseID database_id /* [in] */, - uint32_t *sync_context /* [in,out] [ref] */, - struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, - uint32_t preferredmaximumlength /* [in] */) -{ - struct netr_DatabaseSync r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.computername = computername; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.database_id = database_id; - r.in.sync_context = sync_context; - r.in.preferredmaximumlength = preferredmaximumlength; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DatabaseSync, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DATABASESYNC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *sync_context = *r.out.sync_context; - *delta_enum_array = *r.out.delta_enum_array; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_AccountDeltas(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator credential /* [in] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - struct netr_UAS_INFO_0 uas /* [in] */, - uint32_t count /* [in] */, - uint32_t level /* [in] */, - uint32_t buffersize /* [in] */, - struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */, - uint32_t *count_returned /* [out] [ref] */, - uint32_t *total_entries /* [out] [ref] */, - struct netr_UAS_INFO_0 *recordid /* [out] [ref] */) -{ - struct netr_AccountDeltas r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.computername = computername; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.uas = uas; - r.in.count = count; - r.in.level = level; - r.in.buffersize = buffersize; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_AccountDeltas, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_ACCOUNTDELTAS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *buffer = *r.out.buffer; - *count_returned = *r.out.count_returned; - *total_entries = *r.out.total_entries; - *recordid = *r.out.recordid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator credential /* [in] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - uint32_t reference /* [in] */, - uint32_t level /* [in] */, - uint32_t buffersize /* [in] */, - struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */, - uint32_t *count_returned /* [out] [ref] */, - uint32_t *total_entries /* [out] [ref] */, - uint32_t *next_reference /* [out] [ref] */, - struct netr_UAS_INFO_0 *recordid /* [in,out] [ref] */) -{ - struct netr_AccountSync r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.computername = computername; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.reference = reference; - r.in.level = level; - r.in.buffersize = buffersize; - r.in.recordid = recordid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_AccountSync, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_ACCOUNTSYNC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_AccountSync, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *buffer = *r.out.buffer; - *count_returned = *r.out.count_returned; - *total_entries = *r.out.total_entries; - *next_reference = *r.out.next_reference; - *recordid = *r.out.recordid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *domainname /* [in] [unique,charset(UTF16)] */, - const char **dcname /* [out] [ref,charset(UTF16)] */, - WERROR *werror) -{ - struct netr_GetDcName r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.domainname = domainname; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_GetDcName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_GETDCNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_GetDcName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *dcname = *r.out.dcname; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - enum netr_LogonControlCode function_code /* [in] */, - uint32_t level /* [in] */, - union netr_CONTROL_QUERY_INFORMATION *info /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct netr_LogonControl r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.function_code = function_code; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonControl, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONCONTROL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonControl, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_GetAnyDCName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - const char *domainname /* [in] [unique,charset(UTF16)] */, - const char **dcname /* [out] [ref,charset(UTF16)] */, - WERROR *werror) -{ - struct netr_GetAnyDCName r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.domainname = domainname; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_GETANYDCNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *dcname = *r.out.dcname; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - enum netr_LogonControlCode function_code /* [in] */, - uint32_t level /* [in] */, - union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */, - union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct netr_LogonControl2 r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.function_code = function_code; - r.in.level = level; - r.in.data = data; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonControl2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONCONTROL2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *query = *r.out.query; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Credential *credentials /* [in] [ref] */, - struct netr_Credential *return_credentials /* [out] [ref] */, - uint32_t *negotiate_flags /* [in,out] [ref] */) -{ - struct netr_ServerAuthenticate2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.secure_channel_type = secure_channel_type; - r.in.computer_name = computer_name; - r.in.credentials = credentials; - r.in.negotiate_flags = negotiate_flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_SERVERAUTHENTICATE2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_credentials = *r.out.return_credentials; - *negotiate_flags = *r.out.negotiate_flags; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - enum netr_SamDatabaseID database_id /* [in] */, - uint16_t restart_state /* [in] */, - uint32_t *sync_context /* [in,out] [ref] */, - struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, - uint32_t preferredmaximumlength /* [in] */) -{ - struct netr_DatabaseSync2 r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.computername = computername; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.database_id = database_id; - r.in.restart_state = restart_state; - r.in.sync_context = sync_context; - r.in.preferredmaximumlength = preferredmaximumlength; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DATABASESYNC2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *sync_context = *r.out.sync_context; - *delta_enum_array = *r.out.delta_enum_array; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - struct netr_ChangeLogEntry change_log_entry /* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */, - uint32_t change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->flags))] */, - struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */) -{ - struct netr_DatabaseRedo r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.computername = computername; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.change_log_entry = change_log_entry; - r.in.change_log_entry_size = change_log_entry_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DATABASEREDO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *delta_enum_array = *r.out.delta_enum_array; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - uint32_t function_code /* [in] */, - uint32_t level /* [in] */, - union netr_CONTROL_DATA_INFORMATION data /* [in] [switch_is(function_code)] */, - union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct netr_LogonControl2Ex r; - NTSTATUS status; - - /* In parameters */ - r.in.logon_server = logon_server; - r.in.function_code = function_code; - r.in.level = level; - r.in.data = data; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONCONTROL2EX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *query = *r.out.query; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct netr_Blob *trusted_domains_blob /* [out] [ref] */, - WERROR *werror) -{ - struct netr_NetrEnumerateTrustedDomains r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_NETRENUMERATETRUSTEDDOMAINS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *trusted_domains_blob = *r.out.trusted_domains_blob; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [unique,charset(UTF16)] */, - struct GUID *domain_guid /* [in] [unique] */, - struct GUID *site_guid /* [in] [unique] */, - uint32_t flags /* [in] */, - struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, - WERROR *werror) -{ - struct netr_DsRGetDCName r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.domain_name = domain_name; - r.in.domain_guid = domain_guid; - r.in.site_guid = site_guid; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRGETDCNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct netr_NETRLOGONDUMMYROUTINE1 r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_NETRLOGONDUMMYROUTINE1, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct netr_NETRLOGONSETSERVICEBITS r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_NETRLOGONSETSERVICEBITS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [unique,charset(UTF16)] */, - uint32_t *rid /* [out] [ref] */, - WERROR *werror) -{ - struct netr_LogonGetTrustRid r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.domain_name = domain_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONGETTRUSTRID, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *rid = *r.out.rid; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct netr_NETRLOGONCOMPUTESERVERDIGEST r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct netr_NETRLOGONCOMPUTECLIENTDIGEST r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Credential *credentials /* [in] [ref] */, - struct netr_Credential *return_credentials /* [out] [ref] */, - uint32_t *negotiate_flags /* [in,out] [ref] */, - uint32_t *rid /* [out] [ref] */) -{ - struct netr_ServerAuthenticate3 r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.secure_channel_type = secure_channel_type; - r.in.computer_name = computer_name; - r.in.credentials = credentials; - r.in.negotiate_flags = negotiate_flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_SERVERAUTHENTICATE3, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_credentials = *r.out.return_credentials; - *negotiate_flags = *r.out.negotiate_flags; - *rid = *r.out.rid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [unique,charset(UTF16)] */, - struct GUID *domain_guid /* [in] [unique] */, - const char *site_name /* [in] [unique,charset(UTF16)] */, - uint32_t flags /* [in] */, - struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, - WERROR *werror) -{ - struct netr_DsRGetDCNameEx r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.domain_name = domain_name; - r.in.domain_guid = domain_guid; - r.in.site_name = site_name; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRGETDCNAMEEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_DsRGetSiteName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - const char **site /* [out] [ref,charset(UTF16)] */, - WERROR *werror) -{ - struct netr_DsRGetSiteName r; - NTSTATUS status; - - /* In parameters */ - r.in.computer_name = computer_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRGETSITENAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *site = *r.out.site; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - uint32_t level /* [in] */, - union netr_DomainQuery query /* [in] [switch_is(level)] */, - union netr_DomainInfo *info /* [out] [ref,switch_is(level)] */) -{ - struct netr_LogonGetDomainInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.computer_name = computer_name; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.level = level; - r.in.query = query; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONGETDOMAININFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct netr_CryptPassword *new_password /* [in] [ref] */) -{ - struct netr_ServerPasswordSet2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.secure_channel_type = secure_channel_type; - r.in.computer_name = computer_name; - r.in.credential = credential; - r.in.new_password = new_password; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_SERVERPASSWORDSET2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct samr_Password *password /* [out] [ref] */, - WERROR *werror) -{ - struct netr_ServerPasswordGet r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.secure_channel_type = secure_channel_type; - r.in.computer_name = computer_name; - r.in.credential = credential; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_SERVERPASSWORDGET, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *password = *r.out.password; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct netr_NETRLOGONSENDTOSAM r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_NETRLOGONSENDTOSAM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t count /* [in] [range(0,32000)] */, - struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */, - struct netr_DsRAddressToSitenamesWCtr **ctr /* [out] [ref] */, - WERROR *werror) -{ - struct netr_DsRAddressToSitenamesW r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.count = count; - r.in.addresses = addresses; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRADDRESSTOSITENAMESW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *client_account /* [in] [unique,charset(UTF16)] */, - uint32_t mask /* [in] */, - const char *domain_name /* [in] [unique,charset(UTF16)] */, - struct GUID *domain_guid /* [in] [unique] */, - const char *site_name /* [in] [unique,charset(UTF16)] */, - uint32_t flags /* [in] */, - struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, - WERROR *werror) -{ - struct netr_DsRGetDCNameEx2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.client_account = client_account; - r.in.mask = mask; - r.in.domain_name = domain_name; - r.in.domain_guid = domain_guid; - r.in.site_name = site_name; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRGETDCNAMEEX2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct netr_DomainTrustList *dom_trust_list /* [out] [ref] */, - WERROR *werror) -{ - struct netr_NetrEnumerateTrustedDomainsEx r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *dom_trust_list = *r.out.dom_trust_list; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t count /* [in] [range(0,32000)] */, - struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */, - struct netr_DsRAddressToSitenamesExWCtr **ctr /* [out] [ref] */, - WERROR *werror) -{ - struct netr_DsRAddressToSitenamesExW r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.count = count; - r.in.addresses = addresses; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRADDRESSTOSITENAMESEXW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct DcSitesCtr **ctr /* [out] [ref] */, - WERROR *werror) -{ - struct netr_DsrGetDcSiteCoverageW r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRGETDCSITECOVERAGEW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - enum netr_LogonInfoClass logon_level /* [in] */, - union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, - uint16_t validation_level /* [in] */, - union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, - uint8_t *authoritative /* [out] [ref] */, - uint32_t *flags /* [in,out] [ref] */) -{ - struct netr_LogonSamLogonEx r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.computer_name = computer_name; - r.in.logon_level = logon_level; - r.in.logon = logon; - r.in.validation_level = validation_level; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONSAMLOGONEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *validation = *r.out.validation; - *authoritative = *r.out.authoritative; - *flags = *r.out.flags; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t trust_flags /* [in] */, - struct netr_DomainTrustList *trusts /* [out] [ref] */, - WERROR *werror) -{ - struct netr_DsrEnumerateDomainTrusts r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.trust_flags = trust_flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRENUMERATEDOMAINTRUSTS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *trusts = *r.out.trusts; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain /* [in] [unique,charset(UTF16)] */, - struct GUID *domain_guid /* [in] [unique] */, - struct GUID *dsa_guid /* [in] [unique] */, - const char *dns_host /* [in] [ref,charset(UTF16)] */, - WERROR *werror) -{ - struct netr_DsrDeregisterDNSHostRecords r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.domain = domain; - r.in.domain_guid = domain_guid; - r.in.dsa_guid = dsa_guid; - r.in.dns_host = dns_host; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct samr_Password *password /* [out] [ref] */, - struct samr_Password *password2 /* [out] [ref] */) -{ - struct netr_ServerTrustPasswordsGet r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.secure_channel_type = secure_channel_type; - r.in.computer_name = computer_name; - r.in.credential = credential; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_SERVERTRUSTPASSWORDSGET, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *password = *r.out.password; - *password2 = *r.out.password2; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *trusted_domain_name /* [in] [unique,charset(UTF16)] */, - uint32_t flags /* [in] */, - struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */, - WERROR *werror) -{ - struct netr_DsRGetForestTrustInformation r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.trusted_domain_name = trusted_domain_name; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_DSRGETFORESTTRUSTINFORMATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *forest_trust_info = *r.out.forest_trust_info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *trusted_domain_name /* [in] [ref,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - uint32_t flags /* [in] */, - struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */, - WERROR *werror) -{ - struct netr_GetForestTrustInformation r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.trusted_domain_name = trusted_domain_name; - r.in.credential = credential; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_GETFORESTTRUSTINFORMATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *forest_trust_info = *r.out.forest_trust_info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [unique] */, - struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, - enum netr_LogonInfoClass logon_level /* [in] */, - union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, - uint16_t validation_level /* [in] */, - union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, - uint8_t *authoritative /* [out] [ref] */, - uint32_t *flags /* [in,out] [ref] */) -{ - struct netr_LogonSamLogonWithFlags r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.computer_name = computer_name; - r.in.credential = credential; - r.in.return_authenticator = return_authenticator; - r.in.logon_level = logon_level; - r.in.logon = logon; - r.in.validation_level = validation_level; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_LOGONSAMLOGONWITHFLAGS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (return_authenticator && r.out.return_authenticator) { - *return_authenticator = *r.out.return_authenticator; - } - *validation = *r.out.validation; - *authoritative = *r.out.authoritative; - *flags = *r.out.flags; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_netr_ServerGetTrustInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [ref,charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [ref,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct samr_Password *new_owf_password /* [out] [ref] */, - struct samr_Password *old_owf_password /* [out] [ref] */, - struct netr_TrustInfo **trust_info /* [out] [ref] */) -{ - struct netr_ServerGetTrustInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account_name = account_name; - r.in.secure_channel_type = secure_channel_type; - r.in.computer_name = computer_name; - r.in.credential = credential; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_netlogon, - NDR_NETR_SERVERGETTRUSTINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *return_authenticator = *r.out.return_authenticator; - *new_owf_password = *r.out.new_owf_password; - *old_owf_password = *r.out.old_owf_password; - *trust_info = *r.out.trust_info; - - /* Return result */ - return r.out.result; -} - diff --git a/source3/librpc/gen_ndr/cli_netlogon.h b/source3/librpc/gen_ndr/cli_netlogon.h deleted file mode 100644 index 3fbc00e9da..0000000000 --- a/source3/librpc/gen_ndr/cli_netlogon.h +++ /dev/null @@ -1,370 +0,0 @@ -#include "librpc/gen_ndr/ndr_netlogon.h" -#ifndef __CLI_NETLOGON__ -#define __CLI_NETLOGON__ -NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - const char *workstation /* [in] [charset(UTF16)] */, - struct netr_UasInfo **info /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - const char *workstation /* [in] [charset(UTF16)] */, - struct netr_UasLogoffInfo *info /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [unique] */, - struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, - enum netr_LogonInfoClass logon_level /* [in] */, - union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, - uint16_t validation_level /* [in] */, - union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, - uint8_t *authoritative /* [out] [ref] */); -NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [unique] */, - struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, - enum netr_LogonInfoClass logon_level /* [in] */, - union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */); -NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Credential *credentials /* [in] [ref] */, - struct netr_Credential *return_credentials /* [out] [ref] */); -NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Credential *credentials /* [in] [ref] */, - struct netr_Credential *return_credentials /* [out] [ref] */); -NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct samr_Password *new_password /* [in] [ref] */); -NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - enum netr_SamDatabaseID database_id /* [in] */, - uint64_t *sequence_num /* [in,out] [ref] */, - struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, - uint32_t preferredmaximumlength /* [in] */); -NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - enum netr_SamDatabaseID database_id /* [in] */, - uint32_t *sync_context /* [in,out] [ref] */, - struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, - uint32_t preferredmaximumlength /* [in] */); -NTSTATUS rpccli_netr_AccountDeltas(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator credential /* [in] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - struct netr_UAS_INFO_0 uas /* [in] */, - uint32_t count /* [in] */, - uint32_t level /* [in] */, - uint32_t buffersize /* [in] */, - struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */, - uint32_t *count_returned /* [out] [ref] */, - uint32_t *total_entries /* [out] [ref] */, - struct netr_UAS_INFO_0 *recordid /* [out] [ref] */); -NTSTATUS rpccli_netr_AccountSync(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator credential /* [in] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - uint32_t reference /* [in] */, - uint32_t level /* [in] */, - uint32_t buffersize /* [in] */, - struct netr_AccountBuffer *buffer /* [out] [ref,subcontext(4)] */, - uint32_t *count_returned /* [out] [ref] */, - uint32_t *total_entries /* [out] [ref] */, - uint32_t *next_reference /* [out] [ref] */, - struct netr_UAS_INFO_0 *recordid /* [in,out] [ref] */); -NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *domainname /* [in] [unique,charset(UTF16)] */, - const char **dcname /* [out] [ref,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - enum netr_LogonControlCode function_code /* [in] */, - uint32_t level /* [in] */, - union netr_CONTROL_QUERY_INFORMATION *info /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_netr_GetAnyDCName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - const char *domainname /* [in] [unique,charset(UTF16)] */, - const char **dcname /* [out] [ref,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - enum netr_LogonControlCode function_code /* [in] */, - uint32_t level /* [in] */, - union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */, - union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Credential *credentials /* [in] [ref] */, - struct netr_Credential *return_credentials /* [out] [ref] */, - uint32_t *negotiate_flags /* [in,out] [ref] */); -NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - enum netr_SamDatabaseID database_id /* [in] */, - uint16_t restart_state /* [in] */, - uint32_t *sync_context /* [in,out] [ref] */, - struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */, - uint32_t preferredmaximumlength /* [in] */); -NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [charset(UTF16)] */, - const char *computername /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - struct netr_ChangeLogEntry change_log_entry /* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */, - uint32_t change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->flags))] */, - struct netr_DELTA_ENUM_ARRAY **delta_enum_array /* [out] [ref] */); -NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server /* [in] [unique,charset(UTF16)] */, - uint32_t function_code /* [in] */, - uint32_t level /* [in] */, - union netr_CONTROL_DATA_INFORMATION data /* [in] [switch_is(function_code)] */, - union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct netr_Blob *trusted_domains_blob /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [unique,charset(UTF16)] */, - struct GUID *domain_guid /* [in] [unique] */, - struct GUID *site_guid /* [in] [unique] */, - uint32_t flags /* [in] */, - struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [unique,charset(UTF16)] */, - uint32_t *rid /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Credential *credentials /* [in] [ref] */, - struct netr_Credential *return_credentials /* [out] [ref] */, - uint32_t *negotiate_flags /* [in,out] [ref] */, - uint32_t *rid /* [out] [ref] */); -NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [unique,charset(UTF16)] */, - struct GUID *domain_guid /* [in] [unique] */, - const char *site_name /* [in] [unique,charset(UTF16)] */, - uint32_t flags /* [in] */, - struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_DsRGetSiteName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - const char **site /* [out] [ref,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, - uint32_t level /* [in] */, - union netr_DomainQuery query /* [in] [switch_is(level)] */, - union netr_DomainInfo *info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct netr_CryptPassword *new_password /* [in] [ref] */); -NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct samr_Password *password /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t count /* [in] [range(0,32000)] */, - struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */, - struct netr_DsRAddressToSitenamesWCtr **ctr /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *client_account /* [in] [unique,charset(UTF16)] */, - uint32_t mask /* [in] */, - const char *domain_name /* [in] [unique,charset(UTF16)] */, - struct GUID *domain_guid /* [in] [unique] */, - const char *site_name /* [in] [unique,charset(UTF16)] */, - uint32_t flags /* [in] */, - struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct netr_DomainTrustList *dom_trust_list /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t count /* [in] [range(0,32000)] */, - struct netr_DsRAddress *addresses /* [in] [ref,size_is(count)] */, - struct netr_DsRAddressToSitenamesExWCtr **ctr /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct DcSitesCtr **ctr /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - enum netr_LogonInfoClass logon_level /* [in] */, - union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, - uint16_t validation_level /* [in] */, - union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, - uint8_t *authoritative /* [out] [ref] */, - uint32_t *flags /* [in,out] [ref] */); -NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t trust_flags /* [in] */, - struct netr_DomainTrustList *trusts /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain /* [in] [unique,charset(UTF16)] */, - struct GUID *domain_guid /* [in] [unique] */, - struct GUID *dsa_guid /* [in] [unique] */, - const char *dns_host /* [in] [ref,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct samr_Password *password /* [out] [ref] */, - struct samr_Password *password2 /* [out] [ref] */); -NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *trusted_domain_name /* [in] [unique,charset(UTF16)] */, - uint32_t flags /* [in] */, - struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *trusted_domain_name /* [in] [ref,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - uint32_t flags /* [in] */, - struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *computer_name /* [in] [unique,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [unique] */, - struct netr_Authenticator *return_authenticator /* [in,out] [unique] */, - enum netr_LogonInfoClass logon_level /* [in] */, - union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */, - uint16_t validation_level /* [in] */, - union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */, - uint8_t *authoritative /* [out] [ref] */, - uint32_t *flags /* [in,out] [ref] */); -NTSTATUS rpccli_netr_ServerGetTrustInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account_name /* [in] [ref,charset(UTF16)] */, - enum netr_SchannelType secure_channel_type /* [in] */, - const char *computer_name /* [in] [ref,charset(UTF16)] */, - struct netr_Authenticator *credential /* [in] [ref] */, - struct netr_Authenticator *return_authenticator /* [out] [ref] */, - struct samr_Password *new_owf_password /* [out] [ref] */, - struct samr_Password *old_owf_password /* [out] [ref] */, - struct netr_TrustInfo **trust_info /* [out] [ref] */); -#endif /* __CLI_NETLOGON__ */ diff --git a/source3/librpc/gen_ndr/cli_ntsvcs.c b/source3/librpc/gen_ndr/cli_ntsvcs.c deleted file mode 100644 index 0f97970e0b..0000000000 --- a/source3/librpc/gen_ndr/cli_ntsvcs.c +++ /dev/null @@ -1,2744 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_ntsvcs.h" - -NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_Disconnect r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_Disconnect, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_DISCONNECT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_Disconnect, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_Connect r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_Connect, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_CONNECT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_Connect, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *version /* [out] [ref] */, - WERROR *werror) -{ - struct PNP_GetVersion r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetVersion, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETVERSION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetVersion, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *version = *r.out.version; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetGlobalState r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETGLOBALSTATE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_InitDetection r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_InitDetection, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_INITDETECTION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_InitDetection, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_ReportLogOn r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_REPORTLOGON, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *devicepath /* [in] [ref,charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct PNP_ValidateDeviceInstance r; - NTSTATUS status; - - /* In parameters */ - r.in.devicepath = devicepath; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_VALIDATEDEVICEINSTANCE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetRootDeviceInstance r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETROOTDEVICEINSTANCE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetRelatedDeviceInstance r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETRELATEDDEVICEINSTANCE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_EnumerateSubKeys r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_ENUMERATESUBKEYS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *filter /* [in] [unique,charset(UTF16)] */, - uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */, - uint32_t *length /* [in,out] [ref] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct PNP_GetDeviceList r; - NTSTATUS status; - - /* In parameters */ - r.in.filter = filter; - r.in.length = length; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETDEVICELIST, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(buffer, r.out.buffer, *r.in.length * sizeof(*buffer)); - *length = *r.out.length; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *devicename /* [in] [unique,charset(UTF16)] */, - uint32_t *size /* [out] [ref] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct PNP_GetDeviceListSize r; - NTSTATUS status; - - /* In parameters */ - r.in.devicename = devicename; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETDEVICELISTSIZE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *size = *r.out.size; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetDepth r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDepth, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETDEPTH, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDepth, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *devicepath /* [in] [ref,charset(UTF16)] */, - uint32_t property /* [in] */, - enum winreg_Type *reg_data_type /* [in,out] [ref] */, - uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */, - uint32_t *buffer_size /* [in,out] [ref] */, - uint32_t *needed /* [in,out] [ref] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct PNP_GetDeviceRegProp r; - NTSTATUS status; - - /* In parameters */ - r.in.devicepath = devicepath; - r.in.property = property; - r.in.reg_data_type = reg_data_type; - r.in.buffer_size = buffer_size; - r.in.needed = needed; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETDEVICEREGPROP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *reg_data_type = *r.out.reg_data_type; - memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer)); - *buffer_size = *r.out.buffer_size; - *needed = *r.out.needed; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_SetDeviceRegProp r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_SETDEVICEREGPROP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetClassInstance r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETCLASSINSTANCE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_CreateKey r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_CreateKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_CREATEKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_CreateKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_DeleteRegistryKey r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_DELETEREGISTRYKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetClassCount r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetClassCount, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETCLASSCOUNT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetClassName r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetClassName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETCLASSNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetClassName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_DeleteClassKey r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_DELETECLASSKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetInterfaceDeviceAlias r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETINTERFACEDEVICEALIAS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetInterfaceDeviceList r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETINTERFACEDEVICELIST, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetInterfaceDeviceListSize r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETINTERFACEDEVICELISTSIZE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_RegisterDeviceClassAssociation r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_REGISTERDEVICECLASSASSOCIATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_UnregisterDeviceClassAssociation r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetClassRegProp r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETCLASSREGPROP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_SetClassRegProp r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_SETCLASSREGPROP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_CreateDevInst r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_CREATEDEVINST, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_DeviceInstanceAction r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_DEVICEINSTANCEACTION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetDeviceStatus r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETDEVICESTATUS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_SetDeviceProblem r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_SETDEVICEPROBLEM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_DisableDevInst r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_DISABLEDEVINST, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_UninstallDevInst r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_UNINSTALLDEVINST, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_AddID r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_AddID, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_ADDID, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_AddID, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_RegisterDriver r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_REGISTERDRIVER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_QueryRemove r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_QueryRemove, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_QUERYREMOVE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_RequestDeviceEject r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_REQUESTDEVICEEJECT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_IsDockStationPresent r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_ISDOCKSTATIONPRESENT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_RequestEjectPC r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_REQUESTEJECTPC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t action /* [in] */, - const char *devicepath /* [in] [ref,charset(UTF16)] */, - uint32_t config /* [in] */, - uint32_t *profile_flags /* [in,out] [ref] */, - uint16_t *veto_type /* [in,out] [unique] */, - const char *unknown5 /* [in] [unique,charset(UTF16)] */, - const char **unknown5a /* [out] [unique,charset(UTF16)] */, - uint32_t name_length /* [in] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct PNP_HwProfFlags r; - NTSTATUS status; - - /* In parameters */ - r.in.action = action; - r.in.devicepath = devicepath; - r.in.config = config; - r.in.profile_flags = profile_flags; - r.in.veto_type = veto_type; - r.in.unknown5 = unknown5; - r.in.name_length = name_length; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_HWPROFFLAGS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *profile_flags = *r.out.profile_flags; - if (veto_type && r.out.veto_type) { - *veto_type = *r.out.veto_type; - } - if (unknown5a && r.out.unknown5a) { - *unknown5a = *r.out.unknown5a; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t idx /* [in] */, - struct PNP_HwProfInfo *info /* [in,out] [ref] */, - uint32_t size /* [in] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct PNP_GetHwProfInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.idx = idx; - r.in.info = info; - r.in.size = size; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETHWPROFINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_AddEmptyLogConf r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_ADDEMPTYLOGCONF, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_FreeLogConf r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_FREELOGCONF, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetFirstLogConf r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETFIRSTLOGCONF, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetNextLogConf r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETNEXTLOGCONF, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetLogConfPriority r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETLOGCONFPRIORITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_AddResDes r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_AddResDes, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_ADDRESDES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_AddResDes, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_FreeResDes r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_FreeResDes, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_FREERESDES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetNextResDes r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETNEXTRESDES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetResDesData r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetResDesData, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETRESDESDATA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetResDesDataSize r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETRESDESDATASIZE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_ModifyResDes r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_MODIFYRESDES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_DetectResourceLimit r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_DETECTRESOURCELIMIT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_QueryResConfList r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_QUERYRESCONFLIST, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_SetHwProf r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_SetHwProf, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_SETHWPROF, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_QueryArbitratorFreeData r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_QUERYARBITRATORFREEDATA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_QueryArbitratorFreeSize r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_QUERYARBITRATORFREESIZE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_RunDetection r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RunDetection, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_RUNDETECTION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RunDetection, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_RegisterNotification r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_REGISTERNOTIFICATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_UnregisterNotification r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_UNREGISTERNOTIFICATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetCustomDevProp r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETCUSTOMDEVPROP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetVersionInternal r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETVERSIONINTERNAL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetBlockedDriverInfo r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetBlockedDriverInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETBLOCKEDDRIVERINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetBlockedDriverInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct PNP_GetServerSideDeviceInstallFlags r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetServerSideDeviceInstallFlags, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_ntsvcs, - NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetServerSideDeviceInstallFlags, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - diff --git a/source3/librpc/gen_ndr/cli_ntsvcs.h b/source3/librpc/gen_ndr/cli_ntsvcs.h deleted file mode 100644 index fc4a9f4a71..0000000000 --- a/source3/librpc/gen_ndr/cli_ntsvcs.h +++ /dev/null @@ -1,229 +0,0 @@ -#include "librpc/gen_ndr/ndr_ntsvcs.h" -#ifndef __CLI_NTSVCS__ -#define __CLI_NTSVCS__ -NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *version /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *devicepath /* [in] [ref,charset(UTF16)] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *filter /* [in] [unique,charset(UTF16)] */, - uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */, - uint32_t *length /* [in,out] [ref] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *devicename /* [in] [unique,charset(UTF16)] */, - uint32_t *size /* [out] [ref] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *devicepath /* [in] [ref,charset(UTF16)] */, - uint32_t property /* [in] */, - enum winreg_Type *reg_data_type /* [in,out] [ref] */, - uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */, - uint32_t *buffer_size /* [in,out] [ref] */, - uint32_t *needed /* [in,out] [ref] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t action /* [in] */, - const char *devicepath /* [in] [ref,charset(UTF16)] */, - uint32_t config /* [in] */, - uint32_t *profile_flags /* [in,out] [ref] */, - uint16_t *veto_type /* [in,out] [unique] */, - const char *unknown5 /* [in] [unique,charset(UTF16)] */, - const char **unknown5a /* [out] [unique,charset(UTF16)] */, - uint32_t name_length /* [in] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t idx /* [in] */, - struct PNP_HwProfInfo *info /* [in,out] [ref] */, - uint32_t size /* [in] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -#endif /* __CLI_NTSVCS__ */ diff --git a/source3/librpc/gen_ndr/cli_samr.c b/source3/librpc/gen_ndr/cli_samr.c deleted file mode 100644 index 7edb790286..0000000000 --- a/source3/librpc/gen_ndr/cli_samr.c +++ /dev/null @@ -1,2962 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_samr.h" - -NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *connect_handle /* [out] [ref] */) -{ - struct samr_Connect r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CONNECT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *connect_handle = *r.out.connect_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */) -{ - struct samr_Close r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Close, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CLOSE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Close, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct sec_desc_buf *sdbuf /* [in] [ref] */) -{ - struct samr_SetSecurity r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sec_info = sec_info; - r.in.sdbuf = sdbuf; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetSecurity, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SETSECURITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetSecurity, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct sec_desc_buf **sdbuf /* [out] [ref] */) -{ - struct samr_QuerySecurity r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sec_info = sec_info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QuerySecurity, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYSECURITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sdbuf = *r.out.sdbuf; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */) -{ - struct samr_Shutdown r; - NTSTATUS status; - - /* In parameters */ - r.in.connect_handle = connect_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Shutdown, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SHUTDOWN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Shutdown, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */, - struct lsa_String *domain_name /* [in] [ref] */, - struct dom_sid2 **sid /* [out] [ref] */) -{ - struct samr_LookupDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.connect_handle = connect_handle; - r.in.domain_name = domain_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_LookupDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_LOOKUPDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_LookupDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sid = *r.out.sid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct samr_SamArray **sam /* [out] [ref] */, - uint32_t buf_size /* [in] */, - uint32_t *num_entries /* [out] [ref] */) -{ - struct samr_EnumDomains r; - NTSTATUS status; - - /* In parameters */ - r.in.connect_handle = connect_handle; - r.in.resume_handle = resume_handle; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_EnumDomains, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_ENUMDOMAINS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_EnumDomains, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *resume_handle = *r.out.resume_handle; - *sam = *r.out.sam; - *num_entries = *r.out.num_entries; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct dom_sid2 *sid /* [in] [ref] */, - struct policy_handle *domain_handle /* [out] [ref] */) -{ - struct samr_OpenDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.connect_handle = connect_handle; - r.in.access_mask = access_mask; - r.in.sid = sid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OpenDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_OPENDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OpenDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *domain_handle = *r.out.domain_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */) -{ - struct samr_QueryDomainInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYDOMAININFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */) -{ - struct samr_SetDomainInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SETDOMAININFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_String *name /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *group_handle /* [out] [ref] */, - uint32_t *rid /* [out] [ref] */) -{ - struct samr_CreateDomainGroup r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.name = name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CREATEDOMAINGROUP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *group_handle = *r.out.group_handle; - *rid = *r.out.rid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct samr_SamArray **sam /* [out] [ref] */, - uint32_t max_size /* [in] */, - uint32_t *num_entries /* [out] [ref] */) -{ - struct samr_EnumDomainGroups r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.resume_handle = resume_handle; - r.in.max_size = max_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_ENUMDOMAINGROUPS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *resume_handle = *r.out.resume_handle; - *sam = *r.out.sam; - *num_entries = *r.out.num_entries; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_String *account_name /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *user_handle /* [out] [ref] */, - uint32_t *rid /* [out] [ref] */) -{ - struct samr_CreateUser r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.account_name = account_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_CreateUser, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CREATEUSER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_CreateUser, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *user_handle = *r.out.user_handle; - *rid = *r.out.rid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - uint32_t acct_flags /* [in] */, - struct samr_SamArray **sam /* [out] [ref] */, - uint32_t max_size /* [in] */, - uint32_t *num_entries /* [out] [ref] */) -{ - struct samr_EnumDomainUsers r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.resume_handle = resume_handle; - r.in.acct_flags = acct_flags; - r.in.max_size = max_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_ENUMDOMAINUSERS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *resume_handle = *r.out.resume_handle; - *sam = *r.out.sam; - *num_entries = *r.out.num_entries; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_String *alias_name /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *alias_handle /* [out] [ref] */, - uint32_t *rid /* [out] [ref] */) -{ - struct samr_CreateDomAlias r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.alias_name = alias_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CREATEDOMALIAS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *alias_handle = *r.out.alias_handle; - *rid = *r.out.rid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct samr_SamArray **sam /* [out] [ref] */, - uint32_t max_size /* [in] */, - uint32_t *num_entries /* [out] [ref] */) -{ - struct samr_EnumDomainAliases r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.resume_handle = resume_handle; - r.in.max_size = max_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_ENUMDOMAINALIASES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *resume_handle = *r.out.resume_handle; - *sam = *r.out.sam; - *num_entries = *r.out.num_entries; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */, - struct samr_Ids *rids /* [out] [ref] */) -{ - struct samr_GetAliasMembership r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.sids = sids; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_GETALIASMEMBERSHIP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *rids = *r.out.rids; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */, - struct samr_Ids *rids /* [out] [ref] */, - struct samr_Ids *types /* [out] [ref] */) -{ - struct samr_LookupNames r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.num_names = num_names; - r.in.names = names; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_LookupNames, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_LOOKUPNAMES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_LookupNames, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *rids = *r.out.rids; - *types = *r.out.types; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t num_rids /* [in] [range(0,1000)] */, - uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */, - struct lsa_Strings *names /* [out] [ref] */, - struct samr_Ids *types /* [out] [ref] */) -{ - struct samr_LookupRids r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.num_rids = num_rids; - r.in.rids = rids; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_LookupRids, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_LOOKUPRIDS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_LookupRids, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *names = *r.out.names; - *types = *r.out.types; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t access_mask /* [in] */, - uint32_t rid /* [in] */, - struct policy_handle *group_handle /* [out] [ref] */) -{ - struct samr_OpenGroup r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.access_mask = access_mask; - r.in.rid = rid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OpenGroup, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_OPENGROUP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OpenGroup, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *group_handle = *r.out.group_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - enum samr_GroupInfoEnum level /* [in] */, - union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */) -{ - struct samr_QueryGroupInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.group_handle = group_handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYGROUPINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - enum samr_GroupInfoEnum level /* [in] */, - union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */) -{ - struct samr_SetGroupInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.group_handle = group_handle; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SETGROUPINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - uint32_t rid /* [in] */, - uint32_t flags /* [in] */) -{ - struct samr_AddGroupMember r; - NTSTATUS status; - - /* In parameters */ - r.in.group_handle = group_handle; - r.in.rid = rid; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_AddGroupMember, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_ADDGROUPMEMBER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in,out] [ref] */) -{ - struct samr_DeleteDomainGroup r; - NTSTATUS status; - - /* In parameters */ - r.in.group_handle = group_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_DELETEDOMAINGROUP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *group_handle = *r.out.group_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - uint32_t rid /* [in] */) -{ - struct samr_DeleteGroupMember r; - NTSTATUS status; - - /* In parameters */ - r.in.group_handle = group_handle; - r.in.rid = rid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_DELETEGROUPMEMBER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - struct samr_RidTypeArray **rids /* [out] [ref] */) -{ - struct samr_QueryGroupMember r; - NTSTATUS status; - - /* In parameters */ - r.in.group_handle = group_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYGROUPMEMBER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *rids = *r.out.rids; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - uint32_t unknown1 /* [in] */, - uint32_t unknown2 /* [in] */) -{ - struct samr_SetMemberAttributesOfGroup r; - NTSTATUS status; - - /* In parameters */ - r.in.group_handle = group_handle; - r.in.unknown1 = unknown1; - r.in.unknown2 = unknown2; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t access_mask /* [in] */, - uint32_t rid /* [in] */, - struct policy_handle *alias_handle /* [out] [ref] */) -{ - struct samr_OpenAlias r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.access_mask = access_mask; - r.in.rid = rid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OpenAlias, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_OPENALIAS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OpenAlias, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *alias_handle = *r.out.alias_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - enum samr_AliasInfoEnum level /* [in] */, - union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */) -{ - struct samr_QueryAliasInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.alias_handle = alias_handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYALIASINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - enum samr_AliasInfoEnum level /* [in] */, - union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */) -{ - struct samr_SetAliasInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.alias_handle = alias_handle; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SETALIASINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in,out] [ref] */) -{ - struct samr_DeleteDomAlias r; - NTSTATUS status; - - /* In parameters */ - r.in.alias_handle = alias_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_DELETEDOMALIAS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *alias_handle = *r.out.alias_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */) -{ - struct samr_AddAliasMember r; - NTSTATUS status; - - /* In parameters */ - r.in.alias_handle = alias_handle; - r.in.sid = sid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_AddAliasMember, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_ADDALIASMEMBER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */) -{ - struct samr_DeleteAliasMember r; - NTSTATUS status; - - /* In parameters */ - r.in.alias_handle = alias_handle; - r.in.sid = sid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_DELETEALIASMEMBER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [out] [ref] */) -{ - struct samr_GetMembersInAlias r; - NTSTATUS status; - - /* In parameters */ - r.in.alias_handle = alias_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_GETMEMBERSINALIAS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sids = *r.out.sids; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t access_mask /* [in] */, - uint32_t rid /* [in] */, - struct policy_handle *user_handle /* [out] [ref] */) -{ - struct samr_OpenUser r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.access_mask = access_mask; - r.in.rid = rid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OpenUser, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_OPENUSER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OpenUser, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *user_handle = *r.out.user_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in,out] [ref] */) -{ - struct samr_DeleteUser r; - NTSTATUS status; - - /* In parameters */ - r.in.user_handle = user_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteUser, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_DELETEUSER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteUser, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *user_handle = *r.out.user_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_UserInfo **info /* [out] [ref,switch_is(level)] */) -{ - struct samr_QueryUserInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.user_handle = user_handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYUSERINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_UserInfo *info /* [in] [ref,switch_is(level)] */) -{ - struct samr_SetUserInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.user_handle = user_handle; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetUserInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SETUSERINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint8_t lm_present /* [in] */, - struct samr_Password *old_lm_crypted /* [in] [unique] */, - struct samr_Password *new_lm_crypted /* [in] [unique] */, - uint8_t nt_present /* [in] */, - struct samr_Password *old_nt_crypted /* [in] [unique] */, - struct samr_Password *new_nt_crypted /* [in] [unique] */, - uint8_t cross1_present /* [in] */, - struct samr_Password *nt_cross /* [in] [unique] */, - uint8_t cross2_present /* [in] */, - struct samr_Password *lm_cross /* [in] [unique] */) -{ - struct samr_ChangePasswordUser r; - NTSTATUS status; - - /* In parameters */ - r.in.user_handle = user_handle; - r.in.lm_present = lm_present; - r.in.old_lm_crypted = old_lm_crypted; - r.in.new_lm_crypted = new_lm_crypted; - r.in.nt_present = nt_present; - r.in.old_nt_crypted = old_nt_crypted; - r.in.new_nt_crypted = new_nt_crypted; - r.in.cross1_present = cross1_present; - r.in.nt_cross = nt_cross; - r.in.cross2_present = cross2_present; - r.in.lm_cross = lm_cross; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CHANGEPASSWORDUSER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - struct samr_RidWithAttributeArray **rids /* [out] [ref] */) -{ - struct samr_GetGroupsForUser r; - NTSTATUS status; - - /* In parameters */ - r.in.user_handle = user_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_GETGROUPSFORUSER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *rids = *r.out.rids; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - uint32_t start_idx /* [in] */, - uint32_t max_entries /* [in] */, - uint32_t buf_size /* [in] */, - uint32_t *total_size /* [out] [ref] */, - uint32_t *returned_size /* [out] [ref] */, - union samr_DispInfo *info /* [out] [ref,switch_is(level)] */) -{ - struct samr_QueryDisplayInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.level = level; - r.in.start_idx = start_idx; - r.in.max_entries = max_entries; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYDISPLAYINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *total_size = *r.out.total_size; - *returned_size = *r.out.returned_size; - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - struct lsa_String *name /* [in] [ref] */, - uint32_t *idx /* [out] [ref] */) -{ - struct samr_GetDisplayEnumerationIndex r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.level = level; - r.in.name = name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_GETDISPLAYENUMERATIONINDEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *idx = *r.out.idx; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */) -{ - struct samr_TestPrivateFunctionsDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */) -{ - struct samr_TestPrivateFunctionsUser r; - NTSTATUS status; - - /* In parameters */ - r.in.user_handle = user_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - struct samr_PwInfo *info /* [out] [ref] */) -{ - struct samr_GetUserPwInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.user_handle = user_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_GETUSERPWINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */) -{ - struct samr_RemoveMemberFromForeignDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.sid = sid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */) -{ - struct samr_QueryDomainInfo2 r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYDOMAININFO2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_UserInfo **info /* [out] [ref,switch_is(level)] */) -{ - struct samr_QueryUserInfo2 r; - NTSTATUS status; - - /* In parameters */ - r.in.user_handle = user_handle; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYUSERINFO2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - uint32_t start_idx /* [in] */, - uint32_t max_entries /* [in] */, - uint32_t buf_size /* [in] */, - uint32_t *total_size /* [out] [ref] */, - uint32_t *returned_size /* [out] [ref] */, - union samr_DispInfo *info /* [out] [ref,switch_is(level)] */) -{ - struct samr_QueryDisplayInfo2 r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.level = level; - r.in.start_idx = start_idx; - r.in.max_entries = max_entries; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYDISPLAYINFO2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *total_size = *r.out.total_size; - *returned_size = *r.out.returned_size; - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - struct lsa_String *name /* [in] [ref] */, - uint32_t *idx /* [out] [ref] */) -{ - struct samr_GetDisplayEnumerationIndex2 r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.level = level; - r.in.name = name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_GETDISPLAYENUMERATIONINDEX2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *idx = *r.out.idx; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_String *account_name /* [in] [ref] */, - uint32_t acct_flags /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *user_handle /* [out] [ref] */, - uint32_t *access_granted /* [out] [ref] */, - uint32_t *rid /* [out] [ref] */) -{ - struct samr_CreateUser2 r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.account_name = account_name; - r.in.acct_flags = acct_flags; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_CreateUser2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CREATEUSER2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_CreateUser2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *user_handle = *r.out.user_handle; - *access_granted = *r.out.access_granted; - *rid = *r.out.rid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - uint32_t start_idx /* [in] */, - uint32_t max_entries /* [in] */, - uint32_t buf_size /* [in] */, - uint32_t *total_size /* [out] [ref] */, - uint32_t *returned_size /* [out] [ref] */, - union samr_DispInfo *info /* [out] [ref,switch_is(level)] */) -{ - struct samr_QueryDisplayInfo3 r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.level = level; - r.in.start_idx = start_idx; - r.in.max_entries = max_entries; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_QUERYDISPLAYINFO3, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *total_size = *r.out.total_size; - *returned_size = *r.out.returned_size; - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */) -{ - struct samr_AddMultipleMembersToAlias r; - NTSTATUS status; - - /* In parameters */ - r.in.alias_handle = alias_handle; - r.in.sids = sids; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */) -{ - struct samr_RemoveMultipleMembersFromAlias r; - NTSTATUS status; - - /* In parameters */ - r.in.alias_handle = alias_handle; - r.in.sids = sids; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_AsciiString *server /* [in] [unique] */, - struct lsa_AsciiString *account /* [in] [ref] */, - struct samr_CryptPassword *password /* [in] [unique] */, - struct samr_Password *hash /* [in] [unique] */) -{ - struct samr_OemChangePasswordUser2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server = server; - r.in.account = account; - r.in.password = password; - r.in.hash = hash; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_OEMCHANGEPASSWORDUSER2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_String *server /* [in] [unique] */, - struct lsa_String *account /* [in] [ref] */, - struct samr_CryptPassword *nt_password /* [in] [unique] */, - struct samr_Password *nt_verifier /* [in] [unique] */, - uint8_t lm_change /* [in] */, - struct samr_CryptPassword *lm_password /* [in] [unique] */, - struct samr_Password *lm_verifier /* [in] [unique] */) -{ - struct samr_ChangePasswordUser2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server = server; - r.in.account = account; - r.in.nt_password = nt_password; - r.in.nt_verifier = nt_verifier; - r.in.lm_change = lm_change; - r.in.lm_password = lm_password; - r.in.lm_verifier = lm_verifier; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CHANGEPASSWORDUSER2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_String *domain_name /* [in] [unique] */, - struct samr_PwInfo *info /* [out] [ref] */) -{ - struct samr_GetDomPwInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_name = domain_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_GETDOMPWINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - struct policy_handle *connect_handle /* [out] [ref] */) -{ - struct samr_Connect2 r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CONNECT2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *connect_handle = *r.out.connect_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_UserInfo *info /* [in] [ref,switch_is(level)] */) -{ - struct samr_SetUserInfo2 r; - NTSTATUS status; - - /* In parameters */ - r.in.user_handle = user_handle; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SETUSERINFO2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */, - uint32_t unknown1 /* [in] */, - uint32_t unknown2 /* [in] */, - uint32_t unknown3 /* [in] */) -{ - struct samr_SetBootKeyInformation r; - NTSTATUS status; - - /* In parameters */ - r.in.connect_handle = connect_handle; - r.in.unknown1 = unknown1; - r.in.unknown2 = unknown2; - r.in.unknown3 = unknown3; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SETBOOTKEYINFORMATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t *unknown /* [out] [ref] */) -{ - struct samr_GetBootKeyInformation r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_GETBOOTKEYINFORMATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *unknown = *r.out.unknown; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - uint32_t unknown /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *connect_handle /* [out] [ref] */) -{ - struct samr_Connect3 r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.unknown = unknown; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect3, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CONNECT3, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect3, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *connect_handle = *r.out.connect_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - enum samr_ConnectVersion client_version /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *connect_handle /* [out] [ref] */) -{ - struct samr_Connect4 r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.client_version = client_version; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect4, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CONNECT4, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect4, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *connect_handle = *r.out.connect_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_String *server /* [in] [unique] */, - struct lsa_String *account /* [in] [ref] */, - struct samr_CryptPassword *nt_password /* [in] [unique] */, - struct samr_Password *nt_verifier /* [in] [unique] */, - uint8_t lm_change /* [in] */, - struct samr_CryptPassword *lm_password /* [in] [unique] */, - struct samr_Password *lm_verifier /* [in] [unique] */, - struct samr_CryptPassword *password3 /* [in] [unique] */, - struct samr_DomInfo1 **dominfo /* [out] [ref] */, - struct samr_ChangeReject **reject /* [out] [ref] */) -{ - struct samr_ChangePasswordUser3 r; - NTSTATUS status; - - /* In parameters */ - r.in.server = server; - r.in.account = account; - r.in.nt_password = nt_password; - r.in.nt_verifier = nt_verifier; - r.in.lm_change = lm_change; - r.in.lm_password = lm_password; - r.in.lm_verifier = lm_verifier; - r.in.password3 = password3; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CHANGEPASSWORDUSER3, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *dominfo = *r.out.dominfo; - *reject = *r.out.reject; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - uint32_t level_in /* [in] */, - union samr_ConnectInfo *info_in /* [in] [ref,switch_is(level_in)] */, - uint32_t *level_out /* [out] [ref] */, - union samr_ConnectInfo *info_out /* [out] [ref,switch_is(*level_out)] */, - struct policy_handle *connect_handle /* [out] [ref] */) -{ - struct samr_Connect5 r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - r.in.level_in = level_in; - r.in.info_in = info_in; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect5, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_CONNECT5, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect5, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *level_out = *r.out.level_out; - *info_out = *r.out.info_out; - *connect_handle = *r.out.connect_handle; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t rid /* [in] */, - struct dom_sid2 **sid /* [out] [ref] */) -{ - struct samr_RidToSid r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_handle = domain_handle; - r.in.rid = rid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_RidToSid, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_RIDTOSID, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_RidToSid, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sid = *r.out.sid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_String *name /* [in] [unique] */, - uint32_t unknown /* [in] */, - struct samr_Password *hash /* [in] [unique] */) -{ - struct samr_SetDsrmPassword r; - NTSTATUS status; - - /* In parameters */ - r.in.name = name; - r.in.unknown = unknown; - r.in.hash = hash; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_SETDSRMPASSWORD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - enum samr_ValidatePasswordLevel level /* [in] */, - union samr_ValidatePasswordReq *req /* [in] [ref,switch_is(level)] */, - union samr_ValidatePasswordRep **rep /* [out] [ref,switch_is(level)] */) -{ - struct samr_ValidatePassword r; - NTSTATUS status; - - /* In parameters */ - r.in.level = level; - r.in.req = req; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_ValidatePassword, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_samr, - NDR_SAMR_VALIDATEPASSWORD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *rep = *r.out.rep; - - /* Return result */ - return r.out.result; -} - diff --git a/source3/librpc/gen_ndr/cli_samr.h b/source3/librpc/gen_ndr/cli_samr.h deleted file mode 100644 index b57d63334e..0000000000 --- a/source3/librpc/gen_ndr/cli_samr.h +++ /dev/null @@ -1,389 +0,0 @@ -#include "librpc/gen_ndr/ndr_samr.h" -#ifndef __CLI_SAMR__ -#define __CLI_SAMR__ -NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *connect_handle /* [out] [ref] */); -NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */); -NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct sec_desc_buf *sdbuf /* [in] [ref] */); -NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct sec_desc_buf **sdbuf /* [out] [ref] */); -NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */); -NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */, - struct lsa_String *domain_name /* [in] [ref] */, - struct dom_sid2 **sid /* [out] [ref] */); -NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct samr_SamArray **sam /* [out] [ref] */, - uint32_t buf_size /* [in] */, - uint32_t *num_entries /* [out] [ref] */); -NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct dom_sid2 *sid /* [in] [ref] */, - struct policy_handle *domain_handle /* [out] [ref] */); -NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_String *name /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *group_handle /* [out] [ref] */, - uint32_t *rid /* [out] [ref] */); -NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct samr_SamArray **sam /* [out] [ref] */, - uint32_t max_size /* [in] */, - uint32_t *num_entries /* [out] [ref] */); -NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_String *account_name /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *user_handle /* [out] [ref] */, - uint32_t *rid /* [out] [ref] */); -NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - uint32_t acct_flags /* [in] */, - struct samr_SamArray **sam /* [out] [ref] */, - uint32_t max_size /* [in] */, - uint32_t *num_entries /* [out] [ref] */); -NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_String *alias_name /* [in] [ref] */, - uint32_t access_mask /* [in] */, - struct policy_handle *alias_handle /* [out] [ref] */, - uint32_t *rid /* [out] [ref] */); -NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t *resume_handle /* [in,out] [ref] */, - struct samr_SamArray **sam /* [out] [ref] */, - uint32_t max_size /* [in] */, - uint32_t *num_entries /* [out] [ref] */); -NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */, - struct samr_Ids *rids /* [out] [ref] */); -NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t num_names /* [in] [range(0,1000)] */, - struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */, - struct samr_Ids *rids /* [out] [ref] */, - struct samr_Ids *types /* [out] [ref] */); -NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t num_rids /* [in] [range(0,1000)] */, - uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */, - struct lsa_Strings *names /* [out] [ref] */, - struct samr_Ids *types /* [out] [ref] */); -NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t access_mask /* [in] */, - uint32_t rid /* [in] */, - struct policy_handle *group_handle /* [out] [ref] */); -NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - enum samr_GroupInfoEnum level /* [in] */, - union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - enum samr_GroupInfoEnum level /* [in] */, - union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - uint32_t rid /* [in] */, - uint32_t flags /* [in] */); -NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in,out] [ref] */); -NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - uint32_t rid /* [in] */); -NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - struct samr_RidTypeArray **rids /* [out] [ref] */); -NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *group_handle /* [in] [ref] */, - uint32_t unknown1 /* [in] */, - uint32_t unknown2 /* [in] */); -NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t access_mask /* [in] */, - uint32_t rid /* [in] */, - struct policy_handle *alias_handle /* [out] [ref] */); -NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - enum samr_AliasInfoEnum level /* [in] */, - union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - enum samr_AliasInfoEnum level /* [in] */, - union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in,out] [ref] */); -NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */); -NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */); -NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [out] [ref] */); -NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t access_mask /* [in] */, - uint32_t rid /* [in] */, - struct policy_handle *user_handle /* [out] [ref] */); -NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in,out] [ref] */); -NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_UserInfo **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_UserInfo *info /* [in] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint8_t lm_present /* [in] */, - struct samr_Password *old_lm_crypted /* [in] [unique] */, - struct samr_Password *new_lm_crypted /* [in] [unique] */, - uint8_t nt_present /* [in] */, - struct samr_Password *old_nt_crypted /* [in] [unique] */, - struct samr_Password *new_nt_crypted /* [in] [unique] */, - uint8_t cross1_present /* [in] */, - struct samr_Password *nt_cross /* [in] [unique] */, - uint8_t cross2_present /* [in] */, - struct samr_Password *lm_cross /* [in] [unique] */); -NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - struct samr_RidWithAttributeArray **rids /* [out] [ref] */); -NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - uint32_t start_idx /* [in] */, - uint32_t max_entries /* [in] */, - uint32_t buf_size /* [in] */, - uint32_t *total_size /* [out] [ref] */, - uint32_t *returned_size /* [out] [ref] */, - union samr_DispInfo *info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - struct lsa_String *name /* [in] [ref] */, - uint32_t *idx /* [out] [ref] */); -NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */); -NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */); -NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - struct samr_PwInfo *info /* [out] [ref] */); -NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct dom_sid2 *sid /* [in] [ref] */); -NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_UserInfo **info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - uint32_t start_idx /* [in] */, - uint32_t max_entries /* [in] */, - uint32_t buf_size /* [in] */, - uint32_t *total_size /* [out] [ref] */, - uint32_t *returned_size /* [out] [ref] */, - union samr_DispInfo *info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - struct lsa_String *name /* [in] [ref] */, - uint32_t *idx /* [out] [ref] */); -NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - struct lsa_String *account_name /* [in] [ref] */, - uint32_t acct_flags /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *user_handle /* [out] [ref] */, - uint32_t *access_granted /* [out] [ref] */, - uint32_t *rid /* [out] [ref] */); -NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint16_t level /* [in] */, - uint32_t start_idx /* [in] */, - uint32_t max_entries /* [in] */, - uint32_t buf_size /* [in] */, - uint32_t *total_size /* [out] [ref] */, - uint32_t *returned_size /* [out] [ref] */, - union samr_DispInfo *info /* [out] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */); -NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *alias_handle /* [in] [ref] */, - struct lsa_SidArray *sids /* [in] [ref] */); -NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_AsciiString *server /* [in] [unique] */, - struct lsa_AsciiString *account /* [in] [ref] */, - struct samr_CryptPassword *password /* [in] [unique] */, - struct samr_Password *hash /* [in] [unique] */); -NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_String *server /* [in] [unique] */, - struct lsa_String *account /* [in] [ref] */, - struct samr_CryptPassword *nt_password /* [in] [unique] */, - struct samr_Password *nt_verifier /* [in] [unique] */, - uint8_t lm_change /* [in] */, - struct samr_CryptPassword *lm_password /* [in] [unique] */, - struct samr_Password *lm_verifier /* [in] [unique] */); -NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_String *domain_name /* [in] [unique] */, - struct samr_PwInfo *info /* [out] [ref] */); -NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - struct policy_handle *connect_handle /* [out] [ref] */); -NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle /* [in] [ref] */, - uint16_t level /* [in] */, - union samr_UserInfo *info /* [in] [ref,switch_is(level)] */); -NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *connect_handle /* [in] [ref] */, - uint32_t unknown1 /* [in] */, - uint32_t unknown2 /* [in] */, - uint32_t unknown3 /* [in] */); -NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t *unknown /* [out] [ref] */); -NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - uint32_t unknown /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *connect_handle /* [out] [ref] */); -NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - enum samr_ConnectVersion client_version /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *connect_handle /* [out] [ref] */); -NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_String *server /* [in] [unique] */, - struct lsa_String *account /* [in] [ref] */, - struct samr_CryptPassword *nt_password /* [in] [unique] */, - struct samr_Password *nt_verifier /* [in] [unique] */, - uint8_t lm_change /* [in] */, - struct samr_CryptPassword *lm_password /* [in] [unique] */, - struct samr_Password *lm_verifier /* [in] [unique] */, - struct samr_CryptPassword *password3 /* [in] [unique] */, - struct samr_DomInfo1 **dominfo /* [out] [ref] */, - struct samr_ChangeReject **reject /* [out] [ref] */); -NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *system_name /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - uint32_t level_in /* [in] */, - union samr_ConnectInfo *info_in /* [in] [ref,switch_is(level_in)] */, - uint32_t *level_out /* [out] [ref] */, - union samr_ConnectInfo *info_out /* [out] [ref,switch_is(*level_out)] */, - struct policy_handle *connect_handle /* [out] [ref] */); -NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *domain_handle /* [in] [ref] */, - uint32_t rid /* [in] */, - struct dom_sid2 **sid /* [out] [ref] */); -NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct lsa_String *name /* [in] [unique] */, - uint32_t unknown /* [in] */, - struct samr_Password *hash /* [in] [unique] */); -NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - enum samr_ValidatePasswordLevel level /* [in] */, - union samr_ValidatePasswordReq *req /* [in] [ref,switch_is(level)] */, - union samr_ValidatePasswordRep **rep /* [out] [ref,switch_is(level)] */); -#endif /* __CLI_SAMR__ */ diff --git a/source3/librpc/gen_ndr/cli_srvsvc.c b/source3/librpc/gen_ndr/cli_srvsvc.c deleted file mode 100644 index eb81652a1d..0000000000 --- a/source3/librpc/gen_ndr/cli_srvsvc.c +++ /dev/null @@ -1,2632 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_srvsvc.h" - -NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetCharDevInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetCharDevEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.info_ctr = info_ctr; - r.in.max_buffer = max_buffer; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETCHARDEVENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info_ctr = *r.out.info_ctr; - *totalentries = *r.out.totalentries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetCharDevGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *device_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetCharDevInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct srvsvc_NetCharDevGetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.device_name = device_name; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevGetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETCHARDEVGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevGetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetCharDevControl(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *device_name /* [in] [charset(UTF16)] */, - uint32_t opcode /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetCharDevControl r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.device_name = device_name; - r.in.opcode = opcode; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevControl, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETCHARDEVCONTROL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevControl, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *user /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetCharDevQInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetCharDevQEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.user = user; - r.in.info_ctr = info_ctr; - r.in.max_buffer = max_buffer; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETCHARDEVQENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info_ctr = *r.out.info_ctr; - *totalentries = *r.out.totalentries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *queue_name /* [in] [charset(UTF16)] */, - const char *user /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetCharDevQInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct srvsvc_NetCharDevQGetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.queue_name = queue_name; - r.in.user = user; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQGetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETCHARDEVQGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQGetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *queue_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetCharDevQInfo info /* [in] [switch_is(level)] */, - uint32_t *parm_error /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetCharDevQSetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.queue_name = queue_name; - r.in.level = level; - r.in.info = info; - r.in.parm_error = parm_error; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQSetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETCHARDEVQSETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQSetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (parm_error && r.out.parm_error) { - *parm_error = *r.out.parm_error; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetCharDevQPurge(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *queue_name /* [in] [charset(UTF16)] */, - WERROR *werror) -{ - struct srvsvc_NetCharDevQPurge r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.queue_name = queue_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurge, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETCHARDEVQPURGE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurge, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *queue_name /* [in] [charset(UTF16)] */, - const char *computer_name /* [in] [charset(UTF16)] */, - WERROR *werror) -{ - struct srvsvc_NetCharDevQPurgeSelf r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.queue_name = queue_name; - r.in.computer_name = computer_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurgeSelf, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETCHARDEVQPURGESELF, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurgeSelf, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetConnInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetConnEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.path = path; - r.in.info_ctr = info_ctr; - r.in.max_buffer = max_buffer; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetConnEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETCONNENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetConnEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info_ctr = *r.out.info_ctr; - *totalentries = *r.out.totalentries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path /* [in] [unique,charset(UTF16)] */, - const char *user /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetFileInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetFileEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.path = path; - r.in.user = user; - r.in.info_ctr = info_ctr; - r.in.max_buffer = max_buffer; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetFileEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETFILEENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetFileEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info_ctr = *r.out.info_ctr; - *totalentries = *r.out.totalentries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetFileGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t fid /* [in] */, - uint32_t level /* [in] */, - union srvsvc_NetFileInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct srvsvc_NetFileGetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.fid = fid; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetFileGetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETFILEGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetFileGetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t fid /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetFileClose r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.fid = fid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetFileClose, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETFILECLOSE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetFileClose, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *client /* [in] [unique,charset(UTF16)] */, - const char *user /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetSessInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetSessEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.client = client; - r.in.user = user; - r.in.info_ctr = info_ctr; - r.in.max_buffer = max_buffer; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSessEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSESSENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSessEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info_ctr = *r.out.info_ctr; - *totalentries = *r.out.totalentries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *client /* [in] [unique,charset(UTF16)] */, - const char *user /* [in] [unique,charset(UTF16)] */, - WERROR *werror) -{ - struct srvsvc_NetSessDel r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.client = client; - r.in.user = user; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSessDel, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSESSDEL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSessDel, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_error /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetShareAdd r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.level = level; - r.in.info = info; - r.in.parm_error = parm_error; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareAdd, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHAREADD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareAdd, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (parm_error && r.out.parm_error) { - *parm_error = *r.out.parm_error; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetShareEnumAll r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.info_ctr = info_ctr; - r.in.max_buffer = max_buffer; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnumAll, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHAREENUMALL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnumAll, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info_ctr = *r.out.info_ctr; - *totalentries = *r.out.totalentries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetShareInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct srvsvc_NetShareGetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.share_name = share_name; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareGetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHAREGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareGetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_error /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetShareSetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.share_name = share_name; - r.in.level = level; - r.in.info = info; - r.in.parm_error = parm_error; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareSetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHARESETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareSetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (parm_error && r.out.parm_error) { - *parm_error = *r.out.parm_error; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share_name /* [in] [charset(UTF16)] */, - uint32_t reserved /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetShareDel r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.share_name = share_name; - r.in.reserved = reserved; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareDel, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHAREDEL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDel, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share_name /* [in] [charset(UTF16)] */, - uint32_t reserved /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetShareDelSticky r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.share_name = share_name; - r.in.reserved = reserved; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelSticky, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHAREDELSTICKY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelSticky, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareCheck(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *device_name /* [in] [charset(UTF16)] */, - enum srvsvc_ShareType *type /* [out] [ref] */, - WERROR *werror) -{ - struct srvsvc_NetShareCheck r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.device_name = device_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareCheck, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHARECHECK, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareCheck, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *type = *r.out.type; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetSrvInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct srvsvc_NetSrvGetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSrvGetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSRVGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvGetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetSrvInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_error /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetSrvSetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.level = level; - r.in.info = info; - r.in.parm_error = parm_error; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSrvSetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSRVSETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvSetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (parm_error && r.out.parm_error) { - *parm_error = *r.out.parm_error; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - struct srvsvc_NetDiskInfo *info /* [in,out] [ref] */, - uint32_t maxlen /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetDiskEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.level = level; - r.in.info = info; - r.in.maxlen = maxlen; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetDiskEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETDISKENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetDiskEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - *totalentries = *r.out.totalentries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *service /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - uint32_t options /* [in] */, - struct srvsvc_Statistics **stats /* [out] [ref] */, - WERROR *werror) -{ - struct srvsvc_NetServerStatisticsGet r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.service = service; - r.in.level = level; - r.in.options = options; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetServerStatisticsGet, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSERVERSTATISTICSGET, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetServerStatisticsGet, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *stats = *r.out.stats; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetTransportAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, - WERROR *werror) -{ - struct srvsvc_NetTransportAdd r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetTransportAdd, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETTRANSPORTADD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportAdd, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetTransportInfoCtr *transports /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetTransportEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.transports = transports; - r.in.max_buffer = max_buffer; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetTransportEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETTRANSPORTENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *transports = *r.out.transports; - *totalentries = *r.out.totalentries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetTransportDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - struct srvsvc_NetTransportInfo0 *info0 /* [in] [ref] */, - WERROR *werror) -{ - struct srvsvc_NetTransportDel r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.level = level; - r.in.info0 = info0; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetTransportDel, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETTRANSPORTDEL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportDel, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetRemoteTODInfo **info /* [out] [ref] */, - WERROR *werror) -{ - struct srvsvc_NetRemoteTOD r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetRemoteTOD, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETREMOTETOD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetRemoteTOD, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetSetServiceBits(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *transport /* [in] [unique,charset(UTF16)] */, - uint32_t servicebits /* [in] */, - uint32_t updateimmediately /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetSetServiceBits r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.transport = transport; - r.in.servicebits = servicebits; - r.in.updateimmediately = updateimmediately; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSetServiceBits, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSETSERVICEBITS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSetServiceBits, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path /* [in] [charset(UTF16)] */, - uint32_t pathflags /* [in] */, - uint32_t *pathtype /* [out] [ref] */, - WERROR *werror) -{ - struct srvsvc_NetPathType r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.path = path; - r.in.pathflags = pathflags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetPathType, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETPATHTYPE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetPathType, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *pathtype = *r.out.pathtype; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path /* [in] [charset(UTF16)] */, - uint8_t *can_path /* [out] [size_is(maxbuf)] */, - uint32_t maxbuf /* [in] */, - const char *prefix /* [in] [charset(UTF16)] */, - uint32_t *pathtype /* [in,out] [ref] */, - uint32_t pathflags /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetPathCanonicalize r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.path = path; - r.in.maxbuf = maxbuf; - r.in.prefix = prefix; - r.in.pathtype = pathtype; - r.in.pathflags = pathflags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetPathCanonicalize, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETPATHCANONICALIZE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCanonicalize, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(can_path, r.out.can_path, r.in.maxbuf * sizeof(*can_path)); - *pathtype = *r.out.pathtype; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path1 /* [in] [charset(UTF16)] */, - const char *path2 /* [in] [charset(UTF16)] */, - uint32_t pathtype /* [in] */, - uint32_t pathflags /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetPathCompare r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.path1 = path1; - r.in.path2 = path2; - r.in.pathtype = pathtype; - r.in.pathflags = pathflags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetPathCompare, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETPATHCOMPARE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCompare, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetNameValidate(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *name /* [in] [charset(UTF16)] */, - uint32_t name_type /* [in] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetNameValidate r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.name = name; - r.in.name_type = name_type; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetNameValidate, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETNAMEVALIDATE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetNameValidate, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRPRNAMECANONICALIZE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRPRNAMECANONICALIZE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetPRNameCompare(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *name1 /* [in] [charset(UTF16)] */, - const char *name2 /* [in] [charset(UTF16)] */, - uint32_t name_type /* [in] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetPRNameCompare r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.name1 = name1; - r.in.name2 = name2; - r.in.name_type = name_type; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetPRNameCompare, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETPRNAMECOMPARE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetPRNameCompare, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetShareEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.info_ctr = info_ctr; - r.in.max_buffer = max_buffer; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHAREENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info_ctr = *r.out.info_ctr; - *totalentries = *r.out.totalentries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share /* [in] [charset(UTF16)] */, - uint32_t reserved /* [in] */, - struct policy_handle *hnd /* [out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetShareDelStart r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.share = share; - r.in.reserved = reserved; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelStart, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHAREDELSTART, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelStart, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (hnd && r.out.hnd) { - *hnd = *r.out.hnd; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *hnd /* [in,out] [unique] */, - WERROR *werror) -{ - struct srvsvc_NetShareDelCommit r; - NTSTATUS status; - - /* In parameters */ - r.in.hnd = hnd; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelCommit, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSHAREDELCOMMIT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelCommit, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (hnd && r.out.hnd) { - *hnd = *r.out.hnd; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share /* [in] [unique,charset(UTF16)] */, - const char *file /* [in] [charset(UTF16)] */, - uint32_t securityinformation /* [in] */, - struct sec_desc_buf **sd_buf /* [out] [ref] */, - WERROR *werror) -{ - struct srvsvc_NetGetFileSecurity r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.share = share; - r.in.file = file; - r.in.securityinformation = securityinformation; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetGetFileSecurity, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETGETFILESECURITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetGetFileSecurity, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sd_buf = *r.out.sd_buf; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share /* [in] [unique,charset(UTF16)] */, - const char *file /* [in] [charset(UTF16)] */, - uint32_t securityinformation /* [in] */, - struct sec_desc_buf *sd_buf /* [in] [ref] */, - WERROR *werror) -{ - struct srvsvc_NetSetFileSecurity r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.share = share; - r.in.file = file; - r.in.securityinformation = securityinformation; - r.in.sd_buf = sd_buf; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSetFileSecurity, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSETFILESECURITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSetFileSecurity, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetServerTransportAddEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, - WERROR *werror) -{ - struct srvsvc_NetServerTransportAddEx r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.level = level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetServerTransportAddEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSERVERTRANSPORTADDEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetServerTransportAddEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *emulated_server_unc /* [in] [unique,charset(UTF16)] */, - const char *transport /* [in] [unique,charset(UTF16)] */, - uint32_t servicebitsofinterest /* [in] */, - uint32_t servicebits /* [in] */, - uint32_t updateimmediately /* [in] */, - WERROR *werror) -{ - struct srvsvc_NetServerSetServiceBitsEx r; - NTSTATUS status; - - /* In parameters */ - r.in.server_unc = server_unc; - r.in.emulated_server_unc = emulated_server_unc; - r.in.transport = transport; - r.in.servicebitsofinterest = servicebitsofinterest; - r.in.servicebits = servicebits; - r.in.updateimmediately = updateimmediately; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetServerSetServiceBitsEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETSERVERSETSERVICEBITSEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetServerSetServiceBitsEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSGETVERSION r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSGETVERSION, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSGETVERSION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSGETVERSION, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSCREATELOCALPARTITION r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSCREATELOCALPARTITION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSDELETELOCALPARTITION r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSDELETELOCALPARTITION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSSETLOCALVOLUMESTATE r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSSETSERVERINFO r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSSETSERVERINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETSERVERINFO, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSCREATEEXITPOINT r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSCREATEEXITPOINT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSDELETEEXITPOINT r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSDELETEEXITPOINT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSMODIFYPREFIX r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSMODIFYPREFIX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSFIXLOCALVOLUME r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSFIXLOCALVOLUME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRDFSMANAGERREPORTSITEINFO r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_srvsvc_NETRSERVERTRANSPORTDELEX(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct srvsvc_NETRSERVERTRANSPORTDELEX r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_srvsvc, - NDR_SRVSVC_NETRSERVERTRANSPORTDELEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - diff --git a/source3/librpc/gen_ndr/cli_srvsvc.h b/source3/librpc/gen_ndr/cli_srvsvc.h deleted file mode 100644 index 44b50e7d19..0000000000 --- a/source3/librpc/gen_ndr/cli_srvsvc.h +++ /dev/null @@ -1,344 +0,0 @@ -#include "librpc/gen_ndr/ndr_srvsvc.h" -#ifndef __CLI_SRVSVC__ -#define __CLI_SRVSVC__ -NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetCharDevInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetCharDevGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *device_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetCharDevInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetCharDevControl(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *device_name /* [in] [charset(UTF16)] */, - uint32_t opcode /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *user /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetCharDevQInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *queue_name /* [in] [charset(UTF16)] */, - const char *user /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetCharDevQInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *queue_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetCharDevQInfo info /* [in] [switch_is(level)] */, - uint32_t *parm_error /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetCharDevQPurge(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *queue_name /* [in] [charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *queue_name /* [in] [charset(UTF16)] */, - const char *computer_name /* [in] [charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetConnInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path /* [in] [unique,charset(UTF16)] */, - const char *user /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetFileInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetFileGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t fid /* [in] */, - uint32_t level /* [in] */, - union srvsvc_NetFileInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t fid /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *client /* [in] [unique,charset(UTF16)] */, - const char *user /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetSessInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *client /* [in] [unique,charset(UTF16)] */, - const char *user /* [in] [unique,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_error /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetShareInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share_name /* [in] [charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_error /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share_name /* [in] [charset(UTF16)] */, - uint32_t reserved /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share_name /* [in] [charset(UTF16)] */, - uint32_t reserved /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareCheck(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *device_name /* [in] [charset(UTF16)] */, - enum srvsvc_ShareType *type /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetSrvInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetSrvInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_error /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - struct srvsvc_NetDiskInfo *info /* [in,out] [ref] */, - uint32_t maxlen /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *service /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - uint32_t options /* [in] */, - struct srvsvc_Statistics **stats /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetTransportAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetTransportInfoCtr *transports /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetTransportDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - struct srvsvc_NetTransportInfo0 *info0 /* [in] [ref] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetRemoteTODInfo **info /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetSetServiceBits(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *transport /* [in] [unique,charset(UTF16)] */, - uint32_t servicebits /* [in] */, - uint32_t updateimmediately /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path /* [in] [charset(UTF16)] */, - uint32_t pathflags /* [in] */, - uint32_t *pathtype /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path /* [in] [charset(UTF16)] */, - uint8_t *can_path /* [out] [size_is(maxbuf)] */, - uint32_t maxbuf /* [in] */, - const char *prefix /* [in] [charset(UTF16)] */, - uint32_t *pathtype /* [in,out] [ref] */, - uint32_t pathflags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *path1 /* [in] [charset(UTF16)] */, - const char *path2 /* [in] [charset(UTF16)] */, - uint32_t pathtype /* [in] */, - uint32_t pathflags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetNameValidate(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *name /* [in] [charset(UTF16)] */, - uint32_t name_type /* [in] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetPRNameCompare(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *name1 /* [in] [charset(UTF16)] */, - const char *name2 /* [in] [charset(UTF16)] */, - uint32_t name_type /* [in] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *totalentries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share /* [in] [charset(UTF16)] */, - uint32_t reserved /* [in] */, - struct policy_handle *hnd /* [out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *hnd /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share /* [in] [unique,charset(UTF16)] */, - const char *file /* [in] [charset(UTF16)] */, - uint32_t securityinformation /* [in] */, - struct sec_desc_buf **sd_buf /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *share /* [in] [unique,charset(UTF16)] */, - const char *file /* [in] [charset(UTF16)] */, - uint32_t securityinformation /* [in] */, - struct sec_desc_buf *sd_buf /* [in] [ref] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetServerTransportAddEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_unc /* [in] [unique,charset(UTF16)] */, - const char *emulated_server_unc /* [in] [unique,charset(UTF16)] */, - const char *transport /* [in] [unique,charset(UTF16)] */, - uint32_t servicebitsofinterest /* [in] */, - uint32_t servicebits /* [in] */, - uint32_t updateimmediately /* [in] */, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_srvsvc_NETRSERVERTRANSPORTDELEX(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -#endif /* __CLI_SRVSVC__ */ diff --git a/source3/librpc/gen_ndr/cli_svcctl.c b/source3/librpc/gen_ndr/cli_svcctl.c deleted file mode 100644 index 9f11a40d7e..0000000000 --- a/source3/librpc/gen_ndr/cli_svcctl.c +++ /dev/null @@ -1,2245 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_svcctl.h" - -NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */, - WERROR *werror) -{ - struct svcctl_CloseServiceHandle r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_CLOSESERVICEHANDLE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum SERVICE_CONTROL control /* [in] */, - struct SERVICE_STATUS *service_status /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_ControlService r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.control = control; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ControlService, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_CONTROLSERVICE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ControlService, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *service_status = *r.out.service_status; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - WERROR *werror) -{ - struct svcctl_DeleteService r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_DeleteService, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_DELETESERVICE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct policy_handle *lock /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_LockServiceDatabase r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_LOCKSERVICEDATABASE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *lock = *r.out.lock; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t security_flags /* [in] */, - uint8_t *buffer /* [out] [ref,size_is(buffer_size)] */, - uint32_t buffer_size /* [in] [range(0,0x40000)] */, - uint32_t *needed /* [out] [ref,range(0,0x40000)] */, - WERROR *werror) -{ - struct svcctl_QueryServiceObjectSecurity r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.security_flags = security_flags; - r.in.buffer_size = buffer_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(buffer, r.out.buffer, r.in.buffer_size * sizeof(*buffer)); - *needed = *r.out.needed; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t security_flags /* [in] */, - uint8_t *buffer /* [in] [ref,size_is(buffer_size)] */, - uint32_t buffer_size /* [in] */, - WERROR *werror) -{ - struct svcctl_SetServiceObjectSecurity r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.security_flags = security_flags; - r.in.buffer = buffer; - r.in.buffer_size = buffer_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_SETSERVICEOBJECTSECURITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct SERVICE_STATUS *service_status /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_QueryServiceStatus r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_QUERYSERVICESTATUS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *service_status = *r.out.service_status; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct svcctl_SetServiceStatus r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_SETSERVICESTATUS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *lock /* [in,out] [ref] */, - WERROR *werror) -{ - struct svcctl_UnlockServiceDatabase r; - NTSTATUS status; - - /* In parameters */ - r.in.lock = lock; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_UNLOCKSERVICEDATABASE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *lock = *r.out.lock; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct svcctl_NotifyBootConfigStatus r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t bits /* [in] */, - uint32_t bitson /* [in] */, - uint32_t immediate /* [in] */, - WERROR *werror) -{ - struct svcctl_SCSetServiceBitsW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.bits = bits; - r.in.bitson = bitson; - r.in.immediate = immediate; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_SCSETSERVICEBITSW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t type /* [in] */, - uint32_t start /* [in] */, - uint32_t error /* [in] */, - const char *binary_path /* [in] [unique,charset(UTF16)] */, - const char *load_order_group /* [in] [unique,charset(UTF16)] */, - uint32_t *tag_id /* [out] [ref] */, - const char *dependencies /* [in] [unique,charset(UTF16)] */, - const char *service_start_name /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - const char *display_name /* [in] [unique,charset(UTF16)] */, - WERROR *werror) -{ - struct svcctl_ChangeServiceConfigW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.type = type; - r.in.start = start; - r.in.error = error; - r.in.binary_path = binary_path; - r.in.load_order_group = load_order_group; - r.in.dependencies = dependencies; - r.in.service_start_name = service_start_name; - r.in.password = password; - r.in.display_name = display_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_CHANGESERVICECONFIGW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *tag_id = *r.out.tag_id; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager_handle /* [in] [ref] */, - const char *ServiceName /* [in] [charset(UTF16)] */, - const char *DisplayName /* [in] [unique,charset(UTF16)] */, - uint32_t desired_access /* [in] */, - uint32_t type /* [in] */, - uint32_t start_type /* [in] */, - uint32_t error_control /* [in] */, - const char *binary_path /* [in] [charset(UTF16)] */, - const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */, - uint32_t *TagId /* [in,out] [unique] */, - uint8_t *dependencies /* [in] [unique,size_is(dependencies_size)] */, - uint32_t dependencies_size /* [in] */, - const char *service_start_name /* [in] [unique,charset(UTF16)] */, - uint8_t *password /* [in] [unique,size_is(password_size)] */, - uint32_t password_size /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_CreateServiceW r; - NTSTATUS status; - - /* In parameters */ - r.in.scmanager_handle = scmanager_handle; - r.in.ServiceName = ServiceName; - r.in.DisplayName = DisplayName; - r.in.desired_access = desired_access; - r.in.type = type; - r.in.start_type = start_type; - r.in.error_control = error_control; - r.in.binary_path = binary_path; - r.in.LoadOrderGroupKey = LoadOrderGroupKey; - r.in.TagId = TagId; - r.in.dependencies = dependencies; - r.in.dependencies_size = dependencies_size; - r.in.service_start_name = service_start_name; - r.in.password = password; - r.in.password_size = password_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_CREATESERVICEW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (TagId && r.out.TagId) { - *TagId = *r.out.TagId; - } - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *service /* [in] [ref] */, - uint32_t state /* [in] */, - uint8_t *service_status /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,0x40000)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,0x40000)] */, - uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */, - WERROR *werror) -{ - struct svcctl_EnumDependentServicesW r; - NTSTATUS status; - - /* In parameters */ - r.in.service = service; - r.in.state = state; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_ENUMDEPENDENTSERVICESW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(service_status, r.out.service_status, r.in.buf_size * sizeof(*service_status)); - *bytes_needed = *r.out.bytes_needed; - *services_returned = *r.out.services_returned; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t type /* [in] */, - uint32_t state /* [in] */, - uint8_t *service /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,262144)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,262144)] */, - uint32_t *services_returned /* [out] [ref,range(0,262144)] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct svcctl_EnumServicesStatusW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.type = type; - r.in.state = state; - r.in.buf_size = buf_size; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_ENUMSERVICESSTATUSW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(service, r.out.service, r.in.buf_size * sizeof(*service)); - *bytes_needed = *r.out.bytes_needed; - *services_returned = *r.out.services_returned; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *MachineName /* [in] [unique,charset(UTF16)] */, - const char *DatabaseName /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_OpenSCManagerW r; - NTSTATUS status; - - /* In parameters */ - r.in.MachineName = MachineName; - r.in.DatabaseName = DatabaseName; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_OPENSCMANAGERW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager_handle /* [in] [ref] */, - const char *ServiceName /* [in] [charset(UTF16)] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_OpenServiceW r; - NTSTATUS status; - - /* In parameters */ - r.in.scmanager_handle = scmanager_handle; - r.in.ServiceName = ServiceName; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_OPENSERVICEW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct QUERY_SERVICE_CONFIG *query /* [out] [ref] */, - uint32_t buf_size /* [in] [range(0,8192)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, - WERROR *werror) -{ - struct svcctl_QueryServiceConfigW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_QUERYSERVICECONFIGW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *query = *r.out.query; - *bytes_needed = *r.out.bytes_needed; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t buf_size /* [in] */, - struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */, - uint32_t *required_buf_size /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_QueryServiceLockStatusW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_QUERYSERVICELOCKSTATUSW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *lock_status = *r.out.lock_status; - *required_buf_size = *r.out.required_buf_size; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_StartServiceW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t NumArgs /* [in] */, - const char *Arguments /* [in] [unique,charset(UTF16)] */, - WERROR *werror) -{ - struct svcctl_StartServiceW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.NumArgs = NumArgs; - r.in.Arguments = Arguments; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_STARTSERVICEW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *service_name /* [in] [unique,charset(UTF16)] */, - const char **display_name /* [out] [ref,charset(UTF16)] */, - uint32_t *display_name_length /* [in,out] [unique] */, - WERROR *werror) -{ - struct svcctl_GetServiceDisplayNameW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.service_name = service_name; - r.in.display_name_length = display_name_length; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_GETSERVICEDISPLAYNAMEW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *display_name = *r.out.display_name; - if (display_name_length && r.out.display_name_length) { - *display_name_length = *r.out.display_name_length; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *service_name /* [in] [unique,charset(UTF16)] */, - const char **key_name /* [out] [ref,charset(UTF16)] */, - uint32_t *display_name_length /* [in,out] [unique] */, - WERROR *werror) -{ - struct svcctl_GetServiceKeyNameW r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.service_name = service_name; - r.in.display_name_length = display_name_length; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_GETSERVICEKEYNAMEW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *key_name = *r.out.key_name; - if (display_name_length && r.out.display_name_length) { - *display_name_length = *r.out.display_name_length; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t bits /* [in] */, - uint32_t bitson /* [in] */, - uint32_t immediate /* [in] */, - WERROR *werror) -{ - struct svcctl_SCSetServiceBitsA r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.bits = bits; - r.in.bitson = bitson; - r.in.immediate = immediate; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_SCSETSERVICEBITSA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t type /* [in] */, - uint32_t start /* [in] */, - uint32_t error /* [in] */, - const char *binary_path /* [in] [unique,charset(UTF16)] */, - const char *load_order_group /* [in] [unique,charset(UTF16)] */, - uint32_t *tag_id /* [out] [ref] */, - const char *dependencies /* [in] [unique,charset(UTF16)] */, - const char *service_start_name /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - const char *display_name /* [in] [unique,charset(UTF16)] */, - WERROR *werror) -{ - struct svcctl_ChangeServiceConfigA r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.type = type; - r.in.start = start; - r.in.error = error; - r.in.binary_path = binary_path; - r.in.load_order_group = load_order_group; - r.in.dependencies = dependencies; - r.in.service_start_name = service_start_name; - r.in.password = password; - r.in.display_name = display_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_CHANGESERVICECONFIGA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *tag_id = *r.out.tag_id; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *ServiceName /* [in] [unique,charset(UTF16)] */, - const char *DisplayName /* [in] [unique,charset(UTF16)] */, - uint32_t desired_access /* [in] */, - uint32_t type /* [in] */, - uint32_t start_type /* [in] */, - uint32_t error_control /* [in] */, - const char *binary_path /* [in] [unique,charset(UTF16)] */, - const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */, - uint32_t *TagId /* [out] [unique] */, - const char *dependencies /* [in] [unique,charset(UTF16)] */, - const char *service_start_name /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - WERROR *werror) -{ - struct svcctl_CreateServiceA r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.ServiceName = ServiceName; - r.in.DisplayName = DisplayName; - r.in.desired_access = desired_access; - r.in.type = type; - r.in.start_type = start_type; - r.in.error_control = error_control; - r.in.binary_path = binary_path; - r.in.LoadOrderGroupKey = LoadOrderGroupKey; - r.in.dependencies = dependencies; - r.in.service_start_name = service_start_name; - r.in.password = password; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_CREATESERVICEA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (TagId && r.out.TagId) { - *TagId = *r.out.TagId; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *service /* [in] [ref] */, - uint32_t state /* [in] */, - struct ENUM_SERVICE_STATUS *service_status /* [out] [unique] */, - uint32_t buf_size /* [in] */, - uint32_t *bytes_needed /* [out] [ref] */, - uint32_t *services_returned /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_EnumDependentServicesA r; - NTSTATUS status; - - /* In parameters */ - r.in.service = service; - r.in.state = state; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_ENUMDEPENDENTSERVICESA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (service_status && r.out.service_status) { - *service_status = *r.out.service_status; - } - *bytes_needed = *r.out.bytes_needed; - *services_returned = *r.out.services_returned; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t type /* [in] */, - uint32_t state /* [in] */, - uint32_t buf_size /* [in] */, - uint8_t *service /* [out] [size_is(buf_size)] */, - uint32_t *bytes_needed /* [out] [ref] */, - uint32_t *services_returned /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct svcctl_EnumServicesStatusA r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.type = type; - r.in.state = state; - r.in.buf_size = buf_size; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_ENUMSERVICESSTATUSA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(service, r.out.service, r.in.buf_size * sizeof(*service)); - *bytes_needed = *r.out.bytes_needed; - *services_returned = *r.out.services_returned; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *MachineName /* [in] [unique,charset(UTF16)] */, - const char *DatabaseName /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_OpenSCManagerA r; - NTSTATUS status; - - /* In parameters */ - r.in.MachineName = MachineName; - r.in.DatabaseName = DatabaseName; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_OPENSCMANAGERA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_OpenServiceA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager_handle /* [in] [ref] */, - const char *ServiceName /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - WERROR *werror) -{ - struct svcctl_OpenServiceA r; - NTSTATUS status; - - /* In parameters */ - r.in.scmanager_handle = scmanager_handle; - r.in.ServiceName = ServiceName; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_OPENSERVICEA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint8_t *query /* [out] */, - uint32_t buf_size /* [in] */, - uint32_t *bytes_needed /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_QueryServiceConfigA r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_QUERYSERVICECONFIGA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(query, r.out.query, r.in.buf_size * sizeof(*query)); - *bytes_needed = *r.out.bytes_needed; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t buf_size /* [in] */, - struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */, - uint32_t *required_buf_size /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_QueryServiceLockStatusA r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_QUERYSERVICELOCKSTATUSA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *lock_status = *r.out.lock_status; - *required_buf_size = *r.out.required_buf_size; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_StartServiceA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t NumArgs /* [in] */, - const char *Arguments /* [in] [unique,charset(UTF16)] */, - WERROR *werror) -{ - struct svcctl_StartServiceA r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.NumArgs = NumArgs; - r.in.Arguments = Arguments; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_STARTSERVICEA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *service_name /* [in] [unique,charset(UTF16)] */, - const char **display_name /* [out] [ref,charset(UTF16)] */, - uint32_t *display_name_length /* [in,out] [unique] */, - WERROR *werror) -{ - struct svcctl_GetServiceDisplayNameA r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.service_name = service_name; - r.in.display_name_length = display_name_length; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_GETSERVICEDISPLAYNAMEA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *display_name = *r.out.display_name; - if (display_name_length && r.out.display_name_length) { - *display_name_length = *r.out.display_name_length; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *service_name /* [in] [unique,charset(UTF16)] */, - const char **key_name /* [out] [ref,charset(UTF16)] */, - uint32_t *display_name_length /* [in,out] [unique] */, - WERROR *werror) -{ - struct svcctl_GetServiceKeyNameA r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.service_name = service_name; - r.in.display_name_length = display_name_length; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_GETSERVICEKEYNAMEA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *key_name = *r.out.key_name; - if (display_name_length && r.out.display_name_length) { - *display_name_length = *r.out.display_name_length; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct svcctl_GetCurrentGroupeStateW r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_GETCURRENTGROUPESTATEW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct svcctl_EnumServiceGroupW r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_ENUMSERVICEGROUPW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *info /* [in] [unique] */, - WERROR *werror) -{ - struct svcctl_ChangeServiceConfig2A r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.info_level = info_level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_CHANGESERVICECONFIG2A, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *info /* [in] [unique] */, - WERROR *werror) -{ - struct svcctl_ChangeServiceConfig2W r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.info_level = info_level; - r.in.info = info; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_CHANGESERVICECONFIG2W, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *buffer /* [out] */, - uint32_t buf_size /* [in] */, - uint32_t *bytes_needed /* [out] [ref] */, - WERROR *werror) -{ - struct svcctl_QueryServiceConfig2A r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.info_level = info_level; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_QUERYSERVICECONFIG2A, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(buffer, r.out.buffer, r.in.buf_size * sizeof(*buffer)); - *bytes_needed = *r.out.bytes_needed; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,8192)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, - WERROR *werror) -{ - struct svcctl_QueryServiceConfig2W r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.info_level = info_level; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_QUERYSERVICECONFIG2W, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(buffer, r.out.buffer, r.in.buf_size * sizeof(*buffer)); - *bytes_needed = *r.out.bytes_needed; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,8192)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, - WERROR *werror) -{ - struct svcctl_QueryServiceStatusEx r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.info_level = info_level; - r.in.buf_size = buf_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_QUERYSERVICESTATUSEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(buffer, r.out.buffer, r.in.buf_size * sizeof(*buffer)); - *bytes_needed = *r.out.bytes_needed; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint32_t type /* [in] */, - uint32_t state /* [in] */, - uint8_t *services /* [out] */, - uint32_t buf_size /* [in] */, - uint32_t *bytes_needed /* [out] [ref] */, - uint32_t *service_returned /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - const char **group_name /* [out] [ref,charset(UTF16)] */, - WERROR *werror) -{ - struct EnumServicesStatusExA r; - NTSTATUS status; - - /* In parameters */ - r.in.scmanager = scmanager; - r.in.info_level = info_level; - r.in.type = type; - r.in.state = state; - r.in.buf_size = buf_size; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_ENUMSERVICESSTATUSEXA, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(services, r.out.services, r.in.buf_size * sizeof(*services)); - *bytes_needed = *r.out.bytes_needed; - *service_returned = *r.out.service_returned; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - *group_name = *r.out.group_name; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint32_t type /* [in] */, - uint32_t state /* [in] */, - uint8_t *services /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,262144)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,262144)] */, - uint32_t *service_returned /* [out] [ref,range(0,262144)] */, - uint32_t *resume_handle /* [in,out] [unique,range(0,262144)] */, - const char *group_name /* [in] [unique,charset(UTF16)] */, - WERROR *werror) -{ - struct EnumServicesStatusExW r; - NTSTATUS status; - - /* In parameters */ - r.in.scmanager = scmanager; - r.in.info_level = info_level; - r.in.type = type; - r.in.state = state; - r.in.buf_size = buf_size; - r.in.resume_handle = resume_handle; - r.in.group_name = group_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_ENUMSERVICESSTATUSEXW, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(services, r.out.services, r.in.buf_size * sizeof(*services)); - *bytes_needed = *r.out.bytes_needed; - *service_returned = *r.out.service_returned; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_svcctl_SCSendTSMessage(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct svcctl_SCSendTSMessage r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_svcctl, - NDR_SVCCTL_SCSENDTSMESSAGE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - diff --git a/source3/librpc/gen_ndr/cli_svcctl.h b/source3/librpc/gen_ndr/cli_svcctl.h deleted file mode 100644 index 78c9bf40d8..0000000000 --- a/source3/librpc/gen_ndr/cli_svcctl.h +++ /dev/null @@ -1,336 +0,0 @@ -#include "librpc/gen_ndr/ndr_svcctl.h" -#ifndef __CLI_SVCCTL__ -#define __CLI_SVCCTL__ -NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - enum SERVICE_CONTROL control /* [in] */, - struct SERVICE_STATUS *service_status /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct policy_handle *lock /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t security_flags /* [in] */, - uint8_t *buffer /* [out] [ref,size_is(buffer_size)] */, - uint32_t buffer_size /* [in] [range(0,0x40000)] */, - uint32_t *needed /* [out] [ref,range(0,0x40000)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t security_flags /* [in] */, - uint8_t *buffer /* [in] [ref,size_is(buffer_size)] */, - uint32_t buffer_size /* [in] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct SERVICE_STATUS *service_status /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *lock /* [in,out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t bits /* [in] */, - uint32_t bitson /* [in] */, - uint32_t immediate /* [in] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t type /* [in] */, - uint32_t start /* [in] */, - uint32_t error /* [in] */, - const char *binary_path /* [in] [unique,charset(UTF16)] */, - const char *load_order_group /* [in] [unique,charset(UTF16)] */, - uint32_t *tag_id /* [out] [ref] */, - const char *dependencies /* [in] [unique,charset(UTF16)] */, - const char *service_start_name /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - const char *display_name /* [in] [unique,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager_handle /* [in] [ref] */, - const char *ServiceName /* [in] [charset(UTF16)] */, - const char *DisplayName /* [in] [unique,charset(UTF16)] */, - uint32_t desired_access /* [in] */, - uint32_t type /* [in] */, - uint32_t start_type /* [in] */, - uint32_t error_control /* [in] */, - const char *binary_path /* [in] [charset(UTF16)] */, - const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */, - uint32_t *TagId /* [in,out] [unique] */, - uint8_t *dependencies /* [in] [unique,size_is(dependencies_size)] */, - uint32_t dependencies_size /* [in] */, - const char *service_start_name /* [in] [unique,charset(UTF16)] */, - uint8_t *password /* [in] [unique,size_is(password_size)] */, - uint32_t password_size /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *service /* [in] [ref] */, - uint32_t state /* [in] */, - uint8_t *service_status /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,0x40000)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,0x40000)] */, - uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t type /* [in] */, - uint32_t state /* [in] */, - uint8_t *service /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,262144)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,262144)] */, - uint32_t *services_returned /* [out] [ref,range(0,262144)] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *MachineName /* [in] [unique,charset(UTF16)] */, - const char *DatabaseName /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager_handle /* [in] [ref] */, - const char *ServiceName /* [in] [charset(UTF16)] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct QUERY_SERVICE_CONFIG *query /* [out] [ref] */, - uint32_t buf_size /* [in] [range(0,8192)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t buf_size /* [in] */, - struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */, - uint32_t *required_buf_size /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_StartServiceW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t NumArgs /* [in] */, - const char *Arguments /* [in] [unique,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *service_name /* [in] [unique,charset(UTF16)] */, - const char **display_name /* [out] [ref,charset(UTF16)] */, - uint32_t *display_name_length /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *service_name /* [in] [unique,charset(UTF16)] */, - const char **key_name /* [out] [ref,charset(UTF16)] */, - uint32_t *display_name_length /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t bits /* [in] */, - uint32_t bitson /* [in] */, - uint32_t immediate /* [in] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t type /* [in] */, - uint32_t start /* [in] */, - uint32_t error /* [in] */, - const char *binary_path /* [in] [unique,charset(UTF16)] */, - const char *load_order_group /* [in] [unique,charset(UTF16)] */, - uint32_t *tag_id /* [out] [ref] */, - const char *dependencies /* [in] [unique,charset(UTF16)] */, - const char *service_start_name /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - const char *display_name /* [in] [unique,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *ServiceName /* [in] [unique,charset(UTF16)] */, - const char *DisplayName /* [in] [unique,charset(UTF16)] */, - uint32_t desired_access /* [in] */, - uint32_t type /* [in] */, - uint32_t start_type /* [in] */, - uint32_t error_control /* [in] */, - const char *binary_path /* [in] [unique,charset(UTF16)] */, - const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */, - uint32_t *TagId /* [out] [unique] */, - const char *dependencies /* [in] [unique,charset(UTF16)] */, - const char *service_start_name /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *service /* [in] [ref] */, - uint32_t state /* [in] */, - struct ENUM_SERVICE_STATUS *service_status /* [out] [unique] */, - uint32_t buf_size /* [in] */, - uint32_t *bytes_needed /* [out] [ref] */, - uint32_t *services_returned /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t type /* [in] */, - uint32_t state /* [in] */, - uint32_t buf_size /* [in] */, - uint8_t *service /* [out] [size_is(buf_size)] */, - uint32_t *bytes_needed /* [out] [ref] */, - uint32_t *services_returned /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *MachineName /* [in] [unique,charset(UTF16)] */, - const char *DatabaseName /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_OpenServiceA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager_handle /* [in] [ref] */, - const char *ServiceName /* [in] [unique,charset(UTF16)] */, - uint32_t access_mask /* [in] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint8_t *query /* [out] */, - uint32_t buf_size /* [in] */, - uint32_t *bytes_needed /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t buf_size /* [in] */, - struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */, - uint32_t *required_buf_size /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_StartServiceA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t NumArgs /* [in] */, - const char *Arguments /* [in] [unique,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *service_name /* [in] [unique,charset(UTF16)] */, - const char **display_name /* [out] [ref,charset(UTF16)] */, - uint32_t *display_name_length /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - const char *service_name /* [in] [unique,charset(UTF16)] */, - const char **key_name /* [out] [ref,charset(UTF16)] */, - uint32_t *display_name_length /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *info /* [in] [unique] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *info /* [in] [unique] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *buffer /* [out] */, - uint32_t buf_size /* [in] */, - uint32_t *bytes_needed /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,8192)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint8_t *buffer /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,8192)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */, - WERROR *werror); -NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint32_t type /* [in] */, - uint32_t state /* [in] */, - uint8_t *services /* [out] */, - uint32_t buf_size /* [in] */, - uint32_t *bytes_needed /* [out] [ref] */, - uint32_t *service_returned /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - const char **group_name /* [out] [ref,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *scmanager /* [in] [ref] */, - uint32_t info_level /* [in] */, - uint32_t type /* [in] */, - uint32_t state /* [in] */, - uint8_t *services /* [out] [ref,size_is(buf_size)] */, - uint32_t buf_size /* [in] [range(0,262144)] */, - uint32_t *bytes_needed /* [out] [ref,range(0,262144)] */, - uint32_t *service_returned /* [out] [ref,range(0,262144)] */, - uint32_t *resume_handle /* [in,out] [unique,range(0,262144)] */, - const char *group_name /* [in] [unique,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_svcctl_SCSendTSMessage(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -#endif /* __CLI_SVCCTL__ */ diff --git a/source3/librpc/gen_ndr/cli_winreg.c b/source3/librpc/gen_ndr/cli_winreg.c deleted file mode 100644 index 17b7281c72..0000000000 --- a/source3/librpc/gen_ndr/cli_winreg.c +++ /dev/null @@ -1,1726 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_winreg.h" - -NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenHKCR r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENHKCR, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenHKCU r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENHKCU, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenHKLM r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENHKLM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenHKPD r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENHKPD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenHKU r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKU, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENHKU, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */, - WERROR *werror) -{ - struct winreg_CloseKey r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_CloseKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_CLOSEKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String name /* [in] */, - struct winreg_String keyclass /* [in] */, - uint32_t options /* [in] */, - uint32_t access_mask /* [in] */, - struct winreg_SecBuf *secdesc /* [in] [unique] */, - struct policy_handle *new_handle /* [out] [ref] */, - enum winreg_CreateAction *action_taken /* [in,out] [unique] */, - WERROR *werror) -{ - struct winreg_CreateKey r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.name = name; - r.in.keyclass = keyclass; - r.in.options = options; - r.in.access_mask = access_mask; - r.in.secdesc = secdesc; - r.in.action_taken = action_taken; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_CreateKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_CREATEKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_CreateKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *new_handle = *r.out.new_handle; - if (action_taken && r.out.action_taken) { - *action_taken = *r.out.action_taken; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String key /* [in] */, - WERROR *werror) -{ - struct winreg_DeleteKey r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.key = key; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_DeleteKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_DELETEKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String value /* [in] */, - WERROR *werror) -{ - struct winreg_DeleteValue r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.value = value; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_DeleteValue, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_DELETEVALUE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t enum_index /* [in] */, - struct winreg_StringBuf *name /* [in,out] [ref] */, - struct winreg_StringBuf *keyclass /* [in,out] [unique] */, - NTTIME *last_changed_time /* [in,out] [unique] */, - WERROR *werror) -{ - struct winreg_EnumKey r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.enum_index = enum_index; - r.in.name = name; - r.in.keyclass = keyclass; - r.in.last_changed_time = last_changed_time; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_EnumKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_ENUMKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_EnumKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *name = *r.out.name; - if (keyclass && r.out.keyclass) { - *keyclass = *r.out.keyclass; - } - if (last_changed_time && r.out.last_changed_time) { - *last_changed_time = *r.out.last_changed_time; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t enum_index /* [in] */, - struct winreg_StringBuf *name /* [in,out] [ref] */, - enum winreg_Type *type /* [in,out] [unique] */, - uint8_t *value /* [in,out] [unique,length_is(*length),size_is(*size)] */, - uint32_t *size /* [in,out] [unique] */, - uint32_t *length /* [in,out] [unique] */, - WERROR *werror) -{ - struct winreg_EnumValue r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.enum_index = enum_index; - r.in.name = name; - r.in.type = type; - r.in.value = value; - r.in.size = size; - r.in.length = length; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_EnumValue, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_ENUMVALUE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_EnumValue, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *name = *r.out.name; - if (type && r.out.type) { - *type = *r.out.type; - } - if (value && r.out.value) { - memcpy(value, r.out.value, *r.in.size * sizeof(*value)); - } - if (size && r.out.size) { - *size = *r.out.size; - } - if (length && r.out.length) { - *length = *r.out.length; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - WERROR *werror) -{ - struct winreg_FlushKey r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_FlushKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_FLUSHKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_FlushKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct KeySecurityData *sd /* [in,out] [ref] */, - WERROR *werror) -{ - struct winreg_GetKeySecurity r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sec_info = sec_info; - r.in.sd = sd; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_GETKEYSECURITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sd = *r.out.sd; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *keyname /* [in] [unique] */, - struct winreg_String *filename /* [in] [unique] */, - WERROR *werror) -{ - struct winreg_LoadKey r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.keyname = keyname; - r.in.filename = filename; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_LoadKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_LOADKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_LoadKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint8_t watch_subtree /* [in] */, - uint32_t notify_filter /* [in] */, - uint32_t unknown /* [in] */, - struct winreg_String string1 /* [in] */, - struct winreg_String string2 /* [in] */, - uint32_t unknown2 /* [in] */, - WERROR *werror) -{ - struct winreg_NotifyChangeKeyValue r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.watch_subtree = watch_subtree; - r.in.notify_filter = notify_filter; - r.in.unknown = unknown; - r.in.string1 = string1; - r.in.string2 = string2; - r.in.unknown2 = unknown2; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_NOTIFYCHANGEKEYVALUE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *parent_handle /* [in] [ref] */, - struct winreg_String keyname /* [in] */, - uint32_t unknown /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenKey r; - NTSTATUS status; - - /* In parameters */ - r.in.parent_handle = parent_handle; - r.in.keyname = keyname; - r.in.unknown = unknown; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *classname /* [in,out] [ref] */, - uint32_t *num_subkeys /* [out] [ref] */, - uint32_t *max_subkeylen /* [out] [ref] */, - uint32_t *max_classlen /* [out] [ref] */, - uint32_t *num_values /* [out] [ref] */, - uint32_t *max_valnamelen /* [out] [ref] */, - uint32_t *max_valbufsize /* [out] [ref] */, - uint32_t *secdescsize /* [out] [ref] */, - NTTIME *last_changed_time /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_QueryInfoKey r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.classname = classname; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_QUERYINFOKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *classname = *r.out.classname; - *num_subkeys = *r.out.num_subkeys; - *max_subkeylen = *r.out.max_subkeylen; - *max_classlen = *r.out.max_classlen; - *num_values = *r.out.num_values; - *max_valnamelen = *r.out.max_valnamelen; - *max_valbufsize = *r.out.max_valbufsize; - *secdescsize = *r.out.secdescsize; - *last_changed_time = *r.out.last_changed_time; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *value_name /* [in] [ref] */, - enum winreg_Type *type /* [in,out] [unique] */, - uint8_t *data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */, - uint32_t *data_size /* [in,out] [unique] */, - uint32_t *data_length /* [in,out] [unique] */, - WERROR *werror) -{ - struct winreg_QueryValue r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.value_name = value_name; - r.in.type = type; - r.in.data = data; - r.in.data_size = data_size; - r.in.data_length = data_length; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_QueryValue, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_QUERYVALUE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_QueryValue, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (type && r.out.type) { - *type = *r.out.type; - } - if (data && r.out.data) { - memcpy(data, r.out.data, *r.in.data_size * sizeof(*data)); - } - if (data_size && r.out.data_size) { - *data_size = *r.out.data_size; - } - if (data_length && r.out.data_length) { - *data_length = *r.out.data_length; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct winreg_ReplaceKey r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_REPLACEKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *filename /* [in] [ref] */, - uint32_t flags /* [in] */, - WERROR *werror) -{ - struct winreg_RestoreKey r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.filename = filename; - r.in.flags = flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_RestoreKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_RESTOREKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *filename /* [in] [ref] */, - struct KeySecurityAttribute *sec_attrib /* [in] [unique] */, - WERROR *werror) -{ - struct winreg_SaveKey r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.filename = filename; - r.in.sec_attrib = sec_attrib; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_SaveKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_SAVEKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct KeySecurityData *sd /* [in] [ref] */, - WERROR *werror) -{ - struct winreg_SetKeySecurity r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.sec_info = sec_info; - r.in.sd = sd; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_SETKEYSECURITY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String name /* [in] */, - enum winreg_Type type /* [in] */, - uint8_t *data /* [in] [ref,size_is(size)] */, - uint32_t size /* [in] */, - WERROR *werror) -{ - struct winreg_SetValue r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - r.in.name = name; - r.in.type = type; - r.in.data = data; - r.in.size = size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_SetValue, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_SETVALUE, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_SetValue, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct winreg_UnLoadKey r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_UNLOADKEY, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *hostname /* [in] [unique] */, - struct lsa_StringLarge *message /* [in] [unique] */, - uint32_t timeout /* [in] */, - uint8_t force_apps /* [in] */, - uint8_t do_reboot /* [in] */, - WERROR *werror) -{ - struct winreg_InitiateSystemShutdown r; - NTSTATUS status; - - /* In parameters */ - r.in.hostname = hostname; - r.in.message = message; - r.in.timeout = timeout; - r.in.force_apps = force_apps; - r.in.do_reboot = do_reboot; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_INITIATESYSTEMSHUTDOWN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *server /* [in] [unique] */, - WERROR *werror) -{ - struct winreg_AbortSystemShutdown r; - NTSTATUS status; - - /* In parameters */ - r.in.server = server; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_ABORTSYSTEMSHUTDOWN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *version /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_GetVersion r; - NTSTATUS status; - - /* In parameters */ - r.in.handle = handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_GetVersion, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_GETVERSION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *version = *r.out.version; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenHKCC r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENHKCC, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenHKDD r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENHKDD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *key_handle /* [in] [ref] */, - struct QueryMultipleValue *values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */, - uint32_t num_values /* [in] */, - uint8_t *buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */, - uint32_t *buffer_size /* [in,out] [ref] */, - WERROR *werror) -{ - struct winreg_QueryMultipleValues r; - NTSTATUS status; - - /* In parameters */ - r.in.key_handle = key_handle; - r.in.values = values; - r.in.num_values = num_values; - r.in.buffer = buffer; - r.in.buffer_size = buffer_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_QUERYMULTIPLEVALUES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - memcpy(values, r.out.values, r.in.num_values * sizeof(*values)); - if (buffer && r.out.buffer) { - memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer)); - } - *buffer_size = *r.out.buffer_size; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *hostname /* [in] [unique] */, - struct lsa_StringLarge *message /* [in] [unique] */, - uint32_t timeout /* [in] */, - uint8_t force_apps /* [in] */, - uint8_t do_reboot /* [in] */, - uint32_t reason /* [in] */, - WERROR *werror) -{ - struct winreg_InitiateSystemShutdownEx r; - NTSTATUS status; - - /* In parameters */ - r.in.hostname = hostname; - r.in.message = message; - r.in.timeout = timeout; - r.in.force_apps = force_apps; - r.in.do_reboot = do_reboot; - r.in.reason = reason; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct winreg_SaveKeyEx r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_SAVEKEYEX, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenHKPT r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENHKPT, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror) -{ - struct winreg_OpenHKPN r; - NTSTATUS status; - - /* In parameters */ - r.in.system_name = system_name; - r.in.access_mask = access_mask; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_OPENHKPN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *handle = *r.out.handle; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) -{ - struct winreg_QueryMultipleValues2 r; - NTSTATUS status; - - /* In parameters */ - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_winreg, - NDR_WINREG_QUERYMULTIPLEVALUES2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - diff --git a/source3/librpc/gen_ndr/cli_winreg.h b/source3/librpc/gen_ndr/cli_winreg.h deleted file mode 100644 index fb27bce9d2..0000000000 --- a/source3/librpc/gen_ndr/cli_winreg.h +++ /dev/null @@ -1,229 +0,0 @@ -#include "librpc/gen_ndr/ndr_winreg.h" -#ifndef __CLI_WINREG__ -#define __CLI_WINREG__ -NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in,out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String name /* [in] */, - struct winreg_String keyclass /* [in] */, - uint32_t options /* [in] */, - uint32_t access_mask /* [in] */, - struct winreg_SecBuf *secdesc /* [in] [unique] */, - struct policy_handle *new_handle /* [out] [ref] */, - enum winreg_CreateAction *action_taken /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String key /* [in] */, - WERROR *werror); -NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String value /* [in] */, - WERROR *werror); -NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t enum_index /* [in] */, - struct winreg_StringBuf *name /* [in,out] [ref] */, - struct winreg_StringBuf *keyclass /* [in,out] [unique] */, - NTTIME *last_changed_time /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t enum_index /* [in] */, - struct winreg_StringBuf *name /* [in,out] [ref] */, - enum winreg_Type *type /* [in,out] [unique] */, - uint8_t *value /* [in,out] [unique,length_is(*length),size_is(*size)] */, - uint32_t *size /* [in,out] [unique] */, - uint32_t *length /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct KeySecurityData *sd /* [in,out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *keyname /* [in] [unique] */, - struct winreg_String *filename /* [in] [unique] */, - WERROR *werror); -NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint8_t watch_subtree /* [in] */, - uint32_t notify_filter /* [in] */, - uint32_t unknown /* [in] */, - struct winreg_String string1 /* [in] */, - struct winreg_String string2 /* [in] */, - uint32_t unknown2 /* [in] */, - WERROR *werror); -NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *parent_handle /* [in] [ref] */, - struct winreg_String keyname /* [in] */, - uint32_t unknown /* [in] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *classname /* [in,out] [ref] */, - uint32_t *num_subkeys /* [out] [ref] */, - uint32_t *max_subkeylen /* [out] [ref] */, - uint32_t *max_classlen /* [out] [ref] */, - uint32_t *num_values /* [out] [ref] */, - uint32_t *max_valnamelen /* [out] [ref] */, - uint32_t *max_valbufsize /* [out] [ref] */, - uint32_t *secdescsize /* [out] [ref] */, - NTTIME *last_changed_time /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *value_name /* [in] [ref] */, - enum winreg_Type *type /* [in,out] [unique] */, - uint8_t *data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */, - uint32_t *data_size /* [in,out] [unique] */, - uint32_t *data_length /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *filename /* [in] [ref] */, - uint32_t flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String *filename /* [in] [ref] */, - struct KeySecurityAttribute *sec_attrib /* [in] [unique] */, - WERROR *werror); -NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t sec_info /* [in] */, - struct KeySecurityData *sd /* [in] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - struct winreg_String name /* [in] */, - enum winreg_Type type /* [in] */, - uint8_t *data /* [in] [ref,size_is(size)] */, - uint32_t size /* [in] */, - WERROR *werror); -NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *hostname /* [in] [unique] */, - struct lsa_StringLarge *message /* [in] [unique] */, - uint32_t timeout /* [in] */, - uint8_t force_apps /* [in] */, - uint8_t do_reboot /* [in] */, - WERROR *werror); -NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *server /* [in] [unique] */, - WERROR *werror); -NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *handle /* [in] [ref] */, - uint32_t *version /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct policy_handle *key_handle /* [in] [ref] */, - struct QueryMultipleValue *values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */, - uint32_t num_values /* [in] */, - uint8_t *buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */, - uint32_t *buffer_size /* [in,out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *hostname /* [in] [unique] */, - struct lsa_StringLarge *message /* [in] [unique] */, - uint32_t timeout /* [in] */, - uint8_t force_apps /* [in] */, - uint8_t do_reboot /* [in] */, - uint32_t reason /* [in] */, - WERROR *werror); -NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint16_t *system_name /* [in] [unique] */, - uint32_t access_mask /* [in] */, - struct policy_handle *handle /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -#endif /* __CLI_WINREG__ */ diff --git a/source3/librpc/gen_ndr/cli_wkssvc.c b/source3/librpc/gen_ndr/cli_wkssvc.c deleted file mode 100644 index b82e95311f..0000000000 --- a/source3/librpc/gen_ndr/cli_wkssvc.c +++ /dev/null @@ -1,1570 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_wkssvc.h" - -NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetWkstaInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct wkssvc_NetWkstaGetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETWKSTAGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetWkstaInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_error /* [in,out] [ref] */, - WERROR *werror) -{ - struct wkssvc_NetWkstaSetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.level = level; - r.in.info = info; - r.in.parm_error = parm_error; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETWKSTASETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *parm_error = *r.out.parm_error; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct wkssvc_NetWkstaEnumUsersInfo *info /* [in,out] [ref] */, - uint32_t prefmaxlen /* [in] */, - uint32_t *entries_read /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct wkssvc_NetWkstaEnumUsers r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.info = info; - r.in.prefmaxlen = prefmaxlen; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETWKSTAENUMUSERS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - *entries_read = *r.out.entries_read; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *unknown /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetrWkstaUserInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct wkssvc_NetrWkstaUserGetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.unknown = unknown; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRWKSTAUSERGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *unknown /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetrWkstaUserInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_err /* [in,out] [unique] */, - WERROR *werror) -{ - struct wkssvc_NetrWkstaUserSetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.unknown = unknown; - r.in.level = level; - r.in.info = info; - r.in.parm_err = parm_err; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRWKSTAUSERSETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (parm_err && r.out.parm_err) { - *parm_err = *r.out.parm_err; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *total_entries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct wkssvc_NetWkstaTransportEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.info = info; - r.in.max_buffer = max_buffer; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETWKSTATRANSPORTENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - *total_entries = *r.out.total_entries; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - struct wkssvc_NetWkstaTransportInfo0 *info0 /* [in] [ref] */, - uint32_t *parm_err /* [in,out] [unique] */, - WERROR *werror) -{ - struct wkssvc_NetrWkstaTransportAdd r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.level = level; - r.in.info0 = info0; - r.in.parm_err = parm_err; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRWKSTATRANSPORTADD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (parm_err && r.out.parm_err) { - *parm_err = *r.out.parm_err; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *transport_name /* [in] [unique,charset(UTF16)] */, - uint32_t unknown3 /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrWkstaTransportDel r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.transport_name = transport_name; - r.in.unknown3 = unknown3; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRWKSTATRANSPORTDEL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetrUseGetInfoCtr *ctr /* [in] [ref,switch_is(level)] */, - uint32_t *parm_err /* [in,out] [unique] */, - WERROR *werror) -{ - struct wkssvc_NetrUseAdd r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.level = level; - r.in.ctr = ctr; - r.in.parm_err = parm_err; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRUSEADD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - if (parm_err && r.out.parm_err) { - *parm_err = *r.out.parm_err; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *use_name /* [in] [ref,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetrUseGetInfoCtr *ctr /* [out] [ref,switch_is(level)] */, - WERROR *werror) -{ - struct wkssvc_NetrUseGetInfo r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.use_name = use_name; - r.in.level = level; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRUSEGETINFO, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *use_name /* [in] [ref,charset(UTF16)] */, - uint32_t force_cond /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrUseDel r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.use_name = use_name; - r.in.force_cond = force_cond; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRUSEDEL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct wkssvc_NetrUseEnumInfo *info /* [in,out] [ref] */, - uint32_t prefmaxlen /* [in] */, - uint32_t *entries_read /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror) -{ - struct wkssvc_NetrUseEnum r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.info = info; - r.in.prefmaxlen = prefmaxlen; - r.in.resume_handle = resume_handle; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRUSEENUM, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - *entries_read = *r.out.entries_read; - if (resume_handle && r.out.resume_handle) { - *resume_handle = *r.out.resume_handle; - } - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *message_name /* [in] [ref,charset(UTF16)] */, - const char *message_sender_name /* [in] [unique,charset(UTF16)] */, - uint8_t *message_buffer /* [in] [ref,size_is(message_size)] */, - uint32_t message_size /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrMessageBufferSend r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.message_name = message_name; - r.in.message_sender_name = message_sender_name; - r.in.message_buffer = message_buffer; - r.in.message_size = message_size; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRMESSAGEBUFFERSEND, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *unknown2 /* [in] [unique,charset(UTF16)] */, - uint32_t unknown3 /* [in] */, - uint32_t unknown4 /* [in] */, - struct wkssvc_NetrWorkstationStatistics **info /* [out] [ref] */, - WERROR *werror) -{ - struct wkssvc_NetrWorkstationStatisticsGet r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.unknown2 = unknown2; - r.in.unknown3 = unknown3; - r.in.unknown4 = unknown4; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *info = *r.out.info; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - WERROR *werror) -{ - struct wkssvc_NetrLogonDomainNameAdd r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_name = domain_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRLOGONDOMAINNAMEADD, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - WERROR *werror) -{ - struct wkssvc_NetrLogonDomainNameDel r; - NTSTATUS status; - - /* In parameters */ - r.in.domain_name = domain_name; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - const char *account_ou /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - uint32_t join_flags /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrJoinDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.domain_name = domain_name; - r.in.account_ou = account_ou; - r.in.Account = Account; - r.in.password = password; - r.in.join_flags = join_flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRJOINDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - uint32_t unjoin_flags /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrUnjoinDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.Account = Account; - r.in.password = password; - r.in.unjoin_flags = unjoin_flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRUNJOINDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *NewMachineName /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - uint32_t RenameOptions /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrRenameMachineInDomain r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.NewMachineName = NewMachineName; - r.in.Account = Account; - r.in.password = password; - r.in.RenameOptions = RenameOptions; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *name /* [in] [ref,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *Password /* [in] [unique,charset(UTF16)] */, - enum wkssvc_NetValidateNameType name_type /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrValidateName r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.name = name; - r.in.Account = Account; - r.in.Password = Password; - r.in.name_type = name_type; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRVALIDATENAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char **name_buffer /* [in,out] [ref,charset(UTF16)] */, - enum wkssvc_NetJoinStatus *name_type /* [out] [ref] */, - WERROR *werror) -{ - struct wkssvc_NetrGetJoinInformation r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.name_buffer = name_buffer; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRGETJOININFORMATION, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *name_buffer = *r.out.name_buffer; - *name_type = *r.out.name_type; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *unknown /* [in] [unique,charset(UTF16)] */, - uint32_t *num_ous /* [in,out] [ref] */, - const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */, - WERROR *werror) -{ - struct wkssvc_NetrGetJoinableOus r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.domain_name = domain_name; - r.in.Account = Account; - r.in.unknown = unknown; - r.in.num_ous = num_ous; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRGETJOINABLEOUS, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *num_ous = *r.out.num_ous; - *ous = *r.out.ous; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - const char *account_ou /* [in] [unique,charset(UTF16)] */, - const char *admin_account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */, - uint32_t join_flags /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrJoinDomain2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.domain_name = domain_name; - r.in.account_ou = account_ou; - r.in.admin_account = admin_account; - r.in.encrypted_password = encrypted_password; - r.in.join_flags = join_flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRJOINDOMAIN2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */, - uint32_t unjoin_flags /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrUnjoinDomain2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.account = account; - r.in.encrypted_password = encrypted_password; - r.in.unjoin_flags = unjoin_flags; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRUNJOINDOMAIN2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *NewMachineName /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t RenameOptions /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrRenameMachineInDomain2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.NewMachineName = NewMachineName; - r.in.Account = Account; - r.in.EncryptedPassword = EncryptedPassword; - r.in.RenameOptions = RenameOptions; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *name /* [in] [ref,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - enum wkssvc_NetValidateNameType name_type /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrValidateName2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.name = name; - r.in.Account = Account; - r.in.EncryptedPassword = EncryptedPassword; - r.in.name_type = name_type; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRVALIDATENAME2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t *num_ous /* [in,out] [ref] */, - const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */, - WERROR *werror) -{ - struct wkssvc_NetrGetJoinableOus2 r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.domain_name = domain_name; - r.in.Account = Account; - r.in.EncryptedPassword = EncryptedPassword; - r.in.num_ous = num_ous; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRGETJOINABLEOUS2, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *num_ous = *r.out.num_ous; - *ous = *r.out.ous; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *NewAlternateMachineName /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t Reserved /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrAddAlternateComputerName r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.NewAlternateMachineName = NewAlternateMachineName; - r.in.Account = Account; - r.in.EncryptedPassword = EncryptedPassword; - r.in.Reserved = Reserved; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t Reserved /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrRemoveAlternateComputerName r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.AlternateMachineNameToRemove = AlternateMachineNameToRemove; - r.in.Account = Account; - r.in.EncryptedPassword = EncryptedPassword; - r.in.Reserved = Reserved; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *primary_name /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t Reserved /* [in] */, - WERROR *werror) -{ - struct wkssvc_NetrSetPrimaryComputername r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.primary_name = primary_name; - r.in.Account = Account; - r.in.EncryptedPassword = EncryptedPassword; - r.in.Reserved = Reserved; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - -NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - enum wkssvc_ComputerNameType name_type /* [in] */, - uint32_t Reserved /* [in] */, - struct wkssvc_ComputerNamesCtr **ctr /* [out] [ref] */, - WERROR *werror) -{ - struct wkssvc_NetrEnumerateComputerNames r; - NTSTATUS status; - - /* In parameters */ - r.in.server_name = server_name; - r.in.name_type = name_type; - r.in.Reserved = Reserved; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - &ndr_table_wkssvc, - NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *ctr = *r.out.ctr; - - /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); -} - diff --git a/source3/librpc/gen_ndr/cli_wkssvc.h b/source3/librpc/gen_ndr/cli_wkssvc.h deleted file mode 100644 index 0d360abfeb..0000000000 --- a/source3/librpc/gen_ndr/cli_wkssvc.h +++ /dev/null @@ -1,230 +0,0 @@ -#include "librpc/gen_ndr/ndr_wkssvc.h" -#ifndef __CLI_WKSSVC__ -#define __CLI_WKSSVC__ -NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetWkstaInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetWkstaInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_error /* [in,out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct wkssvc_NetWkstaEnumUsersInfo *info /* [in,out] [ref] */, - uint32_t prefmaxlen /* [in] */, - uint32_t *entries_read /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *unknown /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetrWkstaUserInfo *info /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *unknown /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetrWkstaUserInfo *info /* [in] [ref,switch_is(level)] */, - uint32_t *parm_err /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */, - uint32_t max_buffer /* [in] */, - uint32_t *total_entries /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - struct wkssvc_NetWkstaTransportInfo0 *info0 /* [in] [ref] */, - uint32_t *parm_err /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *transport_name /* [in] [unique,charset(UTF16)] */, - uint32_t unknown3 /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetrUseGetInfoCtr *ctr /* [in] [ref,switch_is(level)] */, - uint32_t *parm_err /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *use_name /* [in] [ref,charset(UTF16)] */, - uint32_t level /* [in] */, - union wkssvc_NetrUseGetInfoCtr *ctr /* [out] [ref,switch_is(level)] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *use_name /* [in] [ref,charset(UTF16)] */, - uint32_t force_cond /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - struct wkssvc_NetrUseEnumInfo *info /* [in,out] [ref] */, - uint32_t prefmaxlen /* [in] */, - uint32_t *entries_read /* [out] [ref] */, - uint32_t *resume_handle /* [in,out] [unique] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *message_name /* [in] [ref,charset(UTF16)] */, - const char *message_sender_name /* [in] [unique,charset(UTF16)] */, - uint8_t *message_buffer /* [in] [ref,size_is(message_size)] */, - uint32_t message_size /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *unknown2 /* [in] [unique,charset(UTF16)] */, - uint32_t unknown3 /* [in] */, - uint32_t unknown4 /* [in] */, - struct wkssvc_NetrWorkstationStatistics **info /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - const char *account_ou /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - uint32_t join_flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - uint32_t unjoin_flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *NewMachineName /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *password /* [in] [unique,charset(UTF16)] */, - uint32_t RenameOptions /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *name /* [in] [ref,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *Password /* [in] [unique,charset(UTF16)] */, - enum wkssvc_NetValidateNameType name_type /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char **name_buffer /* [in,out] [ref,charset(UTF16)] */, - enum wkssvc_NetJoinStatus *name_type /* [out] [ref] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - const char *unknown /* [in] [unique,charset(UTF16)] */, - uint32_t *num_ous /* [in,out] [ref] */, - const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - const char *account_ou /* [in] [unique,charset(UTF16)] */, - const char *admin_account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */, - uint32_t join_flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */, - uint32_t unjoin_flags /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *NewMachineName /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t RenameOptions /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *name /* [in] [ref,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - enum wkssvc_NetValidateNameType name_type /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *domain_name /* [in] [ref,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t *num_ous /* [in,out] [ref] */, - const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *NewAlternateMachineName /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t Reserved /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t Reserved /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - const char *primary_name /* [in] [unique,charset(UTF16)] */, - const char *Account /* [in] [unique,charset(UTF16)] */, - struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */, - uint32_t Reserved /* [in] */, - WERROR *werror); -NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *server_name /* [in] [unique,charset(UTF16)] */, - enum wkssvc_ComputerNameType name_type /* [in] */, - uint32_t Reserved /* [in] */, - struct wkssvc_ComputerNamesCtr **ctr /* [out] [ref] */, - WERROR *werror); -#endif /* __CLI_WKSSVC__ */ diff --git a/source3/librpc/gen_ndr/dfs.h b/source3/librpc/gen_ndr/dfs.h deleted file mode 100644 index 07548c3742..0000000000 --- a/source3/librpc/gen_ndr/dfs.h +++ /dev/null @@ -1,582 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/misc.h" -#ifndef _HEADER_netdfs -#define _HEADER_netdfs - -#define DFS_STORAGE_STATES ( 0xf ) -enum dfs_ManagerVersion -#ifndef USE_UINT_ENUMS - { - DFS_MANAGER_VERSION_NT4=1, - DFS_MANAGER_VERSION_W2K=2, - DFS_MANAGER_VERSION_W2K3=4, - DFS_MANAGER_VERSION_W2K8=6 -} -#else - { __donnot_use_enum_dfs_ManagerVersion=0x7FFFFFFF} -#define DFS_MANAGER_VERSION_NT4 ( 1 ) -#define DFS_MANAGER_VERSION_W2K ( 2 ) -#define DFS_MANAGER_VERSION_W2K3 ( 4 ) -#define DFS_MANAGER_VERSION_W2K8 ( 6 ) -#endif -; - -struct dfs_Info0 { - char _empty_; -}; - -struct dfs_Info1 { - const char *path;/* [unique,charset(UTF16)] */ -}; - -/* bitmap dfs_VolumeState */ -#define DFS_VOLUME_STATE_OK ( 0x1 ) -#define DFS_VOLUME_STATE_INCONSISTENT ( 0x2 ) -#define DFS_VOLUME_STATE_OFFLINE ( 0x3 ) -#define DFS_VOLUME_STATE_ONLINE ( 0x4 ) -#define DFS_VOLUME_STATE_STANDALONE ( DFS_VOLUME_FLAVOR_STANDALONE ) -#define DFS_VOLUME_STATE_AD_BLOB ( DFS_VOLUME_FLAVOR_AD_BLOB ) - -struct dfs_Info2 { - const char *path;/* [unique,charset(UTF16)] */ - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t state; - uint32_t num_stores; -}; - -/* bitmap dfs_StorageState */ -#define DFS_STORAGE_STATE_OFFLINE ( 1 ) -#define DFS_STORAGE_STATE_ONLINE ( 2 ) -#define DFS_STORAGE_STATE_ACTIVE ( 4 ) - -struct dfs_StorageInfo { - uint32_t state; - const char *server;/* [unique,charset(UTF16)] */ - const char *share;/* [unique,charset(UTF16)] */ -}; - -struct dfs_Info3 { - const char *path;/* [unique,charset(UTF16)] */ - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t state; - uint32_t num_stores; - struct dfs_StorageInfo *stores;/* [unique,size_is(num_stores)] */ -}; - -struct dfs_Info4 { - const char *path;/* [unique,charset(UTF16)] */ - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t state; - uint32_t timeout; - struct GUID guid; - uint32_t num_stores; - struct dfs_StorageInfo *stores;/* [unique,size_is(num_stores)] */ -}; - -/* bitmap dfs_PropertyFlags */ -#define DFS_PROPERTY_FLAG_INSITE_REFERRALS ( 0x01 ) -#define DFS_PROPERTY_FLAG_ROOT_SCALABILITY ( 0x02 ) -#define DFS_PROPERTY_FLAG_SITE_COSTING ( 0x04 ) -#define DFS_PROPERTY_FLAG_TARGET_FAILBACK ( 0x08 ) -#define DFS_PROPERTY_FLAG_CLUSTER_ENABLED ( 0x10 ) - -struct dfs_Info5 { - const char *path;/* [unique,charset(UTF16)] */ - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t state; - uint32_t timeout; - struct GUID guid; - uint32_t flags; - uint32_t pktsize; - uint32_t num_stores; -}; - -enum dfs_Target_PriorityClass -#ifndef USE_UINT_ENUMS - { - DFS_INVALID_PRIORITY_CLASS=-1, - DFS_SITE_COST_NORMAL_PRIORITY_CLASS=0, - DFS_GLOBAL_HIGH_PRIORITY_CLASS=1, - DFS_SITE_COST_HIGH_PRIORITY_CLASS=2, - DFS_SITE_COST_LOW_PRIORITY_CLASS=3, - DFS_GLOBAL_LOW_PRIORITY_CLASS=4 -} -#else - { __donnot_use_enum_dfs_Target_PriorityClass=0x7FFFFFFF} -#define DFS_INVALID_PRIORITY_CLASS ( -1 ) -#define DFS_SITE_COST_NORMAL_PRIORITY_CLASS ( 0 ) -#define DFS_GLOBAL_HIGH_PRIORITY_CLASS ( 1 ) -#define DFS_SITE_COST_HIGH_PRIORITY_CLASS ( 2 ) -#define DFS_SITE_COST_LOW_PRIORITY_CLASS ( 3 ) -#define DFS_GLOBAL_LOW_PRIORITY_CLASS ( 4 ) -#endif -; - -struct dfs_Target_Priority { - enum dfs_Target_PriorityClass target_priority_class; - uint16_t target_priority_rank; - uint16_t reserved; -}; - -struct dfs_StorageInfo2 { - struct dfs_StorageInfo info; - struct dfs_Target_Priority target_priority; -}; - -struct dfs_Info6 { - const char *entry_path;/* [unique,charset(UTF16)] */ - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t state; - uint32_t timeout; - struct GUID guid; - uint32_t flags; - uint32_t pktsize; - uint16_t num_stores; - struct dfs_StorageInfo2 *stores;/* [unique,size_is(num_stores)] */ -}; - -struct dfs_Info7 { - struct GUID generation_guid; -}; - -struct dfs_Info100 { - const char *comment;/* [unique,charset(UTF16)] */ -}; - -struct dfs_Info101 { - uint32_t state; -}; - -struct dfs_Info102 { - uint32_t timeout; -}; - -struct dfs_Info103 { - uint32_t flags; -}; - -struct dfs_Info104 { - struct dfs_Target_Priority priority; -}; - -struct dfs_Info105 { - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t state; - uint32_t timeout; - uint32_t property_flag_mask; - uint32_t property_flags; -}; - -struct dfs_Info106 { - uint32_t state; - struct dfs_Target_Priority priority; -}; - -struct dfs_Info200 { - const char *dom_root;/* [unique,charset(UTF16)] */ -}; - -enum dfs_VolumeFlavor -#ifndef USE_UINT_ENUMS - { - DFS_VOLUME_FLAVOR_STANDALONE=0x100, - DFS_VOLUME_FLAVOR_AD_BLOB=0x200 -} -#else - { __donnot_use_enum_dfs_VolumeFlavor=0x7FFFFFFF} -#define DFS_VOLUME_FLAVOR_STANDALONE ( 0x100 ) -#define DFS_VOLUME_FLAVOR_AD_BLOB ( 0x200 ) -#endif -; - -struct dfs_Info300 { - enum dfs_VolumeFlavor flavor; - const char *dom_root;/* [unique,charset(UTF16)] */ -}; - -union dfs_Info { - struct dfs_Info0 *info0;/* [unique,case(0)] */ - struct dfs_Info1 *info1;/* [unique,case] */ - struct dfs_Info2 *info2;/* [unique,case(2)] */ - struct dfs_Info3 *info3;/* [unique,case(3)] */ - struct dfs_Info4 *info4;/* [unique,case(4)] */ - struct dfs_Info5 *info5;/* [unique,case(5)] */ - struct dfs_Info6 *info6;/* [unique,case(6)] */ - struct dfs_Info7 *info7;/* [unique,case(7)] */ - struct dfs_Info100 *info100;/* [unique,case(100)] */ - struct dfs_Info101 *info101;/* [unique,case(101)] */ - struct dfs_Info102 *info102;/* [unique,case(102)] */ - struct dfs_Info103 *info103;/* [unique,case(103)] */ - struct dfs_Info104 *info104;/* [unique,case(104)] */ - struct dfs_Info105 *info105;/* [unique,case(105)] */ - struct dfs_Info106 *info106;/* [unique,case(106)] */ -}; - -struct dfs_EnumArray1 { - uint32_t count; - struct dfs_Info1 *s;/* [unique,size_is(count)] */ -}; - -struct dfs_EnumArray2 { - uint32_t count; - struct dfs_Info2 *s;/* [unique,size_is(count)] */ -}; - -struct dfs_EnumArray3 { - uint32_t count; - struct dfs_Info3 *s;/* [unique,size_is(count)] */ -}; - -struct dfs_EnumArray4 { - uint32_t count; - struct dfs_Info4 *s;/* [unique,size_is(count)] */ -}; - -struct dfs_EnumArray5 { - uint32_t count; - struct dfs_Info5 *s;/* [unique,size_is(count)] */ -}; - -struct dfs_EnumArray6 { - uint32_t count; - struct dfs_Info6 *s;/* [unique,size_is(count)] */ -}; - -struct dfs_EnumArray200 { - uint32_t count; - struct dfs_Info200 *s;/* [unique,size_is(count)] */ -}; - -struct dfs_EnumArray300 { - uint32_t count; - struct dfs_Info300 *s;/* [unique,size_is(count)] */ -}; - -union dfs_EnumInfo { - struct dfs_EnumArray1 *info1;/* [unique,case] */ - struct dfs_EnumArray2 *info2;/* [unique,case(2)] */ - struct dfs_EnumArray3 *info3;/* [unique,case(3)] */ - struct dfs_EnumArray4 *info4;/* [unique,case(4)] */ - struct dfs_EnumArray5 *info5;/* [unique,case(5)] */ - struct dfs_EnumArray6 *info6;/* [unique,case(6)] */ - struct dfs_EnumArray200 *info200;/* [unique,case(200)] */ - struct dfs_EnumArray300 *info300;/* [unique,case(300)] */ -}; - -struct dfs_EnumStruct { - uint32_t level; - union dfs_EnumInfo e;/* [switch_is(level)] */ -}; - -struct dfs_UnknownStruct { - uint32_t unknown1; - const char *unknown2;/* [unique,charset(UTF16)] */ -}; - - -struct dfs_GetManagerVersion { - struct { - enum dfs_ManagerVersion *version;/* [ref] */ - } out; - -}; - - -struct dfs_Add { - struct { - const char *path;/* [ref,charset(UTF16)] */ - const char *server;/* [ref,charset(UTF16)] */ - const char *share;/* [unique,charset(UTF16)] */ - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct dfs_Remove { - struct { - const char *dfs_entry_path;/* [ref,charset(UTF16)] */ - const char *servername;/* [unique,charset(UTF16)] */ - const char *sharename;/* [unique,charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct dfs_SetInfo { - struct { - const char *dfs_entry_path;/* [charset(UTF16)] */ - const char *servername;/* [unique,charset(UTF16)] */ - const char *sharename;/* [unique,charset(UTF16)] */ - uint32_t level; - union dfs_Info *info;/* [ref,switch_is(level)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct dfs_GetInfo { - struct { - const char *dfs_entry_path;/* [charset(UTF16)] */ - const char *servername;/* [unique,charset(UTF16)] */ - const char *sharename;/* [unique,charset(UTF16)] */ - uint32_t level; - } in; - - struct { - union dfs_Info *info;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct dfs_Enum { - struct { - uint32_t level; - uint32_t bufsize; - struct dfs_EnumStruct *info;/* [unique] */ - uint32_t *total;/* [unique] */ - } in; - - struct { - struct dfs_EnumStruct *info;/* [unique] */ - uint32_t *total;/* [unique] */ - WERROR result; - } out; - -}; - - -struct dfs_Rename { - struct { - WERROR result; - } out; - -}; - - -struct dfs_Move { - struct { - WERROR result; - } out; - -}; - - -struct dfs_ManagerGetConfigInfo { - struct { - WERROR result; - } out; - -}; - - -struct dfs_ManagerSendSiteInfo { - struct { - WERROR result; - } out; - -}; - - -struct dfs_AddFtRoot { - struct { - const char *servername;/* [charset(UTF16)] */ - const char *dns_servername;/* [charset(UTF16)] */ - const char *dfsname;/* [charset(UTF16)] */ - const char *rootshare;/* [charset(UTF16)] */ - const char *comment;/* [charset(UTF16)] */ - const char *dfs_config_dn;/* [charset(UTF16)] */ - uint8_t unknown1; - uint32_t flags; - struct dfs_UnknownStruct **unknown2;/* [unique] */ - } in; - - struct { - struct dfs_UnknownStruct **unknown2;/* [unique] */ - WERROR result; - } out; - -}; - - -struct dfs_RemoveFtRoot { - struct { - const char *servername;/* [charset(UTF16)] */ - const char *dns_servername;/* [charset(UTF16)] */ - const char *dfsname;/* [charset(UTF16)] */ - const char *rootshare;/* [charset(UTF16)] */ - uint32_t flags; - struct dfs_UnknownStruct **unknown;/* [unique] */ - } in; - - struct { - struct dfs_UnknownStruct **unknown;/* [unique] */ - WERROR result; - } out; - -}; - - -struct dfs_AddStdRoot { - struct { - const char *servername;/* [charset(UTF16)] */ - const char *rootshare;/* [charset(UTF16)] */ - const char *comment;/* [charset(UTF16)] */ - uint32_t flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct dfs_RemoveStdRoot { - struct { - const char *servername;/* [charset(UTF16)] */ - const char *rootshare;/* [charset(UTF16)] */ - uint32_t flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct dfs_ManagerInitialize { - struct { - const char *servername;/* [ref,charset(UTF16)] */ - uint32_t flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct dfs_AddStdRootForced { - struct { - const char *servername;/* [charset(UTF16)] */ - const char *rootshare;/* [charset(UTF16)] */ - const char *comment;/* [charset(UTF16)] */ - const char *store;/* [charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct dfs_GetDcAddress { - struct { - const char *servername;/* [charset(UTF16)] */ - const char **server_fullname;/* [ref,charset(UTF16)] */ - uint8_t *is_root;/* [ref] */ - uint32_t *ttl;/* [ref] */ - } in; - - struct { - const char **server_fullname;/* [ref,charset(UTF16)] */ - uint8_t *is_root;/* [ref] */ - uint32_t *ttl;/* [ref] */ - WERROR result; - } out; - -}; - - -struct dfs_SetDcAddress { - struct { - const char *servername;/* [charset(UTF16)] */ - const char *server_fullname;/* [charset(UTF16)] */ - uint32_t flags; - uint32_t ttl; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct dfs_FlushFtTable { - struct { - const char *servername;/* [charset(UTF16)] */ - const char *rootshare;/* [charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct dfs_Add2 { - struct { - WERROR result; - } out; - -}; - - -struct dfs_Remove2 { - struct { - WERROR result; - } out; - -}; - - -struct dfs_EnumEx { - struct { - const char *dfs_name;/* [charset(UTF16)] */ - uint32_t level; - uint32_t bufsize; - struct dfs_EnumStruct *info;/* [unique] */ - uint32_t *total;/* [unique] */ - } in; - - struct { - struct dfs_EnumStruct *info;/* [unique] */ - uint32_t *total;/* [unique] */ - WERROR result; - } out; - -}; - - -struct dfs_SetInfo2 { - struct { - WERROR result; - } out; - -}; - -#endif /* _HEADER_netdfs */ diff --git a/source3/librpc/gen_ndr/drsblobs.h b/source3/librpc/gen_ndr/drsblobs.h deleted file mode 100644 index 692746468e..0000000000 --- a/source3/librpc/gen_ndr/drsblobs.h +++ /dev/null @@ -1,534 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/drsuapi.h" -#include "librpc/gen_ndr/misc.h" -#include "librpc/gen_ndr/samr.h" -#include "librpc/gen_ndr/lsa.h" -#ifndef _HEADER_drsblobs -#define _HEADER_drsblobs - -#define SUPPLEMENTAL_CREDENTIALS_PREFIX ( " " ) -enum drsuapi_DsAttributeId; - -enum lsa_TrustAuthType; - -struct replPropertyMetaData1 { - enum drsuapi_DsAttributeId attid; - uint32_t version; - NTTIME originating_change_time; - struct GUID originating_invocation_id; - uint64_t originating_usn; - uint64_t local_usn; -}; - -struct replPropertyMetaDataCtr1 { - uint32_t count; - uint32_t reserved; - struct replPropertyMetaData1 *array; -}; - -union replPropertyMetaDataCtr { - struct replPropertyMetaDataCtr1 ctr1;/* [case] */ -}/* [nodiscriminant] */; - -struct replPropertyMetaDataBlob { - uint32_t version; - uint32_t reserved; - union replPropertyMetaDataCtr ctr;/* [switch_is(version)] */ -}/* [public] */; - -struct replUpToDateVectorCtr1 { - uint32_t count; - uint32_t reserved; - struct drsuapi_DsReplicaCursor *cursors; -}; - -struct replUpToDateVectorCtr2 { - uint32_t count; - uint32_t reserved; - struct drsuapi_DsReplicaCursor2 *cursors; -}; - -union replUpToDateVectorCtr { - struct replUpToDateVectorCtr1 ctr1;/* [case] */ - struct replUpToDateVectorCtr2 ctr2;/* [case(2)] */ -}/* [nodiscriminant] */; - -struct replUpToDateVectorBlob { - uint32_t version; - uint32_t reserved; - union replUpToDateVectorCtr ctr;/* [switch_is(version)] */ -}/* [public] */; - -struct repsFromTo1OtherInfo { - uint32_t __dns_name_size;/* [value(strlen(dns_name)+1)] */ - const char *dns_name;/* [charset(DOS)] */ -}/* [gensize,public] */; - -struct repsFromTo1 { - uint32_t blobsize;/* [value(ndr_size_repsFromTo1(this,ndr->flags)+8)] */ - uint32_t consecutive_sync_failures; - NTTIME last_success; - NTTIME last_attempt; - WERROR result_last_attempt; - struct repsFromTo1OtherInfo *other_info;/* [relative] */ - uint32_t other_info_length;/* [value(ndr_size_repsFromTo1OtherInfo(other_info,ndr->flags))] */ - uint32_t replica_flags; - uint8_t schedule[84]; - uint32_t reserved; - struct drsuapi_DsReplicaHighWaterMark highwatermark; - struct GUID source_dsa_obj_guid; - struct GUID source_dsa_invocation_id; - struct GUID transport_guid; -}/* [gensize,public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -union repsFromTo { - struct repsFromTo1 ctr1;/* [case] */ -}/* [nodiscriminant] */; - -struct repsFromToBlob { - uint32_t version; - uint32_t reserved; - union repsFromTo ctr;/* [switch_is(version)] */ -}/* [public] */; - -struct partialAttributeSetCtr1 { - uint32_t count; - enum drsuapi_DsAttributeId *array; -}; - -union partialAttributeSetCtr { - struct partialAttributeSetCtr1 ctr1;/* [case] */ -}/* [nodiscriminant] */; - -struct partialAttributeSetBlob { - uint32_t version; - uint32_t reserved; - union partialAttributeSetCtr ctr;/* [switch_is(version)] */ -}/* [public] */; - -enum prefixMapVersion -#ifndef USE_UINT_ENUMS - { - PREFIX_MAP_VERSION_DSDB=0x44534442 -} -#else - { __donnot_use_enum_prefixMapVersion=0x7FFFFFFF} -#define PREFIX_MAP_VERSION_DSDB ( 0x44534442 ) -#endif -; - -union prefixMapCtr { - struct drsuapi_DsReplicaOIDMapping_Ctr dsdb;/* [case(PREFIX_MAP_VERSION_DSDB)] */ -}/* [nodiscriminant] */; - -struct prefixMapBlob { - enum prefixMapVersion version; - uint32_t reserved; - union prefixMapCtr ctr;/* [switch_is(version)] */ -}/* [public] */; - -union ldapControlDirSyncExtra { - struct replUpToDateVectorBlob uptodateness_vector;/* [default] */ -}/* [gensize,nodiscriminant] */; - -struct ldapControlDirSyncBlob { - uint32_t u1;/* [value(3)] */ - NTTIME time; - uint32_t u2; - uint32_t u3; - uint32_t extra_length;/* [value(ndr_size_ldapControlDirSyncExtra(&extra,extra.uptodateness_vector.version,0))] */ - struct drsuapi_DsReplicaHighWaterMark highwatermark; - struct GUID guid1; - union ldapControlDirSyncExtra extra;/* [switch_is(extra_length)] */ -}; - -struct ldapControlDirSyncCookie { - const char *msds;/* [value("MSDS"),charset(DOS)] */ - struct ldapControlDirSyncBlob blob;/* [subcontext(0)] */ -}/* [relative_base,public] */; - -struct supplementalCredentialsPackage { - uint16_t name_len;/* [value(2*strlen_m(name))] */ - uint16_t data_len;/* [value(strlen(data))] */ - uint16_t reserved; - const char *name;/* [charset(UTF16)] */ - const char *data;/* [charset(DOS)] */ -}; - -enum supplementalCredentialsSignature -#ifndef USE_UINT_ENUMS - { - SUPPLEMENTAL_CREDENTIALS_SIGNATURE=0x0050 -} -#else - { __donnot_use_enum_supplementalCredentialsSignature=0x7FFFFFFF} -#define SUPPLEMENTAL_CREDENTIALS_SIGNATURE ( 0x0050 ) -#endif -; - -struct supplementalCredentialsSubBlob { - const char *prefix;/* [value(SUPPLEMENTAL_CREDENTIALS_PREFIX),charset(UTF16)] */ - enum supplementalCredentialsSignature signature;/* [value(SUPPLEMENTAL_CREDENTIALS_SIGNATURE)] */ - uint16_t num_packages; - struct supplementalCredentialsPackage *packages; -}/* [gensize] */; - -struct supplementalCredentialsBlob { - uint32_t unknown1;/* [value(0)] */ - uint32_t __ndr_size;/* [value(ndr_size_supplementalCredentialsSubBlob(&sub,ndr->flags))] */ - uint32_t unknown2;/* [value(0)] */ - struct supplementalCredentialsSubBlob sub;/* [subcontext_size(__ndr_size),subcontext(0)] */ - uint8_t unknown3;/* [value(0)] */ -}/* [public] */; - -struct package_PackagesBlob { - const char ** names;/* [flag(LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING)] */ -}/* [public] */; - -struct package_PrimaryKerberosString { - uint16_t length;/* [value(2*strlen_m(string))] */ - uint16_t size;/* [value(2*strlen_m(string))] */ - const char * string;/* [relative,subcontext_size(size),subcontext(0),flag(LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING)] */ -}; - -struct package_PrimaryKerberosKey3 { - uint16_t reserved1;/* [value(0)] */ - uint16_t reserved2;/* [value(0)] */ - uint32_t reserved3;/* [value(0)] */ - uint32_t keytype; - uint32_t value_len;/* [value((value?value->length:0))] */ - DATA_BLOB *value;/* [relative,subcontext_size(value_len),subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */ -}; - -struct package_PrimaryKerberosCtr3 { - uint16_t num_keys; - uint16_t num_old_keys; - struct package_PrimaryKerberosString salt; - struct package_PrimaryKerberosKey3 *keys; - struct package_PrimaryKerberosKey3 *old_keys; - uint32_t padding1;/* [value(0)] */ - uint32_t padding2;/* [value(0)] */ - uint32_t padding3;/* [value(0)] */ - uint32_t padding4;/* [value(0)] */ - uint32_t padding5;/* [value(0)] */ -}; - -struct package_PrimaryKerberosKey4 { - uint16_t reserved1;/* [value(0)] */ - uint16_t reserved2;/* [value(0)] */ - uint32_t reserved3;/* [value(0)] */ - uint32_t iteration_count; - uint32_t keytype; - uint32_t value_len;/* [value((value?value->length:0))] */ - DATA_BLOB *value;/* [relative,subcontext_size(value_len),subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */ -}; - -struct package_PrimaryKerberosCtr4 { - uint16_t num_keys; - uint16_t num_service_keys;/* [value(0)] */ - uint16_t num_old_keys; - uint16_t num_older_keys; - struct package_PrimaryKerberosString salt; - uint32_t default_iteration_count; - struct package_PrimaryKerberosKey4 *keys; - struct package_PrimaryKerberosKey4 *service_keys; - struct package_PrimaryKerberosKey4 *old_keys; - struct package_PrimaryKerberosKey4 *older_keys; -}; - -union package_PrimaryKerberosCtr { - struct package_PrimaryKerberosCtr3 ctr3;/* [case(3)] */ - struct package_PrimaryKerberosCtr4 ctr4;/* [case(4)] */ -}/* [nodiscriminant] */; - -struct package_PrimaryKerberosBlob { - uint16_t version; - uint16_t flags;/* [value(0)] */ - union package_PrimaryKerberosCtr ctr;/* [switch_is(version)] */ -}/* [public] */; - -struct package_PrimaryCLEARTEXTBlob { - DATA_BLOB cleartext;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}/* [public] */; - -struct package_PrimaryWDigestHash { - uint8_t hash[16]; -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct package_PrimaryWDigestBlob { - uint16_t unknown1;/* [value(0x31)] */ - uint8_t unknown2;/* [value(0x01)] */ - uint8_t num_hashes; - uint32_t unknown3;/* [value(0)] */ - uint64_t uuknown4;/* [value(0)] */ - struct package_PrimaryWDigestHash *hashes; -}/* [public] */; - -struct AuthInfoNone { - uint32_t size;/* [value(0)] */ -}; - -struct AuthInfoNT4Owf { - uint32_t size;/* [value(16)] */ - struct samr_Password password; -}; - -struct AuthInfoClear { - uint32_t size; - uint8_t *password; -}; - -struct AuthInfoVersion { - uint32_t size;/* [value(4)] */ - uint32_t version; -}; - -union AuthInfo { - struct AuthInfoNone none;/* [case(TRUST_AUTH_TYPE_NONE)] */ - struct AuthInfoNT4Owf nt4owf;/* [case(TRUST_AUTH_TYPE_NT4OWF)] */ - struct AuthInfoClear clear;/* [case(TRUST_AUTH_TYPE_CLEAR)] */ - struct AuthInfoVersion version;/* [case(TRUST_AUTH_TYPE_VERSION)] */ -}/* [nodiscriminant] */; - -struct AuthenticationInformation { - NTTIME LastUpdateTime; - enum lsa_TrustAuthType AuthType; - union AuthInfo AuthInfo;/* [switch_is(AuthType)] */ - DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */ -}/* [public] */; - -struct AuthenticationInformationArray { - struct AuthenticationInformation *array;/* [size_is] */ -}/* [noprint,nopush,nopull] */; - -struct trustAuthInOutBlob { - uint32_t count; - struct AuthenticationInformationArray *current;/* [relative] */ - struct AuthenticationInformationArray *previous;/* [relative] */ -}/* [noprint,gensize,nopull,public,nopush] */; - -struct trustCurrentPasswords { - uint32_t count; - struct AuthenticationInformation **current;/* [relative] */ -}/* [gensize,public] */; - -struct trustDomainPasswords { - uint8_t confounder[512]; - struct trustCurrentPasswords outgoing;/* [subcontext_size(outgoing_size),subcontext(0)] */ - struct trustCurrentPasswords incoming;/* [subcontext_size(incoming_size),subcontext(0)] */ - uint32_t outgoing_size;/* [value(ndr_size_trustCurrentPasswords(&outgoing,ndr->flags))] */ - uint32_t incoming_size;/* [value(ndr_size_trustCurrentPasswords(&incoming,ndr->flags))] */ -}/* [public,nopull] */; - -struct DsCompressedChunk { - uint32_t marker; - DATA_BLOB data; -}/* [public] */; - -struct ExtendedErrorAString { - uint16_t __size; - const char *string;/* [unique,charset(DOS),size_is(__size)] */ -}; - -struct ExtendedErrorUString { - uint16_t __size; - const char *string;/* [unique,charset(UTF16),size_is(__size)] */ -}; - -struct ExtendedErrorBlob { - uint16_t length; - uint8_t *data;/* [unique,size_is(length)] */ -}; - -enum ExtendedErrorComputerNamePresent -#ifndef USE_UINT_ENUMS - { - EXTENDED_ERROR_COMPUTER_NAME_PRESENT=1, - EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT=2 -} -#else - { __donnot_use_enum_ExtendedErrorComputerNamePresent=0x7FFFFFFF} -#define EXTENDED_ERROR_COMPUTER_NAME_PRESENT ( 1 ) -#define EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT ( 2 ) -#endif -; - -union ExtendedErrorComputerNameU { - struct ExtendedErrorUString name;/* [case(EXTENDED_ERROR_COMPUTER_NAME_PRESENT)] */ -}/* [switch_type(ExtendedErrorComputerNamePresent)] */; - -struct ExtendedErrorComputerName { - enum ExtendedErrorComputerNamePresent present; - union ExtendedErrorComputerNameU n;/* [switch_is(present)] */ -}; - -enum ExtendedErrorParamType -#ifndef USE_UINT_ENUMS - { - EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING=1, - EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING=2, - EXTENDED_ERROR_PARAM_TYPE_UINT32=3, - EXTENDED_ERROR_PARAM_TYPE_UINT16=4, - EXTENDED_ERROR_PARAM_TYPE_UINT64=5, - EXTENDED_ERROR_PARAM_TYPE_NONE=6, - EXTENDED_ERROR_PARAM_TYPE_BLOB=7 -} -#else - { __donnot_use_enum_ExtendedErrorParamType=0x7FFFFFFF} -#define EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING ( 1 ) -#define EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING ( 2 ) -#define EXTENDED_ERROR_PARAM_TYPE_UINT32 ( 3 ) -#define EXTENDED_ERROR_PARAM_TYPE_UINT16 ( 4 ) -#define EXTENDED_ERROR_PARAM_TYPE_UINT64 ( 5 ) -#define EXTENDED_ERROR_PARAM_TYPE_NONE ( 6 ) -#define EXTENDED_ERROR_PARAM_TYPE_BLOB ( 7 ) -#endif -; - -union ExtendedErrorParamU { - struct ExtendedErrorAString a_string;/* [case(EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING)] */ - struct ExtendedErrorUString u_string;/* [case(EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING)] */ - uint32_t uint32;/* [case(EXTENDED_ERROR_PARAM_TYPE_UINT32)] */ - uint16_t uint16;/* [case(EXTENDED_ERROR_PARAM_TYPE_UINT16)] */ - uint64_t uint64;/* [case(EXTENDED_ERROR_PARAM_TYPE_UINT64)] */ - struct ExtendedErrorBlob blob;/* [case(EXTENDED_ERROR_PARAM_TYPE_BLOB)] */ -}/* [switch_type(ExtendedErrorParamType)] */; - -struct ExtendedErrorParam { - enum ExtendedErrorParamType type; - union ExtendedErrorParamU p;/* [switch_is(type)] */ -}; - -struct ExtendedErrorInfo { - struct ExtendedErrorInfo *next;/* [unique] */ - struct ExtendedErrorComputerName computer_name; - uint64_t pid; - NTTIME time; - uint32_t generating_component; - WERROR status; - uint16_t detection_location; - uint16_t flags; - uint16_t num_params; - struct ExtendedErrorParam *params;/* [size_is(num_params)] */ -}/* [public] */; - -struct ExtendedErrorInfoPtr { - struct ExtendedErrorInfo *info;/* [unique] */ -}; - - -struct decode_replPropertyMetaData { - struct { - struct replPropertyMetaDataBlob blob; - } in; - -}; - - -struct decode_replUpToDateVector { - struct { - struct replUpToDateVectorBlob blob; - } in; - -}; - - -struct decode_repsFromTo { - struct { - struct repsFromToBlob blob; - } in; - -}; - - -struct decode_partialAttributeSet { - struct { - struct partialAttributeSetBlob blob; - } in; - -}; - - -struct decode_prefixMap { - struct { - struct prefixMapBlob blob; - } in; - -}; - - -struct decode_ldapControlDirSync { - struct { - struct ldapControlDirSyncCookie cookie; - } in; - -}; - - -struct decode_supplementalCredentials { - struct { - struct supplementalCredentialsBlob blob; - } in; - -}; - - -struct decode_Packages { - struct { - struct package_PackagesBlob blob; - } in; - -}; - - -struct decode_PrimaryKerberos { - struct { - struct package_PrimaryKerberosBlob blob; - } in; - -}; - - -struct decode_PrimaryCLEARTEXT { - struct { - struct package_PrimaryCLEARTEXTBlob blob; - } in; - -}; - - -struct decode_PrimaryWDigest { - struct { - struct package_PrimaryWDigestBlob blob; - } in; - -}; - - -struct decode_trustAuthInOut { - struct { - struct trustAuthInOutBlob blob; - } in; - -}; - - -struct decode_trustDomainPasswords { - struct { - struct trustDomainPasswords blob; - } in; - -}; - - -struct decode_ExtendedErrorInfo { - struct { - struct ExtendedErrorInfoPtr ptr;/* [subcontext(0xFFFFFC01)] */ - } in; - -}; - -#endif /* _HEADER_drsblobs */ diff --git a/source3/librpc/gen_ndr/drsuapi.h b/source3/librpc/gen_ndr/drsuapi.h deleted file mode 100644 index ba01e8f226..0000000000 --- a/source3/librpc/gen_ndr/drsuapi.h +++ /dev/null @@ -1,1770 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/security.h" -#include "librpc/gen_ndr/misc.h" -#include "librpc/gen_ndr/samr.h" -#ifndef _HEADER_drsuapi -#define _HEADER_drsuapi - -#define DRSUAPI_DS_BIND_GUID ( "e24d201a-4fd6-11d1-a3da-0000f875ae0d" ) -#define DRSUAPI_DS_BIND_GUID_W2K ( "6abec3d1-3054-41c8-a362-5a0c5b7d5d71" ) -#define DRSUAPI_DS_BIND_GUID_W2K3 ( "6afab99c-6e26-464a-975f-f58f105218bc" ) -#define DRSUAPI_DS_MEMBERSHIP_FLAG_GROUP_ATTR ( 0x1 ) -#define DRSUAPI_NTDSDSA_KRB5_SERVICE_GUID ( "E3514235-4B06-11D1-AB04-00C04FC2DCD2" ) -/* bitmap drsuapi_SupportedExtensions */ -#define DRSUAPI_SUPPORTED_EXTENSION_BASE ( 0x00000001 ) -#define DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION ( 0x00000002 ) -#define DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI ( 0x00000004 ) -#define DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2 ( 0x00000008 ) -#define DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS ( 0x00000010 ) -#define DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1 ( 0x00000020 ) -#define DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION ( 0x00000040 ) -#define DRSUAPI_SUPPORTED_EXTENSION_00000080 ( 0x00000080 ) -#define DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE ( 0x00000100 ) -#define DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2 ( 0x00000200 ) -#define DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION ( 0x00000400 ) -#define DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2 ( 0x00000800 ) -#define DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD ( 0x00001000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND ( 0x00002000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO ( 0x00004000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION ( 0x00008000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01 ( 0x00010000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP ( 0x00020000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY ( 0x00040000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3 ( 0x00080000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_00100000 ( 0x00100000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2 ( 0x00200000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6 ( 0x00400000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS ( 0x00800000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8 ( 0x01000000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5 ( 0x02000000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6 ( 0x04000000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3 ( 0x08000000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7 ( 0x08000000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT ( 0x08000000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS ( 0x10000000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_20000000 ( 0x20000000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_40000000 ( 0x40000000 ) -#define DRSUAPI_SUPPORTED_EXTENSION_80000000 ( 0x80000000 ) - -/* bitmap drsuapi_SupportedExtensionsExt */ -#define DRSUAPI_SUPPORTED_EXTENSION_ADAM ( 0x00000001 ) -#define DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2 ( 0x00000002 ) - -struct drsuapi_DsBindInfo24 { - uint32_t supported_extensions; - struct GUID site_guid; - uint32_t pid; -}; - -struct drsuapi_DsBindInfo28 { - uint32_t supported_extensions; - struct GUID site_guid; - uint32_t pid; - uint32_t repl_epoch; -}; - -struct drsuapi_DsBindInfo48 { - uint32_t supported_extensions; - struct GUID site_guid; - uint32_t pid; - uint32_t repl_epoch; - uint32_t supported_extensions_ext; - struct GUID config_dn_guid; -}; - -struct drsuapi_DsBindInfoFallBack { - DATA_BLOB info;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}; - -union drsuapi_DsBindInfo { - struct drsuapi_DsBindInfo24 info24;/* [subcontext(4),case(24)] */ - struct drsuapi_DsBindInfo28 info28;/* [subcontext(4),case(28)] */ - struct drsuapi_DsBindInfo48 info48;/* [subcontext(4),case(48)] */ - struct drsuapi_DsBindInfoFallBack FallBack;/* [subcontext(4),default] */ -}/* [nodiscriminant] */; - -struct drsuapi_DsBindInfoCtr { - uint32_t length;/* [range(1,10000)] */ - union drsuapi_DsBindInfo info;/* [switch_is(length)] */ -}; - -struct drsuapi_DsReplicaObjectIdentifier { - uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r,ndr->flags)-4)] */ - uint32_t __ndr_size_sid;/* [value(ndr_size_dom_sid28(&sid,ndr->flags))] */ - struct GUID guid; - struct dom_sid28 sid; - uint32_t __ndr_size_dn;/* [value(strlen_m(dn))] */ - const char *dn;/* [charset(UTF16),size_is(__ndr_size_dn+1)] */ -}/* [gensize,public] */; - -/* bitmap drsuapi_DsReplicaSyncOptions */ -#define DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION ( 0x00000001 ) -#define DRSUAPI_DS_REPLICA_SYNC_WRITEABLE ( 0x00000002 ) -#define DRSUAPI_DS_REPLICA_SYNC_PERIODIC ( 0x00000004 ) -#define DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING ( 0x00000008 ) -#define DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES ( 0x00000010 ) -#define DRSUAPI_DS_REPLICA_SYNC_FULL ( 0x00000020 ) -#define DRSUAPI_DS_REPLICA_SYNC_URGENT ( 0x00000040 ) -#define DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD ( 0x00000080 ) -#define DRSUAPI_DS_REPLICA_SYNC_FORCE ( 0x00000100 ) -#define DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE ( 0x00000200 ) -#define DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED ( 0x00000400 ) -#define DRSUAPI_DS_REPLICA_SYNC_TWO_WAY ( 0x00000800 ) -#define DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY ( 0x00001000 ) -#define DRSUAPI_DS_REPLICA_SYNC_INITIAL ( 0x00002000 ) -#define DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION ( 0x00004000 ) -#define DRSUAPI_DS_REPLICA_SYNC_ABANDONED ( 0x00008000 ) -#define DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS ( 0x00010000 ) -#define DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET ( 0x00020000 ) -#define DRSUAPI_DS_REPLICA_SYNC_REQUEUE ( 0x00040000 ) -#define DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION ( 0x00080000 ) -#define DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA ( 0x00100000 ) -#define DRSUAPI_DS_REPLICA_SYNC_CRITICAL ( 0x00200000 ) -#define DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS ( 0x00400000 ) -#define DRSUAPI_DS_REPLICA_SYNC_PREEMPTED ( 0x00800000 ) - -struct drsuapi_DsReplicaSyncRequest1 { - struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [unique] */ - struct GUID source_dsa_guid; - const char * other_info;/* [unique,flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t options; -}; - -union drsuapi_DsReplicaSyncRequest { - struct drsuapi_DsReplicaSyncRequest1 req1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsReplicaHighWaterMark { - uint64_t tmp_highest_usn; - uint64_t reserved_usn; - uint64_t highest_usn; -}/* [public] */; - -struct drsuapi_DsReplicaCursor { - struct GUID source_dsa_invocation_id; - uint64_t highest_usn; -}/* [public] */; - -struct drsuapi_DsReplicaCursorCtrEx { - uint32_t version;/* [value] */ - uint32_t reserved1;/* [value(0)] */ - uint32_t count;/* [range(0,0x100000)] */ - uint32_t reserved2;/* [value(0)] */ - struct drsuapi_DsReplicaCursor *cursors;/* [size_is(count)] */ -}; - -/* bitmap drsuapi_DsReplicaNeighbourFlags */ -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE ( 0x00000010 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP ( 0x00000020 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS ( 0x00000040 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT ( 0x00000080 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC ( 0x00000200 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS ( 0x00000800 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS ( 0x00001000 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET ( 0x00002000 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED ( 0x00200000 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED ( 0x01000000 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS ( 0x04000000 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC ( 0x08000000 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES ( 0x10000000 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS ( 0x20000000 ) -#define DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET ( 0x40000000 ) - -enum drsuapi_DsExtendedOperation -#ifndef USE_UINT_ENUMS - { - DRSUAPI_EXOP_NONE=0x00000000, - DRSUAPI_EXOP_FSMO_REQ_ROLE=0x00000001, - DRSUAPI_EXOP_FSMO_RID_ALLOC=0x00000002, - DRSUAPI_EXOP_FSMO_RID_REQ_ROLE=0x00000003, - DRSUAPI_EXOP_FSMO_REQ_PDC=0x00000004, - DRSUAPI_EXOP_FSMO_ABANDON_ROLE=0x00000005, - DRSUAPI_EXOP_REPL_OBJ=0x00000006, - DRSUAPI_EXOP_REPL_SECRET=0x00000007 -} -#else - { __donnot_use_enum_drsuapi_DsExtendedOperation=0x7FFFFFFF} -#define DRSUAPI_EXOP_NONE ( 0x00000000 ) -#define DRSUAPI_EXOP_FSMO_REQ_ROLE ( 0x00000001 ) -#define DRSUAPI_EXOP_FSMO_RID_ALLOC ( 0x00000002 ) -#define DRSUAPI_EXOP_FSMO_RID_REQ_ROLE ( 0x00000003 ) -#define DRSUAPI_EXOP_FSMO_REQ_PDC ( 0x00000004 ) -#define DRSUAPI_EXOP_FSMO_ABANDON_ROLE ( 0x00000005 ) -#define DRSUAPI_EXOP_REPL_OBJ ( 0x00000006 ) -#define DRSUAPI_EXOP_REPL_SECRET ( 0x00000007 ) -#endif -; - -enum drsuapi_DsExtendedError -#ifndef USE_UINT_ENUMS - { - DRSUAPI_EXOP_ERR_NONE=0x00000000, - DRSUAPI_EXOP_ERR_SUCCESS=0x00000001, - DRSUAPI_EXOP_ERR_UNKNOWN_OP=0x00000002, - DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER=0x00000003, - DRSUAPI_EXOP_ERR_UPDATE_ERR=0x00000004, - DRSUAPI_EXOP_ERR_EXCEPTION=0x00000005, - DRSUAPI_EXOP_ERR_UNKNOWN_CALLER=0x00000006, - DRSUAPI_EXOP_ERR_RID_ALLOC=0x00000007, - DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED=0x00000008, - DRSUAPI_EXOP_ERR_FMSO_PENDING_OP=0x00000009, - DRSUAPI_EXOP_ERR_MISMATCH=0x0000000A, - DRSUAPI_EXOP_ERR_COULDNT_CONTACT=0x0000000B, - DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES=0x0000000C, - DRSUAPI_EXOP_ERR_DIR_ERROR=0x0000000D, - DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS=0x0000000E, - DRSUAPI_EXOP_ERR_ACCESS_DENIED=0x0000000F, - DRSUAPI_EXOP_ERR_PARAM_ERROR=0x00000010 -} -#else - { __donnot_use_enum_drsuapi_DsExtendedError=0x7FFFFFFF} -#define DRSUAPI_EXOP_ERR_NONE ( 0x00000000 ) -#define DRSUAPI_EXOP_ERR_SUCCESS ( 0x00000001 ) -#define DRSUAPI_EXOP_ERR_UNKNOWN_OP ( 0x00000002 ) -#define DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER ( 0x00000003 ) -#define DRSUAPI_EXOP_ERR_UPDATE_ERR ( 0x00000004 ) -#define DRSUAPI_EXOP_ERR_EXCEPTION ( 0x00000005 ) -#define DRSUAPI_EXOP_ERR_UNKNOWN_CALLER ( 0x00000006 ) -#define DRSUAPI_EXOP_ERR_RID_ALLOC ( 0x00000007 ) -#define DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED ( 0x00000008 ) -#define DRSUAPI_EXOP_ERR_FMSO_PENDING_OP ( 0x00000009 ) -#define DRSUAPI_EXOP_ERR_MISMATCH ( 0x0000000A ) -#define DRSUAPI_EXOP_ERR_COULDNT_CONTACT ( 0x0000000B ) -#define DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES ( 0x0000000C ) -#define DRSUAPI_EXOP_ERR_DIR_ERROR ( 0x0000000D ) -#define DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS ( 0x0000000E ) -#define DRSUAPI_EXOP_ERR_ACCESS_DENIED ( 0x0000000F ) -#define DRSUAPI_EXOP_ERR_PARAM_ERROR ( 0x00000010 ) -#endif -; - -struct drsuapi_DsGetNCChangesRequest5 { - struct GUID destination_dsa_guid; - struct GUID source_dsa_invocation_id; - struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [ref] */ - struct drsuapi_DsReplicaHighWaterMark highwatermark; - struct drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;/* [unique] */ - uint32_t replica_flags; - uint32_t max_object_count; - uint32_t max_ndr_size; - enum drsuapi_DsExtendedOperation extended_op; - uint64_t fsmo_info; -}; - -struct drsuapi_DsReplicaOID { - uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaOID_oid(oid,0)),range(0,10000)] */ - const char *oid;/* [unique,charset(DOS),size_is(__ndr_size)] */ -}/* [nopush,nopull] */; - -struct drsuapi_DsReplicaOIDMapping { - uint32_t id_prefix; - struct drsuapi_DsReplicaOID oid; -}; - -struct drsuapi_DsReplicaOIDMapping_Ctr { - uint32_t num_mappings;/* [range(0,0x100000)] */ - struct drsuapi_DsReplicaOIDMapping *mappings;/* [unique,size_is(num_mappings)] */ -}/* [public] */; - -enum drsuapi_DsObjectClassId -#ifndef USE_UINT_ENUMS - { - DRSUAPI_OBJECTCLASS_top=0x00010000, - DRSUAPI_OBJECTCLASS_classSchema=0x0003000d, - DRSUAPI_OBJECTCLASS_attributeSchema=0x0003000e -} -#else - { __donnot_use_enum_drsuapi_DsObjectClassId=0x7FFFFFFF} -#define DRSUAPI_OBJECTCLASS_top ( 0x00010000 ) -#define DRSUAPI_OBJECTCLASS_classSchema ( 0x0003000d ) -#define DRSUAPI_OBJECTCLASS_attributeSchema ( 0x0003000e ) -#endif -; - -enum drsuapi_DsAttributeId -#ifndef USE_UINT_ENUMS - { - DRSUAPI_ATTRIBUTE_objectClass=0x00000000, - DRSUAPI_ATTRIBUTE_description=0x0000000d, - DRSUAPI_ATTRIBUTE_member=0x0000001f, - DRSUAPI_ATTRIBUTE_instanceType=0x00020001, - DRSUAPI_ATTRIBUTE_whenCreated=0x00020002, - DRSUAPI_ATTRIBUTE_hasMasterNCs=0x0002000e, - DRSUAPI_ATTRIBUTE_governsID=0x00020016, - DRSUAPI_ATTRIBUTE_attributeID=0x0002001e, - DRSUAPI_ATTRIBUTE_attributeSyntax=0x00020020, - DRSUAPI_ATTRIBUTE_isSingleValued=0x00020021, - DRSUAPI_ATTRIBUTE_rangeLower=0x00020022, - DRSUAPI_ATTRIBUTE_rangeUpper=0x00020023, - DRSUAPI_ATTRIBUTE_dMDLocation=0x00020024, - DRSUAPI_ATTRIBUTE_objectVersion=0x0002004c, - DRSUAPI_ATTRIBUTE_invocationId=0x00020073, - DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly=0x000200a9, - DRSUAPI_ATTRIBUTE_adminDisplayName=0x000200c2, - DRSUAPI_ATTRIBUTE_adminDescription=0x000200e2, - DRSUAPI_ATTRIBUTE_oMSyntax=0x000200e7, - DRSUAPI_ATTRIBUTE_ntSecurityDescriptor=0x00020119, - DRSUAPI_ATTRIBUTE_searchFlags=0x0002014e, - DRSUAPI_ATTRIBUTE_lDAPDisplayName=0x000201cc, - DRSUAPI_ATTRIBUTE_name=0x00090001, - DRSUAPI_ATTRIBUTE_userAccountControl=0x00090008, - DRSUAPI_ATTRIBUTE_currentValue=0x0009001b, - DRSUAPI_ATTRIBUTE_homeDirectory=0x0009002c, - DRSUAPI_ATTRIBUTE_homeDrive=0x0009002d, - DRSUAPI_ATTRIBUTE_scriptPath=0x0009003e, - DRSUAPI_ATTRIBUTE_profilePath=0x0009008b, - DRSUAPI_ATTRIBUTE_objectSid=0x00090092, - DRSUAPI_ATTRIBUTE_schemaIDGUID=0x00090094, - DRSUAPI_ATTRIBUTE_dBCSPwd=0x00090037, - DRSUAPI_ATTRIBUTE_logonHours=0x00090040, - DRSUAPI_ATTRIBUTE_userWorkstations=0x00090056, - DRSUAPI_ATTRIBUTE_unicodePwd=0x0009005a, - DRSUAPI_ATTRIBUTE_ntPwdHistory=0x0009005e, - DRSUAPI_ATTRIBUTE_priorValue=0x00090064, - DRSUAPI_ATTRIBUTE_supplementalCredentials=0x0009007d, - DRSUAPI_ATTRIBUTE_trustAuthIncoming=0x00090081, - DRSUAPI_ATTRIBUTE_trustAuthOutgoing=0x00090087, - DRSUAPI_ATTRIBUTE_lmPwdHistory=0x000900a0, - DRSUAPI_ATTRIBUTE_sAMAccountName=0x000900dd, - DRSUAPI_ATTRIBUTE_sAMAccountType=0x0009012e, - DRSUAPI_ATTRIBUTE_fSMORoleOwner=0x00090171, - DRSUAPI_ATTRIBUTE_systemFlags=0x00090177, - DRSUAPI_ATTRIBUTE_serverReference=0x00090203, - DRSUAPI_ATTRIBUTE_serverReferenceBL=0x00090204, - DRSUAPI_ATTRIBUTE_initialAuthIncoming=0x0009021b, - DRSUAPI_ATTRIBUTE_initialAuthOutgoing=0x0009021c, - DRSUAPI_ATTRIBUTE_wellKnownObjects=0x0009026a, - DRSUAPI_ATTRIBUTE_dNSHostName=0x0009026b, - DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet=0x0009027f, - DRSUAPI_ATTRIBUTE_userPrincipalName=0x00090290, - DRSUAPI_ATTRIBUTE_groupType=0x000902ee, - DRSUAPI_ATTRIBUTE_servicePrincipalName=0x00090303, - DRSUAPI_ATTRIBUTE_objectCategory=0x0009030e, - DRSUAPI_ATTRIBUTE_gPLink=0x0009037b, - DRSUAPI_ATTRIBUTE_msDS_Behavior_Version=0x000905b3, - DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber=0x000906f6, - DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs=0x0009071c, - DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs=0x0009072c -} -#else - { __donnot_use_enum_drsuapi_DsAttributeId=0x7FFFFFFF} -#define DRSUAPI_ATTRIBUTE_objectClass ( 0x00000000 ) -#define DRSUAPI_ATTRIBUTE_description ( 0x0000000d ) -#define DRSUAPI_ATTRIBUTE_member ( 0x0000001f ) -#define DRSUAPI_ATTRIBUTE_instanceType ( 0x00020001 ) -#define DRSUAPI_ATTRIBUTE_whenCreated ( 0x00020002 ) -#define DRSUAPI_ATTRIBUTE_hasMasterNCs ( 0x0002000e ) -#define DRSUAPI_ATTRIBUTE_governsID ( 0x00020016 ) -#define DRSUAPI_ATTRIBUTE_attributeID ( 0x0002001e ) -#define DRSUAPI_ATTRIBUTE_attributeSyntax ( 0x00020020 ) -#define DRSUAPI_ATTRIBUTE_isSingleValued ( 0x00020021 ) -#define DRSUAPI_ATTRIBUTE_rangeLower ( 0x00020022 ) -#define DRSUAPI_ATTRIBUTE_rangeUpper ( 0x00020023 ) -#define DRSUAPI_ATTRIBUTE_dMDLocation ( 0x00020024 ) -#define DRSUAPI_ATTRIBUTE_objectVersion ( 0x0002004c ) -#define DRSUAPI_ATTRIBUTE_invocationId ( 0x00020073 ) -#define DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly ( 0x000200a9 ) -#define DRSUAPI_ATTRIBUTE_adminDisplayName ( 0x000200c2 ) -#define DRSUAPI_ATTRIBUTE_adminDescription ( 0x000200e2 ) -#define DRSUAPI_ATTRIBUTE_oMSyntax ( 0x000200e7 ) -#define DRSUAPI_ATTRIBUTE_ntSecurityDescriptor ( 0x00020119 ) -#define DRSUAPI_ATTRIBUTE_searchFlags ( 0x0002014e ) -#define DRSUAPI_ATTRIBUTE_lDAPDisplayName ( 0x000201cc ) -#define DRSUAPI_ATTRIBUTE_name ( 0x00090001 ) -#define DRSUAPI_ATTRIBUTE_userAccountControl ( 0x00090008 ) -#define DRSUAPI_ATTRIBUTE_currentValue ( 0x0009001b ) -#define DRSUAPI_ATTRIBUTE_homeDirectory ( 0x0009002c ) -#define DRSUAPI_ATTRIBUTE_homeDrive ( 0x0009002d ) -#define DRSUAPI_ATTRIBUTE_scriptPath ( 0x0009003e ) -#define DRSUAPI_ATTRIBUTE_profilePath ( 0x0009008b ) -#define DRSUAPI_ATTRIBUTE_objectSid ( 0x00090092 ) -#define DRSUAPI_ATTRIBUTE_schemaIDGUID ( 0x00090094 ) -#define DRSUAPI_ATTRIBUTE_dBCSPwd ( 0x00090037 ) -#define DRSUAPI_ATTRIBUTE_logonHours ( 0x00090040 ) -#define DRSUAPI_ATTRIBUTE_userWorkstations ( 0x00090056 ) -#define DRSUAPI_ATTRIBUTE_unicodePwd ( 0x0009005a ) -#define DRSUAPI_ATTRIBUTE_ntPwdHistory ( 0x0009005e ) -#define DRSUAPI_ATTRIBUTE_priorValue ( 0x00090064 ) -#define DRSUAPI_ATTRIBUTE_supplementalCredentials ( 0x0009007d ) -#define DRSUAPI_ATTRIBUTE_trustAuthIncoming ( 0x00090081 ) -#define DRSUAPI_ATTRIBUTE_trustAuthOutgoing ( 0x00090087 ) -#define DRSUAPI_ATTRIBUTE_lmPwdHistory ( 0x000900a0 ) -#define DRSUAPI_ATTRIBUTE_sAMAccountName ( 0x000900dd ) -#define DRSUAPI_ATTRIBUTE_sAMAccountType ( 0x0009012e ) -#define DRSUAPI_ATTRIBUTE_fSMORoleOwner ( 0x00090171 ) -#define DRSUAPI_ATTRIBUTE_systemFlags ( 0x00090177 ) -#define DRSUAPI_ATTRIBUTE_serverReference ( 0x00090203 ) -#define DRSUAPI_ATTRIBUTE_serverReferenceBL ( 0x00090204 ) -#define DRSUAPI_ATTRIBUTE_initialAuthIncoming ( 0x0009021b ) -#define DRSUAPI_ATTRIBUTE_initialAuthOutgoing ( 0x0009021c ) -#define DRSUAPI_ATTRIBUTE_wellKnownObjects ( 0x0009026a ) -#define DRSUAPI_ATTRIBUTE_dNSHostName ( 0x0009026b ) -#define DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet ( 0x0009027f ) -#define DRSUAPI_ATTRIBUTE_userPrincipalName ( 0x00090290 ) -#define DRSUAPI_ATTRIBUTE_groupType ( 0x000902ee ) -#define DRSUAPI_ATTRIBUTE_servicePrincipalName ( 0x00090303 ) -#define DRSUAPI_ATTRIBUTE_objectCategory ( 0x0009030e ) -#define DRSUAPI_ATTRIBUTE_gPLink ( 0x0009037b ) -#define DRSUAPI_ATTRIBUTE_msDS_Behavior_Version ( 0x000905b3 ) -#define DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber ( 0x000906f6 ) -#define DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs ( 0x0009071c ) -#define DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs ( 0x0009072c ) -#endif -; - -struct drsuapi_DsPartialAttributeSet { - uint32_t version;/* [value] */ - uint32_t reserved1;/* [value(0)] */ - uint32_t num_attids;/* [range(1,0x100000)] */ - enum drsuapi_DsAttributeId *attids;/* [size_is(num_attids)] */ -}; - -struct drsuapi_DsGetNCChangesRequest8 { - struct GUID destination_dsa_guid; - struct GUID source_dsa_invocation_id; - struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [ref] */ - struct drsuapi_DsReplicaHighWaterMark highwatermark; - struct drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;/* [unique] */ - uint32_t replica_flags; - uint32_t max_object_count; - uint32_t max_ndr_size; - enum drsuapi_DsExtendedOperation extended_op; - uint64_t fsmo_info; - struct drsuapi_DsPartialAttributeSet *partial_attribute_set;/* [unique] */ - struct drsuapi_DsPartialAttributeSet *partial_attribute_set_ex;/* [unique] */ - struct drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; -}; - -union drsuapi_DsGetNCChangesRequest { - struct drsuapi_DsGetNCChangesRequest5 req5;/* [case(5)] */ - struct drsuapi_DsGetNCChangesRequest8 req8;/* [case(8)] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsReplicaCursor2 { - struct GUID source_dsa_invocation_id; - uint64_t highest_usn; - NTTIME last_sync_success; -}/* [public] */; - -struct drsuapi_DsReplicaCursor2CtrEx { - uint32_t version;/* [value(2)] */ - uint32_t reserved1;/* [value(0)] */ - uint32_t count;/* [range(0,0x100000)] */ - uint32_t reserved2;/* [value(0)] */ - struct drsuapi_DsReplicaCursor2 *cursors;/* [size_is(count)] */ -}; - -struct drsuapi_DsAttributeValue { - uint32_t __ndr_size;/* [value(ndr_size_DATA_BLOB(0,blob,0)),range(0,10485760)] */ - DATA_BLOB *blob;/* [unique] */ -}; - -struct drsuapi_DsAttributeValueCtr { - uint32_t num_values;/* [range(0,10485760)] */ - struct drsuapi_DsAttributeValue *values;/* [unique,size_is(num_values)] */ -}; - -struct drsuapi_DsReplicaObjectIdentifier3 { - uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r,ndr->flags))] */ - uint32_t __ndr_size_sid;/* [value(ndr_size_dom_sid28(&sid,ndr->flags))] */ - struct GUID guid; - struct dom_sid28 sid; - uint32_t __ndr_size_dn;/* [value(strlen_m(dn))] */ - const char *dn;/* [charset(UTF16)] */ -}/* [gensize,public] */; - -struct drsuapi_DsReplicaObjectIdentifier3Binary { - uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r,ndr->flags))] */ - uint32_t __ndr_size_sid;/* [value(ndr_size_dom_sid28(&sid,ndr->flags))] */ - struct GUID guid; - struct dom_sid28 sid; - uint32_t __ndr_size_dn;/* [value(strlen_m(dn))] */ - const char *dn;/* [charset(UTF16)] */ - uint32_t __ndr_size_binary;/* [value(binary.length+4)] */ - DATA_BLOB binary;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}/* [gensize,public] */; - -struct drsuapi_DsReplicaAttribute { - enum drsuapi_DsAttributeId attid; - struct drsuapi_DsAttributeValueCtr value_ctr; -}/* [public] */; - -struct drsuapi_DsReplicaAttributeCtr { - uint32_t num_attributes;/* [range(0,1048576)] */ - struct drsuapi_DsReplicaAttribute *attributes;/* [unique,size_is(num_attributes)] */ -}; - -/* bitmap drsuapi_DsReplicaObjectFlags */ -#define DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER ( 0x00000001 ) -#define DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC ( 0x00000002 ) -#define DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY ( 0x00010000 ) - -struct drsuapi_DsReplicaObject { - struct drsuapi_DsReplicaObjectIdentifier *identifier;/* [unique] */ - uint32_t flags; - struct drsuapi_DsReplicaAttributeCtr attribute_ctr; -}/* [public] */; - -struct drsuapi_DsReplicaMetaData { - uint32_t version; - NTTIME originating_change_time; - struct GUID originating_invocation_id; - uint64_t originating_usn; -}; - -struct drsuapi_DsReplicaMetaDataCtr { - uint32_t count;/* [range(0,1048576)] */ - struct drsuapi_DsReplicaMetaData *meta_data;/* [size_is(count)] */ -}/* [public] */; - -struct drsuapi_DsReplicaObjectListItemEx { - struct drsuapi_DsReplicaObjectListItemEx *next_object;/* [unique] */ - struct drsuapi_DsReplicaObject object; - uint32_t is_nc_prefix; - struct GUID *parent_object_guid;/* [unique] */ - struct drsuapi_DsReplicaMetaDataCtr *meta_data_ctr;/* [unique] */ -}/* [noprint,public] */; - -struct drsuapi_DsGetNCChangesCtr1 { - struct GUID source_dsa_guid; - struct GUID source_dsa_invocation_id; - struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [unique] */ - struct drsuapi_DsReplicaHighWaterMark old_highwatermark; - struct drsuapi_DsReplicaHighWaterMark new_highwatermark; - struct drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;/* [unique] */ - struct drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; - enum drsuapi_DsExtendedError extended_ret; - uint32_t object_count; - uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->flags)+55)] */ - struct drsuapi_DsReplicaObjectListItemEx *first_object;/* [unique] */ - uint32_t more_data; -}/* [gensize,public] */; - -/* bitmap drsuapi_DsLinkedAttributeFlags */ -#define DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE ( 0x00000001 ) - -struct drsuapi_DsReplicaLinkedAttribute { - struct drsuapi_DsReplicaObjectIdentifier *identifier;/* [unique] */ - enum drsuapi_DsAttributeId attid; - struct drsuapi_DsAttributeValue value; - uint32_t flags; - NTTIME originating_add_time; - struct drsuapi_DsReplicaMetaData meta_data; -}/* [public] */; - -struct drsuapi_DsGetNCChangesCtr6 { - struct GUID source_dsa_guid; - struct GUID source_dsa_invocation_id; - struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [unique] */ - struct drsuapi_DsReplicaHighWaterMark old_highwatermark; - struct drsuapi_DsReplicaHighWaterMark new_highwatermark; - struct drsuapi_DsReplicaCursor2CtrEx *uptodateness_vector;/* [unique] */ - struct drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr; - enum drsuapi_DsExtendedError extended_ret; - uint32_t object_count; - uint32_t __ndr_size;/* [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->flags)+55)] */ - struct drsuapi_DsReplicaObjectListItemEx *first_object;/* [unique] */ - uint32_t more_data; - uint32_t nc_object_count; - uint32_t nc_linked_attributes_count; - uint32_t linked_attributes_count;/* [range(0,1048576)] */ - struct drsuapi_DsReplicaLinkedAttribute *linked_attributes;/* [unique,size_is(linked_attributes_count)] */ - WERROR drs_error; -}/* [gensize,public] */; - -struct drsuapi_DsGetNCChangesCtr1TS { - struct drsuapi_DsGetNCChangesCtr1 ctr1;/* [subcontext(0xFFFFFC01)] */ -}/* [public] */; - -struct drsuapi_DsGetNCChangesCtr6TS { - struct drsuapi_DsGetNCChangesCtr6 ctr6;/* [subcontext(0xFFFFFC01)] */ -}/* [public] */; - -struct drsuapi_DsGetNCChangesMSZIPCtr1 { - uint32_t decompressed_length; - uint32_t compressed_length; - struct drsuapi_DsGetNCChangesCtr1TS *ts;/* [unique,compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */ -}/* [nopush] */; - -struct drsuapi_DsGetNCChangesMSZIPCtr6 { - uint32_t decompressed_length; - uint32_t compressed_length; - struct drsuapi_DsGetNCChangesCtr6TS *ts;/* [unique,compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */ -}/* [nopush] */; - -struct drsuapi_DsGetNCChangesXPRESSCtr1 { - uint32_t decompressed_length; - uint32_t compressed_length; - struct drsuapi_DsGetNCChangesCtr1TS *ts;/* [unique,compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */ -}/* [nopush] */; - -struct drsuapi_DsGetNCChangesXPRESSCtr6 { - uint32_t decompressed_length; - uint32_t compressed_length; - struct drsuapi_DsGetNCChangesCtr6TS *ts;/* [unique,compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */ -}/* [nopush] */; - -enum drsuapi_DsGetNCChangesCompressionType -#ifndef USE_UINT_ENUMS - { - DRSUAPI_COMPRESSION_TYPE_MSZIP=2, - DRSUAPI_COMPRESSION_TYPE_XPRESS=3 -} -#else - { __donnot_use_enum_drsuapi_DsGetNCChangesCompressionType=0x7FFFFFFF} -#define DRSUAPI_COMPRESSION_TYPE_MSZIP ( 2 ) -#define DRSUAPI_COMPRESSION_TYPE_XPRESS ( 3 ) -#endif -; - -union drsuapi_DsGetNCChangesCompressedCtr { - struct drsuapi_DsGetNCChangesMSZIPCtr1 mszip1;/* [case(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] */ - struct drsuapi_DsGetNCChangesMSZIPCtr6 mszip6;/* [case(6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] */ - struct drsuapi_DsGetNCChangesXPRESSCtr1 xpress1;/* [case(1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] */ - struct drsuapi_DsGetNCChangesXPRESSCtr6 xpress6;/* [case(6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] */ -}/* [nodiscriminant,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct drsuapi_DsGetNCChangesCtr2 { - struct drsuapi_DsGetNCChangesMSZIPCtr1 mszip1; -}; - -struct drsuapi_DsGetNCChangesCtr7 { - int32_t level;/* [range(0,6)] */ - enum drsuapi_DsGetNCChangesCompressionType type;/* [range(2,3)] */ - union drsuapi_DsGetNCChangesCompressedCtr ctr;/* [switch_is(level|(type<<16))] */ -}; - -union drsuapi_DsGetNCChangesCtr { - struct drsuapi_DsGetNCChangesCtr1 ctr1;/* [case] */ - struct drsuapi_DsGetNCChangesCtr2 ctr2;/* [case(2)] */ - struct drsuapi_DsGetNCChangesCtr6 ctr6;/* [case(6)] */ - struct drsuapi_DsGetNCChangesCtr7 ctr7;/* [case(7)] */ -}/* [switch_type(int32)] */; - -/* bitmap drsuapi_DsReplicaUpdateRefsOptions */ -#define DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION ( 0x00000001 ) -#define DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE ( 0x00000002 ) -#define DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE ( 0x00000004 ) -#define DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE ( 0x00000008 ) -#define DRSUAPI_DS_REPLICA_UPDATE_0x00000010 ( 0x00000010 ) - -struct drsuapi_DsReplicaUpdateRefsRequest1 { - struct drsuapi_DsReplicaObjectIdentifier *naming_context;/* [ref] */ - const char *dest_dsa_dns_name;/* [ref,charset(DOS)] */ - struct GUID dest_dsa_guid; - uint32_t options; -}; - -union drsuapi_DsReplicaUpdateRefsRequest { - struct drsuapi_DsReplicaUpdateRefsRequest1 req1;/* [case] */ -}/* [switch_type(int32)] */; - -/* bitmap drsuapi_DsReplicaAddOptions */ -#define DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION ( 0x00000001 ) -#define DRSUAPI_DS_REPLICA_ADD_WRITEABLE ( 0x00000002 ) - -/* bitmap drsuapi_DsReplicaDeleteOptions */ -#define DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION ( 0x00000001 ) -#define DRSUAPI_DS_REPLICA_DELETE_WRITEABLE ( 0x00000002 ) - -/* bitmap drsuapi_DsReplicaModifyOptions */ -#define DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION ( 0x00000001 ) -#define DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE ( 0x00000002 ) - -enum drsuapi_DsMembershipType -#ifndef USE_UINT_ENUMS - { - DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS=1, - DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS=2, - DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS=3, - DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2=4, - DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS=5, - DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS=6, - DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2=7 -} -#else - { __donnot_use_enum_drsuapi_DsMembershipType=0x7FFFFFFF} -#define DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS ( 1 ) -#define DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS ( 2 ) -#define DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS ( 3 ) -#define DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2 ( 4 ) -#define DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS ( 5 ) -#define DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS ( 6 ) -#define DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2 ( 7 ) -#endif -; - -struct drsuapi_DsGetMembershipsCtr1 { - NTSTATUS status; - uint32_t num_memberships;/* [range(0,10000)] */ - uint32_t num_sids;/* [range(0,10000)] */ - struct drsuapi_DsReplicaObjectIdentifier **info_array;/* [unique,size_is(num_memberships)] */ - uint32_t *group_attrs;/* [unique,size_is(num_memberships)] */ - struct dom_sid28 **sids;/* [unique,size_is(num_sids)] */ -}; - -union drsuapi_DsGetMembershipsCtr { - struct drsuapi_DsGetMembershipsCtr1 ctr1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsGetMembershipsRequest1 { - uint32_t count;/* [range(1,10000)] */ - struct drsuapi_DsReplicaObjectIdentifier **info_array;/* [unique,size_is(count)] */ - uint32_t flags; - enum drsuapi_DsMembershipType type; - struct drsuapi_DsReplicaObjectIdentifier *domain;/* [unique] */ -}; - -union drsuapi_DsGetMembershipsRequest { - struct drsuapi_DsGetMembershipsRequest1 req1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsGetNT4ChangeLogRequest1 { - uint32_t unknown1; - uint32_t unknown2; - uint32_t length;/* [range(0,0x00A00000)] */ - uint8_t *data;/* [unique,size_is(length)] */ -}; - -union drsuapi_DsGetNT4ChangeLogRequest { - struct drsuapi_DsGetNT4ChangeLogRequest1 req1;/* [case] */ -}/* [switch_type(uint32)] */; - -struct drsuapi_DsGetNT4ChangeLogInfo1 { - uint32_t length1;/* [range(0,0x00A00000)] */ - uint32_t length2;/* [range(0,0x00A00000)] */ - uint64_t unknown1; - NTTIME time2; - uint64_t unknown3; - NTTIME time4; - uint64_t unknown5; - NTTIME time6; - NTSTATUS status; - uint8_t *data1;/* [unique,size_is(length1)] */ - uint8_t *data2;/* [unique,size_is(length2)] */ -}; - -union drsuapi_DsGetNT4ChangeLogInfo { - struct drsuapi_DsGetNT4ChangeLogInfo1 info1;/* [case] */ -}/* [switch_type(uint32)] */; - -enum drsuapi_DsNameStatus -#ifndef USE_UINT_ENUMS - { - DRSUAPI_DS_NAME_STATUS_OK=0, - DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR=1, - DRSUAPI_DS_NAME_STATUS_NOT_FOUND=2, - DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE=3, - DRSUAPI_DS_NAME_STATUS_NO_MAPPING=4, - DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY=5, - DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING=6, - DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL=7 -} -#else - { __donnot_use_enum_drsuapi_DsNameStatus=0x7FFFFFFF} -#define DRSUAPI_DS_NAME_STATUS_OK ( 0 ) -#define DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR ( 1 ) -#define DRSUAPI_DS_NAME_STATUS_NOT_FOUND ( 2 ) -#define DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE ( 3 ) -#define DRSUAPI_DS_NAME_STATUS_NO_MAPPING ( 4 ) -#define DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY ( 5 ) -#define DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING ( 6 ) -#define DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL ( 7 ) -#endif -; - -enum drsuapi_DsNameFlags -#ifndef USE_UINT_ENUMS - { - DRSUAPI_DS_NAME_FLAG_NO_FLAGS=0x0, - DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY=0x1, - DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC=0x2, - DRSUAPI_DS_NAME_FLAG_GCVERIFY=0x4, - DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL=0x8 -} -#else - { __donnot_use_enum_drsuapi_DsNameFlags=0x7FFFFFFF} -#define DRSUAPI_DS_NAME_FLAG_NO_FLAGS ( 0x0 ) -#define DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY ( 0x1 ) -#define DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC ( 0x2 ) -#define DRSUAPI_DS_NAME_FLAG_GCVERIFY ( 0x4 ) -#define DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL ( 0x8 ) -#endif -; - -enum drsuapi_DsNameFormat -#ifndef USE_UINT_ENUMS - { - DRSUAPI_DS_NAME_FORMAT_UNKNOWN=0, - DRSUAPI_DS_NAME_FORMAT_FQDN_1779=1, - DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT=2, - DRSUAPI_DS_NAME_FORMAT_DISPLAY=3, - DRSUAPI_DS_NAME_FORMAT_GUID=6, - DRSUAPI_DS_NAME_FORMAT_CANONICAL=7, - DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL=8, - DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX=9, - DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL=10, - DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY=11, - DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN=12 -} -#else - { __donnot_use_enum_drsuapi_DsNameFormat=0x7FFFFFFF} -#define DRSUAPI_DS_NAME_FORMAT_UNKNOWN ( 0 ) -#define DRSUAPI_DS_NAME_FORMAT_FQDN_1779 ( 1 ) -#define DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT ( 2 ) -#define DRSUAPI_DS_NAME_FORMAT_DISPLAY ( 3 ) -#define DRSUAPI_DS_NAME_FORMAT_GUID ( 6 ) -#define DRSUAPI_DS_NAME_FORMAT_CANONICAL ( 7 ) -#define DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL ( 8 ) -#define DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX ( 9 ) -#define DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL ( 10 ) -#define DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY ( 11 ) -#define DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN ( 12 ) -#endif -; - -struct drsuapi_DsNameString { - const char *str;/* [unique,charset(UTF16)] */ -}; - -struct drsuapi_DsNameRequest1 { - uint32_t codepage; - uint32_t language; - enum drsuapi_DsNameFlags format_flags; - enum drsuapi_DsNameFormat format_offered; - enum drsuapi_DsNameFormat format_desired; - uint32_t count;/* [range(1,10000)] */ - struct drsuapi_DsNameString *names;/* [unique,size_is(count)] */ -}; - -union drsuapi_DsNameRequest { - struct drsuapi_DsNameRequest1 req1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsNameInfo1 { - enum drsuapi_DsNameStatus status; - const char *dns_domain_name;/* [unique,charset(UTF16)] */ - const char *result_name;/* [unique,charset(UTF16)] */ -}; - -struct drsuapi_DsNameCtr1 { - uint32_t count; - struct drsuapi_DsNameInfo1 *array;/* [unique,size_is(count)] */ -}; - -union drsuapi_DsNameCtr { - struct drsuapi_DsNameCtr1 *ctr1;/* [unique,case] */ -}/* [switch_type(int32)] */; - -enum drsuapi_DsSpnOperation -#ifndef USE_UINT_ENUMS - { - DRSUAPI_DS_SPN_OPERATION_ADD=0, - DRSUAPI_DS_SPN_OPERATION_REPLACE=1, - DRSUAPI_DS_SPN_OPERATION_DELETE=2 -} -#else - { __donnot_use_enum_drsuapi_DsSpnOperation=0x7FFFFFFF} -#define DRSUAPI_DS_SPN_OPERATION_ADD ( 0 ) -#define DRSUAPI_DS_SPN_OPERATION_REPLACE ( 1 ) -#define DRSUAPI_DS_SPN_OPERATION_DELETE ( 2 ) -#endif -; - -struct drsuapi_DsWriteAccountSpnRequest1 { - enum drsuapi_DsSpnOperation operation; - uint32_t unknown1; - const char *object_dn;/* [unique,charset(UTF16)] */ - uint32_t count;/* [range(0,10000)] */ - struct drsuapi_DsNameString *spn_names;/* [unique,size_is(count)] */ -}; - -union drsuapi_DsWriteAccountSpnRequest { - struct drsuapi_DsWriteAccountSpnRequest1 req1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsWriteAccountSpnResult1 { - WERROR status; -}; - -union drsuapi_DsWriteAccountSpnResult { - struct drsuapi_DsWriteAccountSpnResult1 res1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsRemoveDSServerRequest1 { - const char *server_dn;/* [unique,charset(UTF16)] */ - const char *domain_dn;/* [unique,charset(UTF16)] */ - uint32_t commit; -}; - -union drsuapi_DsRemoveDSServerRequest { - struct drsuapi_DsRemoveDSServerRequest1 req1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsRemoveDSServerResult1 { - uint32_t last_dc_in_domain; -}; - -union drsuapi_DsRemoveDSServerResult { - struct drsuapi_DsRemoveDSServerResult1 res1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsGetDCInfoRequest1 { - const char *domain_name;/* [unique,charset(UTF16)] */ - int32_t level; -}; - -union drsuapi_DsGetDCInfoRequest { - struct drsuapi_DsGetDCInfoRequest1 req1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsGetDCInfo1 { - const char *netbios_name;/* [unique,charset(UTF16)] */ - const char *dns_name;/* [unique,charset(UTF16)] */ - const char *site_name;/* [unique,charset(UTF16)] */ - const char *computer_dn;/* [unique,charset(UTF16)] */ - const char *server_dn;/* [unique,charset(UTF16)] */ - uint32_t is_pdc; - uint32_t is_enabled; -}; - -struct drsuapi_DsGetDCInfoCtr1 { - uint32_t count;/* [range(0,10000)] */ - struct drsuapi_DsGetDCInfo1 *array;/* [unique,size_is(count)] */ -}; - -struct drsuapi_DsGetDCInfo2 { - const char *netbios_name;/* [unique,charset(UTF16)] */ - const char *dns_name;/* [unique,charset(UTF16)] */ - const char *site_name;/* [unique,charset(UTF16)] */ - const char *site_dn;/* [unique,charset(UTF16)] */ - const char *computer_dn;/* [unique,charset(UTF16)] */ - const char *server_dn;/* [unique,charset(UTF16)] */ - const char *ntds_dn;/* [unique,charset(UTF16)] */ - uint32_t is_pdc; - uint32_t is_enabled; - uint32_t is_gc; - struct GUID site_guid; - struct GUID computer_guid; - struct GUID server_guid; - struct GUID ntds_guid; -}; - -struct drsuapi_DsGetDCInfoCtr2 { - uint32_t count;/* [range(0,10000)] */ - struct drsuapi_DsGetDCInfo2 *array;/* [unique,size_is(count)] */ -}; - -struct drsuapi_DsGetDCInfo3 { - const char *netbios_name;/* [unique,charset(UTF16)] */ - const char *dns_name;/* [unique,charset(UTF16)] */ - const char *site_name;/* [unique,charset(UTF16)] */ - const char *site_dn;/* [unique,charset(UTF16)] */ - const char *computer_dn;/* [unique,charset(UTF16)] */ - const char *server_dn;/* [unique,charset(UTF16)] */ - const char *ntds_dn;/* [unique,charset(UTF16)] */ - uint32_t is_pdc; - uint32_t is_enabled; - uint32_t is_gc; - uint32_t is_rodc; - struct GUID site_guid; - struct GUID computer_guid; - struct GUID server_guid; - struct GUID ntds_guid; -}; - -struct drsuapi_DsGetDCInfoCtr3 { - uint32_t count;/* [range(0,10000)] */ - struct drsuapi_DsGetDCInfo3 *array;/* [unique,size_is(count)] */ -}; - -struct drsuapi_DsGetDCConnection01 { - const char * client_ip_address;/* [flag(LIBNDR_FLAG_BIGENDIAN)] */ - uint32_t unknown2; - uint32_t connection_time; - uint32_t unknown4; - uint32_t unknown5; - uint32_t unknown6; - const char *client_account;/* [unique,charset(UTF16)] */ -}; - -struct drsuapi_DsGetDCConnectionCtr01 { - uint32_t count;/* [range(0,10000)] */ - struct drsuapi_DsGetDCConnection01 *array;/* [unique,size_is(count)] */ -}; - -enum drsuapi_DsGetDCInfoCtrLevels -#ifndef USE_UINT_ENUMS - { - DRSUAPI_DC_INFO_CTR_1=1, - DRSUAPI_DC_INFO_CTR_2=2, - DRSUAPI_DC_INFO_CTR_3=3, - DRSUAPI_DC_CONNECTION_CTR_01=-1 -} -#else - { __donnot_use_enum_drsuapi_DsGetDCInfoCtrLevels=0x7FFFFFFF} -#define DRSUAPI_DC_INFO_CTR_1 ( 1 ) -#define DRSUAPI_DC_INFO_CTR_2 ( 2 ) -#define DRSUAPI_DC_INFO_CTR_3 ( 3 ) -#define DRSUAPI_DC_CONNECTION_CTR_01 ( -1 ) -#endif -; - -union drsuapi_DsGetDCInfoCtr { - struct drsuapi_DsGetDCInfoCtr1 ctr1;/* [case(DRSUAPI_DC_INFO_CTR_1)] */ - struct drsuapi_DsGetDCInfoCtr2 ctr2;/* [case(DRSUAPI_DC_INFO_CTR_2)] */ - struct drsuapi_DsGetDCInfoCtr3 ctr3;/* [case(DRSUAPI_DC_INFO_CTR_3)] */ - struct drsuapi_DsGetDCConnectionCtr01 ctr01;/* [case(DRSUAPI_DC_CONNECTION_CTR_01)] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsReplicaObjectListItem { - struct drsuapi_DsReplicaObjectListItem *next_object;/* [unique] */ - struct drsuapi_DsReplicaObject object; -}/* [noprint,public] */; - -struct drsuapi_DsAddEntryRequest2 { - struct drsuapi_DsReplicaObjectListItem first_object; -}; - -union drsuapi_DsAddEntryRequest { - struct drsuapi_DsAddEntryRequest2 req2;/* [case(2)] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsAddEntryErrorInfoX { - uint32_t unknown1; - WERROR status; - uint32_t unknown2; - uint16_t unknown3; -}; - -struct drsuapi_DsAddEntryExtraErrorBuffer { - uint32_t size;/* [range(0,10485760)] */ - uint8_t *data;/* [unique,size_is(size)] */ -}; - -struct drsuapi_DsAddEntryExtraError1 { - struct drsuapi_DsAddEntryErrorInfoX error; - enum drsuapi_DsAttributeId attid; - uint32_t unknown2; - struct drsuapi_DsAddEntryExtraErrorBuffer buffer; -}; - -struct drsuapi_DsAddEntryErrorListItem1 { - struct drsuapi_DsAddEntryErrorListItem1 *next;/* [unique] */ - struct drsuapi_DsAddEntryExtraError1 error; -}; - -struct drsuapi_DsAddEntryErrorInfo1 { - struct drsuapi_DsReplicaObjectIdentifier *id;/* [unique] */ - WERROR status; - struct drsuapi_DsAddEntryErrorListItem1 first; -}; - -union drsuapi_DsAddEntryErrorInfo { - struct drsuapi_DsAddEntryErrorInfo1 error1;/* [case] */ - struct drsuapi_DsAddEntryErrorInfoX errorX;/* [case(4)] */ -}/* [switch_type(uint32)] */; - -struct drsuapi_DsAddEntryError1 { - WERROR status; - uint32_t level; - union drsuapi_DsAddEntryErrorInfo *info;/* [unique,switch_is(level)] */ -}; - -union drsuapi_DsAddEntryError { - struct drsuapi_DsAddEntryError1 info1;/* [case] */ -}/* [switch_type(uint32)] */; - -struct drsuapi_DsReplicaObjectIdentifier2 { - struct GUID guid; - struct dom_sid28 sid; -}; - -struct drsuapi_DsAddEntryCtr2 { - struct drsuapi_DsReplicaObjectIdentifier *id;/* [unique] */ - uint32_t unknown1; - struct drsuapi_DsAddEntryErrorInfoX error; - uint32_t count;/* [range(0,10000)] */ - struct drsuapi_DsReplicaObjectIdentifier2 *objects;/* [unique,size_is(count)] */ -}; - -struct drsuapi_DsAddEntryCtr3 { - struct drsuapi_DsReplicaObjectIdentifier *id;/* [unique] */ - uint32_t level; - union drsuapi_DsAddEntryError *error;/* [unique,switch_is(level)] */ - uint32_t count;/* [range(0,10000)] */ - struct drsuapi_DsReplicaObjectIdentifier2 *objects;/* [unique,size_is(count)] */ -}; - -union drsuapi_DsAddEntryCtr { - struct drsuapi_DsAddEntryCtr2 ctr2;/* [case(2)] */ - struct drsuapi_DsAddEntryCtr3 ctr3;/* [case(3)] */ -}/* [switch_type(int32)] */; - -enum drsuapi_DsReplicaGetInfoLevel -#ifndef USE_UINT_ENUMS - { - DRSUAPI_DS_REPLICA_GET_INFO=1, - DRSUAPI_DS_REPLICA_GET_INFO2=2 -} -#else - { __donnot_use_enum_drsuapi_DsReplicaGetInfoLevel=0x7FFFFFFF} -#define DRSUAPI_DS_REPLICA_GET_INFO ( 1 ) -#define DRSUAPI_DS_REPLICA_GET_INFO2 ( 2 ) -#endif -; - -enum drsuapi_DsReplicaInfoType -#ifndef USE_UINT_ENUMS - { - DRSUAPI_DS_REPLICA_INFO_NEIGHBORS=0, - DRSUAPI_DS_REPLICA_INFO_CURSORS=1, - DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA=2, - DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES=3, - DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES=4, - DRSUAPI_DS_REPLICA_INFO_PENDING_OPS=5, - DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA=6, - DRSUAPI_DS_REPLICA_INFO_CURSORS2=7, - DRSUAPI_DS_REPLICA_INFO_CURSORS3=8, - DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2=9, - DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2=10, - DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02=-2, - DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04=-4, - DRSUAPI_DS_REPLICA_INFO_CURSORS05=-5, - DRSUAPI_DS_REPLICA_INFO_06=-6 -} -#else - { __donnot_use_enum_drsuapi_DsReplicaInfoType=0x7FFFFFFF} -#define DRSUAPI_DS_REPLICA_INFO_NEIGHBORS ( 0 ) -#define DRSUAPI_DS_REPLICA_INFO_CURSORS ( 1 ) -#define DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA ( 2 ) -#define DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES ( 3 ) -#define DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES ( 4 ) -#define DRSUAPI_DS_REPLICA_INFO_PENDING_OPS ( 5 ) -#define DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA ( 6 ) -#define DRSUAPI_DS_REPLICA_INFO_CURSORS2 ( 7 ) -#define DRSUAPI_DS_REPLICA_INFO_CURSORS3 ( 8 ) -#define DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2 ( 9 ) -#define DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2 ( 10 ) -#define DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02 ( -2 ) -#define DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04 ( -4 ) -#define DRSUAPI_DS_REPLICA_INFO_CURSORS05 ( -5 ) -#define DRSUAPI_DS_REPLICA_INFO_06 ( -6 ) -#endif -; - -struct drsuapi_DsReplicaGetInfoRequest1 { - enum drsuapi_DsReplicaInfoType info_type; - const char *object_dn;/* [unique,charset(UTF16)] */ - struct GUID guid1; -}; - -struct drsuapi_DsReplicaGetInfoRequest2 { - enum drsuapi_DsReplicaInfoType info_type; - const char *object_dn;/* [unique,charset(UTF16)] */ - struct GUID guid1; - uint32_t unknown1; - const char *string1;/* [unique,charset(UTF16)] */ - const char *string2;/* [unique,charset(UTF16)] */ - uint32_t unknown2; -}; - -union drsuapi_DsReplicaGetInfoRequest { - struct drsuapi_DsReplicaGetInfoRequest1 req1;/* [case(DRSUAPI_DS_REPLICA_GET_INFO)] */ - struct drsuapi_DsReplicaGetInfoRequest2 req2;/* [case(DRSUAPI_DS_REPLICA_GET_INFO2)] */ -}/* [switch_type(drsuapi_DsReplicaGetInfoLevel)] */; - -struct drsuapi_DsReplicaNeighbour { - const char *naming_context_dn;/* [unique,charset(UTF16)] */ - const char *source_dsa_obj_dn;/* [unique,charset(UTF16)] */ - const char *source_dsa_address;/* [unique,charset(UTF16)] */ - const char *transport_obj_dn;/* [unique,charset(UTF16)] */ - uint32_t replica_flags; - uint32_t reserved; - struct GUID naming_context_obj_guid; - struct GUID source_dsa_obj_guid; - struct GUID source_dsa_invocation_id; - struct GUID transport_obj_guid; - uint64_t tmp_highest_usn; - uint64_t highest_usn; - NTTIME last_success; - NTTIME last_attempt; - WERROR result_last_attempt; - uint32_t consecutive_sync_failures; -}; - -struct drsuapi_DsReplicaNeighbourCtr { - uint32_t count; - uint32_t reserved; - struct drsuapi_DsReplicaNeighbour *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplicaCursorCtr { - uint32_t count; - uint32_t reserved; - struct drsuapi_DsReplicaCursor *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplicaObjMetaData { - const char *attribute_name;/* [unique,charset(UTF16)] */ - uint32_t version; - NTTIME originating_change_time; - struct GUID originating_invocation_id; - uint64_t originating_usn; - uint64_t local_usn; -}; - -struct drsuapi_DsReplicaObjMetaDataCtr { - uint32_t count; - uint32_t reserved; - struct drsuapi_DsReplicaObjMetaData *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplicaKccDsaFailure { - const char *dsa_obj_dn;/* [unique,charset(UTF16)] */ - struct GUID dsa_obj_guid; - NTTIME first_failure; - uint32_t num_failures; - WERROR last_result; -}; - -struct drsuapi_DsReplicaKccDsaFailuresCtr { - uint32_t count; - uint32_t reserved; - struct drsuapi_DsReplicaKccDsaFailure *array;/* [size_is(count)] */ -}; - -enum drsuapi_DsReplicaOpType -#ifndef USE_UINT_ENUMS - { - DRSUAPI_DS_REPLICA_OP_TYPE_SYNC=0, - DRSUAPI_DS_REPLICA_OP_TYPE_ADD=1, - DRSUAPI_DS_REPLICA_OP_TYPE_DELETE=2, - DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY=3, - DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS=4 -} -#else - { __donnot_use_enum_drsuapi_DsReplicaOpType=0x7FFFFFFF} -#define DRSUAPI_DS_REPLICA_OP_TYPE_SYNC ( 0 ) -#define DRSUAPI_DS_REPLICA_OP_TYPE_ADD ( 1 ) -#define DRSUAPI_DS_REPLICA_OP_TYPE_DELETE ( 2 ) -#define DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY ( 3 ) -#define DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS ( 4 ) -#endif -; - -union drsuapi_DsRplicaOpOptions { - uint32_t sync;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_SYNC)] */ - uint32_t add;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_ADD)] */ - uint32_t op_delete;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_DELETE)] */ - uint32_t modify;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY)] */ - uint32_t update_refs;/* [case(DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS)] */ - uint32_t unknown;/* [default] */ -}/* [switch_type(drsuapi_DsReplicaOpType)] */; - -struct drsuapi_DsReplicaOp { - NTTIME operation_start; - uint32_t serial_num; - uint32_t priority; - enum drsuapi_DsReplicaOpType operation_type; - union drsuapi_DsRplicaOpOptions options;/* [switch_is(operation_type)] */ - const char *nc_dn;/* [unique,charset(UTF16)] */ - const char *remote_dsa_obj_dn;/* [unique,charset(UTF16)] */ - const char *remote_dsa_address;/* [unique,charset(UTF16)] */ - struct GUID nc_obj_guid; - struct GUID remote_dsa_obj_guid; -}; - -struct drsuapi_DsReplicaOpCtr { - NTTIME time; - uint32_t count; - struct drsuapi_DsReplicaOp *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplicaAttrValMetaData { - const char *attribute_name;/* [unique,charset(UTF16)] */ - const char *object_dn;/* [unique,charset(UTF16)] */ - uint32_t __ndr_size_binary;/* [value(ndr_size_DATA_BLOB(0,binary,0))] */ - DATA_BLOB *binary;/* [unique] */ - NTTIME deleted; - NTTIME created; - uint32_t version; - NTTIME originating_change_time; - struct GUID originating_invocation_id; - uint64_t originating_usn; - uint64_t local_usn; -}; - -struct drsuapi_DsReplicaAttrValMetaDataCtr { - uint32_t count; - int32_t enumeration_context; - struct drsuapi_DsReplicaAttrValMetaData *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplicaCursor2Ctr { - uint32_t count; - int32_t enumeration_context; - struct drsuapi_DsReplicaCursor2 *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplicaCursor3 { - struct GUID source_dsa_invocation_id; - uint64_t highest_usn; - NTTIME last_sync_success; - const char *source_dsa_obj_dn;/* [unique,charset(UTF16)] */ -}; - -struct drsuapi_DsReplicaCursor3Ctr { - uint32_t count; - int32_t enumeration_context; - struct drsuapi_DsReplicaCursor3 *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplicaObjMetaData2 { - const char *attribute_name;/* [unique,charset(UTF16)] */ - uint32_t version; - NTTIME originating_change_time; - struct GUID originating_invocation_id; - uint64_t originating_usn; - uint64_t local_usn; - const char *originating_dsa_dn;/* [unique,charset(UTF16)] */ -}; - -struct drsuapi_DsReplicaObjMetaData2Ctr { - uint32_t count; - int32_t enumeration_context; - struct drsuapi_DsReplicaObjMetaData2 *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplicaAttrValMetaData2 { - const char *attribute_name;/* [unique,charset(UTF16)] */ - const char *object_dn;/* [unique,charset(UTF16)] */ - uint32_t __ndr_size_binary;/* [value(ndr_size_DATA_BLOB(0,binary,0))] */ - DATA_BLOB *binary;/* [unique] */ - NTTIME deleted; - NTTIME created; - uint32_t version; - NTTIME originating_change_time; - struct GUID originating_invocation_id; - uint64_t originating_usn; - uint64_t local_usn; - const char *originating_dsa_dn;/* [unique,charset(UTF16)] */ -}; - -struct drsuapi_DsReplicaAttrValMetaData2Ctr { - uint32_t count; - int32_t enumeration_context; - struct drsuapi_DsReplicaAttrValMetaData2 *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplicaConnection04 { - uint64_t u1; - uint32_t u2; - uint32_t u3; - struct GUID bind_guid; - NTTIME bind_time; - const char * client_ip_address;/* [flag(LIBNDR_FLAG_BIGENDIAN)] */ - uint32_t u5; -}; - -struct drsuapi_DsReplicaConnection04Ctr { - uint32_t count;/* [range(0,10000)] */ - uint32_t reserved; - struct drsuapi_DsReplicaConnection04 *array;/* [size_is(count)] */ -}; - -struct drsuapi_DsReplica06 { - const char *str1;/* [unique,charset(UTF16)] */ - uint32_t u1; - uint32_t u2; - uint32_t u3; - uint32_t u4; - uint32_t u5; - uint64_t u6; - uint32_t u7; -}; - -struct drsuapi_DsReplica06Ctr { - uint32_t count;/* [range(0,256)] */ - uint32_t reserved; - struct drsuapi_DsReplica06 *array;/* [size_is(count)] */ -}; - -union drsuapi_DsReplicaInfo { - struct drsuapi_DsReplicaNeighbourCtr *neighbours;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS)] */ - struct drsuapi_DsReplicaCursorCtr *cursors;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CURSORS)] */ - struct drsuapi_DsReplicaObjMetaDataCtr *objmetadata;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA)] */ - struct drsuapi_DsReplicaKccDsaFailuresCtr *connectfailures;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES)] */ - struct drsuapi_DsReplicaKccDsaFailuresCtr *linkfailures;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES)] */ - struct drsuapi_DsReplicaOpCtr *pendingops;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_PENDING_OPS)] */ - struct drsuapi_DsReplicaAttrValMetaDataCtr *attrvalmetadata;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA)] */ - struct drsuapi_DsReplicaCursor2Ctr *cursors2;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CURSORS2)] */ - struct drsuapi_DsReplicaCursor3Ctr *cursors3;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CURSORS3)] */ - struct drsuapi_DsReplicaObjMetaData2Ctr *objmetadata2;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2)] */ - struct drsuapi_DsReplicaAttrValMetaData2Ctr *attrvalmetadata2;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2)] */ - struct drsuapi_DsReplicaNeighbourCtr *neighbours02;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02)] */ - struct drsuapi_DsReplicaConnection04Ctr *connections04;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04)] */ - struct drsuapi_DsReplicaCursorCtrEx *cursors05;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_CURSORS05)] */ - struct drsuapi_DsReplica06Ctr *i06;/* [unique,case(DRSUAPI_DS_REPLICA_INFO_06)] */ -}/* [switch_type(drsuapi_DsReplicaInfoType)] */; - -struct drsuapi_DsGetMemberships2Ctr1 { - uint32_t num_entries;/* [range(0,10000)] */ - struct drsuapi_DsGetMembershipsCtr1 **ctrl_array;/* [unique,size_is(num_entries)] */ -}; - -union drsuapi_DsGetMemberships2Ctr { - struct drsuapi_DsGetMembershipsCtr1 ctr1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsGetMemberships2Request1 { - uint32_t num_req;/* [range(1,10000)] */ - struct drsuapi_DsGetMembershipsRequest1 **req_array;/* [unique,size_is(num_req)] */ -}; - -union drsuapi_DsGetMemberships2Request { - struct drsuapi_DsGetMemberships2Request1 req1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_DsSiteCostInfo { - WERROR error_code; - uint32_t site_cost; -}; - -struct drsuapi_QuerySitesByCostCtr1 { - uint32_t num_info;/* [range(0,10000)] */ - struct drsuapi_DsSiteCostInfo *info;/* [unique,size_is(num_info)] */ - uint32_t unknown; -}; - -union drsuapi_QuerySitesByCostCtr { - struct drsuapi_QuerySitesByCostCtr1 ctr1;/* [case] */ -}/* [switch_type(int32)] */; - -struct drsuapi_QuerySitesByCostRequest1 { - const char *site_from;/* [unique,charset(UTF16)] */ - uint32_t num_req;/* [range(1,10000)] */ - const char **site_to;/* [unique,charset(UTF16),size_is(num_req)] */ - uint32_t flags; -}; - -union drsuapi_QuerySitesByCostRequest { - struct drsuapi_QuerySitesByCostRequest1 req1;/* [case] */ -}/* [switch_type(int32)] */; - - -struct drsuapi_DsBind { - struct { - struct GUID *bind_guid;/* [unique] */ - struct drsuapi_DsBindInfoCtr *bind_info;/* [unique] */ - } in; - - struct { - struct policy_handle *bind_handle;/* [ref] */ - struct drsuapi_DsBindInfoCtr *bind_info;/* [unique] */ - WERROR result; - } out; - -}; - - -struct drsuapi_DsUnbind { - struct { - struct policy_handle *bind_handle;/* [ref] */ - } in; - - struct { - struct policy_handle *bind_handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct drsuapi_DsReplicaSync { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsReplicaSyncRequest req;/* [switch_is(level)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct drsuapi_DsGetNCChanges { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsGetNCChangesRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - int32_t *level_out;/* [ref] */ - union drsuapi_DsGetNCChangesCtr *ctr;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - - -struct drsuapi_DsReplicaUpdateRefs { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsReplicaUpdateRefsRequest req;/* [switch_is(level)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct DRSUAPI_REPLICA_ADD { - struct { - WERROR result; - } out; - -}; - - -struct DRSUAPI_REPLICA_DEL { - struct { - WERROR result; - } out; - -}; - - -struct DRSUAPI_REPLICA_MODIFY { - struct { - WERROR result; - } out; - -}; - - -struct DRSUAPI_VERIFY_NAMES { - struct { - WERROR result; - } out; - -}; - - -struct drsuapi_DsGetMemberships { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsGetMembershipsRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - int32_t *level_out;/* [ref] */ - union drsuapi_DsGetMembershipsCtr *ctr;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - - -struct DRSUAPI_INTER_DOMAIN_MOVE { - struct { - WERROR result; - } out; - -}; - - -struct drsuapi_DsGetNT4ChangeLog { - struct { - struct policy_handle *bind_handle;/* [ref] */ - uint32_t level; - union drsuapi_DsGetNT4ChangeLogRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - uint32_t *level_out;/* [ref] */ - union drsuapi_DsGetNT4ChangeLogInfo *info;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - - -struct drsuapi_DsCrackNames { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsNameRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - int32_t *level_out;/* [ref] */ - union drsuapi_DsNameCtr *ctr;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - - -struct drsuapi_DsWriteAccountSpn { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsWriteAccountSpnRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - int32_t *level_out;/* [ref] */ - union drsuapi_DsWriteAccountSpnResult *res;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - - -struct drsuapi_DsRemoveDSServer { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsRemoveDSServerRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - int32_t *level_out;/* [ref] */ - union drsuapi_DsRemoveDSServerResult *res;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - - -struct DRSUAPI_REMOVE_DS_DOMAIN { - struct { - WERROR result; - } out; - -}; - - -struct drsuapi_DsGetDomainControllerInfo { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsGetDCInfoRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - int32_t *level_out;/* [ref] */ - union drsuapi_DsGetDCInfoCtr *ctr;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - - -struct drsuapi_DsAddEntry { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsAddEntryRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - int32_t *level_out;/* [ref] */ - union drsuapi_DsAddEntryCtr *ctr;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - - -struct DRSUAPI_EXECUTE_KCC { - struct { - WERROR result; - } out; - -}; - - -struct drsuapi_DsReplicaGetInfo { - struct { - struct policy_handle *bind_handle;/* [ref] */ - enum drsuapi_DsReplicaGetInfoLevel level; - union drsuapi_DsReplicaGetInfoRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - enum drsuapi_DsReplicaInfoType *info_type;/* [ref] */ - union drsuapi_DsReplicaInfo *info;/* [ref,switch_is(*info_type)] */ - WERROR result; - } out; - -}; - - -struct DRSUAPI_ADD_SID_HISTORY { - struct { - WERROR result; - } out; - -}; - - -struct drsuapi_DsGetMemberships2 { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_DsGetMemberships2Request *req;/* [ref,switch_is(level)] */ - } in; - - struct { - int32_t *level_out;/* [ref] */ - union drsuapi_DsGetMemberships2Ctr *ctr;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - - -struct DRSUAPI_REPLICA_VERIFY_OBJECTS { - struct { - WERROR result; - } out; - -}; - - -struct DRSUAPI_GET_OBJECT_EXISTENCE { - struct { - WERROR result; - } out; - -}; - - -struct drsuapi_QuerySitesByCost { - struct { - struct policy_handle *bind_handle;/* [ref] */ - int32_t level; - union drsuapi_QuerySitesByCostRequest *req;/* [ref,switch_is(level)] */ - } in; - - struct { - int32_t *level_out;/* [ref] */ - union drsuapi_QuerySitesByCostCtr *ctr;/* [ref,switch_is(*level_out)] */ - WERROR result; - } out; - -}; - -#endif /* _HEADER_drsuapi */ diff --git a/source3/librpc/gen_ndr/dssetup.h b/source3/librpc/gen_ndr/dssetup.h deleted file mode 100644 index d284a63375..0000000000 --- a/source3/librpc/gen_ndr/dssetup.h +++ /dev/null @@ -1,211 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/misc.h" -#ifndef _HEADER_dssetup -#define _HEADER_dssetup - -enum dssetup_DsRole -#ifndef USE_UINT_ENUMS - { - DS_ROLE_STANDALONE_WORKSTATION=0, - DS_ROLE_MEMBER_WORKSTATION=1, - DS_ROLE_STANDALONE_SERVER=2, - DS_ROLE_MEMBER_SERVER=3, - DS_ROLE_BACKUP_DC=4, - DS_ROLE_PRIMARY_DC=5 -} -#else - { __donnot_use_enum_dssetup_DsRole=0x7FFFFFFF} -#define DS_ROLE_STANDALONE_WORKSTATION ( 0 ) -#define DS_ROLE_MEMBER_WORKSTATION ( 1 ) -#define DS_ROLE_STANDALONE_SERVER ( 2 ) -#define DS_ROLE_MEMBER_SERVER ( 3 ) -#define DS_ROLE_BACKUP_DC ( 4 ) -#define DS_ROLE_PRIMARY_DC ( 5 ) -#endif -; - -/* bitmap dssetup_DsRoleFlags */ -#define DS_ROLE_PRIMARY_DS_RUNNING ( 0x00000001 ) -#define DS_ROLE_PRIMARY_DS_MIXED_MODE ( 0x00000002 ) -#define DS_ROLE_UPGRADE_IN_PROGRESS ( 0x00000004 ) -#define DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT ( 0x01000000 ) - -struct dssetup_DsRolePrimaryDomInfoBasic { - enum dssetup_DsRole role; - uint32_t flags; - const char *domain;/* [unique,charset(UTF16)] */ - const char *dns_domain;/* [unique,charset(UTF16)] */ - const char *forest;/* [unique,charset(UTF16)] */ - struct GUID domain_guid; -}; - -enum dssetup_DsUpgrade -#ifndef USE_UINT_ENUMS - { - DS_ROLE_NOT_UPGRADING=0, - DS_ROLE_UPGRADING=1 -} -#else - { __donnot_use_enum_dssetup_DsUpgrade=0x7FFFFFFF} -#define DS_ROLE_NOT_UPGRADING ( 0 ) -#define DS_ROLE_UPGRADING ( 1 ) -#endif -; - -enum dssetup_DsPrevious -#ifndef USE_UINT_ENUMS - { - DS_ROLE_PREVIOUS_UNKNOWN=0, - DS_ROLE_PREVIOUS_PRIMARY=1, - DS_ROLE_PREVIOUS_BACKUP=2 -} -#else - { __donnot_use_enum_dssetup_DsPrevious=0x7FFFFFFF} -#define DS_ROLE_PREVIOUS_UNKNOWN ( 0 ) -#define DS_ROLE_PREVIOUS_PRIMARY ( 1 ) -#define DS_ROLE_PREVIOUS_BACKUP ( 2 ) -#endif -; - -struct dssetup_DsRoleUpgradeStatus { - enum dssetup_DsUpgrade upgrading; - enum dssetup_DsPrevious previous_role; -}; - -enum dssetup_DsRoleOp -#ifndef USE_UINT_ENUMS - { - DS_ROLE_OP_IDLE=0, - DS_ROLE_OP_ACTIVE=1, - DS_ROLE_OP_NEEDS_REBOOT=2 -} -#else - { __donnot_use_enum_dssetup_DsRoleOp=0x7FFFFFFF} -#define DS_ROLE_OP_IDLE ( 0 ) -#define DS_ROLE_OP_ACTIVE ( 1 ) -#define DS_ROLE_OP_NEEDS_REBOOT ( 2 ) -#endif -; - -struct dssetup_DsRoleOpStatus { - enum dssetup_DsRoleOp status; -}; - -enum dssetup_DsRoleInfoLevel -#ifndef USE_UINT_ENUMS - { - DS_ROLE_BASIC_INFORMATION=1, - DS_ROLE_UPGRADE_STATUS=2, - DS_ROLE_OP_STATUS=3 -} -#else - { __donnot_use_enum_dssetup_DsRoleInfoLevel=0x7FFFFFFF} -#define DS_ROLE_BASIC_INFORMATION ( 1 ) -#define DS_ROLE_UPGRADE_STATUS ( 2 ) -#define DS_ROLE_OP_STATUS ( 3 ) -#endif -; - -union dssetup_DsRoleInfo { - struct dssetup_DsRolePrimaryDomInfoBasic basic;/* [case(DS_ROLE_BASIC_INFORMATION)] */ - struct dssetup_DsRoleUpgradeStatus upgrade;/* [case(DS_ROLE_UPGRADE_STATUS)] */ - struct dssetup_DsRoleOpStatus opstatus;/* [case(DS_ROLE_OP_STATUS)] */ -}/* [switch_type(dssetup_DsRoleInfoLevel)] */; - - -struct dssetup_DsRoleGetPrimaryDomainInformation { - struct { - enum dssetup_DsRoleInfoLevel level; - } in; - - struct { - union dssetup_DsRoleInfo *info;/* [unique,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleDnsNameToFlatName { - struct { - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleDcAsDc { - struct { - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleDcAsReplica { - struct { - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleDemoteDc { - struct { - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleGetDcOperationProgress { - struct { - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleGetDcOperationResults { - struct { - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleCancel { - struct { - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleServerSaveStateForUpgrade { - struct { - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleUpgradeDownlevelServer { - struct { - WERROR result; - } out; - -}; - - -struct dssetup_DsRoleAbortDownlevelServerUpgrade { - struct { - WERROR result; - } out; - -}; - -#endif /* _HEADER_dssetup */ diff --git a/source3/librpc/gen_ndr/echo.h b/source3/librpc/gen_ndr/echo.h deleted file mode 100644 index 79d4220714..0000000000 --- a/source3/librpc/gen_ndr/echo.h +++ /dev/null @@ -1,213 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#ifndef _HEADER_rpcecho -#define _HEADER_rpcecho - -struct echo_info1 { - uint8_t v; -}/* [public] */; - -struct echo_info2 { - uint16_t v; -}; - -struct echo_info3 { - uint32_t v; -}; - -struct echo_info4 { - uint64_t v; -}; - -struct echo_info5 { - uint8_t v1; - uint64_t v2; -}; - -struct echo_info6 { - uint8_t v1; - struct echo_info1 info1; -}; - -struct echo_info7 { - uint8_t v1; - struct echo_info4 info4; -}; - -union echo_Info { - struct echo_info1 info1;/* [case] */ - struct echo_info2 info2;/* [case(2)] */ - struct echo_info3 info3;/* [case(3)] */ - struct echo_info4 info4;/* [case(4)] */ - struct echo_info5 info5;/* [case(5)] */ - struct echo_info6 info6;/* [case(6)] */ - struct echo_info7 info7;/* [case(7)] */ -}/* [switch_type(uint16)] */; - -enum echo_Enum1 -#ifndef USE_UINT_ENUMS - { - ECHO_ENUM1=1, - ECHO_ENUM2=2 -} -#else - { __donnot_use_enum_echo_Enum1=0x7FFFFFFF} -#define ECHO_ENUM1 ( 1 ) -#define ECHO_ENUM2 ( 2 ) -#endif -; - -enum echo_Enum1_32 -#ifndef USE_UINT_ENUMS - { - ECHO_ENUM1_32=1, - ECHO_ENUM2_32=2 -} -#else - { __donnot_use_enum_echo_Enum1_32=0x7FFFFFFF} -#define ECHO_ENUM1_32 ( 1 ) -#define ECHO_ENUM2_32 ( 2 ) -#endif -; - -struct echo_Enum2 { - enum echo_Enum1 e1; - enum echo_Enum1_32 e2; -}; - -union echo_Enum3 { - enum echo_Enum1 e1;/* [case(ECHO_ENUM1)] */ - struct echo_Enum2 e2;/* [case(ECHO_ENUM2)] */ -}/* [switch_type(uint16)] */; - -struct echo_Surrounding { - uint32_t x; - uint16_t *surrounding;/* [size_is(x)] */ -}; - - -struct echo_AddOne { - struct { - uint32_t in_data; - } in; - - struct { - uint32_t *out_data;/* [ref] */ - } out; - -}; - - -struct echo_EchoData { - struct { - uint32_t len; - uint8_t *in_data;/* [size_is(len)] */ - } in; - - struct { - uint8_t *out_data;/* [size_is(len)] */ - } out; - -}; - - -struct echo_SinkData { - struct { - uint32_t len; - uint8_t *data;/* [size_is(len)] */ - } in; - -}; - - -struct echo_SourceData { - struct { - uint32_t len; - } in; - - struct { - uint8_t *data;/* [size_is(len)] */ - } out; - -}; - - -struct echo_TestCall { - struct { - const char *s1;/* [ref,charset(UTF16)] */ - } in; - - struct { - const char **s2;/* [ref,charset(UTF16)] */ - } out; - -}; - - -struct echo_TestCall2 { - struct { - uint16_t level; - } in; - - struct { - union echo_Info *info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct echo_TestSleep { - struct { - uint32_t seconds; - } in; - - struct { - uint32_t result; - } out; - -}; - - -struct echo_TestEnum { - struct { - enum echo_Enum1 *foo1;/* [ref] */ - struct echo_Enum2 *foo2;/* [ref] */ - union echo_Enum3 *foo3;/* [ref,switch_is(*foo1)] */ - } in; - - struct { - enum echo_Enum1 *foo1;/* [ref] */ - struct echo_Enum2 *foo2;/* [ref] */ - union echo_Enum3 *foo3;/* [ref,switch_is(*foo1)] */ - } out; - -}; - - -struct echo_TestSurrounding { - struct { - struct echo_Surrounding *data;/* [ref] */ - } in; - - struct { - struct echo_Surrounding *data;/* [ref] */ - } out; - -}; - - -struct echo_TestDoublePointer { - struct { - uint16_t ***data;/* [ref] */ - } in; - - struct { - uint16_t result; - } out; - -}; - -#endif /* _HEADER_rpcecho */ diff --git a/source3/librpc/gen_ndr/epmapper.h b/source3/librpc/gen_ndr/epmapper.h deleted file mode 100644 index 4b75261a02..0000000000 --- a/source3/librpc/gen_ndr/epmapper.h +++ /dev/null @@ -1,357 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/misc.h" -#ifndef _HEADER_epmapper -#define _HEADER_epmapper - -#define EPMAPPER_STATUS_NO_MORE_ENTRIES ( 0x16c9a0d6 ) -#define EPMAPPER_STATUS_NO_MEMORY ( 0x16C9A012 ) -#define EPMAPPER_STATUS_OK ( 0 ) -enum epm_protocol -#ifndef USE_UINT_ENUMS - { - EPM_PROTOCOL_DNET_NSP=0x04, - EPM_PROTOCOL_OSI_TP4=0x05, - EPM_PROTOCOL_OSI_CLNS=0x06, - EPM_PROTOCOL_TCP=0x07, - EPM_PROTOCOL_UDP=0x08, - EPM_PROTOCOL_IP=0x09, - EPM_PROTOCOL_NCADG=0x0a, - EPM_PROTOCOL_NCACN=0x0b, - EPM_PROTOCOL_NCALRPC=0x0c, - EPM_PROTOCOL_UUID=0x0d, - EPM_PROTOCOL_IPX=0x0e, - EPM_PROTOCOL_SMB=0x0f, - EPM_PROTOCOL_PIPE=0x10, - EPM_PROTOCOL_NETBIOS=0x11, - EPM_PROTOCOL_NETBEUI=0x12, - EPM_PROTOCOL_SPX=0x13, - EPM_PROTOCOL_NB_IPX=0x14, - EPM_PROTOCOL_DSP=0x16, - EPM_PROTOCOL_DDP=0x17, - EPM_PROTOCOL_APPLETALK=0x18, - EPM_PROTOCOL_VINES_SPP=0x1a, - EPM_PROTOCOL_VINES_IPC=0x1b, - EPM_PROTOCOL_STREETTALK=0x1c, - EPM_PROTOCOL_HTTP=0x1f, - EPM_PROTOCOL_UNIX_DS=0x20, - EPM_PROTOCOL_NULL=0x21 -} -#else - { __donnot_use_enum_epm_protocol=0x7FFFFFFF} -#define EPM_PROTOCOL_DNET_NSP ( 0x04 ) -#define EPM_PROTOCOL_OSI_TP4 ( 0x05 ) -#define EPM_PROTOCOL_OSI_CLNS ( 0x06 ) -#define EPM_PROTOCOL_TCP ( 0x07 ) -#define EPM_PROTOCOL_UDP ( 0x08 ) -#define EPM_PROTOCOL_IP ( 0x09 ) -#define EPM_PROTOCOL_NCADG ( 0x0a ) -#define EPM_PROTOCOL_NCACN ( 0x0b ) -#define EPM_PROTOCOL_NCALRPC ( 0x0c ) -#define EPM_PROTOCOL_UUID ( 0x0d ) -#define EPM_PROTOCOL_IPX ( 0x0e ) -#define EPM_PROTOCOL_SMB ( 0x0f ) -#define EPM_PROTOCOL_PIPE ( 0x10 ) -#define EPM_PROTOCOL_NETBIOS ( 0x11 ) -#define EPM_PROTOCOL_NETBEUI ( 0x12 ) -#define EPM_PROTOCOL_SPX ( 0x13 ) -#define EPM_PROTOCOL_NB_IPX ( 0x14 ) -#define EPM_PROTOCOL_DSP ( 0x16 ) -#define EPM_PROTOCOL_DDP ( 0x17 ) -#define EPM_PROTOCOL_APPLETALK ( 0x18 ) -#define EPM_PROTOCOL_VINES_SPP ( 0x1a ) -#define EPM_PROTOCOL_VINES_IPC ( 0x1b ) -#define EPM_PROTOCOL_STREETTALK ( 0x1c ) -#define EPM_PROTOCOL_HTTP ( 0x1f ) -#define EPM_PROTOCOL_UNIX_DS ( 0x20 ) -#define EPM_PROTOCOL_NULL ( 0x21 ) -#endif -; - -struct epm_rhs_dnet_nsp { - char _empty_; -}; - -struct epm_rhs_osi_tp4 { - char _empty_; -}; - -struct epm_rhs_osi_clns { - char _empty_; -}; - -struct epm_rhs_udp { - uint16_t port; -}; - -struct epm_rhs_tcp { - uint16_t port; -}; - -struct epm_rhs_ip { - const char * ipaddr; -}; - -struct epm_rhs_ncadg { - uint16_t minor_version; -}; - -struct epm_rhs_ncacn { - uint16_t minor_version; -}; - -struct epm_rhs_uuid { - DATA_BLOB unknown;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}; - -struct epm_rhs_ipx { - char _empty_; -}; - -struct epm_rhs_smb { - const char * unc;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct epm_rhs_pipe { - const char * path;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct epm_rhs_netbios { - const char * name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct epm_rhs_netbeui { - char _empty_; -}; - -struct epm_rhs_spx { - char _empty_; -}; - -struct epm_rhs_nb_ipx { - char _empty_; -}; - -struct epm_rhs_http { - uint16_t port; -}; - -struct epm_rhs_unix_ds { - const char * path;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct epm_rhs_null { - char _empty_; -}; - -struct epm_rhs_ncalrpc { - uint16_t minor_version; -}; - -struct epm_rhs_appletalk { - char _empty_; -}; - -struct epm_rhs_atalk_stream { - char _empty_; -}; - -struct epm_rhs_atalk_datagram { - char _empty_; -}; - -struct epm_rhs_vines_spp { - uint16_t port; -}; - -struct epm_rhs_vines_ipc { - uint16_t port; -}; - -struct epm_rhs_streettalk { - const char * streettalk;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -union epm_rhs { - struct epm_rhs_dnet_nsp dnet_nsp;/* [case(EPM_PROTOCOL_DNET_NSP)] */ - struct epm_rhs_osi_tp4 osi_tp4;/* [case(EPM_PROTOCOL_OSI_TP4)] */ - struct epm_rhs_osi_clns osi_clns;/* [case(EPM_PROTOCOL_OSI_CLNS)] */ - struct epm_rhs_tcp tcp;/* [case(EPM_PROTOCOL_TCP)] */ - struct epm_rhs_udp udp;/* [case(EPM_PROTOCOL_UDP)] */ - struct epm_rhs_ip ip;/* [case(EPM_PROTOCOL_IP)] */ - struct epm_rhs_ncadg ncadg;/* [case(EPM_PROTOCOL_NCADG)] */ - struct epm_rhs_ncacn ncacn;/* [case(EPM_PROTOCOL_NCACN)] */ - struct epm_rhs_ncalrpc ncalrpc;/* [case(EPM_PROTOCOL_NCALRPC)] */ - struct epm_rhs_uuid uuid;/* [case(EPM_PROTOCOL_UUID)] */ - struct epm_rhs_ipx ipx;/* [case(EPM_PROTOCOL_IPX)] */ - struct epm_rhs_smb smb;/* [case(EPM_PROTOCOL_SMB)] */ - struct epm_rhs_pipe pipe;/* [case(EPM_PROTOCOL_PIPE)] */ - struct epm_rhs_netbios netbios;/* [case(EPM_PROTOCOL_NETBIOS)] */ - struct epm_rhs_netbeui netbeui;/* [case(EPM_PROTOCOL_NETBEUI)] */ - struct epm_rhs_spx spx;/* [case(EPM_PROTOCOL_SPX)] */ - struct epm_rhs_nb_ipx nb_ipx;/* [case(EPM_PROTOCOL_NB_IPX)] */ - struct epm_rhs_atalk_stream atalk_stream;/* [case(EPM_PROTOCOL_DSP)] */ - struct epm_rhs_atalk_datagram atalk_datagram;/* [case(EPM_PROTOCOL_DDP)] */ - struct epm_rhs_appletalk appletalk;/* [case(EPM_PROTOCOL_APPLETALK)] */ - struct epm_rhs_vines_spp vines_spp;/* [case(EPM_PROTOCOL_VINES_SPP)] */ - struct epm_rhs_vines_ipc vines_ipc;/* [case(EPM_PROTOCOL_VINES_IPC)] */ - struct epm_rhs_streettalk streettalk;/* [case(EPM_PROTOCOL_STREETTALK)] */ - struct epm_rhs_http http;/* [case(EPM_PROTOCOL_HTTP)] */ - struct epm_rhs_unix_ds unix_ds;/* [case(EPM_PROTOCOL_UNIX_DS)] */ - struct epm_rhs_null null;/* [case(EPM_PROTOCOL_NULL)] */ - DATA_BLOB unknown;/* [default,flag(LIBNDR_FLAG_REMAINING)] */ -}/* [nodiscriminant,flag(LIBNDR_FLAG_BIGENDIAN)] */; - -struct epm_lhs { - enum epm_protocol protocol; - DATA_BLOB lhs_data;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}; - -struct epm_floor { - struct epm_lhs lhs;/* [subcontext(2)] */ - union epm_rhs rhs;/* [subcontext(2),switch_is(lhs.protocol)] */ -}; - -struct epm_tower { - uint16_t num_floors; - struct epm_floor *floors; -}/* [gensize,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN)] */; - -struct epm_twr_t { - uint32_t tower_length;/* [value(ndr_size_epm_tower(&tower,ndr->flags))] */ - struct epm_tower tower;/* [subcontext(4)] */ -}; - -struct epm_entry_t { - struct GUID object; - struct epm_twr_t *tower;/* [ptr] */ - uint32_t __annotation_offset;/* [value(0)] */ - uint32_t __annotation_length;/* [value(strlen(annotation)+1)] */ - const char *annotation;/* [charset(DOS)] */ -}; - -struct rpc_if_id_t { - struct GUID uuid; - uint16_t vers_major; - uint16_t vers_minor; -}; - -struct epm_twr_p_t { - struct epm_twr_t *twr;/* [ptr] */ -}; - - -struct epm_Insert { - struct { - uint32_t num_ents; - struct epm_entry_t *entries;/* [size_is(num_ents)] */ - uint32_t replace; - } in; - - struct { - uint32_t result; - } out; - -}; - - -struct epm_Delete { - struct { - uint32_t num_ents; - struct epm_entry_t *entries;/* [size_is(num_ents)] */ - } in; - - struct { - uint32_t result; - } out; - -}; - - -struct epm_Lookup { - struct { - uint32_t inquiry_type; - struct GUID *object;/* [ptr] */ - struct rpc_if_id_t *interface_id;/* [ptr] */ - uint32_t vers_option; - uint32_t max_ents; - struct policy_handle *entry_handle;/* [ref] */ - } in; - - struct { - uint32_t *num_ents;/* [ref] */ - struct epm_entry_t *entries;/* [length_is(*num_ents),size_is(max_ents)] */ - struct policy_handle *entry_handle;/* [ref] */ - uint32_t result; - } out; - -}; - - -struct epm_Map { - struct { - struct GUID *object;/* [ptr] */ - struct epm_twr_t *map_tower;/* [ptr] */ - uint32_t max_towers; - struct policy_handle *entry_handle;/* [ref] */ - } in; - - struct { - uint32_t *num_towers;/* [ref] */ - struct epm_twr_p_t *towers;/* [length_is(*num_towers),size_is(max_towers)] */ - struct policy_handle *entry_handle;/* [ref] */ - uint32_t result; - } out; - -}; - - -struct epm_LookupHandleFree { - struct { - struct policy_handle *entry_handle;/* [ref] */ - } in; - - struct { - struct policy_handle *entry_handle;/* [ref] */ - uint32_t result; - } out; - -}; - - -struct epm_InqObject { - struct { - struct GUID *epm_object;/* [ref] */ - } in; - - struct { - uint32_t result; - } out; - -}; - - -struct epm_MgmtDelete { - struct { - uint32_t object_speced; - struct GUID *object;/* [ptr] */ - struct epm_twr_t *tower;/* [ptr] */ - } in; - - struct { - uint32_t result; - } out; - -}; - - -struct epm_MapAuth { - struct { - uint32_t result; - } out; - -}; - -#endif /* _HEADER_epmapper */ diff --git a/source3/librpc/gen_ndr/eventlog.h b/source3/librpc/gen_ndr/eventlog.h deleted file mode 100644 index 76b9e863bb..0000000000 --- a/source3/librpc/gen_ndr/eventlog.h +++ /dev/null @@ -1,287 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/lsa.h" -#include "librpc/gen_ndr/security.h" -#ifndef _HEADER_eventlog -#define _HEADER_eventlog - -/* bitmap eventlogReadFlags */ -#define EVENTLOG_SEQUENTIAL_READ ( 0x0001 ) -#define EVENTLOG_SEEK_READ ( 0x0002 ) -#define EVENTLOG_FORWARDS_READ ( 0x0004 ) -#define EVENTLOG_BACKWARDS_READ ( 0x0008 ) - -/* bitmap eventlogEventTypes */ -#define EVENTLOG_SUCCESS ( 0x0000 ) -#define EVENTLOG_ERROR_TYPE ( 0x0001 ) -#define EVENTLOG_WARNING_TYPE ( 0x0002 ) -#define EVENTLOG_INFORMATION_TYPE ( 0x0004 ) -#define EVENTLOG_AUDIT_SUCCESS ( 0x0008 ) -#define EVENTLOG_AUDIT_FAILURE ( 0x0010 ) - -struct eventlog_OpenUnknown0 { - uint16_t unknown0; - uint16_t unknown1; -}; - -struct eventlog_Record { - uint32_t size; - uint32_t reserved; - uint32_t record_number; - uint32_t time_generated; - uint32_t time_written; - uint32_t event_id; - uint16_t event_type; - uint16_t num_of_strings; - uint16_t event_category; - uint16_t reserved_flags; - uint32_t closing_record_number; - uint32_t stringoffset; - uint32_t sid_length; - uint32_t sid_offset; - uint32_t data_length; - uint32_t data_offset; - const char * source_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * computer_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * *strings;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * raw_data;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}/* [public] */; - - -struct eventlog_ClearEventLogW { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String *backupfile;/* [unique] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_BackupEventLogW { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_CloseEventLog { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct eventlog_DeregisterEventSource { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_GetNumRecords { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - uint32_t *number;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct eventlog_GetOldestRecord { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - uint32_t *oldest_entry;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct eventlog_ChangeNotify { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_OpenEventLogW { - struct { - struct eventlog_OpenUnknown0 *unknown0;/* [unique] */ - struct lsa_String *logname;/* [ref] */ - struct lsa_String *servername;/* [ref] */ - uint32_t major_version; - uint32_t minor_version; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct eventlog_RegisterEventSourceW { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_OpenBackupEventLogW { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_ReadEventLogW { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t flags; - uint32_t offset; - uint32_t number_of_bytes;/* [range(0,0x7FFFF)] */ - } in; - - struct { - uint8_t *data;/* [ref,size_is(number_of_bytes)] */ - uint32_t *sent_size;/* [ref] */ - uint32_t *real_size;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct eventlog_ReportEventW { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_ClearEventLogA { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_BackupEventLogA { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_OpenEventLogA { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_RegisterEventSourceA { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_OpenBackupEventLogA { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_ReadEventLogA { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_ReportEventA { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_RegisterClusterSvc { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_DeregisterClusterSvc { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_WriteClusterEvents { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_GetLogIntormation { - struct { - NTSTATUS result; - } out; - -}; - - -struct eventlog_FlushEventLog { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - -#endif /* _HEADER_eventlog */ diff --git a/source3/librpc/gen_ndr/initshutdown.h b/source3/librpc/gen_ndr/initshutdown.h deleted file mode 100644 index 014e2fe689..0000000000 --- a/source3/librpc/gen_ndr/initshutdown.h +++ /dev/null @@ -1,54 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/lsa.h" -#ifndef _HEADER_initshutdown -#define _HEADER_initshutdown - - -struct initshutdown_Init { - struct { - uint16_t *hostname;/* [unique] */ - struct lsa_StringLarge *message;/* [unique] */ - uint32_t timeout; - uint8_t force_apps; - uint8_t do_reboot; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct initshutdown_Abort { - struct { - uint16_t *server;/* [unique] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct initshutdown_InitEx { - struct { - uint16_t *hostname;/* [unique] */ - struct lsa_StringLarge *message;/* [unique] */ - uint32_t timeout; - uint8_t force_apps; - uint8_t do_reboot; - uint32_t reason; - } in; - - struct { - WERROR result; - } out; - -}; - -#endif /* _HEADER_initshutdown */ diff --git a/source3/librpc/gen_ndr/krb5pac.h b/source3/librpc/gen_ndr/krb5pac.h deleted file mode 100644 index 73bd0d95bb..0000000000 --- a/source3/librpc/gen_ndr/krb5pac.h +++ /dev/null @@ -1,150 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/security.h" -#include "librpc/gen_ndr/netlogon.h" -#include "librpc/gen_ndr/samr.h" -#ifndef _HEADER_krb5pac -#define _HEADER_krb5pac - -#define NETLOGON_GENERIC_KRB5_PAC_VALIDATE ( 3 ) -struct PAC_LOGON_NAME { - NTTIME logon_time; - uint16_t size;/* [value(2*strlen_m(account_name))] */ - const char *account_name;/* [charset(UTF16)] */ -}; - -struct PAC_SIGNATURE_DATA { - uint32_t type; - DATA_BLOB signature;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct PAC_LOGON_INFO { - struct netr_SamInfo3 info3; - struct dom_sid2 *res_group_dom_sid;/* [unique] */ - struct samr_RidWithAttributeArray res_groups; -}; - -struct PAC_UNKNOWN_12 { - uint16_t upn_size;/* [value(2*strlen_m(upn_name))] */ - uint16_t upn_offset; - uint16_t domain_size;/* [value(2*strlen_m(domain_name))] */ - uint16_t domain_offset; - uint16_t unknown3; - uint16_t unknown4; - uint32_t unknown5; - const char *upn_name;/* [charset(UTF16)] */ - const char *domain_name;/* [charset(UTF16)] */ - uint32_t unknown6; -}; - -struct PAC_LOGON_INFO_CTR { - struct PAC_LOGON_INFO *info;/* [unique] */ -}/* [public] */; - -enum PAC_TYPE -#ifndef USE_UINT_ENUMS - { - PAC_TYPE_LOGON_INFO=1, - PAC_TYPE_SRV_CHECKSUM=6, - PAC_TYPE_KDC_CHECKSUM=7, - PAC_TYPE_LOGON_NAME=10, - PAC_TYPE_CONSTRAINED_DELEGATION=11, - PAC_TYPE_UNKNOWN_12=12 -} -#else - { __donnot_use_enum_PAC_TYPE=0x7FFFFFFF} -#define PAC_TYPE_LOGON_INFO ( 1 ) -#define PAC_TYPE_SRV_CHECKSUM ( 6 ) -#define PAC_TYPE_KDC_CHECKSUM ( 7 ) -#define PAC_TYPE_LOGON_NAME ( 10 ) -#define PAC_TYPE_CONSTRAINED_DELEGATION ( 11 ) -#define PAC_TYPE_UNKNOWN_12 ( 12 ) -#endif -; - -struct DATA_BLOB_REM { - DATA_BLOB remaining;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}; - -union PAC_INFO { - struct PAC_LOGON_INFO_CTR logon_info;/* [subcontext(0xFFFFFC01),case(PAC_TYPE_LOGON_INFO)] */ - struct PAC_SIGNATURE_DATA srv_cksum;/* [case(PAC_TYPE_SRV_CHECKSUM)] */ - struct PAC_SIGNATURE_DATA kdc_cksum;/* [case(PAC_TYPE_KDC_CHECKSUM)] */ - struct PAC_LOGON_NAME logon_name;/* [case(PAC_TYPE_LOGON_NAME)] */ - struct DATA_BLOB_REM unknown;/* [subcontext(0),default] */ -}/* [gensize,nodiscriminant,public] */; - -struct PAC_BUFFER { - enum PAC_TYPE type; - uint32_t _ndr_size;/* [value(_ndr_size_PAC_INFO(info,type,0))] */ - union PAC_INFO *info;/* [relative,subcontext_size(_subcontext_size_PAC_INFO(r,ndr->flags)),subcontext(0),switch_is(type),flag(LIBNDR_FLAG_ALIGN8)] */ - uint32_t _pad;/* [value(0)] */ -}/* [noprint,nopull,public,nopush] */; - -struct PAC_DATA { - uint32_t num_buffers; - uint32_t version; - struct PAC_BUFFER *buffers; -}/* [public] */; - -struct PAC_BUFFER_RAW { - enum PAC_TYPE type; - uint32_t ndr_size; - struct DATA_BLOB_REM *info;/* [relative,subcontext_size(NDR_ROUND(ndr_size,8)),subcontext(0),flag(LIBNDR_FLAG_ALIGN8)] */ - uint32_t _pad;/* [value(0)] */ -}/* [public] */; - -struct PAC_DATA_RAW { - uint32_t num_buffers; - uint32_t version; - struct PAC_BUFFER_RAW *buffers; -}/* [public] */; - -struct PAC_Validate { - uint32_t MessageType;/* [value(NETLOGON_GENERIC_KRB5_PAC_VALIDATE)] */ - uint32_t ChecksumLength; - int32_t SignatureType; - uint32_t SignatureLength; - DATA_BLOB ChecksumAndSignature;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}/* [public] */; - -struct netsamlogoncache_entry { - time_t timestamp; - struct netr_SamInfo3 info3; -}/* [public] */; - - -struct decode_pac { - struct { - struct PAC_DATA pac; - } in; - -}; - - -struct decode_pac_raw { - struct { - struct PAC_DATA_RAW pac; - } in; - -}; - - -struct decode_login_info { - struct { - struct PAC_LOGON_INFO logon_info; - } in; - -}; - - -struct decode_pac_validate { - struct { - struct PAC_Validate pac_validate; - } in; - -}; - -#endif /* _HEADER_krb5pac */ diff --git a/source3/librpc/gen_ndr/lsa.h b/source3/librpc/gen_ndr/lsa.h deleted file mode 100644 index ee8a31138d..0000000000 --- a/source3/librpc/gen_ndr/lsa.h +++ /dev/null @@ -1,1785 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/misc.h" -#include "librpc/gen_ndr/security.h" -#ifndef _HEADER_lsarpc -#define _HEADER_lsarpc - -#define LSA_ENUM_TRUST_DOMAIN_MULTIPLIER ( 60 ) -#define LSA_REF_DOMAIN_LIST_MULTIPLIER ( 32 ) -#define LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER ( 82 ) -#define LSA_CLIENT_REVISION_NO_DNS ( 0x00000001 ) -#define LSA_CLIENT_REVISION_DNS ( 0x00000002 ) -#define LSA_LOOKUP_OPTIONS_NO_ISOLATED ( 0x80000000 ) -struct lsa_String { - uint16_t length;/* [value(2*strlen_m(string))] */ - uint16_t size;/* [value(2*strlen_m(string))] */ - const char *string;/* [unique,charset(UTF16),length_is(length/2),size_is(size/2)] */ -}/* [public] */; - -struct lsa_StringLarge { - uint16_t length;/* [value(2*strlen_m(string))] */ - uint16_t size;/* [value(2*strlen_m_term(string))] */ - const char *string;/* [unique,charset(UTF16),length_is(length/2),size_is(size/2)] */ -}/* [public] */; - -struct lsa_Strings { - uint32_t count; - struct lsa_String *names;/* [unique,size_is(count)] */ -}/* [public] */; - -struct lsa_AsciiString { - uint16_t length;/* [value(strlen_m(string))] */ - uint16_t size;/* [value(strlen_m(string))] */ - const char *string;/* [unique,charset(DOS),length_is(length),size_is(size)] */ -}/* [public] */; - -struct lsa_AsciiStringLarge { - uint16_t length;/* [value(strlen_m(string))] */ - uint16_t size;/* [value(strlen_m_term(string))] */ - const char *string;/* [unique,charset(DOS),length_is(length),size_is(size)] */ -}/* [public] */; - -struct lsa_BinaryString { - uint16_t length; - uint16_t size; - uint16_t *array;/* [unique,length_is(length/2),size_is(size/2)] */ -}/* [public] */; - -struct lsa_LUID { - uint32_t low; - uint32_t high; -}; - -struct lsa_PrivEntry { - struct lsa_StringLarge name; - struct lsa_LUID luid; -}; - -struct lsa_PrivArray { - uint32_t count; - struct lsa_PrivEntry *privs;/* [unique,size_is(count)] */ -}; - -struct lsa_QosInfo { - uint32_t len; - uint16_t impersonation_level; - uint8_t context_mode; - uint8_t effective_only; -}; - -struct lsa_ObjectAttribute { - uint32_t len; - uint8_t *root_dir;/* [unique] */ - const char *object_name;/* [unique,charset(UTF16)] */ - uint32_t attributes; - struct security_descriptor *sec_desc;/* [unique] */ - struct lsa_QosInfo *sec_qos;/* [unique] */ -}; - -/* bitmap lsa_PolicyAccessMask */ -#define LSA_POLICY_VIEW_LOCAL_INFORMATION ( 0x00000001 ) -#define LSA_POLICY_VIEW_AUDIT_INFORMATION ( 0x00000002 ) -#define LSA_POLICY_GET_PRIVATE_INFORMATION ( 0x00000004 ) -#define LSA_POLICY_TRUST_ADMIN ( 0x00000008 ) -#define LSA_POLICY_CREATE_ACCOUNT ( 0x00000010 ) -#define LSA_POLICY_CREATE_SECRET ( 0x00000020 ) -#define LSA_POLICY_CREATE_PRIVILEGE ( 0x00000040 ) -#define LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS ( 0x00000080 ) -#define LSA_POLICY_SET_AUDIT_REQUIREMENTS ( 0x00000100 ) -#define LSA_POLICY_AUDIT_LOG_ADMIN ( 0x00000200 ) -#define LSA_POLICY_SERVER_ADMIN ( 0x00000400 ) -#define LSA_POLICY_LOOKUP_NAMES ( 0x00000800 ) - -struct lsa_AuditLogInfo { - uint32_t percent_full; - uint32_t maximum_log_size; - uint64_t retention_time; - uint8_t shutdown_in_progress; - uint64_t time_to_shutdown; - uint32_t next_audit_record; -}; - -enum lsa_PolicyAuditPolicy -#ifndef USE_UINT_ENUMS - { - LSA_AUDIT_POLICY_NONE=0, - LSA_AUDIT_POLICY_SUCCESS=1, - LSA_AUDIT_POLICY_FAILURE=2, - LSA_AUDIT_POLICY_ALL=(LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE), - LSA_AUDIT_POLICY_CLEAR=4 -} -#else - { __donnot_use_enum_lsa_PolicyAuditPolicy=0x7FFFFFFF} -#define LSA_AUDIT_POLICY_NONE ( 0 ) -#define LSA_AUDIT_POLICY_SUCCESS ( 1 ) -#define LSA_AUDIT_POLICY_FAILURE ( 2 ) -#define LSA_AUDIT_POLICY_ALL ( (LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE) ) -#define LSA_AUDIT_POLICY_CLEAR ( 4 ) -#endif -; - -enum lsa_PolicyAuditEventType -#ifndef USE_UINT_ENUMS - { - LSA_AUDIT_CATEGORY_SYSTEM=0, - LSA_AUDIT_CATEGORY_LOGON=1, - LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS=2, - LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS=3, - LSA_AUDIT_CATEGORY_PROCCESS_TRACKING=4, - LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES=5, - LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT=6, - LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS=7, - LSA_AUDIT_CATEGORY_ACCOUNT_LOGON=8 -} -#else - { __donnot_use_enum_lsa_PolicyAuditEventType=0x7FFFFFFF} -#define LSA_AUDIT_CATEGORY_SYSTEM ( 0 ) -#define LSA_AUDIT_CATEGORY_LOGON ( 1 ) -#define LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS ( 2 ) -#define LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS ( 3 ) -#define LSA_AUDIT_CATEGORY_PROCCESS_TRACKING ( 4 ) -#define LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES ( 5 ) -#define LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT ( 6 ) -#define LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS ( 7 ) -#define LSA_AUDIT_CATEGORY_ACCOUNT_LOGON ( 8 ) -#endif -; - -struct lsa_AuditEventsInfo { - uint32_t auditing_mode; - enum lsa_PolicyAuditPolicy *settings;/* [unique,size_is(count)] */ - uint32_t count; -}; - -struct lsa_DomainInfo { - struct lsa_StringLarge name; - struct dom_sid2 *sid;/* [unique] */ -}; - -struct lsa_PDAccountInfo { - struct lsa_String name; -}; - -enum lsa_Role -#ifndef USE_UINT_ENUMS - { - LSA_ROLE_BACKUP=2, - LSA_ROLE_PRIMARY=3 -} -#else - { __donnot_use_enum_lsa_Role=0x7FFFFFFF} -#define LSA_ROLE_BACKUP ( 2 ) -#define LSA_ROLE_PRIMARY ( 3 ) -#endif -; - -struct lsa_ServerRole { - enum lsa_Role role; -}; - -struct lsa_ReplicaSourceInfo { - struct lsa_String source; - struct lsa_String account; -}; - -struct lsa_DefaultQuotaInfo { - uint32_t paged_pool; - uint32_t non_paged_pool; - uint32_t min_wss; - uint32_t max_wss; - uint32_t pagefile; - uint64_t unknown; -}; - -struct lsa_ModificationInfo { - uint64_t modified_id; - NTTIME db_create_time; -}; - -struct lsa_AuditFullSetInfo { - uint8_t shutdown_on_full; -}; - -struct lsa_AuditFullQueryInfo { - uint8_t shutdown_on_full; - uint8_t log_is_full; -}; - -struct lsa_DnsDomainInfo { - struct lsa_StringLarge name; - struct lsa_StringLarge dns_domain; - struct lsa_StringLarge dns_forest; - struct GUID domain_guid; - struct dom_sid2 *sid;/* [unique] */ -}; - -enum lsa_PolicyInfo -#ifndef USE_UINT_ENUMS - { - LSA_POLICY_INFO_AUDIT_LOG=1, - LSA_POLICY_INFO_AUDIT_EVENTS=2, - LSA_POLICY_INFO_DOMAIN=3, - LSA_POLICY_INFO_PD=4, - LSA_POLICY_INFO_ACCOUNT_DOMAIN=5, - LSA_POLICY_INFO_ROLE=6, - LSA_POLICY_INFO_REPLICA=7, - LSA_POLICY_INFO_QUOTA=8, - LSA_POLICY_INFO_MOD=9, - LSA_POLICY_INFO_AUDIT_FULL_SET=10, - LSA_POLICY_INFO_AUDIT_FULL_QUERY=11, - LSA_POLICY_INFO_DNS=12, - LSA_POLICY_INFO_DNS_INT=13, - LSA_POLICY_INFO_L_ACCOUNT_DOMAIN=14 -} -#else - { __donnot_use_enum_lsa_PolicyInfo=0x7FFFFFFF} -#define LSA_POLICY_INFO_AUDIT_LOG ( 1 ) -#define LSA_POLICY_INFO_AUDIT_EVENTS ( 2 ) -#define LSA_POLICY_INFO_DOMAIN ( 3 ) -#define LSA_POLICY_INFO_PD ( 4 ) -#define LSA_POLICY_INFO_ACCOUNT_DOMAIN ( 5 ) -#define LSA_POLICY_INFO_ROLE ( 6 ) -#define LSA_POLICY_INFO_REPLICA ( 7 ) -#define LSA_POLICY_INFO_QUOTA ( 8 ) -#define LSA_POLICY_INFO_MOD ( 9 ) -#define LSA_POLICY_INFO_AUDIT_FULL_SET ( 10 ) -#define LSA_POLICY_INFO_AUDIT_FULL_QUERY ( 11 ) -#define LSA_POLICY_INFO_DNS ( 12 ) -#define LSA_POLICY_INFO_DNS_INT ( 13 ) -#define LSA_POLICY_INFO_L_ACCOUNT_DOMAIN ( 14 ) -#endif -; - -union lsa_PolicyInformation { - struct lsa_AuditLogInfo audit_log;/* [case(LSA_POLICY_INFO_AUDIT_LOG)] */ - struct lsa_AuditEventsInfo audit_events;/* [case(LSA_POLICY_INFO_AUDIT_EVENTS)] */ - struct lsa_DomainInfo domain;/* [case(LSA_POLICY_INFO_DOMAIN)] */ - struct lsa_PDAccountInfo pd;/* [case(LSA_POLICY_INFO_PD)] */ - struct lsa_DomainInfo account_domain;/* [case(LSA_POLICY_INFO_ACCOUNT_DOMAIN)] */ - struct lsa_ServerRole role;/* [case(LSA_POLICY_INFO_ROLE)] */ - struct lsa_ReplicaSourceInfo replica;/* [case(LSA_POLICY_INFO_REPLICA)] */ - struct lsa_DefaultQuotaInfo quota;/* [case(LSA_POLICY_INFO_QUOTA)] */ - struct lsa_ModificationInfo mod;/* [case(LSA_POLICY_INFO_MOD)] */ - struct lsa_AuditFullSetInfo auditfullset;/* [case(LSA_POLICY_INFO_AUDIT_FULL_SET)] */ - struct lsa_AuditFullQueryInfo auditfullquery;/* [case(LSA_POLICY_INFO_AUDIT_FULL_QUERY)] */ - struct lsa_DnsDomainInfo dns;/* [case(LSA_POLICY_INFO_DNS)] */ - struct lsa_DomainInfo l_account_domain;/* [case(LSA_POLICY_INFO_L_ACCOUNT_DOMAIN)] */ -}/* [switch_type(uint16)] */; - -struct lsa_SidPtr { - struct dom_sid2 *sid;/* [unique] */ -}; - -struct lsa_SidArray { - uint32_t num_sids;/* [range(0,1000)] */ - struct lsa_SidPtr *sids;/* [unique,size_is(num_sids)] */ -}/* [public] */; - -struct lsa_DomainList { - uint32_t count; - struct lsa_DomainInfo *domains;/* [unique,size_is(count)] */ -}; - -enum lsa_SidType -#ifndef USE_UINT_ENUMS - { - SID_NAME_USE_NONE=0, - SID_NAME_USER=1, - SID_NAME_DOM_GRP=2, - SID_NAME_DOMAIN=3, - SID_NAME_ALIAS=4, - SID_NAME_WKN_GRP=5, - SID_NAME_DELETED=6, - SID_NAME_INVALID=7, - SID_NAME_UNKNOWN=8, - SID_NAME_COMPUTER=9 -} -#else - { __donnot_use_enum_lsa_SidType=0x7FFFFFFF} -#define SID_NAME_USE_NONE ( 0 ) -#define SID_NAME_USER ( 1 ) -#define SID_NAME_DOM_GRP ( 2 ) -#define SID_NAME_DOMAIN ( 3 ) -#define SID_NAME_ALIAS ( 4 ) -#define SID_NAME_WKN_GRP ( 5 ) -#define SID_NAME_DELETED ( 6 ) -#define SID_NAME_INVALID ( 7 ) -#define SID_NAME_UNKNOWN ( 8 ) -#define SID_NAME_COMPUTER ( 9 ) -#endif -; - -struct lsa_TranslatedSid { - enum lsa_SidType sid_type; - uint32_t rid; - uint32_t sid_index; -}; - -struct lsa_TransSidArray { - uint32_t count;/* [range(0,1000)] */ - struct lsa_TranslatedSid *sids;/* [unique,size_is(count)] */ -}; - -struct lsa_RefDomainList { - uint32_t count;/* [range(0,1000)] */ - struct lsa_DomainInfo *domains;/* [unique,size_is(count)] */ - uint32_t max_size; -}; - -enum lsa_LookupNamesLevel -#ifndef USE_UINT_ENUMS - { - LSA_LOOKUP_NAMES_ALL=1, - LSA_LOOKUP_NAMES_DOMAINS_ONLY=2, - LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY=3, - LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY=4, - LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY=5, - LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2=6, - LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC=7 -} -#else - { __donnot_use_enum_lsa_LookupNamesLevel=0x7FFFFFFF} -#define LSA_LOOKUP_NAMES_ALL ( 1 ) -#define LSA_LOOKUP_NAMES_DOMAINS_ONLY ( 2 ) -#define LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY ( 3 ) -#define LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY ( 4 ) -#define LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY ( 5 ) -#define LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 ( 6 ) -#define LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC ( 7 ) -#endif -; - -struct lsa_TranslatedName { - enum lsa_SidType sid_type; - struct lsa_String name; - uint32_t sid_index; -}; - -struct lsa_TransNameArray { - uint32_t count;/* [range(0,1000)] */ - struct lsa_TranslatedName *names;/* [unique,size_is(count)] */ -}; - -struct lsa_LUIDAttribute { - struct lsa_LUID luid; - uint32_t attribute; -}; - -struct lsa_PrivilegeSet { - uint32_t count;/* [range(0,1000)] */ - uint32_t unknown; - struct lsa_LUIDAttribute *set;/* [size_is(count)] */ -}; - -/* bitmap lsa_SystemAccessModeFlags */ -#define LSA_POLICY_MODE_INTERACTIVE ( 0x00000001 ) -#define LSA_POLICY_MODE_NETWORK ( 0x00000002 ) -#define LSA_POLICY_MODE_BATCH ( 0x00000004 ) -#define LSA_POLICY_MODE_SERVICE ( 0x00000010 ) -#define LSA_POLICY_MODE_PROXY ( 0x00000020 ) -#define LSA_POLICY_MODE_DENY_INTERACTIVE ( 0x00000040 ) -#define LSA_POLICY_MODE_DENY_NETWORK ( 0x00000080 ) -#define LSA_POLICY_MODE_DENY_BATCH ( 0x00000100 ) -#define LSA_POLICY_MODE_DENY_SERVICE ( 0x00000200 ) -#define LSA_POLICY_MODE_REMOTE_INTERACTIVE ( 0x00000400 ) -#define LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE ( 0x00000800 ) -#define LSA_POLICY_MODE_ALL ( 0x00000FF7 ) -#define LSA_POLICY_MODE_ALL_NT4 ( 0x00000037 ) - -struct lsa_DATA_BUF { - uint32_t length; - uint32_t size; - uint8_t *data;/* [unique,length_is(length),size_is(size)] */ -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct lsa_DATA_BUF2 { - uint32_t size;/* [range(0,65536)] */ - uint8_t *data;/* [unique,size_is(size)] */ -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -enum lsa_TrustDomInfoEnum -#ifndef USE_UINT_ENUMS - { - LSA_TRUSTED_DOMAIN_INFO_NAME=1, - LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS=2, - LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET=3, - LSA_TRUSTED_DOMAIN_INFO_PASSWORD=4, - LSA_TRUSTED_DOMAIN_INFO_BASIC=5, - LSA_TRUSTED_DOMAIN_INFO_INFO_EX=6, - LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO=7, - LSA_TRUSTED_DOMAIN_INFO_FULL_INFO=8, - LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL=9, - LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL=10, - LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL=11, - LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL=12, - LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES=13 -} -#else - { __donnot_use_enum_lsa_TrustDomInfoEnum=0x7FFFFFFF} -#define LSA_TRUSTED_DOMAIN_INFO_NAME ( 1 ) -#define LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS ( 2 ) -#define LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET ( 3 ) -#define LSA_TRUSTED_DOMAIN_INFO_PASSWORD ( 4 ) -#define LSA_TRUSTED_DOMAIN_INFO_BASIC ( 5 ) -#define LSA_TRUSTED_DOMAIN_INFO_INFO_EX ( 6 ) -#define LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO ( 7 ) -#define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO ( 8 ) -#define LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL ( 9 ) -#define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL ( 10 ) -#define LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL ( 11 ) -#define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL ( 12 ) -#define LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES ( 13 ) -#endif -; - -/* bitmap lsa_TrustDirection */ -#define LSA_TRUST_DIRECTION_INBOUND ( 0x00000001 ) -#define LSA_TRUST_DIRECTION_OUTBOUND ( 0x00000002 ) - -enum lsa_TrustType -#ifndef USE_UINT_ENUMS - { - LSA_TRUST_TYPE_DOWNLEVEL=0x00000001, - LSA_TRUST_TYPE_UPLEVEL=0x00000002, - LSA_TRUST_TYPE_MIT=0x00000003 -} -#else - { __donnot_use_enum_lsa_TrustType=0x7FFFFFFF} -#define LSA_TRUST_TYPE_DOWNLEVEL ( 0x00000001 ) -#define LSA_TRUST_TYPE_UPLEVEL ( 0x00000002 ) -#define LSA_TRUST_TYPE_MIT ( 0x00000003 ) -#endif -; - -/* bitmap lsa_TrustAttributes */ -#define LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE ( 0x00000001 ) -#define LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY ( 0x00000002 ) -#define LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN ( 0x00000004 ) -#define LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE ( 0x00000008 ) -#define LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION ( 0x00000010 ) -#define LSA_TRUST_ATTRIBUTE_WITHIN_FOREST ( 0x00000020 ) -#define LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL ( 0x00000040 ) -#define LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION ( 0x00000080 ) - -struct lsa_TrustDomainInfoName { - struct lsa_StringLarge netbios_name; -}; - -struct lsa_TrustDomainInfoControllers { - uint32_t entries; - struct lsa_StringLarge *netbios_names;/* [unique,size_is(entries)] */ -}; - -struct lsa_TrustDomainInfoPosixOffset { - uint32_t posix_offset; -}; - -struct lsa_TrustDomainInfoPassword { - struct lsa_DATA_BUF *password;/* [unique] */ - struct lsa_DATA_BUF *old_password;/* [unique] */ -}; - -struct lsa_TrustDomainInfoBasic { - struct lsa_String netbios_name; - struct dom_sid2 *sid;/* [unique] */ -}; - -struct lsa_TrustDomainInfoInfoEx { - struct lsa_StringLarge domain_name; - struct lsa_StringLarge netbios_name; - struct dom_sid2 *sid;/* [unique] */ - uint32_t trust_direction; - enum lsa_TrustType trust_type; - uint32_t trust_attributes; -}; - -enum lsa_TrustAuthType -#ifndef USE_UINT_ENUMS - { - TRUST_AUTH_TYPE_NONE=0, - TRUST_AUTH_TYPE_NT4OWF=1, - TRUST_AUTH_TYPE_CLEAR=2, - TRUST_AUTH_TYPE_VERSION=3 -} -#else - { __donnot_use_enum_lsa_TrustAuthType=0x7FFFFFFF} -#define TRUST_AUTH_TYPE_NONE ( 0 ) -#define TRUST_AUTH_TYPE_NT4OWF ( 1 ) -#define TRUST_AUTH_TYPE_CLEAR ( 2 ) -#define TRUST_AUTH_TYPE_VERSION ( 3 ) -#endif -; - -struct lsa_TrustDomainInfoBuffer { - NTTIME last_update_time; - enum lsa_TrustAuthType AuthType; - struct lsa_DATA_BUF2 data; -}; - -struct lsa_TrustDomainInfoAuthInfo { - uint32_t incoming_count; - struct lsa_TrustDomainInfoBuffer *incoming_current_auth_info;/* [unique] */ - struct lsa_TrustDomainInfoBuffer *incoming_previous_auth_info;/* [unique] */ - uint32_t outgoing_count; - struct lsa_TrustDomainInfoBuffer *outgoing_current_auth_info;/* [unique] */ - struct lsa_TrustDomainInfoBuffer *outgoing_previous_auth_info;/* [unique] */ -}; - -struct lsa_TrustDomainInfoFullInfo { - struct lsa_TrustDomainInfoInfoEx info_ex; - struct lsa_TrustDomainInfoPosixOffset posix_offset; - struct lsa_TrustDomainInfoAuthInfo auth_info; -}; - -struct lsa_TrustDomainInfoAuthInfoInternal { - struct lsa_DATA_BUF2 auth_blob; -}; - -struct lsa_TrustDomainInfoFullInfoInternal { - struct lsa_TrustDomainInfoInfoEx info_ex; - struct lsa_TrustDomainInfoPosixOffset posix_offset; - struct lsa_TrustDomainInfoAuthInfoInternal auth_info; -}; - -struct lsa_TrustDomainInfoInfoEx2Internal { - struct lsa_TrustDomainInfoInfoEx info_ex; - uint32_t forest_trust_length; - uint8_t *forest_trust_data;/* [unique,size_is(forest_trust_length)] */ -}; - -struct lsa_TrustDomainInfoFullInfo2Internal { - struct lsa_TrustDomainInfoInfoEx2Internal info; - struct lsa_TrustDomainInfoPosixOffset posix_offset; - struct lsa_TrustDomainInfoAuthInfo auth_info; -}; - -struct lsa_TrustDomainInfoSupportedEncTypes { - uint32_t enc_types; -}; - -union lsa_TrustedDomainInfo { - struct lsa_TrustDomainInfoName name;/* [case(LSA_TRUSTED_DOMAIN_INFO_NAME)] */ - struct lsa_TrustDomainInfoControllers controllers;/* [case(LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS)] */ - struct lsa_TrustDomainInfoPosixOffset posix_offset;/* [case(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)] */ - struct lsa_TrustDomainInfoPassword password;/* [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)] */ - struct lsa_TrustDomainInfoBasic info_basic;/* [case(LSA_TRUSTED_DOMAIN_INFO_BASIC)] */ - struct lsa_TrustDomainInfoInfoEx info_ex;/* [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)] */ - struct lsa_TrustDomainInfoAuthInfo auth_info;/* [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)] */ - struct lsa_TrustDomainInfoFullInfo full_info;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)] */ - struct lsa_TrustDomainInfoAuthInfoInternal auth_info_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL)] */ - struct lsa_TrustDomainInfoFullInfoInternal full_info_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL)] */ - struct lsa_TrustDomainInfoInfoEx2Internal info_ex2_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL)] */ - struct lsa_TrustDomainInfoFullInfo2Internal full_info2_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL)] */ - struct lsa_TrustDomainInfoSupportedEncTypes enc_types;/* [case(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES)] */ -}/* [switch_type(lsa_TrustDomInfoEnum)] */; - -struct lsa_DATA_BUF_PTR { - struct lsa_DATA_BUF *buf;/* [unique] */ -}; - -struct lsa_RightAttribute { - const char *name;/* [unique,charset(UTF16)] */ -}; - -struct lsa_RightSet { - uint32_t count;/* [range(0,256)] */ - struct lsa_StringLarge *names;/* [unique,size_is(count)] */ -}; - -struct lsa_DomainListEx { - uint32_t count; - struct lsa_TrustDomainInfoInfoEx *domains;/* [unique,size_is(count)] */ -}; - -struct lsa_DomainInfoKerberos { - uint32_t enforce_restrictions; - uint64_t service_tkt_lifetime; - uint64_t user_tkt_lifetime; - uint64_t user_tkt_renewaltime; - uint64_t clock_skew; - uint64_t unknown6; -}; - -struct lsa_DomainInfoEfs { - uint32_t blob_size; - uint8_t *efs_blob;/* [unique,size_is(blob_size)] */ -}; - -enum lsa_DomainInfoEnum -#ifndef USE_UINT_ENUMS - { - LSA_DOMAIN_INFO_POLICY_EFS=2, - LSA_DOMAIN_INFO_POLICY_KERBEROS=3 -} -#else - { __donnot_use_enum_lsa_DomainInfoEnum=0x7FFFFFFF} -#define LSA_DOMAIN_INFO_POLICY_EFS ( 2 ) -#define LSA_DOMAIN_INFO_POLICY_KERBEROS ( 3 ) -#endif -; - -union lsa_DomainInformationPolicy { - struct lsa_DomainInfoEfs efs_info;/* [case(LSA_DOMAIN_INFO_POLICY_EFS)] */ - struct lsa_DomainInfoKerberos kerberos_info;/* [case(LSA_DOMAIN_INFO_POLICY_KERBEROS)] */ -}/* [switch_type(uint16)] */; - -struct lsa_TranslatedName2 { - enum lsa_SidType sid_type; - struct lsa_String name; - uint32_t sid_index; - uint32_t unknown; -}; - -struct lsa_TransNameArray2 { - uint32_t count;/* [range(0,1000)] */ - struct lsa_TranslatedName2 *names;/* [unique,size_is(count)] */ -}; - -struct lsa_TranslatedSid2 { - enum lsa_SidType sid_type; - uint32_t rid; - uint32_t sid_index; - uint32_t unknown; -}; - -struct lsa_TransSidArray2 { - uint32_t count;/* [range(0,1000)] */ - struct lsa_TranslatedSid2 *sids;/* [unique,size_is(count)] */ -}; - -struct lsa_TranslatedSid3 { - enum lsa_SidType sid_type; - struct dom_sid2 *sid;/* [unique] */ - uint32_t sid_index; - uint32_t flags; -}; - -struct lsa_TransSidArray3 { - uint32_t count;/* [range(0,1000)] */ - struct lsa_TranslatedSid3 *sids;/* [unique,size_is(count)] */ -}; - -struct lsa_ForestTrustBinaryData { - uint32_t length;/* [range(0,131072)] */ - uint8_t *data;/* [unique,size_is(length)] */ -}; - -struct lsa_ForestTrustDomainInfo { - struct dom_sid2 *domain_sid;/* [unique] */ - struct lsa_StringLarge dns_domain_name; - struct lsa_StringLarge netbios_domain_name; -}; - -union lsa_ForestTrustData { - struct lsa_String top_level_name;/* [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME)] */ - struct lsa_StringLarge top_level_name_ex;/* [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX)] */ - struct lsa_ForestTrustDomainInfo domain_info;/* [case(LSA_FOREST_TRUST_DOMAIN_INFO)] */ - struct lsa_ForestTrustBinaryData data;/* [default] */ -}/* [switch_type(uint32)] */; - -enum lsa_ForestTrustRecordType -#ifndef USE_UINT_ENUMS - { - LSA_FOREST_TRUST_TOP_LEVEL_NAME=0, - LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX=1, - LSA_FOREST_TRUST_DOMAIN_INFO=2, - LSA_FOREST_TRUST_RECORD_TYPE_LAST=3 -} -#else - { __donnot_use_enum_lsa_ForestTrustRecordType=0x7FFFFFFF} -#define LSA_FOREST_TRUST_TOP_LEVEL_NAME ( 0 ) -#define LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX ( 1 ) -#define LSA_FOREST_TRUST_DOMAIN_INFO ( 2 ) -#define LSA_FOREST_TRUST_RECORD_TYPE_LAST ( 3 ) -#endif -; - -struct lsa_ForestTrustRecord { - uint32_t flags; - enum lsa_ForestTrustRecordType level; - uint64_t unknown; - union lsa_ForestTrustData forest_trust_data;/* [switch_is(level)] */ -}; - -struct lsa_ForestTrustInformation { - uint32_t count;/* [range(0,4000)] */ - struct lsa_ForestTrustRecord **entries;/* [unique,size_is(count)] */ -}/* [public] */; - - -struct lsa_Close { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_Delete { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_EnumPrivs { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t max_count; - uint32_t *resume_handle;/* [ref] */ - } in; - - struct { - struct lsa_PrivArray *privs;/* [ref] */ - uint32_t *resume_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_QuerySecurity { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t sec_info; - } in; - - struct { - struct sec_desc_buf **sdbuf;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_SetSecObj { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t sec_info; - struct sec_desc_buf *sdbuf;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_ChangePassword { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_OpenPolicy { - struct { - uint16_t *system_name;/* [unique] */ - struct lsa_ObjectAttribute *attr;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_QueryInfoPolicy { - struct { - struct policy_handle *handle;/* [ref] */ - enum lsa_PolicyInfo level; - } in; - - struct { - union lsa_PolicyInformation **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_SetInfoPolicy { - struct { - struct policy_handle *handle;/* [ref] */ - enum lsa_PolicyInfo level; - union lsa_PolicyInformation *info;/* [ref,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_ClearAuditLog { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_CreateAccount { - struct { - struct policy_handle *handle;/* [ref] */ - struct dom_sid2 *sid;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *acct_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_EnumAccounts { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t num_entries;/* [range(0,8192)] */ - uint32_t *resume_handle;/* [ref] */ - } in; - - struct { - struct lsa_SidArray *sids;/* [ref] */ - uint32_t *resume_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_CreateTrustedDomain { - struct { - struct policy_handle *policy_handle;/* [ref] */ - struct lsa_DomainInfo *info;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *trustdom_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_EnumTrustDom { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t max_size; - uint32_t *resume_handle;/* [ref] */ - } in; - - struct { - struct lsa_DomainList *domains;/* [ref] */ - uint32_t *resume_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupNames { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t num_names;/* [range(0,1000)] */ - struct lsa_String *names;/* [size_is(num_names)] */ - enum lsa_LookupNamesLevel level; - struct lsa_TransSidArray *sids;/* [ref] */ - uint32_t *count;/* [ref] */ - } in; - - struct { - struct lsa_RefDomainList **domains;/* [ref] */ - struct lsa_TransSidArray *sids;/* [ref] */ - uint32_t *count;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupSids { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_SidArray *sids;/* [ref] */ - uint16_t level; - struct lsa_TransNameArray *names;/* [ref] */ - uint32_t *count;/* [ref] */ - } in; - - struct { - struct lsa_RefDomainList **domains;/* [ref] */ - struct lsa_TransNameArray *names;/* [ref] */ - uint32_t *count;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_CreateSecret { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String name; - uint32_t access_mask; - } in; - - struct { - struct policy_handle *sec_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_OpenAccount { - struct { - struct policy_handle *handle;/* [ref] */ - struct dom_sid2 *sid;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *acct_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_EnumPrivsAccount { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct lsa_PrivilegeSet **privs;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_AddPrivilegesToAccount { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_PrivilegeSet *privs;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_RemovePrivilegesFromAccount { - struct { - struct policy_handle *handle;/* [ref] */ - uint8_t remove_all; - struct lsa_PrivilegeSet *privs;/* [unique] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_GetQuotasForAccount { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_SetQuotasForAccount { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_GetSystemAccessAccount { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - uint32_t *access_mask;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_SetSystemAccessAccount { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_OpenTrustedDomain { - struct { - struct policy_handle *handle;/* [ref] */ - struct dom_sid2 *sid;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *trustdom_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_QueryTrustedDomainInfo { - struct { - struct policy_handle *trustdom_handle;/* [ref] */ - enum lsa_TrustDomInfoEnum level; - } in; - - struct { - union lsa_TrustedDomainInfo **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_SetInformationTrustedDomain { - struct { - struct policy_handle *trustdom_handle;/* [ref] */ - enum lsa_TrustDomInfoEnum level; - union lsa_TrustedDomainInfo *info;/* [ref,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_OpenSecret { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String name; - uint32_t access_mask; - } in; - - struct { - struct policy_handle *sec_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_SetSecret { - struct { - struct policy_handle *sec_handle;/* [ref] */ - struct lsa_DATA_BUF *new_val;/* [unique] */ - struct lsa_DATA_BUF *old_val;/* [unique] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_QuerySecret { - struct { - struct policy_handle *sec_handle;/* [ref] */ - struct lsa_DATA_BUF_PTR *new_val;/* [unique] */ - NTTIME *new_mtime;/* [unique] */ - struct lsa_DATA_BUF_PTR *old_val;/* [unique] */ - NTTIME *old_mtime;/* [unique] */ - } in; - - struct { - struct lsa_DATA_BUF_PTR *new_val;/* [unique] */ - NTTIME *new_mtime;/* [unique] */ - struct lsa_DATA_BUF_PTR *old_val;/* [unique] */ - NTTIME *old_mtime;/* [unique] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupPrivValue { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String *name;/* [ref] */ - } in; - - struct { - struct lsa_LUID *luid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupPrivName { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_LUID *luid;/* [ref] */ - } in; - - struct { - struct lsa_StringLarge **name;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupPrivDisplayName { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String *name;/* [ref] */ - uint16_t language_id; - uint16_t language_id_sys; - } in; - - struct { - struct lsa_StringLarge **disp_name;/* [ref] */ - uint16_t *returned_language_id;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_DeleteObject { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_EnumAccountsWithUserRight { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String *name;/* [unique] */ - } in; - - struct { - struct lsa_SidArray *sids;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_EnumAccountRights { - struct { - struct policy_handle *handle;/* [ref] */ - struct dom_sid2 *sid;/* [ref] */ - } in; - - struct { - struct lsa_RightSet *rights;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_AddAccountRights { - struct { - struct policy_handle *handle;/* [ref] */ - struct dom_sid2 *sid;/* [ref] */ - struct lsa_RightSet *rights;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_RemoveAccountRights { - struct { - struct policy_handle *handle;/* [ref] */ - struct dom_sid2 *sid;/* [ref] */ - uint8_t remove_all; - struct lsa_RightSet *rights;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_QueryTrustedDomainInfoBySid { - struct { - struct policy_handle *handle;/* [ref] */ - struct dom_sid2 *dom_sid;/* [ref] */ - enum lsa_TrustDomInfoEnum level; - } in; - - struct { - union lsa_TrustedDomainInfo **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_SetTrustedDomainInfo { - struct { - struct policy_handle *handle;/* [ref] */ - struct dom_sid2 *dom_sid;/* [ref] */ - enum lsa_TrustDomInfoEnum level; - union lsa_TrustedDomainInfo *info;/* [ref,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_DeleteTrustedDomain { - struct { - struct policy_handle *handle;/* [ref] */ - struct dom_sid2 *dom_sid;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_StorePrivateData { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_RetrievePrivateData { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_OpenPolicy2 { - struct { - const char *system_name;/* [unique,charset(UTF16)] */ - struct lsa_ObjectAttribute *attr;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_GetUserName { - struct { - const char *system_name;/* [unique,charset(UTF16)] */ - struct lsa_String **account_name;/* [ref] */ - struct lsa_String **authority_name;/* [unique] */ - } in; - - struct { - struct lsa_String **account_name;/* [ref] */ - struct lsa_String **authority_name;/* [unique] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_QueryInfoPolicy2 { - struct { - struct policy_handle *handle;/* [ref] */ - enum lsa_PolicyInfo level; - } in; - - struct { - union lsa_PolicyInformation **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_SetInfoPolicy2 { - struct { - struct policy_handle *handle;/* [ref] */ - enum lsa_PolicyInfo level; - union lsa_PolicyInformation *info;/* [ref,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_QueryTrustedDomainInfoByName { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String *trusted_domain;/* [ref] */ - enum lsa_TrustDomInfoEnum level; - } in; - - struct { - union lsa_TrustedDomainInfo **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_SetTrustedDomainInfoByName { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String trusted_domain; - enum lsa_TrustDomInfoEnum level; - union lsa_TrustedDomainInfo *info;/* [unique,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_EnumTrustedDomainsEx { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t max_size; - uint32_t *resume_handle;/* [ref] */ - } in; - - struct { - struct lsa_DomainListEx *domains;/* [ref] */ - uint32_t *resume_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_CreateTrustedDomainEx { - struct { - struct policy_handle *policy_handle;/* [ref] */ - struct lsa_TrustDomainInfoInfoEx *info;/* [ref] */ - struct lsa_TrustDomainInfoAuthInfoInternal *auth_info;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *trustdom_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_CloseTrustedDomainEx { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_QueryDomainInformationPolicy { - struct { - struct policy_handle *handle;/* [ref] */ - uint16_t level; - } in; - - struct { - union lsa_DomainInformationPolicy **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_SetDomainInformationPolicy { - struct { - struct policy_handle *handle;/* [ref] */ - uint16_t level; - union lsa_DomainInformationPolicy *info;/* [unique,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_OpenTrustedDomainByName { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String name; - uint32_t access_mask; - } in; - - struct { - struct policy_handle *trustdom_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_TestCall { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupSids2 { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_SidArray *sids;/* [ref] */ - uint16_t level; - uint32_t unknown1; - uint32_t unknown2; - struct lsa_TransNameArray2 *names;/* [ref] */ - uint32_t *count;/* [ref] */ - } in; - - struct { - struct lsa_RefDomainList **domains;/* [ref] */ - struct lsa_TransNameArray2 *names;/* [ref] */ - uint32_t *count;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupNames2 { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t num_names;/* [range(0,1000)] */ - struct lsa_String *names;/* [size_is(num_names)] */ - enum lsa_LookupNamesLevel level; - uint32_t lookup_options; - uint32_t client_revision; - struct lsa_TransSidArray2 *sids;/* [ref] */ - uint32_t *count;/* [ref] */ - } in; - - struct { - struct lsa_RefDomainList **domains;/* [ref] */ - struct lsa_TransSidArray2 *sids;/* [ref] */ - uint32_t *count;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_CreateTrustedDomainEx2 { - struct { - struct policy_handle *policy_handle;/* [ref] */ - struct lsa_TrustDomainInfoInfoEx *info;/* [ref] */ - struct lsa_TrustDomainInfoAuthInfoInternal *auth_info;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *trustdom_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRWRITE { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRREAD { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRENUMERATE { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRWRITEDOMAINCREDENTIALS { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRREADDOMAINCREDENTIALS { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRDELETE { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRGETTARGETINFO { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRPROFILELOADED { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupNames3 { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t num_names;/* [range(0,1000)] */ - struct lsa_String *names;/* [size_is(num_names)] */ - enum lsa_LookupNamesLevel level; - uint32_t lookup_options; - uint32_t client_revision; - struct lsa_TransSidArray3 *sids;/* [ref] */ - uint32_t *count;/* [ref] */ - } in; - - struct { - struct lsa_RefDomainList **domains;/* [ref] */ - struct lsa_TransSidArray3 *sids;/* [ref] */ - uint32_t *count;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRGETSESSIONTYPES { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_LSARREGISTERAUDITEVENT { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_LSARGENAUDITEVENT { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_LSARUNREGISTERAUDITEVENT { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_lsaRQueryForestTrustInformation { - struct { - struct policy_handle *handle;/* [ref] */ - struct lsa_String *trusted_domain_name;/* [ref] */ - uint16_t unknown; - } in; - - struct { - struct lsa_ForestTrustInformation **forest_trust_info;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_LSARSETFORESTTRUSTINFORMATION { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_CREDRRENAME { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupSids3 { - struct { - struct lsa_SidArray *sids;/* [ref] */ - uint16_t level; - uint32_t unknown1; - uint32_t unknown2; - struct lsa_TransNameArray2 *names;/* [ref] */ - uint32_t *count;/* [ref] */ - } in; - - struct { - struct lsa_RefDomainList **domains;/* [ref] */ - struct lsa_TransNameArray2 *names;/* [ref] */ - uint32_t *count;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_LookupNames4 { - struct { - uint32_t num_names;/* [range(0,1000)] */ - struct lsa_String *names;/* [size_is(num_names)] */ - enum lsa_LookupNamesLevel level; - uint32_t lookup_options; - uint32_t client_revision; - struct lsa_TransSidArray3 *sids;/* [ref] */ - uint32_t *count;/* [ref] */ - } in; - - struct { - struct lsa_RefDomainList **domains;/* [ref] */ - struct lsa_TransSidArray3 *sids;/* [ref] */ - uint32_t *count;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct lsa_LSAROPENPOLICYSCE { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE { - struct { - NTSTATUS result; - } out; - -}; - - -struct lsa_LSARADTREPORTSECURITYEVENT { - struct { - NTSTATUS result; - } out; - -}; - -#endif /* _HEADER_lsarpc */ diff --git a/source3/librpc/gen_ndr/misc.h b/source3/librpc/gen_ndr/misc.h deleted file mode 100644 index de4abdcae5..0000000000 --- a/source3/librpc/gen_ndr/misc.h +++ /dev/null @@ -1,45 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#ifndef _HEADER_misc -#define _HEADER_misc - -struct GUID { - uint32_t time_low; - uint16_t time_mid; - uint16_t time_hi_and_version; - uint8_t clock_seq[2]; - uint8_t node[6]; -}/* [noprint,gensize,public] */; - -struct ndr_syntax_id { - struct GUID uuid; - uint32_t if_version; -}/* [public] */; - -struct policy_handle { - uint32_t handle_type; - struct GUID uuid; -}/* [public] */; - -enum netr_SchannelType -#ifndef USE_UINT_ENUMS - { - SEC_CHAN_NULL=0, - SEC_CHAN_WKSTA=2, - SEC_CHAN_DNS_DOMAIN=3, - SEC_CHAN_DOMAIN=4, - SEC_CHAN_BDC=6 -} -#else - { __donnot_use_enum_netr_SchannelType=0x7FFFFFFF} -#define SEC_CHAN_NULL ( 0 ) -#define SEC_CHAN_WKSTA ( 2 ) -#define SEC_CHAN_DNS_DOMAIN ( 3 ) -#define SEC_CHAN_DOMAIN ( 4 ) -#define SEC_CHAN_BDC ( 6 ) -#endif -; - -#endif /* _HEADER_misc */ diff --git a/source3/librpc/gen_ndr/named_pipe_auth.h b/source3/librpc/gen_ndr/named_pipe_auth.h deleted file mode 100644 index 5f4ba9afb1..0000000000 --- a/source3/librpc/gen_ndr/named_pipe_auth.h +++ /dev/null @@ -1,32 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/netlogon.h" -#ifndef _HEADER_named_pipe_auth -#define _HEADER_named_pipe_auth - -#define NAMED_PIPE_AUTH_MAGIC ( "NPAM" ) -union named_pipe_auth_req_info { - struct netr_SamInfo3 info1;/* [case] */ -}/* [switch_type(uint32)] */; - -struct named_pipe_auth_req { - uint32_t length;/* [value(ndr_size_named_pipe_auth_req(r,ndr->flags)-4),flag(LIBNDR_FLAG_BIGENDIAN)] */ - const char *magic;/* [value(NAMED_PIPE_AUTH_MAGIC),charset(DOS)] */ - uint32_t level; - union named_pipe_auth_req_info info;/* [switch_is(level)] */ -}/* [gensize,public] */; - -union named_pipe_auth_rep_info { -}/* [switch_type(uint32)] */; - -struct named_pipe_auth_rep { - uint32_t length;/* [value(ndr_size_named_pipe_auth_rep(r,ndr->flags)-4),flag(LIBNDR_FLAG_BIGENDIAN)] */ - const char *magic;/* [value(NAMED_PIPE_AUTH_MAGIC),charset(DOS)] */ - uint32_t level; - union named_pipe_auth_rep_info info;/* [switch_is(level)] */ - NTSTATUS status; -}/* [gensize,public] */; - -#endif /* _HEADER_named_pipe_auth */ diff --git a/source3/librpc/gen_ndr/nbt.h b/source3/librpc/gen_ndr/nbt.h deleted file mode 100644 index 4b872d7936..0000000000 --- a/source3/librpc/gen_ndr/nbt.h +++ /dev/null @@ -1,694 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/misc.h" -#include "librpc/gen_ndr/security.h" -#include "librpc/gen_ndr/svcctl.h" -#include "librpc/gen_ndr/samr.h" -#ifndef _HEADER_nbt -#define _HEADER_nbt - -#define NBT_NAME_SERVICE_PORT ( 137 ) -#define NBT_DGRAM_SERVICE_PORT ( 138 ) -#define NBT_MAILSLOT_NETLOGON ( "\\MAILSLOT\\NET\\NETLOGON" ) -#define NBT_MAILSLOT_NTLOGON ( "\\MAILSLOT\\NET\\NTLOGON" ) -#define NBT_MAILSLOT_GETDC ( "\\MAILSLOT\\NET\\GETDC" ) -#define NBT_MAILSLOT_BROWSE ( "\\MAILSLOT\\BROWSE" ) -#define DGRAM_SMB ( 0xff534d42 ) -/* bitmap nbt_operation */ -#define NBT_RCODE ( 0x000F ) -#define NBT_FLAG_BROADCAST ( 0x0010 ) -#define NBT_FLAG_RECURSION_AVAIL ( 0x0080 ) -#define NBT_FLAG_RECURSION_DESIRED ( 0x0100 ) -#define NBT_FLAG_TRUNCATION ( 0x0200 ) -#define NBT_FLAG_AUTHORITIVE ( 0x0400 ) -#define NBT_OPCODE ( 0x7800 ) -#define NBT_FLAG_REPLY ( 0x8000 ) - -enum nbt_opcode -#ifndef USE_UINT_ENUMS - { - NBT_OPCODE_QUERY=(0x0<<11), - NBT_OPCODE_REGISTER=(0x5<<11), - NBT_OPCODE_RELEASE=(0x6<<11), - NBT_OPCODE_WACK=(0x7<<11), - NBT_OPCODE_REFRESH=(0x8<<11), - NBT_OPCODE_REFRESH2=(0x9<<11), - NBT_OPCODE_MULTI_HOME_REG=(0xf<<11) -} -#else - { __donnot_use_enum_nbt_opcode=0x7FFFFFFF} -#define NBT_OPCODE_QUERY ( (0x0<<11) ) -#define NBT_OPCODE_REGISTER ( (0x5<<11) ) -#define NBT_OPCODE_RELEASE ( (0x6<<11) ) -#define NBT_OPCODE_WACK ( (0x7<<11) ) -#define NBT_OPCODE_REFRESH ( (0x8<<11) ) -#define NBT_OPCODE_REFRESH2 ( (0x9<<11) ) -#define NBT_OPCODE_MULTI_HOME_REG ( (0xf<<11) ) -#endif -; - -enum nbt_rcode -#ifndef USE_UINT_ENUMS - { - NBT_RCODE_OK=0x0, - NBT_RCODE_FMT=0x1, - NBT_RCODE_SVR=0x2, - NBT_RCODE_NAM=0x3, - NBT_RCODE_IMP=0x4, - NBT_RCODE_RFS=0x5, - NBT_RCODE_ACT=0x6, - NBT_RCODE_CFT=0x7 -} -#else - { __donnot_use_enum_nbt_rcode=0x7FFFFFFF} -#define NBT_RCODE_OK ( 0x0 ) -#define NBT_RCODE_FMT ( 0x1 ) -#define NBT_RCODE_SVR ( 0x2 ) -#define NBT_RCODE_NAM ( 0x3 ) -#define NBT_RCODE_IMP ( 0x4 ) -#define NBT_RCODE_RFS ( 0x5 ) -#define NBT_RCODE_ACT ( 0x6 ) -#define NBT_RCODE_CFT ( 0x7 ) -#endif -; - -enum nbt_name_type -#ifndef USE_UINT_ENUMS - { - NBT_NAME_CLIENT=0x00, - NBT_NAME_MS=0x01, - NBT_NAME_USER=0x03, - NBT_NAME_SERVER=0x20, - NBT_NAME_PDC=0x1B, - NBT_NAME_LOGON=0x1C, - NBT_NAME_MASTER=0x1D, - NBT_NAME_BROWSER=0x1E -} -#else - { __donnot_use_enum_nbt_name_type=0x7FFFFFFF} -#define NBT_NAME_CLIENT ( 0x00 ) -#define NBT_NAME_MS ( 0x01 ) -#define NBT_NAME_USER ( 0x03 ) -#define NBT_NAME_SERVER ( 0x20 ) -#define NBT_NAME_PDC ( 0x1B ) -#define NBT_NAME_LOGON ( 0x1C ) -#define NBT_NAME_MASTER ( 0x1D ) -#define NBT_NAME_BROWSER ( 0x1E ) -#endif -; - -struct nbt_name { - const char * name; - const char * scope; - enum nbt_name_type type; -}/* [nopull,public,nopush] */; - -enum nbt_qclass -#ifndef USE_UINT_ENUMS - { - NBT_QCLASS_IP=0x01 -} -#else - { __donnot_use_enum_nbt_qclass=0x7FFFFFFF} -#define NBT_QCLASS_IP ( 0x01 ) -#endif -; - -enum nbt_qtype -#ifndef USE_UINT_ENUMS - { - NBT_QTYPE_ADDRESS=0x0001, - NBT_QTYPE_NAMESERVICE=0x0002, - NBT_QTYPE_NULL=0x000A, - NBT_QTYPE_NETBIOS=0x0020, - NBT_QTYPE_STATUS=0x0021 -} -#else - { __donnot_use_enum_nbt_qtype=0x7FFFFFFF} -#define NBT_QTYPE_ADDRESS ( 0x0001 ) -#define NBT_QTYPE_NAMESERVICE ( 0x0002 ) -#define NBT_QTYPE_NULL ( 0x000A ) -#define NBT_QTYPE_NETBIOS ( 0x0020 ) -#define NBT_QTYPE_STATUS ( 0x0021 ) -#endif -; - -struct nbt_name_question { - struct nbt_name name; - enum nbt_qtype question_type; - enum nbt_qclass question_class; -}; - -enum nbt_node_type -#ifndef USE_UINT_ENUMS - { - NBT_NODE_B=0x0000, - NBT_NODE_P=0x2000, - NBT_NODE_M=0x4000, - NBT_NODE_H=0x6000 -} -#else - { __donnot_use_enum_nbt_node_type=0x7FFFFFFF} -#define NBT_NODE_B ( 0x0000 ) -#define NBT_NODE_P ( 0x2000 ) -#define NBT_NODE_M ( 0x4000 ) -#define NBT_NODE_H ( 0x6000 ) -#endif -; - -/* bitmap nb_flags */ -#define NBT_NM_PERMANENT ( 0x0200 ) -#define NBT_NM_ACTIVE ( 0x0400 ) -#define NBT_NM_CONFLICT ( 0x0800 ) -#define NBT_NM_DEREGISTER ( 0x1000 ) -#define NBT_NM_OWNER_TYPE ( 0x6000 ) -#define NBT_NM_GROUP ( 0x8000 ) - -struct nbt_rdata_address { - uint16_t nb_flags; - const char * ipaddr; -}; - -struct nbt_rdata_netbios { - uint16_t length; - struct nbt_rdata_address *addresses; -}; - -struct nbt_statistics { - uint8_t unit_id[6]; - uint8_t jumpers; - uint8_t test_result; - uint16_t version_number; - uint16_t period_of_statistics; - uint16_t number_of_crcs; - uint16_t number_alignment_errors; - uint16_t number_of_collisions; - uint16_t number_send_aborts; - uint32_t number_good_sends; - uint32_t number_good_receives; - uint16_t number_retransmits; - uint16_t number_no_resource_conditions; - uint16_t number_free_command_blocks; - uint16_t total_number_command_blocks; - uint16_t max_total_number_command_blocks; - uint16_t number_pending_sessions; - uint16_t max_number_pending_sessions; - uint16_t max_total_sessions_possible; - uint16_t session_data_packet_size; -}; - -struct nbt_status_name { - const char *name;/* [charset(DOS)] */ - enum nbt_name_type type; - uint16_t nb_flags; -}; - -struct nbt_rdata_status { - uint16_t length;/* [value(num_names*18+47)] */ - uint8_t num_names; - struct nbt_status_name *names; - struct nbt_statistics statistics; -}; - -struct nbt_rdata_data { - uint16_t length; - uint8_t *data; -}; - -union nbt_rdata { - struct nbt_rdata_netbios netbios;/* [case(NBT_QTYPE_NETBIOS)] */ - struct nbt_rdata_status status;/* [case(NBT_QTYPE_STATUS)] */ - struct nbt_rdata_data data;/* [default] */ -}/* [nodiscriminant,public] */; - -struct nbt_res_rec { - struct nbt_name name; - enum nbt_qtype rr_type; - enum nbt_qclass rr_class; - uint32_t ttl; - union nbt_rdata rdata;/* [switch_is(rr_type)] */ -}/* [nopush,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct nbt_name_packet { - uint16_t name_trn_id; - uint16_t operation; - uint16_t qdcount; - uint16_t ancount; - uint16_t nscount; - uint16_t arcount; - struct nbt_name_question *questions; - struct nbt_res_rec *answers; - struct nbt_res_rec *nsrecs; - struct nbt_res_rec *additional; - DATA_BLOB padding;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}/* [public,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX)] */; - -enum dgram_msg_type -#ifndef USE_UINT_ENUMS - { - DGRAM_DIRECT_UNIQUE=0x10, - DGRAM_DIRECT_GROUP=0x11, - DGRAM_BCAST=0x12, - DGRAM_ERROR=0x13, - DGRAM_QUERY=0x14, - DGRAM_QUERY_POSITIVE=0x15, - DGRAM_QUERY_NEGATIVE=0x16 -} -#else - { __donnot_use_enum_dgram_msg_type=0x7FFFFFFF} -#define DGRAM_DIRECT_UNIQUE ( 0x10 ) -#define DGRAM_DIRECT_GROUP ( 0x11 ) -#define DGRAM_BCAST ( 0x12 ) -#define DGRAM_ERROR ( 0x13 ) -#define DGRAM_QUERY ( 0x14 ) -#define DGRAM_QUERY_POSITIVE ( 0x15 ) -#define DGRAM_QUERY_NEGATIVE ( 0x16 ) -#endif -; - -/* bitmap dgram_flags */ -#define DGRAM_FLAG_MORE ( 0x01 ) -#define DGRAM_FLAG_FIRST ( 0x02 ) -#define DGRAM_FLAG_NODE_TYPE ( 0x0C ) - -enum dgram_node_type -#ifndef USE_UINT_ENUMS - { - DGRAM_NODE_B=0x00, - DGRAM_NODE_P=0x04, - DGRAM_NODE_M=0x08, - DGRAM_NODE_NBDD=0x0C -} -#else - { __donnot_use_enum_dgram_node_type=0x7FFFFFFF} -#define DGRAM_NODE_B ( 0x00 ) -#define DGRAM_NODE_P ( 0x04 ) -#define DGRAM_NODE_M ( 0x08 ) -#define DGRAM_NODE_NBDD ( 0x0C ) -#endif -; - -enum smb_command -#ifndef USE_UINT_ENUMS - { - SMB_TRANSACTION=0x25 -} -#else - { __donnot_use_enum_smb_command=0x7FFFFFFF} -#define SMB_TRANSACTION ( 0x25 ) -#endif -; - -struct smb_trans_body { - uint8_t wct;/* [value(17),range(17,17)] */ - uint16_t total_param_count; - uint16_t total_data_count; - uint16_t max_param_count; - uint16_t max_data_count; - uint8_t max_setup_count; - uint8_t pad; - uint16_t trans_flags; - uint32_t timeout; - uint16_t reserved; - uint16_t param_count; - uint16_t param_offset; - uint16_t data_count; - uint16_t data_offset; - uint8_t setup_count;/* [value(3),range(3,3)] */ - uint8_t pad2; - uint16_t opcode; - uint16_t priority; - uint16_t _class; - uint16_t byte_count;/* [value(strlen(mailslot_name)+1+data.length)] */ - const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - DATA_BLOB data;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}; - -union smb_body { - struct smb_trans_body trans;/* [case(SMB_TRANSACTION)] */ -}/* [nodiscriminant] */; - -struct dgram_smb_packet { - enum smb_command smb_command; - uint8_t err_class; - uint8_t pad; - uint16_t err_code; - uint8_t flags; - uint16_t flags2; - uint16_t pid_high; - uint8_t signature[8]; - uint16_t reserved; - uint16_t tid; - uint16_t pid; - uint16_t vuid; - uint16_t mid; - union smb_body body;/* [switch_is(smb_command)] */ -}/* [public,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX)] */; - -union dgram_message_body { - struct dgram_smb_packet smb;/* [case(DGRAM_SMB)] */ -}/* [nodiscriminant] */; - -struct dgram_message { - uint16_t length; - uint16_t offset; - struct nbt_name source_name; - struct nbt_name dest_name; - uint32_t dgram_body_type; - union dgram_message_body body;/* [switch_is(dgram_body_type)] */ -}; - -enum dgram_err_code -#ifndef USE_UINT_ENUMS - { - DGRAM_ERROR_NAME_NOT_PRESENT=0x82, - DGRAM_ERROR_INVALID_SOURCE=0x83, - DGRAM_ERROR_INVALID_DEST=0x84 -} -#else - { __donnot_use_enum_dgram_err_code=0x7FFFFFFF} -#define DGRAM_ERROR_NAME_NOT_PRESENT ( 0x82 ) -#define DGRAM_ERROR_INVALID_SOURCE ( 0x83 ) -#define DGRAM_ERROR_INVALID_DEST ( 0x84 ) -#endif -; - -union dgram_data { - struct dgram_message msg;/* [case(DGRAM_DIRECT_UNIQUE)] */ - enum dgram_err_code error;/* [case(DGRAM_ERROR)] */ - struct nbt_name dest_name;/* [case(DGRAM_QUERY)] */ -}/* [nodiscriminant] */; - -struct nbt_dgram_packet { - enum dgram_msg_type msg_type; - uint8_t flags; - uint16_t dgram_id; - const char * src_addr; - uint16_t src_port; - union dgram_data data;/* [switch_is(msg_type)] */ -}/* [public,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX)] */; - -struct nbt_sockaddr { - uint32_t sockaddr_family; - const char * pdc_ip;/* [flag(LIBNDR_FLAG_BIGENDIAN)] */ - DATA_BLOB remaining;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}/* [gensize,public] */; - -/* bitmap nbt_server_type */ -#define NBT_SERVER_PDC ( 0x00000001 ) -#define NBT_SERVER_GC ( 0x00000004 ) -#define NBT_SERVER_LDAP ( 0x00000008 ) -#define NBT_SERVER_DS ( 0x00000010 ) -#define NBT_SERVER_KDC ( 0x00000020 ) -#define NBT_SERVER_TIMESERV ( 0x00000040 ) -#define NBT_SERVER_CLOSEST ( 0x00000080 ) -#define NBT_SERVER_WRITABLE ( 0x00000100 ) -#define NBT_SERVER_GOOD_TIMESERV ( 0x00000200 ) -#define NBT_SERVER_NDNC ( 0x00000400 ) -#define NBT_SERVER_SELECT_SECRET_DOMAIN_6 ( 0x00000800 ) -#define NBT_SERVER_FULL_SECRET_DOMAIN_6 ( 0x00001000 ) - -/* bitmap netlogon_nt_version_flags */ -#define NETLOGON_NT_VERSION_1 ( 0x00000001 ) -#define NETLOGON_NT_VERSION_5 ( 0x00000002 ) -#define NETLOGON_NT_VERSION_5EX ( 0x00000004 ) -#define NETLOGON_NT_VERSION_5EX_WITH_IP ( 0x00000008 ) -#define NETLOGON_NT_VERSION_WITH_CLOSEST_SITE ( 0x00000010 ) -#define NETLOGON_NT_VERSION_AVIOD_NT4EMUL ( 0x01000000 ) -#define NETLOGON_NT_VERSION_PDC ( 0x10000000 ) -#define NETLOGON_NT_VERSION_IP ( 0x20000000 ) -#define NETLOGON_NT_VERSION_LOCAL ( 0x40000000 ) -#define NETLOGON_NT_VERSION_GC ( 0x80000000 ) - -enum netlogon_command -#ifndef USE_UINT_ENUMS - { - LOGON_PRIMARY_QUERY=7, - NETLOGON_ANNOUNCE_UAS=10, - NETLOGON_RESPONSE_FROM_PDC=12, - LOGON_SAM_LOGON_REQUEST=18, - LOGON_SAM_LOGON_RESPONSE=19, - LOGON_SAM_LOGON_PAUSE_RESPONSE=20, - LOGON_SAM_LOGON_USER_UNKNOWN=21, - LOGON_SAM_LOGON_RESPONSE_EX=23, - LOGON_SAM_LOGON_PAUSE_RESPONSE_EX=24, - LOGON_SAM_LOGON_USER_UNKNOWN_EX=25 -} -#else - { __donnot_use_enum_netlogon_command=0x7FFFFFFF} -#define LOGON_PRIMARY_QUERY ( 7 ) -#define NETLOGON_ANNOUNCE_UAS ( 10 ) -#define NETLOGON_RESPONSE_FROM_PDC ( 12 ) -#define LOGON_SAM_LOGON_REQUEST ( 18 ) -#define LOGON_SAM_LOGON_RESPONSE ( 19 ) -#define LOGON_SAM_LOGON_PAUSE_RESPONSE ( 20 ) -#define LOGON_SAM_LOGON_USER_UNKNOWN ( 21 ) -#define LOGON_SAM_LOGON_RESPONSE_EX ( 23 ) -#define LOGON_SAM_LOGON_PAUSE_RESPONSE_EX ( 24 ) -#define LOGON_SAM_LOGON_USER_UNKNOWN_EX ( 25 ) -#endif -; - -struct NETLOGON_SAM_LOGON_REQUEST { - uint16_t request_count; - const char * computer_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t acct_control; - uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */ - DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */ - struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */ - uint32_t nt_version; - uint16_t lmnt_token; - uint16_t lm20_token; -}/* [nopull,nopush] */; - -struct NETLOGON_SAM_LOGON_RESPONSE_NT40 { - enum netlogon_command command; - const char * server;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * domain;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t nt_version; - uint16_t lmnt_token; - uint16_t lm20_token; -}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; - -struct NETLOGON_SAM_LOGON_RESPONSE { - enum netlogon_command command; - const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * domain_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - struct GUID domain_uuid; - struct GUID zero_uuid; - const char * forest; - const char * dns_domain; - const char * pdc_dns_name; - const char * pdc_ip; - uint32_t server_type; - uint32_t nt_version; - uint16_t lmnt_token; - uint16_t lm20_token; -}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; - -struct NETLOGON_SAM_LOGON_RESPONSE_EX { - enum netlogon_command command; - uint16_t sbz; - uint32_t server_type; - struct GUID domain_uuid; - const char * forest; - const char * dns_domain; - const char * pdc_dns_name; - const char * domain; - const char * pdc_name; - const char * user_name; - const char * server_site; - const char * client_site; - uint8_t sockaddr_size;/* [value(ndr_size_nbt_sockaddr(&sockaddr,ndr->flags))] */ - struct nbt_sockaddr sockaddr;/* [subcontext_size(sockaddr_size),subcontext(0)] */ - const char * next_closest_site; - uint32_t nt_version; - uint16_t lmnt_token; - uint16_t lm20_token; -}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; - -struct nbt_netlogon_query_for_pdc { - const char * computer_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ - const char * unicode_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t nt_version; - uint16_t lmnt_token; - uint16_t lm20_token; -}; - -struct nbt_netlogon_response_from_pdc { - enum netlogon_command command; - const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ - const char * unicode_pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * domain_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t nt_version; - uint16_t lmnt_token; - uint16_t lm20_token; -}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; - -enum netr_SamDatabaseID; - -struct nbt_db_change_info { - enum netr_SamDatabaseID db_index; - uint64_t serial; - NTTIME timestamp; -}; - -struct NETLOGON_DB_CHANGE { - uint32_t serial_lo; - time_t timestamp; - uint32_t pulse; - uint32_t random; - const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - const char * domain;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN2)] */ - const char * unicode_pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * unicode_domain;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - uint32_t db_count; - struct nbt_db_change_info *dbchange; - uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */ - struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */ - uint32_t message_format_version; - uint32_t message_token; -}; - -union nbt_netlogon_request { - struct NETLOGON_SAM_LOGON_REQUEST logon;/* [case(LOGON_SAM_LOGON_REQUEST)] */ - struct nbt_netlogon_query_for_pdc pdc;/* [case(LOGON_PRIMARY_QUERY)] */ - struct NETLOGON_DB_CHANGE uas;/* [case(NETLOGON_ANNOUNCE_UAS)] */ -}/* [nodiscriminant] */; - -struct nbt_netlogon_packet { - enum netlogon_command command; - union nbt_netlogon_request req;/* [switch_is(command)] */ -}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; - -enum nbt_browse_opcode -#ifndef USE_UINT_ENUMS - { - HostAnnouncement=1, - AnnouncementRequest=2, - Election=8, - GetBackupListReq=9, - GetBackupListResp=10, - BecomeBackup=11, - DomainAnnouncement=12, - MasterAnnouncement=13, - ResetBrowserState=14, - LocalMasterAnnouncement=15 -} -#else - { __donnot_use_enum_nbt_browse_opcode=0x7FFFFFFF} -#define HostAnnouncement ( 1 ) -#define AnnouncementRequest ( 2 ) -#define Election ( 8 ) -#define GetBackupListReq ( 9 ) -#define GetBackupListResp ( 10 ) -#define BecomeBackup ( 11 ) -#define DomainAnnouncement ( 12 ) -#define MasterAnnouncement ( 13 ) -#define ResetBrowserState ( 14 ) -#define LocalMasterAnnouncement ( 15 ) -#endif -; - -struct nbt_browse_host_announcement { - uint8_t UpdateCount; - uint32_t Periodicity; - const char *ServerName;/* [charset(DOS)] */ - uint8_t OSMajor; - uint8_t OSMinor; - uint32_t ServerType; - uint8_t BroMajorVer; - uint8_t BroMinorVer; - uint16_t Signature; - const char * Comment;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct nbt_browse_announcement_request { - uint8_t Unused; - const char * ResponseName;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct nbt_browse_election_request { - uint8_t Version; - uint32_t Criteria; - uint32_t UpTime; - uint32_t Reserved; - const char * ServerName;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct nbt_browse_backup_list_request { - uint8_t ReqCount; - uint32_t Token; -}; - -struct nbt_browse_backup_list_response { - uint8_t BackupCount; - uint32_t Token; - struct nbt_name *BackupServerList; -}; - -struct nbt_browse_become_backup { - const char * BrowserName;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct nbt_browse_domain_announcement { - uint8_t UpdateCount; - uint32_t Periodicity; - const char *ServerName;/* [charset(DOS)] */ - uint8_t OSMajor; - uint8_t OSMinor; - uint32_t ServerType; - uint32_t MysteriousField; - const char * Comment;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct nbt_browse_master_announcement { - const char * ServerName;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct nbt_browse_reset_state { - uint8_t Command; -}; - -struct nbt_browse_local_master_announcement { - uint8_t UpdateCount; - uint32_t Periodicity; - const char *ServerName;/* [charset(DOS)] */ - uint8_t OSMajor; - uint8_t OSMinor; - uint32_t ServerType; - uint8_t BroMajorVer; - uint8_t BroMinorVer; - uint16_t Signature; - const char * Comment;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -union nbt_browse_payload { - struct nbt_browse_host_announcement host_annoucement;/* [case(HostAnnouncement)] */ - struct nbt_browse_announcement_request announcement_request;/* [case(AnnouncementRequest)] */ - struct nbt_browse_election_request election_request;/* [case(Election)] */ - struct nbt_browse_backup_list_request backup_list_request;/* [case(GetBackupListReq)] */ - struct nbt_browse_backup_list_response backup_list_response;/* [case(GetBackupListResp)] */ - struct nbt_browse_become_backup become_backup;/* [case(BecomeBackup)] */ - struct nbt_browse_domain_announcement domain_announcement;/* [case(DomainAnnouncement)] */ - struct nbt_browse_master_announcement master_announcement;/* [case(MasterAnnouncement)] */ - struct nbt_browse_reset_state reset_browser_state;/* [case(ResetBrowserState)] */ - struct nbt_browse_local_master_announcement local_master_announcement;/* [case(LocalMasterAnnouncement)] */ -}/* [nodiscriminant] */; - -struct nbt_browse_packet { - enum nbt_browse_opcode opcode; - union nbt_browse_payload payload;/* [switch_is(opcode)] */ -}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; - -#endif /* _HEADER_nbt */ diff --git a/source3/librpc/gen_ndr/ndr_dfs.c b/source3/librpc/gen_ndr/ndr_dfs.c deleted file mode 100644 index 75a0d4b755..0000000000 --- a/source3/librpc/gen_ndr/ndr_dfs.c +++ /dev/null @@ -1,5795 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_dfs.h" - -#include "librpc/gen_ndr/ndr_misc.h" -static enum ndr_err_code ndr_push_dfs_ManagerVersion(struct ndr_push *ndr, int ndr_flags, enum dfs_ManagerVersion r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_ManagerVersion(struct ndr_pull *ndr, int ndr_flags, enum dfs_ManagerVersion *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_ManagerVersion(struct ndr_print *ndr, const char *name, enum dfs_ManagerVersion r) -{ - const char *val = NULL; - - switch (r) { - case DFS_MANAGER_VERSION_NT4: val = "DFS_MANAGER_VERSION_NT4"; break; - case DFS_MANAGER_VERSION_W2K: val = "DFS_MANAGER_VERSION_W2K"; break; - case DFS_MANAGER_VERSION_W2K3: val = "DFS_MANAGER_VERSION_W2K3"; break; - case DFS_MANAGER_VERSION_W2K8: val = "DFS_MANAGER_VERSION_W2K8"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dfs_Info0(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info0(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info0(struct ndr_print *ndr, const char *name, const struct dfs_Info0 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info0"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info1(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info1(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info1 *r) -{ - uint32_t _ptr_path; - TALLOC_CTX *_mem_save_path_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->path); - } else { - r->path = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); - if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info1(struct ndr_print *ndr, const char *name, const struct dfs_Info1 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info1"); - ndr->depth++; - ndr_print_ptr(ndr, "path", r->path); - ndr->depth++; - if (r->path) { - ndr_print_string(ndr, "path", r->path); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_dfs_VolumeState(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_dfs_VolumeState(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_VolumeState(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_OK", DFS_VOLUME_STATE_OK, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_INCONSISTENT", DFS_VOLUME_STATE_INCONSISTENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_OFFLINE", DFS_VOLUME_STATE_OFFLINE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_ONLINE", DFS_VOLUME_STATE_ONLINE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_STANDALONE", DFS_VOLUME_STATE_STANDALONE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_VOLUME_STATE_AD_BLOB", DFS_VOLUME_STATE_AD_BLOB, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info2(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info2(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info2 *r) -{ - uint32_t _ptr_path; - TALLOC_CTX *_mem_save_path_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->path); - } else { - r->path = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_stores)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); - if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info2(struct ndr_print *ndr, const char *name, const struct dfs_Info2 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info2"); - ndr->depth++; - ndr_print_ptr(ndr, "path", r->path); - ndr->depth++; - if (r->path) { - ndr_print_string(ndr, "path", r->path); - } - ndr->depth--; - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_dfs_VolumeState(ndr, "state", r->state); - ndr_print_uint32(ndr, "num_stores", r->num_stores); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_dfs_StorageState(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_dfs_StorageState(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_StorageState(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_STORAGE_STATE_OFFLINE", DFS_STORAGE_STATE_OFFLINE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_STORAGE_STATE_ONLINE", DFS_STORAGE_STATE_ONLINE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_STORAGE_STATE_ACTIVE", DFS_STORAGE_STATE_ACTIVE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_StorageInfo(struct ndr_push *ndr, int ndr_flags, const struct dfs_StorageInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dfs_StorageState(ndr, NDR_SCALARS, r->state)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->share)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server, ndr_charset_length(r->server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->share) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->share, ndr_charset_length(r->share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_StorageInfo(struct ndr_pull *ndr, int ndr_flags, struct dfs_StorageInfo *r) -{ - uint32_t _ptr_server; - TALLOC_CTX *_mem_save_server_0; - uint32_t _ptr_share; - TALLOC_CTX *_mem_save_share_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dfs_StorageState(ndr, NDR_SCALARS, &r->state)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); - if (_ptr_server) { - NDR_PULL_ALLOC(ndr, r->server); - } else { - r->server = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); - if (_ptr_share) { - NDR_PULL_ALLOC(ndr, r->share); - } else { - r->share = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server) { - _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server)); - if (ndr_get_array_length(ndr, &r->server) > ndr_get_array_size(ndr, &r->server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server), ndr_get_array_length(ndr, &r->server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server, ndr_get_array_length(ndr, &r->server), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); - } - if (r->share) { - _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->share, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->share)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->share)); - if (ndr_get_array_length(ndr, &r->share) > ndr_get_array_size(ndr, &r->share)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->share), ndr_get_array_length(ndr, &r->share)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->share, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_StorageInfo(struct ndr_print *ndr, const char *name, const struct dfs_StorageInfo *r) -{ - ndr_print_struct(ndr, name, "dfs_StorageInfo"); - ndr->depth++; - ndr_print_dfs_StorageState(ndr, "state", r->state); - ndr_print_ptr(ndr, "server", r->server); - ndr->depth++; - if (r->server) { - ndr_print_string(ndr, "server", r->server); - } - ndr->depth--; - ndr_print_ptr(ndr, "share", r->share); - ndr->depth++; - if (r->share) { - ndr_print_string(ndr, "share", r->share); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info3(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info3 *r) -{ - uint32_t cntr_stores_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->stores)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->stores) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); - } - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info3(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info3 *r) -{ - uint32_t _ptr_path; - TALLOC_CTX *_mem_save_path_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - uint32_t _ptr_stores; - uint32_t cntr_stores_1; - TALLOC_CTX *_mem_save_stores_0; - TALLOC_CTX *_mem_save_stores_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->path); - } else { - r->path = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_stores)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_stores)); - if (_ptr_stores) { - NDR_PULL_ALLOC(ndr, r->stores); - } else { - r->stores = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); - if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - if (r->stores) { - _mem_save_stores_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->stores)); - NDR_PULL_ALLOC_N(ndr, r->stores, ndr_get_array_size(ndr, &r->stores)); - _mem_save_stores_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); - } - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_0, 0); - } - if (r->stores) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->stores, r->num_stores)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info3(struct ndr_print *ndr, const char *name, const struct dfs_Info3 *r) -{ - uint32_t cntr_stores_1; - ndr_print_struct(ndr, name, "dfs_Info3"); - ndr->depth++; - ndr_print_ptr(ndr, "path", r->path); - ndr->depth++; - if (r->path) { - ndr_print_string(ndr, "path", r->path); - } - ndr->depth--; - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_dfs_VolumeState(ndr, "state", r->state); - ndr_print_uint32(ndr, "num_stores", r->num_stores); - ndr_print_ptr(ndr, "stores", r->stores); - ndr->depth++; - if (r->stores) { - ndr->print(ndr, "%s: ARRAY(%d)", "stores", (int)r->num_stores); - ndr->depth++; - for (cntr_stores_1=0;cntr_stores_1num_stores;cntr_stores_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { - ndr_print_dfs_StorageInfo(ndr, "stores", &r->stores[cntr_stores_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info4(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info4 *r) -{ - uint32_t cntr_stores_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->stores)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->stores) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); - } - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info4(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info4 *r) -{ - uint32_t _ptr_path; - TALLOC_CTX *_mem_save_path_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - uint32_t _ptr_stores; - uint32_t cntr_stores_1; - TALLOC_CTX *_mem_save_stores_0; - TALLOC_CTX *_mem_save_stores_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->path); - } else { - r->path = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_stores)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_stores)); - if (_ptr_stores) { - NDR_PULL_ALLOC(ndr, r->stores); - } else { - r->stores = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); - if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - if (r->stores) { - _mem_save_stores_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->stores)); - NDR_PULL_ALLOC_N(ndr, r->stores, ndr_get_array_size(ndr, &r->stores)); - _mem_save_stores_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); - } - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_0, 0); - } - if (r->stores) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->stores, r->num_stores)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info4(struct ndr_print *ndr, const char *name, const struct dfs_Info4 *r) -{ - uint32_t cntr_stores_1; - ndr_print_struct(ndr, name, "dfs_Info4"); - ndr->depth++; - ndr_print_ptr(ndr, "path", r->path); - ndr->depth++; - if (r->path) { - ndr_print_string(ndr, "path", r->path); - } - ndr->depth--; - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_dfs_VolumeState(ndr, "state", r->state); - ndr_print_uint32(ndr, "timeout", r->timeout); - ndr_print_GUID(ndr, "guid", &r->guid); - ndr_print_uint32(ndr, "num_stores", r->num_stores); - ndr_print_ptr(ndr, "stores", r->stores); - ndr->depth++; - if (r->stores) { - ndr->print(ndr, "%s: ARRAY(%d)", "stores", (int)r->num_stores); - ndr->depth++; - for (cntr_stores_1=0;cntr_stores_1num_stores;cntr_stores_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { - ndr_print_dfs_StorageInfo(ndr, "stores", &r->stores[cntr_stores_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_dfs_PropertyFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_dfs_PropertyFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_PropertyFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_INSITE_REFERRALS", DFS_PROPERTY_FLAG_INSITE_REFERRALS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_ROOT_SCALABILITY", DFS_PROPERTY_FLAG_ROOT_SCALABILITY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_SITE_COSTING", DFS_PROPERTY_FLAG_SITE_COSTING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_TARGET_FAILBACK", DFS_PROPERTY_FLAG_TARGET_FAILBACK, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DFS_PROPERTY_FLAG_CLUSTER_ENABLED", DFS_PROPERTY_FLAG_CLUSTER_ENABLED, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info5(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_push_dfs_PropertyFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pktsize)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info5(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info5 *r) -{ - uint32_t _ptr_path; - TALLOC_CTX *_mem_save_path_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->path); - } else { - r->path = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_pull_dfs_PropertyFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pktsize)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_stores)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); - if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info5(struct ndr_print *ndr, const char *name, const struct dfs_Info5 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info5"); - ndr->depth++; - ndr_print_ptr(ndr, "path", r->path); - ndr->depth++; - if (r->path) { - ndr_print_string(ndr, "path", r->path); - } - ndr->depth--; - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_dfs_VolumeState(ndr, "state", r->state); - ndr_print_uint32(ndr, "timeout", r->timeout); - ndr_print_GUID(ndr, "guid", &r->guid); - ndr_print_dfs_PropertyFlags(ndr, "flags", r->flags); - ndr_print_uint32(ndr, "pktsize", r->pktsize); - ndr_print_uint32(ndr, "num_stores", r->num_stores); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Target_PriorityClass(struct ndr_push *ndr, int ndr_flags, enum dfs_Target_PriorityClass r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Target_PriorityClass(struct ndr_pull *ndr, int ndr_flags, enum dfs_Target_PriorityClass *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Target_PriorityClass(struct ndr_print *ndr, const char *name, enum dfs_Target_PriorityClass r) -{ - const char *val = NULL; - - switch (r) { - case DFS_INVALID_PRIORITY_CLASS: val = "DFS_INVALID_PRIORITY_CLASS"; break; - case DFS_SITE_COST_NORMAL_PRIORITY_CLASS: val = "DFS_SITE_COST_NORMAL_PRIORITY_CLASS"; break; - case DFS_GLOBAL_HIGH_PRIORITY_CLASS: val = "DFS_GLOBAL_HIGH_PRIORITY_CLASS"; break; - case DFS_SITE_COST_HIGH_PRIORITY_CLASS: val = "DFS_SITE_COST_HIGH_PRIORITY_CLASS"; break; - case DFS_SITE_COST_LOW_PRIORITY_CLASS: val = "DFS_SITE_COST_LOW_PRIORITY_CLASS"; break; - case DFS_GLOBAL_LOW_PRIORITY_CLASS: val = "DFS_GLOBAL_LOW_PRIORITY_CLASS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dfs_Target_Priority(struct ndr_push *ndr, int ndr_flags, const struct dfs_Target_Priority *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dfs_Target_PriorityClass(ndr, NDR_SCALARS, r->target_priority_class)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->target_priority_rank)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Target_Priority(struct ndr_pull *ndr, int ndr_flags, struct dfs_Target_Priority *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dfs_Target_PriorityClass(ndr, NDR_SCALARS, &r->target_priority_class)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->target_priority_rank)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Target_Priority(struct ndr_print *ndr, const char *name, const struct dfs_Target_Priority *r) -{ - ndr_print_struct(ndr, name, "dfs_Target_Priority"); - ndr->depth++; - ndr_print_dfs_Target_PriorityClass(ndr, "target_priority_class", r->target_priority_class); - ndr_print_uint16(ndr, "target_priority_rank", r->target_priority_rank); - ndr_print_uint16(ndr, "reserved", r->reserved); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_StorageInfo2(struct ndr_push *ndr, int ndr_flags, const struct dfs_StorageInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_push_dfs_Target_Priority(ndr, NDR_SCALARS, &r->target_priority)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_StorageInfo2(struct ndr_pull *ndr, int ndr_flags, struct dfs_StorageInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_pull_dfs_Target_Priority(ndr, NDR_SCALARS, &r->target_priority)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_dfs_StorageInfo(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_StorageInfo2(struct ndr_print *ndr, const char *name, const struct dfs_StorageInfo2 *r) -{ - ndr_print_struct(ndr, name, "dfs_StorageInfo2"); - ndr->depth++; - ndr_print_dfs_StorageInfo(ndr, "info", &r->info); - ndr_print_dfs_Target_Priority(ndr, "target_priority", &r->target_priority); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info6(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info6 *r) -{ - uint32_t cntr_stores_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->entry_path)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_push_dfs_PropertyFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pktsize)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_stores)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->stores)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entry_path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->entry_path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->entry_path, ndr_charset_length(r->entry_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->stores) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_stores)); - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_push_dfs_StorageInfo2(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); - } - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_push_dfs_StorageInfo2(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info6(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info6 *r) -{ - uint32_t _ptr_entry_path; - TALLOC_CTX *_mem_save_entry_path_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - uint32_t _ptr_stores; - uint32_t cntr_stores_1; - TALLOC_CTX *_mem_save_stores_0; - TALLOC_CTX *_mem_save_stores_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entry_path)); - if (_ptr_entry_path) { - NDR_PULL_ALLOC(ndr, r->entry_path); - } else { - r->entry_path = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_pull_dfs_PropertyFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pktsize)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_stores)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_stores)); - if (_ptr_stores) { - NDR_PULL_ALLOC(ndr, r->stores); - } else { - r->stores = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entry_path) { - _mem_save_entry_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entry_path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->entry_path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->entry_path)); - if (ndr_get_array_length(ndr, &r->entry_path) > ndr_get_array_size(ndr, &r->entry_path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->entry_path), ndr_get_array_length(ndr, &r->entry_path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->entry_path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->entry_path, ndr_get_array_length(ndr, &r->entry_path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_path_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - if (r->stores) { - _mem_save_stores_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->stores)); - NDR_PULL_ALLOC_N(ndr, r->stores, ndr_get_array_size(ndr, &r->stores)); - _mem_save_stores_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->stores, 0); - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_pull_dfs_StorageInfo2(ndr, NDR_SCALARS, &r->stores[cntr_stores_1])); - } - for (cntr_stores_1 = 0; cntr_stores_1 < r->num_stores; cntr_stores_1++) { - NDR_CHECK(ndr_pull_dfs_StorageInfo2(ndr, NDR_BUFFERS, &r->stores[cntr_stores_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stores_0, 0); - } - if (r->stores) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->stores, r->num_stores)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info6(struct ndr_print *ndr, const char *name, const struct dfs_Info6 *r) -{ - uint32_t cntr_stores_1; - ndr_print_struct(ndr, name, "dfs_Info6"); - ndr->depth++; - ndr_print_ptr(ndr, "entry_path", r->entry_path); - ndr->depth++; - if (r->entry_path) { - ndr_print_string(ndr, "entry_path", r->entry_path); - } - ndr->depth--; - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_dfs_VolumeState(ndr, "state", r->state); - ndr_print_uint32(ndr, "timeout", r->timeout); - ndr_print_GUID(ndr, "guid", &r->guid); - ndr_print_dfs_PropertyFlags(ndr, "flags", r->flags); - ndr_print_uint32(ndr, "pktsize", r->pktsize); - ndr_print_uint16(ndr, "num_stores", r->num_stores); - ndr_print_ptr(ndr, "stores", r->stores); - ndr->depth++; - if (r->stores) { - ndr->print(ndr, "%s: ARRAY(%d)", "stores", (int)r->num_stores); - ndr->depth++; - for (cntr_stores_1=0;cntr_stores_1num_stores;cntr_stores_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { - ndr_print_dfs_StorageInfo2(ndr, "stores", &r->stores[cntr_stores_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info7(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->generation_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info7(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->generation_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info7(struct ndr_print *ndr, const char *name, const struct dfs_Info7 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info7"); - ndr->depth++; - ndr_print_GUID(ndr, "generation_guid", &r->generation_guid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info100(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info100 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info100(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info100 *r) -{ - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info100(struct ndr_print *ndr, const char *name, const struct dfs_Info100 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info100"); - ndr->depth++; - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info101(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info101 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dfs_StorageState(ndr, NDR_SCALARS, r->state)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info101(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info101 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dfs_StorageState(ndr, NDR_SCALARS, &r->state)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info101(struct ndr_print *ndr, const char *name, const struct dfs_Info101 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info101"); - ndr->depth++; - ndr_print_dfs_StorageState(ndr, "state", r->state); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info102(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info102 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info102(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info102 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info102(struct ndr_print *ndr, const char *name, const struct dfs_Info102 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info102"); - ndr->depth++; - ndr_print_uint32(ndr, "timeout", r->timeout); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info103(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info103 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dfs_PropertyFlags(ndr, NDR_SCALARS, r->flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info103(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info103 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dfs_PropertyFlags(ndr, NDR_SCALARS, &r->flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info103(struct ndr_print *ndr, const char *name, const struct dfs_Info103 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info103"); - ndr->depth++; - ndr_print_dfs_PropertyFlags(ndr, "flags", r->flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info104(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info104 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dfs_Target_Priority(ndr, NDR_SCALARS, &r->priority)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info104(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info104 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dfs_Target_Priority(ndr, NDR_SCALARS, &r->priority)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info104(struct ndr_print *ndr, const char *name, const struct dfs_Info104 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info104"); - ndr->depth++; - ndr_print_dfs_Target_Priority(ndr, "priority", &r->priority); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info105(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info105 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_dfs_VolumeState(ndr, NDR_SCALARS, r->state)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->property_flag_mask)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->property_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info105(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info105 *r) -{ - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_dfs_VolumeState(ndr, NDR_SCALARS, &r->state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->property_flag_mask)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->property_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info105(struct ndr_print *ndr, const char *name, const struct dfs_Info105 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info105"); - ndr->depth++; - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_dfs_VolumeState(ndr, "state", r->state); - ndr_print_uint32(ndr, "timeout", r->timeout); - ndr_print_uint32(ndr, "property_flag_mask", r->property_flag_mask); - ndr_print_uint32(ndr, "property_flags", r->property_flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info106(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info106 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dfs_StorageState(ndr, NDR_SCALARS, r->state)); - NDR_CHECK(ndr_push_dfs_Target_Priority(ndr, NDR_SCALARS, &r->priority)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info106(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info106 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dfs_StorageState(ndr, NDR_SCALARS, &r->state)); - NDR_CHECK(ndr_pull_dfs_Target_Priority(ndr, NDR_SCALARS, &r->priority)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info106(struct ndr_print *ndr, const char *name, const struct dfs_Info106 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info106"); - ndr->depth++; - ndr_print_dfs_StorageState(ndr, "state", r->state); - ndr_print_dfs_Target_Priority(ndr, "priority", &r->priority); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info200(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info200 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dom_root)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dom_root) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dom_root, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dom_root, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dom_root, ndr_charset_length(r->dom_root, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info200(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info200 *r) -{ - uint32_t _ptr_dom_root; - TALLOC_CTX *_mem_save_dom_root_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_root)); - if (_ptr_dom_root) { - NDR_PULL_ALLOC(ndr, r->dom_root); - } else { - r->dom_root = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dom_root) { - _mem_save_dom_root_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dom_root, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dom_root)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dom_root)); - if (ndr_get_array_length(ndr, &r->dom_root) > ndr_get_array_size(ndr, &r->dom_root)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dom_root), ndr_get_array_length(ndr, &r->dom_root)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dom_root), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dom_root, ndr_get_array_length(ndr, &r->dom_root), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_root_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info200(struct ndr_print *ndr, const char *name, const struct dfs_Info200 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info200"); - ndr->depth++; - ndr_print_ptr(ndr, "dom_root", r->dom_root); - ndr->depth++; - if (r->dom_root) { - ndr_print_string(ndr, "dom_root", r->dom_root); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_VolumeFlavor(struct ndr_push *ndr, int ndr_flags, enum dfs_VolumeFlavor r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_VolumeFlavor(struct ndr_pull *ndr, int ndr_flags, enum dfs_VolumeFlavor *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_VolumeFlavor(struct ndr_print *ndr, const char *name, enum dfs_VolumeFlavor r) -{ - const char *val = NULL; - - switch (r) { - case DFS_VOLUME_FLAVOR_STANDALONE: val = "DFS_VOLUME_FLAVOR_STANDALONE"; break; - case DFS_VOLUME_FLAVOR_AD_BLOB: val = "DFS_VOLUME_FLAVOR_AD_BLOB"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dfs_Info300(struct ndr_push *ndr, int ndr_flags, const struct dfs_Info300 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dfs_VolumeFlavor(ndr, NDR_SCALARS, r->flavor)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dom_root)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dom_root) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dom_root, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dom_root, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dom_root, ndr_charset_length(r->dom_root, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info300(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info300 *r) -{ - uint32_t _ptr_dom_root; - TALLOC_CTX *_mem_save_dom_root_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dfs_VolumeFlavor(ndr, NDR_SCALARS, &r->flavor)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_root)); - if (_ptr_dom_root) { - NDR_PULL_ALLOC(ndr, r->dom_root); - } else { - r->dom_root = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dom_root) { - _mem_save_dom_root_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dom_root, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dom_root)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dom_root)); - if (ndr_get_array_length(ndr, &r->dom_root) > ndr_get_array_size(ndr, &r->dom_root)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dom_root), ndr_get_array_length(ndr, &r->dom_root)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dom_root), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dom_root, ndr_get_array_length(ndr, &r->dom_root), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_root_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info300(struct ndr_print *ndr, const char *name, const struct dfs_Info300 *r) -{ - ndr_print_struct(ndr, name, "dfs_Info300"); - ndr->depth++; - ndr_print_dfs_VolumeFlavor(ndr, "flavor", r->flavor); - ndr_print_ptr(ndr, "dom_root", r->dom_root); - ndr->depth++; - if (r->dom_root) { - ndr_print_string(ndr, "dom_root", r->dom_root); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Info(struct ndr_push *ndr, int ndr_flags, const union dfs_Info *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4)); - break; } - - case 5: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info5)); - break; } - - case 6: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info6)); - break; } - - case 7: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info7)); - break; } - - case 100: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info100)); - break; } - - case 101: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info101)); - break; } - - case 102: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info102)); - break; } - - case 103: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info103)); - break; } - - case 104: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info104)); - break; } - - case 105: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info105)); - break; } - - case 106: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info106)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->info0) { - NDR_CHECK(ndr_push_dfs_Info0(ndr, NDR_SCALARS, r->info0)); - } - break; - - case 1: - if (r->info1) { - NDR_CHECK(ndr_push_dfs_Info1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - } - break; - - case 2: - if (r->info2) { - NDR_CHECK(ndr_push_dfs_Info2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - } - break; - - case 3: - if (r->info3) { - NDR_CHECK(ndr_push_dfs_Info3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); - } - break; - - case 4: - if (r->info4) { - NDR_CHECK(ndr_push_dfs_Info4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); - } - break; - - case 5: - if (r->info5) { - NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); - } - break; - - case 6: - if (r->info6) { - NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); - } - break; - - case 7: - if (r->info7) { - NDR_CHECK(ndr_push_dfs_Info7(ndr, NDR_SCALARS, r->info7)); - } - break; - - case 100: - if (r->info100) { - NDR_CHECK(ndr_push_dfs_Info100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); - } - break; - - case 101: - if (r->info101) { - NDR_CHECK(ndr_push_dfs_Info101(ndr, NDR_SCALARS, r->info101)); - } - break; - - case 102: - if (r->info102) { - NDR_CHECK(ndr_push_dfs_Info102(ndr, NDR_SCALARS, r->info102)); - } - break; - - case 103: - if (r->info103) { - NDR_CHECK(ndr_push_dfs_Info103(ndr, NDR_SCALARS, r->info103)); - } - break; - - case 104: - if (r->info104) { - NDR_CHECK(ndr_push_dfs_Info104(ndr, NDR_SCALARS, r->info104)); - } - break; - - case 105: - if (r->info105) { - NDR_CHECK(ndr_push_dfs_Info105(ndr, NDR_SCALARS|NDR_BUFFERS, r->info105)); - } - break; - - case 106: - if (r->info106) { - NDR_CHECK(ndr_push_dfs_Info106(ndr, NDR_SCALARS, r->info106)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Info(struct ndr_pull *ndr, int ndr_flags, union dfs_Info *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info0_0; - TALLOC_CTX *_mem_save_info1_0; - TALLOC_CTX *_mem_save_info2_0; - TALLOC_CTX *_mem_save_info3_0; - TALLOC_CTX *_mem_save_info4_0; - TALLOC_CTX *_mem_save_info5_0; - TALLOC_CTX *_mem_save_info6_0; - TALLOC_CTX *_mem_save_info7_0; - TALLOC_CTX *_mem_save_info100_0; - TALLOC_CTX *_mem_save_info101_0; - TALLOC_CTX *_mem_save_info102_0; - TALLOC_CTX *_mem_save_info103_0; - TALLOC_CTX *_mem_save_info104_0; - TALLOC_CTX *_mem_save_info105_0; - TALLOC_CTX *_mem_save_info106_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_info0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); - if (_ptr_info0) { - NDR_PULL_ALLOC(ndr, r->info0); - } else { - r->info0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_info1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); - if (_ptr_info1) { - NDR_PULL_ALLOC(ndr, r->info1); - } else { - r->info1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_info2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); - if (_ptr_info2) { - NDR_PULL_ALLOC(ndr, r->info2); - } else { - r->info2 = NULL; - } - break; } - - case 3: { - uint32_t _ptr_info3; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); - if (_ptr_info3) { - NDR_PULL_ALLOC(ndr, r->info3); - } else { - r->info3 = NULL; - } - break; } - - case 4: { - uint32_t _ptr_info4; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4)); - if (_ptr_info4) { - NDR_PULL_ALLOC(ndr, r->info4); - } else { - r->info4 = NULL; - } - break; } - - case 5: { - uint32_t _ptr_info5; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info5)); - if (_ptr_info5) { - NDR_PULL_ALLOC(ndr, r->info5); - } else { - r->info5 = NULL; - } - break; } - - case 6: { - uint32_t _ptr_info6; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info6)); - if (_ptr_info6) { - NDR_PULL_ALLOC(ndr, r->info6); - } else { - r->info6 = NULL; - } - break; } - - case 7: { - uint32_t _ptr_info7; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info7)); - if (_ptr_info7) { - NDR_PULL_ALLOC(ndr, r->info7); - } else { - r->info7 = NULL; - } - break; } - - case 100: { - uint32_t _ptr_info100; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info100)); - if (_ptr_info100) { - NDR_PULL_ALLOC(ndr, r->info100); - } else { - r->info100 = NULL; - } - break; } - - case 101: { - uint32_t _ptr_info101; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info101)); - if (_ptr_info101) { - NDR_PULL_ALLOC(ndr, r->info101); - } else { - r->info101 = NULL; - } - break; } - - case 102: { - uint32_t _ptr_info102; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info102)); - if (_ptr_info102) { - NDR_PULL_ALLOC(ndr, r->info102); - } else { - r->info102 = NULL; - } - break; } - - case 103: { - uint32_t _ptr_info103; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info103)); - if (_ptr_info103) { - NDR_PULL_ALLOC(ndr, r->info103); - } else { - r->info103 = NULL; - } - break; } - - case 104: { - uint32_t _ptr_info104; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info104)); - if (_ptr_info104) { - NDR_PULL_ALLOC(ndr, r->info104); - } else { - r->info104 = NULL; - } - break; } - - case 105: { - uint32_t _ptr_info105; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info105)); - if (_ptr_info105) { - NDR_PULL_ALLOC(ndr, r->info105); - } else { - r->info105 = NULL; - } - break; } - - case 106: { - uint32_t _ptr_info106; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info106)); - if (_ptr_info106) { - NDR_PULL_ALLOC(ndr, r->info106); - } else { - r->info106 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->info0) { - _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); - NDR_CHECK(ndr_pull_dfs_Info0(ndr, NDR_SCALARS, r->info0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); - } - break; - - case 1: - if (r->info1) { - _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); - NDR_CHECK(ndr_pull_dfs_Info1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); - } - break; - - case 2: - if (r->info2) { - _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); - NDR_CHECK(ndr_pull_dfs_Info2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); - } - break; - - case 3: - if (r->info3) { - _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); - NDR_CHECK(ndr_pull_dfs_Info3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); - } - break; - - case 4: - if (r->info4) { - _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0); - NDR_CHECK(ndr_pull_dfs_Info4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0); - } - break; - - case 5: - if (r->info5) { - _mem_save_info5_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info5, 0); - NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info5_0, 0); - } - break; - - case 6: - if (r->info6) { - _mem_save_info6_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info6, 0); - NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info6_0, 0); - } - break; - - case 7: - if (r->info7) { - _mem_save_info7_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info7, 0); - NDR_CHECK(ndr_pull_dfs_Info7(ndr, NDR_SCALARS, r->info7)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info7_0, 0); - } - break; - - case 100: - if (r->info100) { - _mem_save_info100_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info100, 0); - NDR_CHECK(ndr_pull_dfs_Info100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info100_0, 0); - } - break; - - case 101: - if (r->info101) { - _mem_save_info101_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info101, 0); - NDR_CHECK(ndr_pull_dfs_Info101(ndr, NDR_SCALARS, r->info101)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info101_0, 0); - } - break; - - case 102: - if (r->info102) { - _mem_save_info102_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info102, 0); - NDR_CHECK(ndr_pull_dfs_Info102(ndr, NDR_SCALARS, r->info102)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info102_0, 0); - } - break; - - case 103: - if (r->info103) { - _mem_save_info103_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info103, 0); - NDR_CHECK(ndr_pull_dfs_Info103(ndr, NDR_SCALARS, r->info103)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info103_0, 0); - } - break; - - case 104: - if (r->info104) { - _mem_save_info104_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info104, 0); - NDR_CHECK(ndr_pull_dfs_Info104(ndr, NDR_SCALARS, r->info104)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info104_0, 0); - } - break; - - case 105: - if (r->info105) { - _mem_save_info105_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info105, 0); - NDR_CHECK(ndr_pull_dfs_Info105(ndr, NDR_SCALARS|NDR_BUFFERS, r->info105)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info105_0, 0); - } - break; - - case 106: - if (r->info106) { - _mem_save_info106_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info106, 0); - NDR_CHECK(ndr_pull_dfs_Info106(ndr, NDR_SCALARS, r->info106)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info106_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Info(struct ndr_print *ndr, const char *name, const union dfs_Info *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "dfs_Info"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "info0", r->info0); - ndr->depth++; - if (r->info0) { - ndr_print_dfs_Info0(ndr, "info0", r->info0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "info1", r->info1); - ndr->depth++; - if (r->info1) { - ndr_print_dfs_Info1(ndr, "info1", r->info1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "info2", r->info2); - ndr->depth++; - if (r->info2) { - ndr_print_dfs_Info2(ndr, "info2", r->info2); - } - ndr->depth--; - break; - - case 3: - ndr_print_ptr(ndr, "info3", r->info3); - ndr->depth++; - if (r->info3) { - ndr_print_dfs_Info3(ndr, "info3", r->info3); - } - ndr->depth--; - break; - - case 4: - ndr_print_ptr(ndr, "info4", r->info4); - ndr->depth++; - if (r->info4) { - ndr_print_dfs_Info4(ndr, "info4", r->info4); - } - ndr->depth--; - break; - - case 5: - ndr_print_ptr(ndr, "info5", r->info5); - ndr->depth++; - if (r->info5) { - ndr_print_dfs_Info5(ndr, "info5", r->info5); - } - ndr->depth--; - break; - - case 6: - ndr_print_ptr(ndr, "info6", r->info6); - ndr->depth++; - if (r->info6) { - ndr_print_dfs_Info6(ndr, "info6", r->info6); - } - ndr->depth--; - break; - - case 7: - ndr_print_ptr(ndr, "info7", r->info7); - ndr->depth++; - if (r->info7) { - ndr_print_dfs_Info7(ndr, "info7", r->info7); - } - ndr->depth--; - break; - - case 100: - ndr_print_ptr(ndr, "info100", r->info100); - ndr->depth++; - if (r->info100) { - ndr_print_dfs_Info100(ndr, "info100", r->info100); - } - ndr->depth--; - break; - - case 101: - ndr_print_ptr(ndr, "info101", r->info101); - ndr->depth++; - if (r->info101) { - ndr_print_dfs_Info101(ndr, "info101", r->info101); - } - ndr->depth--; - break; - - case 102: - ndr_print_ptr(ndr, "info102", r->info102); - ndr->depth++; - if (r->info102) { - ndr_print_dfs_Info102(ndr, "info102", r->info102); - } - ndr->depth--; - break; - - case 103: - ndr_print_ptr(ndr, "info103", r->info103); - ndr->depth++; - if (r->info103) { - ndr_print_dfs_Info103(ndr, "info103", r->info103); - } - ndr->depth--; - break; - - case 104: - ndr_print_ptr(ndr, "info104", r->info104); - ndr->depth++; - if (r->info104) { - ndr_print_dfs_Info104(ndr, "info104", r->info104); - } - ndr->depth--; - break; - - case 105: - ndr_print_ptr(ndr, "info105", r->info105); - ndr->depth++; - if (r->info105) { - ndr_print_dfs_Info105(ndr, "info105", r->info105); - } - ndr->depth--; - break; - - case 106: - ndr_print_ptr(ndr, "info106", r->info106); - ndr->depth++; - if (r->info106) { - ndr_print_dfs_Info106(ndr, "info106", r->info106); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_dfs_EnumArray1(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray1 *r) -{ - uint32_t cntr_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info1(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info1(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumArray1(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray1 *r) -{ - uint32_t _ptr_s; - uint32_t cntr_s_1; - TALLOC_CTX *_mem_save_s_0; - TALLOC_CTX *_mem_save_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_PULL_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); - NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); - _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info1(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info1(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); - } - if (r->s) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray1 *r) -{ - uint32_t cntr_s_1; - ndr_print_struct(ndr, name, "dfs_EnumArray1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); - ndr->depth++; - for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { - ndr_print_dfs_Info1(ndr, "s", &r->s[cntr_s_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_EnumArray2(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray2 *r) -{ - uint32_t cntr_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info2(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info2(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumArray2(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray2 *r) -{ - uint32_t _ptr_s; - uint32_t cntr_s_1; - TALLOC_CTX *_mem_save_s_0; - TALLOC_CTX *_mem_save_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_PULL_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); - NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); - _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info2(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info2(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); - } - if (r->s) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray2 *r) -{ - uint32_t cntr_s_1; - ndr_print_struct(ndr, name, "dfs_EnumArray2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); - ndr->depth++; - for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { - ndr_print_dfs_Info2(ndr, "s", &r->s[cntr_s_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_EnumArray3(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray3 *r) -{ - uint32_t cntr_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info3(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info3(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumArray3(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray3 *r) -{ - uint32_t _ptr_s; - uint32_t cntr_s_1; - TALLOC_CTX *_mem_save_s_0; - TALLOC_CTX *_mem_save_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_PULL_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); - NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); - _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info3(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info3(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); - } - if (r->s) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray3 *r) -{ - uint32_t cntr_s_1; - ndr_print_struct(ndr, name, "dfs_EnumArray3"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); - ndr->depth++; - for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { - ndr_print_dfs_Info3(ndr, "s", &r->s[cntr_s_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_EnumArray4(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray4 *r) -{ - uint32_t cntr_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info4(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info4(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumArray4(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray4 *r) -{ - uint32_t _ptr_s; - uint32_t cntr_s_1; - TALLOC_CTX *_mem_save_s_0; - TALLOC_CTX *_mem_save_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_PULL_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); - NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); - _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info4(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info4(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); - } - if (r->s) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray4 *r) -{ - uint32_t cntr_s_1; - ndr_print_struct(ndr, name, "dfs_EnumArray4"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); - ndr->depth++; - for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { - ndr_print_dfs_Info4(ndr, "s", &r->s[cntr_s_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_EnumArray5(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray5 *r) -{ - uint32_t cntr_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumArray5(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray5 *r) -{ - uint32_t _ptr_s; - uint32_t cntr_s_1; - TALLOC_CTX *_mem_save_s_0; - TALLOC_CTX *_mem_save_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_PULL_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); - NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); - _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); - } - if (r->s) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumArray5(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray5 *r) -{ - uint32_t cntr_s_1; - ndr_print_struct(ndr, name, "dfs_EnumArray5"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); - ndr->depth++; - for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { - ndr_print_dfs_Info5(ndr, "s", &r->s[cntr_s_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_EnumArray6(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray6 *r) -{ - uint32_t cntr_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumArray6(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray6 *r) -{ - uint32_t _ptr_s; - uint32_t cntr_s_1; - TALLOC_CTX *_mem_save_s_0; - TALLOC_CTX *_mem_save_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_PULL_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); - NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); - _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); - } - if (r->s) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumArray6(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray6 *r) -{ - uint32_t cntr_s_1; - ndr_print_struct(ndr, name, "dfs_EnumArray6"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); - ndr->depth++; - for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { - ndr_print_dfs_Info6(ndr, "s", &r->s[cntr_s_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_EnumArray200(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray200 *r) -{ - uint32_t cntr_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info200(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info200(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumArray200(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray200 *r) -{ - uint32_t _ptr_s; - uint32_t cntr_s_1; - TALLOC_CTX *_mem_save_s_0; - TALLOC_CTX *_mem_save_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_PULL_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); - NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); - _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info200(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info200(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); - } - if (r->s) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray200 *r) -{ - uint32_t cntr_s_1; - ndr_print_struct(ndr, name, "dfs_EnumArray200"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); - ndr->depth++; - for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { - ndr_print_dfs_Info200(ndr, "s", &r->s[cntr_s_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_EnumArray300(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray300 *r) -{ - uint32_t cntr_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info300(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_push_dfs_Info300(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumArray300(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray300 *r) -{ - uint32_t _ptr_s; - uint32_t cntr_s_1; - TALLOC_CTX *_mem_save_s_0; - TALLOC_CTX *_mem_save_s_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_PULL_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->s) { - _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); - NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); - _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info300(ndr, NDR_SCALARS, &r->s[cntr_s_1])); - } - for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { - NDR_CHECK(ndr_pull_dfs_Info300(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); - } - if (r->s) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumArray300(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray300 *r) -{ - uint32_t cntr_s_1; - ndr_print_struct(ndr, name, "dfs_EnumArray300"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr->print(ndr, "%s: ARRAY(%d)", "s", (int)r->count); - ndr->depth++; - for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { - ndr_print_dfs_Info300(ndr, "s", &r->s[cntr_s_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_EnumInfo(struct ndr_push *ndr, int ndr_flags, const union dfs_EnumInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4)); - break; } - - case 5: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info5)); - break; } - - case 6: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info6)); - break; } - - case 200: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info200)); - break; } - - case 300: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info300)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - if (r->info1) { - NDR_CHECK(ndr_push_dfs_EnumArray1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - } - break; - - case 2: - if (r->info2) { - NDR_CHECK(ndr_push_dfs_EnumArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - } - break; - - case 3: - if (r->info3) { - NDR_CHECK(ndr_push_dfs_EnumArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); - } - break; - - case 4: - if (r->info4) { - NDR_CHECK(ndr_push_dfs_EnumArray4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); - } - break; - - case 5: - if (r->info5) { - NDR_CHECK(ndr_push_dfs_EnumArray5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); - } - break; - - case 6: - if (r->info6) { - NDR_CHECK(ndr_push_dfs_EnumArray6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); - } - break; - - case 200: - if (r->info200) { - NDR_CHECK(ndr_push_dfs_EnumArray200(ndr, NDR_SCALARS|NDR_BUFFERS, r->info200)); - } - break; - - case 300: - if (r->info300) { - NDR_CHECK(ndr_push_dfs_EnumArray300(ndr, NDR_SCALARS|NDR_BUFFERS, r->info300)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumInfo(struct ndr_pull *ndr, int ndr_flags, union dfs_EnumInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info1_0; - TALLOC_CTX *_mem_save_info2_0; - TALLOC_CTX *_mem_save_info3_0; - TALLOC_CTX *_mem_save_info4_0; - TALLOC_CTX *_mem_save_info5_0; - TALLOC_CTX *_mem_save_info6_0; - TALLOC_CTX *_mem_save_info200_0; - TALLOC_CTX *_mem_save_info300_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - uint32_t _ptr_info1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); - if (_ptr_info1) { - NDR_PULL_ALLOC(ndr, r->info1); - } else { - r->info1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_info2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); - if (_ptr_info2) { - NDR_PULL_ALLOC(ndr, r->info2); - } else { - r->info2 = NULL; - } - break; } - - case 3: { - uint32_t _ptr_info3; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); - if (_ptr_info3) { - NDR_PULL_ALLOC(ndr, r->info3); - } else { - r->info3 = NULL; - } - break; } - - case 4: { - uint32_t _ptr_info4; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4)); - if (_ptr_info4) { - NDR_PULL_ALLOC(ndr, r->info4); - } else { - r->info4 = NULL; - } - break; } - - case 5: { - uint32_t _ptr_info5; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info5)); - if (_ptr_info5) { - NDR_PULL_ALLOC(ndr, r->info5); - } else { - r->info5 = NULL; - } - break; } - - case 6: { - uint32_t _ptr_info6; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info6)); - if (_ptr_info6) { - NDR_PULL_ALLOC(ndr, r->info6); - } else { - r->info6 = NULL; - } - break; } - - case 200: { - uint32_t _ptr_info200; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info200)); - if (_ptr_info200) { - NDR_PULL_ALLOC(ndr, r->info200); - } else { - r->info200 = NULL; - } - break; } - - case 300: { - uint32_t _ptr_info300; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info300)); - if (_ptr_info300) { - NDR_PULL_ALLOC(ndr, r->info300); - } else { - r->info300 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - if (r->info1) { - _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); - NDR_CHECK(ndr_pull_dfs_EnumArray1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); - } - break; - - case 2: - if (r->info2) { - _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); - NDR_CHECK(ndr_pull_dfs_EnumArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); - } - break; - - case 3: - if (r->info3) { - _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); - NDR_CHECK(ndr_pull_dfs_EnumArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); - } - break; - - case 4: - if (r->info4) { - _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0); - NDR_CHECK(ndr_pull_dfs_EnumArray4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0); - } - break; - - case 5: - if (r->info5) { - _mem_save_info5_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info5, 0); - NDR_CHECK(ndr_pull_dfs_EnumArray5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info5_0, 0); - } - break; - - case 6: - if (r->info6) { - _mem_save_info6_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info6, 0); - NDR_CHECK(ndr_pull_dfs_EnumArray6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info6_0, 0); - } - break; - - case 200: - if (r->info200) { - _mem_save_info200_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info200, 0); - NDR_CHECK(ndr_pull_dfs_EnumArray200(ndr, NDR_SCALARS|NDR_BUFFERS, r->info200)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info200_0, 0); - } - break; - - case 300: - if (r->info300) { - _mem_save_info300_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info300, 0); - NDR_CHECK(ndr_pull_dfs_EnumArray300(ndr, NDR_SCALARS|NDR_BUFFERS, r->info300)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info300_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumInfo(struct ndr_print *ndr, const char *name, const union dfs_EnumInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "dfs_EnumInfo"); - switch (level) { - case 1: - ndr_print_ptr(ndr, "info1", r->info1); - ndr->depth++; - if (r->info1) { - ndr_print_dfs_EnumArray1(ndr, "info1", r->info1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "info2", r->info2); - ndr->depth++; - if (r->info2) { - ndr_print_dfs_EnumArray2(ndr, "info2", r->info2); - } - ndr->depth--; - break; - - case 3: - ndr_print_ptr(ndr, "info3", r->info3); - ndr->depth++; - if (r->info3) { - ndr_print_dfs_EnumArray3(ndr, "info3", r->info3); - } - ndr->depth--; - break; - - case 4: - ndr_print_ptr(ndr, "info4", r->info4); - ndr->depth++; - if (r->info4) { - ndr_print_dfs_EnumArray4(ndr, "info4", r->info4); - } - ndr->depth--; - break; - - case 5: - ndr_print_ptr(ndr, "info5", r->info5); - ndr->depth++; - if (r->info5) { - ndr_print_dfs_EnumArray5(ndr, "info5", r->info5); - } - ndr->depth--; - break; - - case 6: - ndr_print_ptr(ndr, "info6", r->info6); - ndr->depth++; - if (r->info6) { - ndr_print_dfs_EnumArray6(ndr, "info6", r->info6); - } - ndr->depth--; - break; - - case 200: - ndr_print_ptr(ndr, "info200", r->info200); - ndr->depth++; - if (r->info200) { - ndr_print_dfs_EnumArray200(ndr, "info200", r->info200); - } - ndr->depth--; - break; - - case 300: - ndr_print_ptr(ndr, "info300", r->info300); - ndr->depth++; - if (r->info300) { - ndr_print_dfs_EnumArray300(ndr, "info300", r->info300); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_dfs_EnumStruct(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumStruct *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->e, r->level)); - NDR_CHECK(ndr_push_dfs_EnumInfo(ndr, NDR_SCALARS, &r->e)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_dfs_EnumInfo(ndr, NDR_BUFFERS, &r->e)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_EnumStruct(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumStruct *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->e, r->level)); - NDR_CHECK(ndr_pull_dfs_EnumInfo(ndr, NDR_SCALARS, &r->e)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_dfs_EnumInfo(ndr, NDR_BUFFERS, &r->e)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumStruct(struct ndr_print *ndr, const char *name, const struct dfs_EnumStruct *r) -{ - ndr_print_struct(ndr, name, "dfs_EnumStruct"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->e, r->level); - ndr_print_dfs_EnumInfo(ndr, "e", &r->e); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_UnknownStruct(struct ndr_push *ndr, int ndr_flags, const struct dfs_UnknownStruct *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown2)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->unknown2) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown2, ndr_charset_length(r->unknown2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_UnknownStruct(struct ndr_pull *ndr, int ndr_flags, struct dfs_UnknownStruct *r) -{ - uint32_t _ptr_unknown2; - TALLOC_CTX *_mem_save_unknown2_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); - if (_ptr_unknown2) { - NDR_PULL_ALLOC(ndr, r->unknown2); - } else { - r->unknown2 = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->unknown2) { - _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->unknown2, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown2)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown2)); - if (ndr_get_array_length(ndr, &r->unknown2) > ndr_get_array_size(ndr, &r->unknown2)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown2), ndr_get_array_length(ndr, &r->unknown2)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown2, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_UnknownStruct(struct ndr_print *ndr, const char *name, const struct dfs_UnknownStruct *r) -{ - ndr_print_struct(ndr, name, "dfs_UnknownStruct"); - ndr->depth++; - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_ptr(ndr, "unknown2", r->unknown2); - ndr->depth++; - if (r->unknown2) { - ndr_print_string(ndr, "unknown2", r->unknown2); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_dfs_GetManagerVersion(struct ndr_push *ndr, int flags, const struct dfs_GetManagerVersion *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - 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 NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_dfs_GetManagerVersion(struct ndr_pull *ndr, int flags, struct dfs_GetManagerVersion *r) -{ - TALLOC_CTX *_mem_save_version_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_PULL_ALLOC(ndr, r->out.version); - ZERO_STRUCTP(r->out.version); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.version); - } - _mem_save_version_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.version, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dfs_ManagerVersion(ndr, NDR_SCALARS, r->out.version)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_0, LIBNDR_FLAG_REF_ALLOC); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_GetManagerVersion(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetManagerVersion *r) -{ - ndr_print_struct(ndr, name, "dfs_GetManagerVersion"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_GetManagerVersion"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_GetManagerVersion"); - ndr->depth++; - ndr_print_ptr(ndr, "version", r->out.version); - ndr->depth++; - ndr_print_dfs_ManagerVersion(ndr, "version", *r->out.version); - ndr->depth--; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 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 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server, ndr_charset_length(r->in.server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.share)); - if (r->in.share) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share, ndr_charset_length(r->in.share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.comment)); - if (r->in.comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.comment, ndr_charset_length(r->in.comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Add(struct ndr_pull *ndr, int flags, struct dfs_Add *r) -{ - uint32_t _ptr_share; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_share_0; - TALLOC_CTX *_mem_save_comment_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); - if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server)); - if (ndr_get_array_length(ndr, &r->in.server) > ndr_get_array_size(ndr, &r->in.server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server), ndr_get_array_length(ndr, &r->in.server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server, ndr_get_array_length(ndr, &r->in.server), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); - if (_ptr_share) { - NDR_PULL_ALLOC(ndr, r->in.share); - } else { - r->in.share = NULL; - } - if (r->in.share) { - _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.share, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share)); - if (ndr_get_array_length(ndr, &r->in.share) > ndr_get_array_size(ndr, &r->in.share)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share), ndr_get_array_length(ndr, &r->in.share)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->in.comment); - } else { - r->in.comment = NULL; - } - if (r->in.comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.comment)); - if (ndr_get_array_length(ndr, &r->in.comment) > ndr_get_array_size(ndr, &r->in.comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.comment), ndr_get_array_length(ndr, &r->in.comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.comment, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Add(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Add *r) -{ - ndr_print_struct(ndr, name, "dfs_Add"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_Add"); - ndr->depth++; - ndr_print_ptr(ndr, "path", r->in.path); - ndr->depth++; - ndr_print_string(ndr, "path", r->in.path); - ndr->depth--; - ndr_print_ptr(ndr, "server", r->in.server); - ndr->depth++; - ndr_print_string(ndr, "server", r->in.server); - ndr->depth--; - ndr_print_ptr(ndr, "share", r->in.share); - ndr->depth++; - if (r->in.share) { - ndr_print_string(ndr, "share", r->in.share); - } - ndr->depth--; - ndr_print_ptr(ndr, "comment", r->in.comment); - ndr->depth++; - if (r->in.comment) { - ndr_print_string(ndr, "comment", r->in.comment); - } - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_Add"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_entry_path, ndr_charset_length(r->in.dfs_entry_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.servername)); - if (r->in.servername) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.sharename)); - if (r->in.sharename) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.sharename, ndr_charset_length(r->in.sharename, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Remove(struct ndr_pull *ndr, int flags, struct dfs_Remove *r) -{ - uint32_t _ptr_servername; - uint32_t _ptr_sharename; - TALLOC_CTX *_mem_save_servername_0; - TALLOC_CTX *_mem_save_sharename_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_entry_path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_entry_path)); - if (ndr_get_array_length(ndr, &r->in.dfs_entry_path) > ndr_get_array_size(ndr, &r->in.dfs_entry_path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_entry_path), ndr_get_array_length(ndr, &r->in.dfs_entry_path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_entry_path, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername)); - if (_ptr_servername) { - NDR_PULL_ALLOC(ndr, r->in.servername); - } else { - r->in.servername = NULL; - } - if (r->in.servername) { - _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sharename)); - if (_ptr_sharename) { - NDR_PULL_ALLOC(ndr, r->in.sharename); - } else { - r->in.sharename = NULL; - } - if (r->in.sharename) { - _mem_save_sharename_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sharename, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.sharename)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.sharename)); - if (ndr_get_array_length(ndr, &r->in.sharename) > ndr_get_array_size(ndr, &r->in.sharename)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.sharename), ndr_get_array_length(ndr, &r->in.sharename)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.sharename, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sharename_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Remove(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Remove *r) -{ - ndr_print_struct(ndr, name, "dfs_Remove"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_Remove"); - ndr->depth++; - ndr_print_ptr(ndr, "dfs_entry_path", r->in.dfs_entry_path); - ndr->depth++; - ndr_print_string(ndr, "dfs_entry_path", r->in.dfs_entry_path); - ndr->depth--; - ndr_print_ptr(ndr, "servername", r->in.servername); - ndr->depth++; - if (r->in.servername) { - ndr_print_string(ndr, "servername", r->in.servername); - } - ndr->depth--; - ndr_print_ptr(ndr, "sharename", r->in.sharename); - ndr->depth++; - if (r->in.sharename) { - ndr_print_string(ndr, "sharename", r->in.sharename); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_Remove"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_SetInfo(struct ndr_push *ndr, int flags, const struct dfs_SetInfo *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_entry_path, ndr_charset_length(r->in.dfs_entry_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.servername)); - if (r->in.servername) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.sharename)); - if (r->in.sharename) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); - 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 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)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_SetInfo(struct ndr_pull *ndr, int flags, struct dfs_SetInfo *r) -{ - uint32_t _ptr_servername; - uint32_t _ptr_sharename; - TALLOC_CTX *_mem_save_servername_0; - TALLOC_CTX *_mem_save_sharename_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_entry_path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_entry_path)); - if (ndr_get_array_length(ndr, &r->in.dfs_entry_path) > ndr_get_array_size(ndr, &r->in.dfs_entry_path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_entry_path), ndr_get_array_length(ndr, &r->in.dfs_entry_path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_entry_path, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername)); - if (_ptr_servername) { - NDR_PULL_ALLOC(ndr, r->in.servername); - } else { - r->in.servername = NULL; - } - if (r->in.servername) { - _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sharename)); - if (_ptr_sharename) { - NDR_PULL_ALLOC(ndr, r->in.sharename); - } else { - r->in.sharename = NULL; - } - if (r->in.sharename) { - _mem_save_sharename_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sharename, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.sharename)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.sharename)); - if (ndr_get_array_length(ndr, &r->in.sharename) > ndr_get_array_size(ndr, &r->in.sharename)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.sharename), ndr_get_array_length(ndr, &r->in.sharename)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.sharename, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sharename_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_dfs_Info(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_SetInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetInfo *r) -{ - ndr_print_struct(ndr, name, "dfs_SetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_SetInfo"); - ndr->depth++; - ndr_print_string(ndr, "dfs_entry_path", r->in.dfs_entry_path); - ndr_print_ptr(ndr, "servername", r->in.servername); - ndr->depth++; - if (r->in.servername) { - ndr_print_string(ndr, "servername", r->in.servername); - } - ndr->depth--; - ndr_print_ptr(ndr, "sharename", r->in.sharename); - ndr->depth++; - if (r->in.sharename) { - ndr_print_string(ndr, "sharename", r->in.sharename); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_dfs_Info(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_SetInfo"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_GetInfo(struct ndr_push *ndr, int flags, const struct dfs_GetInfo *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_entry_path, ndr_charset_length(r->in.dfs_entry_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.servername)); - if (r->in.servername) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.sharename)); - if (r->in.sharename) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.sharename, CH_UTF16))); - 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 (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_GetInfo(struct ndr_pull *ndr, int flags, struct dfs_GetInfo *r) -{ - uint32_t _ptr_servername; - uint32_t _ptr_sharename; - TALLOC_CTX *_mem_save_servername_0; - TALLOC_CTX *_mem_save_sharename_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_entry_path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_entry_path)); - if (ndr_get_array_length(ndr, &r->in.dfs_entry_path) > ndr_get_array_size(ndr, &r->in.dfs_entry_path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_entry_path), ndr_get_array_length(ndr, &r->in.dfs_entry_path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_entry_path, ndr_get_array_length(ndr, &r->in.dfs_entry_path), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername)); - if (_ptr_servername) { - NDR_PULL_ALLOC(ndr, r->in.servername); - } else { - r->in.servername = NULL; - } - if (r->in.servername) { - _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sharename)); - if (_ptr_sharename) { - NDR_PULL_ALLOC(ndr, r->in.sharename); - } else { - r->in.sharename = NULL; - } - if (r->in.sharename) { - _mem_save_sharename_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sharename, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.sharename)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.sharename)); - if (ndr_get_array_length(ndr, &r->in.sharename) > ndr_get_array_size(ndr, &r->in.sharename)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.sharename), ndr_get_array_length(ndr, &r->in.sharename)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.sharename, ndr_get_array_length(ndr, &r->in.sharename), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sharename_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_dfs_Info(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_GetInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetInfo *r) -{ - ndr_print_struct(ndr, name, "dfs_GetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_GetInfo"); - ndr->depth++; - ndr_print_string(ndr, "dfs_entry_path", r->in.dfs_entry_path); - ndr_print_ptr(ndr, "servername", r->in.servername); - ndr->depth++; - if (r->in.servername) { - ndr_print_string(ndr, "servername", r->in.servername); - } - ndr->depth--; - ndr_print_ptr(ndr, "sharename", r->in.sharename); - ndr->depth++; - if (r->in.sharename) { - ndr_print_string(ndr, "sharename", r->in.sharename); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_GetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_dfs_Info(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Enum(struct ndr_push *ndr, int flags, const struct dfs_Enum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); - if (r->in.info) { - NDR_CHECK(ndr_push_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.total)); - if (r->in.total) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.total)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.total)); - if (r->out.total) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Enum(struct ndr_pull *ndr, int flags, struct dfs_Enum *r) -{ - uint32_t _ptr_info; - uint32_t _ptr_total; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_total_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bufsize)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->in.info); - } else { - r->in.info = NULL; - } - if (r->in.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); - NDR_CHECK(ndr_pull_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_total)); - if (_ptr_total) { - NDR_PULL_ALLOC(ndr, r->in.total); - } else { - r->in.total = NULL; - } - if (r->in.total) { - _mem_save_total_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.total, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.total)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->out.info); - } else { - r->out.info = NULL; - } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_total)); - if (_ptr_total) { - NDR_PULL_ALLOC(ndr, r->out.total); - } else { - r->out.total = NULL; - } - if (r->out.total) { - _mem_save_total_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.total, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Enum(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Enum *r) -{ - ndr_print_struct(ndr, name, "dfs_Enum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_Enum"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_uint32(ndr, "bufsize", r->in.bufsize); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - if (r->in.info) { - ndr_print_dfs_EnumStruct(ndr, "info", r->in.info); - } - ndr->depth--; - ndr_print_ptr(ndr, "total", r->in.total); - ndr->depth++; - if (r->in.total) { - ndr_print_uint32(ndr, "total", *r->in.total); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_Enum"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - if (r->out.info) { - ndr_print_dfs_EnumStruct(ndr, "info", r->out.info); - } - ndr->depth--; - ndr_print_ptr(ndr, "total", r->out.total); - ndr->depth++; - if (r->out.total) { - ndr_print_uint32(ndr, "total", *r->out.total); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Rename(struct ndr_push *ndr, int flags, const struct dfs_Rename *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Rename(struct ndr_pull *ndr, int flags, struct dfs_Rename *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Rename(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Rename *r) -{ - ndr_print_struct(ndr, name, "dfs_Rename"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_Rename"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_Rename"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Move(struct ndr_push *ndr, int flags, const struct dfs_Move *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Move(struct ndr_pull *ndr, int flags, struct dfs_Move *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Move(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Move *r) -{ - ndr_print_struct(ndr, name, "dfs_Move"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_Move"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_Move"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_ManagerGetConfigInfo(struct ndr_push *ndr, int flags, const struct dfs_ManagerGetConfigInfo *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_ManagerGetConfigInfo(struct ndr_pull *ndr, int flags, struct dfs_ManagerGetConfigInfo *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_ManagerGetConfigInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerGetConfigInfo *r) -{ - ndr_print_struct(ndr, name, "dfs_ManagerGetConfigInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_ManagerGetConfigInfo"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_ManagerGetConfigInfo"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_ManagerSendSiteInfo(struct ndr_push *ndr, int flags, const struct dfs_ManagerSendSiteInfo *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_ManagerSendSiteInfo(struct ndr_pull *ndr, int flags, struct dfs_ManagerSendSiteInfo *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_ManagerSendSiteInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerSendSiteInfo *r) -{ - ndr_print_struct(ndr, name, "dfs_ManagerSendSiteInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_ManagerSendSiteInfo"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_ManagerSendSiteInfo"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_AddFtRoot(struct ndr_push *ndr, int flags, const struct dfs_AddFtRoot *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_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.dns_servername, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dns_servername, ndr_charset_length(r->in.dns_servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfsname, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfsname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfsname, ndr_charset_length(r->in.dfsname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.comment, ndr_charset_length(r->in.comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfs_config_dn, 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_config_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_config_dn, ndr_charset_length(r->in.dfs_config_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.unknown1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown2)); - if (r->in.unknown2) { - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.unknown2)); - if (*r->in.unknown2) { - NDR_CHECK(ndr_push_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.unknown2)); - } - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.unknown2)); - if (r->out.unknown2) { - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.unknown2)); - if (*r->out.unknown2) { - NDR_CHECK(ndr_push_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.unknown2)); - } - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_AddFtRoot(struct ndr_pull *ndr, int flags, struct dfs_AddFtRoot *r) -{ - uint32_t _ptr_unknown2; - TALLOC_CTX *_mem_save_unknown2_0; - TALLOC_CTX *_mem_save_unknown2_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_servername)); - if (ndr_get_array_length(ndr, &r->in.dns_servername) > ndr_get_array_size(ndr, &r->in.dns_servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dns_servername), ndr_get_array_length(ndr, &r->in.dns_servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dns_servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_servername, ndr_get_array_length(ndr, &r->in.dns_servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfsname)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfsname)); - if (ndr_get_array_length(ndr, &r->in.dfsname) > ndr_get_array_size(ndr, &r->in.dfsname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfsname), ndr_get_array_length(ndr, &r->in.dfsname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfsname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfsname, ndr_get_array_length(ndr, &r->in.dfsname), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); - if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.comment)); - if (ndr_get_array_length(ndr, &r->in.comment) > ndr_get_array_size(ndr, &r->in.comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.comment), ndr_get_array_length(ndr, &r->in.comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.comment, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_config_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_config_dn)); - if (ndr_get_array_length(ndr, &r->in.dfs_config_dn) > ndr_get_array_size(ndr, &r->in.dfs_config_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_config_dn), ndr_get_array_length(ndr, &r->in.dfs_config_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_config_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_config_dn, ndr_get_array_length(ndr, &r->in.dfs_config_dn), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); - if (_ptr_unknown2) { - NDR_PULL_ALLOC(ndr, r->in.unknown2); - } else { - r->in.unknown2 = NULL; - } - if (r->in.unknown2) { - _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown2, 0); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); - if (_ptr_unknown2) { - NDR_PULL_ALLOC(ndr, *r->in.unknown2); - } else { - *r->in.unknown2 = NULL; - } - if (*r->in.unknown2) { - _mem_save_unknown2_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->in.unknown2, 0); - NDR_CHECK(ndr_pull_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.unknown2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); - if (_ptr_unknown2) { - NDR_PULL_ALLOC(ndr, r->out.unknown2); - } else { - r->out.unknown2 = NULL; - } - if (r->out.unknown2) { - _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown2, 0); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); - if (_ptr_unknown2) { - NDR_PULL_ALLOC(ndr, *r->out.unknown2); - } else { - *r->out.unknown2 = NULL; - } - if (*r->out.unknown2) { - _mem_save_unknown2_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.unknown2, 0); - NDR_CHECK(ndr_pull_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.unknown2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_AddFtRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddFtRoot *r) -{ - ndr_print_struct(ndr, name, "dfs_AddFtRoot"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_AddFtRoot"); - ndr->depth++; - ndr_print_string(ndr, "servername", r->in.servername); - ndr_print_string(ndr, "dns_servername", r->in.dns_servername); - ndr_print_string(ndr, "dfsname", r->in.dfsname); - ndr_print_string(ndr, "rootshare", r->in.rootshare); - ndr_print_string(ndr, "comment", r->in.comment); - ndr_print_string(ndr, "dfs_config_dn", r->in.dfs_config_dn); - ndr_print_uint8(ndr, "unknown1", r->in.unknown1); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr_print_ptr(ndr, "unknown2", r->in.unknown2); - ndr->depth++; - if (r->in.unknown2) { - ndr_print_ptr(ndr, "unknown2", *r->in.unknown2); - ndr->depth++; - if (*r->in.unknown2) { - ndr_print_dfs_UnknownStruct(ndr, "unknown2", *r->in.unknown2); - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_AddFtRoot"); - ndr->depth++; - ndr_print_ptr(ndr, "unknown2", r->out.unknown2); - ndr->depth++; - if (r->out.unknown2) { - ndr_print_ptr(ndr, "unknown2", *r->out.unknown2); - ndr->depth++; - if (*r->out.unknown2) { - ndr_print_dfs_UnknownStruct(ndr, "unknown2", *r->out.unknown2); - } - ndr->depth--; - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_RemoveFtRoot(struct ndr_push *ndr, int flags, const struct dfs_RemoveFtRoot *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_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.dns_servername, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dns_servername, ndr_charset_length(r->in.dns_servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfsname, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfsname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfsname, ndr_charset_length(r->in.dfsname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); - if (r->in.unknown) { - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.unknown)); - if (*r->in.unknown) { - NDR_CHECK(ndr_push_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.unknown)); - } - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.unknown)); - if (r->out.unknown) { - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.unknown)); - if (*r->out.unknown) { - NDR_CHECK(ndr_push_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.unknown)); - } - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_RemoveFtRoot(struct ndr_pull *ndr, int flags, struct dfs_RemoveFtRoot *r) -{ - uint32_t _ptr_unknown; - TALLOC_CTX *_mem_save_unknown_0; - TALLOC_CTX *_mem_save_unknown_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_servername)); - if (ndr_get_array_length(ndr, &r->in.dns_servername) > ndr_get_array_size(ndr, &r->in.dns_servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dns_servername), ndr_get_array_length(ndr, &r->in.dns_servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dns_servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_servername, ndr_get_array_length(ndr, &r->in.dns_servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfsname)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfsname)); - if (ndr_get_array_length(ndr, &r->in.dfsname) > ndr_get_array_size(ndr, &r->in.dfsname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfsname), ndr_get_array_length(ndr, &r->in.dfsname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfsname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfsname, ndr_get_array_length(ndr, &r->in.dfsname), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); - if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); - if (_ptr_unknown) { - NDR_PULL_ALLOC(ndr, r->in.unknown); - } else { - r->in.unknown = NULL; - } - if (r->in.unknown) { - _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown, 0); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); - if (_ptr_unknown) { - NDR_PULL_ALLOC(ndr, *r->in.unknown); - } else { - *r->in.unknown = NULL; - } - if (*r->in.unknown) { - _mem_save_unknown_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->in.unknown, 0); - NDR_CHECK(ndr_pull_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.unknown)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); - if (_ptr_unknown) { - NDR_PULL_ALLOC(ndr, r->out.unknown); - } else { - r->out.unknown = NULL; - } - if (r->out.unknown) { - _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown, 0); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); - if (_ptr_unknown) { - NDR_PULL_ALLOC(ndr, *r->out.unknown); - } else { - *r->out.unknown = NULL; - } - if (*r->out.unknown) { - _mem_save_unknown_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.unknown, 0); - NDR_CHECK(ndr_pull_dfs_UnknownStruct(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.unknown)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_RemoveFtRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_RemoveFtRoot *r) -{ - ndr_print_struct(ndr, name, "dfs_RemoveFtRoot"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_RemoveFtRoot"); - ndr->depth++; - ndr_print_string(ndr, "servername", r->in.servername); - ndr_print_string(ndr, "dns_servername", r->in.dns_servername); - ndr_print_string(ndr, "dfsname", r->in.dfsname); - ndr_print_string(ndr, "rootshare", r->in.rootshare); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr_print_ptr(ndr, "unknown", r->in.unknown); - ndr->depth++; - if (r->in.unknown) { - ndr_print_ptr(ndr, "unknown", *r->in.unknown); - ndr->depth++; - if (*r->in.unknown) { - ndr_print_dfs_UnknownStruct(ndr, "unknown", *r->in.unknown); - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_RemoveFtRoot"); - ndr->depth++; - ndr_print_ptr(ndr, "unknown", r->out.unknown); - ndr->depth++; - if (r->out.unknown) { - ndr_print_ptr(ndr, "unknown", *r->out.unknown); - ndr->depth++; - if (*r->out.unknown) { - ndr_print_dfs_UnknownStruct(ndr, "unknown", *r->out.unknown); - } - ndr->depth--; - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_AddStdRoot(struct ndr_push *ndr, int flags, const struct dfs_AddStdRoot *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.comment, ndr_charset_length(r->in.comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_AddStdRoot(struct ndr_pull *ndr, int flags, struct dfs_AddStdRoot *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); - if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.comment)); - if (ndr_get_array_length(ndr, &r->in.comment) > ndr_get_array_size(ndr, &r->in.comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.comment), ndr_get_array_length(ndr, &r->in.comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.comment, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_AddStdRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddStdRoot *r) -{ - ndr_print_struct(ndr, name, "dfs_AddStdRoot"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_AddStdRoot"); - ndr->depth++; - ndr_print_string(ndr, "servername", r->in.servername); - ndr_print_string(ndr, "rootshare", r->in.rootshare); - ndr_print_string(ndr, "comment", r->in.comment); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_AddStdRoot"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_RemoveStdRoot(struct ndr_push *ndr, int flags, const struct dfs_RemoveStdRoot *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_RemoveStdRoot(struct ndr_pull *ndr, int flags, struct dfs_RemoveStdRoot *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); - if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_RemoveStdRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_RemoveStdRoot *r) -{ - ndr_print_struct(ndr, name, "dfs_RemoveStdRoot"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_RemoveStdRoot"); - ndr->depth++; - ndr_print_string(ndr, "servername", r->in.servername); - ndr_print_string(ndr, "rootshare", r->in.rootshare); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_RemoveStdRoot"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_ManagerInitialize(struct ndr_pull *ndr, int flags, struct dfs_ManagerInitialize *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_ManagerInitialize(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerInitialize *r) -{ - ndr_print_struct(ndr, name, "dfs_ManagerInitialize"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_ManagerInitialize"); - ndr->depth++; - ndr_print_ptr(ndr, "servername", r->in.servername); - ndr->depth++; - ndr_print_string(ndr, "servername", r->in.servername); - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_ManagerInitialize"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_AddStdRootForced(struct ndr_push *ndr, int flags, const struct dfs_AddStdRootForced *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.comment, ndr_charset_length(r->in.comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.store, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.store, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.store, ndr_charset_length(r->in.store, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_AddStdRootForced(struct ndr_pull *ndr, int flags, struct dfs_AddStdRootForced *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); - if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.comment)); - if (ndr_get_array_length(ndr, &r->in.comment) > ndr_get_array_size(ndr, &r->in.comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.comment), ndr_get_array_length(ndr, &r->in.comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.comment, ndr_get_array_length(ndr, &r->in.comment), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.store)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.store)); - if (ndr_get_array_length(ndr, &r->in.store) > ndr_get_array_size(ndr, &r->in.store)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.store), ndr_get_array_length(ndr, &r->in.store)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.store), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.store, ndr_get_array_length(ndr, &r->in.store), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_AddStdRootForced(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddStdRootForced *r) -{ - ndr_print_struct(ndr, name, "dfs_AddStdRootForced"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_AddStdRootForced"); - ndr->depth++; - ndr_print_string(ndr, "servername", r->in.servername); - ndr_print_string(ndr, "rootshare", r->in.rootshare); - ndr_print_string(ndr, "comment", r->in.comment); - ndr_print_string(ndr, "store", r->in.store); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_AddStdRootForced"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_GetDcAddress(struct ndr_push *ndr, int flags, const struct dfs_GetDcAddress *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - if (r->in.server_fullname == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.server_fullname)); - if (*r->in.server_fullname) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.server_fullname, 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_fullname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->in.server_fullname, ndr_charset_length(*r->in.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->in.is_root == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.is_root)); - if (r->in.ttl == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.ttl)); - } - if (flags & NDR_OUT) { - if (r->out.server_fullname == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.server_fullname)); - if (*r->out.server_fullname) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.server_fullname, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.server_fullname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.server_fullname, ndr_charset_length(*r->out.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->out.is_root == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.is_root)); - if (r->out.ttl == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.ttl)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_GetDcAddress(struct ndr_pull *ndr, int flags, struct dfs_GetDcAddress *r) -{ - uint32_t _ptr_server_fullname; - TALLOC_CTX *_mem_save_server_fullname_0; - TALLOC_CTX *_mem_save_server_fullname_1; - TALLOC_CTX *_mem_save_is_root_0; - TALLOC_CTX *_mem_save_ttl_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.server_fullname); - } - _mem_save_server_fullname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_fullname, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_fullname)); - if (_ptr_server_fullname) { - NDR_PULL_ALLOC(ndr, *r->in.server_fullname); - } else { - *r->in.server_fullname = NULL; - } - if (*r->in.server_fullname) { - _mem_save_server_fullname_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->in.server_fullname, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->in.server_fullname)); - NDR_CHECK(ndr_pull_array_length(ndr, r->in.server_fullname)); - if (ndr_get_array_length(ndr, r->in.server_fullname) > ndr_get_array_size(ndr, r->in.server_fullname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->in.server_fullname), ndr_get_array_length(ndr, r->in.server_fullname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->in.server_fullname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->in.server_fullname, ndr_get_array_length(ndr, r->in.server_fullname), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.is_root); - } - _mem_save_is_root_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.is_root, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.is_root)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_is_root_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.ttl); - } - _mem_save_ttl_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.ttl, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.ttl)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ttl_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.server_fullname); - *r->out.server_fullname = *r->in.server_fullname; - NDR_PULL_ALLOC(ndr, r->out.is_root); - *r->out.is_root = *r->in.is_root; - NDR_PULL_ALLOC(ndr, r->out.ttl); - *r->out.ttl = *r->in.ttl; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.server_fullname); - } - _mem_save_server_fullname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.server_fullname, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_fullname)); - if (_ptr_server_fullname) { - NDR_PULL_ALLOC(ndr, *r->out.server_fullname); - } else { - *r->out.server_fullname = NULL; - } - if (*r->out.server_fullname) { - _mem_save_server_fullname_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.server_fullname, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.server_fullname)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.server_fullname)); - if (ndr_get_array_length(ndr, r->out.server_fullname) > ndr_get_array_size(ndr, r->out.server_fullname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.server_fullname), ndr_get_array_length(ndr, r->out.server_fullname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.server_fullname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.server_fullname, ndr_get_array_length(ndr, r->out.server_fullname), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.is_root); - } - _mem_save_is_root_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.is_root, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.is_root)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_is_root_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ttl); - } - _mem_save_ttl_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ttl, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.ttl)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ttl_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_GetDcAddress(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetDcAddress *r) -{ - ndr_print_struct(ndr, name, "dfs_GetDcAddress"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_GetDcAddress"); - ndr->depth++; - ndr_print_string(ndr, "servername", r->in.servername); - ndr_print_ptr(ndr, "server_fullname", r->in.server_fullname); - ndr->depth++; - ndr_print_ptr(ndr, "server_fullname", *r->in.server_fullname); - ndr->depth++; - if (*r->in.server_fullname) { - ndr_print_string(ndr, "server_fullname", *r->in.server_fullname); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "is_root", r->in.is_root); - ndr->depth++; - ndr_print_uint8(ndr, "is_root", *r->in.is_root); - ndr->depth--; - ndr_print_ptr(ndr, "ttl", r->in.ttl); - ndr->depth++; - ndr_print_uint32(ndr, "ttl", *r->in.ttl); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_GetDcAddress"); - ndr->depth++; - ndr_print_ptr(ndr, "server_fullname", r->out.server_fullname); - ndr->depth++; - ndr_print_ptr(ndr, "server_fullname", *r->out.server_fullname); - ndr->depth++; - if (*r->out.server_fullname) { - ndr_print_string(ndr, "server_fullname", *r->out.server_fullname); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "is_root", r->out.is_root); - ndr->depth++; - ndr_print_uint8(ndr, "is_root", *r->out.is_root); - ndr->depth--; - ndr_print_ptr(ndr, "ttl", r->out.ttl); - ndr->depth++; - ndr_print_uint32(ndr, "ttl", *r->out.ttl); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_SetDcAddress(struct ndr_push *ndr, int flags, const struct dfs_SetDcAddress *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_fullname, 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_fullname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_fullname, ndr_charset_length(r->in.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.ttl)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_SetDcAddress(struct ndr_pull *ndr, int flags, struct dfs_SetDcAddress *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_fullname)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_fullname)); - if (ndr_get_array_length(ndr, &r->in.server_fullname) > ndr_get_array_size(ndr, &r->in.server_fullname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_fullname), ndr_get_array_length(ndr, &r->in.server_fullname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_fullname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_fullname, ndr_get_array_length(ndr, &r->in.server_fullname), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.ttl)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_SetDcAddress(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetDcAddress *r) -{ - ndr_print_struct(ndr, name, "dfs_SetDcAddress"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_SetDcAddress"); - ndr->depth++; - ndr_print_string(ndr, "servername", r->in.servername); - ndr_print_string(ndr, "server_fullname", r->in.server_fullname); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr_print_uint32(ndr, "ttl", r->in.ttl); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_SetDcAddress"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_FlushFtTable(struct ndr_push *ndr, int flags, const struct dfs_FlushFtTable *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.rootshare, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.rootshare, ndr_charset_length(r->in.rootshare, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_FlushFtTable(struct ndr_pull *ndr, int flags, struct dfs_FlushFtTable *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); - if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rootshare)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rootshare)); - if (ndr_get_array_length(ndr, &r->in.rootshare) > ndr_get_array_size(ndr, &r->in.rootshare)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rootshare), ndr_get_array_length(ndr, &r->in.rootshare)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.rootshare, ndr_get_array_length(ndr, &r->in.rootshare), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_FlushFtTable(struct ndr_print *ndr, const char *name, int flags, const struct dfs_FlushFtTable *r) -{ - ndr_print_struct(ndr, name, "dfs_FlushFtTable"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_FlushFtTable"); - ndr->depth++; - ndr_print_string(ndr, "servername", r->in.servername); - ndr_print_string(ndr, "rootshare", r->in.rootshare); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_FlushFtTable"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Add2(struct ndr_push *ndr, int flags, const struct dfs_Add2 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Add2(struct ndr_pull *ndr, int flags, struct dfs_Add2 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Add2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Add2 *r) -{ - ndr_print_struct(ndr, name, "dfs_Add2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_Add2"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_Add2"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_Remove2(struct ndr_push *ndr, int flags, const struct dfs_Remove2 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_Remove2(struct ndr_pull *ndr, int flags, struct dfs_Remove2 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_Remove2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Remove2 *r) -{ - ndr_print_struct(ndr, name, "dfs_Remove2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_Remove2"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_Remove2"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_dfs_EnumEx(struct ndr_push *ndr, int flags, const struct dfs_EnumEx *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dfs_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.dfs_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dfs_name, ndr_charset_length(r->in.dfs_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); - if (r->in.info) { - NDR_CHECK(ndr_push_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.total)); - if (r->in.total) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.total)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.total)); - if (r->out.total) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_dfs_EnumEx(struct ndr_pull *ndr, int flags, struct dfs_EnumEx *r) -{ - uint32_t _ptr_info; - uint32_t _ptr_total; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_total_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dfs_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dfs_name)); - if (ndr_get_array_length(ndr, &r->in.dfs_name) > ndr_get_array_size(ndr, &r->in.dfs_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dfs_name), ndr_get_array_length(ndr, &r->in.dfs_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dfs_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dfs_name, ndr_get_array_length(ndr, &r->in.dfs_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bufsize)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->in.info); - } else { - r->in.info = NULL; - } - if (r->in.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); - NDR_CHECK(ndr_pull_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_total)); - if (_ptr_total) { - NDR_PULL_ALLOC(ndr, r->in.total); - } else { - r->in.total = NULL; - } - if (r->in.total) { - _mem_save_total_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.total, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.total)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->out.info); - } else { - r->out.info = NULL; - } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_dfs_EnumStruct(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_total)); - if (_ptr_total) { - NDR_PULL_ALLOC(ndr, r->out.total); - } else { - r->out.total = NULL; - } - if (r->out.total) { - _mem_save_total_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.total, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_EnumEx(struct ndr_print *ndr, const char *name, int flags, const struct dfs_EnumEx *r) -{ - ndr_print_struct(ndr, name, "dfs_EnumEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_EnumEx"); - ndr->depth++; - ndr_print_string(ndr, "dfs_name", r->in.dfs_name); - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_uint32(ndr, "bufsize", r->in.bufsize); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - if (r->in.info) { - ndr_print_dfs_EnumStruct(ndr, "info", r->in.info); - } - ndr->depth--; - ndr_print_ptr(ndr, "total", r->in.total); - ndr->depth++; - if (r->in.total) { - ndr_print_uint32(ndr, "total", *r->in.total); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_EnumEx"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - if (r->out.info) { - ndr_print_dfs_EnumStruct(ndr, "info", r->out.info); - } - ndr->depth--; - ndr_print_ptr(ndr, "total", r->out.total); - ndr->depth++; - if (r->out.total) { - ndr_print_uint32(ndr, "total", *r->out.total); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dfs_SetInfo2(struct ndr_push *ndr, int flags, const struct dfs_SetInfo2 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dfs_SetInfo2(struct ndr_pull *ndr, int flags, struct dfs_SetInfo2 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dfs_SetInfo2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetInfo2 *r) -{ - ndr_print_struct(ndr, name, "dfs_SetInfo2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dfs_SetInfo2"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dfs_SetInfo2"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call netdfs_calls[] = { - { - "dfs_GetManagerVersion", - sizeof(struct dfs_GetManagerVersion), - (ndr_push_flags_fn_t) ndr_push_dfs_GetManagerVersion, - (ndr_pull_flags_fn_t) ndr_pull_dfs_GetManagerVersion, - (ndr_print_function_t) ndr_print_dfs_GetManagerVersion, - false, - }, - { - "dfs_Add", - sizeof(struct dfs_Add), - (ndr_push_flags_fn_t) ndr_push_dfs_Add, - (ndr_pull_flags_fn_t) ndr_pull_dfs_Add, - (ndr_print_function_t) ndr_print_dfs_Add, - false, - }, - { - "dfs_Remove", - sizeof(struct dfs_Remove), - (ndr_push_flags_fn_t) ndr_push_dfs_Remove, - (ndr_pull_flags_fn_t) ndr_pull_dfs_Remove, - (ndr_print_function_t) ndr_print_dfs_Remove, - false, - }, - { - "dfs_SetInfo", - sizeof(struct dfs_SetInfo), - (ndr_push_flags_fn_t) ndr_push_dfs_SetInfo, - (ndr_pull_flags_fn_t) ndr_pull_dfs_SetInfo, - (ndr_print_function_t) ndr_print_dfs_SetInfo, - false, - }, - { - "dfs_GetInfo", - sizeof(struct dfs_GetInfo), - (ndr_push_flags_fn_t) ndr_push_dfs_GetInfo, - (ndr_pull_flags_fn_t) ndr_pull_dfs_GetInfo, - (ndr_print_function_t) ndr_print_dfs_GetInfo, - false, - }, - { - "dfs_Enum", - sizeof(struct dfs_Enum), - (ndr_push_flags_fn_t) ndr_push_dfs_Enum, - (ndr_pull_flags_fn_t) ndr_pull_dfs_Enum, - (ndr_print_function_t) ndr_print_dfs_Enum, - false, - }, - { - "dfs_Rename", - sizeof(struct dfs_Rename), - (ndr_push_flags_fn_t) ndr_push_dfs_Rename, - (ndr_pull_flags_fn_t) ndr_pull_dfs_Rename, - (ndr_print_function_t) ndr_print_dfs_Rename, - false, - }, - { - "dfs_Move", - sizeof(struct dfs_Move), - (ndr_push_flags_fn_t) ndr_push_dfs_Move, - (ndr_pull_flags_fn_t) ndr_pull_dfs_Move, - (ndr_print_function_t) ndr_print_dfs_Move, - false, - }, - { - "dfs_ManagerGetConfigInfo", - sizeof(struct dfs_ManagerGetConfigInfo), - (ndr_push_flags_fn_t) ndr_push_dfs_ManagerGetConfigInfo, - (ndr_pull_flags_fn_t) ndr_pull_dfs_ManagerGetConfigInfo, - (ndr_print_function_t) ndr_print_dfs_ManagerGetConfigInfo, - false, - }, - { - "dfs_ManagerSendSiteInfo", - sizeof(struct dfs_ManagerSendSiteInfo), - (ndr_push_flags_fn_t) ndr_push_dfs_ManagerSendSiteInfo, - (ndr_pull_flags_fn_t) ndr_pull_dfs_ManagerSendSiteInfo, - (ndr_print_function_t) ndr_print_dfs_ManagerSendSiteInfo, - false, - }, - { - "dfs_AddFtRoot", - sizeof(struct dfs_AddFtRoot), - (ndr_push_flags_fn_t) ndr_push_dfs_AddFtRoot, - (ndr_pull_flags_fn_t) ndr_pull_dfs_AddFtRoot, - (ndr_print_function_t) ndr_print_dfs_AddFtRoot, - false, - }, - { - "dfs_RemoveFtRoot", - sizeof(struct dfs_RemoveFtRoot), - (ndr_push_flags_fn_t) ndr_push_dfs_RemoveFtRoot, - (ndr_pull_flags_fn_t) ndr_pull_dfs_RemoveFtRoot, - (ndr_print_function_t) ndr_print_dfs_RemoveFtRoot, - false, - }, - { - "dfs_AddStdRoot", - sizeof(struct dfs_AddStdRoot), - (ndr_push_flags_fn_t) ndr_push_dfs_AddStdRoot, - (ndr_pull_flags_fn_t) ndr_pull_dfs_AddStdRoot, - (ndr_print_function_t) ndr_print_dfs_AddStdRoot, - false, - }, - { - "dfs_RemoveStdRoot", - sizeof(struct dfs_RemoveStdRoot), - (ndr_push_flags_fn_t) ndr_push_dfs_RemoveStdRoot, - (ndr_pull_flags_fn_t) ndr_pull_dfs_RemoveStdRoot, - (ndr_print_function_t) ndr_print_dfs_RemoveStdRoot, - false, - }, - { - "dfs_ManagerInitialize", - sizeof(struct dfs_ManagerInitialize), - (ndr_push_flags_fn_t) ndr_push_dfs_ManagerInitialize, - (ndr_pull_flags_fn_t) ndr_pull_dfs_ManagerInitialize, - (ndr_print_function_t) ndr_print_dfs_ManagerInitialize, - false, - }, - { - "dfs_AddStdRootForced", - sizeof(struct dfs_AddStdRootForced), - (ndr_push_flags_fn_t) ndr_push_dfs_AddStdRootForced, - (ndr_pull_flags_fn_t) ndr_pull_dfs_AddStdRootForced, - (ndr_print_function_t) ndr_print_dfs_AddStdRootForced, - false, - }, - { - "dfs_GetDcAddress", - sizeof(struct dfs_GetDcAddress), - (ndr_push_flags_fn_t) ndr_push_dfs_GetDcAddress, - (ndr_pull_flags_fn_t) ndr_pull_dfs_GetDcAddress, - (ndr_print_function_t) ndr_print_dfs_GetDcAddress, - false, - }, - { - "dfs_SetDcAddress", - sizeof(struct dfs_SetDcAddress), - (ndr_push_flags_fn_t) ndr_push_dfs_SetDcAddress, - (ndr_pull_flags_fn_t) ndr_pull_dfs_SetDcAddress, - (ndr_print_function_t) ndr_print_dfs_SetDcAddress, - false, - }, - { - "dfs_FlushFtTable", - sizeof(struct dfs_FlushFtTable), - (ndr_push_flags_fn_t) ndr_push_dfs_FlushFtTable, - (ndr_pull_flags_fn_t) ndr_pull_dfs_FlushFtTable, - (ndr_print_function_t) ndr_print_dfs_FlushFtTable, - false, - }, - { - "dfs_Add2", - sizeof(struct dfs_Add2), - (ndr_push_flags_fn_t) ndr_push_dfs_Add2, - (ndr_pull_flags_fn_t) ndr_pull_dfs_Add2, - (ndr_print_function_t) ndr_print_dfs_Add2, - false, - }, - { - "dfs_Remove2", - sizeof(struct dfs_Remove2), - (ndr_push_flags_fn_t) ndr_push_dfs_Remove2, - (ndr_pull_flags_fn_t) ndr_pull_dfs_Remove2, - (ndr_print_function_t) ndr_print_dfs_Remove2, - false, - }, - { - "dfs_EnumEx", - sizeof(struct dfs_EnumEx), - (ndr_push_flags_fn_t) ndr_push_dfs_EnumEx, - (ndr_pull_flags_fn_t) ndr_pull_dfs_EnumEx, - (ndr_print_function_t) ndr_print_dfs_EnumEx, - false, - }, - { - "dfs_SetInfo2", - sizeof(struct dfs_SetInfo2), - (ndr_push_flags_fn_t) ndr_push_dfs_SetInfo2, - (ndr_pull_flags_fn_t) ndr_pull_dfs_SetInfo2, - (ndr_print_function_t) ndr_print_dfs_SetInfo2, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const netdfs_endpoint_strings[] = { - "ncacn_np:[\\pipe\\netdfs]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array netdfs_endpoints = { - .count = 3, - .names = netdfs_endpoint_strings -}; - -static const char * const netdfs_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array netdfs_authservices = { - .count = 1, - .names = netdfs_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_netdfs = { - .name = "netdfs", - .syntax_id = { - {0x4fc742e0,0x4a10,0x11cf,{0x82,0x73},{0x00,0xaa,0x00,0x4a,0xe6,0x73}}, - NDR_NETDFS_VERSION - }, - .helpstring = NDR_NETDFS_HELPSTRING, - .num_calls = 23, - .calls = netdfs_calls, - .endpoints = &netdfs_endpoints, - .authservices = &netdfs_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_dfs.h b/source3/librpc/gen_ndr/ndr_dfs.h deleted file mode 100644 index a7c66f9693..0000000000 --- a/source3/librpc/gen_ndr/ndr_dfs.h +++ /dev/null @@ -1,132 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/dfs.h" - -#ifndef _HEADER_NDR_netdfs -#define _HEADER_NDR_netdfs - -#define NDR_NETDFS_UUID "4fc742e0-4a10-11cf-8273-00aa004ae673" -#define NDR_NETDFS_VERSION 3.0 -#define NDR_NETDFS_NAME "netdfs" -#define NDR_NETDFS_HELPSTRING "Settings for Microsoft Distributed File System" -extern const struct ndr_interface_table ndr_table_netdfs; -#define NDR_DFS_GETMANAGERVERSION (0x00) - -#define NDR_DFS_ADD (0x01) - -#define NDR_DFS_REMOVE (0x02) - -#define NDR_DFS_SETINFO (0x03) - -#define NDR_DFS_GETINFO (0x04) - -#define NDR_DFS_ENUM (0x05) - -#define NDR_DFS_RENAME (0x06) - -#define NDR_DFS_MOVE (0x07) - -#define NDR_DFS_MANAGERGETCONFIGINFO (0x08) - -#define NDR_DFS_MANAGERSENDSITEINFO (0x09) - -#define NDR_DFS_ADDFTROOT (0x0a) - -#define NDR_DFS_REMOVEFTROOT (0x0b) - -#define NDR_DFS_ADDSTDROOT (0x0c) - -#define NDR_DFS_REMOVESTDROOT (0x0d) - -#define NDR_DFS_MANAGERINITIALIZE (0x0e) - -#define NDR_DFS_ADDSTDROOTFORCED (0x0f) - -#define NDR_DFS_GETDCADDRESS (0x10) - -#define NDR_DFS_SETDCADDRESS (0x11) - -#define NDR_DFS_FLUSHFTTABLE (0x12) - -#define NDR_DFS_ADD2 (0x13) - -#define NDR_DFS_REMOVE2 (0x14) - -#define NDR_DFS_ENUMEX (0x15) - -#define NDR_DFS_SETINFO2 (0x16) - -#define NDR_NETDFS_CALL_COUNT (23) -void ndr_print_dfs_ManagerVersion(struct ndr_print *ndr, const char *name, enum dfs_ManagerVersion r); -void ndr_print_dfs_Info0(struct ndr_print *ndr, const char *name, const struct dfs_Info0 *r); -void ndr_print_dfs_Info1(struct ndr_print *ndr, const char *name, const struct dfs_Info1 *r); -enum ndr_err_code ndr_push_dfs_VolumeState(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_dfs_VolumeState(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_dfs_VolumeState(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_dfs_Info2(struct ndr_print *ndr, const char *name, const struct dfs_Info2 *r); -enum ndr_err_code ndr_push_dfs_StorageState(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_dfs_StorageState(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_dfs_StorageState(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_dfs_StorageInfo(struct ndr_print *ndr, const char *name, const struct dfs_StorageInfo *r); -void ndr_print_dfs_Info3(struct ndr_print *ndr, const char *name, const struct dfs_Info3 *r); -void ndr_print_dfs_Info4(struct ndr_print *ndr, const char *name, const struct dfs_Info4 *r); -enum ndr_err_code ndr_push_dfs_PropertyFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_dfs_PropertyFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_dfs_PropertyFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_dfs_Info5(struct ndr_print *ndr, const char *name, const struct dfs_Info5 *r); -void ndr_print_dfs_Target_PriorityClass(struct ndr_print *ndr, const char *name, enum dfs_Target_PriorityClass r); -void ndr_print_dfs_Target_Priority(struct ndr_print *ndr, const char *name, const struct dfs_Target_Priority *r); -void ndr_print_dfs_StorageInfo2(struct ndr_print *ndr, const char *name, const struct dfs_StorageInfo2 *r); -void ndr_print_dfs_Info6(struct ndr_print *ndr, const char *name, const struct dfs_Info6 *r); -void ndr_print_dfs_Info7(struct ndr_print *ndr, const char *name, const struct dfs_Info7 *r); -void ndr_print_dfs_Info100(struct ndr_print *ndr, const char *name, const struct dfs_Info100 *r); -void ndr_print_dfs_Info101(struct ndr_print *ndr, const char *name, const struct dfs_Info101 *r); -void ndr_print_dfs_Info102(struct ndr_print *ndr, const char *name, const struct dfs_Info102 *r); -void ndr_print_dfs_Info103(struct ndr_print *ndr, const char *name, const struct dfs_Info103 *r); -void ndr_print_dfs_Info104(struct ndr_print *ndr, const char *name, const struct dfs_Info104 *r); -void ndr_print_dfs_Info105(struct ndr_print *ndr, const char *name, const struct dfs_Info105 *r); -void ndr_print_dfs_Info106(struct ndr_print *ndr, const char *name, const struct dfs_Info106 *r); -void ndr_print_dfs_Info200(struct ndr_print *ndr, const char *name, const struct dfs_Info200 *r); -void ndr_print_dfs_VolumeFlavor(struct ndr_print *ndr, const char *name, enum dfs_VolumeFlavor r); -void ndr_print_dfs_Info300(struct ndr_print *ndr, const char *name, const struct dfs_Info300 *r); -void ndr_print_dfs_Info(struct ndr_print *ndr, const char *name, const union dfs_Info *r); -void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray1 *r); -void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray2 *r); -void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray3 *r); -void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray4 *r); -void ndr_print_dfs_EnumArray5(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray5 *r); -void ndr_print_dfs_EnumArray6(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray6 *r); -void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray200 *r); -void ndr_print_dfs_EnumArray300(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray300 *r); -void ndr_print_dfs_EnumInfo(struct ndr_print *ndr, const char *name, const union dfs_EnumInfo *r); -void ndr_print_dfs_EnumStruct(struct ndr_print *ndr, const char *name, const struct dfs_EnumStruct *r); -void ndr_print_dfs_UnknownStruct(struct ndr_print *ndr, const char *name, const struct dfs_UnknownStruct *r); -enum ndr_err_code ndr_push_dfs_GetManagerVersion(struct ndr_push *ndr, int flags, const struct dfs_GetManagerVersion *r); -enum ndr_err_code ndr_pull_dfs_GetManagerVersion(struct ndr_pull *ndr, int flags, struct dfs_GetManagerVersion *r); -void ndr_print_dfs_GetManagerVersion(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetManagerVersion *r); -void ndr_print_dfs_Add(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Add *r); -void ndr_print_dfs_Remove(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Remove *r); -void ndr_print_dfs_SetInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetInfo *r); -void ndr_print_dfs_GetInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetInfo *r); -void ndr_print_dfs_Enum(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Enum *r); -void ndr_print_dfs_Rename(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Rename *r); -void ndr_print_dfs_Move(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Move *r); -void ndr_print_dfs_ManagerGetConfigInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerGetConfigInfo *r); -void ndr_print_dfs_ManagerSendSiteInfo(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerSendSiteInfo *r); -void ndr_print_dfs_AddFtRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddFtRoot *r); -void ndr_print_dfs_RemoveFtRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_RemoveFtRoot *r); -void ndr_print_dfs_AddStdRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddStdRoot *r); -void ndr_print_dfs_RemoveStdRoot(struct ndr_print *ndr, const char *name, int flags, const struct dfs_RemoveStdRoot *r); -void ndr_print_dfs_ManagerInitialize(struct ndr_print *ndr, const char *name, int flags, const struct dfs_ManagerInitialize *r); -void ndr_print_dfs_AddStdRootForced(struct ndr_print *ndr, const char *name, int flags, const struct dfs_AddStdRootForced *r); -void ndr_print_dfs_GetDcAddress(struct ndr_print *ndr, const char *name, int flags, const struct dfs_GetDcAddress *r); -void ndr_print_dfs_SetDcAddress(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetDcAddress *r); -void ndr_print_dfs_FlushFtTable(struct ndr_print *ndr, const char *name, int flags, const struct dfs_FlushFtTable *r); -void ndr_print_dfs_Add2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Add2 *r); -void ndr_print_dfs_Remove2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_Remove2 *r); -enum ndr_err_code ndr_push_dfs_EnumEx(struct ndr_push *ndr, int flags, const struct dfs_EnumEx *r); -enum ndr_err_code ndr_pull_dfs_EnumEx(struct ndr_pull *ndr, int flags, struct dfs_EnumEx *r); -void ndr_print_dfs_EnumEx(struct ndr_print *ndr, const char *name, int flags, const struct dfs_EnumEx *r); -void ndr_print_dfs_SetInfo2(struct ndr_print *ndr, const char *name, int flags, const struct dfs_SetInfo2 *r); -#endif /* _HEADER_NDR_netdfs */ diff --git a/source3/librpc/gen_ndr/ndr_drsblobs.c b/source3/librpc/gen_ndr/ndr_drsblobs.c deleted file mode 100644 index d965e40bd2..0000000000 --- a/source3/librpc/gen_ndr/ndr_drsblobs.c +++ /dev/null @@ -1,4267 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_drsblobs.h" - -#include "librpc/gen_ndr/ndr_drsuapi.h" -#include "librpc/gen_ndr/ndr_misc.h" -#include "librpc/gen_ndr/ndr_samr.h" -#include "librpc/gen_ndr/ndr_lsa.h" -static enum ndr_err_code ndr_push_replPropertyMetaData1(struct ndr_push *ndr, int ndr_flags, const struct replPropertyMetaData1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_change_time)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_replPropertyMetaData1(struct ndr_pull *ndr, int ndr_flags, struct replPropertyMetaData1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_change_time)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_replPropertyMetaData1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaData1 *r) -{ - ndr_print_struct(ndr, name, "replPropertyMetaData1"); - ndr->depth++; - ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid); - ndr_print_uint32(ndr, "version", r->version); - ndr_print_NTTIME_1sec(ndr, "originating_change_time", r->originating_change_time); - ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); - ndr_print_hyper(ndr, "originating_usn", r->originating_usn); - ndr_print_hyper(ndr, "local_usn", r->local_usn); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_replPropertyMetaDataCtr1(struct ndr_push *ndr, int ndr_flags, const struct replPropertyMetaDataCtr1 *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_replPropertyMetaData1(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_replPropertyMetaDataCtr1(struct ndr_pull *ndr, int ndr_flags, struct replPropertyMetaDataCtr1 *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_PULL_ALLOC_N(ndr, r->array, r->count); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_replPropertyMetaData1(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_replPropertyMetaDataCtr1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataCtr1 *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "replPropertyMetaDataCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_replPropertyMetaData1(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_replPropertyMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const union replPropertyMetaDataCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_replPropertyMetaDataCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_replPropertyMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, union replPropertyMetaDataCtr *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_replPropertyMetaDataCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_replPropertyMetaDataCtr(struct ndr_print *ndr, const char *name, const union replPropertyMetaDataCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "replPropertyMetaDataCtr"); - switch (level) { - case 1: - ndr_print_replPropertyMetaDataCtr1(ndr, "ctr1", &r->ctr1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_replPropertyMetaDataBlob(struct ndr_push *ndr, int ndr_flags, const struct replPropertyMetaDataBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_push_replPropertyMetaDataCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_replPropertyMetaDataBlob(struct ndr_pull *ndr, int ndr_flags, struct replPropertyMetaDataBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_pull_replPropertyMetaDataCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_replPropertyMetaDataBlob(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataBlob *r) -{ - ndr_print_struct(ndr, name, "replPropertyMetaDataBlob"); - ndr->depth++; - ndr_print_uint32(ndr, "version", r->version); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr_print_set_switch_value(ndr, &r->ctr, r->version); - ndr_print_replPropertyMetaDataCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_replUpToDateVectorCtr1(struct ndr_push *ndr, int ndr_flags, const struct replUpToDateVectorCtr1 *r) -{ - uint32_t cntr_cursors_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_replUpToDateVectorCtr1(struct ndr_pull *ndr, int ndr_flags, struct replUpToDateVectorCtr1 *r) -{ - uint32_t cntr_cursors_0; - TALLOC_CTX *_mem_save_cursors_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_PULL_ALLOC_N(ndr, r->cursors, r->count); - _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); - for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_replUpToDateVectorCtr1(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorCtr1 *r) -{ - uint32_t cntr_cursors_0; - ndr_print_struct(ndr, name, "replUpToDateVectorCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count); - ndr->depth++; - for (cntr_cursors_0=0;cntr_cursors_0count;cntr_cursors_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) { - ndr_print_drsuapi_DsReplicaCursor(ndr, "cursors", &r->cursors[cntr_cursors_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_replUpToDateVectorCtr2(struct ndr_push *ndr, int ndr_flags, const struct replUpToDateVectorCtr2 *r) -{ - uint32_t cntr_cursors_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_replUpToDateVectorCtr2(struct ndr_pull *ndr, int ndr_flags, struct replUpToDateVectorCtr2 *r) -{ - uint32_t cntr_cursors_0; - TALLOC_CTX *_mem_save_cursors_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_PULL_ALLOC_N(ndr, r->cursors, r->count); - _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); - for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_replUpToDateVectorCtr2(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorCtr2 *r) -{ - uint32_t cntr_cursors_0; - ndr_print_struct(ndr, name, "replUpToDateVectorCtr2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count); - ndr->depth++; - for (cntr_cursors_0=0;cntr_cursors_0count;cntr_cursors_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) { - ndr_print_drsuapi_DsReplicaCursor2(ndr, "cursors", &r->cursors[cntr_cursors_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_replUpToDateVectorCtr(struct ndr_push *ndr, int ndr_flags, const union replUpToDateVectorCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_replUpToDateVectorCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_replUpToDateVectorCtr2(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - break; - - case 2: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_replUpToDateVectorCtr(struct ndr_pull *ndr, int ndr_flags, union replUpToDateVectorCtr *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_replUpToDateVectorCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_replUpToDateVectorCtr2(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - break; - - case 2: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_replUpToDateVectorCtr(struct ndr_print *ndr, const char *name, const union replUpToDateVectorCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "replUpToDateVectorCtr"); - switch (level) { - case 1: - ndr_print_replUpToDateVectorCtr1(ndr, "ctr1", &r->ctr1); - break; - - case 2: - ndr_print_replUpToDateVectorCtr2(ndr, "ctr2", &r->ctr2); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_replUpToDateVectorBlob(struct ndr_push *ndr, int ndr_flags, const struct replUpToDateVectorBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_push_replUpToDateVectorCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_replUpToDateVectorBlob(struct ndr_pull *ndr, int ndr_flags, struct replUpToDateVectorBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_pull_replUpToDateVectorCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_replUpToDateVectorBlob(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorBlob *r) -{ - ndr_print_struct(ndr, name, "replUpToDateVectorBlob"); - ndr->depth++; - ndr_print_uint32(ndr, "version", r->version); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr_print_set_switch_value(ndr, &r->ctr, r->version); - ndr_print_replUpToDateVectorCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_repsFromTo1OtherInfo(struct ndr_push *ndr, int ndr_flags, const struct repsFromTo1OtherInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen(r->dns_name) + 1)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, strlen(r->dns_name) + 1, sizeof(uint8_t), CH_DOS)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_repsFromTo1OtherInfo(struct ndr_pull *ndr, int ndr_flags, struct repsFromTo1OtherInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__dns_name_size)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, r->__dns_name_size, sizeof(uint8_t), CH_DOS)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_repsFromTo1OtherInfo(struct ndr_print *ndr, const char *name, const struct repsFromTo1OtherInfo *r) -{ - ndr_print_struct(ndr, name, "repsFromTo1OtherInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "__dns_name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->dns_name) + 1:r->__dns_name_size); - ndr_print_string(ndr, "dns_name", r->dns_name); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_repsFromTo1OtherInfo(const struct repsFromTo1OtherInfo *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_repsFromTo1OtherInfo); -} - -_PUBLIC_ enum ndr_err_code ndr_push_repsFromTo1(struct ndr_push *ndr, int ndr_flags, const struct repsFromTo1 *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_repsFromTo1(r, ndr->flags) + 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->consecutive_sync_failures)); - NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->last_success)); - NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->last_attempt)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->result_last_attempt)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->other_info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_repsFromTo1OtherInfo(r->other_info, ndr->flags))); - NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->schedule, 84)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->transport_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->other_info) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->other_info)); - NDR_CHECK(ndr_push_repsFromTo1OtherInfo(ndr, NDR_SCALARS, r->other_info)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_repsFromTo1(struct ndr_pull *ndr, int ndr_flags, struct repsFromTo1 *r) -{ - uint32_t _ptr_other_info; - TALLOC_CTX *_mem_save_other_info_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->blobsize)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->consecutive_sync_failures)); - NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->last_success)); - NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->last_attempt)); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->result_last_attempt)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_info)); - if (_ptr_other_info) { - NDR_PULL_ALLOC(ndr, r->other_info); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->other_info, _ptr_other_info)); - } else { - r->other_info = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->other_info_length)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->schedule, 84)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->transport_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->other_info) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->other_info)); - _mem_save_other_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->other_info, 0); - NDR_CHECK(ndr_pull_repsFromTo1OtherInfo(ndr, NDR_SCALARS, r->other_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_info_0, 0); - ndr->offset = _relative_save_offset; - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_repsFromTo1(struct ndr_print *ndr, const char *name, const struct repsFromTo1 *r) -{ - ndr_print_struct(ndr, name, "repsFromTo1"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint32(ndr, "blobsize", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_repsFromTo1(r, ndr->flags) + 8:r->blobsize); - ndr_print_uint32(ndr, "consecutive_sync_failures", r->consecutive_sync_failures); - ndr_print_NTTIME_1sec(ndr, "last_success", r->last_success); - ndr_print_NTTIME_1sec(ndr, "last_attempt", r->last_attempt); - ndr_print_WERROR(ndr, "result_last_attempt", r->result_last_attempt); - ndr_print_ptr(ndr, "other_info", r->other_info); - ndr->depth++; - if (r->other_info) { - ndr_print_repsFromTo1OtherInfo(ndr, "other_info", r->other_info); - } - ndr->depth--; - ndr_print_uint32(ndr, "other_info_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_repsFromTo1OtherInfo(r->other_info, ndr->flags):r->other_info_length); - ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags); - ndr_print_array_uint8(ndr, "schedule", r->schedule, 84); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark); - ndr_print_GUID(ndr, "source_dsa_obj_guid", &r->source_dsa_obj_guid); - ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); - ndr_print_GUID(ndr, "transport_guid", &r->transport_guid); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ size_t ndr_size_repsFromTo1(const struct repsFromTo1 *r, int flags) -{ - flags |= LIBNDR_PRINT_ARRAY_HEX; - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_repsFromTo1); -} - -static enum ndr_err_code ndr_push_repsFromTo(struct ndr_push *ndr, int ndr_flags, const union repsFromTo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_repsFromTo1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_repsFromTo1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_repsFromTo(struct ndr_pull *ndr, int ndr_flags, union repsFromTo *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_repsFromTo1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_repsFromTo1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_repsFromTo(struct ndr_print *ndr, const char *name, const union repsFromTo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "repsFromTo"); - switch (level) { - case 1: - ndr_print_repsFromTo1(ndr, "ctr1", &r->ctr1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_repsFromToBlob(struct ndr_push *ndr, int ndr_flags, const struct repsFromToBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_push_repsFromTo(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_repsFromTo(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_repsFromToBlob(struct ndr_pull *ndr, int ndr_flags, struct repsFromToBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_pull_repsFromTo(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_repsFromTo(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_repsFromToBlob(struct ndr_print *ndr, const char *name, const struct repsFromToBlob *r) -{ - ndr_print_struct(ndr, name, "repsFromToBlob"); - ndr->depth++; - ndr_print_uint32(ndr, "version", r->version); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr_print_set_switch_value(ndr, &r->ctr, r->version); - ndr_print_repsFromTo(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_partialAttributeSetCtr1(struct ndr_push *ndr, int ndr_flags, const struct partialAttributeSetCtr1 *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_partialAttributeSetCtr1(struct ndr_pull *ndr, int ndr_flags, struct partialAttributeSetCtr1 *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_PULL_ALLOC_N(ndr, r->array, r->count); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_partialAttributeSetCtr1(struct ndr_print *ndr, const char *name, const struct partialAttributeSetCtr1 *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "partialAttributeSetCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsAttributeId(ndr, "array", r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_partialAttributeSetCtr(struct ndr_push *ndr, int ndr_flags, const union partialAttributeSetCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_partialAttributeSetCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_partialAttributeSetCtr(struct ndr_pull *ndr, int ndr_flags, union partialAttributeSetCtr *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_partialAttributeSetCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_partialAttributeSetCtr(struct ndr_print *ndr, const char *name, const union partialAttributeSetCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "partialAttributeSetCtr"); - switch (level) { - case 1: - ndr_print_partialAttributeSetCtr1(ndr, "ctr1", &r->ctr1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_partialAttributeSetBlob(struct ndr_push *ndr, int ndr_flags, const struct partialAttributeSetBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_push_partialAttributeSetCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_partialAttributeSetBlob(struct ndr_pull *ndr, int ndr_flags, struct partialAttributeSetBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_pull_partialAttributeSetCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_partialAttributeSetBlob(struct ndr_print *ndr, const char *name, const struct partialAttributeSetBlob *r) -{ - ndr_print_struct(ndr, name, "partialAttributeSetBlob"); - ndr->depth++; - ndr_print_uint32(ndr, "version", r->version); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr_print_set_switch_value(ndr, &r->ctr, r->version); - ndr_print_partialAttributeSetCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_prefixMapVersion(struct ndr_push *ndr, int ndr_flags, enum prefixMapVersion r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_prefixMapVersion(struct ndr_pull *ndr, int ndr_flags, enum prefixMapVersion *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_prefixMapVersion(struct ndr_print *ndr, const char *name, enum prefixMapVersion r) -{ - const char *val = NULL; - - switch (r) { - case PREFIX_MAP_VERSION_DSDB: val = "PREFIX_MAP_VERSION_DSDB"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_prefixMapCtr(struct ndr_push *ndr, int ndr_flags, const union prefixMapCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case PREFIX_MAP_VERSION_DSDB: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->dsdb)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case PREFIX_MAP_VERSION_DSDB: - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->dsdb)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_prefixMapCtr(struct ndr_pull *ndr, int ndr_flags, union prefixMapCtr *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case PREFIX_MAP_VERSION_DSDB: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->dsdb)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case PREFIX_MAP_VERSION_DSDB: - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->dsdb)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_prefixMapCtr(struct ndr_print *ndr, const char *name, const union prefixMapCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "prefixMapCtr"); - switch (level) { - case PREFIX_MAP_VERSION_DSDB: - ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "dsdb", &r->dsdb); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_prefixMapBlob(struct ndr_push *ndr, int ndr_flags, const struct prefixMapBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_prefixMapVersion(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_push_prefixMapCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_prefixMapCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_prefixMapBlob(struct ndr_pull *ndr, int ndr_flags, struct prefixMapBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_prefixMapVersion(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_pull_prefixMapCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_prefixMapCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_prefixMapBlob(struct ndr_print *ndr, const char *name, const struct prefixMapBlob *r) -{ - ndr_print_struct(ndr, name, "prefixMapBlob"); - ndr->depth++; - ndr_print_prefixMapVersion(ndr, "version", r->version); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr_print_set_switch_value(ndr, &r->ctr, r->version); - ndr_print_prefixMapCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_ldapControlDirSyncExtra(struct ndr_push *ndr, int ndr_flags, const union ldapControlDirSyncExtra *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: { - break; } - - default: { - NDR_CHECK(ndr_push_replUpToDateVectorBlob(ndr, NDR_SCALARS, &r->uptodateness_vector)); - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ldapControlDirSyncExtra(struct ndr_pull *ndr, int ndr_flags, union ldapControlDirSyncExtra *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case 0: { - break; } - - default: { - NDR_CHECK(ndr_pull_replUpToDateVectorBlob(ndr, NDR_SCALARS, &r->uptodateness_vector)); - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ldapControlDirSyncExtra(struct ndr_print *ndr, const char *name, const union ldapControlDirSyncExtra *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "ldapControlDirSyncExtra"); - switch (level) { - case 0: - break; - - default: - ndr_print_replUpToDateVectorBlob(ndr, "uptodateness_vector", &r->uptodateness_vector); - break; - - } -} - -static size_t ndr_size_ldapControlDirSyncExtra(const union ldapControlDirSyncExtra *r, uint32_t level, int flags) -{ - return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_ldapControlDirSyncExtra); -} - -static enum ndr_err_code ndr_push_ldapControlDirSyncBlob(struct ndr_push *ndr, int ndr_flags, const struct ldapControlDirSyncBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 3)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_ldapControlDirSyncExtra(&r->extra, r->extra.uptodateness_vector.version, 0))); - NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->extra, ndr_size_ldapControlDirSyncExtra(&r->extra, r->extra.uptodateness_vector.version, 0))); - NDR_CHECK(ndr_push_ldapControlDirSyncExtra(ndr, NDR_SCALARS, &r->extra)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_ldapControlDirSyncExtra(ndr, NDR_BUFFERS, &r->extra)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ldapControlDirSyncBlob(struct ndr_pull *ndr, int ndr_flags, struct ldapControlDirSyncBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u1)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->extra_length)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->extra, r->extra_length)); - NDR_CHECK(ndr_pull_ldapControlDirSyncExtra(ndr, NDR_SCALARS, &r->extra)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_ldapControlDirSyncExtra(ndr, NDR_BUFFERS, &r->extra)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ldapControlDirSyncBlob(struct ndr_print *ndr, const char *name, const struct ldapControlDirSyncBlob *r) -{ - ndr_print_struct(ndr, name, "ldapControlDirSyncBlob"); - ndr->depth++; - ndr_print_uint32(ndr, "u1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?3:r->u1); - ndr_print_NTTIME(ndr, "time", r->time); - ndr_print_uint32(ndr, "u2", r->u2); - ndr_print_uint32(ndr, "u3", r->u3); - ndr_print_uint32(ndr, "extra_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_ldapControlDirSyncExtra(&r->extra, r->extra.uptodateness_vector.version, 0):r->extra_length); - ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark); - ndr_print_GUID(ndr, "guid1", &r->guid1); - ndr_print_set_switch_value(ndr, &r->extra, r->extra_length); - ndr_print_ldapControlDirSyncExtra(ndr, "extra", &r->extra); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_ldapControlDirSyncCookie(struct ndr_push *ndr, int ndr_flags, const struct ldapControlDirSyncCookie *r) -{ - uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "MSDS", 4, sizeof(uint8_t), CH_DOS)); - { - struct ndr_push *_ndr_blob; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_blob, 0, -1)); - NDR_CHECK(ndr_push_ldapControlDirSyncBlob(_ndr_blob, NDR_SCALARS|NDR_BUFFERS, &r->blob)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_blob, 0, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r)); - } - ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_ldapControlDirSyncCookie(struct ndr_pull *ndr, int ndr_flags, struct ldapControlDirSyncCookie *r) -{ - uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->msds, 4, sizeof(uint8_t), CH_DOS)); - { - struct ndr_pull *_ndr_blob; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_blob, 0, -1)); - NDR_CHECK(ndr_pull_ldapControlDirSyncBlob(_ndr_blob, NDR_SCALARS|NDR_BUFFERS, &r->blob)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_blob, 0, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r)); - } - ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ldapControlDirSyncCookie(struct ndr_print *ndr, const char *name, const struct ldapControlDirSyncCookie *r) -{ - ndr_print_struct(ndr, name, "ldapControlDirSyncCookie"); - ndr->depth++; - ndr_print_string(ndr, "msds", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"MSDS":r->msds); - ndr_print_ldapControlDirSyncBlob(ndr, "blob", &r->blob); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_supplementalCredentialsPackage(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsPackage *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->name))); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->data))); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, 2 * strlen_m(r->name), sizeof(uint8_t), CH_UTF16)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data, strlen(r->data), sizeof(uint8_t), CH_DOS)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_supplementalCredentialsPackage(struct ndr_pull *ndr, int ndr_flags, struct supplementalCredentialsPackage *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_len)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_len)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, r->name_len, sizeof(uint8_t), CH_UTF16)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data, r->data_len, sizeof(uint8_t), CH_DOS)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_supplementalCredentialsPackage(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsPackage *r) -{ - ndr_print_struct(ndr, name, "supplementalCredentialsPackage"); - ndr->depth++; - ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->name):r->name_len); - ndr_print_uint16(ndr, "data_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->data):r->data_len); - ndr_print_uint16(ndr, "reserved", r->reserved); - ndr_print_string(ndr, "name", r->name); - ndr_print_string(ndr, "data", r->data); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_supplementalCredentialsSignature(struct ndr_push *ndr, int ndr_flags, enum supplementalCredentialsSignature r) -{ - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_supplementalCredentialsSignature(struct ndr_pull *ndr, int ndr_flags, enum supplementalCredentialsSignature *r) -{ - uint16_t v; - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_supplementalCredentialsSignature(struct ndr_print *ndr, const char *name, enum supplementalCredentialsSignature r) -{ - const char *val = NULL; - - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - switch (r) { - case SUPPLEMENTAL_CREDENTIALS_SIGNATURE: val = "SUPPLEMENTAL_CREDENTIALS_SIGNATURE"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); - ndr->flags = _flags_save_ENUM; - } -} - -static enum ndr_err_code ndr_push_supplementalCredentialsSubBlob(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsSubBlob *r) -{ - uint32_t cntr_packages_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, SUPPLEMENTAL_CREDENTIALS_PREFIX, 0x30, sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_supplementalCredentialsSignature(ndr, NDR_SCALARS, SUPPLEMENTAL_CREDENTIALS_SIGNATURE)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_packages)); - for (cntr_packages_0 = 0; cntr_packages_0 < r->num_packages; cntr_packages_0++) { - NDR_CHECK(ndr_push_supplementalCredentialsPackage(ndr, NDR_SCALARS, &r->packages[cntr_packages_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_supplementalCredentialsSubBlob(struct ndr_pull *ndr, int ndr_flags, struct supplementalCredentialsSubBlob *r) -{ - uint32_t cntr_packages_0; - TALLOC_CTX *_mem_save_packages_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->prefix, 0x30, sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_supplementalCredentialsSignature(ndr, NDR_SCALARS, &r->signature)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_packages)); - NDR_PULL_ALLOC_N(ndr, r->packages, r->num_packages); - _mem_save_packages_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->packages, 0); - for (cntr_packages_0 = 0; cntr_packages_0 < r->num_packages; cntr_packages_0++) { - NDR_CHECK(ndr_pull_supplementalCredentialsPackage(ndr, NDR_SCALARS, &r->packages[cntr_packages_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_packages_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_supplementalCredentialsSubBlob(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsSubBlob *r) -{ - uint32_t cntr_packages_0; - ndr_print_struct(ndr, name, "supplementalCredentialsSubBlob"); - ndr->depth++; - ndr_print_string(ndr, "prefix", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?SUPPLEMENTAL_CREDENTIALS_PREFIX:r->prefix); - ndr_print_supplementalCredentialsSignature(ndr, "signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?SUPPLEMENTAL_CREDENTIALS_SIGNATURE:r->signature); - ndr_print_uint16(ndr, "num_packages", r->num_packages); - ndr->print(ndr, "%s: ARRAY(%d)", "packages", (int)r->num_packages); - ndr->depth++; - for (cntr_packages_0=0;cntr_packages_0num_packages;cntr_packages_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_packages_0) != -1) { - ndr_print_supplementalCredentialsPackage(ndr, "packages", &r->packages[cntr_packages_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static size_t ndr_size_supplementalCredentialsSubBlob(const struct supplementalCredentialsSubBlob *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_supplementalCredentialsSubBlob); -} - -_PUBLIC_ enum ndr_err_code ndr_push_supplementalCredentialsBlob(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_supplementalCredentialsSubBlob(&r->sub, ndr->flags))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - { - struct ndr_push *_ndr_sub; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sub, 0, ndr_size_supplementalCredentialsSubBlob(&r->sub, ndr->flags))); - NDR_CHECK(ndr_push_supplementalCredentialsSubBlob(_ndr_sub, NDR_SCALARS, &r->sub)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sub, 0, ndr_size_supplementalCredentialsSubBlob(&r->sub, ndr->flags))); - } - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 0)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_supplementalCredentialsBlob(struct ndr_pull *ndr, int ndr_flags, struct supplementalCredentialsBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - { - struct ndr_pull *_ndr_sub; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sub, 0, r->__ndr_size)); - NDR_CHECK(ndr_pull_supplementalCredentialsSubBlob(_ndr_sub, NDR_SCALARS, &r->sub)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sub, 0, r->__ndr_size)); - } - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown3)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_supplementalCredentialsBlob(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsBlob *r) -{ - ndr_print_struct(ndr, name, "supplementalCredentialsBlob"); - ndr->depth++; - ndr_print_uint32(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown1); - ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_supplementalCredentialsSubBlob(&r->sub, ndr->flags):r->__ndr_size); - ndr_print_uint32(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown2); - ndr_print_supplementalCredentialsSubBlob(ndr, "sub", &r->sub); - ndr_print_uint8(ndr, "unknown3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown3); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_package_PackagesBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PackagesBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string_array = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->names)); - ndr->flags = _flags_save_string_array; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_package_PackagesBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PackagesBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string_array = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->names)); - ndr->flags = _flags_save_string_array; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PackagesBlob(struct ndr_print *ndr, const char *name, const struct package_PackagesBlob *r) -{ - ndr_print_struct(ndr, name, "package_PackagesBlob"); - ndr->depth++; - ndr_print_string_array(ndr, "names", r->names); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_package_PrimaryKerberosString(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosString *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->string)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); - if (r->string) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->string)); - { - struct ndr_push *_ndr_string; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_string, 0, 2 * strlen_m(r->string))); - NDR_CHECK(ndr_push_string(_ndr_string, NDR_SCALARS, r->string)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_string, 0, 2 * strlen_m(r->string))); - } - } - ndr->flags = _flags_save_string; - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_package_PrimaryKerberosString(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosString *r) -{ - uint32_t _ptr_string; - TALLOC_CTX *_mem_save_string_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); - if (_ptr_string) { - NDR_PULL_ALLOC(ndr, r->string); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->string, _ptr_string)); - } else { - r->string = NULL; - } - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING); - if (r->string) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->string)); - _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); - { - struct ndr_pull *_ndr_string; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_string, 0, r->size)); - NDR_CHECK(ndr_pull_string(_ndr_string, NDR_SCALARS, &r->string)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_string, 0, r->size)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); - ndr->offset = _relative_save_offset; - } - ndr->flags = _flags_save_string; - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryKerberosString(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosString *r) -{ - ndr_print_struct(ndr, name, "package_PrimaryKerberosString"); - ndr->depth++; - ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->length); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->size); - ndr_print_ptr(ndr, "string", r->string); - ndr->depth++; - if (r->string) { - ndr_print_string(ndr, "string", r->string); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_package_PrimaryKerberosKey3(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosKey3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keytype)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (r->value?r->value->length:0))); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - if (r->value) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value)); - { - struct ndr_push *_ndr_value; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_value, 0, (r->value?r->value->length:0))); - NDR_CHECK(ndr_push_DATA_BLOB(_ndr_value, NDR_SCALARS, *r->value)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_value, 0, (r->value?r->value->length:0))); - } - } - ndr->flags = _flags_save_DATA_BLOB; - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_package_PrimaryKerberosKey3(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosKey3 *r) -{ - uint32_t _ptr_value; - TALLOC_CTX *_mem_save_value_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved1)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keytype)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value_len)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value)); - if (_ptr_value) { - NDR_PULL_ALLOC(ndr, r->value); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value, _ptr_value)); - } else { - r->value = NULL; - } - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - if (r->value) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value)); - _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->value, 0); - { - struct ndr_pull *_ndr_value; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_value, 0, r->value_len)); - NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_value, NDR_SCALARS, r->value)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_value, 0, r->value_len)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0); - ndr->offset = _relative_save_offset; - } - ndr->flags = _flags_save_DATA_BLOB; - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryKerberosKey3(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosKey3 *r) -{ - ndr_print_struct(ndr, name, "package_PrimaryKerberosKey3"); - ndr->depth++; - ndr_print_uint16(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); - ndr_print_uint16(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2); - ndr_print_uint32(ndr, "reserved3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved3); - ndr_print_uint32(ndr, "keytype", r->keytype); - ndr_print_uint32(ndr, "value_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?(r->value?r->value->length:0):r->value_len); - ndr_print_ptr(ndr, "value", r->value); - ndr->depth++; - if (r->value) { - ndr_print_DATA_BLOB(ndr, "value", *r->value); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr3(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosCtr3 *r) -{ - uint32_t cntr_keys_0; - uint32_t cntr_old_keys_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_keys)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_old_keys)); - NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); - for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey3(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); - } - for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey3(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); - for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey3(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); - } - for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey3(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_package_PrimaryKerberosCtr3(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosCtr3 *r) -{ - uint32_t cntr_keys_0; - TALLOC_CTX *_mem_save_keys_0; - uint32_t cntr_old_keys_0; - TALLOC_CTX *_mem_save_old_keys_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_keys)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_old_keys)); - NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); - NDR_PULL_ALLOC_N(ndr, r->keys, r->num_keys); - _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); - for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey3(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); - NDR_PULL_ALLOC_N(ndr, r->old_keys, r->num_old_keys); - _mem_save_old_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->old_keys, 0); - for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey3(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys_0, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding5)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); - _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); - for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey3(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); - _mem_save_old_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->old_keys, 0); - for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey3(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryKerberosCtr3(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosCtr3 *r) -{ - uint32_t cntr_keys_0; - uint32_t cntr_old_keys_0; - ndr_print_struct(ndr, name, "package_PrimaryKerberosCtr3"); - ndr->depth++; - ndr_print_uint16(ndr, "num_keys", r->num_keys); - ndr_print_uint16(ndr, "num_old_keys", r->num_old_keys); - ndr_print_package_PrimaryKerberosString(ndr, "salt", &r->salt); - ndr->print(ndr, "%s: ARRAY(%d)", "keys", (int)r->num_keys); - ndr->depth++; - for (cntr_keys_0=0;cntr_keys_0num_keys;cntr_keys_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_keys_0) != -1) { - ndr_print_package_PrimaryKerberosKey3(ndr, "keys", &r->keys[cntr_keys_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "old_keys", (int)r->num_old_keys); - ndr->depth++; - for (cntr_old_keys_0=0;cntr_old_keys_0num_old_keys;cntr_old_keys_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_old_keys_0) != -1) { - ndr_print_package_PrimaryKerberosKey3(ndr, "old_keys", &r->old_keys[cntr_old_keys_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_uint32(ndr, "padding1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding1); - ndr_print_uint32(ndr, "padding2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding2); - ndr_print_uint32(ndr, "padding3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding3); - ndr_print_uint32(ndr, "padding4", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding4); - ndr_print_uint32(ndr, "padding5", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding5); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_package_PrimaryKerberosKey4(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosKey4 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->iteration_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keytype)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (r->value?r->value->length:0))); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - if (r->value) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value)); - { - struct ndr_push *_ndr_value; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_value, 0, (r->value?r->value->length:0))); - NDR_CHECK(ndr_push_DATA_BLOB(_ndr_value, NDR_SCALARS, *r->value)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_value, 0, (r->value?r->value->length:0))); - } - } - ndr->flags = _flags_save_DATA_BLOB; - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_package_PrimaryKerberosKey4(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosKey4 *r) -{ - uint32_t _ptr_value; - TALLOC_CTX *_mem_save_value_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved1)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->iteration_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keytype)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value_len)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value)); - if (_ptr_value) { - NDR_PULL_ALLOC(ndr, r->value); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value, _ptr_value)); - } else { - r->value = NULL; - } - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - if (r->value) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value)); - _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->value, 0); - { - struct ndr_pull *_ndr_value; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_value, 0, r->value_len)); - NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_value, NDR_SCALARS, r->value)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_value, 0, r->value_len)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0); - ndr->offset = _relative_save_offset; - } - ndr->flags = _flags_save_DATA_BLOB; - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryKerberosKey4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosKey4 *r) -{ - ndr_print_struct(ndr, name, "package_PrimaryKerberosKey4"); - ndr->depth++; - ndr_print_uint16(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); - ndr_print_uint16(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2); - ndr_print_uint32(ndr, "reserved3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved3); - ndr_print_uint32(ndr, "iteration_count", r->iteration_count); - ndr_print_uint32(ndr, "keytype", r->keytype); - ndr_print_uint32(ndr, "value_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?(r->value?r->value->length:0):r->value_len); - ndr_print_ptr(ndr, "value", r->value); - ndr->depth++; - if (r->value) { - ndr_print_DATA_BLOB(ndr, "value", *r->value); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr4(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosCtr4 *r) -{ - uint32_t cntr_keys_0; - uint32_t cntr_service_keys_0; - uint32_t cntr_old_keys_0; - uint32_t cntr_older_keys_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_keys)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_old_keys)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_older_keys)); - NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->default_iteration_count)); - for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); - } - for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; cntr_service_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->service_keys[cntr_service_keys_0])); - } - for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); - } - for (cntr_older_keys_0 = 0; cntr_older_keys_0 < r->num_older_keys; cntr_older_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->older_keys[cntr_older_keys_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); - for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); - } - for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; cntr_service_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->service_keys[cntr_service_keys_0])); - } - for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0])); - } - for (cntr_older_keys_0 = 0; cntr_older_keys_0 < r->num_older_keys; cntr_older_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->older_keys[cntr_older_keys_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_package_PrimaryKerberosCtr4(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosCtr4 *r) -{ - uint32_t cntr_keys_0; - TALLOC_CTX *_mem_save_keys_0; - uint32_t cntr_service_keys_0; - TALLOC_CTX *_mem_save_service_keys_0; - uint32_t cntr_old_keys_0; - TALLOC_CTX *_mem_save_old_keys_0; - uint32_t cntr_older_keys_0; - TALLOC_CTX *_mem_save_older_keys_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_keys)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_service_keys)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_old_keys)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_older_keys)); - NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->default_iteration_count)); - NDR_PULL_ALLOC_N(ndr, r->keys, r->num_keys); - _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); - for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); - NDR_PULL_ALLOC_N(ndr, r->service_keys, r->num_service_keys); - _mem_save_service_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->service_keys, 0); - for (cntr_service_keys_0 = 0; cntr_service_keys_0 < r->num_service_keys; cntr_service_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->service_keys[cntr_service_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_keys_0, 0); - NDR_PULL_ALLOC_N(ndr, r->old_keys, r->num_old_keys); - _mem_save_old_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->old_keys, 0); - for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys_0, 0); - NDR_PULL_ALLOC_N(ndr, r->older_keys, r->num_older_keys); - _mem_save_older_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->older_keys, 0); - for (cntr_older_keys_0 = 0; cntr_older_keys_0 < r->num_older_keys; cntr_older_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->older_keys[cntr_older_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_older_keys_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); - _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); - for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); - _mem_save_service_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->service_keys, 0); - for (cntr_service_keys_0 = 0; cntr_service_keys_0 < r->num_service_keys; cntr_service_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->service_keys[cntr_service_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_keys_0, 0); - _mem_save_old_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->old_keys, 0); - for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys_0, 0); - _mem_save_older_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->older_keys, 0); - for (cntr_older_keys_0 = 0; cntr_older_keys_0 < r->num_older_keys; cntr_older_keys_0++) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->older_keys[cntr_older_keys_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_older_keys_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryKerberosCtr4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosCtr4 *r) -{ - uint32_t cntr_keys_0; - uint32_t cntr_service_keys_0; - uint32_t cntr_old_keys_0; - uint32_t cntr_older_keys_0; - ndr_print_struct(ndr, name, "package_PrimaryKerberosCtr4"); - ndr->depth++; - ndr_print_uint16(ndr, "num_keys", r->num_keys); - ndr_print_uint16(ndr, "num_service_keys", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->num_service_keys); - ndr_print_uint16(ndr, "num_old_keys", r->num_old_keys); - ndr_print_uint16(ndr, "num_older_keys", r->num_older_keys); - ndr_print_package_PrimaryKerberosString(ndr, "salt", &r->salt); - ndr_print_uint32(ndr, "default_iteration_count", r->default_iteration_count); - ndr->print(ndr, "%s: ARRAY(%d)", "keys", (int)r->num_keys); - ndr->depth++; - for (cntr_keys_0=0;cntr_keys_0num_keys;cntr_keys_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_keys_0) != -1) { - ndr_print_package_PrimaryKerberosKey4(ndr, "keys", &r->keys[cntr_keys_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "service_keys", (int)r->num_service_keys); - ndr->depth++; - for (cntr_service_keys_0=0;cntr_service_keys_0num_service_keys;cntr_service_keys_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_service_keys_0) != -1) { - ndr_print_package_PrimaryKerberosKey4(ndr, "service_keys", &r->service_keys[cntr_service_keys_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "old_keys", (int)r->num_old_keys); - ndr->depth++; - for (cntr_old_keys_0=0;cntr_old_keys_0num_old_keys;cntr_old_keys_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_old_keys_0) != -1) { - ndr_print_package_PrimaryKerberosKey4(ndr, "old_keys", &r->old_keys[cntr_old_keys_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "older_keys", (int)r->num_older_keys); - ndr->depth++; - for (cntr_older_keys_0=0;cntr_older_keys_0num_older_keys;cntr_older_keys_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_older_keys_0) != -1) { - ndr_print_package_PrimaryKerberosKey4(ndr, "older_keys", &r->older_keys[cntr_older_keys_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr(struct ndr_push *ndr, int ndr_flags, const union package_PrimaryKerberosCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 3: { - NDR_CHECK(ndr_push_package_PrimaryKerberosCtr3(ndr, NDR_SCALARS, &r->ctr3)); - break; } - - case 4: { - NDR_CHECK(ndr_push_package_PrimaryKerberosCtr4(ndr, NDR_SCALARS, &r->ctr4)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 3: - NDR_CHECK(ndr_push_package_PrimaryKerberosCtr3(ndr, NDR_BUFFERS, &r->ctr3)); - break; - - case 4: - NDR_CHECK(ndr_push_package_PrimaryKerberosCtr4(ndr, NDR_BUFFERS, &r->ctr4)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_package_PrimaryKerberosCtr(struct ndr_pull *ndr, int ndr_flags, union package_PrimaryKerberosCtr *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case 3: { - NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr3(ndr, NDR_SCALARS, &r->ctr3)); - break; } - - case 4: { - NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr4(ndr, NDR_SCALARS, &r->ctr4)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 3: - NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr3(ndr, NDR_BUFFERS, &r->ctr3)); - break; - - case 4: - NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr4(ndr, NDR_BUFFERS, &r->ctr4)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryKerberosCtr(struct ndr_print *ndr, const char *name, const union package_PrimaryKerberosCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "package_PrimaryKerberosCtr"); - switch (level) { - case 3: - ndr_print_package_PrimaryKerberosCtr3(ndr, "ctr3", &r->ctr3); - break; - - case 4: - ndr_print_package_PrimaryKerberosCtr4(ndr, "ctr4", &r->ctr4); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_package_PrimaryKerberosBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_push_package_PrimaryKerberosCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_package_PrimaryKerberosCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_package_PrimaryKerberosBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); - NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryKerberosBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosBlob *r) -{ - ndr_print_struct(ndr, name, "package_PrimaryKerberosBlob"); - ndr->depth++; - ndr_print_uint16(ndr, "version", r->version); - ndr_print_uint16(ndr, "flags", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->flags); - ndr_print_set_switch_value(ndr, &r->ctr, r->version); - ndr_print_package_PrimaryKerberosCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_package_PrimaryCLEARTEXTBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryCLEARTEXTBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->cleartext)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_package_PrimaryCLEARTEXTBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryCLEARTEXTBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->cleartext)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryCLEARTEXTBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryCLEARTEXTBlob *r) -{ - ndr_print_struct(ndr, name, "package_PrimaryCLEARTEXTBlob"); - ndr->depth++; - ndr_print_DATA_BLOB(ndr, "cleartext", r->cleartext); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_package_PrimaryWDigestHash(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryWDigestHash *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_package_PrimaryWDigestHash(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryWDigestHash *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryWDigestHash(struct ndr_print *ndr, const char *name, const struct package_PrimaryWDigestHash *r) -{ - ndr_print_struct(ndr, name, "package_PrimaryWDigestHash"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "hash", r->hash, 16); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_package_PrimaryWDigestBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryWDigestBlob *r) -{ - uint32_t cntr_hashes_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0x31)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 0x01)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_hashes)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, 0)); - for (cntr_hashes_0 = 0; cntr_hashes_0 < r->num_hashes; cntr_hashes_0++) { - NDR_CHECK(ndr_push_package_PrimaryWDigestHash(ndr, NDR_SCALARS, &r->hashes[cntr_hashes_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_package_PrimaryWDigestBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryWDigestBlob *r) -{ - uint32_t cntr_hashes_0; - TALLOC_CTX *_mem_save_hashes_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_hashes)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->uuknown4)); - NDR_PULL_ALLOC_N(ndr, r->hashes, r->num_hashes); - _mem_save_hashes_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->hashes, 0); - for (cntr_hashes_0 = 0; cntr_hashes_0 < r->num_hashes; cntr_hashes_0++) { - NDR_CHECK(ndr_pull_package_PrimaryWDigestHash(ndr, NDR_SCALARS, &r->hashes[cntr_hashes_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hashes_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_package_PrimaryWDigestBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryWDigestBlob *r) -{ - uint32_t cntr_hashes_0; - ndr_print_struct(ndr, name, "package_PrimaryWDigestBlob"); - ndr->depth++; - ndr_print_uint16(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x31:r->unknown1); - ndr_print_uint8(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x01:r->unknown2); - ndr_print_uint8(ndr, "num_hashes", r->num_hashes); - ndr_print_uint32(ndr, "unknown3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown3); - ndr_print_udlong(ndr, "uuknown4", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->uuknown4); - ndr->print(ndr, "%s: ARRAY(%d)", "hashes", (int)r->num_hashes); - ndr->depth++; - for (cntr_hashes_0=0;cntr_hashes_0num_hashes;cntr_hashes_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_hashes_0) != -1) { - ndr_print_package_PrimaryWDigestHash(ndr, "hashes", &r->hashes[cntr_hashes_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_AuthInfoNone(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoNone *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_AuthInfoNone(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoNone *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_AuthInfoNone(struct ndr_print *ndr, const char *name, const struct AuthInfoNone *r) -{ - ndr_print_struct(ndr, name, "AuthInfoNone"); - ndr->depth++; - ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->size); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_AuthInfoNT4Owf(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoNT4Owf *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 16)); - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->password)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_AuthInfoNT4Owf(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoNT4Owf *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->password)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_AuthInfoNT4Owf(struct ndr_print *ndr, const char *name, const struct AuthInfoNT4Owf *r) -{ - ndr_print_struct(ndr, name, "AuthInfoNT4Owf"); - ndr->depth++; - ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?16:r->size); - ndr_print_samr_Password(ndr, "password", &r->password); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_AuthInfoClear(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoClear *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->password, r->size)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_AuthInfoClear(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoClear *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - NDR_PULL_ALLOC_N(ndr, r->password, r->size); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->password, r->size)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_AuthInfoClear(struct ndr_print *ndr, const char *name, const struct AuthInfoClear *r) -{ - ndr_print_struct(ndr, name, "AuthInfoClear"); - ndr->depth++; - ndr_print_uint32(ndr, "size", r->size); - ndr_print_array_uint8(ndr, "password", r->password, r->size); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_AuthInfoVersion(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoVersion *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_AuthInfoVersion(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoVersion *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_AuthInfoVersion(struct ndr_print *ndr, const char *name, const struct AuthInfoVersion *r) -{ - ndr_print_struct(ndr, name, "AuthInfoVersion"); - ndr->depth++; - ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?4:r->size); - ndr_print_uint32(ndr, "version", r->version); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_AuthInfo(struct ndr_push *ndr, int ndr_flags, const union AuthInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case TRUST_AUTH_TYPE_NONE: { - NDR_CHECK(ndr_push_AuthInfoNone(ndr, NDR_SCALARS, &r->none)); - break; } - - case TRUST_AUTH_TYPE_NT4OWF: { - NDR_CHECK(ndr_push_AuthInfoNT4Owf(ndr, NDR_SCALARS, &r->nt4owf)); - break; } - - case TRUST_AUTH_TYPE_CLEAR: { - NDR_CHECK(ndr_push_AuthInfoClear(ndr, NDR_SCALARS, &r->clear)); - break; } - - case TRUST_AUTH_TYPE_VERSION: { - NDR_CHECK(ndr_push_AuthInfoVersion(ndr, NDR_SCALARS, &r->version)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case TRUST_AUTH_TYPE_NONE: - break; - - case TRUST_AUTH_TYPE_NT4OWF: - break; - - case TRUST_AUTH_TYPE_CLEAR: - break; - - case TRUST_AUTH_TYPE_VERSION: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_AuthInfo(struct ndr_pull *ndr, int ndr_flags, union AuthInfo *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case TRUST_AUTH_TYPE_NONE: { - NDR_CHECK(ndr_pull_AuthInfoNone(ndr, NDR_SCALARS, &r->none)); - break; } - - case TRUST_AUTH_TYPE_NT4OWF: { - NDR_CHECK(ndr_pull_AuthInfoNT4Owf(ndr, NDR_SCALARS, &r->nt4owf)); - break; } - - case TRUST_AUTH_TYPE_CLEAR: { - NDR_CHECK(ndr_pull_AuthInfoClear(ndr, NDR_SCALARS, &r->clear)); - break; } - - case TRUST_AUTH_TYPE_VERSION: { - NDR_CHECK(ndr_pull_AuthInfoVersion(ndr, NDR_SCALARS, &r->version)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case TRUST_AUTH_TYPE_NONE: - break; - - case TRUST_AUTH_TYPE_NT4OWF: - break; - - case TRUST_AUTH_TYPE_CLEAR: - break; - - case TRUST_AUTH_TYPE_VERSION: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_AuthInfo(struct ndr_print *ndr, const char *name, const union AuthInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "AuthInfo"); - switch (level) { - case TRUST_AUTH_TYPE_NONE: - ndr_print_AuthInfoNone(ndr, "none", &r->none); - break; - - case TRUST_AUTH_TYPE_NT4OWF: - ndr_print_AuthInfoNT4Owf(ndr, "nt4owf", &r->nt4owf); - break; - - case TRUST_AUTH_TYPE_CLEAR: - ndr_print_AuthInfoClear(ndr, "clear", &r->clear); - break; - - case TRUST_AUTH_TYPE_VERSION: - ndr_print_AuthInfoVersion(ndr, "version", &r->version); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_AuthenticationInformation(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformation *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->LastUpdateTime)); - NDR_CHECK(ndr_push_lsa_TrustAuthType(ndr, NDR_SCALARS, r->AuthType)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->AuthInfo, r->AuthType)); - NDR_CHECK(ndr_push_AuthInfo(ndr, NDR_SCALARS, &r->AuthInfo)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_AuthenticationInformation(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformation *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->LastUpdateTime)); - NDR_CHECK(ndr_pull_lsa_TrustAuthType(ndr, NDR_SCALARS, &r->AuthType)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->AuthInfo, r->AuthType)); - NDR_CHECK(ndr_pull_AuthInfo(ndr, NDR_SCALARS, &r->AuthInfo)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_AuthenticationInformation(struct ndr_print *ndr, const char *name, const struct AuthenticationInformation *r) -{ - ndr_print_struct(ndr, name, "AuthenticationInformation"); - ndr->depth++; - ndr_print_NTTIME(ndr, "LastUpdateTime", r->LastUpdateTime); - ndr_print_lsa_TrustAuthType(ndr, "AuthType", r->AuthType); - ndr_print_set_switch_value(ndr, &r->AuthInfo, r->AuthType); - ndr_print_AuthInfo(ndr, "AuthInfo", &r->AuthInfo); - ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_trustAuthInOutBlob(const struct trustAuthInOutBlob *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_trustAuthInOutBlob); -} - -_PUBLIC_ enum ndr_err_code ndr_push_trustCurrentPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustCurrentPasswords *r) -{ - uint32_t cntr_current_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) { - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->current[cntr_current_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) { - if (r->current[cntr_current_0]) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->current[cntr_current_0])); - NDR_CHECK(ndr_push_AuthenticationInformation(ndr, NDR_SCALARS, r->current[cntr_current_0])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_trustCurrentPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustCurrentPasswords *r) -{ - uint32_t _ptr_current; - uint32_t cntr_current_0; - TALLOC_CTX *_mem_save_current_0; - TALLOC_CTX *_mem_save_current_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_PULL_ALLOC_N(ndr, r->current, r->count); - _mem_save_current_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->current, 0); - for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_current)); - if (_ptr_current) { - NDR_PULL_ALLOC(ndr, r->current[cntr_current_0]); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->current[cntr_current_0], _ptr_current)); - } else { - r->current[cntr_current_0] = NULL; - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_current_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->current, 0); - for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) { - if (r->current[cntr_current_0]) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->current[cntr_current_0])); - _mem_save_current_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->current[cntr_current_0], 0); - NDR_CHECK(ndr_pull_AuthenticationInformation(ndr, NDR_SCALARS, r->current[cntr_current_0])); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_1, 0); - ndr->offset = _relative_save_offset; - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_trustCurrentPasswords(struct ndr_print *ndr, const char *name, const struct trustCurrentPasswords *r) -{ - uint32_t cntr_current_0; - ndr_print_struct(ndr, name, "trustCurrentPasswords"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr->print(ndr, "%s: ARRAY(%d)", "current", (int)r->count); - ndr->depth++; - for (cntr_current_0=0;cntr_current_0count;cntr_current_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_current_0) != -1) { - ndr_print_ptr(ndr, "current", r->current[cntr_current_0]); - ndr->depth++; - if (r->current[cntr_current_0]) { - ndr_print_AuthenticationInformation(ndr, "current", r->current[cntr_current_0]); - } - ndr->depth--; - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_trustCurrentPasswords(const struct trustCurrentPasswords *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_trustCurrentPasswords); -} - -_PUBLIC_ enum ndr_err_code ndr_push_trustDomainPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustDomainPasswords *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->confounder, 512)); - { - struct ndr_push *_ndr_outgoing; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_outgoing, 0, ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags))); - NDR_CHECK(ndr_push_trustCurrentPasswords(_ndr_outgoing, NDR_SCALARS|NDR_BUFFERS, &r->outgoing)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_outgoing, 0, ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags))); - } - { - struct ndr_push *_ndr_incoming; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_incoming, 0, ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags))); - NDR_CHECK(ndr_push_trustCurrentPasswords(_ndr_incoming, NDR_SCALARS|NDR_BUFFERS, &r->incoming)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_incoming, 0, ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags))); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags))); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_trustDomainPasswords(struct ndr_print *ndr, const char *name, const struct trustDomainPasswords *r) -{ - ndr_print_struct(ndr, name, "trustDomainPasswords"); - ndr->depth++; - ndr_print_array_uint8(ndr, "confounder", r->confounder, 512); - ndr_print_trustCurrentPasswords(ndr, "outgoing", &r->outgoing); - ndr_print_trustCurrentPasswords(ndr, "incoming", &r->incoming); - ndr_print_uint32(ndr, "outgoing_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags):r->outgoing_size); - ndr_print_uint32(ndr, "incoming_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags):r->incoming_size); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_DsCompressedChunk(struct ndr_push *ndr, int ndr_flags, const struct DsCompressedChunk *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->marker)); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_DsCompressedChunk(struct ndr_pull *ndr, int ndr_flags, struct DsCompressedChunk *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->marker)); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DsCompressedChunk(struct ndr_print *ndr, const char *name, const struct DsCompressedChunk *r) -{ - ndr_print_struct(ndr, name, "DsCompressedChunk"); - ndr->depth++; - ndr_print_uint32(ndr, "marker", r->marker); - ndr_print_DATA_BLOB(ndr, "data", r->data); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_ExtendedErrorAString(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorAString *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->__size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->__size)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, r->__size, sizeof(uint8_t), CH_DOS)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorAString(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorAString *r) -{ - uint32_t _ptr_string; - TALLOC_CTX *_mem_save_string_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->__size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); - if (_ptr_string) { - NDR_PULL_ALLOC(ndr, r->string); - } else { - r->string = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_size(ndr, &r->string), sizeof(uint8_t), CH_DOS)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); - } - if (r->string) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->__size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorAString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorAString *r) -{ - ndr_print_struct(ndr, name, "ExtendedErrorAString"); - ndr->depth++; - ndr_print_uint16(ndr, "__size", r->__size); - ndr_print_ptr(ndr, "string", r->string); - ndr->depth++; - if (r->string) { - ndr_print_string(ndr, "string", r->string); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_ExtendedErrorUString(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorUString *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->__size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->__size)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, r->__size, sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorUString(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorUString *r) -{ - uint32_t _ptr_string; - TALLOC_CTX *_mem_save_string_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->__size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); - if (_ptr_string) { - NDR_PULL_ALLOC(ndr, r->string); - } else { - r->string = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_size(ndr, &r->string), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); - } - if (r->string) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->__size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorUString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorUString *r) -{ - ndr_print_struct(ndr, name, "ExtendedErrorUString"); - ndr->depth++; - ndr_print_uint16(ndr, "__size", r->__size); - ndr_print_ptr(ndr, "string", r->string); - ndr->depth++; - if (r->string) { - ndr_print_string(ndr, "string", r->string); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_ExtendedErrorBlob(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorBlob(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorBlob *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorBlob(struct ndr_print *ndr, const char *name, const struct ExtendedErrorBlob *r) -{ - ndr_print_struct(ndr, name, "ExtendedErrorBlob"); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->length); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_ExtendedErrorComputerNamePresent(struct ndr_push *ndr, int ndr_flags, enum ExtendedErrorComputerNamePresent r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorComputerNamePresent(struct ndr_pull *ndr, int ndr_flags, enum ExtendedErrorComputerNamePresent *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorComputerNamePresent(struct ndr_print *ndr, const char *name, enum ExtendedErrorComputerNamePresent r) -{ - const char *val = NULL; - - switch (r) { - case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: val = "EXTENDED_ERROR_COMPUTER_NAME_PRESENT"; break; - case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: val = "EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_ExtendedErrorComputerNameU(struct ndr_push *ndr, int ndr_flags, const union ExtendedErrorComputerNameU *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_ExtendedErrorComputerNamePresent(ndr, NDR_SCALARS, level)); - switch (level) { - case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: { - NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_SCALARS, &r->name)); - break; } - - case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: { - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: - NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->name)); - break; - - case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorComputerNameU(struct ndr_pull *ndr, int ndr_flags, union ExtendedErrorComputerNameU *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: { - NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_SCALARS, &r->name)); - break; } - - case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: { - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: - NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->name)); - break; - - case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorComputerNameU(struct ndr_print *ndr, const char *name, const union ExtendedErrorComputerNameU *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "ExtendedErrorComputerNameU"); - switch (level) { - case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: - ndr_print_ExtendedErrorUString(ndr, "name", &r->name); - break; - - case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_ExtendedErrorComputerName(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorComputerName *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_ExtendedErrorComputerNamePresent(ndr, NDR_SCALARS, r->present)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->n, r->present)); - NDR_CHECK(ndr_push_ExtendedErrorComputerNameU(ndr, NDR_SCALARS, &r->n)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_ExtendedErrorComputerNameU(ndr, NDR_BUFFERS, &r->n)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorComputerName(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorComputerName *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_ExtendedErrorComputerNamePresent(ndr, NDR_SCALARS, &r->present)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->n, r->present)); - NDR_CHECK(ndr_pull_ExtendedErrorComputerNameU(ndr, NDR_SCALARS, &r->n)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_ExtendedErrorComputerNameU(ndr, NDR_BUFFERS, &r->n)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorComputerName(struct ndr_print *ndr, const char *name, const struct ExtendedErrorComputerName *r) -{ - ndr_print_struct(ndr, name, "ExtendedErrorComputerName"); - ndr->depth++; - ndr_print_ExtendedErrorComputerNamePresent(ndr, "present", r->present); - ndr_print_set_switch_value(ndr, &r->n, r->present); - ndr_print_ExtendedErrorComputerNameU(ndr, "n", &r->n); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_ExtendedErrorParamType(struct ndr_push *ndr, int ndr_flags, enum ExtendedErrorParamType r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorParamType(struct ndr_pull *ndr, int ndr_flags, enum ExtendedErrorParamType *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorParamType(struct ndr_print *ndr, const char *name, enum ExtendedErrorParamType r) -{ - const char *val = NULL; - - switch (r) { - case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: val = "EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING"; break; - case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: val = "EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING"; break; - case EXTENDED_ERROR_PARAM_TYPE_UINT32: val = "EXTENDED_ERROR_PARAM_TYPE_UINT32"; break; - case EXTENDED_ERROR_PARAM_TYPE_UINT16: val = "EXTENDED_ERROR_PARAM_TYPE_UINT16"; break; - case EXTENDED_ERROR_PARAM_TYPE_UINT64: val = "EXTENDED_ERROR_PARAM_TYPE_UINT64"; break; - case EXTENDED_ERROR_PARAM_TYPE_NONE: val = "EXTENDED_ERROR_PARAM_TYPE_NONE"; break; - case EXTENDED_ERROR_PARAM_TYPE_BLOB: val = "EXTENDED_ERROR_PARAM_TYPE_BLOB"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_ExtendedErrorParamU(struct ndr_push *ndr, int ndr_flags, const union ExtendedErrorParamU *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_ExtendedErrorParamType(ndr, NDR_SCALARS, level)); - switch (level) { - case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: { - NDR_CHECK(ndr_push_ExtendedErrorAString(ndr, NDR_SCALARS, &r->a_string)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: { - NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_SCALARS, &r->u_string)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_UINT32: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->uint32)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_UINT16: { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->uint16)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_UINT64: { - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->uint64)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_NONE: { - break; } - - case EXTENDED_ERROR_PARAM_TYPE_BLOB: { - NDR_CHECK(ndr_push_ExtendedErrorBlob(ndr, NDR_SCALARS, &r->blob)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: - NDR_CHECK(ndr_push_ExtendedErrorAString(ndr, NDR_BUFFERS, &r->a_string)); - break; - - case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: - NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->u_string)); - break; - - case EXTENDED_ERROR_PARAM_TYPE_UINT32: - break; - - case EXTENDED_ERROR_PARAM_TYPE_UINT16: - break; - - case EXTENDED_ERROR_PARAM_TYPE_UINT64: - break; - - case EXTENDED_ERROR_PARAM_TYPE_NONE: - break; - - case EXTENDED_ERROR_PARAM_TYPE_BLOB: - NDR_CHECK(ndr_push_ExtendedErrorBlob(ndr, NDR_BUFFERS, &r->blob)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorParamU(struct ndr_pull *ndr, int ndr_flags, union ExtendedErrorParamU *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: { - NDR_CHECK(ndr_pull_ExtendedErrorAString(ndr, NDR_SCALARS, &r->a_string)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: { - NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_SCALARS, &r->u_string)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_UINT32: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->uint32)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_UINT16: { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->uint16)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_UINT64: { - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->uint64)); - break; } - - case EXTENDED_ERROR_PARAM_TYPE_NONE: { - break; } - - case EXTENDED_ERROR_PARAM_TYPE_BLOB: { - NDR_CHECK(ndr_pull_ExtendedErrorBlob(ndr, NDR_SCALARS, &r->blob)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: - NDR_CHECK(ndr_pull_ExtendedErrorAString(ndr, NDR_BUFFERS, &r->a_string)); - break; - - case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: - NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->u_string)); - break; - - case EXTENDED_ERROR_PARAM_TYPE_UINT32: - break; - - case EXTENDED_ERROR_PARAM_TYPE_UINT16: - break; - - case EXTENDED_ERROR_PARAM_TYPE_UINT64: - break; - - case EXTENDED_ERROR_PARAM_TYPE_NONE: - break; - - case EXTENDED_ERROR_PARAM_TYPE_BLOB: - NDR_CHECK(ndr_pull_ExtendedErrorBlob(ndr, NDR_BUFFERS, &r->blob)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorParamU(struct ndr_print *ndr, const char *name, const union ExtendedErrorParamU *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "ExtendedErrorParamU"); - switch (level) { - case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: - ndr_print_ExtendedErrorAString(ndr, "a_string", &r->a_string); - break; - - case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: - ndr_print_ExtendedErrorUString(ndr, "u_string", &r->u_string); - break; - - case EXTENDED_ERROR_PARAM_TYPE_UINT32: - ndr_print_uint32(ndr, "uint32", r->uint32); - break; - - case EXTENDED_ERROR_PARAM_TYPE_UINT16: - ndr_print_uint16(ndr, "uint16", r->uint16); - break; - - case EXTENDED_ERROR_PARAM_TYPE_UINT64: - ndr_print_hyper(ndr, "uint64", r->uint64); - break; - - case EXTENDED_ERROR_PARAM_TYPE_NONE: - break; - - case EXTENDED_ERROR_PARAM_TYPE_BLOB: - ndr_print_ExtendedErrorBlob(ndr, "blob", &r->blob); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_ExtendedErrorParam(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorParam *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_ExtendedErrorParamType(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->p, r->type)); - NDR_CHECK(ndr_push_ExtendedErrorParamU(ndr, NDR_SCALARS, &r->p)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_ExtendedErrorParamU(ndr, NDR_BUFFERS, &r->p)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorParam(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorParam *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_ExtendedErrorParamType(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->p, r->type)); - NDR_CHECK(ndr_pull_ExtendedErrorParamU(ndr, NDR_SCALARS, &r->p)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_ExtendedErrorParamU(ndr, NDR_BUFFERS, &r->p)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorParam(struct ndr_print *ndr, const char *name, const struct ExtendedErrorParam *r) -{ - ndr_print_struct(ndr, name, "ExtendedErrorParam"); - ndr->depth++; - ndr_print_ExtendedErrorParamType(ndr, "type", r->type); - ndr_print_set_switch_value(ndr, &r->p, r->type); - ndr_print_ExtendedErrorParamU(ndr, "p", &r->p); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_ExtendedErrorInfo(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorInfo *r) -{ - uint32_t cntr_params_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_params)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->next)); - NDR_CHECK(ndr_push_ExtendedErrorComputerName(ndr, NDR_SCALARS, &r->computer_name)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->pid)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->generating_component)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->detection_location)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_params)); - for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) { - NDR_CHECK(ndr_push_ExtendedErrorParam(ndr, NDR_SCALARS, &r->params[cntr_params_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->next) { - NDR_CHECK(ndr_push_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->next)); - } - NDR_CHECK(ndr_push_ExtendedErrorComputerName(ndr, NDR_BUFFERS, &r->computer_name)); - for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) { - NDR_CHECK(ndr_push_ExtendedErrorParam(ndr, NDR_BUFFERS, &r->params[cntr_params_0])); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_ExtendedErrorInfo(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorInfo *r) -{ - uint32_t _ptr_next; - TALLOC_CTX *_mem_save_next_0; - uint32_t cntr_params_0; - TALLOC_CTX *_mem_save_params_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->params)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next)); - if (_ptr_next) { - NDR_PULL_ALLOC(ndr, r->next); - } else { - r->next = NULL; - } - NDR_CHECK(ndr_pull_ExtendedErrorComputerName(ndr, NDR_SCALARS, &r->computer_name)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->pid)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->generating_component)); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->detection_location)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_params)); - NDR_PULL_ALLOC_N(ndr, r->params, ndr_get_array_size(ndr, &r->params)); - _mem_save_params_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->params, 0); - for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) { - NDR_CHECK(ndr_pull_ExtendedErrorParam(ndr, NDR_SCALARS, &r->params[cntr_params_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_params_0, 0); - if (r->params) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->params, r->num_params)); - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->next) { - _mem_save_next_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->next, 0); - NDR_CHECK(ndr_pull_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->next)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_0, 0); - } - NDR_CHECK(ndr_pull_ExtendedErrorComputerName(ndr, NDR_BUFFERS, &r->computer_name)); - _mem_save_params_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->params, 0); - for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) { - NDR_CHECK(ndr_pull_ExtendedErrorParam(ndr, NDR_BUFFERS, &r->params[cntr_params_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_params_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfo *r) -{ - uint32_t cntr_params_0; - ndr_print_struct(ndr, name, "ExtendedErrorInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "next", r->next); - ndr->depth++; - if (r->next) { - ndr_print_ExtendedErrorInfo(ndr, "next", r->next); - } - ndr->depth--; - ndr_print_ExtendedErrorComputerName(ndr, "computer_name", &r->computer_name); - ndr_print_hyper(ndr, "pid", r->pid); - ndr_print_NTTIME(ndr, "time", r->time); - ndr_print_uint32(ndr, "generating_component", r->generating_component); - ndr_print_WERROR(ndr, "status", r->status); - ndr_print_uint16(ndr, "detection_location", r->detection_location); - ndr_print_uint16(ndr, "flags", r->flags); - ndr_print_uint16(ndr, "num_params", r->num_params); - ndr->print(ndr, "%s: ARRAY(%d)", "params", (int)r->num_params); - ndr->depth++; - for (cntr_params_0=0;cntr_params_0num_params;cntr_params_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_params_0) != -1) { - ndr_print_ExtendedErrorParam(ndr, "params", &r->params[cntr_params_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_ExtendedErrorInfoPtr(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorInfoPtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - NDR_CHECK(ndr_push_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ExtendedErrorInfoPtr(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorInfoPtr *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_info_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->info); - } else { - r->info = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); - NDR_CHECK(ndr_pull_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ExtendedErrorInfoPtr(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfoPtr *r) -{ - ndr_print_struct(ndr, name, "ExtendedErrorInfoPtr"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->info); - ndr->depth++; - if (r->info) { - ndr_print_ExtendedErrorInfo(ndr, "info", r->info); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_replPropertyMetaData(struct ndr_push *ndr, int flags, const struct decode_replPropertyMetaData *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_replPropertyMetaDataBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_replPropertyMetaData(struct ndr_pull *ndr, int flags, struct decode_replPropertyMetaData *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_replPropertyMetaDataBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_replPropertyMetaData(struct ndr_print *ndr, const char *name, int flags, const struct decode_replPropertyMetaData *r) -{ - ndr_print_struct(ndr, name, "decode_replPropertyMetaData"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_replPropertyMetaData"); - ndr->depth++; - ndr_print_replPropertyMetaDataBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_replPropertyMetaData"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_replUpToDateVector(struct ndr_push *ndr, int flags, const struct decode_replUpToDateVector *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_replUpToDateVectorBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_replUpToDateVector(struct ndr_pull *ndr, int flags, struct decode_replUpToDateVector *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_replUpToDateVectorBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_replUpToDateVector(struct ndr_print *ndr, const char *name, int flags, const struct decode_replUpToDateVector *r) -{ - ndr_print_struct(ndr, name, "decode_replUpToDateVector"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_replUpToDateVector"); - ndr->depth++; - ndr_print_replUpToDateVectorBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_replUpToDateVector"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_repsFromTo(struct ndr_push *ndr, int flags, const struct decode_repsFromTo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_repsFromToBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_repsFromTo(struct ndr_pull *ndr, int flags, struct decode_repsFromTo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_repsFromToBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_repsFromTo(struct ndr_print *ndr, const char *name, int flags, const struct decode_repsFromTo *r) -{ - ndr_print_struct(ndr, name, "decode_repsFromTo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_repsFromTo"); - ndr->depth++; - ndr_print_repsFromToBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_repsFromTo"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_partialAttributeSet(struct ndr_push *ndr, int flags, const struct decode_partialAttributeSet *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_partialAttributeSetBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_partialAttributeSet(struct ndr_pull *ndr, int flags, struct decode_partialAttributeSet *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_partialAttributeSetBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_partialAttributeSet(struct ndr_print *ndr, const char *name, int flags, const struct decode_partialAttributeSet *r) -{ - ndr_print_struct(ndr, name, "decode_partialAttributeSet"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_partialAttributeSet"); - ndr->depth++; - ndr_print_partialAttributeSetBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_partialAttributeSet"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_prefixMap(struct ndr_push *ndr, int flags, const struct decode_prefixMap *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_prefixMapBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_prefixMap(struct ndr_pull *ndr, int flags, struct decode_prefixMap *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_prefixMapBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_prefixMap(struct ndr_print *ndr, const char *name, int flags, const struct decode_prefixMap *r) -{ - ndr_print_struct(ndr, name, "decode_prefixMap"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_prefixMap"); - ndr->depth++; - ndr_print_prefixMapBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_prefixMap"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_ldapControlDirSync(struct ndr_push *ndr, int flags, const struct decode_ldapControlDirSync *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_ldapControlDirSyncCookie(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.cookie)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_ldapControlDirSync(struct ndr_pull *ndr, int flags, struct decode_ldapControlDirSync *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_ldapControlDirSyncCookie(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.cookie)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_ldapControlDirSync(struct ndr_print *ndr, const char *name, int flags, const struct decode_ldapControlDirSync *r) -{ - ndr_print_struct(ndr, name, "decode_ldapControlDirSync"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_ldapControlDirSync"); - ndr->depth++; - ndr_print_ldapControlDirSyncCookie(ndr, "cookie", &r->in.cookie); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_ldapControlDirSync"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_supplementalCredentials(struct ndr_push *ndr, int flags, const struct decode_supplementalCredentials *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_supplementalCredentialsBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_supplementalCredentials(struct ndr_pull *ndr, int flags, struct decode_supplementalCredentials *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_supplementalCredentialsBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_supplementalCredentials(struct ndr_print *ndr, const char *name, int flags, const struct decode_supplementalCredentials *r) -{ - ndr_print_struct(ndr, name, "decode_supplementalCredentials"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_supplementalCredentials"); - ndr->depth++; - ndr_print_supplementalCredentialsBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_supplementalCredentials"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_Packages(struct ndr_push *ndr, int flags, const struct decode_Packages *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_package_PackagesBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_Packages(struct ndr_pull *ndr, int flags, struct decode_Packages *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_package_PackagesBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_Packages(struct ndr_print *ndr, const char *name, int flags, const struct decode_Packages *r) -{ - ndr_print_struct(ndr, name, "decode_Packages"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_Packages"); - ndr->depth++; - ndr_print_package_PackagesBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_Packages"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_PrimaryKerberos(struct ndr_push *ndr, int flags, const struct decode_PrimaryKerberos *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_package_PrimaryKerberosBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_PrimaryKerberos(struct ndr_pull *ndr, int flags, struct decode_PrimaryKerberos *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_package_PrimaryKerberosBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_PrimaryKerberos(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryKerberos *r) -{ - ndr_print_struct(ndr, name, "decode_PrimaryKerberos"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_PrimaryKerberos"); - ndr->depth++; - ndr_print_package_PrimaryKerberosBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_PrimaryKerberos"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_PrimaryCLEARTEXT(struct ndr_push *ndr, int flags, const struct decode_PrimaryCLEARTEXT *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_package_PrimaryCLEARTEXTBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_PrimaryCLEARTEXT(struct ndr_pull *ndr, int flags, struct decode_PrimaryCLEARTEXT *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_package_PrimaryCLEARTEXTBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_PrimaryCLEARTEXT(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryCLEARTEXT *r) -{ - ndr_print_struct(ndr, name, "decode_PrimaryCLEARTEXT"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_PrimaryCLEARTEXT"); - ndr->depth++; - ndr_print_package_PrimaryCLEARTEXTBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_PrimaryCLEARTEXT"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_PrimaryWDigest(struct ndr_push *ndr, int flags, const struct decode_PrimaryWDigest *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_package_PrimaryWDigestBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_PrimaryWDigest(struct ndr_pull *ndr, int flags, struct decode_PrimaryWDigest *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_package_PrimaryWDigestBlob(ndr, NDR_SCALARS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_PrimaryWDigest(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryWDigest *r) -{ - ndr_print_struct(ndr, name, "decode_PrimaryWDigest"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_PrimaryWDigest"); - ndr->depth++; - ndr_print_package_PrimaryWDigestBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_PrimaryWDigest"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_trustAuthInOut(struct ndr_push *ndr, int flags, const struct decode_trustAuthInOut *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_trustAuthInOutBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_trustAuthInOut(struct ndr_pull *ndr, int flags, struct decode_trustAuthInOut *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_trustAuthInOutBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_trustAuthInOut(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustAuthInOut *r) -{ - ndr_print_struct(ndr, name, "decode_trustAuthInOut"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_trustAuthInOut"); - ndr->depth++; - ndr_print_trustAuthInOutBlob(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_trustAuthInOut"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_trustDomainPasswords(struct ndr_push *ndr, int flags, const struct decode_trustDomainPasswords *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_trustDomainPasswords(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_trustDomainPasswords(struct ndr_pull *ndr, int flags, struct decode_trustDomainPasswords *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_trustDomainPasswords(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_trustDomainPasswords(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustDomainPasswords *r) -{ - ndr_print_struct(ndr, name, "decode_trustDomainPasswords"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_trustDomainPasswords"); - ndr->depth++; - ndr_print_trustDomainPasswords(ndr, "blob", &r->in.blob); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_trustDomainPasswords"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_ExtendedErrorInfo(struct ndr_push *ndr, int flags, const struct decode_ExtendedErrorInfo *r) -{ - if (flags & NDR_IN) { - { - struct ndr_push *_ndr_ptr; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ptr, 0xFFFFFC01, -1)); - NDR_CHECK(ndr_push_ExtendedErrorInfoPtr(_ndr_ptr, NDR_SCALARS|NDR_BUFFERS, &r->in.ptr)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ptr, 0xFFFFFC01, -1)); - } - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_ExtendedErrorInfo(struct ndr_pull *ndr, int flags, struct decode_ExtendedErrorInfo *r) -{ - if (flags & NDR_IN) { - { - struct ndr_pull *_ndr_ptr; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ptr, 0xFFFFFC01, -1)); - NDR_CHECK(ndr_pull_ExtendedErrorInfoPtr(_ndr_ptr, NDR_SCALARS|NDR_BUFFERS, &r->in.ptr)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ptr, 0xFFFFFC01, -1)); - } - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, int flags, const struct decode_ExtendedErrorInfo *r) -{ - ndr_print_struct(ndr, name, "decode_ExtendedErrorInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_ExtendedErrorInfo"); - ndr->depth++; - ndr_print_ExtendedErrorInfoPtr(ndr, "ptr", &r->in.ptr); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_ExtendedErrorInfo"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call drsblobs_calls[] = { - { - "decode_replPropertyMetaData", - sizeof(struct decode_replPropertyMetaData), - (ndr_push_flags_fn_t) ndr_push_decode_replPropertyMetaData, - (ndr_pull_flags_fn_t) ndr_pull_decode_replPropertyMetaData, - (ndr_print_function_t) ndr_print_decode_replPropertyMetaData, - false, - }, - { - "decode_replUpToDateVector", - sizeof(struct decode_replUpToDateVector), - (ndr_push_flags_fn_t) ndr_push_decode_replUpToDateVector, - (ndr_pull_flags_fn_t) ndr_pull_decode_replUpToDateVector, - (ndr_print_function_t) ndr_print_decode_replUpToDateVector, - false, - }, - { - "decode_repsFromTo", - sizeof(struct decode_repsFromTo), - (ndr_push_flags_fn_t) ndr_push_decode_repsFromTo, - (ndr_pull_flags_fn_t) ndr_pull_decode_repsFromTo, - (ndr_print_function_t) ndr_print_decode_repsFromTo, - false, - }, - { - "decode_partialAttributeSet", - sizeof(struct decode_partialAttributeSet), - (ndr_push_flags_fn_t) ndr_push_decode_partialAttributeSet, - (ndr_pull_flags_fn_t) ndr_pull_decode_partialAttributeSet, - (ndr_print_function_t) ndr_print_decode_partialAttributeSet, - false, - }, - { - "decode_prefixMap", - sizeof(struct decode_prefixMap), - (ndr_push_flags_fn_t) ndr_push_decode_prefixMap, - (ndr_pull_flags_fn_t) ndr_pull_decode_prefixMap, - (ndr_print_function_t) ndr_print_decode_prefixMap, - false, - }, - { - "decode_ldapControlDirSync", - sizeof(struct decode_ldapControlDirSync), - (ndr_push_flags_fn_t) ndr_push_decode_ldapControlDirSync, - (ndr_pull_flags_fn_t) ndr_pull_decode_ldapControlDirSync, - (ndr_print_function_t) ndr_print_decode_ldapControlDirSync, - false, - }, - { - "decode_supplementalCredentials", - sizeof(struct decode_supplementalCredentials), - (ndr_push_flags_fn_t) ndr_push_decode_supplementalCredentials, - (ndr_pull_flags_fn_t) ndr_pull_decode_supplementalCredentials, - (ndr_print_function_t) ndr_print_decode_supplementalCredentials, - false, - }, - { - "decode_Packages", - sizeof(struct decode_Packages), - (ndr_push_flags_fn_t) ndr_push_decode_Packages, - (ndr_pull_flags_fn_t) ndr_pull_decode_Packages, - (ndr_print_function_t) ndr_print_decode_Packages, - false, - }, - { - "decode_PrimaryKerberos", - sizeof(struct decode_PrimaryKerberos), - (ndr_push_flags_fn_t) ndr_push_decode_PrimaryKerberos, - (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryKerberos, - (ndr_print_function_t) ndr_print_decode_PrimaryKerberos, - false, - }, - { - "decode_PrimaryCLEARTEXT", - sizeof(struct decode_PrimaryCLEARTEXT), - (ndr_push_flags_fn_t) ndr_push_decode_PrimaryCLEARTEXT, - (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryCLEARTEXT, - (ndr_print_function_t) ndr_print_decode_PrimaryCLEARTEXT, - false, - }, - { - "decode_PrimaryWDigest", - sizeof(struct decode_PrimaryWDigest), - (ndr_push_flags_fn_t) ndr_push_decode_PrimaryWDigest, - (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryWDigest, - (ndr_print_function_t) ndr_print_decode_PrimaryWDigest, - false, - }, - { - "decode_trustAuthInOut", - sizeof(struct decode_trustAuthInOut), - (ndr_push_flags_fn_t) ndr_push_decode_trustAuthInOut, - (ndr_pull_flags_fn_t) ndr_pull_decode_trustAuthInOut, - (ndr_print_function_t) ndr_print_decode_trustAuthInOut, - false, - }, - { - "decode_trustDomainPasswords", - sizeof(struct decode_trustDomainPasswords), - (ndr_push_flags_fn_t) ndr_push_decode_trustDomainPasswords, - (ndr_pull_flags_fn_t) ndr_pull_decode_trustDomainPasswords, - (ndr_print_function_t) ndr_print_decode_trustDomainPasswords, - false, - }, - { - "decode_ExtendedErrorInfo", - sizeof(struct decode_ExtendedErrorInfo), - (ndr_push_flags_fn_t) ndr_push_decode_ExtendedErrorInfo, - (ndr_pull_flags_fn_t) ndr_pull_decode_ExtendedErrorInfo, - (ndr_print_function_t) ndr_print_decode_ExtendedErrorInfo, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const drsblobs_endpoint_strings[] = { - "ncacn_np:[\\pipe\\drsblobs]", -}; - -static const struct ndr_interface_string_array drsblobs_endpoints = { - .count = 1, - .names = drsblobs_endpoint_strings -}; - -static const char * const drsblobs_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array drsblobs_authservices = { - .count = 1, - .names = drsblobs_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_drsblobs = { - .name = "drsblobs", - .syntax_id = { - {0x12345778,0x1234,0xabcd,{0x00,0x01},{0x00,0x00,0x00,0x01}}, - NDR_DRSBLOBS_VERSION - }, - .helpstring = NDR_DRSBLOBS_HELPSTRING, - .num_calls = 14, - .calls = drsblobs_calls, - .endpoints = &drsblobs_endpoints, - .authservices = &drsblobs_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_drsblobs.h b/source3/librpc/gen_ndr/ndr_drsblobs.h deleted file mode 100644 index 8a5298874a..0000000000 --- a/source3/librpc/gen_ndr/ndr_drsblobs.h +++ /dev/null @@ -1,159 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/drsblobs.h" - -#ifndef _HEADER_NDR_drsblobs -#define _HEADER_NDR_drsblobs - -#define NDR_DRSBLOBS_UUID "12345778-1234-abcd-0001-00000001" -#define NDR_DRSBLOBS_VERSION 0.0 -#define NDR_DRSBLOBS_NAME "drsblobs" -#define NDR_DRSBLOBS_HELPSTRING "Active Directory Replication LDAP Blobs" -extern const struct ndr_interface_table ndr_table_drsblobs; -#define NDR_DECODE_REPLPROPERTYMETADATA (0x00) - -#define NDR_DECODE_REPLUPTODATEVECTOR (0x01) - -#define NDR_DECODE_REPSFROMTO (0x02) - -#define NDR_DECODE_PARTIALATTRIBUTESET (0x03) - -#define NDR_DECODE_PREFIXMAP (0x04) - -#define NDR_DECODE_LDAPCONTROLDIRSYNC (0x05) - -#define NDR_DECODE_SUPPLEMENTALCREDENTIALS (0x06) - -#define NDR_DECODE_PACKAGES (0x07) - -#define NDR_DECODE_PRIMARYKERBEROS (0x08) - -#define NDR_DECODE_PRIMARYCLEARTEXT (0x09) - -#define NDR_DECODE_PRIMARYWDIGEST (0x0a) - -#define NDR_DECODE_TRUSTAUTHINOUT (0x0b) - -#define NDR_DECODE_TRUSTDOMAINPASSWORDS (0x0c) - -#define NDR_DECODE_EXTENDEDERRORINFO (0x0d) - -#define NDR_DRSBLOBS_CALL_COUNT (14) -void ndr_print_replPropertyMetaData1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaData1 *r); -void ndr_print_replPropertyMetaDataCtr1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataCtr1 *r); -void ndr_print_replPropertyMetaDataCtr(struct ndr_print *ndr, const char *name, const union replPropertyMetaDataCtr *r); -enum ndr_err_code ndr_push_replPropertyMetaDataBlob(struct ndr_push *ndr, int ndr_flags, const struct replPropertyMetaDataBlob *r); -enum ndr_err_code ndr_pull_replPropertyMetaDataBlob(struct ndr_pull *ndr, int ndr_flags, struct replPropertyMetaDataBlob *r); -void ndr_print_replPropertyMetaDataBlob(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataBlob *r); -void ndr_print_replUpToDateVectorCtr1(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorCtr1 *r); -void ndr_print_replUpToDateVectorCtr2(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorCtr2 *r); -void ndr_print_replUpToDateVectorCtr(struct ndr_print *ndr, const char *name, const union replUpToDateVectorCtr *r); -enum ndr_err_code ndr_push_replUpToDateVectorBlob(struct ndr_push *ndr, int ndr_flags, const struct replUpToDateVectorBlob *r); -enum ndr_err_code ndr_pull_replUpToDateVectorBlob(struct ndr_pull *ndr, int ndr_flags, struct replUpToDateVectorBlob *r); -void ndr_print_replUpToDateVectorBlob(struct ndr_print *ndr, const char *name, const struct replUpToDateVectorBlob *r); -enum ndr_err_code ndr_push_repsFromTo1OtherInfo(struct ndr_push *ndr, int ndr_flags, const struct repsFromTo1OtherInfo *r); -enum ndr_err_code ndr_pull_repsFromTo1OtherInfo(struct ndr_pull *ndr, int ndr_flags, struct repsFromTo1OtherInfo *r); -void ndr_print_repsFromTo1OtherInfo(struct ndr_print *ndr, const char *name, const struct repsFromTo1OtherInfo *r); -size_t ndr_size_repsFromTo1OtherInfo(const struct repsFromTo1OtherInfo *r, int flags); -enum ndr_err_code ndr_push_repsFromTo1(struct ndr_push *ndr, int ndr_flags, const struct repsFromTo1 *r); -enum ndr_err_code ndr_pull_repsFromTo1(struct ndr_pull *ndr, int ndr_flags, struct repsFromTo1 *r); -void ndr_print_repsFromTo1(struct ndr_print *ndr, const char *name, const struct repsFromTo1 *r); -size_t ndr_size_repsFromTo1(const struct repsFromTo1 *r, int flags); -void ndr_print_repsFromTo(struct ndr_print *ndr, const char *name, const union repsFromTo *r); -enum ndr_err_code ndr_push_repsFromToBlob(struct ndr_push *ndr, int ndr_flags, const struct repsFromToBlob *r); -enum ndr_err_code ndr_pull_repsFromToBlob(struct ndr_pull *ndr, int ndr_flags, struct repsFromToBlob *r); -void ndr_print_repsFromToBlob(struct ndr_print *ndr, const char *name, const struct repsFromToBlob *r); -void ndr_print_partialAttributeSetCtr1(struct ndr_print *ndr, const char *name, const struct partialAttributeSetCtr1 *r); -void ndr_print_partialAttributeSetCtr(struct ndr_print *ndr, const char *name, const union partialAttributeSetCtr *r); -enum ndr_err_code ndr_push_partialAttributeSetBlob(struct ndr_push *ndr, int ndr_flags, const struct partialAttributeSetBlob *r); -enum ndr_err_code ndr_pull_partialAttributeSetBlob(struct ndr_pull *ndr, int ndr_flags, struct partialAttributeSetBlob *r); -void ndr_print_partialAttributeSetBlob(struct ndr_print *ndr, const char *name, const struct partialAttributeSetBlob *r); -void ndr_print_prefixMapVersion(struct ndr_print *ndr, const char *name, enum prefixMapVersion r); -void ndr_print_prefixMapCtr(struct ndr_print *ndr, const char *name, const union prefixMapCtr *r); -enum ndr_err_code ndr_push_prefixMapBlob(struct ndr_push *ndr, int ndr_flags, const struct prefixMapBlob *r); -enum ndr_err_code ndr_pull_prefixMapBlob(struct ndr_pull *ndr, int ndr_flags, struct prefixMapBlob *r); -void ndr_print_prefixMapBlob(struct ndr_print *ndr, const char *name, const struct prefixMapBlob *r); -void ndr_print_ldapControlDirSyncExtra(struct ndr_print *ndr, const char *name, const union ldapControlDirSyncExtra *r); -void ndr_print_ldapControlDirSyncBlob(struct ndr_print *ndr, const char *name, const struct ldapControlDirSyncBlob *r); -enum ndr_err_code ndr_push_ldapControlDirSyncCookie(struct ndr_push *ndr, int ndr_flags, const struct ldapControlDirSyncCookie *r); -enum ndr_err_code ndr_pull_ldapControlDirSyncCookie(struct ndr_pull *ndr, int ndr_flags, struct ldapControlDirSyncCookie *r); -void ndr_print_ldapControlDirSyncCookie(struct ndr_print *ndr, const char *name, const struct ldapControlDirSyncCookie *r); -void ndr_print_supplementalCredentialsPackage(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsPackage *r); -void ndr_print_supplementalCredentialsSignature(struct ndr_print *ndr, const char *name, enum supplementalCredentialsSignature r); -void ndr_print_supplementalCredentialsSubBlob(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsSubBlob *r); -enum ndr_err_code ndr_push_supplementalCredentialsBlob(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsBlob *r); -enum ndr_err_code ndr_pull_supplementalCredentialsBlob(struct ndr_pull *ndr, int ndr_flags, struct supplementalCredentialsBlob *r); -void ndr_print_supplementalCredentialsBlob(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsBlob *r); -enum ndr_err_code ndr_push_package_PackagesBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PackagesBlob *r); -enum ndr_err_code ndr_pull_package_PackagesBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PackagesBlob *r); -void ndr_print_package_PackagesBlob(struct ndr_print *ndr, const char *name, const struct package_PackagesBlob *r); -void ndr_print_package_PrimaryKerberosString(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosString *r); -void ndr_print_package_PrimaryKerberosKey3(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosKey3 *r); -void ndr_print_package_PrimaryKerberosCtr3(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosCtr3 *r); -void ndr_print_package_PrimaryKerberosKey4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosKey4 *r); -void ndr_print_package_PrimaryKerberosCtr4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosCtr4 *r); -void ndr_print_package_PrimaryKerberosCtr(struct ndr_print *ndr, const char *name, const union package_PrimaryKerberosCtr *r); -enum ndr_err_code ndr_push_package_PrimaryKerberosBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosBlob *r); -enum ndr_err_code ndr_pull_package_PrimaryKerberosBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosBlob *r); -void ndr_print_package_PrimaryKerberosBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosBlob *r); -enum ndr_err_code ndr_push_package_PrimaryCLEARTEXTBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryCLEARTEXTBlob *r); -enum ndr_err_code ndr_pull_package_PrimaryCLEARTEXTBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryCLEARTEXTBlob *r); -void ndr_print_package_PrimaryCLEARTEXTBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryCLEARTEXTBlob *r); -void ndr_print_package_PrimaryWDigestHash(struct ndr_print *ndr, const char *name, const struct package_PrimaryWDigestHash *r); -enum ndr_err_code ndr_push_package_PrimaryWDigestBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryWDigestBlob *r); -enum ndr_err_code ndr_pull_package_PrimaryWDigestBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryWDigestBlob *r); -void ndr_print_package_PrimaryWDigestBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryWDigestBlob *r); -void ndr_print_AuthInfoNone(struct ndr_print *ndr, const char *name, const struct AuthInfoNone *r); -void ndr_print_AuthInfoNT4Owf(struct ndr_print *ndr, const char *name, const struct AuthInfoNT4Owf *r); -void ndr_print_AuthInfoClear(struct ndr_print *ndr, const char *name, const struct AuthInfoClear *r); -void ndr_print_AuthInfoVersion(struct ndr_print *ndr, const char *name, const struct AuthInfoVersion *r); -void ndr_print_AuthInfo(struct ndr_print *ndr, const char *name, const union AuthInfo *r); -enum ndr_err_code ndr_push_AuthenticationInformation(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformation *r); -enum ndr_err_code ndr_pull_AuthenticationInformation(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformation *r); -void ndr_print_AuthenticationInformation(struct ndr_print *ndr, const char *name, const struct AuthenticationInformation *r); -enum ndr_err_code ndr_push_AuthenticationInformationArray(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformationArray *r); -enum ndr_err_code ndr_pull_AuthenticationInformationArray(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformationArray *r); -void ndr_print_AuthenticationInformationArray(struct ndr_print *ndr, const char *name, const struct AuthenticationInformationArray *r); -enum ndr_err_code ndr_push_trustAuthInOutBlob(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutBlob *r); -enum ndr_err_code ndr_pull_trustAuthInOutBlob(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutBlob *r); -void ndr_print_trustAuthInOutBlob(struct ndr_print *ndr, const char *name, const struct trustAuthInOutBlob *r); -size_t ndr_size_trustAuthInOutBlob(const struct trustAuthInOutBlob *r, int flags); -enum ndr_err_code ndr_push_trustCurrentPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustCurrentPasswords *r); -enum ndr_err_code ndr_pull_trustCurrentPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustCurrentPasswords *r); -void ndr_print_trustCurrentPasswords(struct ndr_print *ndr, const char *name, const struct trustCurrentPasswords *r); -size_t ndr_size_trustCurrentPasswords(const struct trustCurrentPasswords *r, int flags); -enum ndr_err_code ndr_push_trustDomainPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustDomainPasswords *r); -enum ndr_err_code ndr_pull_trustDomainPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustDomainPasswords *r); -void ndr_print_trustDomainPasswords(struct ndr_print *ndr, const char *name, const struct trustDomainPasswords *r); -enum ndr_err_code ndr_push_DsCompressedChunk(struct ndr_push *ndr, int ndr_flags, const struct DsCompressedChunk *r); -enum ndr_err_code ndr_pull_DsCompressedChunk(struct ndr_pull *ndr, int ndr_flags, struct DsCompressedChunk *r); -void ndr_print_DsCompressedChunk(struct ndr_print *ndr, const char *name, const struct DsCompressedChunk *r); -void ndr_print_ExtendedErrorAString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorAString *r); -void ndr_print_ExtendedErrorUString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorUString *r); -void ndr_print_ExtendedErrorBlob(struct ndr_print *ndr, const char *name, const struct ExtendedErrorBlob *r); -void ndr_print_ExtendedErrorComputerNamePresent(struct ndr_print *ndr, const char *name, enum ExtendedErrorComputerNamePresent r); -void ndr_print_ExtendedErrorComputerNameU(struct ndr_print *ndr, const char *name, const union ExtendedErrorComputerNameU *r); -void ndr_print_ExtendedErrorComputerName(struct ndr_print *ndr, const char *name, const struct ExtendedErrorComputerName *r); -void ndr_print_ExtendedErrorParamType(struct ndr_print *ndr, const char *name, enum ExtendedErrorParamType r); -void ndr_print_ExtendedErrorParamU(struct ndr_print *ndr, const char *name, const union ExtendedErrorParamU *r); -void ndr_print_ExtendedErrorParam(struct ndr_print *ndr, const char *name, const struct ExtendedErrorParam *r); -enum ndr_err_code ndr_push_ExtendedErrorInfo(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorInfo *r); -enum ndr_err_code ndr_pull_ExtendedErrorInfo(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorInfo *r); -void ndr_print_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfo *r); -void ndr_print_ExtendedErrorInfoPtr(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfoPtr *r); -void ndr_print_decode_replPropertyMetaData(struct ndr_print *ndr, const char *name, int flags, const struct decode_replPropertyMetaData *r); -void ndr_print_decode_replUpToDateVector(struct ndr_print *ndr, const char *name, int flags, const struct decode_replUpToDateVector *r); -void ndr_print_decode_repsFromTo(struct ndr_print *ndr, const char *name, int flags, const struct decode_repsFromTo *r); -void ndr_print_decode_partialAttributeSet(struct ndr_print *ndr, const char *name, int flags, const struct decode_partialAttributeSet *r); -void ndr_print_decode_prefixMap(struct ndr_print *ndr, const char *name, int flags, const struct decode_prefixMap *r); -void ndr_print_decode_ldapControlDirSync(struct ndr_print *ndr, const char *name, int flags, const struct decode_ldapControlDirSync *r); -void ndr_print_decode_supplementalCredentials(struct ndr_print *ndr, const char *name, int flags, const struct decode_supplementalCredentials *r); -void ndr_print_decode_Packages(struct ndr_print *ndr, const char *name, int flags, const struct decode_Packages *r); -void ndr_print_decode_PrimaryKerberos(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryKerberos *r); -void ndr_print_decode_PrimaryCLEARTEXT(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryCLEARTEXT *r); -void ndr_print_decode_PrimaryWDigest(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryWDigest *r); -void ndr_print_decode_trustAuthInOut(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustAuthInOut *r); -void ndr_print_decode_trustDomainPasswords(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustDomainPasswords *r); -void ndr_print_decode_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, int flags, const struct decode_ExtendedErrorInfo *r); -#endif /* _HEADER_NDR_drsblobs */ diff --git a/source3/librpc/gen_ndr/ndr_drsuapi.c b/source3/librpc/gen_ndr/ndr_drsuapi.c deleted file mode 100644 index c2a4aee180..0000000000 --- a/source3/librpc/gen_ndr/ndr_drsuapi.c +++ /dev/null @@ -1,14532 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_drsuapi.h" - -#include "librpc/gen_ndr/ndr_security.h" -#include "librpc/gen_ndr/ndr_misc.h" -#include "librpc/gen_ndr/ndr_samr.h" -#include "librpc/ndr/ndr_compression.h" -static enum ndr_err_code ndr_push_drsuapi_SupportedExtensions(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_SupportedExtensions(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_BASE", DRSUAPI_SUPPORTED_EXTENSION_BASE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION", DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI", DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2", DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS", DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION", DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_00000080", DRSUAPI_SUPPORTED_EXTENSION_00000080, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE", DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2", DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION", DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD", DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND", DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO", DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION", DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP", DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY", DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3", DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_00100000", DRSUAPI_SUPPORTED_EXTENSION_00100000, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2", DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS", DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3", DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT", DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS", DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_20000000", DRSUAPI_SUPPORTED_EXTENSION_20000000, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_40000000", DRSUAPI_SUPPORTED_EXTENSION_40000000, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_80000000", DRSUAPI_SUPPORTED_EXTENSION_80000000, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_SupportedExtensionsExt(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensionsExt(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_SupportedExtensionsExt(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADAM", DRSUAPI_SUPPORTED_EXTENSION_ADAM, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2", DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsBindInfo24(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo24 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo24(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo24 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsBindInfo24(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo24 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsBindInfo24"); - ndr->depth++; - ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions); - ndr_print_GUID(ndr, "site_guid", &r->site_guid); - ndr_print_uint32(ndr, "pid", r->pid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsBindInfo28(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo28 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->repl_epoch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo28(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo28 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->repl_epoch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsBindInfo28(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo28 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsBindInfo28"); - ndr->depth++; - ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions); - ndr_print_GUID(ndr, "site_guid", &r->site_guid); - ndr_print_uint32(ndr, "pid", r->pid); - ndr_print_uint32(ndr, "repl_epoch", r->repl_epoch); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsBindInfo48(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo48 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->repl_epoch)); - NDR_CHECK(ndr_push_drsuapi_SupportedExtensionsExt(ndr, NDR_SCALARS, r->supported_extensions_ext)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->config_dn_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo48(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo48 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->repl_epoch)); - NDR_CHECK(ndr_pull_drsuapi_SupportedExtensionsExt(ndr, NDR_SCALARS, &r->supported_extensions_ext)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->config_dn_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsBindInfo48(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo48 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsBindInfo48"); - ndr->depth++; - ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions); - ndr_print_GUID(ndr, "site_guid", &r->site_guid); - ndr_print_uint32(ndr, "pid", r->pid); - ndr_print_uint32(ndr, "repl_epoch", r->repl_epoch); - ndr_print_drsuapi_SupportedExtensionsExt(ndr, "supported_extensions_ext", r->supported_extensions_ext); - ndr_print_GUID(ndr, "config_dn_guid", &r->config_dn_guid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsBindInfoFallBack(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoFallBack *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->info)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoFallBack(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoFallBack *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->info)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsBindInfoFallBack(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoFallBack *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsBindInfoFallBack"); - ndr->depth++; - ndr_print_DATA_BLOB(ndr, "info", r->info); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsBindInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsBindInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 24: { - { - struct ndr_push *_ndr_info24; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info24, 4, -1)); - NDR_CHECK(ndr_push_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info24, 4, -1)); - } - break; } - - case 28: { - { - struct ndr_push *_ndr_info28; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info28, 4, -1)); - NDR_CHECK(ndr_push_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info28, 4, -1)); - } - break; } - - case 48: { - { - struct ndr_push *_ndr_info48; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info48, 4, -1)); - NDR_CHECK(ndr_push_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info48, 4, -1)); - } - break; } - - default: { - { - struct ndr_push *_ndr_FallBack; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_FallBack, 4, -1)); - NDR_CHECK(ndr_push_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_FallBack, 4, -1)); - } - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 24: - break; - - case 28: - break; - - case 48: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsBindInfo *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case 24: { - { - struct ndr_pull *_ndr_info24; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info24, 4, -1)); - NDR_CHECK(ndr_pull_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info24, 4, -1)); - } - break; } - - case 28: { - { - struct ndr_pull *_ndr_info28; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info28, 4, -1)); - NDR_CHECK(ndr_pull_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info28, 4, -1)); - } - break; } - - case 48: { - { - struct ndr_pull *_ndr_info48; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info48, 4, -1)); - NDR_CHECK(ndr_pull_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info48, 4, -1)); - } - break; } - - default: { - { - struct ndr_pull *_ndr_FallBack; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_FallBack, 4, -1)); - NDR_CHECK(ndr_pull_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_FallBack, 4, -1)); - } - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 24: - break; - - case 28: - break; - - case 48: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsBindInfo"); - switch (level) { - case 24: - ndr_print_drsuapi_DsBindInfo24(ndr, "info24", &r->info24); - break; - - case 28: - ndr_print_drsuapi_DsBindInfo28(ndr, "info28", &r->info28); - break; - - case 48: - ndr_print_drsuapi_DsBindInfo48(ndr, "info48", &r->info48); - break; - - default: - ndr_print_drsuapi_DsBindInfoFallBack(ndr, "FallBack", &r->FallBack); - break; - - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsBindInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->length)); - NDR_CHECK(ndr_push_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - if (r->length < 1 || r->length > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->length)); - NDR_CHECK(ndr_pull_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsBindInfoCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoCtr *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsBindInfoCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "length", r->length); - ndr_print_set_switch_value(ndr, &r->info, r->length); - ndr_print_drsuapi_DsBindInfo(ndr, "info", &r->info); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn) + 1)); - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->flags) - 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags))); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->dn)); - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, ndr_get_array_size(ndr, &r->dn), sizeof(uint16_t), CH_UTF16)); - if (r->dn) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->dn, r->__ndr_size_dn + 1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier"); - ndr->depth++; - ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->flags) - 4:r->__ndr_size); - ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid); - ndr_print_GUID(ndr, "guid", &r->guid); - ndr_print_dom_sid28(ndr, "sid", &r->sid); - ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn); - ndr_print_string(ndr, "dn", r->dn); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier(const struct drsuapi_DsReplicaObjectIdentifier *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier); -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncOptions(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_WRITEABLE", DRSUAPI_DS_REPLICA_SYNC_WRITEABLE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PERIODIC", DRSUAPI_DS_REPLICA_SYNC_PERIODIC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING", DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES", DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL", DRSUAPI_DS_REPLICA_SYNC_FULL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_URGENT", DRSUAPI_DS_REPLICA_SYNC_URGENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD", DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FORCE", DRSUAPI_DS_REPLICA_SYNC_FORCE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE", DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED", DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_TWO_WAY", DRSUAPI_DS_REPLICA_SYNC_TWO_WAY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY", DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL", DRSUAPI_DS_REPLICA_SYNC_INITIAL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION", DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ABANDONED", DRSUAPI_DS_REPLICA_SYNC_ABANDONED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_REQUEUE", DRSUAPI_DS_REPLICA_SYNC_REQUEUE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION", DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_CRITICAL", DRSUAPI_DS_REPLICA_SYNC_CRITICAL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PREEMPTED", DRSUAPI_DS_REPLICA_SYNC_PREEMPTED, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaSyncRequest1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->other_info)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->options)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->naming_context) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - if (r->other_info) { - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->other_info)); - } - ndr->flags = _flags_save_string; - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaSyncRequest1 *r) -{ - uint32_t _ptr_naming_context; - TALLOC_CTX *_mem_save_naming_context_0; - uint32_t _ptr_other_info; - TALLOC_CTX *_mem_save_other_info_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context)); - if (_ptr_naming_context) { - NDR_PULL_ALLOC(ndr, r->naming_context); - } else { - r->naming_context = NULL; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_info)); - if (_ptr_other_info) { - NDR_PULL_ALLOC(ndr, r->other_info); - } else { - r->other_info = NULL; - } - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->options)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->naming_context) { - _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - if (r->other_info) { - _mem_save_other_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->other_info, 0); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->other_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_info_0, 0); - } - ndr->flags = _flags_save_string; - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaSyncRequest1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaSyncRequest1"); - ndr->depth++; - ndr_print_ptr(ndr, "naming_context", r->naming_context); - ndr->depth++; - if (r->naming_context) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); - } - ndr->depth--; - ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid); - ndr_print_ptr(ndr, "other_info", r->other_info); - ndr->depth++; - if (r->other_info) { - ndr_print_string(ndr, "other_info", r->other_info); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "options", r->options); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaSyncRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaSyncRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaSyncRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsReplicaSyncRequest"); - switch (level) { - case 1: - ndr_print_drsuapi_DsReplicaSyncRequest1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaHighWaterMark(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaHighWaterMark *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->tmp_highest_usn)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->reserved_usn)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaHighWaterMark(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaHighWaterMark *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->tmp_highest_usn)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->reserved_usn)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaHighWaterMark(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaHighWaterMark *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaHighWaterMark"); - ndr->depth++; - ndr_print_hyper(ndr, "tmp_highest_usn", r->tmp_highest_usn); - ndr_print_hyper(ndr, "reserved_usn", r->reserved_usn); - ndr_print_hyper(ndr, "highest_usn", r->highest_usn); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor"); - ndr->depth++; - ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); - ndr_print_hyper(ndr, "highest_usn", r->highest_usn); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtrEx *r) -{ - uint32_t cntr_cursors_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtrEx *r) -{ - uint32_t cntr_cursors_0; - TALLOC_CTX *_mem_save_cursors_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 0x100000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2)); - NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors)); - _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); - for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); - if (r->cursors) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtrEx *r) -{ - uint32_t cntr_cursors_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursorCtrEx"); - ndr->depth++; - ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version); - ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2); - ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count); - ndr->depth++; - for (cntr_cursors_0=0;cntr_cursors_0count;cntr_cursors_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) { - ndr_print_drsuapi_DsReplicaCursor(ndr, "cursors", &r->cursors[cntr_cursors_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE", DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP", DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS", DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT", DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS", DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED", DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED", DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES", DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsExtendedOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation r) -{ - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsExtendedOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation *r) -{ - uint32_t v; - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsExtendedOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedOperation r) -{ - const char *val = NULL; - - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - switch (r) { - case DRSUAPI_EXOP_NONE: val = "DRSUAPI_EXOP_NONE"; break; - case DRSUAPI_EXOP_FSMO_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_REQ_ROLE"; break; - case DRSUAPI_EXOP_FSMO_RID_ALLOC: val = "DRSUAPI_EXOP_FSMO_RID_ALLOC"; break; - case DRSUAPI_EXOP_FSMO_RID_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_RID_REQ_ROLE"; break; - case DRSUAPI_EXOP_FSMO_REQ_PDC: val = "DRSUAPI_EXOP_FSMO_REQ_PDC"; break; - case DRSUAPI_EXOP_FSMO_ABANDON_ROLE: val = "DRSUAPI_EXOP_FSMO_ABANDON_ROLE"; break; - case DRSUAPI_EXOP_REPL_OBJ: val = "DRSUAPI_EXOP_REPL_OBJ"; break; - case DRSUAPI_EXOP_REPL_SECRET: val = "DRSUAPI_EXOP_REPL_SECRET"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); - ndr->flags = _flags_save_ENUM; - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsExtendedError(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedError r) -{ - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsExtendedError(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedError *r) -{ - uint32_t v; - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsExtendedError(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedError r) -{ - const char *val = NULL; - - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - switch (r) { - case DRSUAPI_EXOP_ERR_NONE: val = "DRSUAPI_EXOP_ERR_NONE"; break; - case DRSUAPI_EXOP_ERR_SUCCESS: val = "DRSUAPI_EXOP_ERR_SUCCESS"; break; - case DRSUAPI_EXOP_ERR_UNKNOWN_OP: val = "DRSUAPI_EXOP_ERR_UNKNOWN_OP"; break; - case DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER: val = "DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER"; break; - case DRSUAPI_EXOP_ERR_UPDATE_ERR: val = "DRSUAPI_EXOP_ERR_UPDATE_ERR"; break; - case DRSUAPI_EXOP_ERR_EXCEPTION: val = "DRSUAPI_EXOP_ERR_EXCEPTION"; break; - case DRSUAPI_EXOP_ERR_UNKNOWN_CALLER: val = "DRSUAPI_EXOP_ERR_UNKNOWN_CALLER"; break; - case DRSUAPI_EXOP_ERR_RID_ALLOC: val = "DRSUAPI_EXOP_ERR_RID_ALLOC"; break; - case DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED: val = "DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED"; break; - case DRSUAPI_EXOP_ERR_FMSO_PENDING_OP: val = "DRSUAPI_EXOP_ERR_FMSO_PENDING_OP"; break; - case DRSUAPI_EXOP_ERR_MISMATCH: val = "DRSUAPI_EXOP_ERR_MISMATCH"; break; - case DRSUAPI_EXOP_ERR_COULDNT_CONTACT: val = "DRSUAPI_EXOP_ERR_COULDNT_CONTACT"; break; - case DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES: val = "DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES"; break; - case DRSUAPI_EXOP_ERR_DIR_ERROR: val = "DRSUAPI_EXOP_ERR_DIR_ERROR"; break; - case DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS: val = "DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS"; break; - case DRSUAPI_EXOP_ERR_ACCESS_DENIED: val = "DRSUAPI_EXOP_ERR_ACCESS_DENIED"; break; - case DRSUAPI_EXOP_ERR_PARAM_ERROR: val = "DRSUAPI_EXOP_ERR_PARAM_ERROR"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); - ndr->flags = _flags_save_ENUM; - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest5(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - if (r->naming_context == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size)); - NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - if (r->uptodateness_vector) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest5(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest5 *r) -{ - uint32_t _ptr_naming_context; - TALLOC_CTX *_mem_save_naming_context_0; - uint32_t _ptr_uptodateness_vector; - TALLOC_CTX *_mem_save_uptodateness_vector_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context)); - if (_ptr_naming_context) { - NDR_PULL_ALLOC(ndr, r->naming_context); - } else { - r->naming_context = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector)); - if (_ptr_uptodateness_vector) { - NDR_PULL_ALLOC(ndr, r->uptodateness_vector); - } else { - r->uptodateness_vector = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size)); - NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info)); - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); - if (r->uptodateness_vector) { - _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest5(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest5 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest5"); - ndr->depth++; - ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid); - ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); - ndr_print_ptr(ndr, "naming_context", r->naming_context); - ndr->depth++; - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); - ndr->depth--; - ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark); - ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector); - ndr->depth++; - if (r->uptodateness_vector) { - ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags); - ndr_print_uint32(ndr, "max_object_count", r->max_object_count); - ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size); - ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op); - ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info); - ndr->depth--; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaOID"); - ndr->depth++; - ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaOID_oid(r->oid, 0):r->__ndr_size); - ndr_print_ptr(ndr, "oid", r->oid); - ndr->depth++; - if (r->oid) { - ndr_print_string(ndr, "oid", r->oid); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id_prefix)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id_prefix)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping"); - ndr->depth++; - ndr_print_uint32(ndr, "id_prefix", r->id_prefix); - ndr_print_drsuapi_DsReplicaOID(ndr, "oid", &r->oid); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping_Ctr *r) -{ - uint32_t cntr_mappings_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mappings)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->mappings)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->mappings) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mappings)); - for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1])); - } - for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping_Ctr *r) -{ - uint32_t _ptr_mappings; - uint32_t cntr_mappings_1; - TALLOC_CTX *_mem_save_mappings_0; - TALLOC_CTX *_mem_save_mappings_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_mappings)); - if (r->num_mappings < 0 || r->num_mappings > 0x100000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_mappings)); - if (_ptr_mappings) { - NDR_PULL_ALLOC(ndr, r->mappings); - } else { - r->mappings = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->mappings) { - _mem_save_mappings_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->mappings)); - NDR_PULL_ALLOC_N(ndr, r->mappings, ndr_get_array_size(ndr, &r->mappings)); - _mem_save_mappings_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0); - for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1])); - } - for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_0, 0); - } - if (r->mappings) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->mappings, r->num_mappings)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping_Ctr *r) -{ - uint32_t cntr_mappings_1; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping_Ctr"); - ndr->depth++; - ndr_print_uint32(ndr, "num_mappings", r->num_mappings); - ndr_print_ptr(ndr, "mappings", r->mappings); - ndr->depth++; - if (r->mappings) { - ndr->print(ndr, "%s: ARRAY(%d)", "mappings", (int)r->num_mappings); - ndr->depth++; - for (cntr_mappings_1=0;cntr_mappings_1num_mappings;cntr_mappings_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_mappings_1) != -1) { - ndr_print_drsuapi_DsReplicaOIDMapping(ndr, "mappings", &r->mappings[cntr_mappings_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAttributeId(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsAttributeId r) -{ - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAttributeId(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsAttributeId *r) -{ - uint32_t v; - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char *name, enum drsuapi_DsAttributeId r) -{ - const char *val = NULL; - - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - switch (r) { - case DRSUAPI_ATTRIBUTE_objectClass: val = "DRSUAPI_ATTRIBUTE_objectClass"; break; - case DRSUAPI_ATTRIBUTE_description: val = "DRSUAPI_ATTRIBUTE_description"; break; - case DRSUAPI_ATTRIBUTE_member: val = "DRSUAPI_ATTRIBUTE_member"; break; - case DRSUAPI_ATTRIBUTE_instanceType: val = "DRSUAPI_ATTRIBUTE_instanceType"; break; - case DRSUAPI_ATTRIBUTE_whenCreated: val = "DRSUAPI_ATTRIBUTE_whenCreated"; break; - case DRSUAPI_ATTRIBUTE_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_hasMasterNCs"; break; - case DRSUAPI_ATTRIBUTE_governsID: val = "DRSUAPI_ATTRIBUTE_governsID"; break; - case DRSUAPI_ATTRIBUTE_attributeID: val = "DRSUAPI_ATTRIBUTE_attributeID"; break; - case DRSUAPI_ATTRIBUTE_attributeSyntax: val = "DRSUAPI_ATTRIBUTE_attributeSyntax"; break; - case DRSUAPI_ATTRIBUTE_isSingleValued: val = "DRSUAPI_ATTRIBUTE_isSingleValued"; break; - case DRSUAPI_ATTRIBUTE_rangeLower: val = "DRSUAPI_ATTRIBUTE_rangeLower"; break; - case DRSUAPI_ATTRIBUTE_rangeUpper: val = "DRSUAPI_ATTRIBUTE_rangeUpper"; break; - case DRSUAPI_ATTRIBUTE_dMDLocation: val = "DRSUAPI_ATTRIBUTE_dMDLocation"; break; - case DRSUAPI_ATTRIBUTE_objectVersion: val = "DRSUAPI_ATTRIBUTE_objectVersion"; break; - case DRSUAPI_ATTRIBUTE_invocationId: val = "DRSUAPI_ATTRIBUTE_invocationId"; break; - case DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly: val = "DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly"; break; - case DRSUAPI_ATTRIBUTE_adminDisplayName: val = "DRSUAPI_ATTRIBUTE_adminDisplayName"; break; - case DRSUAPI_ATTRIBUTE_adminDescription: val = "DRSUAPI_ATTRIBUTE_adminDescription"; break; - case DRSUAPI_ATTRIBUTE_oMSyntax: val = "DRSUAPI_ATTRIBUTE_oMSyntax"; break; - case DRSUAPI_ATTRIBUTE_ntSecurityDescriptor: val = "DRSUAPI_ATTRIBUTE_ntSecurityDescriptor"; break; - case DRSUAPI_ATTRIBUTE_searchFlags: val = "DRSUAPI_ATTRIBUTE_searchFlags"; break; - case DRSUAPI_ATTRIBUTE_lDAPDisplayName: val = "DRSUAPI_ATTRIBUTE_lDAPDisplayName"; break; - case DRSUAPI_ATTRIBUTE_name: val = "DRSUAPI_ATTRIBUTE_name"; break; - case DRSUAPI_ATTRIBUTE_userAccountControl: val = "DRSUAPI_ATTRIBUTE_userAccountControl"; break; - case DRSUAPI_ATTRIBUTE_currentValue: val = "DRSUAPI_ATTRIBUTE_currentValue"; break; - case DRSUAPI_ATTRIBUTE_homeDirectory: val = "DRSUAPI_ATTRIBUTE_homeDirectory"; break; - case DRSUAPI_ATTRIBUTE_homeDrive: val = "DRSUAPI_ATTRIBUTE_homeDrive"; break; - case DRSUAPI_ATTRIBUTE_scriptPath: val = "DRSUAPI_ATTRIBUTE_scriptPath"; break; - case DRSUAPI_ATTRIBUTE_profilePath: val = "DRSUAPI_ATTRIBUTE_profilePath"; break; - case DRSUAPI_ATTRIBUTE_objectSid: val = "DRSUAPI_ATTRIBUTE_objectSid"; break; - case DRSUAPI_ATTRIBUTE_schemaIDGUID: val = "DRSUAPI_ATTRIBUTE_schemaIDGUID"; break; - case DRSUAPI_ATTRIBUTE_dBCSPwd: val = "DRSUAPI_ATTRIBUTE_dBCSPwd"; break; - case DRSUAPI_ATTRIBUTE_logonHours: val = "DRSUAPI_ATTRIBUTE_logonHours"; break; - case DRSUAPI_ATTRIBUTE_userWorkstations: val = "DRSUAPI_ATTRIBUTE_userWorkstations"; break; - case DRSUAPI_ATTRIBUTE_unicodePwd: val = "DRSUAPI_ATTRIBUTE_unicodePwd"; break; - case DRSUAPI_ATTRIBUTE_ntPwdHistory: val = "DRSUAPI_ATTRIBUTE_ntPwdHistory"; break; - case DRSUAPI_ATTRIBUTE_priorValue: val = "DRSUAPI_ATTRIBUTE_priorValue"; break; - case DRSUAPI_ATTRIBUTE_supplementalCredentials: val = "DRSUAPI_ATTRIBUTE_supplementalCredentials"; break; - case DRSUAPI_ATTRIBUTE_trustAuthIncoming: val = "DRSUAPI_ATTRIBUTE_trustAuthIncoming"; break; - case DRSUAPI_ATTRIBUTE_trustAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_trustAuthOutgoing"; break; - case DRSUAPI_ATTRIBUTE_lmPwdHistory: val = "DRSUAPI_ATTRIBUTE_lmPwdHistory"; break; - case DRSUAPI_ATTRIBUTE_sAMAccountName: val = "DRSUAPI_ATTRIBUTE_sAMAccountName"; break; - case DRSUAPI_ATTRIBUTE_sAMAccountType: val = "DRSUAPI_ATTRIBUTE_sAMAccountType"; break; - case DRSUAPI_ATTRIBUTE_fSMORoleOwner: val = "DRSUAPI_ATTRIBUTE_fSMORoleOwner"; break; - case DRSUAPI_ATTRIBUTE_systemFlags: val = "DRSUAPI_ATTRIBUTE_systemFlags"; break; - case DRSUAPI_ATTRIBUTE_serverReference: val = "DRSUAPI_ATTRIBUTE_serverReference"; break; - case DRSUAPI_ATTRIBUTE_serverReferenceBL: val = "DRSUAPI_ATTRIBUTE_serverReferenceBL"; break; - case DRSUAPI_ATTRIBUTE_initialAuthIncoming: val = "DRSUAPI_ATTRIBUTE_initialAuthIncoming"; break; - case DRSUAPI_ATTRIBUTE_initialAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_initialAuthOutgoing"; break; - case DRSUAPI_ATTRIBUTE_wellKnownObjects: val = "DRSUAPI_ATTRIBUTE_wellKnownObjects"; break; - case DRSUAPI_ATTRIBUTE_dNSHostName: val = "DRSUAPI_ATTRIBUTE_dNSHostName"; break; - case DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet: val = "DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet"; break; - case DRSUAPI_ATTRIBUTE_userPrincipalName: val = "DRSUAPI_ATTRIBUTE_userPrincipalName"; break; - case DRSUAPI_ATTRIBUTE_groupType: val = "DRSUAPI_ATTRIBUTE_groupType"; break; - case DRSUAPI_ATTRIBUTE_servicePrincipalName: val = "DRSUAPI_ATTRIBUTE_servicePrincipalName"; break; - case DRSUAPI_ATTRIBUTE_objectCategory: val = "DRSUAPI_ATTRIBUTE_objectCategory"; break; - case DRSUAPI_ATTRIBUTE_gPLink: val = "DRSUAPI_ATTRIBUTE_gPLink"; break; - case DRSUAPI_ATTRIBUTE_msDS_Behavior_Version: val = "DRSUAPI_ATTRIBUTE_msDS_Behavior_Version"; break; - case DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber: val = "DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber"; break; - case DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs: val = "DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs"; break; - case DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); - ndr->flags = _flags_save_ENUM; - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsPartialAttributeSet(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsPartialAttributeSet *r) -{ - uint32_t cntr_attids_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attids)); - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attids)); - for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) { - NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attids[cntr_attids_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsPartialAttributeSet(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsPartialAttributeSet *r) -{ - uint32_t cntr_attids_0; - TALLOC_CTX *_mem_save_attids_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->attids)); - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attids)); - if (r->num_attids < 1 || r->num_attids > 0x100000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC_N(ndr, r->attids, ndr_get_array_size(ndr, &r->attids)); - _mem_save_attids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attids, 0); - for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attids[cntr_attids_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attids_0, 0); - if (r->attids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attids, r->num_attids)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsPartialAttributeSet(struct ndr_print *ndr, const char *name, const struct drsuapi_DsPartialAttributeSet *r) -{ - uint32_t cntr_attids_0; - ndr_print_struct(ndr, name, "drsuapi_DsPartialAttributeSet"); - ndr->depth++; - ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version); - ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); - ndr_print_uint32(ndr, "num_attids", r->num_attids); - ndr->print(ndr, "%s: ARRAY(%d)", "attids", (int)r->num_attids); - ndr->depth++; - for (cntr_attids_0=0;cntr_attids_0num_attids;cntr_attids_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_attids_0) != -1) { - ndr_print_drsuapi_DsAttributeId(ndr, "attids", r->attids[cntr_attids_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest8(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest8 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - if (r->naming_context == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size)); - NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set_ex)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - if (r->uptodateness_vector) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); - } - if (r->partial_attribute_set) { - NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set)); - } - if (r->partial_attribute_set_ex) { - NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex)); - } - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest8(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest8 *r) -{ - uint32_t _ptr_naming_context; - TALLOC_CTX *_mem_save_naming_context_0; - uint32_t _ptr_uptodateness_vector; - TALLOC_CTX *_mem_save_uptodateness_vector_0; - uint32_t _ptr_partial_attribute_set; - TALLOC_CTX *_mem_save_partial_attribute_set_0; - uint32_t _ptr_partial_attribute_set_ex; - TALLOC_CTX *_mem_save_partial_attribute_set_ex_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context)); - if (_ptr_naming_context) { - NDR_PULL_ALLOC(ndr, r->naming_context); - } else { - r->naming_context = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector)); - if (_ptr_uptodateness_vector) { - NDR_PULL_ALLOC(ndr, r->uptodateness_vector); - } else { - r->uptodateness_vector = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size)); - NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set)); - if (_ptr_partial_attribute_set) { - NDR_PULL_ALLOC(ndr, r->partial_attribute_set); - } else { - r->partial_attribute_set = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set_ex)); - if (_ptr_partial_attribute_set_ex) { - NDR_PULL_ALLOC(ndr, r->partial_attribute_set_ex); - } else { - r->partial_attribute_set_ex = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); - if (r->uptodateness_vector) { - _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0); - } - if (r->partial_attribute_set) { - _mem_save_partial_attribute_set_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set, 0); - NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_0, 0); - } - if (r->partial_attribute_set_ex) { - _mem_save_partial_attribute_set_ex_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set_ex, 0); - NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_ex_0, 0); - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest8(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest8 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest8"); - ndr->depth++; - ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid); - ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); - ndr_print_ptr(ndr, "naming_context", r->naming_context); - ndr->depth++; - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); - ndr->depth--; - ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark); - ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector); - ndr->depth++; - if (r->uptodateness_vector) { - ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags); - ndr_print_uint32(ndr, "max_object_count", r->max_object_count); - ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size); - ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op); - ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info); - ndr_print_ptr(ndr, "partial_attribute_set", r->partial_attribute_set); - ndr->depth++; - if (r->partial_attribute_set) { - ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set", r->partial_attribute_set); - } - ndr->depth--; - ndr_print_ptr(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex); - ndr->depth++; - if (r->partial_attribute_set_ex) { - ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 5: { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5)); - break; } - - case 8: { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 5: - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5)); - break; - - case 8: - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 5: { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5)); - break; } - - case 8: { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 5: - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5)); - break; - - case 8: - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesRequest"); - switch (level) { - case 5: - ndr_print_drsuapi_DsGetNCChangesRequest5(ndr, "req5", &r->req5); - break; - - case 8: - ndr_print_drsuapi_DsGetNCChangesRequest8(ndr, "req8", &r->req8); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2"); - ndr->depth++; - ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); - ndr_print_hyper(ndr, "highest_usn", r->highest_usn); - ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2CtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2CtrEx *r) -{ - uint32_t cntr_cursors_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2CtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2CtrEx *r) -{ - uint32_t cntr_cursors_0; - TALLOC_CTX *_mem_save_cursors_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 0x100000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2)); - NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors)); - _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); - for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); - if (r->cursors) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2CtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2CtrEx *r) -{ - uint32_t cntr_cursors_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2CtrEx"); - ndr->depth++; - ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->version); - ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2); - ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count); - ndr->depth++; - for (cntr_cursors_0=0;cntr_cursors_0count;cntr_cursors_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) { - ndr_print_drsuapi_DsReplicaCursor2(ndr, "cursors", &r->cursors[cntr_cursors_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAttributeValue(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValue *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->blob, 0))); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->blob)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->blob) { - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->blob)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValue(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValue *r) -{ - uint32_t _ptr_blob; - TALLOC_CTX *_mem_save_blob_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); - if (r->__ndr_size < 0 || r->__ndr_size > 10485760) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_blob)); - if (_ptr_blob) { - NDR_PULL_ALLOC(ndr, r->blob); - } else { - r->blob = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->blob) { - _mem_save_blob_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->blob, 0); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->blob)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_blob_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAttributeValue(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue"); - ndr->depth++; - ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->blob, 0):r->__ndr_size); - ndr_print_ptr(ndr, "blob", r->blob); - ndr->depth++; - if (r->blob) { - ndr_print_DATA_BLOB(ndr, "blob", *r->blob); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAttributeValueCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValueCtr *r) -{ - uint32_t cntr_values_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_values)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->values)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->values) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_values)); - for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) { - NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1])); - } - for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) { - NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValueCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValueCtr *r) -{ - uint32_t _ptr_values; - uint32_t cntr_values_1; - TALLOC_CTX *_mem_save_values_0; - TALLOC_CTX *_mem_save_values_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_values)); - if (r->num_values < 0 || r->num_values > 10485760) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_values)); - if (_ptr_values) { - NDR_PULL_ALLOC(ndr, r->values); - } else { - r->values = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->values) { - _mem_save_values_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->values, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->values)); - NDR_PULL_ALLOC_N(ndr, r->values, ndr_get_array_size(ndr, &r->values)); - _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->values, 0); - for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1])); - } - for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_0, 0); - } - if (r->values) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->values, r->num_values)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValueCtr *r) -{ - uint32_t cntr_values_1; - ndr_print_struct(ndr, name, "drsuapi_DsAttributeValueCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "num_values", r->num_values); - ndr_print_ptr(ndr, "values", r->values); - ndr->depth++; - if (r->values) { - ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->num_values); - ndr->depth++; - for (cntr_values_1=0;cntr_values_1num_values;cntr_values_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) { - ndr_print_drsuapi_DsAttributeValue(ndr, "values", &r->values[cntr_values_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->flags))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags))); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3"); - ndr->depth++; - ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->flags):r->__ndr_size); - ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid); - ndr_print_GUID(ndr, "guid", &r->guid); - ndr_print_dom_sid28(ndr, "sid", &r->sid); - ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn); - ndr_print_string(ndr, "dn", r->dn); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplicaObjectIdentifier3 *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r, ndr->flags))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags))); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->binary.length + 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->binary)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->binary)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3Binary"); - ndr->depth++; - ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r, ndr->flags):r->__ndr_size); - ndr_print_uint32(ndr, "__ndr_size_sid", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid28(&r->sid, ndr->flags):r->__ndr_size_sid); - ndr_print_GUID(ndr, "guid", &r->guid); - ndr_print_dom_sid28(ndr, "sid", &r->sid); - ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn); - ndr_print_string(ndr, "dn", r->dn); - ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->binary.length + 4:r->__ndr_size_binary); - ndr_print_DATA_BLOB(ndr, "binary", r->binary); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary); -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid)); - NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid)); - NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttribute"); - ndr->depth++; - ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid); - ndr_print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttributeCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttributeCtr *r) -{ - uint32_t cntr_attributes_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attributes)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attributes) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attributes)); - for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1])); - } - for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttributeCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttributeCtr *r) -{ - uint32_t _ptr_attributes; - uint32_t cntr_attributes_1; - TALLOC_CTX *_mem_save_attributes_0; - TALLOC_CTX *_mem_save_attributes_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attributes)); - if (r->num_attributes < 0 || r->num_attributes > 1048576) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attributes)); - if (_ptr_attributes) { - NDR_PULL_ALLOC(ndr, r->attributes); - } else { - r->attributes = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attributes) { - _mem_save_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->attributes)); - NDR_PULL_ALLOC_N(ndr, r->attributes, ndr_get_array_size(ndr, &r->attributes)); - _mem_save_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0); - for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1])); - } - for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_0, 0); - } - if (r->attributes) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attributes, r->num_attributes)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttributeCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttributeCtr *r) -{ - uint32_t cntr_attributes_1; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttributeCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "num_attributes", r->num_attributes); - ndr_print_ptr(ndr, "attributes", r->attributes); - ndr->depth++; - if (r->attributes) { - ndr->print(ndr, "%s: ARRAY(%d)", "attributes", (int)r->num_attributes); - ndr->depth++; - for (cntr_attributes_1=0;cntr_attributes_1num_attributes;cntr_attributes_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_attributes_1) != -1) { - ndr_print_drsuapi_DsReplicaAttribute(ndr, "attributes", &r->attributes[cntr_attributes_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER", DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC", DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY", DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObject(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObject *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->identifier) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier)); - } - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObject(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObject *r) -{ - uint32_t _ptr_identifier; - TALLOC_CTX *_mem_save_identifier_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier)); - if (_ptr_identifier) { - NDR_PULL_ALLOC(ndr, r->identifier); - } else { - r->identifier = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->identifier) { - _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0); - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObject(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObject *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaObject"); - ndr->depth++; - ndr_print_ptr(ndr, "identifier", r->identifier); - ndr->depth++; - if (r->identifier) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaObjectFlags(ndr, "flags", r->flags); - ndr_print_drsuapi_DsReplicaAttributeCtr(ndr, "attribute_ctr", &r->attribute_ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaData *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_change_time)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaData *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_change_time)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaData *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaData"); - ndr->depth++; - ndr_print_uint32(ndr, "version", r->version); - ndr_print_NTTIME_1sec(ndr, "originating_change_time", r->originating_change_time); - ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); - ndr_print_hyper(ndr, "originating_usn", r->originating_usn); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaDataCtr *r) -{ - uint32_t cntr_meta_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaDataCtr *r) -{ - uint32_t cntr_meta_data_0; - TALLOC_CTX *_mem_save_meta_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->meta_data)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 1048576) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC_N(ndr, r->meta_data, ndr_get_array_size(ndr, &r->meta_data)); - _mem_save_meta_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->meta_data, 0); - for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_0, 0); - if (r->meta_data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->meta_data, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaDataCtr *r) -{ - uint32_t cntr_meta_data_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaDataCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr->print(ndr, "%s: ARRAY(%d)", "meta_data", (int)r->count); - ndr->depth++; - for (cntr_meta_data_0=0;cntr_meta_data_0count;cntr_meta_data_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_meta_data_0) != -1) { - ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data[cntr_meta_data_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItemEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItemEx *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_nc_prefix)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->parent_object_guid)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->meta_data_ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->next_object) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object)); - } - NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object)); - if (r->parent_object_guid) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->parent_object_guid)); - } - if (r->meta_data_ctr) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItemEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItemEx *r) -{ - uint32_t _ptr_next_object; - TALLOC_CTX *_mem_save_next_object_0; - uint32_t _ptr_parent_object_guid; - TALLOC_CTX *_mem_save_parent_object_guid_0; - uint32_t _ptr_meta_data_ctr; - TALLOC_CTX *_mem_save_meta_data_ctr_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object)); - if (_ptr_next_object) { - NDR_PULL_ALLOC(ndr, r->next_object); - } else { - r->next_object = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_nc_prefix)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parent_object_guid)); - if (_ptr_parent_object_guid) { - NDR_PULL_ALLOC(ndr, r->parent_object_guid); - } else { - r->parent_object_guid = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_meta_data_ctr)); - if (_ptr_meta_data_ctr) { - NDR_PULL_ALLOC(ndr, r->meta_data_ctr); - } else { - r->meta_data_ctr = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->next_object) { - _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0); - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object)); - if (r->parent_object_guid) { - _mem_save_parent_object_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->parent_object_guid, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->parent_object_guid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_object_guid_0, 0); - } - if (r->meta_data_ctr) { - _mem_save_meta_data_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->meta_data_ctr, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_ctr_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); - NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->flags) + 55)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->naming_context) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - } - if (r->uptodateness_vector) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); - } - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); - if (r->first_object) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1 *r) -{ - uint32_t _ptr_naming_context; - TALLOC_CTX *_mem_save_naming_context_0; - uint32_t _ptr_uptodateness_vector; - TALLOC_CTX *_mem_save_uptodateness_vector_0; - uint32_t _ptr_first_object; - TALLOC_CTX *_mem_save_first_object_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context)); - if (_ptr_naming_context) { - NDR_PULL_ALLOC(ndr, r->naming_context); - } else { - r->naming_context = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector)); - if (_ptr_uptodateness_vector) { - NDR_PULL_ALLOC(ndr, r->uptodateness_vector); - } else { - r->uptodateness_vector = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); - NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object)); - if (_ptr_first_object) { - NDR_PULL_ALLOC(ndr, r->first_object); - } else { - r->first_object = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->naming_context) { - _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); - } - if (r->uptodateness_vector) { - _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0); - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); - if (r->first_object) { - _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1"); - ndr->depth++; - ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid); - ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); - ndr_print_ptr(ndr, "naming_context", r->naming_context); - ndr->depth++; - if (r->naming_context) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark); - ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark); - ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector); - ndr->depth++; - if (r->uptodateness_vector) { - ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr); - ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret); - ndr_print_uint32(ndr, "object_count", r->object_count); - ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->flags) + 55:r->__ndr_size); - ndr_print_ptr(ndr, "first_object", r->first_object); - ndr->depth++; - if (r->first_object) { - ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object); - } - ndr->depth--; - ndr_print_uint32(ndr, "more_data", r->more_data); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr1(const struct drsuapi_DsGetNCChangesCtr1 *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr1); -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsLinkedAttributeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsLinkedAttributeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsLinkedAttributeFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE", DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaLinkedAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaLinkedAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier)); - NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid)); - NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value)); - NDR_CHECK(ndr_push_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_add_time)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->identifier) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier)); - } - NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaLinkedAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaLinkedAttribute *r) -{ - uint32_t _ptr_identifier; - TALLOC_CTX *_mem_save_identifier_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier)); - if (_ptr_identifier) { - NDR_PULL_ALLOC(ndr, r->identifier); - } else { - r->identifier = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid)); - NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value)); - NDR_CHECK(ndr_pull_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_add_time)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->identifier) { - _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0); - } - NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaLinkedAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaLinkedAttribute *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaLinkedAttribute"); - ndr->depth++; - ndr_print_ptr(ndr, "identifier", r->identifier); - ndr->depth++; - if (r->identifier) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier); - } - ndr->depth--; - ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid); - ndr_print_drsuapi_DsAttributeValue(ndr, "value", &r->value); - ndr_print_drsuapi_DsLinkedAttributeFlags(ndr, "flags", r->flags); - ndr_print_NTTIME_1sec(ndr, "originating_add_time", r->originating_add_time); - ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6 *r) -{ - uint32_t cntr_linked_attributes_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); - NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr6(r, ndr->flags) + 55)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_object_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_linked_attributes_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linked_attributes_count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->linked_attributes)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->drs_error)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->naming_context) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - } - if (r->uptodateness_vector) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); - } - NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); - if (r->first_object) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object)); - } - if (r->linked_attributes) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linked_attributes_count)); - for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1])); - } - for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6 *r) -{ - uint32_t _ptr_naming_context; - TALLOC_CTX *_mem_save_naming_context_0; - uint32_t _ptr_uptodateness_vector; - TALLOC_CTX *_mem_save_uptodateness_vector_0; - uint32_t _ptr_first_object; - TALLOC_CTX *_mem_save_first_object_0; - uint32_t _ptr_linked_attributes; - uint32_t cntr_linked_attributes_1; - TALLOC_CTX *_mem_save_linked_attributes_0; - TALLOC_CTX *_mem_save_linked_attributes_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context)); - if (_ptr_naming_context) { - NDR_PULL_ALLOC(ndr, r->naming_context); - } else { - r->naming_context = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector)); - if (_ptr_uptodateness_vector) { - NDR_PULL_ALLOC(ndr, r->uptodateness_vector); - } else { - r->uptodateness_vector = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr)); - NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object)); - if (_ptr_first_object) { - NDR_PULL_ALLOC(ndr, r->first_object); - } else { - r->first_object = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_object_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_linked_attributes_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->linked_attributes_count)); - if (r->linked_attributes_count < 0 || r->linked_attributes_count > 1048576) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_linked_attributes)); - if (_ptr_linked_attributes) { - NDR_PULL_ALLOC(ndr, r->linked_attributes); - } else { - r->linked_attributes = NULL; - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->drs_error)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->naming_context) { - _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); - } - if (r->uptodateness_vector) { - _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0); - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr)); - if (r->first_object) { - _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0); - } - if (r->linked_attributes) { - _mem_save_linked_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->linked_attributes)); - NDR_PULL_ALLOC_N(ndr, r->linked_attributes, ndr_get_array_size(ndr, &r->linked_attributes)); - _mem_save_linked_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0); - for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1])); - } - for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_0, 0); - } - if (r->linked_attributes) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->linked_attributes, r->linked_attributes_count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6 *r) -{ - uint32_t cntr_linked_attributes_1; - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6"); - ndr->depth++; - ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid); - ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); - ndr_print_ptr(ndr, "naming_context", r->naming_context); - ndr->depth++; - if (r->naming_context) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark); - ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark); - ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector); - ndr->depth++; - if (r->uptodateness_vector) { - ndr_print_drsuapi_DsReplicaCursor2CtrEx(ndr, "uptodateness_vector", r->uptodateness_vector); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr); - ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret); - ndr_print_uint32(ndr, "object_count", r->object_count); - ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsGetNCChangesCtr6(r, ndr->flags) + 55:r->__ndr_size); - ndr_print_ptr(ndr, "first_object", r->first_object); - ndr->depth++; - if (r->first_object) { - ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object); - } - ndr->depth--; - ndr_print_uint32(ndr, "more_data", r->more_data); - ndr_print_uint32(ndr, "nc_object_count", r->nc_object_count); - ndr_print_uint32(ndr, "nc_linked_attributes_count", r->nc_linked_attributes_count); - ndr_print_uint32(ndr, "linked_attributes_count", r->linked_attributes_count); - ndr_print_ptr(ndr, "linked_attributes", r->linked_attributes); - ndr->depth++; - if (r->linked_attributes) { - ndr->print(ndr, "%s: ARRAY(%d)", "linked_attributes", (int)r->linked_attributes_count); - ndr->depth++; - for (cntr_linked_attributes_1=0;cntr_linked_attributes_1linked_attributes_count;cntr_linked_attributes_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_linked_attributes_1) != -1) { - ndr_print_drsuapi_DsReplicaLinkedAttribute(ndr, "linked_attributes", &r->linked_attributes[cntr_linked_attributes_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_WERROR(ndr, "drs_error", r->drs_error); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNCChangesCtr6 *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr6); -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - { - struct ndr_push *_ndr_ctr1; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1)); - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1TS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - { - struct ndr_pull *_ndr_ctr1; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1TS *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1TS"); - ndr->depth++; - ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6TS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - { - struct ndr_push *_ndr_ctr6; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1)); - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6TS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - { - struct ndr_pull *_ndr_ctr6; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6TS *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6TS"); - ndr->depth++; - ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6); - ndr->depth--; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr1 *r) -{ - uint32_t _ptr_ts; - TALLOC_CTX *_mem_save_ts_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts)); - if (_ptr_ts) { - NDR_PULL_ALLOC(ndr, r->ts); - } else { - r->ts = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->ts) { - _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0); - { - struct ndr_pull *_ndr_ts; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length)); - { - struct ndr_pull *_ndr_ts_compressed; - NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); - NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length)); - } - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length); - ndr_print_uint32(ndr, "compressed_length", r->compressed_length); - ndr_print_ptr(ndr, "ts", r->ts); - ndr->depth++; - if (r->ts) { - ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr6 *r) -{ - uint32_t _ptr_ts; - TALLOC_CTX *_mem_save_ts_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts)); - if (_ptr_ts) { - NDR_PULL_ALLOC(ndr, r->ts); - } else { - r->ts = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->ts) { - _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0); - { - struct ndr_pull *_ndr_ts; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length)); - { - struct ndr_pull *_ndr_ts_compressed; - NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); - NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length)); - } - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr6"); - ndr->depth++; - ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length); - ndr_print_uint32(ndr, "compressed_length", r->compressed_length); - ndr_print_ptr(ndr, "ts", r->ts); - ndr->depth++; - if (r->ts) { - ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr1 *r) -{ - uint32_t _ptr_ts; - TALLOC_CTX *_mem_save_ts_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts)); - if (_ptr_ts) { - NDR_PULL_ALLOC(ndr, r->ts); - } else { - r->ts = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->ts) { - _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0); - { - struct ndr_pull *_ndr_ts; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length)); - { - struct ndr_pull *_ndr_ts_compressed; - NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); - NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length)); - } - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesXPRESSCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length); - ndr_print_uint32(ndr, "compressed_length", r->compressed_length); - ndr_print_ptr(ndr, "ts", r->ts); - ndr->depth++; - if (r->ts) { - ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr6 *r) -{ - uint32_t _ptr_ts; - TALLOC_CTX *_mem_save_ts_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts)); - if (_ptr_ts) { - NDR_PULL_ALLOC(ndr, r->ts); - } else { - r->ts = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->ts) { - _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0); - { - struct ndr_pull *_ndr_ts; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length)); - { - struct ndr_pull *_ndr_ts_compressed; - NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); - NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length)); - } - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesXPRESSCtr6"); - ndr->depth++; - ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length); - ndr_print_uint32(ndr, "compressed_length", r->compressed_length); - ndr_print_ptr(ndr, "ts", r->ts); - ndr->depth++; - if (r->ts) { - ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCompressionType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsGetNCChangesCompressionType r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCompressionType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsGetNCChangesCompressionType *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCompressionType(struct ndr_print *ndr, const char *name, enum drsuapi_DsGetNCChangesCompressionType r) -{ - const char *val = NULL; - - switch (r) { - case DRSUAPI_COMPRESSION_TYPE_MSZIP: val = "DRSUAPI_COMPRESSION_TYPE_MSZIP"; break; - case DRSUAPI_COMPRESSION_TYPE_XPRESS: val = "DRSUAPI_COMPRESSION_TYPE_XPRESS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesCompressedCtr *r) -{ - { - uint32_t _flags_save_UNION = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1)); - break; } - - case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_SCALARS, &r->mszip6)); - break; } - - case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_SCALARS, &r->xpress1)); - break; } - - case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_SCALARS, &r->xpress6)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1)); - break; - - case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_BUFFERS, &r->mszip6)); - break; - - case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_BUFFERS, &r->xpress1)); - break; - - case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_BUFFERS, &r->xpress6)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - ndr->flags = _flags_save_UNION; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesCompressedCtr *r) -{ - int level; - { - uint32_t _flags_save_UNION = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1)); - break; } - - case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_SCALARS, &r->mszip6)); - break; } - - case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_SCALARS, &r->xpress1)); - break; } - - case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_SCALARS, &r->xpress6)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1)); - break; - - case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_BUFFERS, &r->mszip6)); - break; - - case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_BUFFERS, &r->xpress1)); - break; - - case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_BUFFERS, &r->xpress6)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - ndr->flags = _flags_save_UNION; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCompressedCtr *r) -{ - int level; - { - uint32_t _flags_save_UNION = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesCompressedCtr"); - switch (level) { - case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): - ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, "mszip1", &r->mszip1); - break; - - case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): - ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, "mszip6", &r->mszip6); - break; - - case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): - ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, "xpress1", &r->xpress1); - break; - - case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): - ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, "xpress6", &r->xpress6); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } - ndr->flags = _flags_save_UNION; - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr2 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr2"); - ndr->depth++; - ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, "mszip1", &r->mszip1); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr7(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressionType(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16))); - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr7(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->level)); - if (r->level < 0 || r->level > 6) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressionType(ndr, NDR_SCALARS, &r->type)); - if (r->type < 2 || r->type > 3) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16))); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr7(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr7 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr7"); - ndr->depth++; - ndr_print_int32(ndr, "level", r->level); - ndr_print_drsuapi_DsGetNCChangesCompressionType(ndr, "type", r->type); - ndr_print_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16)); - ndr_print_drsuapi_DsGetNCChangesCompressedCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr2(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - case 6: { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(ndr, NDR_SCALARS, &r->ctr6)); - break; } - - case 7: { - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr7(ndr, NDR_SCALARS, &r->ctr7)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - case 2: - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr2(ndr, NDR_BUFFERS, &r->ctr2)); - break; - - case 6: - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(ndr, NDR_BUFFERS, &r->ctr6)); - break; - - case 7: - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr7(ndr, NDR_BUFFERS, &r->ctr7)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesCtr *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr2(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - case 6: { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(ndr, NDR_SCALARS, &r->ctr6)); - break; } - - case 7: { - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr7(ndr, NDR_SCALARS, &r->ctr7)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - case 2: - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr2(ndr, NDR_BUFFERS, &r->ctr2)); - break; - - case 6: - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(ndr, NDR_BUFFERS, &r->ctr6)); - break; - - case 7: - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr7(ndr, NDR_BUFFERS, &r->ctr7)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesCtr"); - switch (level) { - case 1: - ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1); - break; - - case 2: - ndr_print_drsuapi_DsGetNCChangesCtr2(ndr, "ctr2", &r->ctr2); - break; - - case 6: - ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6); - break; - - case 7: - ndr_print_drsuapi_DsGetNCChangesCtr7(ndr, "ctr7", &r->ctr7); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE", DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE", DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE", DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_0x00000010", DRSUAPI_DS_REPLICA_UPDATE_0x00000010, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - if (r->naming_context == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - if (r->dest_dsa_dns_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_GUID(ndr, NDR_SCALARS, &r->dest_dsa_guid)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, r->options)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dest_dsa_dns_name, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS), sizeof(uint8_t), CH_DOS)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaUpdateRefsRequest1 *r) -{ - uint32_t _ptr_naming_context; - TALLOC_CTX *_mem_save_naming_context_0; - uint32_t _ptr_dest_dsa_dns_name; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context)); - if (_ptr_naming_context) { - NDR_PULL_ALLOC(ndr, r->naming_context); - } else { - r->naming_context = NULL; - } - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_dest_dsa_dns_name)); - if (_ptr_dest_dsa_dns_name) { - NDR_PULL_ALLOC(ndr, r->dest_dsa_dns_name); - } else { - r->dest_dsa_dns_name = NULL; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->dest_dsa_guid)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, &r->options)); - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dest_dsa_dns_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dest_dsa_dns_name)); - if (ndr_get_array_length(ndr, &r->dest_dsa_dns_name) > ndr_get_array_size(ndr, &r->dest_dsa_dns_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dest_dsa_dns_name), ndr_get_array_length(ndr, &r->dest_dsa_dns_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dest_dsa_dns_name), sizeof(uint8_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dest_dsa_dns_name, ndr_get_array_length(ndr, &r->dest_dsa_dns_name), sizeof(uint8_t), CH_DOS)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaUpdateRefsRequest1"); - ndr->depth++; - ndr_print_ptr(ndr, "naming_context", r->naming_context); - ndr->depth++; - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context); - ndr->depth--; - ndr_print_ptr(ndr, "dest_dsa_dns_name", r->dest_dsa_dns_name); - ndr->depth++; - ndr_print_string(ndr, "dest_dsa_dns_name", r->dest_dsa_dns_name); - ndr->depth--; - ndr_print_GUID(ndr, "dest_dsa_guid", &r->dest_dsa_guid); - ndr_print_drsuapi_DsReplicaUpdateRefsOptions(ndr, "options", r->options); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaUpdateRefsRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaUpdateRefsRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaUpdateRefsRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsReplicaUpdateRefsRequest"); - switch (level) { - case 1: - ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaAddOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAddOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaAddOptions(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_WRITEABLE", DRSUAPI_DS_REPLICA_ADD_WRITEABLE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaDeleteOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaDeleteOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaDeleteOptions(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_DELETE_WRITEABLE", DRSUAPI_DS_REPLICA_DELETE_WRITEABLE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaModifyOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaModifyOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaModifyOptions(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE", DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsMembershipType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsMembershipType r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsMembershipType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsMembershipType *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsMembershipType(struct ndr_print *ndr, const char *name, enum drsuapi_DsMembershipType r) -{ - const char *val = NULL; - - switch (r) { - case DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS"; break; - case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS"; break; - case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS"; break; - case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2"; break; - case DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS"; break; - case DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS"; break; - case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMembershipsCtr1 *r) -{ - uint32_t cntr_info_array_1; - uint32_t cntr_group_attrs_1; - uint32_t cntr_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_attrs)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info_array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships)); - for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array[cntr_info_array_1])); - } - for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) { - if (r->info_array[cntr_info_array_1]) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1])); - } - } - } - if (r->group_attrs) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships)); - for (cntr_group_attrs_1 = 0; cntr_group_attrs_1 < r->num_memberships; cntr_group_attrs_1++) { - NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->group_attrs[cntr_group_attrs_1])); - } - } - if (r->sids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); - for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids[cntr_sids_1])); - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { - if (r->sids[cntr_sids_1]) { - NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_1])); - } - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMembershipsCtr1 *r) -{ - uint32_t _ptr_info_array; - uint32_t cntr_info_array_1; - TALLOC_CTX *_mem_save_info_array_0; - TALLOC_CTX *_mem_save_info_array_1; - TALLOC_CTX *_mem_save_info_array_2; - uint32_t _ptr_group_attrs; - uint32_t cntr_group_attrs_1; - TALLOC_CTX *_mem_save_group_attrs_0; - TALLOC_CTX *_mem_save_group_attrs_1; - uint32_t _ptr_sids; - uint32_t cntr_sids_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_sids_1; - TALLOC_CTX *_mem_save_sids_2; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_memberships)); - if (r->num_memberships < 0 || r->num_memberships > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids)); - if (r->num_sids < 0 || r->num_sids > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array)); - if (_ptr_info_array) { - NDR_PULL_ALLOC(ndr, r->info_array); - } else { - r->info_array = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_attrs)); - if (_ptr_group_attrs) { - NDR_PULL_ALLOC(ndr, r->group_attrs); - } else { - r->group_attrs = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); - if (_ptr_sids) { - NDR_PULL_ALLOC(ndr, r->sids); - } else { - r->sids = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info_array) { - _mem_save_info_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->info_array)); - NDR_PULL_ALLOC_N(ndr, r->info_array, ndr_get_array_size(ndr, &r->info_array)); - _mem_save_info_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0); - for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array)); - if (_ptr_info_array) { - NDR_PULL_ALLOC(ndr, r->info_array[cntr_info_array_1]); - } else { - r->info_array[cntr_info_array_1] = NULL; - } - } - for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) { - if (r->info_array[cntr_info_array_1]) { - _mem_save_info_array_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info_array[cntr_info_array_1], 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1])); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_2, 0); - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_0, 0); - } - if (r->group_attrs) { - _mem_save_group_attrs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->group_attrs, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->group_attrs)); - NDR_PULL_ALLOC_N(ndr, r->group_attrs, ndr_get_array_size(ndr, &r->group_attrs)); - _mem_save_group_attrs_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->group_attrs, 0); - for (cntr_group_attrs_1 = 0; cntr_group_attrs_1 < r->num_memberships; cntr_group_attrs_1++) { - NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->group_attrs[cntr_group_attrs_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_attrs_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_attrs_0, 0); - } - if (r->sids) { - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); - NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); - _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); - if (_ptr_sids) { - NDR_PULL_ALLOC(ndr, r->sids[cntr_sids_1]); - } else { - r->sids[cntr_sids_1] = NULL; - } - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { - if (r->sids[cntr_sids_1]) { - _mem_save_sids_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids[cntr_sids_1], 0); - NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_1])); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_2, 0); - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); - } - if (r->info_array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info_array, r->num_memberships)); - } - if (r->group_attrs) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->group_attrs, r->num_memberships)); - } - if (r->sids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsCtr1 *r) -{ - uint32_t cntr_info_array_1; - uint32_t cntr_group_attrs_1; - uint32_t cntr_sids_1; - ndr_print_struct(ndr, name, "drsuapi_DsGetMembershipsCtr1"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "status", r->status); - ndr_print_uint32(ndr, "num_memberships", r->num_memberships); - ndr_print_uint32(ndr, "num_sids", r->num_sids); - ndr_print_ptr(ndr, "info_array", r->info_array); - ndr->depth++; - if (r->info_array) { - ndr->print(ndr, "%s: ARRAY(%d)", "info_array", (int)r->num_memberships); - ndr->depth++; - for (cntr_info_array_1=0;cntr_info_array_1num_memberships;cntr_info_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_array_1) != -1) { - ndr_print_ptr(ndr, "info_array", r->info_array[cntr_info_array_1]); - ndr->depth++; - if (r->info_array[cntr_info_array_1]) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "info_array", r->info_array[cntr_info_array_1]); - } - ndr->depth--; - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_ptr(ndr, "group_attrs", r->group_attrs); - ndr->depth++; - if (r->group_attrs) { - ndr->print(ndr, "%s: ARRAY(%d)", "group_attrs", (int)r->num_memberships); - ndr->depth++; - for (cntr_group_attrs_1=0;cntr_group_attrs_1num_memberships;cntr_group_attrs_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_group_attrs_1) != -1) { - ndr_print_samr_GroupAttrs(ndr, "group_attrs", r->group_attrs[cntr_group_attrs_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->sids); - ndr->depth++; - if (r->sids) { - ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids); - ndr->depth++; - for (cntr_sids_1=0;cntr_sids_1num_sids;cntr_sids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { - ndr_print_ptr(ndr, "sids", r->sids[cntr_sids_1]); - ndr->depth++; - if (r->sids[cntr_sids_1]) { - ndr_print_dom_sid28(ndr, "sids", r->sids[cntr_sids_1]); - } - ndr->depth--; - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMembershipsCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMembershipsCtr *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetMembershipsCtr"); - switch (level) { - case 1: - ndr_print_drsuapi_DsGetMembershipsCtr1(ndr, "ctr1", &r->ctr1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMembershipsRequest1 *r) -{ - uint32_t cntr_info_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_drsuapi_DsMembershipType(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info_array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array[cntr_info_array_1])); - } - for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) { - if (r->info_array[cntr_info_array_1]) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1])); - } - } - } - if (r->domain) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMembershipsRequest1 *r) -{ - uint32_t _ptr_info_array; - uint32_t cntr_info_array_1; - TALLOC_CTX *_mem_save_info_array_0; - TALLOC_CTX *_mem_save_info_array_1; - TALLOC_CTX *_mem_save_info_array_2; - uint32_t _ptr_domain; - TALLOC_CTX *_mem_save_domain_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 1 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array)); - if (_ptr_info_array) { - NDR_PULL_ALLOC(ndr, r->info_array); - } else { - r->info_array = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_drsuapi_DsMembershipType(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info_array) { - _mem_save_info_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->info_array)); - NDR_PULL_ALLOC_N(ndr, r->info_array, ndr_get_array_size(ndr, &r->info_array)); - _mem_save_info_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0); - for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array)); - if (_ptr_info_array) { - NDR_PULL_ALLOC(ndr, r->info_array[cntr_info_array_1]); - } else { - r->info_array[cntr_info_array_1] = NULL; - } - } - for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) { - if (r->info_array[cntr_info_array_1]) { - _mem_save_info_array_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info_array[cntr_info_array_1], 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1])); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_2, 0); - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_0, 0); - } - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - if (r->info_array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info_array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsRequest1 *r) -{ - uint32_t cntr_info_array_1; - ndr_print_struct(ndr, name, "drsuapi_DsGetMembershipsRequest1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "info_array", r->info_array); - ndr->depth++; - if (r->info_array) { - ndr->print(ndr, "%s: ARRAY(%d)", "info_array", (int)r->count); - ndr->depth++; - for (cntr_info_array_1=0;cntr_info_array_1count;cntr_info_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_array_1) != -1) { - ndr_print_ptr(ndr, "info_array", r->info_array[cntr_info_array_1]); - ndr->depth++; - if (r->info_array[cntr_info_array_1]) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "info_array", r->info_array[cntr_info_array_1]); - } - ndr->depth--; - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->flags); - ndr_print_drsuapi_DsMembershipType(ndr, "type", r->type); - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "domain", r->domain); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMembershipsRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMembershipsRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetMembershipsRequest"); - switch (level) { - case 1: - ndr_print_drsuapi_DsGetMembershipsRequest1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNT4ChangeLogRequest1 *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - if (r->length < 0 || r->length > 0x00A00000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLogRequest1"); - ndr->depth++; - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr_print_uint32(ndr, "length", r->length); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->length); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNT4ChangeLogRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNT4ChangeLogRequest *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetNT4ChangeLogRequest"); - switch (level) { - case 1: - ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length2)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time2)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown3)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time4)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time6)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data1)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data2)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data1) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length1)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data1, r->length1)); - } - if (r->data2) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length2)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data2, r->length2)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNT4ChangeLogInfo1 *r) -{ - uint32_t _ptr_data1; - TALLOC_CTX *_mem_save_data1_0; - uint32_t _ptr_data2; - TALLOC_CTX *_mem_save_data2_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length1)); - if (r->length1 < 0 || r->length1 > 0x00A00000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length2)); - if (r->length2 < 0 || r->length2 > 0x00A00000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time2)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time4)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time6)); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data1)); - if (_ptr_data1) { - NDR_PULL_ALLOC(ndr, r->data1); - } else { - r->data1 = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data2)); - if (_ptr_data2) { - NDR_PULL_ALLOC(ndr, r->data2); - } else { - r->data2 = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data1) { - _mem_save_data1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data1, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data1)); - NDR_PULL_ALLOC_N(ndr, r->data1, ndr_get_array_size(ndr, &r->data1)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data1, ndr_get_array_size(ndr, &r->data1))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data1_0, 0); - } - if (r->data2) { - _mem_save_data2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data2, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data2)); - NDR_PULL_ALLOC_N(ndr, r->data2, ndr_get_array_size(ndr, &r->data2)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data2, ndr_get_array_size(ndr, &r->data2))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data2_0, 0); - } - if (r->data1) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data1, r->length1)); - } - if (r->data2) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data2, r->length2)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLogInfo1"); - ndr->depth++; - ndr_print_uint32(ndr, "length1", r->length1); - ndr_print_uint32(ndr, "length2", r->length2); - ndr_print_hyper(ndr, "unknown1", r->unknown1); - ndr_print_NTTIME(ndr, "time2", r->time2); - ndr_print_hyper(ndr, "unknown3", r->unknown3); - ndr_print_NTTIME(ndr, "time4", r->time4); - ndr_print_hyper(ndr, "unknown5", r->unknown5); - ndr_print_NTTIME(ndr, "time6", r->time6); - ndr_print_NTSTATUS(ndr, "status", r->status); - ndr_print_ptr(ndr, "data1", r->data1); - ndr->depth++; - if (r->data1) { - ndr_print_array_uint8(ndr, "data1", r->data1, r->length1); - } - ndr->depth--; - ndr_print_ptr(ndr, "data2", r->data2); - ndr->depth++; - if (r->data2) { - ndr_print_array_uint8(ndr, "data2", r->data2, r->length2); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNT4ChangeLogInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_BUFFERS, &r->info1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNT4ChangeLogInfo *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_BUFFERS, &r->info1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetNT4ChangeLogInfo"); - switch (level) { - case 1: - ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(ndr, "info1", &r->info1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsNameStatus(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameStatus r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsNameStatus(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameStatus *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsNameStatus(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameStatus r) -{ - const char *val = NULL; - - switch (r) { - case DRSUAPI_DS_NAME_STATUS_OK: val = "DRSUAPI_DS_NAME_STATUS_OK"; break; - case DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR: val = "DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR"; break; - case DRSUAPI_DS_NAME_STATUS_NOT_FOUND: val = "DRSUAPI_DS_NAME_STATUS_NOT_FOUND"; break; - case DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE: val = "DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE"; break; - case DRSUAPI_DS_NAME_STATUS_NO_MAPPING: val = "DRSUAPI_DS_NAME_STATUS_NO_MAPPING"; break; - case DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY: val = "DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY"; break; - case DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING: val = "DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING"; break; - case DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL: val = "DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_drsuapi_DsNameFlags(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameFlags r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsNameFlags(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameFlags *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsNameFlags(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFlags r) -{ - const char *val = NULL; - - switch (r) { - case DRSUAPI_DS_NAME_FLAG_NO_FLAGS: val = "DRSUAPI_DS_NAME_FLAG_NO_FLAGS"; break; - case DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY: val = "DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY"; break; - case DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC: val = "DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC"; break; - case DRSUAPI_DS_NAME_FLAG_GCVERIFY: val = "DRSUAPI_DS_NAME_FLAG_GCVERIFY"; break; - case DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL: val = "DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_drsuapi_DsNameFormat(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameFormat r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsNameFormat(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameFormat *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsNameFormat(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFormat r) -{ - const char *val = NULL; - - switch (r) { - case DRSUAPI_DS_NAME_FORMAT_UNKNOWN: val = "DRSUAPI_DS_NAME_FORMAT_UNKNOWN"; break; - case DRSUAPI_DS_NAME_FORMAT_FQDN_1779: val = "DRSUAPI_DS_NAME_FORMAT_FQDN_1779"; break; - case DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT: val = "DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT"; break; - case DRSUAPI_DS_NAME_FORMAT_DISPLAY: val = "DRSUAPI_DS_NAME_FORMAT_DISPLAY"; break; - case DRSUAPI_DS_NAME_FORMAT_GUID: val = "DRSUAPI_DS_NAME_FORMAT_GUID"; break; - case DRSUAPI_DS_NAME_FORMAT_CANONICAL: val = "DRSUAPI_DS_NAME_FORMAT_CANONICAL"; break; - case DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL: val = "DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL"; break; - case DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX: val = "DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX"; break; - case DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL: val = "DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL"; break; - case DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY: val = "DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY"; break; - case DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN: val = "DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_drsuapi_DsNameString(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameString *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->str)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->str) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->str, ndr_charset_length(r->str, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsNameString(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameString *r) -{ - uint32_t _ptr_str; - TALLOC_CTX *_mem_save_str_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_str)); - if (_ptr_str) { - NDR_PULL_ALLOC(ndr, r->str); - } else { - r->str = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->str) { - _mem_save_str_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->str, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->str)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->str)); - if (ndr_get_array_length(ndr, &r->str) > ndr_get_array_size(ndr, &r->str)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->str), ndr_get_array_length(ndr, &r->str)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->str), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->str, ndr_get_array_length(ndr, &r->str), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_str_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsNameString(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameString *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsNameString"); - ndr->depth++; - ndr_print_ptr(ndr, "str", r->str); - ndr->depth++; - if (r->str) { - ndr_print_string(ndr, "str", r->str); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsNameRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameRequest1 *r) -{ - uint32_t cntr_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->codepage)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->language)); - NDR_CHECK(ndr_push_drsuapi_DsNameFlags(ndr, NDR_SCALARS, r->format_flags)); - NDR_CHECK(ndr_push_drsuapi_DsNameFormat(ndr, NDR_SCALARS, r->format_offered)); - NDR_CHECK(ndr_push_drsuapi_DsNameFormat(ndr, NDR_SCALARS, r->format_desired)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsNameRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameRequest1 *r) -{ - uint32_t _ptr_names; - uint32_t cntr_names_1; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->codepage)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->language)); - NDR_CHECK(ndr_pull_drsuapi_DsNameFlags(ndr, NDR_SCALARS, &r->format_flags)); - NDR_CHECK(ndr_pull_drsuapi_DsNameFormat(ndr, NDR_SCALARS, &r->format_offered)); - NDR_CHECK(ndr_pull_drsuapi_DsNameFormat(ndr, NDR_SCALARS, &r->format_desired)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 1 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); - if (_ptr_names) { - NDR_PULL_ALLOC(ndr, r->names); - } else { - r->names = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); - NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); - _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - } - if (r->names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsNameRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameRequest1 *r) -{ - uint32_t cntr_names_1; - ndr_print_struct(ndr, name, "drsuapi_DsNameRequest1"); - ndr->depth++; - ndr_print_uint32(ndr, "codepage", r->codepage); - ndr_print_uint32(ndr, "language", r->language); - ndr_print_drsuapi_DsNameFlags(ndr, "format_flags", r->format_flags); - ndr_print_drsuapi_DsNameFormat(ndr, "format_offered", r->format_offered); - ndr_print_drsuapi_DsNameFormat(ndr, "format_desired", r->format_desired); - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "names", r->names); - ndr->depth++; - if (r->names) { - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); - ndr->depth++; - for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { - ndr_print_drsuapi_DsNameString(ndr, "names", &r->names[cntr_names_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsNameRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsNameRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsNameRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsNameRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsNameRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsNameRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsNameRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsNameRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsNameRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsNameRequest"); - switch (level) { - case 1: - ndr_print_drsuapi_DsNameRequest1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsNameInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_DsNameStatus(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_domain_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->result_name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dns_domain_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_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->dns_domain_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_domain_name, ndr_charset_length(r->dns_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->result_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->result_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->result_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->result_name, ndr_charset_length(r->result_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsNameInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameInfo1 *r) -{ - uint32_t _ptr_dns_domain_name; - TALLOC_CTX *_mem_save_dns_domain_name_0; - uint32_t _ptr_result_name; - TALLOC_CTX *_mem_save_result_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_DsNameStatus(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_domain_name)); - if (_ptr_dns_domain_name) { - NDR_PULL_ALLOC(ndr, r->dns_domain_name); - } else { - r->dns_domain_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_result_name)); - if (_ptr_result_name) { - NDR_PULL_ALLOC(ndr, r->result_name); - } else { - r->result_name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dns_domain_name) { - _mem_save_dns_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dns_domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_domain_name)); - if (ndr_get_array_length(ndr, &r->dns_domain_name) > ndr_get_array_size(ndr, &r->dns_domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_domain_name), ndr_get_array_length(ndr, &r->dns_domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_domain_name, ndr_get_array_length(ndr, &r->dns_domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_domain_name_0, 0); - } - if (r->result_name) { - _mem_save_result_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->result_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->result_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->result_name)); - if (ndr_get_array_length(ndr, &r->result_name) > ndr_get_array_size(ndr, &r->result_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->result_name), ndr_get_array_length(ndr, &r->result_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->result_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->result_name, ndr_get_array_length(ndr, &r->result_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_result_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsNameInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameInfo1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsNameInfo1"); - ndr->depth++; - ndr_print_drsuapi_DsNameStatus(ndr, "status", r->status); - ndr_print_ptr(ndr, "dns_domain_name", r->dns_domain_name); - ndr->depth++; - if (r->dns_domain_name) { - ndr_print_string(ndr, "dns_domain_name", r->dns_domain_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "result_name", r->result_name); - ndr->depth++; - if (r->result_name) { - ndr_print_string(ndr, "result_name", r->result_name); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsNameCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameCtr1 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsNameInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsNameInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsNameCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameCtr1 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsNameInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsNameInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsNameCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameCtr1 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "drsuapi_DsNameCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_drsuapi_DsNameInfo1(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsNameCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsNameCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - if (r->ctr1) { - NDR_CHECK(ndr_push_drsuapi_DsNameCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsNameCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsNameCtr *r) -{ - int level; - int32_t _level; - TALLOC_CTX *_mem_save_ctr1_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - uint32_t _ptr_ctr1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); - if (_ptr_ctr1) { - NDR_PULL_ALLOC(ndr, r->ctr1); - } else { - r->ctr1 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - if (r->ctr1) { - _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); - NDR_CHECK(ndr_pull_drsuapi_DsNameCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsNameCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsNameCtr"); - switch (level) { - case 1: - ndr_print_ptr(ndr, "ctr1", r->ctr1); - ndr->depth++; - if (r->ctr1) { - ndr_print_drsuapi_DsNameCtr1(ndr, "ctr1", r->ctr1); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsSpnOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsSpnOperation r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsSpnOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsSpnOperation *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsSpnOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsSpnOperation r) -{ - const char *val = NULL; - - switch (r) { - case DRSUAPI_DS_SPN_OPERATION_ADD: val = "DRSUAPI_DS_SPN_OPERATION_ADD"; break; - case DRSUAPI_DS_SPN_OPERATION_REPLACE: val = "DRSUAPI_DS_SPN_OPERATION_REPLACE"; break; - case DRSUAPI_DS_SPN_OPERATION_DELETE: val = "DRSUAPI_DS_SPN_OPERATION_DELETE"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsWriteAccountSpnRequest1 *r) -{ - uint32_t cntr_spn_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_DsSpnOperation(ndr, NDR_SCALARS, r->operation)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->spn_names)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->object_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->spn_names) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) { - NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->spn_names[cntr_spn_names_1])); - } - for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) { - NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->spn_names[cntr_spn_names_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsWriteAccountSpnRequest1 *r) -{ - uint32_t _ptr_object_dn; - TALLOC_CTX *_mem_save_object_dn_0; - uint32_t _ptr_spn_names; - uint32_t cntr_spn_names_1; - TALLOC_CTX *_mem_save_spn_names_0; - TALLOC_CTX *_mem_save_spn_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_DsSpnOperation(ndr, NDR_SCALARS, &r->operation)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); - if (_ptr_object_dn) { - NDR_PULL_ALLOC(ndr, r->object_dn); - } else { - r->object_dn = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_spn_names)); - if (_ptr_spn_names) { - NDR_PULL_ALLOC(ndr, r->spn_names); - } else { - r->spn_names = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->object_dn) { - _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); - if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); - } - if (r->spn_names) { - _mem_save_spn_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->spn_names, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->spn_names)); - NDR_PULL_ALLOC_N(ndr, r->spn_names, ndr_get_array_size(ndr, &r->spn_names)); - _mem_save_spn_names_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->spn_names, 0); - for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->spn_names[cntr_spn_names_1])); - } - for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->spn_names[cntr_spn_names_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_spn_names_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_spn_names_0, 0); - } - if (r->spn_names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->spn_names, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnRequest1 *r) -{ - uint32_t cntr_spn_names_1; - ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpnRequest1"); - ndr->depth++; - ndr_print_drsuapi_DsSpnOperation(ndr, "operation", r->operation); - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_ptr(ndr, "object_dn", r->object_dn); - ndr->depth++; - if (r->object_dn) { - ndr_print_string(ndr, "object_dn", r->object_dn); - } - ndr->depth--; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "spn_names", r->spn_names); - ndr->depth++; - if (r->spn_names) { - ndr->print(ndr, "%s: ARRAY(%d)", "spn_names", (int)r->count); - ndr->depth++; - for (cntr_spn_names_1=0;cntr_spn_names_1count;cntr_spn_names_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_spn_names_1) != -1) { - ndr_print_drsuapi_DsNameString(ndr, "spn_names", &r->spn_names[cntr_spn_names_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsWriteAccountSpnRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsWriteAccountSpnRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsWriteAccountSpnRequest"); - switch (level) { - case 1: - ndr_print_drsuapi_DsWriteAccountSpnRequest1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnResult1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsWriteAccountSpnResult1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnResult1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsWriteAccountSpnResult1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnResult1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpnResult1"); - ndr->depth++; - ndr_print_WERROR(ndr, "status", r->status); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnResult(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsWriteAccountSpnResult *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnResult1(ndr, NDR_SCALARS, &r->res1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnResult(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsWriteAccountSpnResult *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnResult1(ndr, NDR_SCALARS, &r->res1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnResult *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsWriteAccountSpnResult"); - switch (level) { - case 1: - ndr_print_drsuapi_DsWriteAccountSpnResult1(ndr, "res1", &r->res1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsRemoveDSServerRequest1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_dn)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->commit)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_dn, ndr_charset_length(r->domain_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsRemoveDSServerRequest1 *r) -{ - uint32_t _ptr_server_dn; - TALLOC_CTX *_mem_save_server_dn_0; - uint32_t _ptr_domain_dn; - TALLOC_CTX *_mem_save_domain_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn)); - if (_ptr_server_dn) { - NDR_PULL_ALLOC(ndr, r->server_dn); - } else { - r->server_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_dn)); - if (_ptr_domain_dn) { - NDR_PULL_ALLOC(ndr, r->domain_dn); - } else { - r->domain_dn = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->commit)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_dn) { - _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn)); - if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0); - } - if (r->domain_dn) { - _mem_save_domain_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_dn)); - if (ndr_get_array_length(ndr, &r->domain_dn) > ndr_get_array_size(ndr, &r->domain_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_dn), ndr_get_array_length(ndr, &r->domain_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_dn, ndr_get_array_length(ndr, &r->domain_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerRequest1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServerRequest1"); - ndr->depth++; - ndr_print_ptr(ndr, "server_dn", r->server_dn); - ndr->depth++; - if (r->server_dn) { - ndr_print_string(ndr, "server_dn", r->server_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_dn", r->domain_dn); - ndr->depth++; - if (r->domain_dn) { - ndr_print_string(ndr, "domain_dn", r->domain_dn); - } - ndr->depth--; - ndr_print_uint32(ndr, "commit", r->commit); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRemoveDSServerRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRemoveDSServerRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsRemoveDSServerRequest"); - switch (level) { - case 1: - ndr_print_drsuapi_DsRemoveDSServerRequest1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerResult1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsRemoveDSServerResult1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->last_dc_in_domain)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerResult1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsRemoveDSServerResult1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->last_dc_in_domain)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerResult1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServerResult1"); - ndr->depth++; - ndr_print_uint32(ndr, "last_dc_in_domain", r->last_dc_in_domain); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerResult(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRemoveDSServerResult *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerResult1(ndr, NDR_SCALARS, &r->res1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerResult(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRemoveDSServerResult *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerResult1(ndr, NDR_SCALARS, &r->res1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerResult *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsRemoveDSServerResult"); - switch (level) { - case 1: - ndr_print_drsuapi_DsRemoveDSServerResult1(ndr, "res1", &r->res1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoRequest1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->level)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoRequest1 *r) -{ - uint32_t _ptr_domain_name; - TALLOC_CTX *_mem_save_domain_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->domain_name); - } else { - r->domain_name = NULL; - } - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->level)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); - if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoRequest1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoRequest1"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_name", r->domain_name); - ndr->depth++; - if (r->domain_name) { - ndr_print_string(ndr, "domain_name", r->domain_name); - } - ndr->depth--; - ndr_print_int32(ndr, "level", r->level); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetDCInfoRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetDCInfoRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetDCInfoRequest"); - switch (level) { - case 1: - ndr_print_drsuapi_DsGetDCInfoRequest1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->dns_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->site_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->computer_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->server_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo1 *r) -{ - uint32_t _ptr_netbios_name; - TALLOC_CTX *_mem_save_netbios_name_0; - uint32_t _ptr_dns_name; - TALLOC_CTX *_mem_save_dns_name_0; - uint32_t _ptr_site_name; - TALLOC_CTX *_mem_save_site_name_0; - uint32_t _ptr_computer_dn; - TALLOC_CTX *_mem_save_computer_dn_0; - uint32_t _ptr_server_dn; - TALLOC_CTX *_mem_save_server_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name)); - if (_ptr_netbios_name) { - NDR_PULL_ALLOC(ndr, r->netbios_name); - } else { - r->netbios_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name)); - if (_ptr_dns_name) { - NDR_PULL_ALLOC(ndr, r->dns_name); - } else { - r->dns_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); - if (_ptr_site_name) { - NDR_PULL_ALLOC(ndr, r->site_name); - } else { - r->site_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn)); - if (_ptr_computer_dn) { - NDR_PULL_ALLOC(ndr, r->computer_dn); - } else { - r->computer_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn)); - if (_ptr_server_dn) { - NDR_PULL_ALLOC(ndr, r->server_dn); - } else { - r->server_dn = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_name) { - _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name)); - if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0); - } - if (r->dns_name) { - _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name)); - if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0); - } - if (r->site_name) { - _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name)); - if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_name), ndr_get_array_length(ndr, &r->site_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); - } - if (r->computer_dn) { - _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn)); - if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer_dn), ndr_get_array_length(ndr, &r->computer_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0); - } - if (r->server_dn) { - _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn)); - if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo1"); - ndr->depth++; - ndr_print_ptr(ndr, "netbios_name", r->netbios_name); - ndr->depth++; - if (r->netbios_name) { - ndr_print_string(ndr, "netbios_name", r->netbios_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "dns_name", r->dns_name); - ndr->depth++; - if (r->dns_name) { - ndr_print_string(ndr, "dns_name", r->dns_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "site_name", r->site_name); - ndr->depth++; - if (r->site_name) { - ndr_print_string(ndr, "site_name", r->site_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "computer_dn", r->computer_dn); - ndr->depth++; - if (r->computer_dn) { - ndr_print_string(ndr, "computer_dn", r->computer_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "server_dn", r->server_dn); - ndr->depth++; - if (r->server_dn) { - ndr_print_string(ndr, "server_dn", r->server_dn); - } - ndr->depth--; - ndr_print_uint32(ndr, "is_pdc", r->is_pdc); - ndr_print_uint32(ndr, "is_enabled", r->is_enabled); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr1 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr1 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr1 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_drsuapi_DsGetDCInfo1(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ntds_dn)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_gc)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->computer_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->server_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->ntds_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->dns_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->site_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->site_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_dn, ndr_charset_length(r->site_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->computer_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->server_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->ntds_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ntds_dn, ndr_charset_length(r->ntds_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo2 *r) -{ - uint32_t _ptr_netbios_name; - TALLOC_CTX *_mem_save_netbios_name_0; - uint32_t _ptr_dns_name; - TALLOC_CTX *_mem_save_dns_name_0; - uint32_t _ptr_site_name; - TALLOC_CTX *_mem_save_site_name_0; - uint32_t _ptr_site_dn; - TALLOC_CTX *_mem_save_site_dn_0; - uint32_t _ptr_computer_dn; - TALLOC_CTX *_mem_save_computer_dn_0; - uint32_t _ptr_server_dn; - TALLOC_CTX *_mem_save_server_dn_0; - uint32_t _ptr_ntds_dn; - TALLOC_CTX *_mem_save_ntds_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name)); - if (_ptr_netbios_name) { - NDR_PULL_ALLOC(ndr, r->netbios_name); - } else { - r->netbios_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name)); - if (_ptr_dns_name) { - NDR_PULL_ALLOC(ndr, r->dns_name); - } else { - r->dns_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); - if (_ptr_site_name) { - NDR_PULL_ALLOC(ndr, r->site_name); - } else { - r->site_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_dn)); - if (_ptr_site_dn) { - NDR_PULL_ALLOC(ndr, r->site_dn); - } else { - r->site_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn)); - if (_ptr_computer_dn) { - NDR_PULL_ALLOC(ndr, r->computer_dn); - } else { - r->computer_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn)); - if (_ptr_server_dn) { - NDR_PULL_ALLOC(ndr, r->server_dn); - } else { - r->server_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ntds_dn)); - if (_ptr_ntds_dn) { - NDR_PULL_ALLOC(ndr, r->ntds_dn); - } else { - r->ntds_dn = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_gc)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->computer_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->server_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->ntds_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_name) { - _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name)); - if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0); - } - if (r->dns_name) { - _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name)); - if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0); - } - if (r->site_name) { - _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name)); - if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_name), ndr_get_array_length(ndr, &r->site_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); - } - if (r->site_dn) { - _mem_save_site_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->site_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->site_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->site_dn)); - if (ndr_get_array_length(ndr, &r->site_dn) > ndr_get_array_size(ndr, &r->site_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_dn), ndr_get_array_length(ndr, &r->site_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_dn, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_dn_0, 0); - } - if (r->computer_dn) { - _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn)); - if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer_dn), ndr_get_array_length(ndr, &r->computer_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0); - } - if (r->server_dn) { - _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn)); - if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0); - } - if (r->ntds_dn) { - _mem_save_ntds_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ntds_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->ntds_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->ntds_dn)); - if (ndr_get_array_length(ndr, &r->ntds_dn) > ndr_get_array_size(ndr, &r->ntds_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->ntds_dn), ndr_get_array_length(ndr, &r->ntds_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ntds_dn, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ntds_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo2 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "netbios_name", r->netbios_name); - ndr->depth++; - if (r->netbios_name) { - ndr_print_string(ndr, "netbios_name", r->netbios_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "dns_name", r->dns_name); - ndr->depth++; - if (r->dns_name) { - ndr_print_string(ndr, "dns_name", r->dns_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "site_name", r->site_name); - ndr->depth++; - if (r->site_name) { - ndr_print_string(ndr, "site_name", r->site_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "site_dn", r->site_dn); - ndr->depth++; - if (r->site_dn) { - ndr_print_string(ndr, "site_dn", r->site_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "computer_dn", r->computer_dn); - ndr->depth++; - if (r->computer_dn) { - ndr_print_string(ndr, "computer_dn", r->computer_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "server_dn", r->server_dn); - ndr->depth++; - if (r->server_dn) { - ndr_print_string(ndr, "server_dn", r->server_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "ntds_dn", r->ntds_dn); - ndr->depth++; - if (r->ntds_dn) { - ndr_print_string(ndr, "ntds_dn", r->ntds_dn); - } - ndr->depth--; - ndr_print_uint32(ndr, "is_pdc", r->is_pdc); - ndr_print_uint32(ndr, "is_enabled", r->is_enabled); - ndr_print_uint32(ndr, "is_gc", r->is_gc); - ndr_print_GUID(ndr, "site_guid", &r->site_guid); - ndr_print_GUID(ndr, "computer_guid", &r->computer_guid); - ndr_print_GUID(ndr, "server_guid", &r->server_guid); - ndr_print_GUID(ndr, "ntds_guid", &r->ntds_guid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr2 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr2 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr2 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_drsuapi_DsGetDCInfo2(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ntds_dn)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_gc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_rodc)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->computer_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->server_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->ntds_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->dns_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->site_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->site_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_dn, ndr_charset_length(r->site_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->computer_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->server_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->ntds_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ntds_dn, ndr_charset_length(r->ntds_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo3 *r) -{ - uint32_t _ptr_netbios_name; - TALLOC_CTX *_mem_save_netbios_name_0; - uint32_t _ptr_dns_name; - TALLOC_CTX *_mem_save_dns_name_0; - uint32_t _ptr_site_name; - TALLOC_CTX *_mem_save_site_name_0; - uint32_t _ptr_site_dn; - TALLOC_CTX *_mem_save_site_dn_0; - uint32_t _ptr_computer_dn; - TALLOC_CTX *_mem_save_computer_dn_0; - uint32_t _ptr_server_dn; - TALLOC_CTX *_mem_save_server_dn_0; - uint32_t _ptr_ntds_dn; - TALLOC_CTX *_mem_save_ntds_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name)); - if (_ptr_netbios_name) { - NDR_PULL_ALLOC(ndr, r->netbios_name); - } else { - r->netbios_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name)); - if (_ptr_dns_name) { - NDR_PULL_ALLOC(ndr, r->dns_name); - } else { - r->dns_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); - if (_ptr_site_name) { - NDR_PULL_ALLOC(ndr, r->site_name); - } else { - r->site_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_dn)); - if (_ptr_site_dn) { - NDR_PULL_ALLOC(ndr, r->site_dn); - } else { - r->site_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn)); - if (_ptr_computer_dn) { - NDR_PULL_ALLOC(ndr, r->computer_dn); - } else { - r->computer_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn)); - if (_ptr_server_dn) { - NDR_PULL_ALLOC(ndr, r->server_dn); - } else { - r->server_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ntds_dn)); - if (_ptr_ntds_dn) { - NDR_PULL_ALLOC(ndr, r->ntds_dn); - } else { - r->ntds_dn = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_gc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_rodc)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->computer_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->server_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->ntds_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_name) { - _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name)); - if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0); - } - if (r->dns_name) { - _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name)); - if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0); - } - if (r->site_name) { - _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name)); - if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_name), ndr_get_array_length(ndr, &r->site_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); - } - if (r->site_dn) { - _mem_save_site_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->site_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->site_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->site_dn)); - if (ndr_get_array_length(ndr, &r->site_dn) > ndr_get_array_size(ndr, &r->site_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_dn), ndr_get_array_length(ndr, &r->site_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_dn, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_dn_0, 0); - } - if (r->computer_dn) { - _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn)); - if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer_dn), ndr_get_array_length(ndr, &r->computer_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0); - } - if (r->server_dn) { - _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn)); - if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_dn), ndr_get_array_length(ndr, &r->server_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0); - } - if (r->ntds_dn) { - _mem_save_ntds_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ntds_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->ntds_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->ntds_dn)); - if (ndr_get_array_length(ndr, &r->ntds_dn) > ndr_get_array_size(ndr, &r->ntds_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->ntds_dn), ndr_get_array_length(ndr, &r->ntds_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ntds_dn, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ntds_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo3 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo3"); - ndr->depth++; - ndr_print_ptr(ndr, "netbios_name", r->netbios_name); - ndr->depth++; - if (r->netbios_name) { - ndr_print_string(ndr, "netbios_name", r->netbios_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "dns_name", r->dns_name); - ndr->depth++; - if (r->dns_name) { - ndr_print_string(ndr, "dns_name", r->dns_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "site_name", r->site_name); - ndr->depth++; - if (r->site_name) { - ndr_print_string(ndr, "site_name", r->site_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "site_dn", r->site_dn); - ndr->depth++; - if (r->site_dn) { - ndr_print_string(ndr, "site_dn", r->site_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "computer_dn", r->computer_dn); - ndr->depth++; - if (r->computer_dn) { - ndr_print_string(ndr, "computer_dn", r->computer_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "server_dn", r->server_dn); - ndr->depth++; - if (r->server_dn) { - ndr_print_string(ndr, "server_dn", r->server_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "ntds_dn", r->ntds_dn); - ndr->depth++; - if (r->ntds_dn) { - ndr_print_string(ndr, "ntds_dn", r->ntds_dn); - } - ndr->depth--; - ndr_print_uint32(ndr, "is_pdc", r->is_pdc); - ndr_print_uint32(ndr, "is_enabled", r->is_enabled); - ndr_print_uint32(ndr, "is_gc", r->is_gc); - ndr_print_uint32(ndr, "is_rodc", r->is_rodc); - ndr_print_GUID(ndr, "site_guid", &r->site_guid); - ndr_print_GUID(ndr, "computer_guid", &r->computer_guid); - ndr_print_GUID(ndr, "server_guid", &r->server_guid); - ndr_print_GUID(ndr, "ntds_guid", &r->ntds_guid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr3 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr3 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr3 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr3"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_drsuapi_DsGetDCInfo3(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCConnection01(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCConnection01 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_ipv4address = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->client_ip_address)); - ndr->flags = _flags_save_ipv4address; - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->connection_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_account)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client_account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_account, ndr_charset_length(r->client_account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCConnection01(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCConnection01 *r) -{ - uint32_t _ptr_client_account; - TALLOC_CTX *_mem_save_client_account_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_ipv4address = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->client_ip_address)); - ndr->flags = _flags_save_ipv4address; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->connection_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_account)); - if (_ptr_client_account) { - NDR_PULL_ALLOC(ndr, r->client_account); - } else { - r->client_account = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client_account) { - _mem_save_client_account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->client_account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->client_account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->client_account)); - if (ndr_get_array_length(ndr, &r->client_account) > ndr_get_array_size(ndr, &r->client_account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_account), ndr_get_array_length(ndr, &r->client_account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_account, ndr_get_array_length(ndr, &r->client_account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCConnection01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnection01 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetDCConnection01"); - ndr->depth++; - ndr_print_ipv4address(ndr, "client_ip_address", r->client_ip_address); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr_print_uint32(ndr, "connection_time", r->connection_time); - ndr_print_uint32(ndr, "unknown4", r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_ptr(ndr, "client_account", r->client_account); - ndr->depth++; - if (r->client_account) { - ndr_print_string(ndr, "client_account", r->client_account); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCConnectionCtr01(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCConnectionCtr01 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsGetDCConnection01(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_drsuapi_DsGetDCConnection01(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCConnectionCtr01(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCConnectionCtr01 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnection01(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnection01(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCConnectionCtr01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnectionCtr01 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "drsuapi_DsGetDCConnectionCtr01"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_drsuapi_DsGetDCConnection01(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetDCInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case DRSUAPI_DC_INFO_CTR_1: { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - case DRSUAPI_DC_INFO_CTR_2: { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr2(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - case DRSUAPI_DC_INFO_CTR_3: { - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr3(ndr, NDR_SCALARS, &r->ctr3)); - break; } - - case DRSUAPI_DC_CONNECTION_CTR_01: { - NDR_CHECK(ndr_push_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_SCALARS, &r->ctr01)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case DRSUAPI_DC_INFO_CTR_1: - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - case DRSUAPI_DC_INFO_CTR_2: - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr2(ndr, NDR_BUFFERS, &r->ctr2)); - break; - - case DRSUAPI_DC_INFO_CTR_3: - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr3(ndr, NDR_BUFFERS, &r->ctr3)); - break; - - case DRSUAPI_DC_CONNECTION_CTR_01: - NDR_CHECK(ndr_push_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_BUFFERS, &r->ctr01)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetDCInfoCtr *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case DRSUAPI_DC_INFO_CTR_1: { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - case DRSUAPI_DC_INFO_CTR_2: { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr2(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - case DRSUAPI_DC_INFO_CTR_3: { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr3(ndr, NDR_SCALARS, &r->ctr3)); - break; } - - case DRSUAPI_DC_CONNECTION_CTR_01: { - NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_SCALARS, &r->ctr01)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case DRSUAPI_DC_INFO_CTR_1: - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - case DRSUAPI_DC_INFO_CTR_2: - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr2(ndr, NDR_BUFFERS, &r->ctr2)); - break; - - case DRSUAPI_DC_INFO_CTR_3: - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr3(ndr, NDR_BUFFERS, &r->ctr3)); - break; - - case DRSUAPI_DC_CONNECTION_CTR_01: - NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_BUFFERS, &r->ctr01)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetDCInfoCtr"); - switch (level) { - case DRSUAPI_DC_INFO_CTR_1: - ndr_print_drsuapi_DsGetDCInfoCtr1(ndr, "ctr1", &r->ctr1); - break; - - case DRSUAPI_DC_INFO_CTR_2: - ndr_print_drsuapi_DsGetDCInfoCtr2(ndr, "ctr2", &r->ctr2); - break; - - case DRSUAPI_DC_INFO_CTR_3: - ndr_print_drsuapi_DsGetDCInfoCtr3(ndr, "ctr3", &r->ctr3); - break; - - case DRSUAPI_DC_CONNECTION_CTR_01: - ndr_print_drsuapi_DsGetDCConnectionCtr01(ndr, "ctr01", &r->ctr01); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItem(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItem *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->next_object) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object)); - } - NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItem(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItem *r) -{ - uint32_t _ptr_next_object; - TALLOC_CTX *_mem_save_next_object_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object)); - if (_ptr_next_object) { - NDR_PULL_ALLOC(ndr, r->next_object); - } else { - r->next_object = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->next_object) { - _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0); - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryRequest2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryRequest2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS, &r->first_object)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_BUFFERS, &r->first_object)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryRequest2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryRequest2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS, &r->first_object)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_BUFFERS, &r->first_object)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryRequest2 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsAddEntryRequest2"); - ndr->depth++; - ndr_print_drsuapi_DsReplicaObjectListItem(ndr, "first_object", &r->first_object); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 2: { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest2(ndr, NDR_SCALARS, &r->req2)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 2: - NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest2(ndr, NDR_BUFFERS, &r->req2)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 2: { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest2(ndr, NDR_SCALARS, &r->req2)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 2: - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest2(ndr, NDR_BUFFERS, &r->req2)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryRequest"); - switch (level) { - case 2: - ndr_print_drsuapi_DsAddEntryRequest2(ndr, "req2", &r->req2); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfoX(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorInfoX *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown3)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfoX(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorInfoX *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown3)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfoX(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfoX *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorInfoX"); - ndr->depth++; - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_WERROR(ndr, "status", r->status); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr_print_uint16(ndr, "unknown3", r->unknown3); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryExtraErrorBuffer *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->size)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryExtraErrorBuffer *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - if (r->size < 0 || r->size > 10485760) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraErrorBuffer *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsAddEntryExtraErrorBuffer"); - ndr->depth++; - ndr_print_uint32(ndr, "size", r->size); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->size); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryExtraError1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryExtraError1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error)); - NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_SCALARS, &r->buffer)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_BUFFERS, &r->buffer)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryExtraError1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryExtraError1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error)); - NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_SCALARS, &r->buffer)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_BUFFERS, &r->buffer)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryExtraError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraError1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsAddEntryExtraError1"); - ndr->depth++; - ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "error", &r->error); - ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(ndr, "buffer", &r->buffer); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorListItem1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorListItem1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->next)); - NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraError1(ndr, NDR_SCALARS, &r->error)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->next) { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS|NDR_BUFFERS, r->next)); - } - NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraError1(ndr, NDR_BUFFERS, &r->error)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorListItem1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorListItem1 *r) -{ - uint32_t _ptr_next; - TALLOC_CTX *_mem_save_next_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next)); - if (_ptr_next) { - NDR_PULL_ALLOC(ndr, r->next); - } else { - r->next = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraError1(ndr, NDR_SCALARS, &r->error)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->next) { - _mem_save_next_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->next, 0); - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS|NDR_BUFFERS, r->next)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_0, 0); - } - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraError1(ndr, NDR_BUFFERS, &r->error)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorListItem1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorListItem1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorListItem1"); - ndr->depth++; - ndr_print_ptr(ndr, "next", r->next); - ndr->depth++; - if (r->next) { - ndr_print_drsuapi_DsAddEntryErrorListItem1(ndr, "next", r->next); - } - ndr->depth--; - ndr_print_drsuapi_DsAddEntryExtraError1(ndr, "error", &r->error); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->id)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS, &r->first)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->id) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); - } - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_BUFFERS, &r->first)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorInfo1 *r) -{ - uint32_t _ptr_id; - TALLOC_CTX *_mem_save_id_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id)); - if (_ptr_id) { - NDR_PULL_ALLOC(ndr, r->id); - } else { - r->id = NULL; - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS, &r->first)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->id) { - _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->id, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0); - } - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_BUFFERS, &r->first)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfo1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorInfo1"); - ndr->depth++; - ndr_print_ptr(ndr, "id", r->id); - ndr->depth++; - if (r->id) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id); - } - ndr->depth--; - ndr_print_WERROR(ndr, "status", r->status); - ndr_print_drsuapi_DsAddEntryErrorListItem1(ndr, "first", &r->first); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryErrorInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_SCALARS, &r->error1)); - break; } - - case 4: { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); - break; } - - case 5: { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); - break; } - - case 6: { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); - break; } - - case 7: { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_BUFFERS, &r->error1)); - break; - - case 4: - break; - - case 5: - break; - - case 6: - break; - - case 7: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryErrorInfo *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_SCALARS, &r->error1)); - break; } - - case 4: { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); - break; } - - case 5: { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); - break; } - - case 6: { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); - break; } - - case 7: { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_BUFFERS, &r->error1)); - break; - - case 4: - break; - - case 5: - break; - - case 6: - break; - - case 7: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryErrorInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryErrorInfo"); - switch (level) { - case 1: - ndr_print_drsuapi_DsAddEntryErrorInfo1(ndr, "error1", &r->error1); - break; - - case 4: - ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX); - break; - - case 5: - ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX); - break; - - case 6: - ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX); - break; - - case 7: - ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryError1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryError1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, r->info, r->level)); - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryError1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryError1 *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_info_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->info); - } else { - r->info = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->info, r->level)); - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryError1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsAddEntryError1"); - ndr->depth++; - ndr_print_WERROR(ndr, "status", r->status); - ndr_print_uint32(ndr, "level", r->level); - ndr_print_ptr(ndr, "info", r->info); - ndr->depth++; - if (r->info) { - ndr_print_set_switch_value(ndr, r->info, r->level); - ndr_print_drsuapi_DsAddEntryErrorInfo(ndr, "info", r->info); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryError(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryError *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryError1(ndr, NDR_SCALARS, &r->info1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsAddEntryError1(ndr, NDR_BUFFERS, &r->info1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryError(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryError *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError1(ndr, NDR_SCALARS, &r->info1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError1(ndr, NDR_BUFFERS, &r->info1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryError(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryError *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryError"); - switch (level) { - case 1: - ndr_print_drsuapi_DsAddEntryError1(ndr, "info1", &r->info1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier2 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier2"); - ndr->depth++; - ndr_print_GUID(ndr, "guid", &r->guid); - ndr_print_dom_sid28(ndr, "sid", &r->sid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryCtr2 *r) -{ - uint32_t cntr_objects_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->id)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->objects)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->id) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); - } - if (r->objects) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1])); - } - for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryCtr2 *r) -{ - uint32_t _ptr_id; - TALLOC_CTX *_mem_save_id_0; - uint32_t _ptr_objects; - uint32_t cntr_objects_1; - TALLOC_CTX *_mem_save_objects_0; - TALLOC_CTX *_mem_save_objects_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id)); - if (_ptr_id) { - NDR_PULL_ALLOC(ndr, r->id); - } else { - r->id = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objects)); - if (_ptr_objects) { - NDR_PULL_ALLOC(ndr, r->objects); - } else { - r->objects = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->id) { - _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->id, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0); - } - if (r->objects) { - _mem_save_objects_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->objects)); - NDR_PULL_ALLOC_N(ndr, r->objects, ndr_get_array_size(ndr, &r->objects)); - _mem_save_objects_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0); - for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1])); - } - for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_0, 0); - } - if (r->objects) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->objects, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr2 *r) -{ - uint32_t cntr_objects_1; - ndr_print_struct(ndr, name, "drsuapi_DsAddEntryCtr2"); - ndr->depth++; - ndr_print_ptr(ndr, "id", r->id); - ndr->depth++; - if (r->id) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id); - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "error", &r->error); - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "objects", r->objects); - ndr->depth++; - if (r->objects) { - ndr->print(ndr, "%s: ARRAY(%d)", "objects", (int)r->count); - ndr->depth++; - for (cntr_objects_1=0;cntr_objects_1count;cntr_objects_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_objects_1) != -1) { - ndr_print_drsuapi_DsReplicaObjectIdentifier2(ndr, "objects", &r->objects[cntr_objects_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryCtr3 *r) -{ - uint32_t cntr_objects_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->id)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->error)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->objects)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->id) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); - } - if (r->error) { - NDR_CHECK(ndr_push_set_switch_value(ndr, r->error, r->level)); - NDR_CHECK(ndr_push_drsuapi_DsAddEntryError(ndr, NDR_SCALARS|NDR_BUFFERS, r->error)); - } - if (r->objects) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1])); - } - for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryCtr3 *r) -{ - uint32_t _ptr_id; - TALLOC_CTX *_mem_save_id_0; - uint32_t _ptr_error; - TALLOC_CTX *_mem_save_error_0; - uint32_t _ptr_objects; - uint32_t cntr_objects_1; - TALLOC_CTX *_mem_save_objects_0; - TALLOC_CTX *_mem_save_objects_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id)); - if (_ptr_id) { - NDR_PULL_ALLOC(ndr, r->id); - } else { - r->id = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_error)); - if (_ptr_error) { - NDR_PULL_ALLOC(ndr, r->error); - } else { - r->error = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objects)); - if (_ptr_objects) { - NDR_PULL_ALLOC(ndr, r->objects); - } else { - r->objects = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->id) { - _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->id, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0); - } - if (r->error) { - _mem_save_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->error, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->error, r->level)); - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError(ndr, NDR_SCALARS|NDR_BUFFERS, r->error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_error_0, 0); - } - if (r->objects) { - _mem_save_objects_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->objects)); - NDR_PULL_ALLOC_N(ndr, r->objects, ndr_get_array_size(ndr, &r->objects)); - _mem_save_objects_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0); - for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1])); - } - for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_0, 0); - } - if (r->objects) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->objects, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr3 *r) -{ - uint32_t cntr_objects_1; - ndr_print_struct(ndr, name, "drsuapi_DsAddEntryCtr3"); - ndr->depth++; - ndr_print_ptr(ndr, "id", r->id); - ndr->depth++; - if (r->id) { - ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_ptr(ndr, "error", r->error); - ndr->depth++; - if (r->error) { - ndr_print_set_switch_value(ndr, r->error, r->level); - ndr_print_drsuapi_DsAddEntryError(ndr, "error", r->error); - } - ndr->depth--; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "objects", r->objects); - ndr->depth++; - if (r->objects) { - ndr->print(ndr, "%s: ARRAY(%d)", "objects", (int)r->count); - ndr->depth++; - for (cntr_objects_1=0;cntr_objects_1count;cntr_objects_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_objects_1) != -1) { - ndr_print_drsuapi_DsReplicaObjectIdentifier2(ndr, "objects", &r->objects[cntr_objects_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 2: { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr2(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr3(ndr, NDR_SCALARS, &r->ctr3)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 2: - NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr2(ndr, NDR_BUFFERS, &r->ctr2)); - break; - - case 3: - NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr3(ndr, NDR_BUFFERS, &r->ctr3)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryCtr *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 2: { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr2(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - case 3: { - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr3(ndr, NDR_SCALARS, &r->ctr3)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 2: - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr2(ndr, NDR_BUFFERS, &r->ctr2)); - break; - - case 3: - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr3(ndr, NDR_BUFFERS, &r->ctr3)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryCtr"); - switch (level) { - case 2: - ndr_print_drsuapi_DsAddEntryCtr2(ndr, "ctr2", &r->ctr2); - break; - - case 3: - ndr_print_drsuapi_DsAddEntryCtr3(ndr, "ctr3", &r->ctr3); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoLevel(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaGetInfoLevel r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoLevel(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaGetInfoLevel *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoLevel(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaGetInfoLevel r) -{ - const char *val = NULL; - - switch (r) { - case DRSUAPI_DS_REPLICA_GET_INFO: val = "DRSUAPI_DS_REPLICA_GET_INFO"; break; - case DRSUAPI_DS_REPLICA_GET_INFO2: val = "DRSUAPI_DS_REPLICA_GET_INFO2"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaInfoType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaInfoType r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaInfoType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaInfoType *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaInfoType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaInfoType r) -{ - const char *val = NULL; - - switch (r) { - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: val = "DRSUAPI_DS_REPLICA_INFO_NEIGHBORS"; break; - case DRSUAPI_DS_REPLICA_INFO_CURSORS: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS"; break; - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: val = "DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA"; break; - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: val = "DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES"; break; - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: val = "DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES"; break; - case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: val = "DRSUAPI_DS_REPLICA_INFO_PENDING_OPS"; break; - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: val = "DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA"; break; - case DRSUAPI_DS_REPLICA_INFO_CURSORS2: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS2"; break; - case DRSUAPI_DS_REPLICA_INFO_CURSORS3: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS3"; break; - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: val = "DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2"; break; - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: val = "DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2"; break; - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: val = "DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02"; break; - case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: val = "DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04"; break; - case DRSUAPI_DS_REPLICA_INFO_CURSORS05: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS05"; break; - case DRSUAPI_DS_REPLICA_INFO_06: val = "DRSUAPI_DS_REPLICA_INFO_06"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaGetInfoRequest1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->info_type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->object_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaGetInfoRequest1 *r) -{ - uint32_t _ptr_object_dn; - TALLOC_CTX *_mem_save_object_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, &r->info_type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); - if (_ptr_object_dn) { - NDR_PULL_ALLOC(ndr, r->object_dn); - } else { - r->object_dn = NULL; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->object_dn) { - _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); - if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest1 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfoRequest1"); - ndr->depth++; - ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", r->info_type); - ndr_print_ptr(ndr, "object_dn", r->object_dn); - ndr->depth++; - if (r->object_dn) { - ndr_print_string(ndr, "object_dn", r->object_dn); - } - ndr->depth--; - ndr_print_GUID(ndr, "guid1", &r->guid1); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaGetInfoRequest2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->info_type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string1)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->object_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->string1) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string1, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string1, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string1, ndr_charset_length(r->string1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->string2) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string2, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string2, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string2, ndr_charset_length(r->string2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaGetInfoRequest2 *r) -{ - uint32_t _ptr_object_dn; - TALLOC_CTX *_mem_save_object_dn_0; - uint32_t _ptr_string1; - TALLOC_CTX *_mem_save_string1_0; - uint32_t _ptr_string2; - TALLOC_CTX *_mem_save_string2_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, &r->info_type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); - if (_ptr_object_dn) { - NDR_PULL_ALLOC(ndr, r->object_dn); - } else { - r->object_dn = NULL; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string1)); - if (_ptr_string1) { - NDR_PULL_ALLOC(ndr, r->string1); - } else { - r->string1 = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string2)); - if (_ptr_string2) { - NDR_PULL_ALLOC(ndr, r->string2); - } else { - r->string2 = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->object_dn) { - _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); - if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); - } - if (r->string1) { - _mem_save_string1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string1, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->string1)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->string1)); - if (ndr_get_array_length(ndr, &r->string1) > ndr_get_array_size(ndr, &r->string1)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string1), ndr_get_array_length(ndr, &r->string1)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->string1), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string1, ndr_get_array_length(ndr, &r->string1), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string1_0, 0); - } - if (r->string2) { - _mem_save_string2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string2, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->string2)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->string2)); - if (ndr_get_array_length(ndr, &r->string2) > ndr_get_array_size(ndr, &r->string2)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string2), ndr_get_array_length(ndr, &r->string2)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->string2), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string2, ndr_get_array_length(ndr, &r->string2), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string2_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest2 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfoRequest2"); - ndr->depth++; - ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", r->info_type); - ndr_print_ptr(ndr, "object_dn", r->object_dn); - ndr->depth++; - if (r->object_dn) { - ndr_print_string(ndr, "object_dn", r->object_dn); - } - ndr->depth--; - ndr_print_GUID(ndr, "guid1", &r->guid1); - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_ptr(ndr, "string1", r->string1); - ndr->depth++; - if (r->string1) { - ndr_print_string(ndr, "string1", r->string1); - } - ndr->depth--; - ndr_print_ptr(ndr, "string2", r->string2); - ndr->depth++; - if (r->string2) { - ndr_print_string(ndr, "string2", r->string2); - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaGetInfoRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, level)); - switch (level) { - case DRSUAPI_DS_REPLICA_GET_INFO: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - case DRSUAPI_DS_REPLICA_GET_INFO2: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_SCALARS, &r->req2)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case DRSUAPI_DS_REPLICA_GET_INFO: - NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - case DRSUAPI_DS_REPLICA_GET_INFO2: - NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_BUFFERS, &r->req2)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaGetInfoRequest *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case DRSUAPI_DS_REPLICA_GET_INFO: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - case DRSUAPI_DS_REPLICA_GET_INFO2: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_SCALARS, &r->req2)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case DRSUAPI_DS_REPLICA_GET_INFO: - NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - case DRSUAPI_DS_REPLICA_GET_INFO2: - NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_BUFFERS, &r->req2)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaGetInfoRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsReplicaGetInfoRequest"); - switch (level) { - case DRSUAPI_DS_REPLICA_GET_INFO: - ndr_print_drsuapi_DsReplicaGetInfoRequest1(ndr, "req1", &r->req1); - break; - - case DRSUAPI_DS_REPLICA_GET_INFO2: - ndr_print_drsuapi_DsReplicaGetInfoRequest2(ndr, "req2", &r->req2); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbour(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaNeighbour *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_obj_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_address)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->transport_obj_dn)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->naming_context_obj_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->transport_obj_guid)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->tmp_highest_usn)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_success)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_attempt)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->result_last_attempt)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->consecutive_sync_failures)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->naming_context_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->naming_context_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->naming_context_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->naming_context_dn, ndr_charset_length(r->naming_context_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->source_dsa_obj_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_obj_dn, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->source_dsa_address) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_address, ndr_charset_length(r->source_dsa_address, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->transport_obj_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->transport_obj_dn, ndr_charset_length(r->transport_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbour(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaNeighbour *r) -{ - uint32_t _ptr_naming_context_dn; - TALLOC_CTX *_mem_save_naming_context_dn_0; - uint32_t _ptr_source_dsa_obj_dn; - TALLOC_CTX *_mem_save_source_dsa_obj_dn_0; - uint32_t _ptr_source_dsa_address; - TALLOC_CTX *_mem_save_source_dsa_address_0; - uint32_t _ptr_transport_obj_dn; - TALLOC_CTX *_mem_save_transport_obj_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context_dn)); - if (_ptr_naming_context_dn) { - NDR_PULL_ALLOC(ndr, r->naming_context_dn); - } else { - r->naming_context_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_obj_dn)); - if (_ptr_source_dsa_obj_dn) { - NDR_PULL_ALLOC(ndr, r->source_dsa_obj_dn); - } else { - r->source_dsa_obj_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_address)); - if (_ptr_source_dsa_address) { - NDR_PULL_ALLOC(ndr, r->source_dsa_address); - } else { - r->source_dsa_address = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport_obj_dn)); - if (_ptr_transport_obj_dn) { - NDR_PULL_ALLOC(ndr, r->transport_obj_dn); - } else { - r->transport_obj_dn = NULL; - } - NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->naming_context_obj_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->transport_obj_guid)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->tmp_highest_usn)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_success)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_attempt)); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->result_last_attempt)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->consecutive_sync_failures)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->naming_context_dn) { - _mem_save_naming_context_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->naming_context_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->naming_context_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->naming_context_dn)); - if (ndr_get_array_length(ndr, &r->naming_context_dn) > ndr_get_array_size(ndr, &r->naming_context_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->naming_context_dn), ndr_get_array_length(ndr, &r->naming_context_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->naming_context_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->naming_context_dn, ndr_get_array_length(ndr, &r->naming_context_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_dn_0, 0); - } - if (r->source_dsa_obj_dn) { - _mem_save_source_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_obj_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_obj_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_obj_dn)); - if (ndr_get_array_length(ndr, &r->source_dsa_obj_dn) > ndr_get_array_size(ndr, &r->source_dsa_obj_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_obj_dn), ndr_get_array_length(ndr, &r->source_dsa_obj_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_obj_dn, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_obj_dn_0, 0); - } - if (r->source_dsa_address) { - _mem_save_source_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_address, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_address)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_address)); - if (ndr_get_array_length(ndr, &r->source_dsa_address) > ndr_get_array_size(ndr, &r->source_dsa_address)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_address), ndr_get_array_length(ndr, &r->source_dsa_address)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_address, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_address_0, 0); - } - if (r->transport_obj_dn) { - _mem_save_transport_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->transport_obj_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->transport_obj_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->transport_obj_dn)); - if (ndr_get_array_length(ndr, &r->transport_obj_dn) > ndr_get_array_size(ndr, &r->transport_obj_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->transport_obj_dn), ndr_get_array_length(ndr, &r->transport_obj_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->transport_obj_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->transport_obj_dn, ndr_get_array_length(ndr, &r->transport_obj_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_obj_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbour(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbour *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaNeighbour"); - ndr->depth++; - ndr_print_ptr(ndr, "naming_context_dn", r->naming_context_dn); - ndr->depth++; - if (r->naming_context_dn) { - ndr_print_string(ndr, "naming_context_dn", r->naming_context_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn); - ndr->depth++; - if (r->source_dsa_obj_dn) { - ndr_print_string(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "source_dsa_address", r->source_dsa_address); - ndr->depth++; - if (r->source_dsa_address) { - ndr_print_string(ndr, "source_dsa_address", r->source_dsa_address); - } - ndr->depth--; - ndr_print_ptr(ndr, "transport_obj_dn", r->transport_obj_dn); - ndr->depth++; - if (r->transport_obj_dn) { - ndr_print_string(ndr, "transport_obj_dn", r->transport_obj_dn); - } - ndr->depth--; - ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr_print_GUID(ndr, "naming_context_obj_guid", &r->naming_context_obj_guid); - ndr_print_GUID(ndr, "source_dsa_obj_guid", &r->source_dsa_obj_guid); - ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); - ndr_print_GUID(ndr, "transport_obj_guid", &r->transport_obj_guid); - ndr_print_hyper(ndr, "tmp_highest_usn", r->tmp_highest_usn); - ndr_print_hyper(ndr, "highest_usn", r->highest_usn); - ndr_print_NTTIME(ndr, "last_success", r->last_success); - ndr_print_NTTIME(ndr, "last_attempt", r->last_attempt); - ndr_print_WERROR(ndr, "result_last_attempt", r->result_last_attempt); - ndr_print_uint32(ndr, "consecutive_sync_failures", r->consecutive_sync_failures); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaNeighbourCtr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbour(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbour(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaNeighbourCtr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbour(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbour(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbourCtr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaNeighbourCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaNeighbour(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursorCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaCursor(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attribute_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData *r) -{ - uint32_t _ptr_attribute_name; - TALLOC_CTX *_mem_save_attribute_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name)); - if (_ptr_attribute_name) { - NDR_PULL_ALLOC(ndr, r->attribute_name); - } else { - r->attribute_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attribute_name) { - _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name)); - if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData"); - ndr->depth++; - ndr_print_ptr(ndr, "attribute_name", r->attribute_name); - ndr->depth++; - if (r->attribute_name) { - ndr_print_string(ndr, "attribute_name", r->attribute_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "version", r->version); - ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time); - ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); - ndr_print_hyper(ndr, "originating_usn", r->originating_usn); - ndr_print_hyper(ndr, "local_usn", r->local_usn); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaDataCtr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaDataCtr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaDataCtr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaDataCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaObjMetaData(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaKccDsaFailure(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaKccDsaFailure *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dsa_obj_dn)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->dsa_obj_guid)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->first_failure)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_failures)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->last_result)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dsa_obj_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dsa_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dsa_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dsa_obj_dn, ndr_charset_length(r->dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaKccDsaFailure(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaKccDsaFailure *r) -{ - uint32_t _ptr_dsa_obj_dn; - TALLOC_CTX *_mem_save_dsa_obj_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_obj_dn)); - if (_ptr_dsa_obj_dn) { - NDR_PULL_ALLOC(ndr, r->dsa_obj_dn); - } else { - r->dsa_obj_dn = NULL; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->dsa_obj_guid)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->first_failure)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_failures)); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->last_result)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dsa_obj_dn) { - _mem_save_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dsa_obj_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dsa_obj_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dsa_obj_dn)); - if (ndr_get_array_length(ndr, &r->dsa_obj_dn) > ndr_get_array_size(ndr, &r->dsa_obj_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dsa_obj_dn), ndr_get_array_length(ndr, &r->dsa_obj_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dsa_obj_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dsa_obj_dn, ndr_get_array_length(ndr, &r->dsa_obj_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_obj_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaKccDsaFailure(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailure *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaKccDsaFailure"); - ndr->depth++; - ndr_print_ptr(ndr, "dsa_obj_dn", r->dsa_obj_dn); - ndr->depth++; - if (r->dsa_obj_dn) { - ndr_print_string(ndr, "dsa_obj_dn", r->dsa_obj_dn); - } - ndr->depth--; - ndr_print_GUID(ndr, "dsa_obj_guid", &r->dsa_obj_guid); - ndr_print_NTTIME(ndr, "first_failure", r->first_failure); - ndr_print_uint32(ndr, "num_failures", r->num_failures); - ndr_print_WERROR(ndr, "last_result", r->last_result); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaKccDsaFailuresCtr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaKccDsaFailuresCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaKccDsaFailure(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaOpType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaOpType r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOpType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaOpType *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaOpType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaOpType r) -{ - const char *val = NULL; - - switch (r) { - case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: val = "DRSUAPI_DS_REPLICA_OP_TYPE_SYNC"; break; - case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: val = "DRSUAPI_DS_REPLICA_OP_TYPE_ADD"; break; - case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: val = "DRSUAPI_DS_REPLICA_OP_TYPE_DELETE"; break; - case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: val = "DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY"; break; - case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: val = "DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_drsuapi_DsRplicaOpOptions(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRplicaOpOptions *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, level)); - switch (level) { - case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->sync)); - break; } - - case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, r->add)); - break; } - - case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, r->op_delete)); - break; } - - case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, r->modify)); - break; } - - case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: { - NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, r->update_refs)); - break; } - - default: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsRplicaOpOptions(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRplicaOpOptions *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->sync)); - break; } - - case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, &r->add)); - break; } - - case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, &r->op_delete)); - break; } - - case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, &r->modify)); - break; } - - case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, &r->update_refs)); - break; } - - default: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsRplicaOpOptions(struct ndr_print *ndr, const char *name, const union drsuapi_DsRplicaOpOptions *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsRplicaOpOptions"); - switch (level) { - case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: - ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "sync", r->sync); - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: - ndr_print_drsuapi_DsReplicaAddOptions(ndr, "add", r->add); - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: - ndr_print_drsuapi_DsReplicaDeleteOptions(ndr, "op_delete", r->op_delete); - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: - ndr_print_drsuapi_DsReplicaModifyOptions(ndr, "modify", r->modify); - break; - - case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: - ndr_print_drsuapi_DsReplicaUpdateRefsOptions(ndr, "update_refs", r->update_refs); - break; - - default: - ndr_print_uint32(ndr, "unknown", r->unknown); - break; - - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaOp(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOp *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->operation_start)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_num)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, r->operation_type)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->options, r->operation_type)); - NDR_CHECK(ndr_push_drsuapi_DsRplicaOpOptions(ndr, NDR_SCALARS, &r->options)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->nc_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_dsa_obj_dn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_dsa_address)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->nc_obj_guid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->remote_dsa_obj_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->nc_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->nc_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->nc_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->nc_dn, ndr_charset_length(r->nc_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->remote_dsa_obj_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote_dsa_obj_dn, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->remote_dsa_address) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_address, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_address, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote_dsa_address, ndr_charset_length(r->remote_dsa_address, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOp(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOp *r) -{ - uint32_t _ptr_nc_dn; - TALLOC_CTX *_mem_save_nc_dn_0; - uint32_t _ptr_remote_dsa_obj_dn; - TALLOC_CTX *_mem_save_remote_dsa_obj_dn_0; - uint32_t _ptr_remote_dsa_address; - TALLOC_CTX *_mem_save_remote_dsa_address_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->operation_start)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_num)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, &r->operation_type)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->options, r->operation_type)); - NDR_CHECK(ndr_pull_drsuapi_DsRplicaOpOptions(ndr, NDR_SCALARS, &r->options)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nc_dn)); - if (_ptr_nc_dn) { - NDR_PULL_ALLOC(ndr, r->nc_dn); - } else { - r->nc_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_dsa_obj_dn)); - if (_ptr_remote_dsa_obj_dn) { - NDR_PULL_ALLOC(ndr, r->remote_dsa_obj_dn); - } else { - r->remote_dsa_obj_dn = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_dsa_address)); - if (_ptr_remote_dsa_address) { - NDR_PULL_ALLOC(ndr, r->remote_dsa_address); - } else { - r->remote_dsa_address = NULL; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->nc_obj_guid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->remote_dsa_obj_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->nc_dn) { - _mem_save_nc_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->nc_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->nc_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->nc_dn)); - if (ndr_get_array_length(ndr, &r->nc_dn) > ndr_get_array_size(ndr, &r->nc_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->nc_dn), ndr_get_array_length(ndr, &r->nc_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->nc_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->nc_dn, ndr_get_array_length(ndr, &r->nc_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nc_dn_0, 0); - } - if (r->remote_dsa_obj_dn) { - _mem_save_remote_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->remote_dsa_obj_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_dsa_obj_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_dsa_obj_dn)); - if (ndr_get_array_length(ndr, &r->remote_dsa_obj_dn) > ndr_get_array_size(ndr, &r->remote_dsa_obj_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote_dsa_obj_dn), ndr_get_array_length(ndr, &r->remote_dsa_obj_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote_dsa_obj_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_dsa_obj_dn, ndr_get_array_length(ndr, &r->remote_dsa_obj_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_dsa_obj_dn_0, 0); - } - if (r->remote_dsa_address) { - _mem_save_remote_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->remote_dsa_address, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_dsa_address)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_dsa_address)); - if (ndr_get_array_length(ndr, &r->remote_dsa_address) > ndr_get_array_size(ndr, &r->remote_dsa_address)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote_dsa_address), ndr_get_array_length(ndr, &r->remote_dsa_address)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote_dsa_address), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_dsa_address, ndr_get_array_length(ndr, &r->remote_dsa_address), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_dsa_address_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaOp(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOp *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaOp"); - ndr->depth++; - ndr_print_NTTIME(ndr, "operation_start", r->operation_start); - ndr_print_uint32(ndr, "serial_num", r->serial_num); - ndr_print_uint32(ndr, "priority", r->priority); - ndr_print_drsuapi_DsReplicaOpType(ndr, "operation_type", r->operation_type); - ndr_print_set_switch_value(ndr, &r->options, r->operation_type); - ndr_print_drsuapi_DsRplicaOpOptions(ndr, "options", &r->options); - ndr_print_ptr(ndr, "nc_dn", r->nc_dn); - ndr->depth++; - if (r->nc_dn) { - ndr_print_string(ndr, "nc_dn", r->nc_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "remote_dsa_obj_dn", r->remote_dsa_obj_dn); - ndr->depth++; - if (r->remote_dsa_obj_dn) { - ndr_print_string(ndr, "remote_dsa_obj_dn", r->remote_dsa_obj_dn); - } - ndr->depth--; - ndr_print_ptr(ndr, "remote_dsa_address", r->remote_dsa_address); - ndr->depth++; - if (r->remote_dsa_address) { - ndr_print_string(ndr, "remote_dsa_address", r->remote_dsa_address); - } - ndr->depth--; - ndr_print_GUID(ndr, "nc_obj_guid", &r->nc_obj_guid); - ndr_print_GUID(ndr, "remote_dsa_obj_guid", &r->remote_dsa_obj_guid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaOpCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOpCtr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaOp(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaOp(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOpCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOpCtr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOp(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOp(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaOpCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOpCtr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaOpCtr"); - ndr->depth++; - ndr_print_NTTIME(ndr, "time", r->time); - ndr_print_uint32(ndr, "count", r->count); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaOp(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->binary, 0))); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->binary)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->deleted)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->created)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attribute_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->object_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->binary) { - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->binary)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData *r) -{ - uint32_t _ptr_attribute_name; - TALLOC_CTX *_mem_save_attribute_name_0; - uint32_t _ptr_object_dn; - TALLOC_CTX *_mem_save_object_dn_0; - uint32_t _ptr_binary; - TALLOC_CTX *_mem_save_binary_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name)); - if (_ptr_attribute_name) { - NDR_PULL_ALLOC(ndr, r->attribute_name); - } else { - r->attribute_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); - if (_ptr_object_dn) { - NDR_PULL_ALLOC(ndr, r->object_dn); - } else { - r->object_dn = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary)); - if (_ptr_binary) { - NDR_PULL_ALLOC(ndr, r->binary); - } else { - r->binary = NULL; - } - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->deleted)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->created)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attribute_name) { - _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name)); - if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0); - } - if (r->object_dn) { - _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); - if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); - } - if (r->binary) { - _mem_save_binary_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->binary, 0); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->binary)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData"); - ndr->depth++; - ndr_print_ptr(ndr, "attribute_name", r->attribute_name); - ndr->depth++; - if (r->attribute_name) { - ndr_print_string(ndr, "attribute_name", r->attribute_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "object_dn", r->object_dn); - ndr->depth++; - if (r->object_dn) { - ndr_print_string(ndr, "object_dn", r->object_dn); - } - ndr->depth--; - ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->binary, 0):r->__ndr_size_binary); - ndr_print_ptr(ndr, "binary", r->binary); - ndr->depth++; - if (r->binary) { - ndr_print_DATA_BLOB(ndr, "binary", *r->binary); - } - ndr->depth--; - ndr_print_NTTIME(ndr, "deleted", r->deleted); - ndr_print_NTTIME(ndr, "created", r->created); - ndr_print_uint32(ndr, "version", r->version); - ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time); - ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); - ndr_print_hyper(ndr, "originating_usn", r->originating_usn); - ndr_print_hyper(ndr, "local_usn", r->local_usn); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaDataCtr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaDataCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaAttrValMetaData(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2Ctr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2Ctr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2Ctr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2Ctr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaCursor2(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_obj_dn)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->source_dsa_obj_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->source_dsa_obj_dn, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor3 *r) -{ - uint32_t _ptr_source_dsa_obj_dn; - TALLOC_CTX *_mem_save_source_dsa_obj_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_obj_dn)); - if (_ptr_source_dsa_obj_dn) { - NDR_PULL_ALLOC(ndr, r->source_dsa_obj_dn); - } else { - r->source_dsa_obj_dn = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->source_dsa_obj_dn) { - _mem_save_source_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_obj_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_obj_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_obj_dn)); - if (ndr_get_array_length(ndr, &r->source_dsa_obj_dn) > ndr_get_array_size(ndr, &r->source_dsa_obj_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->source_dsa_obj_dn), ndr_get_array_length(ndr, &r->source_dsa_obj_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->source_dsa_obj_dn, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_obj_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor3"); - ndr->depth++; - ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id); - ndr_print_hyper(ndr, "highest_usn", r->highest_usn); - ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success); - ndr_print_ptr(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn); - ndr->depth++; - if (r->source_dsa_obj_dn) { - ndr_print_string(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor3Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor3Ctr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor3Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor3Ctr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor3Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3Ctr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor3Ctr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaCursor3(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->originating_dsa_dn)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attribute_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->originating_dsa_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->originating_dsa_dn, ndr_charset_length(r->originating_dsa_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData2 *r) -{ - uint32_t _ptr_attribute_name; - TALLOC_CTX *_mem_save_attribute_name_0; - uint32_t _ptr_originating_dsa_dn; - TALLOC_CTX *_mem_save_originating_dsa_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name)); - if (_ptr_attribute_name) { - NDR_PULL_ALLOC(ndr, r->attribute_name); - } else { - r->attribute_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_originating_dsa_dn)); - if (_ptr_originating_dsa_dn) { - NDR_PULL_ALLOC(ndr, r->originating_dsa_dn); - } else { - r->originating_dsa_dn = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attribute_name) { - _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name)); - if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0); - } - if (r->originating_dsa_dn) { - _mem_save_originating_dsa_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->originating_dsa_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->originating_dsa_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->originating_dsa_dn)); - if (ndr_get_array_length(ndr, &r->originating_dsa_dn) > ndr_get_array_size(ndr, &r->originating_dsa_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->originating_dsa_dn), ndr_get_array_length(ndr, &r->originating_dsa_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->originating_dsa_dn, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_originating_dsa_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData2"); - ndr->depth++; - ndr_print_ptr(ndr, "attribute_name", r->attribute_name); - ndr->depth++; - if (r->attribute_name) { - ndr_print_string(ndr, "attribute_name", r->attribute_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "version", r->version); - ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time); - ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); - ndr_print_hyper(ndr, "originating_usn", r->originating_usn); - ndr_print_hyper(ndr, "local_usn", r->local_usn); - ndr_print_ptr(ndr, "originating_dsa_dn", r->originating_dsa_dn); - ndr->depth++; - if (r->originating_dsa_dn) { - ndr_print_string(ndr, "originating_dsa_dn", r->originating_dsa_dn); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData2Ctr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData2Ctr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2Ctr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData2Ctr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaObjMetaData2(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->binary, 0))); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->binary)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->deleted)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->created)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->originating_dsa_dn)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attribute_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->object_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->binary) { - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->binary)); - } - if (r->originating_dsa_dn) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->originating_dsa_dn, ndr_charset_length(r->originating_dsa_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData2 *r) -{ - uint32_t _ptr_attribute_name; - TALLOC_CTX *_mem_save_attribute_name_0; - uint32_t _ptr_object_dn; - TALLOC_CTX *_mem_save_object_dn_0; - uint32_t _ptr_binary; - TALLOC_CTX *_mem_save_binary_0; - uint32_t _ptr_originating_dsa_dn; - TALLOC_CTX *_mem_save_originating_dsa_dn_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name)); - if (_ptr_attribute_name) { - NDR_PULL_ALLOC(ndr, r->attribute_name); - } else { - r->attribute_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn)); - if (_ptr_object_dn) { - NDR_PULL_ALLOC(ndr, r->object_dn); - } else { - r->object_dn = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary)); - if (_ptr_binary) { - NDR_PULL_ALLOC(ndr, r->binary); - } else { - r->binary = NULL; - } - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->deleted)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->created)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_originating_dsa_dn)); - if (_ptr_originating_dsa_dn) { - NDR_PULL_ALLOC(ndr, r->originating_dsa_dn); - } else { - r->originating_dsa_dn = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->attribute_name) { - _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name)); - if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->attribute_name), ndr_get_array_length(ndr, &r->attribute_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0); - } - if (r->object_dn) { - _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn)); - if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_dn), ndr_get_array_length(ndr, &r->object_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0); - } - if (r->binary) { - _mem_save_binary_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->binary, 0); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->binary)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_0, 0); - } - if (r->originating_dsa_dn) { - _mem_save_originating_dsa_dn_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->originating_dsa_dn, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->originating_dsa_dn)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->originating_dsa_dn)); - if (ndr_get_array_length(ndr, &r->originating_dsa_dn) > ndr_get_array_size(ndr, &r->originating_dsa_dn)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->originating_dsa_dn), ndr_get_array_length(ndr, &r->originating_dsa_dn)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->originating_dsa_dn, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_originating_dsa_dn_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData2"); - ndr->depth++; - ndr_print_ptr(ndr, "attribute_name", r->attribute_name); - ndr->depth++; - if (r->attribute_name) { - ndr_print_string(ndr, "attribute_name", r->attribute_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "object_dn", r->object_dn); - ndr->depth++; - if (r->object_dn) { - ndr_print_string(ndr, "object_dn", r->object_dn); - } - ndr->depth--; - ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->binary, 0):r->__ndr_size_binary); - ndr_print_ptr(ndr, "binary", r->binary); - ndr->depth++; - if (r->binary) { - ndr_print_DATA_BLOB(ndr, "binary", *r->binary); - } - ndr->depth--; - ndr_print_NTTIME(ndr, "deleted", r->deleted); - ndr_print_NTTIME(ndr, "created", r->created); - ndr_print_uint32(ndr, "version", r->version); - ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time); - ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id); - ndr_print_hyper(ndr, "originating_usn", r->originating_usn); - ndr_print_hyper(ndr, "local_usn", r->local_usn); - ndr_print_ptr(ndr, "originating_dsa_dn", r->originating_dsa_dn); - ndr->depth++; - if (r->originating_dsa_dn) { - ndr_print_string(ndr, "originating_dsa_dn", r->originating_dsa_dn); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData2Ctr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData2Ctr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_int32(ndr, "enumeration_context", r->enumeration_context); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaAttrValMetaData2(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaConnection04(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaConnection04 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->u1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->bind_guid)); - NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->bind_time)); - { - uint32_t _flags_save_ipv4address = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->client_ip_address)); - ndr->flags = _flags_save_ipv4address; - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u5)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaConnection04(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaConnection04 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->u1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->bind_guid)); - NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->bind_time)); - { - uint32_t _flags_save_ipv4address = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->client_ip_address)); - ndr->flags = _flags_save_ipv4address; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u5)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaConnection04(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaConnection04"); - ndr->depth++; - ndr_print_hyper(ndr, "u1", r->u1); - ndr_print_uint32(ndr, "u2", r->u2); - ndr_print_uint32(ndr, "u3", r->u3); - ndr_print_GUID(ndr, "bind_guid", &r->bind_guid); - ndr_print_NTTIME_1sec(ndr, "bind_time", r->bind_time); - ndr_print_ipv4address(ndr, "client_ip_address", r->client_ip_address); - ndr_print_uint32(ndr, "u5", r->u5); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaConnection04Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaConnection04Ctr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaConnection04(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaConnection04Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaConnection04Ctr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplicaConnection04(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaConnection04Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04Ctr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplicaConnection04Ctr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplicaConnection04(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplica06(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplica06 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->str1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u5)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->u6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u7)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->str1) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str1, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str1, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->str1, ndr_charset_length(r->str1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplica06(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplica06 *r) -{ - uint32_t _ptr_str1; - TALLOC_CTX *_mem_save_str1_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_str1)); - if (_ptr_str1) { - NDR_PULL_ALLOC(ndr, r->str1); - } else { - r->str1 = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u5)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->u6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u7)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->str1) { - _mem_save_str1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->str1, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->str1)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->str1)); - if (ndr_get_array_length(ndr, &r->str1) > ndr_get_array_size(ndr, &r->str1)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->str1), ndr_get_array_length(ndr, &r->str1)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->str1), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->str1, ndr_get_array_length(ndr, &r->str1), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_str1_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplica06(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplica06"); - ndr->depth++; - ndr_print_ptr(ndr, "str1", r->str1); - ndr->depth++; - if (r->str1) { - ndr_print_string(ndr, "str1", r->str1); - } - ndr->depth--; - ndr_print_uint32(ndr, "u1", r->u1); - ndr_print_uint32(ndr, "u2", r->u2); - ndr_print_uint32(ndr, "u3", r->u3); - ndr_print_uint32(ndr, "u4", r->u4); - ndr_print_uint32(ndr, "u5", r->u5); - ndr_print_hyper(ndr, "u6", r->u6); - ndr_print_uint32(ndr, "u7", r->u7); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplica06Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplica06Ctr *r) -{ - uint32_t cntr_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplica06(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_push_drsuapi_DsReplica06(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplica06Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplica06Ctr *r) -{ - uint32_t cntr_array_0; - TALLOC_CTX *_mem_save_array_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 256) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplica06(ndr, NDR_SCALARS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { - NDR_CHECK(ndr_pull_drsuapi_DsReplica06(ndr, NDR_BUFFERS, &r->array[cntr_array_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplica06Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06Ctr *r) -{ - uint32_t cntr_array_0; - ndr_print_struct(ndr, name, "drsuapi_DsReplica06Ctr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_0=0;cntr_array_0count;cntr_array_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) { - ndr_print_drsuapi_DsReplica06(ndr, "array", &r->array[cntr_array_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, level)); - switch (level) { - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->neighbours)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_CURSORS: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->objmetadata)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->connectfailures)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->linkfailures)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->pendingops)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->attrvalmetadata)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_CURSORS2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors2)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_CURSORS3: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors3)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->objmetadata2)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->attrvalmetadata2)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->neighbours02)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->connections04)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_CURSORS05: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors05)); - break; } - - case DRSUAPI_DS_REPLICA_INFO_06: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->i06)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: - if (r->neighbours) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS: - if (r->cursors) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtr(ndr, NDR_SCALARS, r->cursors)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: - if (r->objmetadata) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: - if (r->connectfailures) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->connectfailures)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: - if (r->linkfailures) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->linkfailures)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: - if (r->pendingops) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaOpCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->pendingops)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: - if (r->attrvalmetadata) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS2: - if (r->cursors2) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2Ctr(ndr, NDR_SCALARS, r->cursors2)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS3: - if (r->cursors3) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->cursors3)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: - if (r->objmetadata2) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata2)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: - if (r->attrvalmetadata2) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata2)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: - if (r->neighbours02) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours02)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: - if (r->connections04) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaConnection04Ctr(ndr, NDR_SCALARS, r->connections04)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS05: - if (r->cursors05) { - NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->cursors05)); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_06: - if (r->i06) { - NDR_CHECK(ndr_push_drsuapi_DsReplica06Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->i06)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_neighbours_0; - TALLOC_CTX *_mem_save_cursors_0; - TALLOC_CTX *_mem_save_objmetadata_0; - TALLOC_CTX *_mem_save_connectfailures_0; - TALLOC_CTX *_mem_save_linkfailures_0; - TALLOC_CTX *_mem_save_pendingops_0; - TALLOC_CTX *_mem_save_attrvalmetadata_0; - TALLOC_CTX *_mem_save_cursors2_0; - TALLOC_CTX *_mem_save_cursors3_0; - TALLOC_CTX *_mem_save_objmetadata2_0; - TALLOC_CTX *_mem_save_attrvalmetadata2_0; - TALLOC_CTX *_mem_save_neighbours02_0; - TALLOC_CTX *_mem_save_connections04_0; - TALLOC_CTX *_mem_save_cursors05_0; - TALLOC_CTX *_mem_save_i06_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: { - uint32_t _ptr_neighbours; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_neighbours)); - if (_ptr_neighbours) { - NDR_PULL_ALLOC(ndr, r->neighbours); - } else { - r->neighbours = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_CURSORS: { - uint32_t _ptr_cursors; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors)); - if (_ptr_cursors) { - NDR_PULL_ALLOC(ndr, r->cursors); - } else { - r->cursors = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: { - uint32_t _ptr_objmetadata; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objmetadata)); - if (_ptr_objmetadata) { - NDR_PULL_ALLOC(ndr, r->objmetadata); - } else { - r->objmetadata = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: { - uint32_t _ptr_connectfailures; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_connectfailures)); - if (_ptr_connectfailures) { - NDR_PULL_ALLOC(ndr, r->connectfailures); - } else { - r->connectfailures = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: { - uint32_t _ptr_linkfailures; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_linkfailures)); - if (_ptr_linkfailures) { - NDR_PULL_ALLOC(ndr, r->linkfailures); - } else { - r->linkfailures = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: { - uint32_t _ptr_pendingops; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pendingops)); - if (_ptr_pendingops) { - NDR_PULL_ALLOC(ndr, r->pendingops); - } else { - r->pendingops = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: { - uint32_t _ptr_attrvalmetadata; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attrvalmetadata)); - if (_ptr_attrvalmetadata) { - NDR_PULL_ALLOC(ndr, r->attrvalmetadata); - } else { - r->attrvalmetadata = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_CURSORS2: { - uint32_t _ptr_cursors2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors2)); - if (_ptr_cursors2) { - NDR_PULL_ALLOC(ndr, r->cursors2); - } else { - r->cursors2 = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_CURSORS3: { - uint32_t _ptr_cursors3; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors3)); - if (_ptr_cursors3) { - NDR_PULL_ALLOC(ndr, r->cursors3); - } else { - r->cursors3 = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: { - uint32_t _ptr_objmetadata2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objmetadata2)); - if (_ptr_objmetadata2) { - NDR_PULL_ALLOC(ndr, r->objmetadata2); - } else { - r->objmetadata2 = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: { - uint32_t _ptr_attrvalmetadata2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attrvalmetadata2)); - if (_ptr_attrvalmetadata2) { - NDR_PULL_ALLOC(ndr, r->attrvalmetadata2); - } else { - r->attrvalmetadata2 = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: { - uint32_t _ptr_neighbours02; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_neighbours02)); - if (_ptr_neighbours02) { - NDR_PULL_ALLOC(ndr, r->neighbours02); - } else { - r->neighbours02 = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: { - uint32_t _ptr_connections04; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_connections04)); - if (_ptr_connections04) { - NDR_PULL_ALLOC(ndr, r->connections04); - } else { - r->connections04 = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_CURSORS05: { - uint32_t _ptr_cursors05; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors05)); - if (_ptr_cursors05) { - NDR_PULL_ALLOC(ndr, r->cursors05); - } else { - r->cursors05 = NULL; - } - break; } - - case DRSUAPI_DS_REPLICA_INFO_06: { - uint32_t _ptr_i06; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_i06)); - if (_ptr_i06) { - NDR_PULL_ALLOC(ndr, r->i06); - } else { - r->i06 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: - if (r->neighbours) { - _mem_save_neighbours_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->neighbours, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_neighbours_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS: - if (r->cursors) { - _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtr(ndr, NDR_SCALARS, r->cursors)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: - if (r->objmetadata) { - _mem_save_objmetadata_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->objmetadata, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objmetadata_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: - if (r->connectfailures) { - _mem_save_connectfailures_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->connectfailures, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->connectfailures)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connectfailures_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: - if (r->linkfailures) { - _mem_save_linkfailures_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->linkfailures, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->linkfailures)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linkfailures_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: - if (r->pendingops) { - _mem_save_pendingops_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->pendingops, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaOpCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->pendingops)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pendingops_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: - if (r->attrvalmetadata) { - _mem_save_attrvalmetadata_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attrvalmetadata, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attrvalmetadata_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS2: - if (r->cursors2) { - _mem_save_cursors2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->cursors2, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2Ctr(ndr, NDR_SCALARS, r->cursors2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors2_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS3: - if (r->cursors3) { - _mem_save_cursors3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->cursors3, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->cursors3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors3_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: - if (r->objmetadata2) { - _mem_save_objmetadata2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->objmetadata2, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objmetadata2_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: - if (r->attrvalmetadata2) { - _mem_save_attrvalmetadata2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attrvalmetadata2, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attrvalmetadata2_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: - if (r->neighbours02) { - _mem_save_neighbours02_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->neighbours02, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours02)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_neighbours02_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: - if (r->connections04) { - _mem_save_connections04_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->connections04, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaConnection04Ctr(ndr, NDR_SCALARS, r->connections04)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connections04_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS05: - if (r->cursors05) { - _mem_save_cursors05_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->cursors05, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->cursors05)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors05_0, 0); - } - break; - - case DRSUAPI_DS_REPLICA_INFO_06: - if (r->i06) { - _mem_save_i06_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->i06, 0); - NDR_CHECK(ndr_pull_drsuapi_DsReplica06Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->i06)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_i06_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsReplicaInfo"); - switch (level) { - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: - ndr_print_ptr(ndr, "neighbours", r->neighbours); - ndr->depth++; - if (r->neighbours) { - ndr_print_drsuapi_DsReplicaNeighbourCtr(ndr, "neighbours", r->neighbours); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS: - ndr_print_ptr(ndr, "cursors", r->cursors); - ndr->depth++; - if (r->cursors) { - ndr_print_drsuapi_DsReplicaCursorCtr(ndr, "cursors", r->cursors); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: - ndr_print_ptr(ndr, "objmetadata", r->objmetadata); - ndr->depth++; - if (r->objmetadata) { - ndr_print_drsuapi_DsReplicaObjMetaDataCtr(ndr, "objmetadata", r->objmetadata); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: - ndr_print_ptr(ndr, "connectfailures", r->connectfailures); - ndr->depth++; - if (r->connectfailures) { - ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, "connectfailures", r->connectfailures); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: - ndr_print_ptr(ndr, "linkfailures", r->linkfailures); - ndr->depth++; - if (r->linkfailures) { - ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, "linkfailures", r->linkfailures); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: - ndr_print_ptr(ndr, "pendingops", r->pendingops); - ndr->depth++; - if (r->pendingops) { - ndr_print_drsuapi_DsReplicaOpCtr(ndr, "pendingops", r->pendingops); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: - ndr_print_ptr(ndr, "attrvalmetadata", r->attrvalmetadata); - ndr->depth++; - if (r->attrvalmetadata) { - ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, "attrvalmetadata", r->attrvalmetadata); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS2: - ndr_print_ptr(ndr, "cursors2", r->cursors2); - ndr->depth++; - if (r->cursors2) { - ndr_print_drsuapi_DsReplicaCursor2Ctr(ndr, "cursors2", r->cursors2); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS3: - ndr_print_ptr(ndr, "cursors3", r->cursors3); - ndr->depth++; - if (r->cursors3) { - ndr_print_drsuapi_DsReplicaCursor3Ctr(ndr, "cursors3", r->cursors3); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: - ndr_print_ptr(ndr, "objmetadata2", r->objmetadata2); - ndr->depth++; - if (r->objmetadata2) { - ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(ndr, "objmetadata2", r->objmetadata2); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: - ndr_print_ptr(ndr, "attrvalmetadata2", r->attrvalmetadata2); - ndr->depth++; - if (r->attrvalmetadata2) { - ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, "attrvalmetadata2", r->attrvalmetadata2); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: - ndr_print_ptr(ndr, "neighbours02", r->neighbours02); - ndr->depth++; - if (r->neighbours02) { - ndr_print_drsuapi_DsReplicaNeighbourCtr(ndr, "neighbours02", r->neighbours02); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: - ndr_print_ptr(ndr, "connections04", r->connections04); - ndr->depth++; - if (r->connections04) { - ndr_print_drsuapi_DsReplicaConnection04Ctr(ndr, "connections04", r->connections04); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_CURSORS05: - ndr_print_ptr(ndr, "cursors05", r->cursors05); - ndr->depth++; - if (r->cursors05) { - ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "cursors05", r->cursors05); - } - ndr->depth--; - break; - - case DRSUAPI_DS_REPLICA_INFO_06: - ndr_print_ptr(ndr, "i06", r->i06); - ndr->depth++; - if (r->i06) { - ndr_print_drsuapi_DsReplica06Ctr(ndr, "i06", r->i06); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Ctr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMemberships2Ctr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Ctr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMemberships2Ctr *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Ctr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Ctr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetMemberships2Ctr"); - switch (level) { - case 1: - ndr_print_drsuapi_DsGetMembershipsCtr1(ndr, "ctr1", &r->ctr1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Request1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMemberships2Request1 *r) -{ - uint32_t cntr_req_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->req_array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->req_array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req)); - for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->req_array[cntr_req_array_1])); - } - for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) { - if (r->req_array[cntr_req_array_1]) { - NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS|NDR_BUFFERS, r->req_array[cntr_req_array_1])); - } - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Request1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMemberships2Request1 *r) -{ - uint32_t _ptr_req_array; - uint32_t cntr_req_array_1; - TALLOC_CTX *_mem_save_req_array_0; - TALLOC_CTX *_mem_save_req_array_1; - TALLOC_CTX *_mem_save_req_array_2; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_req)); - if (r->num_req < 1 || r->num_req > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_req_array)); - if (_ptr_req_array) { - NDR_PULL_ALLOC(ndr, r->req_array); - } else { - r->req_array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->req_array) { - _mem_save_req_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->req_array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->req_array)); - NDR_PULL_ALLOC_N(ndr, r->req_array, ndr_get_array_size(ndr, &r->req_array)); - _mem_save_req_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->req_array, 0); - for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_req_array)); - if (_ptr_req_array) { - NDR_PULL_ALLOC(ndr, r->req_array[cntr_req_array_1]); - } else { - r->req_array[cntr_req_array_1] = NULL; - } - } - for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) { - if (r->req_array[cntr_req_array_1]) { - _mem_save_req_array_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->req_array[cntr_req_array_1], 0); - NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS|NDR_BUFFERS, r->req_array[cntr_req_array_1])); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_2, 0); - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_0, 0); - } - if (r->req_array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->req_array, r->num_req)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Request1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMemberships2Request1 *r) -{ - uint32_t cntr_req_array_1; - ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships2Request1"); - ndr->depth++; - ndr_print_uint32(ndr, "num_req", r->num_req); - ndr_print_ptr(ndr, "req_array", r->req_array); - ndr->depth++; - if (r->req_array) { - ndr->print(ndr, "%s: ARRAY(%d)", "req_array", (int)r->num_req); - ndr->depth++; - for (cntr_req_array_1=0;cntr_req_array_1num_req;cntr_req_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_req_array_1) != -1) { - ndr_print_ptr(ndr, "req_array", r->req_array[cntr_req_array_1]); - ndr->depth++; - if (r->req_array[cntr_req_array_1]) { - ndr_print_drsuapi_DsGetMembershipsRequest1(ndr, "req_array", r->req_array[cntr_req_array_1]); - } - ndr->depth--; - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Request(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMemberships2Request *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Request(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMemberships2Request *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Request(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Request *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_DsGetMemberships2Request"); - switch (level) { - case 1: - ndr_print_drsuapi_DsGetMemberships2Request1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_DsSiteCostInfo(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsSiteCostInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->error_code)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->site_cost)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsSiteCostInfo(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsSiteCostInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->error_code)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->site_cost)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsSiteCostInfo(struct ndr_print *ndr, const char *name, const struct drsuapi_DsSiteCostInfo *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsSiteCostInfo"); - ndr->depth++; - ndr_print_WERROR(ndr, "error_code", r->error_code); - ndr_print_uint32(ndr, "site_cost", r->site_cost); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_QuerySitesByCostCtr1 *r) -{ - uint32_t cntr_info_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_info)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_info)); - for (cntr_info_1 = 0; cntr_info_1 < r->num_info; cntr_info_1++) { - NDR_CHECK(ndr_push_drsuapi_DsSiteCostInfo(ndr, NDR_SCALARS, &r->info[cntr_info_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_QuerySitesByCostCtr1 *r) -{ - uint32_t _ptr_info; - uint32_t cntr_info_1; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_info)); - if (r->num_info < 0 || r->num_info > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->info); - } else { - r->info = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->info)); - NDR_PULL_ALLOC_N(ndr, r->info, ndr_get_array_size(ndr, &r->info)); - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); - for (cntr_info_1 = 0; cntr_info_1 < r->num_info; cntr_info_1++) { - NDR_CHECK(ndr_pull_drsuapi_DsSiteCostInfo(ndr, NDR_SCALARS, &r->info[cntr_info_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - if (r->info) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info, r->num_info)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostCtr1 *r) -{ - uint32_t cntr_info_1; - ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCostCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "num_info", r->num_info); - ndr_print_ptr(ndr, "info", r->info); - ndr->depth++; - if (r->info) { - ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->num_info); - ndr->depth++; - for (cntr_info_1=0;cntr_info_1num_info;cntr_info_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { - ndr_print_drsuapi_DsSiteCostInfo(ndr, "info", &r->info[cntr_info_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_QuerySitesByCostCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_QuerySitesByCostCtr *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr1(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr1(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostCtr(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_QuerySitesByCostCtr"); - switch (level) { - case 1: - ndr_print_drsuapi_QuerySitesByCostCtr1(ndr, "ctr1", &r->ctr1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_QuerySitesByCostRequest1 *r) -{ - uint32_t cntr_site_to_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_from)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_to)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->site_from) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_from, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_from, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_from, ndr_charset_length(r->site_from, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->site_to) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req)); - for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_to[cntr_site_to_1])); - } - for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) { - if (r->site_to[cntr_site_to_1]) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_to[cntr_site_to_1], ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_QuerySitesByCostRequest1 *r) -{ - uint32_t _ptr_site_from; - TALLOC_CTX *_mem_save_site_from_0; - uint32_t _ptr_site_to; - uint32_t cntr_site_to_1; - TALLOC_CTX *_mem_save_site_to_0; - TALLOC_CTX *_mem_save_site_to_1; - TALLOC_CTX *_mem_save_site_to_2; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_from)); - if (_ptr_site_from) { - NDR_PULL_ALLOC(ndr, r->site_from); - } else { - r->site_from = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_req)); - if (r->num_req < 1 || r->num_req > 10000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_to)); - if (_ptr_site_to) { - NDR_PULL_ALLOC(ndr, r->site_to); - } else { - r->site_to = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->site_from) { - _mem_save_site_from_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->site_from, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->site_from)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->site_from)); - if (ndr_get_array_length(ndr, &r->site_from) > ndr_get_array_size(ndr, &r->site_from)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_from), ndr_get_array_length(ndr, &r->site_from)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_from), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_from, ndr_get_array_length(ndr, &r->site_from), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_from_0, 0); - } - if (r->site_to) { - _mem_save_site_to_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->site_to, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->site_to)); - NDR_PULL_ALLOC_N(ndr, r->site_to, ndr_get_array_size(ndr, &r->site_to)); - _mem_save_site_to_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->site_to, 0); - for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_to)); - if (_ptr_site_to) { - NDR_PULL_ALLOC(ndr, r->site_to[cntr_site_to_1]); - } else { - r->site_to[cntr_site_to_1] = NULL; - } - } - for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) { - if (r->site_to[cntr_site_to_1]) { - _mem_save_site_to_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->site_to[cntr_site_to_1], 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->site_to[cntr_site_to_1])); - NDR_CHECK(ndr_pull_array_length(ndr, &r->site_to[cntr_site_to_1])); - if (ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]) > ndr_get_array_size(ndr, &r->site_to[cntr_site_to_1])) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->site_to[cntr_site_to_1]), ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1])); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_to[cntr_site_to_1], ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_2, 0); - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_0, 0); - } - if (r->site_to) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->site_to, r->num_req)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostRequest1 *r) -{ - uint32_t cntr_site_to_1; - ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCostRequest1"); - ndr->depth++; - ndr_print_ptr(ndr, "site_from", r->site_from); - ndr->depth++; - if (r->site_from) { - ndr_print_string(ndr, "site_from", r->site_from); - } - ndr->depth--; - ndr_print_uint32(ndr, "num_req", r->num_req); - ndr_print_ptr(ndr, "site_to", r->site_to); - ndr->depth++; - if (r->site_to) { - ndr->print(ndr, "%s: ARRAY(%d)", "site_to", (int)r->num_req); - ndr->depth++; - for (cntr_site_to_1=0;cntr_site_to_1num_req;cntr_site_to_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_site_to_1) != -1) { - ndr_print_ptr(ndr, "site_to", r->site_to[cntr_site_to_1]); - ndr->depth++; - if (r->site_to[cntr_site_to_1]) { - ndr_print_string(ndr, "site_to", r->site_to[cntr_site_to_1]); - } - ndr->depth--; - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_QuerySitesByCostRequest *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_QuerySitesByCostRequest *r) -{ - int level; - int32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest1(ndr, NDR_SCALARS, &r->req1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest1(ndr, NDR_BUFFERS, &r->req1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostRequest(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostRequest *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "drsuapi_QuerySitesByCostRequest"); - switch (level) { - case 1: - ndr_print_drsuapi_QuerySitesByCostRequest1(ndr, "req1", &r->req1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsBind(struct ndr_push *ndr, int flags, const struct drsuapi_DsBind *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.bind_guid)); - if (r->in.bind_guid) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.bind_guid)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.bind_info)); - if (r->in.bind_info) { - NDR_CHECK(ndr_push_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->in.bind_info)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.bind_info)); - if (r->out.bind_info) { - NDR_CHECK(ndr_push_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->out.bind_info)); - } - if (r->out.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsBind(struct ndr_pull *ndr, int flags, struct drsuapi_DsBind *r) -{ - uint32_t _ptr_bind_guid; - uint32_t _ptr_bind_info; - TALLOC_CTX *_mem_save_bind_guid_0; - TALLOC_CTX *_mem_save_bind_info_0; - TALLOC_CTX *_mem_save_bind_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_guid)); - if (_ptr_bind_guid) { - NDR_PULL_ALLOC(ndr, r->in.bind_guid); - } else { - r->in.bind_guid = NULL; - } - if (r->in.bind_guid) { - _mem_save_bind_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_guid, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.bind_guid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_guid_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_info)); - if (_ptr_bind_info) { - NDR_PULL_ALLOC(ndr, r->in.bind_info); - } else { - r->in.bind_info = NULL; - } - if (r->in.bind_info) { - _mem_save_bind_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_info, 0); - NDR_CHECK(ndr_pull_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->in.bind_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_info_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.bind_handle); - ZERO_STRUCTP(r->out.bind_handle); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_info)); - if (_ptr_bind_info) { - NDR_PULL_ALLOC(ndr, r->out.bind_info); - } else { - r->out.bind_info = NULL; - } - if (r->out.bind_info) { - _mem_save_bind_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_info, 0); - NDR_CHECK(ndr_pull_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->out.bind_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_info_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsBind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsBind *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsBind"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsBind"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_guid", r->in.bind_guid); - ndr->depth++; - if (r->in.bind_guid) { - ndr_print_GUID(ndr, "bind_guid", r->in.bind_guid); - } - ndr->depth--; - ndr_print_ptr(ndr, "bind_info", r->in.bind_info); - ndr->depth++; - if (r->in.bind_info) { - ndr_print_drsuapi_DsBindInfoCtr(ndr, "bind_info", r->in.bind_info); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsBind"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_info", r->out.bind_info); - ndr->depth++; - if (r->out.bind_info) { - ndr_print_drsuapi_DsBindInfoCtr(ndr, "bind_info", r->out.bind_info); - } - ndr->depth--; - ndr_print_ptr(ndr, "bind_handle", r->out.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->out.bind_handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsUnbind(struct ndr_push *ndr, int flags, const struct drsuapi_DsUnbind *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - } - if (flags & NDR_OUT) { - if (r->out.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsUnbind(struct ndr_pull *ndr, int flags, struct drsuapi_DsUnbind *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.bind_handle); - *r->out.bind_handle = *r->in.bind_handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsUnbind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsUnbind *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsUnbind"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsUnbind"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsUnbind"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->out.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->out.bind_handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaSync(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaSync *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSync(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaSync *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaSync(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaSync *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaSync"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsReplicaSync"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_set_switch_value(ndr, &r->in.req, r->in.level); - ndr_print_drsuapi_DsReplicaSyncRequest(ndr, "req", &r->in.req); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsReplicaSync"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNCChanges(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetNCChanges *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); - 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_out)); - NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChanges(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetNCChanges *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_ctr_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNCChanges(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNCChanges *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNCChanges"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsGetNCChanges"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsGetNCChangesRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsGetNCChanges"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_int32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); - ndr_print_drsuapi_DsGetNCChangesCtr(ndr, "ctr", r->out.ctr); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefs(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaUpdateRefs *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefs(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaUpdateRefs *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefs(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaUpdateRefs *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaUpdateRefs"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsReplicaUpdateRefs"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_set_switch_value(ndr, &r->in.req, r->in.level); - ndr_print_drsuapi_DsReplicaUpdateRefsRequest(ndr, "req", &r->in.req); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsReplicaUpdateRefs"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_ADD(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_ADD *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_ADD(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_ADD *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_REPLICA_ADD(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_ADD *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_ADD"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_ADD"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_ADD"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_DEL(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_DEL *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_DEL(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_DEL *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_REPLICA_DEL(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_DEL *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_DEL"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_DEL"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_DEL"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_MODIFY(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_MODIFY *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_MODIFY(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_MODIFY *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_REPLICA_MODIFY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_MODIFY *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_MODIFY"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_MODIFY"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_MODIFY"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_VERIFY_NAMES(struct ndr_push *ndr, int flags, const struct DRSUAPI_VERIFY_NAMES *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_VERIFY_NAMES(struct ndr_pull *ndr, int flags, struct DRSUAPI_VERIFY_NAMES *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_VERIFY_NAMES(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_VERIFY_NAMES *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_VERIFY_NAMES"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_VERIFY_NAMES"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_VERIFY_NAMES"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetMemberships *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); - 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_out)); - NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetMemberships *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_ctr_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsGetMemberships"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsGetMembershipsRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsGetMemberships"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_int32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); - ndr_print_drsuapi_DsGetMembershipsCtr(ndr, "ctr", r->out.ctr); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_push *ndr, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_pull *ndr, int flags, struct DRSUAPI_INTER_DOMAIN_MOVE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_INTER_DOMAIN_MOVE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_INTER_DOMAIN_MOVE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_INTER_DOMAIN_MOVE"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLog(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetNT4ChangeLog *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level_out)); - 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->out.level_out)); - NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLog(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetNT4ChangeLog *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLog(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNT4ChangeLog *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLog"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsGetNT4ChangeLog"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsGetNT4ChangeLogRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsGetNT4ChangeLog"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_uint32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, *r->out.level_out); - ndr_print_drsuapi_DsGetNT4ChangeLogInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsCrackNames(struct ndr_push *ndr, int flags, const struct drsuapi_DsCrackNames *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsNameRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); - 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_out)); - NDR_CHECK(ndr_push_drsuapi_DsNameCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsCrackNames(struct ndr_pull *ndr, int flags, struct drsuapi_DsCrackNames *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_ctr_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsNameRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_DsNameCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsCrackNames(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsCrackNames *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsCrackNames"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsCrackNames"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsNameRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsCrackNames"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_int32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); - ndr_print_drsuapi_DsNameCtr(ndr, "ctr", r->out.ctr); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpn(struct ndr_push *ndr, int flags, const struct drsuapi_DsWriteAccountSpn *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); - if (r->out.res == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.res, *r->out.level_out)); - NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnResult(ndr, NDR_SCALARS, r->out.res)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpn(struct ndr_pull *ndr, int flags, struct drsuapi_DsWriteAccountSpn *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_res_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.res); - ZERO_STRUCTP(r->out.res); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.res); - } - _mem_save_res_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.res, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.res, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnResult(ndr, NDR_SCALARS, r->out.res)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpn(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsWriteAccountSpn *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpn"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsWriteAccountSpn"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsWriteAccountSpnRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsWriteAccountSpn"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_int32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "res", r->out.res); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.res, *r->out.level_out); - ndr_print_drsuapi_DsWriteAccountSpnResult(ndr, "res", r->out.res); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServer(struct ndr_push *ndr, int flags, const struct drsuapi_DsRemoveDSServer *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); - if (r->out.res == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.res, *r->out.level_out)); - NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerResult(ndr, NDR_SCALARS, r->out.res)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServer(struct ndr_pull *ndr, int flags, struct drsuapi_DsRemoveDSServer *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_res_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.res); - ZERO_STRUCTP(r->out.res); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.res); - } - _mem_save_res_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.res, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.res, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerResult(ndr, NDR_SCALARS, r->out.res)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServer(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsRemoveDSServer *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServer"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsRemoveDSServer"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsRemoveDSServerRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsRemoveDSServer"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_int32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "res", r->out.res); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.res, *r->out.level_out); - ndr_print_drsuapi_DsRemoveDSServerResult(ndr, "res", r->out.res); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_push *ndr, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_pull *ndr, int flags, struct DRSUAPI_REMOVE_DS_DOMAIN *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_REMOVE_DS_DOMAIN"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_REMOVE_DS_DOMAIN"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_REMOVE_DS_DOMAIN"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetDomainControllerInfo(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetDomainControllerInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); - 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_out)); - NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetDomainControllerInfo(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetDomainControllerInfo *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_ctr_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetDomainControllerInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetDomainControllerInfo *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetDomainControllerInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsGetDomainControllerInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsGetDCInfoRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsGetDomainControllerInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_int32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); - ndr_print_drsuapi_DsGetDCInfoCtr(ndr, "ctr", r->out.ctr); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAddEntry(struct ndr_push *ndr, int flags, const struct drsuapi_DsAddEntry *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); - 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_out)); - NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAddEntry(struct ndr_pull *ndr, int flags, struct drsuapi_DsAddEntry *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_ctr_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsAddEntry(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsAddEntry *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsAddEntry"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsAddEntry"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsAddEntryRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsAddEntry"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_int32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); - ndr_print_drsuapi_DsAddEntryCtr(ndr, "ctr", r->out.ctr); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_EXECUTE_KCC(struct ndr_push *ndr, int flags, const struct DRSUAPI_EXECUTE_KCC *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_EXECUTE_KCC(struct ndr_pull *ndr, int flags, struct DRSUAPI_EXECUTE_KCC *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_EXECUTE_KCC(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_EXECUTE_KCC *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_EXECUTE_KCC"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_EXECUTE_KCC"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_EXECUTE_KCC"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfo(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaGetInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.info_type == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, *r->out.info_type)); - 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->out.info_type)); - NDR_CHECK(ndr_push_drsuapi_DsReplicaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfo(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaGetInfo *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_info_type_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.info_type); - ZERO_STRUCTP(r->out.info_type); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info_type); - } - _mem_save_info_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info_type, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->out.info_type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_type_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, *r->out.info_type)); - NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaGetInfo *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsReplicaGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_drsuapi_DsReplicaGetInfoLevel(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsReplicaGetInfoRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsReplicaGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info_type", r->out.info_type); - ndr->depth++; - ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", *r->out.info_type); - ndr->depth--; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, *r->out.info_type); - ndr_print_drsuapi_DsReplicaInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_ADD_SID_HISTORY(struct ndr_push *ndr, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_ADD_SID_HISTORY(struct ndr_pull *ndr, int flags, struct DRSUAPI_ADD_SID_HISTORY *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_ADD_SID_HISTORY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_ADD_SID_HISTORY"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_ADD_SID_HISTORY"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_ADD_SID_HISTORY"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetMemberships2 *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); - 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_out)); - NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetMemberships2 *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_ctr_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships2 *r) -{ - ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_DsGetMemberships2"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_DsGetMemberships2Request(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_DsGetMemberships2"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_int32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); - ndr_print_drsuapi_DsGetMemberships2Ctr(ndr, "ctr", r->out.ctr); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_VERIFY_OBJECTS"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_VERIFY_OBJECTS"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_VERIFY_OBJECTS"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_push *ndr, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_pull *ndr, int flags, struct DRSUAPI_GET_OBJECT_EXISTENCE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r) -{ - ndr_print_struct(ndr, name, "DRSUAPI_GET_OBJECT_EXISTENCE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "DRSUAPI_GET_OBJECT_EXISTENCE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "DRSUAPI_GET_OBJECT_EXISTENCE"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCost(struct ndr_push *ndr, int flags, const struct drsuapi_QuerySitesByCost *r) -{ - if (flags & NDR_IN) { - if (r->in.bind_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out)); - 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_out)); - NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCost(struct ndr_pull *ndr, int flags, struct drsuapi_QuerySitesByCost *r) -{ - TALLOC_CTX *_mem_save_bind_handle_0; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_ctr_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.bind_handle); - } - _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out)); - NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_drsuapi_QuerySitesByCost(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_QuerySitesByCost *r) -{ - ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCost"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "drsuapi_QuerySitesByCost"); - ndr->depth++; - ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle); - ndr->depth--; - ndr_print_int32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_drsuapi_QuerySitesByCostRequest(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "drsuapi_QuerySitesByCost"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_int32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out); - ndr_print_drsuapi_QuerySitesByCostCtr(ndr, "ctr", r->out.ctr); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call drsuapi_calls[] = { - { - "drsuapi_DsBind", - sizeof(struct drsuapi_DsBind), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsBind, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsBind, - (ndr_print_function_t) ndr_print_drsuapi_DsBind, - false, - }, - { - "drsuapi_DsUnbind", - sizeof(struct drsuapi_DsUnbind), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsUnbind, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsUnbind, - (ndr_print_function_t) ndr_print_drsuapi_DsUnbind, - false, - }, - { - "drsuapi_DsReplicaSync", - sizeof(struct drsuapi_DsReplicaSync), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaSync, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaSync, - (ndr_print_function_t) ndr_print_drsuapi_DsReplicaSync, - false, - }, - { - "drsuapi_DsGetNCChanges", - sizeof(struct drsuapi_DsGetNCChanges), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNCChanges, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNCChanges, - (ndr_print_function_t) ndr_print_drsuapi_DsGetNCChanges, - false, - }, - { - "drsuapi_DsReplicaUpdateRefs", - sizeof(struct drsuapi_DsReplicaUpdateRefs), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaUpdateRefs, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaUpdateRefs, - (ndr_print_function_t) ndr_print_drsuapi_DsReplicaUpdateRefs, - false, - }, - { - "DRSUAPI_REPLICA_ADD", - sizeof(struct DRSUAPI_REPLICA_ADD), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_ADD, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_ADD, - (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_ADD, - false, - }, - { - "DRSUAPI_REPLICA_DEL", - sizeof(struct DRSUAPI_REPLICA_DEL), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_DEL, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_DEL, - (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_DEL, - false, - }, - { - "DRSUAPI_REPLICA_MODIFY", - sizeof(struct DRSUAPI_REPLICA_MODIFY), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_MODIFY, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_MODIFY, - (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_MODIFY, - false, - }, - { - "DRSUAPI_VERIFY_NAMES", - sizeof(struct DRSUAPI_VERIFY_NAMES), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_VERIFY_NAMES, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_VERIFY_NAMES, - (ndr_print_function_t) ndr_print_DRSUAPI_VERIFY_NAMES, - false, - }, - { - "drsuapi_DsGetMemberships", - sizeof(struct drsuapi_DsGetMemberships), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships, - (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships, - false, - }, - { - "DRSUAPI_INTER_DOMAIN_MOVE", - sizeof(struct DRSUAPI_INTER_DOMAIN_MOVE), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_INTER_DOMAIN_MOVE, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_INTER_DOMAIN_MOVE, - (ndr_print_function_t) ndr_print_DRSUAPI_INTER_DOMAIN_MOVE, - false, - }, - { - "drsuapi_DsGetNT4ChangeLog", - sizeof(struct drsuapi_DsGetNT4ChangeLog), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNT4ChangeLog, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNT4ChangeLog, - (ndr_print_function_t) ndr_print_drsuapi_DsGetNT4ChangeLog, - false, - }, - { - "drsuapi_DsCrackNames", - sizeof(struct drsuapi_DsCrackNames), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsCrackNames, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsCrackNames, - (ndr_print_function_t) ndr_print_drsuapi_DsCrackNames, - false, - }, - { - "drsuapi_DsWriteAccountSpn", - sizeof(struct drsuapi_DsWriteAccountSpn), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsWriteAccountSpn, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsWriteAccountSpn, - (ndr_print_function_t) ndr_print_drsuapi_DsWriteAccountSpn, - false, - }, - { - "drsuapi_DsRemoveDSServer", - sizeof(struct drsuapi_DsRemoveDSServer), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsRemoveDSServer, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsRemoveDSServer, - (ndr_print_function_t) ndr_print_drsuapi_DsRemoveDSServer, - false, - }, - { - "DRSUAPI_REMOVE_DS_DOMAIN", - sizeof(struct DRSUAPI_REMOVE_DS_DOMAIN), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REMOVE_DS_DOMAIN, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REMOVE_DS_DOMAIN, - (ndr_print_function_t) ndr_print_DRSUAPI_REMOVE_DS_DOMAIN, - false, - }, - { - "drsuapi_DsGetDomainControllerInfo", - sizeof(struct drsuapi_DsGetDomainControllerInfo), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetDomainControllerInfo, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetDomainControllerInfo, - (ndr_print_function_t) ndr_print_drsuapi_DsGetDomainControllerInfo, - false, - }, - { - "drsuapi_DsAddEntry", - sizeof(struct drsuapi_DsAddEntry), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsAddEntry, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsAddEntry, - (ndr_print_function_t) ndr_print_drsuapi_DsAddEntry, - false, - }, - { - "DRSUAPI_EXECUTE_KCC", - sizeof(struct DRSUAPI_EXECUTE_KCC), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_EXECUTE_KCC, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_EXECUTE_KCC, - (ndr_print_function_t) ndr_print_DRSUAPI_EXECUTE_KCC, - false, - }, - { - "drsuapi_DsReplicaGetInfo", - sizeof(struct drsuapi_DsReplicaGetInfo), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaGetInfo, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaGetInfo, - (ndr_print_function_t) ndr_print_drsuapi_DsReplicaGetInfo, - false, - }, - { - "DRSUAPI_ADD_SID_HISTORY", - sizeof(struct DRSUAPI_ADD_SID_HISTORY), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_ADD_SID_HISTORY, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_ADD_SID_HISTORY, - (ndr_print_function_t) ndr_print_DRSUAPI_ADD_SID_HISTORY, - false, - }, - { - "drsuapi_DsGetMemberships2", - sizeof(struct drsuapi_DsGetMemberships2), - (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships2, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships2, - (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships2, - false, - }, - { - "DRSUAPI_REPLICA_VERIFY_OBJECTS", - sizeof(struct DRSUAPI_REPLICA_VERIFY_OBJECTS), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_VERIFY_OBJECTS, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_VERIFY_OBJECTS, - (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS, - false, - }, - { - "DRSUAPI_GET_OBJECT_EXISTENCE", - sizeof(struct DRSUAPI_GET_OBJECT_EXISTENCE), - (ndr_push_flags_fn_t) ndr_push_DRSUAPI_GET_OBJECT_EXISTENCE, - (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_GET_OBJECT_EXISTENCE, - (ndr_print_function_t) ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE, - false, - }, - { - "drsuapi_QuerySitesByCost", - sizeof(struct drsuapi_QuerySitesByCost), - (ndr_push_flags_fn_t) ndr_push_drsuapi_QuerySitesByCost, - (ndr_pull_flags_fn_t) ndr_pull_drsuapi_QuerySitesByCost, - (ndr_print_function_t) ndr_print_drsuapi_QuerySitesByCost, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const drsuapi_endpoint_strings[] = { - "ncacn_np:[\\pipe\\lsass]", - "ncacn_np:[\\pipe\\protected_storage]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array drsuapi_endpoints = { - .count = 4, - .names = drsuapi_endpoint_strings -}; - -static const char * const drsuapi_authservice_strings[] = { - "ldap", -}; - -static const struct ndr_interface_string_array drsuapi_authservices = { - .count = 1, - .names = drsuapi_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_drsuapi = { - .name = "drsuapi", - .syntax_id = { - {0xe3514235,0x4b06,0x11d1,{0xab,0x04},{0x00,0xc0,0x4f,0xc2,0xdc,0xd2}}, - NDR_DRSUAPI_VERSION - }, - .helpstring = NDR_DRSUAPI_HELPSTRING, - .num_calls = 25, - .calls = drsuapi_calls, - .endpoints = &drsuapi_endpoints, - .authservices = &drsuapi_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_drsuapi.h b/source3/librpc/gen_ndr/ndr_drsuapi.h deleted file mode 100644 index 4b5ead467f..0000000000 --- a/source3/librpc/gen_ndr/ndr_drsuapi.h +++ /dev/null @@ -1,301 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/drsuapi.h" - -#ifndef _HEADER_NDR_drsuapi -#define _HEADER_NDR_drsuapi - -#include "../librpc/ndr/ndr_drsuapi.h" -#define NDR_DRSUAPI_UUID "e3514235-4b06-11d1-ab04-00c04fc2dcd2" -#define NDR_DRSUAPI_VERSION 4.0 -#define NDR_DRSUAPI_NAME "drsuapi" -#define NDR_DRSUAPI_HELPSTRING "Active Directory Replication" -extern const struct ndr_interface_table ndr_table_drsuapi; -#define NDR_DRSUAPI_DSBIND (0x00) - -#define NDR_DRSUAPI_DSUNBIND (0x01) - -#define NDR_DRSUAPI_DSREPLICASYNC (0x02) - -#define NDR_DRSUAPI_DSGETNCCHANGES (0x03) - -#define NDR_DRSUAPI_DSREPLICAUPDATEREFS (0x04) - -#define NDR_DRSUAPI_REPLICA_ADD (0x05) - -#define NDR_DRSUAPI_REPLICA_DEL (0x06) - -#define NDR_DRSUAPI_REPLICA_MODIFY (0x07) - -#define NDR_DRSUAPI_VERIFY_NAMES (0x08) - -#define NDR_DRSUAPI_DSGETMEMBERSHIPS (0x09) - -#define NDR_DRSUAPI_INTER_DOMAIN_MOVE (0x0a) - -#define NDR_DRSUAPI_DSGETNT4CHANGELOG (0x0b) - -#define NDR_DRSUAPI_DSCRACKNAMES (0x0c) - -#define NDR_DRSUAPI_DSWRITEACCOUNTSPN (0x0d) - -#define NDR_DRSUAPI_DSREMOVEDSSERVER (0x0e) - -#define NDR_DRSUAPI_REMOVE_DS_DOMAIN (0x0f) - -#define NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO (0x10) - -#define NDR_DRSUAPI_DSADDENTRY (0x11) - -#define NDR_DRSUAPI_EXECUTE_KCC (0x12) - -#define NDR_DRSUAPI_DSREPLICAGETINFO (0x13) - -#define NDR_DRSUAPI_ADD_SID_HISTORY (0x14) - -#define NDR_DRSUAPI_DSGETMEMBERSHIPS2 (0x15) - -#define NDR_DRSUAPI_REPLICA_VERIFY_OBJECTS (0x16) - -#define NDR_DRSUAPI_GET_OBJECT_EXISTENCE (0x17) - -#define NDR_DRSUAPI_QUERYSITESBYCOST (0x18) - -#define NDR_DRSUAPI_CALL_COUNT (25) -void ndr_print_drsuapi_SupportedExtensions(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_drsuapi_SupportedExtensionsExt(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_drsuapi_DsBindInfo24(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo24 *r); -void ndr_print_drsuapi_DsBindInfo28(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo28 *r); -void ndr_print_drsuapi_DsBindInfo48(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo48 *r); -void ndr_print_drsuapi_DsBindInfoFallBack(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoFallBack *r); -void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r); -void ndr_print_drsuapi_DsBindInfoCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoCtr *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier *r); -void ndr_print_drsuapi_DsReplicaObjectIdentifier(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier *r); -size_t ndr_size_drsuapi_DsReplicaObjectIdentifier(const struct drsuapi_DsReplicaObjectIdentifier *r, int flags); -enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_drsuapi_DsReplicaSyncOptions(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_drsuapi_DsReplicaSyncRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaSyncRequest1 *r); -void ndr_print_drsuapi_DsReplicaSyncRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaSyncRequest *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaHighWaterMark(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaHighWaterMark *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaHighWaterMark(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaHighWaterMark *r); -void ndr_print_drsuapi_DsReplicaHighWaterMark(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaHighWaterMark *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor *r); -void ndr_print_drsuapi_DsReplicaCursor(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor *r); -void ndr_print_drsuapi_DsReplicaCursorCtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtrEx *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_drsuapi_DsReplicaNeighbourFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_drsuapi_DsExtendedOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedOperation r); -void ndr_print_drsuapi_DsExtendedError(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedError r); -void ndr_print_drsuapi_DsGetNCChangesRequest5(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest5 *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaOID(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOID *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOID *r); -void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r); -void ndr_print_drsuapi_DsReplicaOIDMapping(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping_Ctr *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping_Ctr *r); -void ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping_Ctr *r); -enum ndr_err_code ndr_push_drsuapi_DsAttributeId(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsAttributeId r); -enum ndr_err_code ndr_pull_drsuapi_DsAttributeId(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsAttributeId *r); -void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char *name, enum drsuapi_DsAttributeId r); -void ndr_print_drsuapi_DsPartialAttributeSet(struct ndr_print *ndr, const char *name, const struct drsuapi_DsPartialAttributeSet *r); -void ndr_print_drsuapi_DsGetNCChangesRequest8(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest8 *r); -void ndr_print_drsuapi_DsGetNCChangesRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesRequest *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2 *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2 *r); -void ndr_print_drsuapi_DsReplicaCursor2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2 *r); -void ndr_print_drsuapi_DsReplicaCursor2CtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2CtrEx *r); -void ndr_print_drsuapi_DsAttributeValue(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r); -void ndr_print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValueCtr *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3 *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3 *r); -void ndr_print_drsuapi_DsReplicaObjectIdentifier3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3 *r); -size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplicaObjectIdentifier3 *r, int flags); -enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r); -void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r); -size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags); -enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r); -void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r); -void ndr_print_drsuapi_DsReplicaAttributeCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttributeCtr *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_drsuapi_DsReplicaObjectFlags(struct ndr_print *ndr, const char *name, uint32_t r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaObject(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObject *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaObject(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObject *r); -void ndr_print_drsuapi_DsReplicaObject(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObject *r); -void ndr_print_drsuapi_DsReplicaMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaData *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaDataCtr *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaDataCtr *r); -void ndr_print_drsuapi_DsReplicaMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaDataCtr *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItemEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItemEx *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItemEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItemEx *r); -void ndr_print_drsuapi_DsReplicaObjectListItemEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectListItemEx *r); -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1 *r); -enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1 *r); -void ndr_print_drsuapi_DsGetNCChangesCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1 *r); -size_t ndr_size_drsuapi_DsGetNCChangesCtr1(const struct drsuapi_DsGetNCChangesCtr1 *r, int flags); -enum ndr_err_code ndr_push_drsuapi_DsLinkedAttributeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_drsuapi_DsLinkedAttributeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_drsuapi_DsLinkedAttributeFlags(struct ndr_print *ndr, const char *name, uint32_t r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaLinkedAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaLinkedAttribute *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaLinkedAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaLinkedAttribute *r); -void ndr_print_drsuapi_DsReplicaLinkedAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaLinkedAttribute *r); -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6 *r); -enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6 *r); -void ndr_print_drsuapi_DsGetNCChangesCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6 *r); -size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNCChangesCtr6 *r, int flags); -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r); -enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1TS *r); -void ndr_print_drsuapi_DsGetNCChangesCtr1TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1TS *r); -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6TS *r); -enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6TS *r); -void ndr_print_drsuapi_DsGetNCChangesCtr6TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6TS *r); -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r); -void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r); -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r); -void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r); -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r); -void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r); -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r); -void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r); -void ndr_print_drsuapi_DsGetNCChangesCompressionType(struct ndr_print *ndr, const char *name, enum drsuapi_DsGetNCChangesCompressionType r); -void ndr_print_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCompressedCtr *r); -void ndr_print_drsuapi_DsGetNCChangesCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr2 *r); -void ndr_print_drsuapi_DsGetNCChangesCtr7(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr7 *r); -void ndr_print_drsuapi_DsGetNCChangesCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCtr *r); -void ndr_print_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r); -void ndr_print_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaUpdateRefsRequest *r); -void ndr_print_drsuapi_DsReplicaAddOptions(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_drsuapi_DsReplicaDeleteOptions(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_drsuapi_DsReplicaModifyOptions(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_drsuapi_DsMembershipType(struct ndr_print *ndr, const char *name, enum drsuapi_DsMembershipType r); -void ndr_print_drsuapi_DsGetMembershipsCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsCtr1 *r); -void ndr_print_drsuapi_DsGetMembershipsCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsCtr *r); -void ndr_print_drsuapi_DsGetMembershipsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsRequest1 *r); -void ndr_print_drsuapi_DsGetMembershipsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsRequest *r); -void ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r); -void ndr_print_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogRequest *r); -void ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r); -void ndr_print_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogInfo *r); -void ndr_print_drsuapi_DsNameStatus(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameStatus r); -void ndr_print_drsuapi_DsNameFlags(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFlags r); -void ndr_print_drsuapi_DsNameFormat(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFormat r); -void ndr_print_drsuapi_DsNameString(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameString *r); -void ndr_print_drsuapi_DsNameRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameRequest1 *r); -void ndr_print_drsuapi_DsNameRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameRequest *r); -void ndr_print_drsuapi_DsNameInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameInfo1 *r); -void ndr_print_drsuapi_DsNameCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameCtr1 *r); -void ndr_print_drsuapi_DsNameCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameCtr *r); -void ndr_print_drsuapi_DsSpnOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsSpnOperation r); -void ndr_print_drsuapi_DsWriteAccountSpnRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnRequest1 *r); -void ndr_print_drsuapi_DsWriteAccountSpnRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnRequest *r); -void ndr_print_drsuapi_DsWriteAccountSpnResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnResult1 *r); -void ndr_print_drsuapi_DsWriteAccountSpnResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnResult *r); -void ndr_print_drsuapi_DsRemoveDSServerRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerRequest1 *r); -void ndr_print_drsuapi_DsRemoveDSServerRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerRequest *r); -void ndr_print_drsuapi_DsRemoveDSServerResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerResult1 *r); -void ndr_print_drsuapi_DsRemoveDSServerResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerResult *r); -void ndr_print_drsuapi_DsGetDCInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoRequest1 *r); -void ndr_print_drsuapi_DsGetDCInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoRequest *r); -void ndr_print_drsuapi_DsGetDCInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo1 *r); -void ndr_print_drsuapi_DsGetDCInfoCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr1 *r); -void ndr_print_drsuapi_DsGetDCInfo2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo2 *r); -void ndr_print_drsuapi_DsGetDCInfoCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr2 *r); -void ndr_print_drsuapi_DsGetDCInfo3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo3 *r); -void ndr_print_drsuapi_DsGetDCInfoCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr3 *r); -void ndr_print_drsuapi_DsGetDCConnection01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnection01 *r); -void ndr_print_drsuapi_DsGetDCConnectionCtr01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnectionCtr01 *r); -void ndr_print_drsuapi_DsGetDCInfoCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoCtr *r); -enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItem(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItem *r); -enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItem(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItem *r); -void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectListItem *r); -void ndr_print_drsuapi_DsAddEntryRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryRequest2 *r); -void ndr_print_drsuapi_DsAddEntryRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryRequest *r); -void ndr_print_drsuapi_DsAddEntryErrorInfoX(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfoX *r); -void ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraErrorBuffer *r); -void ndr_print_drsuapi_DsAddEntryExtraError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraError1 *r); -void ndr_print_drsuapi_DsAddEntryErrorListItem1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorListItem1 *r); -void ndr_print_drsuapi_DsAddEntryErrorInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfo1 *r); -void ndr_print_drsuapi_DsAddEntryErrorInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryErrorInfo *r); -void ndr_print_drsuapi_DsAddEntryError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryError1 *r); -void ndr_print_drsuapi_DsAddEntryError(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryError *r); -void ndr_print_drsuapi_DsReplicaObjectIdentifier2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier2 *r); -void ndr_print_drsuapi_DsAddEntryCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr2 *r); -void ndr_print_drsuapi_DsAddEntryCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr3 *r); -void ndr_print_drsuapi_DsAddEntryCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryCtr *r); -void ndr_print_drsuapi_DsReplicaGetInfoLevel(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaGetInfoLevel r); -void ndr_print_drsuapi_DsReplicaInfoType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaInfoType r); -void ndr_print_drsuapi_DsReplicaGetInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest1 *r); -void ndr_print_drsuapi_DsReplicaGetInfoRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest2 *r); -void ndr_print_drsuapi_DsReplicaGetInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaGetInfoRequest *r); -void ndr_print_drsuapi_DsReplicaNeighbour(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbour *r); -void ndr_print_drsuapi_DsReplicaNeighbourCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbourCtr *r); -void ndr_print_drsuapi_DsReplicaCursorCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtr *r); -void ndr_print_drsuapi_DsReplicaObjMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData *r); -void ndr_print_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaDataCtr *r); -void ndr_print_drsuapi_DsReplicaKccDsaFailure(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailure *r); -void ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r); -void ndr_print_drsuapi_DsReplicaOpType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaOpType r); -void ndr_print_drsuapi_DsRplicaOpOptions(struct ndr_print *ndr, const char *name, const union drsuapi_DsRplicaOpOptions *r); -void ndr_print_drsuapi_DsReplicaOp(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOp *r); -void ndr_print_drsuapi_DsReplicaOpCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOpCtr *r); -void ndr_print_drsuapi_DsReplicaAttrValMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData *r); -void ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r); -void ndr_print_drsuapi_DsReplicaCursor2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2Ctr *r); -void ndr_print_drsuapi_DsReplicaCursor3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3 *r); -void ndr_print_drsuapi_DsReplicaCursor3Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3Ctr *r); -void ndr_print_drsuapi_DsReplicaObjMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2 *r); -void ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2Ctr *r); -void ndr_print_drsuapi_DsReplicaAttrValMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2 *r); -void ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r); -void ndr_print_drsuapi_DsReplicaConnection04(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04 *r); -void ndr_print_drsuapi_DsReplicaConnection04Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04Ctr *r); -void ndr_print_drsuapi_DsReplica06(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06 *r); -void ndr_print_drsuapi_DsReplica06Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06Ctr *r); -void ndr_print_drsuapi_DsReplicaInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaInfo *r); -void ndr_print_drsuapi_DsGetMemberships2Ctr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Ctr *r); -void ndr_print_drsuapi_DsGetMemberships2Request1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMemberships2Request1 *r); -void ndr_print_drsuapi_DsGetMemberships2Request(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Request *r); -void ndr_print_drsuapi_DsSiteCostInfo(struct ndr_print *ndr, const char *name, const struct drsuapi_DsSiteCostInfo *r); -void ndr_print_drsuapi_QuerySitesByCostCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostCtr1 *r); -void ndr_print_drsuapi_QuerySitesByCostCtr(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostCtr *r); -void ndr_print_drsuapi_QuerySitesByCostRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostRequest1 *r); -void ndr_print_drsuapi_QuerySitesByCostRequest(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostRequest *r); -enum ndr_err_code ndr_push_drsuapi_DsBind(struct ndr_push *ndr, int flags, const struct drsuapi_DsBind *r); -enum ndr_err_code ndr_pull_drsuapi_DsBind(struct ndr_pull *ndr, int flags, struct drsuapi_DsBind *r); -void ndr_print_drsuapi_DsBind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsBind *r); -void ndr_print_drsuapi_DsUnbind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsUnbind *r); -void ndr_print_drsuapi_DsReplicaSync(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaSync *r); -void ndr_print_drsuapi_DsGetNCChanges(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNCChanges *r); -void ndr_print_drsuapi_DsReplicaUpdateRefs(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaUpdateRefs *r); -void ndr_print_DRSUAPI_REPLICA_ADD(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_ADD *r); -void ndr_print_DRSUAPI_REPLICA_DEL(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_DEL *r); -void ndr_print_DRSUAPI_REPLICA_MODIFY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_MODIFY *r); -void ndr_print_DRSUAPI_VERIFY_NAMES(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_VERIFY_NAMES *r); -void ndr_print_drsuapi_DsGetMemberships(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships *r); -void ndr_print_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r); -void ndr_print_drsuapi_DsGetNT4ChangeLog(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNT4ChangeLog *r); -void ndr_print_drsuapi_DsCrackNames(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsCrackNames *r); -void ndr_print_drsuapi_DsWriteAccountSpn(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsWriteAccountSpn *r); -void ndr_print_drsuapi_DsRemoveDSServer(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsRemoveDSServer *r); -void ndr_print_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r); -void ndr_print_drsuapi_DsGetDomainControllerInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetDomainControllerInfo *r); -enum ndr_err_code ndr_push_drsuapi_DsAddEntry(struct ndr_push *ndr, int flags, const struct drsuapi_DsAddEntry *r); -enum ndr_err_code ndr_pull_drsuapi_DsAddEntry(struct ndr_pull *ndr, int flags, struct drsuapi_DsAddEntry *r); -void ndr_print_drsuapi_DsAddEntry(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsAddEntry *r); -void ndr_print_DRSUAPI_EXECUTE_KCC(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_EXECUTE_KCC *r); -void ndr_print_drsuapi_DsReplicaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaGetInfo *r); -void ndr_print_DRSUAPI_ADD_SID_HISTORY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r); -void ndr_print_drsuapi_DsGetMemberships2(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships2 *r); -void ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r); -void ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r); -void ndr_print_drsuapi_QuerySitesByCost(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_QuerySitesByCost *r); -#endif /* _HEADER_NDR_drsuapi */ diff --git a/source3/librpc/gen_ndr/ndr_dssetup.c b/source3/librpc/gen_ndr/ndr_dssetup.c deleted file mode 100644 index 0c02784db8..0000000000 --- a/source3/librpc/gen_ndr/ndr_dssetup.c +++ /dev/null @@ -1,1082 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_dssetup.h" - -#include "librpc/gen_ndr/ndr_misc.h" -static enum ndr_err_code ndr_push_dssetup_DsRole(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRole r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRole(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRole *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRole(struct ndr_print *ndr, const char *name, enum dssetup_DsRole r) -{ - const char *val = NULL; - - switch (r) { - case DS_ROLE_STANDALONE_WORKSTATION: val = "DS_ROLE_STANDALONE_WORKSTATION"; break; - case DS_ROLE_MEMBER_WORKSTATION: val = "DS_ROLE_MEMBER_WORKSTATION"; break; - case DS_ROLE_STANDALONE_SERVER: val = "DS_ROLE_STANDALONE_SERVER"; break; - case DS_ROLE_MEMBER_SERVER: val = "DS_ROLE_MEMBER_SERVER"; break; - case DS_ROLE_BACKUP_DC: val = "DS_ROLE_BACKUP_DC"; break; - case DS_ROLE_PRIMARY_DC: val = "DS_ROLE_PRIMARY_DC"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DS_RUNNING", DS_ROLE_PRIMARY_DS_RUNNING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DS_MIXED_MODE", DS_ROLE_PRIMARY_DS_MIXED_MODE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_UPGRADE_IN_PROGRESS", DS_ROLE_UPGRADE_IN_PROGRESS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRolePrimaryDomInfoBasic *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dssetup_DsRole(ndr, NDR_SCALARS, r->role)); - NDR_CHECK(ndr_push_dssetup_DsRoleFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_domain)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->dns_domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_domain, ndr_charset_length(r->dns_domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->forest) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->forest, ndr_charset_length(r->forest, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRolePrimaryDomInfoBasic *r) -{ - uint32_t _ptr_domain; - TALLOC_CTX *_mem_save_domain_0; - uint32_t _ptr_dns_domain; - TALLOC_CTX *_mem_save_dns_domain_0; - uint32_t _ptr_forest; - TALLOC_CTX *_mem_save_forest_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dssetup_DsRole(ndr, NDR_SCALARS, &r->role)); - NDR_CHECK(ndr_pull_dssetup_DsRoleFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_domain)); - if (_ptr_dns_domain) { - NDR_PULL_ALLOC(ndr, r->dns_domain); - } else { - r->dns_domain = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest)); - if (_ptr_forest) { - NDR_PULL_ALLOC(ndr, r->forest); - } else { - r->forest = NULL; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - if (r->dns_domain) { - _mem_save_dns_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dns_domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_domain)); - if (ndr_get_array_length(ndr, &r->dns_domain) > ndr_get_array_size(ndr, &r->dns_domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_domain), ndr_get_array_length(ndr, &r->dns_domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_domain, ndr_get_array_length(ndr, &r->dns_domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_domain_0, 0); - } - if (r->forest) { - _mem_save_forest_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->forest, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->forest)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->forest)); - if (ndr_get_array_length(ndr, &r->forest) > ndr_get_array_size(ndr, &r->forest)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->forest), ndr_get_array_length(ndr, &r->forest)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->forest), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->forest, ndr_get_array_length(ndr, &r->forest), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_print *ndr, const char *name, const struct dssetup_DsRolePrimaryDomInfoBasic *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRolePrimaryDomInfoBasic"); - ndr->depth++; - ndr_print_dssetup_DsRole(ndr, "role", r->role); - ndr_print_dssetup_DsRoleFlags(ndr, "flags", r->flags); - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - ndr_print_ptr(ndr, "dns_domain", r->dns_domain); - ndr->depth++; - if (r->dns_domain) { - ndr_print_string(ndr, "dns_domain", r->dns_domain); - } - ndr->depth--; - ndr_print_ptr(ndr, "forest", r->forest); - ndr->depth++; - if (r->forest) { - ndr_print_string(ndr, "forest", r->forest); - } - ndr->depth--; - ndr_print_GUID(ndr, "domain_guid", &r->domain_guid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsUpgrade(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsUpgrade r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsUpgrade(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsUpgrade *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsUpgrade(struct ndr_print *ndr, const char *name, enum dssetup_DsUpgrade r) -{ - const char *val = NULL; - - switch (r) { - case DS_ROLE_NOT_UPGRADING: val = "DS_ROLE_NOT_UPGRADING"; break; - case DS_ROLE_UPGRADING: val = "DS_ROLE_UPGRADING"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dssetup_DsPrevious(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsPrevious r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsPrevious(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsPrevious *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsPrevious(struct ndr_print *ndr, const char *name, enum dssetup_DsPrevious r) -{ - const char *val = NULL; - - switch (r) { - case DS_ROLE_PREVIOUS_UNKNOWN: val = "DS_ROLE_PREVIOUS_UNKNOWN"; break; - case DS_ROLE_PREVIOUS_PRIMARY: val = "DS_ROLE_PREVIOUS_PRIMARY"; break; - case DS_ROLE_PREVIOUS_BACKUP: val = "DS_ROLE_PREVIOUS_BACKUP"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleUpgradeStatus(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRoleUpgradeStatus *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dssetup_DsUpgrade(ndr, NDR_SCALARS, r->upgrading)); - NDR_CHECK(ndr_push_dssetup_DsPrevious(ndr, NDR_SCALARS, r->previous_role)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleUpgradeStatus(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRoleUpgradeStatus *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dssetup_DsUpgrade(ndr, NDR_SCALARS, &r->upgrading)); - NDR_CHECK(ndr_pull_dssetup_DsPrevious(ndr, NDR_SCALARS, &r->previous_role)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleUpgradeStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleUpgradeStatus *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleUpgradeStatus"); - ndr->depth++; - ndr_print_dssetup_DsUpgrade(ndr, "upgrading", r->upgrading); - ndr_print_dssetup_DsPrevious(ndr, "previous_role", r->previous_role); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleOp(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRoleOp r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleOp(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRoleOp *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleOp(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleOp r) -{ - const char *val = NULL; - - switch (r) { - case DS_ROLE_OP_IDLE: val = "DS_ROLE_OP_IDLE"; break; - case DS_ROLE_OP_ACTIVE: val = "DS_ROLE_OP_ACTIVE"; break; - case DS_ROLE_OP_NEEDS_REBOOT: val = "DS_ROLE_OP_NEEDS_REBOOT"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleOpStatus(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRoleOpStatus *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_dssetup_DsRoleOp(ndr, NDR_SCALARS, r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleOpStatus(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRoleOpStatus *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_dssetup_DsRoleOp(ndr, NDR_SCALARS, &r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleOpStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleOpStatus *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleOpStatus"); - ndr->depth++; - ndr_print_dssetup_DsRoleOp(ndr, "status", r->status); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleInfoLevel(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRoleInfoLevel r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleInfoLevel(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRoleInfoLevel *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleInfoLevel(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleInfoLevel r) -{ - const char *val = NULL; - - switch (r) { - case DS_ROLE_BASIC_INFORMATION: val = "DS_ROLE_BASIC_INFORMATION"; break; - case DS_ROLE_UPGRADE_STATUS: val = "DS_ROLE_UPGRADE_STATUS"; break; - case DS_ROLE_OP_STATUS: val = "DS_ROLE_OP_STATUS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleInfo(struct ndr_push *ndr, int ndr_flags, const union dssetup_DsRoleInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, level)); - switch (level) { - case DS_ROLE_BASIC_INFORMATION: { - NDR_CHECK(ndr_push_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_SCALARS, &r->basic)); - break; } - - case DS_ROLE_UPGRADE_STATUS: { - NDR_CHECK(ndr_push_dssetup_DsRoleUpgradeStatus(ndr, NDR_SCALARS, &r->upgrade)); - break; } - - case DS_ROLE_OP_STATUS: { - NDR_CHECK(ndr_push_dssetup_DsRoleOpStatus(ndr, NDR_SCALARS, &r->opstatus)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case DS_ROLE_BASIC_INFORMATION: - NDR_CHECK(ndr_push_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_BUFFERS, &r->basic)); - break; - - case DS_ROLE_UPGRADE_STATUS: - break; - - case DS_ROLE_OP_STATUS: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleInfo(struct ndr_pull *ndr, int ndr_flags, union dssetup_DsRoleInfo *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case DS_ROLE_BASIC_INFORMATION: { - NDR_CHECK(ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_SCALARS, &r->basic)); - break; } - - case DS_ROLE_UPGRADE_STATUS: { - NDR_CHECK(ndr_pull_dssetup_DsRoleUpgradeStatus(ndr, NDR_SCALARS, &r->upgrade)); - break; } - - case DS_ROLE_OP_STATUS: { - NDR_CHECK(ndr_pull_dssetup_DsRoleOpStatus(ndr, NDR_SCALARS, &r->opstatus)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case DS_ROLE_BASIC_INFORMATION: - NDR_CHECK(ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_BUFFERS, &r->basic)); - break; - - case DS_ROLE_UPGRADE_STATUS: - break; - - case DS_ROLE_OP_STATUS: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleInfo(struct ndr_print *ndr, const char *name, const union dssetup_DsRoleInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "dssetup_DsRoleInfo"); - switch (level) { - case DS_ROLE_BASIC_INFORMATION: - ndr_print_dssetup_DsRolePrimaryDomInfoBasic(ndr, "basic", &r->basic); - break; - - case DS_ROLE_UPGRADE_STATUS: - ndr_print_dssetup_DsRoleUpgradeStatus(ndr, "upgrade", &r->upgrade); - break; - - case DS_ROLE_OP_STATUS: - ndr_print_dssetup_DsRoleOpStatus(ndr, "opstatus", &r->opstatus); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_push_dssetup_DsRoleInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetPrimaryDomainInformation *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, &r->in.level)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->out.info); - } else { - r->out.info = NULL; - } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_dssetup_DsRoleInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleGetPrimaryDomainInformation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleGetPrimaryDomainInformation"); - ndr->depth++; - ndr_print_dssetup_DsRoleInfoLevel(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleGetPrimaryDomainInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - if (r->out.info) { - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_dssetup_DsRoleInfo(ndr, "info", r->out.info); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleDnsNameToFlatName(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleDnsNameToFlatName(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDnsNameToFlatName *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleDnsNameToFlatName(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleDnsNameToFlatName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleDnsNameToFlatName"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleDnsNameToFlatName"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleDcAsDc(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDcAsDc *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleDcAsDc(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDcAsDc *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleDcAsDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsDc *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleDcAsDc"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleDcAsDc"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleDcAsDc"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleDcAsReplica(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDcAsReplica *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleDcAsReplica(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDcAsReplica *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleDcAsReplica(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsReplica *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleDcAsReplica"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleDcAsReplica"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleDcAsReplica"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleDemoteDc(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDemoteDc *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleDemoteDc(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDemoteDc *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleDemoteDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDemoteDc *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleDemoteDc"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleDemoteDc"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleDemoteDc"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleGetDcOperationProgress(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleGetDcOperationProgress(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetDcOperationProgress *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleGetDcOperationProgress(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleGetDcOperationProgress"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleGetDcOperationProgress"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleGetDcOperationProgress"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleGetDcOperationResults(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetDcOperationResults *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleGetDcOperationResults(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetDcOperationResults *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleGetDcOperationResults(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationResults *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleGetDcOperationResults"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleGetDcOperationResults"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleGetDcOperationResults"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleCancel(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleCancel *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleCancel(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleCancel *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleCancel(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleCancel *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleCancel"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleCancel"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleCancel"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleServerSaveStateForUpgrade *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleServerSaveStateForUpgrade"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleServerSaveStateForUpgrade"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleServerSaveStateForUpgrade"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleUpgradeDownlevelServer *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleUpgradeDownlevelServer"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleUpgradeDownlevelServer"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleUpgradeDownlevelServer"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleAbortDownlevelServerUpgrade *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r) -{ - ndr_print_struct(ndr, name, "dssetup_DsRoleAbortDownlevelServerUpgrade"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "dssetup_DsRoleAbortDownlevelServerUpgrade"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "dssetup_DsRoleAbortDownlevelServerUpgrade"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call dssetup_calls[] = { - { - "dssetup_DsRoleGetPrimaryDomainInformation", - sizeof(struct dssetup_DsRoleGetPrimaryDomainInformation), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetPrimaryDomainInformation, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetPrimaryDomainInformation, - (ndr_print_function_t) ndr_print_dssetup_DsRoleGetPrimaryDomainInformation, - false, - }, - { - "dssetup_DsRoleDnsNameToFlatName", - sizeof(struct dssetup_DsRoleDnsNameToFlatName), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDnsNameToFlatName, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDnsNameToFlatName, - (ndr_print_function_t) ndr_print_dssetup_DsRoleDnsNameToFlatName, - false, - }, - { - "dssetup_DsRoleDcAsDc", - sizeof(struct dssetup_DsRoleDcAsDc), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsDc, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsDc, - (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsDc, - false, - }, - { - "dssetup_DsRoleDcAsReplica", - sizeof(struct dssetup_DsRoleDcAsReplica), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsReplica, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsReplica, - (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsReplica, - false, - }, - { - "dssetup_DsRoleDemoteDc", - sizeof(struct dssetup_DsRoleDemoteDc), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDemoteDc, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDemoteDc, - (ndr_print_function_t) ndr_print_dssetup_DsRoleDemoteDc, - false, - }, - { - "dssetup_DsRoleGetDcOperationProgress", - sizeof(struct dssetup_DsRoleGetDcOperationProgress), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationProgress, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationProgress, - (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationProgress, - false, - }, - { - "dssetup_DsRoleGetDcOperationResults", - sizeof(struct dssetup_DsRoleGetDcOperationResults), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationResults, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationResults, - (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationResults, - false, - }, - { - "dssetup_DsRoleCancel", - sizeof(struct dssetup_DsRoleCancel), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleCancel, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleCancel, - (ndr_print_function_t) ndr_print_dssetup_DsRoleCancel, - false, - }, - { - "dssetup_DsRoleServerSaveStateForUpgrade", - sizeof(struct dssetup_DsRoleServerSaveStateForUpgrade), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleServerSaveStateForUpgrade, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleServerSaveStateForUpgrade, - (ndr_print_function_t) ndr_print_dssetup_DsRoleServerSaveStateForUpgrade, - false, - }, - { - "dssetup_DsRoleUpgradeDownlevelServer", - sizeof(struct dssetup_DsRoleUpgradeDownlevelServer), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleUpgradeDownlevelServer, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleUpgradeDownlevelServer, - (ndr_print_function_t) ndr_print_dssetup_DsRoleUpgradeDownlevelServer, - false, - }, - { - "dssetup_DsRoleAbortDownlevelServerUpgrade", - sizeof(struct dssetup_DsRoleAbortDownlevelServerUpgrade), - (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleAbortDownlevelServerUpgrade, - (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleAbortDownlevelServerUpgrade, - (ndr_print_function_t) ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const dssetup_endpoint_strings[] = { - "ncacn_np:[\\pipe\\lsarpc]", - "ncacn_np:[\\pipe\\lsass]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array dssetup_endpoints = { - .count = 4, - .names = dssetup_endpoint_strings -}; - -static const char * const dssetup_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array dssetup_authservices = { - .count = 1, - .names = dssetup_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_dssetup = { - .name = "dssetup", - .syntax_id = { - {0x3919286a,0xb10c,0x11d0,{0x9b,0xa8},{0x00,0xc0,0x4f,0xd9,0x2e,0xf5}}, - NDR_DSSETUP_VERSION - }, - .helpstring = NDR_DSSETUP_HELPSTRING, - .num_calls = 11, - .calls = dssetup_calls, - .endpoints = &dssetup_endpoints, - .authservices = &dssetup_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_dssetup.h b/source3/librpc/gen_ndr/ndr_dssetup.h deleted file mode 100644 index 103ad116a3..0000000000 --- a/source3/librpc/gen_ndr/ndr_dssetup.h +++ /dev/null @@ -1,58 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/dssetup.h" - -#ifndef _HEADER_NDR_dssetup -#define _HEADER_NDR_dssetup - -#define NDR_DSSETUP_UUID "3919286a-b10c-11d0-9ba8-00c04fd92ef5" -#define NDR_DSSETUP_VERSION 0.0 -#define NDR_DSSETUP_NAME "dssetup" -#define NDR_DSSETUP_HELPSTRING "Active Directory Setup" -extern const struct ndr_interface_table ndr_table_dssetup; -#define NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION (0x00) - -#define NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME (0x01) - -#define NDR_DSSETUP_DSROLEDCASDC (0x02) - -#define NDR_DSSETUP_DSROLEDCASREPLICA (0x03) - -#define NDR_DSSETUP_DSROLEDEMOTEDC (0x04) - -#define NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS (0x05) - -#define NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS (0x06) - -#define NDR_DSSETUP_DSROLECANCEL (0x07) - -#define NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE (0x08) - -#define NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER (0x09) - -#define NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE (0x0a) - -#define NDR_DSSETUP_CALL_COUNT (11) -void ndr_print_dssetup_DsRole(struct ndr_print *ndr, const char *name, enum dssetup_DsRole r); -void ndr_print_dssetup_DsRoleFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_print *ndr, const char *name, const struct dssetup_DsRolePrimaryDomInfoBasic *r); -void ndr_print_dssetup_DsUpgrade(struct ndr_print *ndr, const char *name, enum dssetup_DsUpgrade r); -void ndr_print_dssetup_DsPrevious(struct ndr_print *ndr, const char *name, enum dssetup_DsPrevious r); -void ndr_print_dssetup_DsRoleUpgradeStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleUpgradeStatus *r); -void ndr_print_dssetup_DsRoleOp(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleOp r); -void ndr_print_dssetup_DsRoleOpStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleOpStatus *r); -void ndr_print_dssetup_DsRoleInfoLevel(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleInfoLevel r); -void ndr_print_dssetup_DsRoleInfo(struct ndr_print *ndr, const char *name, const union dssetup_DsRoleInfo *r); -void ndr_print_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r); -void ndr_print_dssetup_DsRoleDnsNameToFlatName(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r); -void ndr_print_dssetup_DsRoleDcAsDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsDc *r); -void ndr_print_dssetup_DsRoleDcAsReplica(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsReplica *r); -void ndr_print_dssetup_DsRoleDemoteDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDemoteDc *r); -void ndr_print_dssetup_DsRoleGetDcOperationProgress(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r); -void ndr_print_dssetup_DsRoleGetDcOperationResults(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationResults *r); -void ndr_print_dssetup_DsRoleCancel(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleCancel *r); -void ndr_print_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r); -void ndr_print_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r); -void ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r); -#endif /* _HEADER_NDR_dssetup */ diff --git a/source3/librpc/gen_ndr/ndr_echo.c b/source3/librpc/gen_ndr/ndr_echo.c deleted file mode 100644 index 99556e1bff..0000000000 --- a/source3/librpc/gen_ndr/ndr_echo.c +++ /dev/null @@ -1,1513 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_echo.h" - -_PUBLIC_ enum ndr_err_code ndr_push_echo_info1(struct ndr_push *ndr, int ndr_flags, const struct echo_info1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_echo_info1(struct ndr_pull *ndr, int ndr_flags, struct echo_info1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r) -{ - ndr_print_struct(ndr, name, "echo_info1"); - ndr->depth++; - ndr_print_uint8(ndr, "v", r->v); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_info2(struct ndr_push *ndr, int ndr_flags, const struct echo_info2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->v)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_info2(struct ndr_pull *ndr, int ndr_flags, struct echo_info2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->v)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_info2(struct ndr_print *ndr, const char *name, const struct echo_info2 *r) -{ - ndr_print_struct(ndr, name, "echo_info2"); - ndr->depth++; - ndr_print_uint16(ndr, "v", r->v); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_info3(struct ndr_push *ndr, int ndr_flags, const struct echo_info3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->v)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_info3(struct ndr_pull *ndr, int ndr_flags, struct echo_info3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->v)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_info3(struct ndr_print *ndr, const char *name, const struct echo_info3 *r) -{ - ndr_print_struct(ndr, name, "echo_info3"); - ndr->depth++; - ndr_print_uint32(ndr, "v", r->v); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_STRUCT_echo_info4(struct ndr_push *ndr, int ndr_flags, const struct echo_info4 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_STRUCT_echo_info4(struct ndr_pull *ndr, int ndr_flags, struct echo_info4 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_STRUCT_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r) -{ - ndr_print_struct(ndr, name, "echo_info4"); - ndr->depth++; - ndr_print_hyper(ndr, "v", r->v); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_info5(struct ndr_push *ndr, int ndr_flags, const struct echo_info5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_info5(struct ndr_pull *ndr, int ndr_flags, struct echo_info5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_info5(struct ndr_print *ndr, const char *name, const struct echo_info5 *r) -{ - ndr_print_struct(ndr, name, "echo_info5"); - ndr->depth++; - ndr_print_uint8(ndr, "v1", r->v1); - ndr_print_hyper(ndr, "v2", r->v2); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_info6(struct ndr_push *ndr, int ndr_flags, const struct echo_info6 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1)); - NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_info6(struct ndr_pull *ndr, int ndr_flags, struct echo_info6 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1)); - NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_info6(struct ndr_print *ndr, const char *name, const struct echo_info6 *r) -{ - ndr_print_struct(ndr, name, "echo_info6"); - ndr->depth++; - ndr_print_uint8(ndr, "v1", r->v1); - ndr_print_echo_info1(ndr, "info1", &r->info1); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_info7(struct ndr_push *ndr, int ndr_flags, const struct echo_info7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1)); - NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_info7(struct ndr_pull *ndr, int ndr_flags, struct echo_info7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1)); - NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_info7(struct ndr_print *ndr, const char *name, const struct echo_info7 *r) -{ - ndr_print_struct(ndr, name, "echo_info7"); - ndr->depth++; - ndr_print_uint8(ndr, "v1", r->v1); - ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_Info(struct ndr_push *ndr, int ndr_flags, const union echo_Info *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_echo_info2(ndr, NDR_SCALARS, &r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_echo_info3(ndr, NDR_SCALARS, &r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); - break; } - - case 5: { - NDR_CHECK(ndr_push_echo_info5(ndr, NDR_SCALARS, &r->info5)); - break; } - - case 6: { - NDR_CHECK(ndr_push_echo_info6(ndr, NDR_SCALARS, &r->info6)); - break; } - - case 7: { - NDR_CHECK(ndr_push_echo_info7(ndr, NDR_SCALARS, &r->info7)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - break; - - case 2: - break; - - case 3: - break; - - case 4: - break; - - case 5: - break; - - case 6: - break; - - case 7: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_Info(struct ndr_pull *ndr, int ndr_flags, union echo_Info *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_echo_info2(ndr, NDR_SCALARS, &r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_pull_echo_info3(ndr, NDR_SCALARS, &r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); - break; } - - case 5: { - NDR_CHECK(ndr_pull_echo_info5(ndr, NDR_SCALARS, &r->info5)); - break; } - - case 6: { - NDR_CHECK(ndr_pull_echo_info6(ndr, NDR_SCALARS, &r->info6)); - break; } - - case 7: { - NDR_CHECK(ndr_pull_echo_info7(ndr, NDR_SCALARS, &r->info7)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - break; - - case 2: - break; - - case 3: - break; - - case 4: - break; - - case 5: - break; - - case 6: - break; - - case 7: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_Info(struct ndr_print *ndr, const char *name, const union echo_Info *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "echo_Info"); - switch (level) { - case 1: - ndr_print_echo_info1(ndr, "info1", &r->info1); - break; - - case 2: - ndr_print_echo_info2(ndr, "info2", &r->info2); - break; - - case 3: - ndr_print_echo_info3(ndr, "info3", &r->info3); - break; - - case 4: - ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4); - break; - - case 5: - ndr_print_echo_info5(ndr, "info5", &r->info5); - break; - - case 6: - ndr_print_echo_info6(ndr, "info6", &r->info6); - break; - - case 7: - ndr_print_echo_info7(ndr, "info7", &r->info7); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_echo_Enum1(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1 r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_Enum1(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1 *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_Enum1(struct ndr_print *ndr, const char *name, enum echo_Enum1 r) -{ - const char *val = NULL; - - switch (r) { - case ECHO_ENUM1: val = "ECHO_ENUM1"; break; - case ECHO_ENUM2: val = "ECHO_ENUM2"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_echo_Enum1_32(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1_32 r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_Enum1_32(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1_32 *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_Enum1_32(struct ndr_print *ndr, const char *name, enum echo_Enum1_32 r) -{ - const char *val = NULL; - - switch (r) { - case ECHO_ENUM1_32: val = "ECHO_ENUM1_32"; break; - case ECHO_ENUM2_32: val = "ECHO_ENUM2_32"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_echo_Enum2(struct ndr_push *ndr, int ndr_flags, const struct echo_Enum2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1)); - NDR_CHECK(ndr_push_echo_Enum1_32(ndr, NDR_SCALARS, r->e2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_Enum2(struct ndr_pull *ndr, int ndr_flags, struct echo_Enum2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1)); - NDR_CHECK(ndr_pull_echo_Enum1_32(ndr, NDR_SCALARS, &r->e2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_Enum2(struct ndr_print *ndr, const char *name, const struct echo_Enum2 *r) -{ - ndr_print_struct(ndr, name, "echo_Enum2"); - ndr->depth++; - ndr_print_echo_Enum1(ndr, "e1", r->e1); - ndr_print_echo_Enum1_32(ndr, "e2", r->e2); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_Enum3(struct ndr_push *ndr, int ndr_flags, const union echo_Enum3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case ECHO_ENUM1: { - NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1)); - break; } - - case ECHO_ENUM2: { - NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, &r->e2)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case ECHO_ENUM1: - break; - - case ECHO_ENUM2: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_Enum3(struct ndr_pull *ndr, int ndr_flags, union echo_Enum3 *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case ECHO_ENUM1: { - NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1)); - break; } - - case ECHO_ENUM2: { - NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, &r->e2)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case ECHO_ENUM1: - break; - - case ECHO_ENUM2: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_Enum3(struct ndr_print *ndr, const char *name, const union echo_Enum3 *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "echo_Enum3"); - switch (level) { - case ECHO_ENUM1: - ndr_print_echo_Enum1(ndr, "e1", r->e1); - break; - - case ECHO_ENUM2: - ndr_print_echo_Enum2(ndr, "e2", &r->e2); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_echo_Surrounding(struct ndr_push *ndr, int ndr_flags, const struct echo_Surrounding *r) -{ - uint32_t cntr_surrounding_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->x)); - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->x)); - for (cntr_surrounding_0 = 0; cntr_surrounding_0 < r->x; cntr_surrounding_0++) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->surrounding[cntr_surrounding_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_Surrounding(struct ndr_pull *ndr, int ndr_flags, struct echo_Surrounding *r) -{ - uint32_t cntr_surrounding_0; - TALLOC_CTX *_mem_save_surrounding_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->surrounding)); - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->x)); - NDR_PULL_ALLOC_N(ndr, r->surrounding, ndr_get_array_size(ndr, &r->surrounding)); - _mem_save_surrounding_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->surrounding, 0); - for (cntr_surrounding_0 = 0; cntr_surrounding_0 < r->x; cntr_surrounding_0++) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->surrounding[cntr_surrounding_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_surrounding_0, 0); - if (r->surrounding) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->surrounding, r->x)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name, const struct echo_Surrounding *r) -{ - uint32_t cntr_surrounding_0; - ndr_print_struct(ndr, name, "echo_Surrounding"); - ndr->depth++; - ndr_print_uint32(ndr, "x", r->x); - ndr->print(ndr, "%s: ARRAY(%d)", "surrounding", (int)r->x); - ndr->depth++; - for (cntr_surrounding_0=0;cntr_surrounding_0x;cntr_surrounding_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_surrounding_0) != -1) { - ndr_print_uint16(ndr, "surrounding", r->surrounding[cntr_surrounding_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_AddOne(struct ndr_push *ndr, int flags, const struct echo_AddOne *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data)); - } - if (flags & NDR_OUT) { - 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 NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_AddOne(struct ndr_pull *ndr, int flags, struct echo_AddOne *r) -{ - TALLOC_CTX *_mem_save_out_data_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data)); - NDR_PULL_ALLOC(ndr, r->out.out_data); - ZERO_STRUCTP(r->out.out_data); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.out_data); - } - _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, const struct echo_AddOne *r) -{ - ndr_print_struct(ndr, name, "echo_AddOne"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_AddOne"); - ndr->depth++; - ndr_print_uint32(ndr, "in_data", r->in.in_data); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_AddOne"); - ndr->depth++; - ndr_print_ptr(ndr, "out_data", r->out.out_data); - ndr->depth++; - ndr_print_uint32(ndr, "out_data", *r->out.out_data); - ndr->depth--; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_EchoData(struct ndr_push *ndr, int flags, const struct echo_EchoData *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.in_data, r->in.len)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.out_data, r->in.len)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_EchoData(struct ndr_pull *ndr, int flags, struct echo_EchoData *r) -{ - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.in_data)); - NDR_PULL_ALLOC_N(ndr, r->in.in_data, ndr_get_array_size(ndr, &r->in.in_data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.in_data, ndr_get_array_size(ndr, &r->in.in_data))); - if (r->in.in_data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.in_data, r->in.len)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.out_data)); - NDR_PULL_ALLOC_N(ndr, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data))); - if (r->out.out_data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.out_data, r->in.len)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, const struct echo_EchoData *r) -{ - ndr_print_struct(ndr, name, "echo_EchoData"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_EchoData"); - ndr->depth++; - ndr_print_uint32(ndr, "len", r->in.len); - ndr_print_array_uint8(ndr, "in_data", r->in.in_data, r->in.len); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_EchoData"); - ndr->depth++; - ndr_print_array_uint8(ndr, "out_data", r->out.out_data, r->in.len); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_SinkData(struct ndr_push *ndr, int flags, const struct echo_SinkData *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, r->in.len)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_SinkData(struct ndr_pull *ndr, int flags, struct echo_SinkData *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data)); - NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_size(ndr, &r->in.data))); - if (r->in.data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, r->in.len)); - } - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SinkData *r) -{ - ndr_print_struct(ndr, name, "echo_SinkData"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_SinkData"); - ndr->depth++; - ndr_print_uint32(ndr, "len", r->in.len); - ndr_print_array_uint8(ndr, "data", r->in.data, r->in.len); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_SinkData"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_SourceData(struct ndr_push *ndr, int flags, const struct echo_SourceData *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.len)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_SourceData(struct ndr_pull *ndr, int flags, struct echo_SourceData *r) -{ - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data)); - NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_size(ndr, &r->out.data))); - if (r->out.data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.len)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_SourceData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SourceData *r) -{ - ndr_print_struct(ndr, name, "echo_SourceData"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_SourceData"); - ndr->depth++; - ndr_print_uint32(ndr, "len", r->in.len); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_SourceData"); - ndr->depth++; - ndr_print_array_uint8(ndr, "data", r->out.data, r->in.len); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.s2)); - if (*r->out.s2) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.s2, ndr_charset_length(*r->out.s2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_TestCall(struct ndr_pull *ndr, int flags, struct echo_TestCall *r) -{ - uint32_t _ptr_s2; - TALLOC_CTX *_mem_save_s2_0; - TALLOC_CTX *_mem_save_s2_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.s1)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.s1)); - if (ndr_get_array_length(ndr, &r->in.s1) > ndr_get_array_size(ndr, &r->in.s1)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.s1), ndr_get_array_length(ndr, &r->in.s1)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.s1), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.s1, ndr_get_array_length(ndr, &r->in.s1), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_ALLOC(ndr, r->out.s2); - ZERO_STRUCTP(r->out.s2); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.s2); - } - _mem_save_s2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.s2, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s2)); - if (_ptr_s2) { - NDR_PULL_ALLOC(ndr, *r->out.s2); - } else { - *r->out.s2 = NULL; - } - if (*r->out.s2) { - _mem_save_s2_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.s2, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.s2)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.s2)); - if (ndr_get_array_length(ndr, r->out.s2) > ndr_get_array_size(ndr, r->out.s2)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.s2), ndr_get_array_length(ndr, r->out.s2)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.s2, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_0, LIBNDR_FLAG_REF_ALLOC); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall *r) -{ - ndr_print_struct(ndr, name, "echo_TestCall"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_TestCall"); - ndr->depth++; - ndr_print_ptr(ndr, "s1", r->in.s1); - ndr->depth++; - ndr_print_string(ndr, "s1", r->in.s1); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_TestCall"); - ndr->depth++; - ndr_print_ptr(ndr, "s2", r->out.s2); - ndr->depth++; - ndr_print_ptr(ndr, "s2", *r->out.s2); - ndr->depth++; - if (*r->out.s2) { - ndr_print_string(ndr, "s2", *r->out.s2); - } - ndr->depth--; - ndr->depth--; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_TestCall2(struct ndr_push *ndr, int flags, const struct echo_TestCall2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_TestCall2(struct ndr_pull *ndr, int flags, struct echo_TestCall2 *r) -{ - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_echo_Info(ndr, NDR_SCALARS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_TestCall2(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall2 *r) -{ - ndr_print_struct(ndr, name, "echo_TestCall2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_TestCall2"); - ndr->depth++; - ndr_print_uint16(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_TestCall2"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_echo_Info(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_echo_TestSleep(struct ndr_push *ndr, int flags, const struct echo_TestSleep *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.seconds)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_TestSleep(struct ndr_pull *ndr, int flags, struct echo_TestSleep *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.seconds)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_TestSleep(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSleep *r) -{ - ndr_print_struct(ndr, name, "echo_TestSleep"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_TestSleep"); - ndr->depth++; - ndr_print_uint32(ndr, "seconds", r->in.seconds); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_TestSleep"); - ndr->depth++; - ndr_print_uint32(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 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 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 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 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_TestEnum(struct ndr_pull *ndr, int flags, struct echo_TestEnum *r) -{ - TALLOC_CTX *_mem_save_foo1_0; - TALLOC_CTX *_mem_save_foo2_0; - TALLOC_CTX *_mem_save_foo3_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.foo1); - } - _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.foo1, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->in.foo1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.foo2); - } - _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.foo2, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->in.foo2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.foo3); - } - _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.foo3, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.foo3, *r->in.foo1)); - NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->in.foo3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.foo1); - *r->out.foo1 = *r->in.foo1; - NDR_PULL_ALLOC(ndr, r->out.foo2); - *r->out.foo2 = *r->in.foo2; - NDR_PULL_ALLOC(ndr, r->out.foo3); - *r->out.foo3 = *r->in.foo3; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.foo1); - } - _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.foo1, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->out.foo1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.foo2); - } - _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.foo2, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->out.foo2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.foo3); - } - _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.foo3, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.foo3, *r->out.foo1)); - NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->out.foo3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestEnum *r) -{ - ndr_print_struct(ndr, name, "echo_TestEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_TestEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "foo1", r->in.foo1); - ndr->depth++; - ndr_print_echo_Enum1(ndr, "foo1", *r->in.foo1); - ndr->depth--; - ndr_print_ptr(ndr, "foo2", r->in.foo2); - ndr->depth++; - ndr_print_echo_Enum2(ndr, "foo2", r->in.foo2); - ndr->depth--; - ndr_print_ptr(ndr, "foo3", r->in.foo3); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.foo3, *r->in.foo1); - ndr_print_echo_Enum3(ndr, "foo3", r->in.foo3); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_TestEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "foo1", r->out.foo1); - ndr->depth++; - ndr_print_echo_Enum1(ndr, "foo1", *r->out.foo1); - ndr->depth--; - ndr_print_ptr(ndr, "foo2", r->out.foo2); - ndr->depth++; - ndr_print_echo_Enum2(ndr, "foo2", r->out.foo2); - ndr->depth--; - ndr_print_ptr(ndr, "foo3", r->out.foo3); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.foo3, *r->out.foo1); - ndr_print_echo_Enum3(ndr, "foo3", r->out.foo3); - ndr->depth--; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->out.data)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_TestSurrounding(struct ndr_pull *ndr, int flags, struct echo_TestSurrounding *r) -{ - TALLOC_CTX *_mem_save_data_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.data); - } - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->in.data)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.data); - *r->out.data = *r->in.data; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.data); - } - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->out.data)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSurrounding *r) -{ - ndr_print_struct(ndr, name, "echo_TestSurrounding"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_TestSurrounding"); - ndr->depth++; - ndr_print_ptr(ndr, "data", r->in.data); - ndr->depth++; - ndr_print_echo_Surrounding(ndr, "data", r->in.data); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_TestSurrounding"); - ndr->depth++; - ndr_print_ptr(ndr, "data", r->out.data); - ndr->depth++; - ndr_print_echo_Surrounding(ndr, "data", r->out.data); - ndr->depth--; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.data)); - if (*r->in.data) { - NDR_CHECK(ndr_push_unique_ptr(ndr, **r->in.data)); - if (**r->in.data) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ***r->in.data)); - } - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_echo_TestDoublePointer(struct ndr_pull *ndr, int flags, struct echo_TestDoublePointer *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - TALLOC_CTX *_mem_save_data_1; - TALLOC_CTX *_mem_save_data_2; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.data); - } - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, *r->in.data); - } else { - *r->in.data = NULL; - } - if (*r->in.data) { - _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->in.data, 0); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, **r->in.data); - } else { - **r->in.data = NULL; - } - if (**r->in.data) { - _mem_save_data_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, **r->in.data, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, **r->in.data)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_2, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestDoublePointer *r) -{ - ndr_print_struct(ndr, name, "echo_TestDoublePointer"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "echo_TestDoublePointer"); - ndr->depth++; - ndr_print_ptr(ndr, "data", r->in.data); - ndr->depth++; - ndr_print_ptr(ndr, "data", *r->in.data); - ndr->depth++; - if (*r->in.data) { - ndr_print_ptr(ndr, "data", **r->in.data); - ndr->depth++; - if (**r->in.data) { - ndr_print_uint16(ndr, "data", ***r->in.data); - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "echo_TestDoublePointer"); - ndr->depth++; - ndr_print_uint16(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call rpcecho_calls[] = { - { - "echo_AddOne", - sizeof(struct echo_AddOne), - (ndr_push_flags_fn_t) ndr_push_echo_AddOne, - (ndr_pull_flags_fn_t) ndr_pull_echo_AddOne, - (ndr_print_function_t) ndr_print_echo_AddOne, - false, - }, - { - "echo_EchoData", - sizeof(struct echo_EchoData), - (ndr_push_flags_fn_t) ndr_push_echo_EchoData, - (ndr_pull_flags_fn_t) ndr_pull_echo_EchoData, - (ndr_print_function_t) ndr_print_echo_EchoData, - false, - }, - { - "echo_SinkData", - sizeof(struct echo_SinkData), - (ndr_push_flags_fn_t) ndr_push_echo_SinkData, - (ndr_pull_flags_fn_t) ndr_pull_echo_SinkData, - (ndr_print_function_t) ndr_print_echo_SinkData, - false, - }, - { - "echo_SourceData", - sizeof(struct echo_SourceData), - (ndr_push_flags_fn_t) ndr_push_echo_SourceData, - (ndr_pull_flags_fn_t) ndr_pull_echo_SourceData, - (ndr_print_function_t) ndr_print_echo_SourceData, - false, - }, - { - "echo_TestCall", - sizeof(struct echo_TestCall), - (ndr_push_flags_fn_t) ndr_push_echo_TestCall, - (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall, - (ndr_print_function_t) ndr_print_echo_TestCall, - false, - }, - { - "echo_TestCall2", - sizeof(struct echo_TestCall2), - (ndr_push_flags_fn_t) ndr_push_echo_TestCall2, - (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall2, - (ndr_print_function_t) ndr_print_echo_TestCall2, - false, - }, - { - "echo_TestSleep", - sizeof(struct echo_TestSleep), - (ndr_push_flags_fn_t) ndr_push_echo_TestSleep, - (ndr_pull_flags_fn_t) ndr_pull_echo_TestSleep, - (ndr_print_function_t) ndr_print_echo_TestSleep, - false, - }, - { - "echo_TestEnum", - sizeof(struct echo_TestEnum), - (ndr_push_flags_fn_t) ndr_push_echo_TestEnum, - (ndr_pull_flags_fn_t) ndr_pull_echo_TestEnum, - (ndr_print_function_t) ndr_print_echo_TestEnum, - false, - }, - { - "echo_TestSurrounding", - sizeof(struct echo_TestSurrounding), - (ndr_push_flags_fn_t) ndr_push_echo_TestSurrounding, - (ndr_pull_flags_fn_t) ndr_pull_echo_TestSurrounding, - (ndr_print_function_t) ndr_print_echo_TestSurrounding, - false, - }, - { - "echo_TestDoublePointer", - sizeof(struct echo_TestDoublePointer), - (ndr_push_flags_fn_t) ndr_push_echo_TestDoublePointer, - (ndr_pull_flags_fn_t) ndr_pull_echo_TestDoublePointer, - (ndr_print_function_t) ndr_print_echo_TestDoublePointer, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const rpcecho_endpoint_strings[] = { - "ncacn_np:[\\pipe\\rpcecho]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array rpcecho_endpoints = { - .count = 3, - .names = rpcecho_endpoint_strings -}; - -static const char * const rpcecho_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array rpcecho_authservices = { - .count = 1, - .names = rpcecho_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_rpcecho = { - .name = "rpcecho", - .syntax_id = { - {0x60a15ec5,0x4de8,0x11d7,{0xa6,0x37},{0x00,0x50,0x56,0xa2,0x01,0x82}}, - NDR_RPCECHO_VERSION - }, - .helpstring = NDR_RPCECHO_HELPSTRING, - .num_calls = 10, - .calls = rpcecho_calls, - .endpoints = &rpcecho_endpoints, - .authservices = &rpcecho_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_echo.h b/source3/librpc/gen_ndr/ndr_echo.h deleted file mode 100644 index c1c7716573..0000000000 --- a/source3/librpc/gen_ndr/ndr_echo.h +++ /dev/null @@ -1,60 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/echo.h" - -#ifndef _HEADER_NDR_rpcecho -#define _HEADER_NDR_rpcecho - -#define NDR_RPCECHO_UUID "60a15ec5-4de8-11d7-a637-005056a20182" -#define NDR_RPCECHO_VERSION 1.0 -#define NDR_RPCECHO_NAME "rpcecho" -#define NDR_RPCECHO_HELPSTRING "Simple echo pipe" -extern const struct ndr_interface_table ndr_table_rpcecho; -#define NDR_ECHO_ADDONE (0x00) - -#define NDR_ECHO_ECHODATA (0x01) - -#define NDR_ECHO_SINKDATA (0x02) - -#define NDR_ECHO_SOURCEDATA (0x03) - -#define NDR_ECHO_TESTCALL (0x04) - -#define NDR_ECHO_TESTCALL2 (0x05) - -#define NDR_ECHO_TESTSLEEP (0x06) - -#define NDR_ECHO_TESTENUM (0x07) - -#define NDR_ECHO_TESTSURROUNDING (0x08) - -#define NDR_ECHO_TESTDOUBLEPOINTER (0x09) - -#define NDR_RPCECHO_CALL_COUNT (10) -enum ndr_err_code ndr_push_echo_info1(struct ndr_push *ndr, int ndr_flags, const struct echo_info1 *r); -enum ndr_err_code ndr_pull_echo_info1(struct ndr_pull *ndr, int ndr_flags, struct echo_info1 *r); -void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r); -void ndr_print_echo_info2(struct ndr_print *ndr, const char *name, const struct echo_info2 *r); -void ndr_print_echo_info3(struct ndr_print *ndr, const char *name, const struct echo_info3 *r); -void ndr_print_STRUCT_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r); -void ndr_print_echo_info5(struct ndr_print *ndr, const char *name, const struct echo_info5 *r); -void ndr_print_echo_info6(struct ndr_print *ndr, const char *name, const struct echo_info6 *r); -void ndr_print_echo_info7(struct ndr_print *ndr, const char *name, const struct echo_info7 *r); -void ndr_print_echo_Info(struct ndr_print *ndr, const char *name, const union echo_Info *r); -void ndr_print_echo_Enum1(struct ndr_print *ndr, const char *name, enum echo_Enum1 r); -void ndr_print_echo_Enum1_32(struct ndr_print *ndr, const char *name, enum echo_Enum1_32 r); -void ndr_print_echo_Enum2(struct ndr_print *ndr, const char *name, const struct echo_Enum2 *r); -void ndr_print_echo_Enum3(struct ndr_print *ndr, const char *name, const union echo_Enum3 *r); -void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name, const struct echo_Surrounding *r); -void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, const struct echo_AddOne *r); -void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, const struct echo_EchoData *r); -void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SinkData *r); -void ndr_print_echo_SourceData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SourceData *r); -void ndr_print_echo_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall *r); -void ndr_print_echo_TestCall2(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall2 *r); -void ndr_print_echo_TestSleep(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSleep *r); -void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestEnum *r); -void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSurrounding *r); -void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestDoublePointer *r); -#endif /* _HEADER_NDR_rpcecho */ diff --git a/source3/librpc/gen_ndr/ndr_epmapper.c b/source3/librpc/gen_ndr/ndr_epmapper.c deleted file mode 100644 index 0f1005dda7..0000000000 --- a/source3/librpc/gen_ndr/ndr_epmapper.c +++ /dev/null @@ -1,2692 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_epmapper.h" - -#include "librpc/gen_ndr/ndr_misc.h" -static enum ndr_err_code ndr_push_epm_protocol(struct ndr_push *ndr, int ndr_flags, enum epm_protocol r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_protocol(struct ndr_pull *ndr, int ndr_flags, enum epm_protocol *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_protocol(struct ndr_print *ndr, const char *name, enum epm_protocol r) -{ - const char *val = NULL; - - switch (r) { - case EPM_PROTOCOL_DNET_NSP: val = "EPM_PROTOCOL_DNET_NSP"; break; - case EPM_PROTOCOL_OSI_TP4: val = "EPM_PROTOCOL_OSI_TP4"; break; - case EPM_PROTOCOL_OSI_CLNS: val = "EPM_PROTOCOL_OSI_CLNS"; break; - case EPM_PROTOCOL_TCP: val = "EPM_PROTOCOL_TCP"; break; - case EPM_PROTOCOL_UDP: val = "EPM_PROTOCOL_UDP"; break; - case EPM_PROTOCOL_IP: val = "EPM_PROTOCOL_IP"; break; - case EPM_PROTOCOL_NCADG: val = "EPM_PROTOCOL_NCADG"; break; - case EPM_PROTOCOL_NCACN: val = "EPM_PROTOCOL_NCACN"; break; - case EPM_PROTOCOL_NCALRPC: val = "EPM_PROTOCOL_NCALRPC"; break; - case EPM_PROTOCOL_UUID: val = "EPM_PROTOCOL_UUID"; break; - case EPM_PROTOCOL_IPX: val = "EPM_PROTOCOL_IPX"; break; - case EPM_PROTOCOL_SMB: val = "EPM_PROTOCOL_SMB"; break; - case EPM_PROTOCOL_PIPE: val = "EPM_PROTOCOL_PIPE"; break; - case EPM_PROTOCOL_NETBIOS: val = "EPM_PROTOCOL_NETBIOS"; break; - case EPM_PROTOCOL_NETBEUI: val = "EPM_PROTOCOL_NETBEUI"; break; - case EPM_PROTOCOL_SPX: val = "EPM_PROTOCOL_SPX"; break; - case EPM_PROTOCOL_NB_IPX: val = "EPM_PROTOCOL_NB_IPX"; break; - case EPM_PROTOCOL_DSP: val = "EPM_PROTOCOL_DSP"; break; - case EPM_PROTOCOL_DDP: val = "EPM_PROTOCOL_DDP"; break; - case EPM_PROTOCOL_APPLETALK: val = "EPM_PROTOCOL_APPLETALK"; break; - case EPM_PROTOCOL_VINES_SPP: val = "EPM_PROTOCOL_VINES_SPP"; break; - case EPM_PROTOCOL_VINES_IPC: val = "EPM_PROTOCOL_VINES_IPC"; break; - case EPM_PROTOCOL_STREETTALK: val = "EPM_PROTOCOL_STREETTALK"; break; - case EPM_PROTOCOL_HTTP: val = "EPM_PROTOCOL_HTTP"; break; - case EPM_PROTOCOL_UNIX_DS: val = "EPM_PROTOCOL_UNIX_DS"; break; - case EPM_PROTOCOL_NULL: val = "EPM_PROTOCOL_NULL"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_epm_rhs_dnet_nsp(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_dnet_nsp *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_dnet_nsp(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_dnet_nsp *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_dnet_nsp(struct ndr_print *ndr, const char *name, const struct epm_rhs_dnet_nsp *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_dnet_nsp"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_osi_tp4(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_osi_tp4 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_osi_tp4(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_osi_tp4 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_osi_tp4(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_tp4 *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_osi_tp4"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_osi_clns(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_osi_clns *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_osi_clns(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_osi_clns *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_osi_clns(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_clns *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_osi_clns"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_udp(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_udp *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_udp(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_udp *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_udp(struct ndr_print *ndr, const char *name, const struct epm_rhs_udp *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_udp"); - ndr->depth++; - ndr_print_uint16(ndr, "port", r->port); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_tcp(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_tcp *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_tcp(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_tcp *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_tcp(struct ndr_print *ndr, const char *name, const struct epm_rhs_tcp *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_tcp"); - ndr->depth++; - ndr_print_uint16(ndr, "port", r->port); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_ip(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ip *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipaddr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_ip(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ip *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipaddr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_ip(struct ndr_print *ndr, const char *name, const struct epm_rhs_ip *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_ip"); - ndr->depth++; - ndr_print_ipv4address(ndr, "ipaddr", r->ipaddr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_ncadg(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ncadg *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->minor_version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_ncadg(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ncadg *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->minor_version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_ncadg(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncadg *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_ncadg"); - ndr->depth++; - ndr_print_uint16(ndr, "minor_version", r->minor_version); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_ncacn(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ncacn *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->minor_version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_ncacn(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ncacn *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->minor_version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_ncacn(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncacn *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_ncacn"); - ndr->depth++; - ndr_print_uint16(ndr, "minor_version", r->minor_version); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_uuid(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_uuid *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->unknown)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_uuid(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_uuid *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->unknown)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_uuid(struct ndr_print *ndr, const char *name, const struct epm_rhs_uuid *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_uuid"); - ndr->depth++; - ndr_print_DATA_BLOB(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_ipx(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ipx *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_ipx(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ipx *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_ipx *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_ipx"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_smb(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_smb *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unc)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_smb(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_smb *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unc)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_smb(struct ndr_print *ndr, const char *name, const struct epm_rhs_smb *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_smb"); - ndr->depth++; - ndr_print_string(ndr, "unc", r->unc); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_pipe(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_pipe *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->path)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_pipe(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_pipe *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_pipe(struct ndr_print *ndr, const char *name, const struct epm_rhs_pipe *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_pipe"); - ndr->depth++; - ndr_print_string(ndr, "path", r->path); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_netbios(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_netbios *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_netbios(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_netbios *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_netbios(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbios *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_netbios"); - ndr->depth++; - ndr_print_string(ndr, "name", r->name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_netbeui(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_netbeui *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_netbeui(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_netbeui *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_netbeui(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbeui *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_netbeui"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_spx(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_spx *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_spx(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_spx *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_spx(struct ndr_print *ndr, const char *name, const struct epm_rhs_spx *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_spx"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_nb_ipx(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_nb_ipx *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_nb_ipx(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_nb_ipx *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_nb_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_nb_ipx *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_nb_ipx"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_http(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_http *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_http(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_http *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_http(struct ndr_print *ndr, const char *name, const struct epm_rhs_http *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_http"); - ndr->depth++; - ndr_print_uint16(ndr, "port", r->port); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_unix_ds(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_unix_ds *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->path)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_unix_ds(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_unix_ds *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_unix_ds(struct ndr_print *ndr, const char *name, const struct epm_rhs_unix_ds *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_unix_ds"); - ndr->depth++; - ndr_print_string(ndr, "path", r->path); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_null(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_null *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_null(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_null *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_null(struct ndr_print *ndr, const char *name, const struct epm_rhs_null *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_null"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_ncalrpc(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_ncalrpc *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->minor_version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_ncalrpc(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_ncalrpc *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->minor_version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_ncalrpc(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncalrpc *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_ncalrpc"); - ndr->depth++; - ndr_print_uint16(ndr, "minor_version", r->minor_version); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_appletalk(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_appletalk *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_appletalk(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_appletalk *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_appletalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_appletalk *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_appletalk"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_atalk_stream(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_atalk_stream *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_atalk_stream(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_atalk_stream *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_atalk_stream(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_stream *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_atalk_stream"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_atalk_datagram(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_atalk_datagram *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_atalk_datagram(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_atalk_datagram *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_atalk_datagram(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_datagram *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_atalk_datagram"); - ndr->depth++; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_vines_spp(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_vines_spp *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_vines_spp(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_vines_spp *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_vines_spp(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_spp *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_vines_spp"); - ndr->depth++; - ndr_print_uint16(ndr, "port", r->port); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_vines_ipc(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_vines_ipc *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_vines_ipc(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_vines_ipc *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->port)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_vines_ipc(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_ipc *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_vines_ipc"); - ndr->depth++; - ndr_print_uint16(ndr, "port", r->port); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs_streettalk(struct ndr_push *ndr, int ndr_flags, const struct epm_rhs_streettalk *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->streettalk)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs_streettalk(struct ndr_pull *ndr, int ndr_flags, struct epm_rhs_streettalk *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->streettalk)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs_streettalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_streettalk *r) -{ - ndr_print_struct(ndr, name, "epm_rhs_streettalk"); - ndr->depth++; - ndr_print_string(ndr, "streettalk", r->streettalk); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_rhs(struct ndr_push *ndr, int ndr_flags, const union epm_rhs *r) -{ - { - uint32_t _flags_save_UNION = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case EPM_PROTOCOL_DNET_NSP: { - NDR_CHECK(ndr_push_epm_rhs_dnet_nsp(ndr, NDR_SCALARS, &r->dnet_nsp)); - break; } - - case EPM_PROTOCOL_OSI_TP4: { - NDR_CHECK(ndr_push_epm_rhs_osi_tp4(ndr, NDR_SCALARS, &r->osi_tp4)); - break; } - - case EPM_PROTOCOL_OSI_CLNS: { - NDR_CHECK(ndr_push_epm_rhs_osi_clns(ndr, NDR_SCALARS, &r->osi_clns)); - break; } - - case EPM_PROTOCOL_TCP: { - NDR_CHECK(ndr_push_epm_rhs_tcp(ndr, NDR_SCALARS, &r->tcp)); - break; } - - case EPM_PROTOCOL_UDP: { - NDR_CHECK(ndr_push_epm_rhs_udp(ndr, NDR_SCALARS, &r->udp)); - break; } - - case EPM_PROTOCOL_IP: { - NDR_CHECK(ndr_push_epm_rhs_ip(ndr, NDR_SCALARS, &r->ip)); - break; } - - case EPM_PROTOCOL_NCADG: { - NDR_CHECK(ndr_push_epm_rhs_ncadg(ndr, NDR_SCALARS, &r->ncadg)); - break; } - - case EPM_PROTOCOL_NCACN: { - NDR_CHECK(ndr_push_epm_rhs_ncacn(ndr, NDR_SCALARS, &r->ncacn)); - break; } - - case EPM_PROTOCOL_NCALRPC: { - NDR_CHECK(ndr_push_epm_rhs_ncalrpc(ndr, NDR_SCALARS, &r->ncalrpc)); - break; } - - case EPM_PROTOCOL_UUID: { - NDR_CHECK(ndr_push_epm_rhs_uuid(ndr, NDR_SCALARS, &r->uuid)); - break; } - - case EPM_PROTOCOL_IPX: { - NDR_CHECK(ndr_push_epm_rhs_ipx(ndr, NDR_SCALARS, &r->ipx)); - break; } - - case EPM_PROTOCOL_SMB: { - NDR_CHECK(ndr_push_epm_rhs_smb(ndr, NDR_SCALARS, &r->smb)); - break; } - - case EPM_PROTOCOL_PIPE: { - NDR_CHECK(ndr_push_epm_rhs_pipe(ndr, NDR_SCALARS, &r->pipe)); - break; } - - case EPM_PROTOCOL_NETBIOS: { - NDR_CHECK(ndr_push_epm_rhs_netbios(ndr, NDR_SCALARS, &r->netbios)); - break; } - - case EPM_PROTOCOL_NETBEUI: { - NDR_CHECK(ndr_push_epm_rhs_netbeui(ndr, NDR_SCALARS, &r->netbeui)); - break; } - - case EPM_PROTOCOL_SPX: { - NDR_CHECK(ndr_push_epm_rhs_spx(ndr, NDR_SCALARS, &r->spx)); - break; } - - case EPM_PROTOCOL_NB_IPX: { - NDR_CHECK(ndr_push_epm_rhs_nb_ipx(ndr, NDR_SCALARS, &r->nb_ipx)); - break; } - - case EPM_PROTOCOL_DSP: { - NDR_CHECK(ndr_push_epm_rhs_atalk_stream(ndr, NDR_SCALARS, &r->atalk_stream)); - break; } - - case EPM_PROTOCOL_DDP: { - NDR_CHECK(ndr_push_epm_rhs_atalk_datagram(ndr, NDR_SCALARS, &r->atalk_datagram)); - break; } - - case EPM_PROTOCOL_APPLETALK: { - NDR_CHECK(ndr_push_epm_rhs_appletalk(ndr, NDR_SCALARS, &r->appletalk)); - break; } - - case EPM_PROTOCOL_VINES_SPP: { - NDR_CHECK(ndr_push_epm_rhs_vines_spp(ndr, NDR_SCALARS, &r->vines_spp)); - break; } - - case EPM_PROTOCOL_VINES_IPC: { - NDR_CHECK(ndr_push_epm_rhs_vines_ipc(ndr, NDR_SCALARS, &r->vines_ipc)); - break; } - - case EPM_PROTOCOL_STREETTALK: { - NDR_CHECK(ndr_push_epm_rhs_streettalk(ndr, NDR_SCALARS, &r->streettalk)); - break; } - - case EPM_PROTOCOL_HTTP: { - NDR_CHECK(ndr_push_epm_rhs_http(ndr, NDR_SCALARS, &r->http)); - break; } - - case EPM_PROTOCOL_UNIX_DS: { - NDR_CHECK(ndr_push_epm_rhs_unix_ds(ndr, NDR_SCALARS, &r->unix_ds)); - break; } - - case EPM_PROTOCOL_NULL: { - NDR_CHECK(ndr_push_epm_rhs_null(ndr, NDR_SCALARS, &r->null)); - break; } - - default: { - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->unknown)); - ndr->flags = _flags_save_DATA_BLOB; - } - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case EPM_PROTOCOL_DNET_NSP: - break; - - case EPM_PROTOCOL_OSI_TP4: - break; - - case EPM_PROTOCOL_OSI_CLNS: - break; - - case EPM_PROTOCOL_TCP: - break; - - case EPM_PROTOCOL_UDP: - break; - - case EPM_PROTOCOL_IP: - break; - - case EPM_PROTOCOL_NCADG: - break; - - case EPM_PROTOCOL_NCACN: - break; - - case EPM_PROTOCOL_NCALRPC: - break; - - case EPM_PROTOCOL_UUID: - break; - - case EPM_PROTOCOL_IPX: - break; - - case EPM_PROTOCOL_SMB: - break; - - case EPM_PROTOCOL_PIPE: - break; - - case EPM_PROTOCOL_NETBIOS: - break; - - case EPM_PROTOCOL_NETBEUI: - break; - - case EPM_PROTOCOL_SPX: - break; - - case EPM_PROTOCOL_NB_IPX: - break; - - case EPM_PROTOCOL_DSP: - break; - - case EPM_PROTOCOL_DDP: - break; - - case EPM_PROTOCOL_APPLETALK: - break; - - case EPM_PROTOCOL_VINES_SPP: - break; - - case EPM_PROTOCOL_VINES_IPC: - break; - - case EPM_PROTOCOL_STREETTALK: - break; - - case EPM_PROTOCOL_HTTP: - break; - - case EPM_PROTOCOL_UNIX_DS: - break; - - case EPM_PROTOCOL_NULL: - break; - - default: - break; - - } - } - ndr->flags = _flags_save_UNION; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_rhs(struct ndr_pull *ndr, int ndr_flags, union epm_rhs *r) -{ - int level; - { - uint32_t _flags_save_UNION = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case EPM_PROTOCOL_DNET_NSP: { - NDR_CHECK(ndr_pull_epm_rhs_dnet_nsp(ndr, NDR_SCALARS, &r->dnet_nsp)); - break; } - - case EPM_PROTOCOL_OSI_TP4: { - NDR_CHECK(ndr_pull_epm_rhs_osi_tp4(ndr, NDR_SCALARS, &r->osi_tp4)); - break; } - - case EPM_PROTOCOL_OSI_CLNS: { - NDR_CHECK(ndr_pull_epm_rhs_osi_clns(ndr, NDR_SCALARS, &r->osi_clns)); - break; } - - case EPM_PROTOCOL_TCP: { - NDR_CHECK(ndr_pull_epm_rhs_tcp(ndr, NDR_SCALARS, &r->tcp)); - break; } - - case EPM_PROTOCOL_UDP: { - NDR_CHECK(ndr_pull_epm_rhs_udp(ndr, NDR_SCALARS, &r->udp)); - break; } - - case EPM_PROTOCOL_IP: { - NDR_CHECK(ndr_pull_epm_rhs_ip(ndr, NDR_SCALARS, &r->ip)); - break; } - - case EPM_PROTOCOL_NCADG: { - NDR_CHECK(ndr_pull_epm_rhs_ncadg(ndr, NDR_SCALARS, &r->ncadg)); - break; } - - case EPM_PROTOCOL_NCACN: { - NDR_CHECK(ndr_pull_epm_rhs_ncacn(ndr, NDR_SCALARS, &r->ncacn)); - break; } - - case EPM_PROTOCOL_NCALRPC: { - NDR_CHECK(ndr_pull_epm_rhs_ncalrpc(ndr, NDR_SCALARS, &r->ncalrpc)); - break; } - - case EPM_PROTOCOL_UUID: { - NDR_CHECK(ndr_pull_epm_rhs_uuid(ndr, NDR_SCALARS, &r->uuid)); - break; } - - case EPM_PROTOCOL_IPX: { - NDR_CHECK(ndr_pull_epm_rhs_ipx(ndr, NDR_SCALARS, &r->ipx)); - break; } - - case EPM_PROTOCOL_SMB: { - NDR_CHECK(ndr_pull_epm_rhs_smb(ndr, NDR_SCALARS, &r->smb)); - break; } - - case EPM_PROTOCOL_PIPE: { - NDR_CHECK(ndr_pull_epm_rhs_pipe(ndr, NDR_SCALARS, &r->pipe)); - break; } - - case EPM_PROTOCOL_NETBIOS: { - NDR_CHECK(ndr_pull_epm_rhs_netbios(ndr, NDR_SCALARS, &r->netbios)); - break; } - - case EPM_PROTOCOL_NETBEUI: { - NDR_CHECK(ndr_pull_epm_rhs_netbeui(ndr, NDR_SCALARS, &r->netbeui)); - break; } - - case EPM_PROTOCOL_SPX: { - NDR_CHECK(ndr_pull_epm_rhs_spx(ndr, NDR_SCALARS, &r->spx)); - break; } - - case EPM_PROTOCOL_NB_IPX: { - NDR_CHECK(ndr_pull_epm_rhs_nb_ipx(ndr, NDR_SCALARS, &r->nb_ipx)); - break; } - - case EPM_PROTOCOL_DSP: { - NDR_CHECK(ndr_pull_epm_rhs_atalk_stream(ndr, NDR_SCALARS, &r->atalk_stream)); - break; } - - case EPM_PROTOCOL_DDP: { - NDR_CHECK(ndr_pull_epm_rhs_atalk_datagram(ndr, NDR_SCALARS, &r->atalk_datagram)); - break; } - - case EPM_PROTOCOL_APPLETALK: { - NDR_CHECK(ndr_pull_epm_rhs_appletalk(ndr, NDR_SCALARS, &r->appletalk)); - break; } - - case EPM_PROTOCOL_VINES_SPP: { - NDR_CHECK(ndr_pull_epm_rhs_vines_spp(ndr, NDR_SCALARS, &r->vines_spp)); - break; } - - case EPM_PROTOCOL_VINES_IPC: { - NDR_CHECK(ndr_pull_epm_rhs_vines_ipc(ndr, NDR_SCALARS, &r->vines_ipc)); - break; } - - case EPM_PROTOCOL_STREETTALK: { - NDR_CHECK(ndr_pull_epm_rhs_streettalk(ndr, NDR_SCALARS, &r->streettalk)); - break; } - - case EPM_PROTOCOL_HTTP: { - NDR_CHECK(ndr_pull_epm_rhs_http(ndr, NDR_SCALARS, &r->http)); - break; } - - case EPM_PROTOCOL_UNIX_DS: { - NDR_CHECK(ndr_pull_epm_rhs_unix_ds(ndr, NDR_SCALARS, &r->unix_ds)); - break; } - - case EPM_PROTOCOL_NULL: { - NDR_CHECK(ndr_pull_epm_rhs_null(ndr, NDR_SCALARS, &r->null)); - break; } - - default: { - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->unknown)); - ndr->flags = _flags_save_DATA_BLOB; - } - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case EPM_PROTOCOL_DNET_NSP: - break; - - case EPM_PROTOCOL_OSI_TP4: - break; - - case EPM_PROTOCOL_OSI_CLNS: - break; - - case EPM_PROTOCOL_TCP: - break; - - case EPM_PROTOCOL_UDP: - break; - - case EPM_PROTOCOL_IP: - break; - - case EPM_PROTOCOL_NCADG: - break; - - case EPM_PROTOCOL_NCACN: - break; - - case EPM_PROTOCOL_NCALRPC: - break; - - case EPM_PROTOCOL_UUID: - break; - - case EPM_PROTOCOL_IPX: - break; - - case EPM_PROTOCOL_SMB: - break; - - case EPM_PROTOCOL_PIPE: - break; - - case EPM_PROTOCOL_NETBIOS: - break; - - case EPM_PROTOCOL_NETBEUI: - break; - - case EPM_PROTOCOL_SPX: - break; - - case EPM_PROTOCOL_NB_IPX: - break; - - case EPM_PROTOCOL_DSP: - break; - - case EPM_PROTOCOL_DDP: - break; - - case EPM_PROTOCOL_APPLETALK: - break; - - case EPM_PROTOCOL_VINES_SPP: - break; - - case EPM_PROTOCOL_VINES_IPC: - break; - - case EPM_PROTOCOL_STREETTALK: - break; - - case EPM_PROTOCOL_HTTP: - break; - - case EPM_PROTOCOL_UNIX_DS: - break; - - case EPM_PROTOCOL_NULL: - break; - - default: - break; - - } - } - ndr->flags = _flags_save_UNION; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_rhs(struct ndr_print *ndr, const char *name, const union epm_rhs *r) -{ - int level; - { - uint32_t _flags_save_UNION = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "epm_rhs"); - switch (level) { - case EPM_PROTOCOL_DNET_NSP: - ndr_print_epm_rhs_dnet_nsp(ndr, "dnet_nsp", &r->dnet_nsp); - break; - - case EPM_PROTOCOL_OSI_TP4: - ndr_print_epm_rhs_osi_tp4(ndr, "osi_tp4", &r->osi_tp4); - break; - - case EPM_PROTOCOL_OSI_CLNS: - ndr_print_epm_rhs_osi_clns(ndr, "osi_clns", &r->osi_clns); - break; - - case EPM_PROTOCOL_TCP: - ndr_print_epm_rhs_tcp(ndr, "tcp", &r->tcp); - break; - - case EPM_PROTOCOL_UDP: - ndr_print_epm_rhs_udp(ndr, "udp", &r->udp); - break; - - case EPM_PROTOCOL_IP: - ndr_print_epm_rhs_ip(ndr, "ip", &r->ip); - break; - - case EPM_PROTOCOL_NCADG: - ndr_print_epm_rhs_ncadg(ndr, "ncadg", &r->ncadg); - break; - - case EPM_PROTOCOL_NCACN: - ndr_print_epm_rhs_ncacn(ndr, "ncacn", &r->ncacn); - break; - - case EPM_PROTOCOL_NCALRPC: - ndr_print_epm_rhs_ncalrpc(ndr, "ncalrpc", &r->ncalrpc); - break; - - case EPM_PROTOCOL_UUID: - ndr_print_epm_rhs_uuid(ndr, "uuid", &r->uuid); - break; - - case EPM_PROTOCOL_IPX: - ndr_print_epm_rhs_ipx(ndr, "ipx", &r->ipx); - break; - - case EPM_PROTOCOL_SMB: - ndr_print_epm_rhs_smb(ndr, "smb", &r->smb); - break; - - case EPM_PROTOCOL_PIPE: - ndr_print_epm_rhs_pipe(ndr, "pipe", &r->pipe); - break; - - case EPM_PROTOCOL_NETBIOS: - ndr_print_epm_rhs_netbios(ndr, "netbios", &r->netbios); - break; - - case EPM_PROTOCOL_NETBEUI: - ndr_print_epm_rhs_netbeui(ndr, "netbeui", &r->netbeui); - break; - - case EPM_PROTOCOL_SPX: - ndr_print_epm_rhs_spx(ndr, "spx", &r->spx); - break; - - case EPM_PROTOCOL_NB_IPX: - ndr_print_epm_rhs_nb_ipx(ndr, "nb_ipx", &r->nb_ipx); - break; - - case EPM_PROTOCOL_DSP: - ndr_print_epm_rhs_atalk_stream(ndr, "atalk_stream", &r->atalk_stream); - break; - - case EPM_PROTOCOL_DDP: - ndr_print_epm_rhs_atalk_datagram(ndr, "atalk_datagram", &r->atalk_datagram); - break; - - case EPM_PROTOCOL_APPLETALK: - ndr_print_epm_rhs_appletalk(ndr, "appletalk", &r->appletalk); - break; - - case EPM_PROTOCOL_VINES_SPP: - ndr_print_epm_rhs_vines_spp(ndr, "vines_spp", &r->vines_spp); - break; - - case EPM_PROTOCOL_VINES_IPC: - ndr_print_epm_rhs_vines_ipc(ndr, "vines_ipc", &r->vines_ipc); - break; - - case EPM_PROTOCOL_STREETTALK: - ndr_print_epm_rhs_streettalk(ndr, "streettalk", &r->streettalk); - break; - - case EPM_PROTOCOL_HTTP: - ndr_print_epm_rhs_http(ndr, "http", &r->http); - break; - - case EPM_PROTOCOL_UNIX_DS: - ndr_print_epm_rhs_unix_ds(ndr, "unix_ds", &r->unix_ds); - break; - - case EPM_PROTOCOL_NULL: - ndr_print_epm_rhs_null(ndr, "null", &r->null); - break; - - default: - ndr_print_DATA_BLOB(ndr, "unknown", r->unknown); - break; - - } - ndr->flags = _flags_save_UNION; - } -} - -static enum ndr_err_code ndr_push_epm_lhs(struct ndr_push *ndr, int ndr_flags, const struct epm_lhs *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_epm_protocol(ndr, NDR_SCALARS, r->protocol)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->lhs_data)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_lhs(struct ndr_pull *ndr, int ndr_flags, struct epm_lhs *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_epm_protocol(ndr, NDR_SCALARS, &r->protocol)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->lhs_data)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_lhs(struct ndr_print *ndr, const char *name, const struct epm_lhs *r) -{ - ndr_print_struct(ndr, name, "epm_lhs"); - ndr->depth++; - ndr_print_epm_protocol(ndr, "protocol", r->protocol); - ndr_print_DATA_BLOB(ndr, "lhs_data", r->lhs_data); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_floor(struct ndr_push *ndr, int ndr_flags, const struct epm_floor *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - { - struct ndr_push *_ndr_lhs; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_lhs, 2, -1)); - NDR_CHECK(ndr_push_epm_lhs(_ndr_lhs, NDR_SCALARS, &r->lhs)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_lhs, 2, -1)); - } - { - struct ndr_push *_ndr_rhs; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_rhs, 2, -1)); - NDR_CHECK(ndr_push_set_switch_value(_ndr_rhs, &r->rhs, r->lhs.protocol)); - NDR_CHECK(ndr_push_epm_rhs(_ndr_rhs, NDR_SCALARS, &r->rhs)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_rhs, 2, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_floor(struct ndr_pull *ndr, int ndr_flags, struct epm_floor *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - { - struct ndr_pull *_ndr_lhs; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_lhs, 2, -1)); - NDR_CHECK(ndr_pull_epm_lhs(_ndr_lhs, NDR_SCALARS, &r->lhs)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_lhs, 2, -1)); - } - { - struct ndr_pull *_ndr_rhs; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_rhs, 2, -1)); - NDR_CHECK(ndr_pull_set_switch_value(_ndr_rhs, &r->rhs, r->lhs.protocol)); - NDR_CHECK(ndr_pull_epm_rhs(_ndr_rhs, NDR_SCALARS, &r->rhs)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_rhs, 2, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_floor(struct ndr_print *ndr, const char *name, const struct epm_floor *r) -{ - ndr_print_struct(ndr, name, "epm_floor"); - ndr->depth++; - ndr_print_epm_lhs(ndr, "lhs", &r->lhs); - ndr_print_set_switch_value(ndr, &r->rhs, r->lhs.protocol); - ndr_print_epm_rhs(ndr, "rhs", &r->rhs); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_tower(struct ndr_push *ndr, int ndr_flags, const struct epm_tower *r) -{ - uint32_t cntr_floors_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_floors)); - for (cntr_floors_0 = 0; cntr_floors_0 < r->num_floors; cntr_floors_0++) { - NDR_CHECK(ndr_push_epm_floor(ndr, NDR_SCALARS, &r->floors[cntr_floors_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_tower(struct ndr_pull *ndr, int ndr_flags, struct epm_tower *r) -{ - uint32_t cntr_floors_0; - TALLOC_CTX *_mem_save_floors_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_floors)); - NDR_PULL_ALLOC_N(ndr, r->floors, r->num_floors); - _mem_save_floors_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->floors, 0); - for (cntr_floors_0 = 0; cntr_floors_0 < r->num_floors; cntr_floors_0++) { - NDR_CHECK(ndr_pull_epm_floor(ndr, NDR_SCALARS, &r->floors[cntr_floors_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_floors_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_tower(struct ndr_print *ndr, const char *name, const struct epm_tower *r) -{ - uint32_t cntr_floors_0; - ndr_print_struct(ndr, name, "epm_tower"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN); - ndr->depth++; - ndr_print_uint16(ndr, "num_floors", r->num_floors); - ndr->print(ndr, "%s: ARRAY(%d)", "floors", (int)r->num_floors); - ndr->depth++; - for (cntr_floors_0=0;cntr_floors_0num_floors;cntr_floors_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_floors_0) != -1) { - ndr_print_epm_floor(ndr, "floors", &r->floors[cntr_floors_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static size_t ndr_size_epm_tower(const struct epm_tower *r, int flags) -{ - flags |= LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN; - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_epm_tower); -} - -static enum ndr_err_code ndr_push_epm_twr_t(struct ndr_push *ndr, int ndr_flags, const struct epm_twr_t *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_epm_tower(&r->tower, ndr->flags))); - { - struct ndr_push *_ndr_tower; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_tower, 4, -1)); - NDR_CHECK(ndr_push_epm_tower(_ndr_tower, NDR_SCALARS, &r->tower)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_tower, 4, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_twr_t(struct ndr_pull *ndr, int ndr_flags, struct epm_twr_t *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tower_length)); - { - struct ndr_pull *_ndr_tower; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_tower, 4, -1)); - NDR_CHECK(ndr_pull_epm_tower(_ndr_tower, NDR_SCALARS, &r->tower)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_tower, 4, -1)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_twr_t(struct ndr_print *ndr, const char *name, const struct epm_twr_t *r) -{ - ndr_print_struct(ndr, name, "epm_twr_t"); - ndr->depth++; - ndr_print_uint32(ndr, "tower_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_epm_tower(&r->tower, ndr->flags):r->tower_length); - ndr_print_epm_tower(ndr, "tower", &r->tower); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_entry_t(struct ndr_push *ndr, int ndr_flags, const struct epm_entry_t *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object)); - NDR_CHECK(ndr_push_full_ptr(ndr, r->tower)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen(r->annotation) + 1)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->annotation, strlen(r->annotation) + 1, sizeof(uint8_t), CH_DOS)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->tower) { - NDR_CHECK(ndr_push_epm_twr_t(ndr, NDR_SCALARS, r->tower)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_entry_t(struct ndr_pull *ndr, int ndr_flags, struct epm_entry_t *r) -{ - uint32_t _ptr_tower; - TALLOC_CTX *_mem_save_tower_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->object)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_tower)); - if (_ptr_tower) { - NDR_PULL_ALLOC(ndr, r->tower); - } else { - r->tower = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__annotation_offset)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__annotation_length)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->annotation, r->__annotation_length, sizeof(uint8_t), CH_DOS)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->tower) { - _mem_save_tower_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->tower, 0); - NDR_CHECK(ndr_pull_epm_twr_t(ndr, NDR_SCALARS, r->tower)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tower_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_entry_t(struct ndr_print *ndr, const char *name, const struct epm_entry_t *r) -{ - ndr_print_struct(ndr, name, "epm_entry_t"); - ndr->depth++; - ndr_print_GUID(ndr, "object", &r->object); - ndr_print_ptr(ndr, "tower", r->tower); - ndr->depth++; - if (r->tower) { - ndr_print_epm_twr_t(ndr, "tower", r->tower); - } - ndr->depth--; - ndr_print_uint32(ndr, "__annotation_offset", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->__annotation_offset); - ndr_print_uint32(ndr, "__annotation_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->annotation) + 1:r->__annotation_length); - ndr_print_string(ndr, "annotation", r->annotation); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_rpc_if_id_t(struct ndr_push *ndr, int ndr_flags, const struct rpc_if_id_t *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->vers_major)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->vers_minor)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_rpc_if_id_t(struct ndr_pull *ndr, int ndr_flags, struct rpc_if_id_t *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->vers_major)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->vers_minor)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_rpc_if_id_t(struct ndr_print *ndr, const char *name, const struct rpc_if_id_t *r) -{ - ndr_print_struct(ndr, name, "rpc_if_id_t"); - ndr->depth++; - ndr_print_GUID(ndr, "uuid", &r->uuid); - ndr_print_uint16(ndr, "vers_major", r->vers_major); - ndr_print_uint16(ndr, "vers_minor", r->vers_minor); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_twr_p_t(struct ndr_push *ndr, int ndr_flags, const struct epm_twr_p_t *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_full_ptr(ndr, r->twr)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->twr) { - NDR_CHECK(ndr_push_epm_twr_t(ndr, NDR_SCALARS, r->twr)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_twr_p_t(struct ndr_pull *ndr, int ndr_flags, struct epm_twr_p_t *r) -{ - uint32_t _ptr_twr; - TALLOC_CTX *_mem_save_twr_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_twr)); - if (_ptr_twr) { - NDR_PULL_ALLOC(ndr, r->twr); - } else { - r->twr = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->twr) { - _mem_save_twr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->twr, 0); - NDR_CHECK(ndr_pull_epm_twr_t(ndr, NDR_SCALARS, r->twr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_twr_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_twr_p_t(struct ndr_print *ndr, const char *name, const struct epm_twr_p_t *r) -{ - ndr_print_struct(ndr, name, "epm_twr_p_t"); - ndr->depth++; - ndr_print_ptr(ndr, "twr", r->twr); - ndr->depth++; - if (r->twr) { - ndr_print_epm_twr_t(ndr, "twr", r->twr); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_Insert(struct ndr_push *ndr, int flags, const struct epm_Insert *r) -{ - uint32_t cntr_entries_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_ents)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_ents)); - for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_SCALARS, &r->in.entries[cntr_entries_0])); - } - for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_BUFFERS, &r->in.entries[cntr_entries_0])); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.replace)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_Insert(struct ndr_pull *ndr, int flags, struct epm_Insert *r) -{ - uint32_t cntr_entries_0; - TALLOC_CTX *_mem_save_entries_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_ents)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.entries)); - NDR_PULL_ALLOC_N(ndr, r->in.entries, ndr_get_array_size(ndr, &r->in.entries)); - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.entries, 0); - for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_SCALARS, &r->in.entries[cntr_entries_0])); - } - for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_BUFFERS, &r->in.entries[cntr_entries_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.replace)); - if (r->in.entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.entries, r->in.num_ents)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_Insert(struct ndr_print *ndr, const char *name, int flags, const struct epm_Insert *r) -{ - uint32_t cntr_entries_0; - ndr_print_struct(ndr, name, "epm_Insert"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "epm_Insert"); - ndr->depth++; - ndr_print_uint32(ndr, "num_ents", r->in.num_ents); - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->in.num_ents); - ndr->depth++; - for (cntr_entries_0=0;cntr_entries_0in.num_ents;cntr_entries_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { - ndr_print_epm_entry_t(ndr, "entries", &r->in.entries[cntr_entries_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_uint32(ndr, "replace", r->in.replace); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "epm_Insert"); - ndr->depth++; - ndr_print_uint32(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_Delete(struct ndr_push *ndr, int flags, const struct epm_Delete *r) -{ - uint32_t cntr_entries_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_ents)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_ents)); - for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_SCALARS, &r->in.entries[cntr_entries_0])); - } - for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_BUFFERS, &r->in.entries[cntr_entries_0])); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_Delete(struct ndr_pull *ndr, int flags, struct epm_Delete *r) -{ - uint32_t cntr_entries_0; - TALLOC_CTX *_mem_save_entries_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_ents)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.entries)); - NDR_PULL_ALLOC_N(ndr, r->in.entries, ndr_get_array_size(ndr, &r->in.entries)); - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.entries, 0); - for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_SCALARS, &r->in.entries[cntr_entries_0])); - } - for (cntr_entries_0 = 0; cntr_entries_0 < r->in.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_BUFFERS, &r->in.entries[cntr_entries_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - if (r->in.entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.entries, r->in.num_ents)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_Delete(struct ndr_print *ndr, const char *name, int flags, const struct epm_Delete *r) -{ - uint32_t cntr_entries_0; - ndr_print_struct(ndr, name, "epm_Delete"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "epm_Delete"); - ndr->depth++; - ndr_print_uint32(ndr, "num_ents", r->in.num_ents); - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->in.num_ents); - ndr->depth++; - for (cntr_entries_0=0;cntr_entries_0in.num_ents;cntr_entries_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { - ndr_print_epm_entry_t(ndr, "entries", &r->in.entries[cntr_entries_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "epm_Delete"); - ndr->depth++; - ndr_print_uint32(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_Lookup(struct ndr_push *ndr, int flags, const struct epm_Lookup *r) -{ - uint32_t cntr_entries_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.inquiry_type)); - NDR_CHECK(ndr_push_full_ptr(ndr, r->in.object)); - if (r->in.object) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.object)); - } - NDR_CHECK(ndr_push_full_ptr(ndr, r->in.interface_id)); - if (r->in.interface_id) { - NDR_CHECK(ndr_push_rpc_if_id_t(ndr, NDR_SCALARS, r->in.interface_id)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.vers_option)); - 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, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ents)); - for (cntr_entries_0 = 0; cntr_entries_0 < *r->out.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_SCALARS, &r->out.entries[cntr_entries_0])); - } - for (cntr_entries_0 = 0; cntr_entries_0 < *r->out.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_push_epm_entry_t(ndr, NDR_BUFFERS, &r->out.entries[cntr_entries_0])); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_Lookup(struct ndr_pull *ndr, int flags, struct epm_Lookup *r) -{ - uint32_t _ptr_object; - uint32_t _ptr_interface_id; - uint32_t cntr_entries_0; - TALLOC_CTX *_mem_save_object_0; - TALLOC_CTX *_mem_save_interface_id_0; - TALLOC_CTX *_mem_save_entry_handle_0; - TALLOC_CTX *_mem_save_num_ents_0; - TALLOC_CTX *_mem_save_entries_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.inquiry_type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object)); - if (_ptr_object) { - NDR_PULL_ALLOC(ndr, r->in.object); - } else { - r->in.object = NULL; - } - if (r->in.object) { - _mem_save_object_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.object, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.object)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_interface_id)); - if (_ptr_interface_id) { - NDR_PULL_ALLOC(ndr, r->in.interface_id); - } else { - r->in.interface_id = NULL; - } - if (r->in.interface_id) { - _mem_save_interface_id_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.interface_id, 0); - NDR_CHECK(ndr_pull_rpc_if_id_t(ndr, NDR_SCALARS, r->in.interface_id)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interface_id_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.vers_option)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.entry_handle); - } - _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.entry_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.entry_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_ents)); - NDR_PULL_ALLOC(ndr, r->out.entry_handle); - *r->out.entry_handle = *r->in.entry_handle; - NDR_PULL_ALLOC(ndr, r->out.num_ents); - ZERO_STRUCTP(r->out.num_ents); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.entry_handle); - } - _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.entry_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_ents); - } - _mem_save_num_ents_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_ents, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_ents)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ents_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.entries)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->out.entries)); - if (ndr_get_array_length(ndr, &r->out.entries) > ndr_get_array_size(ndr, &r->out.entries)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.entries), ndr_get_array_length(ndr, &r->out.entries)); - } - NDR_PULL_ALLOC_N(ndr, r->out.entries, ndr_get_array_size(ndr, &r->out.entries)); - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.entries, 0); - for (cntr_entries_0 = 0; cntr_entries_0 < *r->out.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_SCALARS, &r->out.entries[cntr_entries_0])); - } - for (cntr_entries_0 = 0; cntr_entries_0 < *r->out.num_ents; cntr_entries_0++) { - NDR_CHECK(ndr_pull_epm_entry_t(ndr, NDR_BUFFERS, &r->out.entries[cntr_entries_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.entries, r->in.max_ents)); - } - if (r->out.entries) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.entries, *r->out.num_ents)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_Lookup(struct ndr_print *ndr, const char *name, int flags, const struct epm_Lookup *r) -{ - uint32_t cntr_entries_0; - ndr_print_struct(ndr, name, "epm_Lookup"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "epm_Lookup"); - ndr->depth++; - ndr_print_uint32(ndr, "inquiry_type", r->in.inquiry_type); - ndr_print_ptr(ndr, "object", r->in.object); - ndr->depth++; - if (r->in.object) { - ndr_print_GUID(ndr, "object", r->in.object); - } - ndr->depth--; - ndr_print_ptr(ndr, "interface_id", r->in.interface_id); - ndr->depth++; - if (r->in.interface_id) { - ndr_print_rpc_if_id_t(ndr, "interface_id", r->in.interface_id); - } - ndr->depth--; - ndr_print_uint32(ndr, "vers_option", r->in.vers_option); - ndr_print_ptr(ndr, "entry_handle", r->in.entry_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "entry_handle", r->in.entry_handle); - ndr->depth--; - ndr_print_uint32(ndr, "max_ents", r->in.max_ents); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "epm_Lookup"); - ndr->depth++; - ndr_print_ptr(ndr, "entry_handle", r->out.entry_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "entry_handle", r->out.entry_handle); - ndr->depth--; - ndr_print_ptr(ndr, "num_ents", r->out.num_ents); - ndr->depth++; - ndr_print_uint32(ndr, "num_ents", *r->out.num_ents); - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)*r->out.num_ents); - ndr->depth++; - for (cntr_entries_0=0;cntr_entries_0<*r->out.num_ents;cntr_entries_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { - ndr_print_epm_entry_t(ndr, "entries", &r->out.entries[cntr_entries_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_uint32(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_epm_Map(struct ndr_push *ndr, int flags, const struct epm_Map *r) -{ - uint32_t cntr_towers_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_full_ptr(ndr, r->in.object)); - if (r->in.object) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.object)); - } - NDR_CHECK(ndr_push_full_ptr(ndr, r->in.map_tower)); - 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_towers)); - for (cntr_towers_0 = 0; cntr_towers_0 < *r->out.num_towers; cntr_towers_0++) { - NDR_CHECK(ndr_push_epm_twr_p_t(ndr, NDR_SCALARS, &r->out.towers[cntr_towers_0])); - } - for (cntr_towers_0 = 0; cntr_towers_0 < *r->out.num_towers; cntr_towers_0++) { - NDR_CHECK(ndr_push_epm_twr_p_t(ndr, NDR_BUFFERS, &r->out.towers[cntr_towers_0])); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_epm_Map(struct ndr_pull *ndr, int flags, struct epm_Map *r) -{ - uint32_t _ptr_object; - uint32_t _ptr_map_tower; - uint32_t cntr_towers_0; - TALLOC_CTX *_mem_save_object_0; - TALLOC_CTX *_mem_save_map_tower_0; - TALLOC_CTX *_mem_save_entry_handle_0; - TALLOC_CTX *_mem_save_num_towers_0; - TALLOC_CTX *_mem_save_towers_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object)); - if (_ptr_object) { - NDR_PULL_ALLOC(ndr, r->in.object); - } else { - r->in.object = NULL; - } - if (r->in.object) { - _mem_save_object_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.object, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.object)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_map_tower)); - if (_ptr_map_tower) { - NDR_PULL_ALLOC(ndr, r->in.map_tower); - } else { - r->in.map_tower = NULL; - } - if (r->in.map_tower) { - _mem_save_map_tower_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.map_tower, 0); - NDR_CHECK(ndr_pull_epm_twr_t(ndr, NDR_SCALARS, r->in.map_tower)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_map_tower_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.entry_handle); - } - _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.entry_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.entry_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_towers)); - NDR_PULL_ALLOC(ndr, r->out.entry_handle); - *r->out.entry_handle = *r->in.entry_handle; - NDR_PULL_ALLOC(ndr, r->out.num_towers); - ZERO_STRUCTP(r->out.num_towers); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.entry_handle); - } - _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.entry_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_towers); - } - _mem_save_num_towers_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_towers, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_towers)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_towers_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.towers)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->out.towers)); - if (ndr_get_array_length(ndr, &r->out.towers) > ndr_get_array_size(ndr, &r->out.towers)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.towers), ndr_get_array_length(ndr, &r->out.towers)); - } - NDR_PULL_ALLOC_N(ndr, r->out.towers, ndr_get_array_size(ndr, &r->out.towers)); - _mem_save_towers_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.towers, 0); - for (cntr_towers_0 = 0; cntr_towers_0 < *r->out.num_towers; cntr_towers_0++) { - NDR_CHECK(ndr_pull_epm_twr_p_t(ndr, NDR_SCALARS, &r->out.towers[cntr_towers_0])); - } - for (cntr_towers_0 = 0; cntr_towers_0 < *r->out.num_towers; cntr_towers_0++) { - NDR_CHECK(ndr_pull_epm_twr_p_t(ndr, NDR_BUFFERS, &r->out.towers[cntr_towers_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_towers_0, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.towers) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.towers, r->in.max_towers)); - } - if (r->out.towers) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.towers, *r->out.num_towers)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_Map(struct ndr_print *ndr, const char *name, int flags, const struct epm_Map *r) -{ - uint32_t cntr_towers_0; - ndr_print_struct(ndr, name, "epm_Map"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "epm_Map"); - ndr->depth++; - ndr_print_ptr(ndr, "object", r->in.object); - ndr->depth++; - if (r->in.object) { - ndr_print_GUID(ndr, "object", r->in.object); - } - ndr->depth--; - ndr_print_ptr(ndr, "map_tower", r->in.map_tower); - ndr->depth++; - if (r->in.map_tower) { - ndr_print_epm_twr_t(ndr, "map_tower", r->in.map_tower); - } - ndr->depth--; - ndr_print_ptr(ndr, "entry_handle", r->in.entry_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "entry_handle", r->in.entry_handle); - ndr->depth--; - ndr_print_uint32(ndr, "max_towers", r->in.max_towers); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "epm_Map"); - ndr->depth++; - ndr_print_ptr(ndr, "entry_handle", r->out.entry_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "entry_handle", r->out.entry_handle); - ndr->depth--; - ndr_print_ptr(ndr, "num_towers", r->out.num_towers); - ndr->depth++; - ndr_print_uint32(ndr, "num_towers", *r->out.num_towers); - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "towers", (int)*r->out.num_towers); - ndr->depth++; - for (cntr_towers_0=0;cntr_towers_0<*r->out.num_towers;cntr_towers_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_towers_0) != -1) { - ndr_print_epm_twr_p_t(ndr, "towers", &r->out.towers[cntr_towers_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_uint32(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.entry_handle)); - } - if (flags & NDR_OUT) { - 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, r->out.entry_handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_LookupHandleFree(struct ndr_pull *ndr, int flags, struct epm_LookupHandleFree *r) -{ - TALLOC_CTX *_mem_save_entry_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.entry_handle); - } - _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.entry_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.entry_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.entry_handle); - *r->out.entry_handle = *r->in.entry_handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.entry_handle); - } - _mem_save_entry_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.entry_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.entry_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entry_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_LookupHandleFree(struct ndr_print *ndr, const char *name, int flags, const struct epm_LookupHandleFree *r) -{ - ndr_print_struct(ndr, name, "epm_LookupHandleFree"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "epm_LookupHandleFree"); - ndr->depth++; - ndr_print_ptr(ndr, "entry_handle", r->in.entry_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "entry_handle", r->in.entry_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "epm_LookupHandleFree"); - ndr->depth++; - ndr_print_ptr(ndr, "entry_handle", r->out.entry_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "entry_handle", r->out.entry_handle); - ndr->depth--; - ndr_print_uint32(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.epm_object)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_InqObject(struct ndr_pull *ndr, int flags, struct epm_InqObject *r) -{ - TALLOC_CTX *_mem_save_epm_object_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.epm_object); - } - _mem_save_epm_object_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.epm_object, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.epm_object)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_epm_object_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_InqObject(struct ndr_print *ndr, const char *name, int flags, const struct epm_InqObject *r) -{ - ndr_print_struct(ndr, name, "epm_InqObject"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "epm_InqObject"); - ndr->depth++; - ndr_print_ptr(ndr, "epm_object", r->in.epm_object); - ndr->depth++; - ndr_print_GUID(ndr, "epm_object", r->in.epm_object); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "epm_InqObject"); - ndr->depth++; - ndr_print_uint32(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_MgmtDelete(struct ndr_push *ndr, int flags, const struct epm_MgmtDelete *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.object_speced)); - NDR_CHECK(ndr_push_full_ptr(ndr, r->in.object)); - if (r->in.object) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.object)); - } - NDR_CHECK(ndr_push_full_ptr(ndr, r->in.tower)); - if (r->in.tower) { - NDR_CHECK(ndr_push_epm_twr_t(ndr, NDR_SCALARS, r->in.tower)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_MgmtDelete(struct ndr_pull *ndr, int flags, struct epm_MgmtDelete *r) -{ - uint32_t _ptr_object; - uint32_t _ptr_tower; - TALLOC_CTX *_mem_save_object_0; - TALLOC_CTX *_mem_save_tower_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.object_speced)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object)); - if (_ptr_object) { - NDR_PULL_ALLOC(ndr, r->in.object); - } else { - r->in.object = NULL; - } - if (r->in.object) { - _mem_save_object_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.object, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.object)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_tower)); - if (_ptr_tower) { - NDR_PULL_ALLOC(ndr, r->in.tower); - } else { - r->in.tower = NULL; - } - if (r->in.tower) { - _mem_save_tower_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.tower, 0); - NDR_CHECK(ndr_pull_epm_twr_t(ndr, NDR_SCALARS, r->in.tower)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tower_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_MgmtDelete(struct ndr_print *ndr, const char *name, int flags, const struct epm_MgmtDelete *r) -{ - ndr_print_struct(ndr, name, "epm_MgmtDelete"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "epm_MgmtDelete"); - ndr->depth++; - ndr_print_uint32(ndr, "object_speced", r->in.object_speced); - ndr_print_ptr(ndr, "object", r->in.object); - ndr->depth++; - if (r->in.object) { - ndr_print_GUID(ndr, "object", r->in.object); - } - ndr->depth--; - ndr_print_ptr(ndr, "tower", r->in.tower); - ndr->depth++; - if (r->in.tower) { - ndr_print_epm_twr_t(ndr, "tower", r->in.tower); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "epm_MgmtDelete"); - ndr->depth++; - ndr_print_uint32(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_epm_MapAuth(struct ndr_push *ndr, int flags, const struct epm_MapAuth *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_epm_MapAuth(struct ndr_pull *ndr, int flags, struct epm_MapAuth *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_epm_MapAuth(struct ndr_print *ndr, const char *name, int flags, const struct epm_MapAuth *r) -{ - ndr_print_struct(ndr, name, "epm_MapAuth"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "epm_MapAuth"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "epm_MapAuth"); - ndr->depth++; - ndr_print_uint32(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call epmapper_calls[] = { - { - "epm_Insert", - sizeof(struct epm_Insert), - (ndr_push_flags_fn_t) ndr_push_epm_Insert, - (ndr_pull_flags_fn_t) ndr_pull_epm_Insert, - (ndr_print_function_t) ndr_print_epm_Insert, - false, - }, - { - "epm_Delete", - sizeof(struct epm_Delete), - (ndr_push_flags_fn_t) ndr_push_epm_Delete, - (ndr_pull_flags_fn_t) ndr_pull_epm_Delete, - (ndr_print_function_t) ndr_print_epm_Delete, - false, - }, - { - "epm_Lookup", - sizeof(struct epm_Lookup), - (ndr_push_flags_fn_t) ndr_push_epm_Lookup, - (ndr_pull_flags_fn_t) ndr_pull_epm_Lookup, - (ndr_print_function_t) ndr_print_epm_Lookup, - false, - }, - { - "epm_Map", - sizeof(struct epm_Map), - (ndr_push_flags_fn_t) ndr_push_epm_Map, - (ndr_pull_flags_fn_t) ndr_pull_epm_Map, - (ndr_print_function_t) ndr_print_epm_Map, - false, - }, - { - "epm_LookupHandleFree", - sizeof(struct epm_LookupHandleFree), - (ndr_push_flags_fn_t) ndr_push_epm_LookupHandleFree, - (ndr_pull_flags_fn_t) ndr_pull_epm_LookupHandleFree, - (ndr_print_function_t) ndr_print_epm_LookupHandleFree, - false, - }, - { - "epm_InqObject", - sizeof(struct epm_InqObject), - (ndr_push_flags_fn_t) ndr_push_epm_InqObject, - (ndr_pull_flags_fn_t) ndr_pull_epm_InqObject, - (ndr_print_function_t) ndr_print_epm_InqObject, - false, - }, - { - "epm_MgmtDelete", - sizeof(struct epm_MgmtDelete), - (ndr_push_flags_fn_t) ndr_push_epm_MgmtDelete, - (ndr_pull_flags_fn_t) ndr_pull_epm_MgmtDelete, - (ndr_print_function_t) ndr_print_epm_MgmtDelete, - false, - }, - { - "epm_MapAuth", - sizeof(struct epm_MapAuth), - (ndr_push_flags_fn_t) ndr_push_epm_MapAuth, - (ndr_pull_flags_fn_t) ndr_pull_epm_MapAuth, - (ndr_print_function_t) ndr_print_epm_MapAuth, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const epmapper_endpoint_strings[] = { - "ncacn_np:[\\pipe\\epmapper]", - "ncacn_ip_tcp:[135]", - "ncalrpc:[EPMAPPER]", -}; - -static const struct ndr_interface_string_array epmapper_endpoints = { - .count = 3, - .names = epmapper_endpoint_strings -}; - -static const char * const epmapper_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array epmapper_authservices = { - .count = 1, - .names = epmapper_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_epmapper = { - .name = "epmapper", - .syntax_id = { - {0xe1af8308,0x5d1f,0x11c9,{0x91,0xa4},{0x08,0x00,0x2b,0x14,0xa0,0xfa}}, - NDR_EPMAPPER_VERSION - }, - .helpstring = NDR_EPMAPPER_HELPSTRING, - .num_calls = 8, - .calls = epmapper_calls, - .endpoints = &epmapper_endpoints, - .authservices = &epmapper_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_epmapper.h b/source3/librpc/gen_ndr/ndr_epmapper.h deleted file mode 100644 index 0fac75e0af..0000000000 --- a/source3/librpc/gen_ndr/ndr_epmapper.h +++ /dev/null @@ -1,76 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/epmapper.h" - -#ifndef _HEADER_NDR_epmapper -#define _HEADER_NDR_epmapper - -#define NDR_EPMAPPER_UUID "e1af8308-5d1f-11c9-91a4-08002b14a0fa" -#define NDR_EPMAPPER_VERSION 3.0 -#define NDR_EPMAPPER_NAME "epmapper" -#define NDR_EPMAPPER_HELPSTRING "EndPoint Mapper" -extern const struct ndr_interface_table ndr_table_epmapper; -#define NDR_EPM_INSERT (0x00) - -#define NDR_EPM_DELETE (0x01) - -#define NDR_EPM_LOOKUP (0x02) - -#define NDR_EPM_MAP (0x03) - -#define NDR_EPM_LOOKUPHANDLEFREE (0x04) - -#define NDR_EPM_INQOBJECT (0x05) - -#define NDR_EPM_MGMTDELETE (0x06) - -#define NDR_EPM_MAPAUTH (0x07) - -#define NDR_EPMAPPER_CALL_COUNT (8) -void ndr_print_epm_protocol(struct ndr_print *ndr, const char *name, enum epm_protocol r); -void ndr_print_epm_rhs_dnet_nsp(struct ndr_print *ndr, const char *name, const struct epm_rhs_dnet_nsp *r); -void ndr_print_epm_rhs_osi_tp4(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_tp4 *r); -void ndr_print_epm_rhs_osi_clns(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_clns *r); -void ndr_print_epm_rhs_udp(struct ndr_print *ndr, const char *name, const struct epm_rhs_udp *r); -void ndr_print_epm_rhs_tcp(struct ndr_print *ndr, const char *name, const struct epm_rhs_tcp *r); -void ndr_print_epm_rhs_ip(struct ndr_print *ndr, const char *name, const struct epm_rhs_ip *r); -void ndr_print_epm_rhs_ncadg(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncadg *r); -void ndr_print_epm_rhs_ncacn(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncacn *r); -void ndr_print_epm_rhs_uuid(struct ndr_print *ndr, const char *name, const struct epm_rhs_uuid *r); -void ndr_print_epm_rhs_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_ipx *r); -void ndr_print_epm_rhs_smb(struct ndr_print *ndr, const char *name, const struct epm_rhs_smb *r); -void ndr_print_epm_rhs_pipe(struct ndr_print *ndr, const char *name, const struct epm_rhs_pipe *r); -void ndr_print_epm_rhs_netbios(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbios *r); -void ndr_print_epm_rhs_netbeui(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbeui *r); -void ndr_print_epm_rhs_spx(struct ndr_print *ndr, const char *name, const struct epm_rhs_spx *r); -void ndr_print_epm_rhs_nb_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_nb_ipx *r); -void ndr_print_epm_rhs_http(struct ndr_print *ndr, const char *name, const struct epm_rhs_http *r); -void ndr_print_epm_rhs_unix_ds(struct ndr_print *ndr, const char *name, const struct epm_rhs_unix_ds *r); -void ndr_print_epm_rhs_null(struct ndr_print *ndr, const char *name, const struct epm_rhs_null *r); -void ndr_print_epm_rhs_ncalrpc(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncalrpc *r); -void ndr_print_epm_rhs_appletalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_appletalk *r); -void ndr_print_epm_rhs_atalk_stream(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_stream *r); -void ndr_print_epm_rhs_atalk_datagram(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_datagram *r); -void ndr_print_epm_rhs_vines_spp(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_spp *r); -void ndr_print_epm_rhs_vines_ipc(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_ipc *r); -void ndr_print_epm_rhs_streettalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_streettalk *r); -void ndr_print_epm_rhs(struct ndr_print *ndr, const char *name, const union epm_rhs *r); -void ndr_print_epm_lhs(struct ndr_print *ndr, const char *name, const struct epm_lhs *r); -void ndr_print_epm_floor(struct ndr_print *ndr, const char *name, const struct epm_floor *r); -void ndr_print_epm_tower(struct ndr_print *ndr, const char *name, const struct epm_tower *r); -void ndr_print_epm_twr_t(struct ndr_print *ndr, const char *name, const struct epm_twr_t *r); -void ndr_print_epm_entry_t(struct ndr_print *ndr, const char *name, const struct epm_entry_t *r); -void ndr_print_rpc_if_id_t(struct ndr_print *ndr, const char *name, const struct rpc_if_id_t *r); -void ndr_print_epm_twr_p_t(struct ndr_print *ndr, const char *name, const struct epm_twr_p_t *r); -void ndr_print_epm_Insert(struct ndr_print *ndr, const char *name, int flags, const struct epm_Insert *r); -void ndr_print_epm_Delete(struct ndr_print *ndr, const char *name, int flags, const struct epm_Delete *r); -void ndr_print_epm_Lookup(struct ndr_print *ndr, const char *name, int flags, const struct epm_Lookup *r); -enum ndr_err_code ndr_push_epm_Map(struct ndr_push *ndr, int flags, const struct epm_Map *r); -enum ndr_err_code ndr_pull_epm_Map(struct ndr_pull *ndr, int flags, struct epm_Map *r); -void ndr_print_epm_Map(struct ndr_print *ndr, const char *name, int flags, const struct epm_Map *r); -void ndr_print_epm_LookupHandleFree(struct ndr_print *ndr, const char *name, int flags, const struct epm_LookupHandleFree *r); -void ndr_print_epm_InqObject(struct ndr_print *ndr, const char *name, int flags, const struct epm_InqObject *r); -void ndr_print_epm_MgmtDelete(struct ndr_print *ndr, const char *name, int flags, const struct epm_MgmtDelete *r); -void ndr_print_epm_MapAuth(struct ndr_print *ndr, const char *name, int flags, const struct epm_MapAuth *r); -#endif /* _HEADER_NDR_epmapper */ diff --git a/source3/librpc/gen_ndr/ndr_eventlog.c b/source3/librpc/gen_ndr/ndr_eventlog.c deleted file mode 100644 index 12fa9fcec4..0000000000 --- a/source3/librpc/gen_ndr/ndr_eventlog.c +++ /dev/null @@ -1,1755 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_eventlog.h" - -#include "librpc/gen_ndr/ndr_lsa.h" -#include "librpc/gen_ndr/ndr_security.h" -static enum ndr_err_code ndr_push_eventlogReadFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlogReadFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlogReadFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "EVENTLOG_SEQUENTIAL_READ", EVENTLOG_SEQUENTIAL_READ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "EVENTLOG_SEEK_READ", EVENTLOG_SEEK_READ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "EVENTLOG_FORWARDS_READ", EVENTLOG_FORWARDS_READ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "EVENTLOG_BACKWARDS_READ", EVENTLOG_BACKWARDS_READ, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_OpenUnknown0(struct ndr_push *ndr, int ndr_flags, const struct eventlog_OpenUnknown0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown0)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_OpenUnknown0(struct ndr_pull *ndr, int ndr_flags, struct eventlog_OpenUnknown0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown0)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown1)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_OpenUnknown0(struct ndr_print *ndr, const char *name, const struct eventlog_OpenUnknown0 *r) -{ - ndr_print_struct(ndr, name, "eventlog_OpenUnknown0"); - ndr->depth++; - ndr_print_uint16(ndr, "unknown0", r->unknown0); - ndr_print_uint16(ndr, "unknown1", r->unknown1); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_eventlog_Record(struct ndr_push *ndr, int ndr_flags, const struct eventlog_Record *r) -{ - uint32_t cntr_strings_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->record_number)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_generated)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_written)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->event_id)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->event_type)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_of_strings)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->event_category)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->closing_record_number)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->stringoffset)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_offset)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_offset)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->source_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - for (cntr_strings_0 = 0; cntr_strings_0 < r->num_of_strings; cntr_strings_0++) { - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->strings[cntr_strings_0])); - } - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->raw_data)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_eventlog_Record(struct ndr_pull *ndr, int ndr_flags, struct eventlog_Record *r) -{ - uint32_t cntr_strings_0; - TALLOC_CTX *_mem_save_strings_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->record_number)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_generated)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_written)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->event_id)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->event_type)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_of_strings)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->event_category)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->closing_record_number)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->stringoffset)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_offset)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_offset)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->source_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_PULL_ALLOC_N(ndr, r->strings, r->num_of_strings); - _mem_save_strings_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->strings, 0); - for (cntr_strings_0 = 0; cntr_strings_0 < r->num_of_strings; cntr_strings_0++) { - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->strings[cntr_strings_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_strings_0, 0); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->raw_data)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_Record(struct ndr_print *ndr, const char *name, const struct eventlog_Record *r) -{ - uint32_t cntr_strings_0; - ndr_print_struct(ndr, name, "eventlog_Record"); - ndr->depth++; - ndr_print_uint32(ndr, "size", r->size); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr_print_uint32(ndr, "record_number", r->record_number); - ndr_print_uint32(ndr, "time_generated", r->time_generated); - ndr_print_uint32(ndr, "time_written", r->time_written); - ndr_print_uint32(ndr, "event_id", r->event_id); - ndr_print_uint16(ndr, "event_type", r->event_type); - ndr_print_uint16(ndr, "num_of_strings", r->num_of_strings); - ndr_print_uint16(ndr, "event_category", r->event_category); - ndr_print_uint16(ndr, "reserved_flags", r->reserved_flags); - ndr_print_uint32(ndr, "closing_record_number", r->closing_record_number); - ndr_print_uint32(ndr, "stringoffset", r->stringoffset); - ndr_print_uint32(ndr, "sid_length", r->sid_length); - ndr_print_uint32(ndr, "sid_offset", r->sid_offset); - ndr_print_uint32(ndr, "data_length", r->data_length); - ndr_print_uint32(ndr, "data_offset", r->data_offset); - ndr_print_string(ndr, "source_name", r->source_name); - ndr_print_string(ndr, "computer_name", r->computer_name); - ndr->print(ndr, "%s: ARRAY(%d)", "strings", (int)r->num_of_strings); - ndr->depth++; - for (cntr_strings_0=0;cntr_strings_0num_of_strings;cntr_strings_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_strings_0) != -1) { - ndr_print_string(ndr, "strings", r->strings[cntr_strings_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_string(ndr, "raw_data", r->raw_data); - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.backupfile)); - if (r->in.backupfile) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.backupfile)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_ClearEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_ClearEventLogW *r) -{ - uint32_t _ptr_backupfile; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_backupfile_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_backupfile)); - if (_ptr_backupfile) { - NDR_PULL_ALLOC(ndr, r->in.backupfile); - } else { - r->in.backupfile = NULL; - } - if (r->in.backupfile) { - _mem_save_backupfile_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.backupfile, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.backupfile)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_backupfile_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_ClearEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ClearEventLogW *r) -{ - ndr_print_struct(ndr, name, "eventlog_ClearEventLogW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_ClearEventLogW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "backupfile", r->in.backupfile); - ndr->depth++; - if (r->in.backupfile) { - ndr_print_lsa_String(ndr, "backupfile", r->in.backupfile); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_ClearEventLogW"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_BackupEventLogW(struct ndr_push *ndr, int flags, const struct eventlog_BackupEventLogW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_BackupEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_BackupEventLogW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_BackupEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_BackupEventLogW *r) -{ - ndr_print_struct(ndr, name, "eventlog_BackupEventLogW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_BackupEventLogW"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_BackupEventLogW"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_CloseEventLog(struct ndr_pull *ndr, int flags, struct eventlog_CloseEventLog *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.handle); - *r->out.handle = *r->in.handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_CloseEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_CloseEventLog *r) -{ - ndr_print_struct(ndr, name, "eventlog_CloseEventLog"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_CloseEventLog"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_CloseEventLog"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_DeregisterEventSource(struct ndr_push *ndr, int flags, const struct eventlog_DeregisterEventSource *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_DeregisterEventSource(struct ndr_pull *ndr, int flags, struct eventlog_DeregisterEventSource *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_DeregisterEventSource(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_DeregisterEventSource *r) -{ - ndr_print_struct(ndr, name, "eventlog_DeregisterEventSource"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_DeregisterEventSource"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_DeregisterEventSource"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_GetNumRecords(struct ndr_pull *ndr, int flags, struct eventlog_GetNumRecords *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_number_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.number); - ZERO_STRUCTP(r->out.number); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.number); - } - _mem_save_number_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.number, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.number)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_number_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_GetNumRecords(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetNumRecords *r) -{ - ndr_print_struct(ndr, name, "eventlog_GetNumRecords"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_GetNumRecords"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_GetNumRecords"); - ndr->depth++; - ndr_print_ptr(ndr, "number", r->out.number); - ndr->depth++; - ndr_print_uint32(ndr, "number", *r->out.number); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_GetOldestRecord(struct ndr_push *ndr, int flags, const struct eventlog_GetOldestRecord *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - } - if (flags & NDR_OUT) { - if (r->out.oldest_entry == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.oldest_entry)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_GetOldestRecord(struct ndr_pull *ndr, int flags, struct eventlog_GetOldestRecord *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_oldest_entry_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.oldest_entry); - ZERO_STRUCTP(r->out.oldest_entry); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.oldest_entry); - } - _mem_save_oldest_entry_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.oldest_entry, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.oldest_entry)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_oldest_entry_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_GetOldestRecord(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetOldestRecord *r) -{ - ndr_print_struct(ndr, name, "eventlog_GetOldestRecord"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_GetOldestRecord"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_GetOldestRecord"); - ndr->depth++; - ndr_print_ptr(ndr, "oldest_entry", r->out.oldest_entry); - ndr->depth++; - ndr_print_uint32(ndr, "oldest_entry", *r->out.oldest_entry); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_ChangeNotify(struct ndr_push *ndr, int flags, const struct eventlog_ChangeNotify *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_ChangeNotify(struct ndr_pull *ndr, int flags, struct eventlog_ChangeNotify *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_ChangeNotify(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ChangeNotify *r) -{ - ndr_print_struct(ndr, name, "eventlog_ChangeNotify"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_ChangeNotify"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_ChangeNotify"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_OpenEventLogW(struct ndr_push *ndr, int flags, const struct eventlog_OpenEventLogW *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown0)); - if (r->in.unknown0) { - NDR_CHECK(ndr_push_eventlog_OpenUnknown0(ndr, NDR_SCALARS, r->in.unknown0)); - } - if (r->in.logname == 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.logname)); - if (r->in.servername == 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.servername)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.major_version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.minor_version)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_OpenEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_OpenEventLogW *r) -{ - uint32_t _ptr_unknown0; - TALLOC_CTX *_mem_save_unknown0_0; - TALLOC_CTX *_mem_save_logname_0; - TALLOC_CTX *_mem_save_servername_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown0)); - if (_ptr_unknown0) { - NDR_PULL_ALLOC(ndr, r->in.unknown0); - } else { - r->in.unknown0 = NULL; - } - if (r->in.unknown0) { - _mem_save_unknown0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown0, 0); - NDR_CHECK(ndr_pull_eventlog_OpenUnknown0(ndr, NDR_SCALARS, r->in.unknown0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown0_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.logname); - } - _mem_save_logname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logname, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logname)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logname_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.servername); - } - _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.servername)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.major_version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.minor_version)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_OpenEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenEventLogW *r) -{ - ndr_print_struct(ndr, name, "eventlog_OpenEventLogW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_OpenEventLogW"); - ndr->depth++; - ndr_print_ptr(ndr, "unknown0", r->in.unknown0); - ndr->depth++; - if (r->in.unknown0) { - ndr_print_eventlog_OpenUnknown0(ndr, "unknown0", r->in.unknown0); - } - ndr->depth--; - ndr_print_ptr(ndr, "logname", r->in.logname); - ndr->depth++; - ndr_print_lsa_String(ndr, "logname", r->in.logname); - ndr->depth--; - ndr_print_ptr(ndr, "servername", r->in.servername); - ndr->depth++; - ndr_print_lsa_String(ndr, "servername", r->in.servername); - ndr->depth--; - ndr_print_uint32(ndr, "major_version", r->in.major_version); - ndr_print_uint32(ndr, "minor_version", r->in.minor_version); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_OpenEventLogW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_RegisterEventSourceW(struct ndr_push *ndr, int flags, const struct eventlog_RegisterEventSourceW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_RegisterEventSourceW(struct ndr_pull *ndr, int flags, struct eventlog_RegisterEventSourceW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_RegisterEventSourceW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterEventSourceW *r) -{ - ndr_print_struct(ndr, name, "eventlog_RegisterEventSourceW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_RegisterEventSourceW"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_RegisterEventSourceW"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_OpenBackupEventLogW(struct ndr_push *ndr, int flags, const struct eventlog_OpenBackupEventLogW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_OpenBackupEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_OpenBackupEventLogW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_OpenBackupEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenBackupEventLogW *r) -{ - ndr_print_struct(ndr, name, "eventlog_OpenBackupEventLogW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_OpenBackupEventLogW"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_OpenBackupEventLogW"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_eventlogReadFlags(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 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_ReadEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_ReadEventLogW *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sent_size_0; - TALLOC_CTX *_mem_save_real_size_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_eventlogReadFlags(ndr, NDR_SCALARS, &r->in.flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offset)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.number_of_bytes)); - if (r->in.number_of_bytes < 0 || r->in.number_of_bytes > 0x7FFFF) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC_N(ndr, r->out.data, r->in.number_of_bytes); - memset(r->out.data, 0, (r->in.number_of_bytes) * sizeof(*r->out.data)); - NDR_PULL_ALLOC(ndr, r->out.sent_size); - ZERO_STRUCTP(r->out.sent_size); - NDR_PULL_ALLOC(ndr, r->out.real_size); - ZERO_STRUCTP(r->out.real_size); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_size(ndr, &r->out.data))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sent_size); - } - _mem_save_sent_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sent_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sent_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sent_size_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.real_size); - } - _mem_save_real_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.real_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.real_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_real_size_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.number_of_bytes)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_ReadEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReadEventLogW *r) -{ - ndr_print_struct(ndr, name, "eventlog_ReadEventLogW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_ReadEventLogW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_eventlogReadFlags(ndr, "flags", r->in.flags); - ndr_print_uint32(ndr, "offset", r->in.offset); - ndr_print_uint32(ndr, "number_of_bytes", r->in.number_of_bytes); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_ReadEventLogW"); - ndr->depth++; - ndr_print_ptr(ndr, "data", r->out.data); - ndr->depth++; - ndr_print_array_uint8(ndr, "data", r->out.data, r->in.number_of_bytes); - ndr->depth--; - ndr_print_ptr(ndr, "sent_size", r->out.sent_size); - ndr->depth++; - ndr_print_uint32(ndr, "sent_size", *r->out.sent_size); - ndr->depth--; - ndr_print_ptr(ndr, "real_size", r->out.real_size); - ndr->depth++; - ndr_print_uint32(ndr, "real_size", *r->out.real_size); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_ReportEventW(struct ndr_push *ndr, int flags, const struct eventlog_ReportEventW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_ReportEventW(struct ndr_pull *ndr, int flags, struct eventlog_ReportEventW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_ReportEventW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReportEventW *r) -{ - ndr_print_struct(ndr, name, "eventlog_ReportEventW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_ReportEventW"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_ReportEventW"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_ClearEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_ClearEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_ClearEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_ClearEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_ClearEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ClearEventLogA *r) -{ - ndr_print_struct(ndr, name, "eventlog_ClearEventLogA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_ClearEventLogA"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_ClearEventLogA"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_BackupEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_BackupEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_BackupEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_BackupEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_BackupEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_BackupEventLogA *r) -{ - ndr_print_struct(ndr, name, "eventlog_BackupEventLogA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_BackupEventLogA"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_BackupEventLogA"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_OpenEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_OpenEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_OpenEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_OpenEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_OpenEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenEventLogA *r) -{ - ndr_print_struct(ndr, name, "eventlog_OpenEventLogA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_OpenEventLogA"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_OpenEventLogA"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_RegisterEventSourceA(struct ndr_push *ndr, int flags, const struct eventlog_RegisterEventSourceA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_RegisterEventSourceA(struct ndr_pull *ndr, int flags, struct eventlog_RegisterEventSourceA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_RegisterEventSourceA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterEventSourceA *r) -{ - ndr_print_struct(ndr, name, "eventlog_RegisterEventSourceA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_RegisterEventSourceA"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_RegisterEventSourceA"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_OpenBackupEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_OpenBackupEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_OpenBackupEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_OpenBackupEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_OpenBackupEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenBackupEventLogA *r) -{ - ndr_print_struct(ndr, name, "eventlog_OpenBackupEventLogA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_OpenBackupEventLogA"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_OpenBackupEventLogA"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_ReadEventLogA(struct ndr_push *ndr, int flags, const struct eventlog_ReadEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_ReadEventLogA(struct ndr_pull *ndr, int flags, struct eventlog_ReadEventLogA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_ReadEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReadEventLogA *r) -{ - ndr_print_struct(ndr, name, "eventlog_ReadEventLogA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_ReadEventLogA"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_ReadEventLogA"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_ReportEventA(struct ndr_push *ndr, int flags, const struct eventlog_ReportEventA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_ReportEventA(struct ndr_pull *ndr, int flags, struct eventlog_ReportEventA *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_ReportEventA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReportEventA *r) -{ - ndr_print_struct(ndr, name, "eventlog_ReportEventA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_ReportEventA"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_ReportEventA"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_RegisterClusterSvc(struct ndr_push *ndr, int flags, const struct eventlog_RegisterClusterSvc *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_RegisterClusterSvc(struct ndr_pull *ndr, int flags, struct eventlog_RegisterClusterSvc *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_RegisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterClusterSvc *r) -{ - ndr_print_struct(ndr, name, "eventlog_RegisterClusterSvc"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_RegisterClusterSvc"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_RegisterClusterSvc"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_DeregisterClusterSvc(struct ndr_push *ndr, int flags, const struct eventlog_DeregisterClusterSvc *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_DeregisterClusterSvc(struct ndr_pull *ndr, int flags, struct eventlog_DeregisterClusterSvc *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_DeregisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_DeregisterClusterSvc *r) -{ - ndr_print_struct(ndr, name, "eventlog_DeregisterClusterSvc"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_DeregisterClusterSvc"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_DeregisterClusterSvc"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_WriteClusterEvents(struct ndr_push *ndr, int flags, const struct eventlog_WriteClusterEvents *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_WriteClusterEvents(struct ndr_pull *ndr, int flags, struct eventlog_WriteClusterEvents *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_WriteClusterEvents(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_WriteClusterEvents *r) -{ - ndr_print_struct(ndr, name, "eventlog_WriteClusterEvents"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_WriteClusterEvents"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_WriteClusterEvents"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_eventlog_GetLogIntormation(struct ndr_push *ndr, int flags, const struct eventlog_GetLogIntormation *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_GetLogIntormation(struct ndr_pull *ndr, int flags, struct eventlog_GetLogIntormation *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_GetLogIntormation(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetLogIntormation *r) -{ - ndr_print_struct(ndr, name, "eventlog_GetLogIntormation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_GetLogIntormation"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_GetLogIntormation"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_eventlog_FlushEventLog(struct ndr_pull *ndr, int flags, struct eventlog_FlushEventLog *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_FlushEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_FlushEventLog *r) -{ - ndr_print_struct(ndr, name, "eventlog_FlushEventLog"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_FlushEventLog"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_FlushEventLog"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call eventlog_calls[] = { - { - "eventlog_ClearEventLogW", - sizeof(struct eventlog_ClearEventLogW), - (ndr_push_flags_fn_t) ndr_push_eventlog_ClearEventLogW, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_ClearEventLogW, - (ndr_print_function_t) ndr_print_eventlog_ClearEventLogW, - false, - }, - { - "eventlog_BackupEventLogW", - sizeof(struct eventlog_BackupEventLogW), - (ndr_push_flags_fn_t) ndr_push_eventlog_BackupEventLogW, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_BackupEventLogW, - (ndr_print_function_t) ndr_print_eventlog_BackupEventLogW, - false, - }, - { - "eventlog_CloseEventLog", - sizeof(struct eventlog_CloseEventLog), - (ndr_push_flags_fn_t) ndr_push_eventlog_CloseEventLog, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_CloseEventLog, - (ndr_print_function_t) ndr_print_eventlog_CloseEventLog, - false, - }, - { - "eventlog_DeregisterEventSource", - sizeof(struct eventlog_DeregisterEventSource), - (ndr_push_flags_fn_t) ndr_push_eventlog_DeregisterEventSource, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_DeregisterEventSource, - (ndr_print_function_t) ndr_print_eventlog_DeregisterEventSource, - false, - }, - { - "eventlog_GetNumRecords", - sizeof(struct eventlog_GetNumRecords), - (ndr_push_flags_fn_t) ndr_push_eventlog_GetNumRecords, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetNumRecords, - (ndr_print_function_t) ndr_print_eventlog_GetNumRecords, - false, - }, - { - "eventlog_GetOldestRecord", - sizeof(struct eventlog_GetOldestRecord), - (ndr_push_flags_fn_t) ndr_push_eventlog_GetOldestRecord, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetOldestRecord, - (ndr_print_function_t) ndr_print_eventlog_GetOldestRecord, - false, - }, - { - "eventlog_ChangeNotify", - sizeof(struct eventlog_ChangeNotify), - (ndr_push_flags_fn_t) ndr_push_eventlog_ChangeNotify, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_ChangeNotify, - (ndr_print_function_t) ndr_print_eventlog_ChangeNotify, - false, - }, - { - "eventlog_OpenEventLogW", - sizeof(struct eventlog_OpenEventLogW), - (ndr_push_flags_fn_t) ndr_push_eventlog_OpenEventLogW, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenEventLogW, - (ndr_print_function_t) ndr_print_eventlog_OpenEventLogW, - false, - }, - { - "eventlog_RegisterEventSourceW", - sizeof(struct eventlog_RegisterEventSourceW), - (ndr_push_flags_fn_t) ndr_push_eventlog_RegisterEventSourceW, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_RegisterEventSourceW, - (ndr_print_function_t) ndr_print_eventlog_RegisterEventSourceW, - false, - }, - { - "eventlog_OpenBackupEventLogW", - sizeof(struct eventlog_OpenBackupEventLogW), - (ndr_push_flags_fn_t) ndr_push_eventlog_OpenBackupEventLogW, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenBackupEventLogW, - (ndr_print_function_t) ndr_print_eventlog_OpenBackupEventLogW, - false, - }, - { - "eventlog_ReadEventLogW", - sizeof(struct eventlog_ReadEventLogW), - (ndr_push_flags_fn_t) ndr_push_eventlog_ReadEventLogW, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReadEventLogW, - (ndr_print_function_t) ndr_print_eventlog_ReadEventLogW, - false, - }, - { - "eventlog_ReportEventW", - sizeof(struct eventlog_ReportEventW), - (ndr_push_flags_fn_t) ndr_push_eventlog_ReportEventW, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReportEventW, - (ndr_print_function_t) ndr_print_eventlog_ReportEventW, - false, - }, - { - "eventlog_ClearEventLogA", - sizeof(struct eventlog_ClearEventLogA), - (ndr_push_flags_fn_t) ndr_push_eventlog_ClearEventLogA, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_ClearEventLogA, - (ndr_print_function_t) ndr_print_eventlog_ClearEventLogA, - false, - }, - { - "eventlog_BackupEventLogA", - sizeof(struct eventlog_BackupEventLogA), - (ndr_push_flags_fn_t) ndr_push_eventlog_BackupEventLogA, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_BackupEventLogA, - (ndr_print_function_t) ndr_print_eventlog_BackupEventLogA, - false, - }, - { - "eventlog_OpenEventLogA", - sizeof(struct eventlog_OpenEventLogA), - (ndr_push_flags_fn_t) ndr_push_eventlog_OpenEventLogA, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenEventLogA, - (ndr_print_function_t) ndr_print_eventlog_OpenEventLogA, - false, - }, - { - "eventlog_RegisterEventSourceA", - sizeof(struct eventlog_RegisterEventSourceA), - (ndr_push_flags_fn_t) ndr_push_eventlog_RegisterEventSourceA, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_RegisterEventSourceA, - (ndr_print_function_t) ndr_print_eventlog_RegisterEventSourceA, - false, - }, - { - "eventlog_OpenBackupEventLogA", - sizeof(struct eventlog_OpenBackupEventLogA), - (ndr_push_flags_fn_t) ndr_push_eventlog_OpenBackupEventLogA, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_OpenBackupEventLogA, - (ndr_print_function_t) ndr_print_eventlog_OpenBackupEventLogA, - false, - }, - { - "eventlog_ReadEventLogA", - sizeof(struct eventlog_ReadEventLogA), - (ndr_push_flags_fn_t) ndr_push_eventlog_ReadEventLogA, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReadEventLogA, - (ndr_print_function_t) ndr_print_eventlog_ReadEventLogA, - false, - }, - { - "eventlog_ReportEventA", - sizeof(struct eventlog_ReportEventA), - (ndr_push_flags_fn_t) ndr_push_eventlog_ReportEventA, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_ReportEventA, - (ndr_print_function_t) ndr_print_eventlog_ReportEventA, - false, - }, - { - "eventlog_RegisterClusterSvc", - sizeof(struct eventlog_RegisterClusterSvc), - (ndr_push_flags_fn_t) ndr_push_eventlog_RegisterClusterSvc, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_RegisterClusterSvc, - (ndr_print_function_t) ndr_print_eventlog_RegisterClusterSvc, - false, - }, - { - "eventlog_DeregisterClusterSvc", - sizeof(struct eventlog_DeregisterClusterSvc), - (ndr_push_flags_fn_t) ndr_push_eventlog_DeregisterClusterSvc, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_DeregisterClusterSvc, - (ndr_print_function_t) ndr_print_eventlog_DeregisterClusterSvc, - false, - }, - { - "eventlog_WriteClusterEvents", - sizeof(struct eventlog_WriteClusterEvents), - (ndr_push_flags_fn_t) ndr_push_eventlog_WriteClusterEvents, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_WriteClusterEvents, - (ndr_print_function_t) ndr_print_eventlog_WriteClusterEvents, - false, - }, - { - "eventlog_GetLogIntormation", - sizeof(struct eventlog_GetLogIntormation), - (ndr_push_flags_fn_t) ndr_push_eventlog_GetLogIntormation, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetLogIntormation, - (ndr_print_function_t) ndr_print_eventlog_GetLogIntormation, - false, - }, - { - "eventlog_FlushEventLog", - sizeof(struct eventlog_FlushEventLog), - (ndr_push_flags_fn_t) ndr_push_eventlog_FlushEventLog, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_FlushEventLog, - (ndr_print_function_t) ndr_print_eventlog_FlushEventLog, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const eventlog_endpoint_strings[] = { - "ncacn_np:[\\pipe\\eventlog]", -}; - -static const struct ndr_interface_string_array eventlog_endpoints = { - .count = 1, - .names = eventlog_endpoint_strings -}; - -static const char * const eventlog_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array eventlog_authservices = { - .count = 1, - .names = eventlog_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_eventlog = { - .name = "eventlog", - .syntax_id = { - {0x82273fdc,0xe32a,0x18c3,{0x3f,0x78},{0x82,0x79,0x29,0xdc,0x23,0xea}}, - NDR_EVENTLOG_VERSION - }, - .helpstring = NDR_EVENTLOG_HELPSTRING, - .num_calls = 24, - .calls = eventlog_calls, - .endpoints = &eventlog_endpoints, - .authservices = &eventlog_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_eventlog.h b/source3/librpc/gen_ndr/ndr_eventlog.h deleted file mode 100644 index 6002f35a7d..0000000000 --- a/source3/librpc/gen_ndr/ndr_eventlog.h +++ /dev/null @@ -1,92 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/eventlog.h" - -#ifndef _HEADER_NDR_eventlog -#define _HEADER_NDR_eventlog - -#define NDR_EVENTLOG_UUID "82273fdc-e32a-18c3-3f78-827929dc23ea" -#define NDR_EVENTLOG_VERSION 0.0 -#define NDR_EVENTLOG_NAME "eventlog" -#define NDR_EVENTLOG_HELPSTRING "Event Logger" -extern const struct ndr_interface_table ndr_table_eventlog; -#define NDR_EVENTLOG_CLEAREVENTLOGW (0x00) - -#define NDR_EVENTLOG_BACKUPEVENTLOGW (0x01) - -#define NDR_EVENTLOG_CLOSEEVENTLOG (0x02) - -#define NDR_EVENTLOG_DEREGISTEREVENTSOURCE (0x03) - -#define NDR_EVENTLOG_GETNUMRECORDS (0x04) - -#define NDR_EVENTLOG_GETOLDESTRECORD (0x05) - -#define NDR_EVENTLOG_CHANGENOTIFY (0x06) - -#define NDR_EVENTLOG_OPENEVENTLOGW (0x07) - -#define NDR_EVENTLOG_REGISTEREVENTSOURCEW (0x08) - -#define NDR_EVENTLOG_OPENBACKUPEVENTLOGW (0x09) - -#define NDR_EVENTLOG_READEVENTLOGW (0x0a) - -#define NDR_EVENTLOG_REPORTEVENTW (0x0b) - -#define NDR_EVENTLOG_CLEAREVENTLOGA (0x0c) - -#define NDR_EVENTLOG_BACKUPEVENTLOGA (0x0d) - -#define NDR_EVENTLOG_OPENEVENTLOGA (0x0e) - -#define NDR_EVENTLOG_REGISTEREVENTSOURCEA (0x0f) - -#define NDR_EVENTLOG_OPENBACKUPEVENTLOGA (0x10) - -#define NDR_EVENTLOG_READEVENTLOGA (0x11) - -#define NDR_EVENTLOG_REPORTEVENTA (0x12) - -#define NDR_EVENTLOG_REGISTERCLUSTERSVC (0x13) - -#define NDR_EVENTLOG_DEREGISTERCLUSTERSVC (0x14) - -#define NDR_EVENTLOG_WRITECLUSTEREVENTS (0x15) - -#define NDR_EVENTLOG_GETLOGINTORMATION (0x16) - -#define NDR_EVENTLOG_FLUSHEVENTLOG (0x17) - -#define NDR_EVENTLOG_CALL_COUNT (24) -void ndr_print_eventlogReadFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_eventlog_OpenUnknown0(struct ndr_print *ndr, const char *name, const struct eventlog_OpenUnknown0 *r); -enum ndr_err_code ndr_push_eventlog_Record(struct ndr_push *ndr, int ndr_flags, const struct eventlog_Record *r); -enum ndr_err_code ndr_pull_eventlog_Record(struct ndr_pull *ndr, int ndr_flags, struct eventlog_Record *r); -void ndr_print_eventlog_Record(struct ndr_print *ndr, const char *name, const struct eventlog_Record *r); -void ndr_print_eventlog_ClearEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ClearEventLogW *r); -void ndr_print_eventlog_BackupEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_BackupEventLogW *r); -void ndr_print_eventlog_CloseEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_CloseEventLog *r); -void ndr_print_eventlog_DeregisterEventSource(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_DeregisterEventSource *r); -void ndr_print_eventlog_GetNumRecords(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetNumRecords *r); -void ndr_print_eventlog_GetOldestRecord(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetOldestRecord *r); -void ndr_print_eventlog_ChangeNotify(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ChangeNotify *r); -void ndr_print_eventlog_OpenEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenEventLogW *r); -void ndr_print_eventlog_RegisterEventSourceW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterEventSourceW *r); -void ndr_print_eventlog_OpenBackupEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenBackupEventLogW *r); -void ndr_print_eventlog_ReadEventLogW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReadEventLogW *r); -void ndr_print_eventlog_ReportEventW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReportEventW *r); -void ndr_print_eventlog_ClearEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ClearEventLogA *r); -void ndr_print_eventlog_BackupEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_BackupEventLogA *r); -void ndr_print_eventlog_OpenEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenEventLogA *r); -void ndr_print_eventlog_RegisterEventSourceA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterEventSourceA *r); -void ndr_print_eventlog_OpenBackupEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_OpenBackupEventLogA *r); -void ndr_print_eventlog_ReadEventLogA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReadEventLogA *r); -void ndr_print_eventlog_ReportEventA(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReportEventA *r); -void ndr_print_eventlog_RegisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterClusterSvc *r); -void ndr_print_eventlog_DeregisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_DeregisterClusterSvc *r); -void ndr_print_eventlog_WriteClusterEvents(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_WriteClusterEvents *r); -void ndr_print_eventlog_GetLogIntormation(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetLogIntormation *r); -void ndr_print_eventlog_FlushEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_FlushEventLog *r); -#endif /* _HEADER_NDR_eventlog */ diff --git a/source3/librpc/gen_ndr/ndr_initshutdown.c b/source3/librpc/gen_ndr/ndr_initshutdown.c deleted file mode 100644 index 62a19af3a2..0000000000 --- a/source3/librpc/gen_ndr/ndr_initshutdown.c +++ /dev/null @@ -1,330 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_initshutdown.h" - -#include "librpc/gen_ndr/ndr_lsa.h" -static enum ndr_err_code ndr_push_initshutdown_Init(struct ndr_push *ndr, int flags, const struct initshutdown_Init *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname)); - if (r->in.hostname) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message)); - if (r->in.message) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_initshutdown_Init(struct ndr_pull *ndr, int flags, struct initshutdown_Init *r) -{ - uint32_t _ptr_hostname; - uint32_t _ptr_message; - TALLOC_CTX *_mem_save_hostname_0; - TALLOC_CTX *_mem_save_message_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname)); - if (_ptr_hostname) { - NDR_PULL_ALLOC(ndr, r->in.hostname); - } else { - r->in.hostname = NULL; - } - if (r->in.hostname) { - _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message)); - if (_ptr_message) { - NDR_PULL_ALLOC(ndr, r->in.message); - } else { - r->in.message = NULL; - } - if (r->in.message) { - _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Init *r) -{ - ndr_print_struct(ndr, name, "initshutdown_Init"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "initshutdown_Init"); - ndr->depth++; - ndr_print_ptr(ndr, "hostname", r->in.hostname); - ndr->depth++; - if (r->in.hostname) { - ndr_print_uint16(ndr, "hostname", *r->in.hostname); - } - ndr->depth--; - ndr_print_ptr(ndr, "message", r->in.message); - ndr->depth++; - if (r->in.message) { - ndr_print_lsa_StringLarge(ndr, "message", r->in.message); - } - ndr->depth--; - ndr_print_uint32(ndr, "timeout", r->in.timeout); - ndr_print_uint8(ndr, "force_apps", r->in.force_apps); - ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "initshutdown_Init"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_initshutdown_Abort(struct ndr_push *ndr, int flags, const struct initshutdown_Abort *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); - if (r->in.server) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.server)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_initshutdown_Abort(struct ndr_pull *ndr, int flags, struct initshutdown_Abort *r) -{ - uint32_t _ptr_server; - TALLOC_CTX *_mem_save_server_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); - if (_ptr_server) { - NDR_PULL_ALLOC(ndr, r->in.server); - } else { - r->in.server = NULL; - } - if (r->in.server) { - _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.server)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_initshutdown_Abort(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Abort *r) -{ - ndr_print_struct(ndr, name, "initshutdown_Abort"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "initshutdown_Abort"); - ndr->depth++; - ndr_print_ptr(ndr, "server", r->in.server); - ndr->depth++; - if (r->in.server) { - ndr_print_uint16(ndr, "server", *r->in.server); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "initshutdown_Abort"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_initshutdown_InitEx(struct ndr_push *ndr, int flags, const struct initshutdown_InitEx *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname)); - if (r->in.hostname) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message)); - if (r->in.message) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reason)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_initshutdown_InitEx(struct ndr_pull *ndr, int flags, struct initshutdown_InitEx *r) -{ - uint32_t _ptr_hostname; - uint32_t _ptr_message; - TALLOC_CTX *_mem_save_hostname_0; - TALLOC_CTX *_mem_save_message_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname)); - if (_ptr_hostname) { - NDR_PULL_ALLOC(ndr, r->in.hostname); - } else { - r->in.hostname = NULL; - } - if (r->in.hostname) { - _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message)); - if (_ptr_message) { - NDR_PULL_ALLOC(ndr, r->in.message); - } else { - r->in.message = NULL; - } - if (r->in.message) { - _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reason)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_InitEx *r) -{ - ndr_print_struct(ndr, name, "initshutdown_InitEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "initshutdown_InitEx"); - ndr->depth++; - ndr_print_ptr(ndr, "hostname", r->in.hostname); - ndr->depth++; - if (r->in.hostname) { - ndr_print_uint16(ndr, "hostname", *r->in.hostname); - } - ndr->depth--; - ndr_print_ptr(ndr, "message", r->in.message); - ndr->depth++; - if (r->in.message) { - ndr_print_lsa_StringLarge(ndr, "message", r->in.message); - } - ndr->depth--; - ndr_print_uint32(ndr, "timeout", r->in.timeout); - ndr_print_uint8(ndr, "force_apps", r->in.force_apps); - ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot); - ndr_print_uint32(ndr, "reason", r->in.reason); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "initshutdown_InitEx"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call initshutdown_calls[] = { - { - "initshutdown_Init", - sizeof(struct initshutdown_Init), - (ndr_push_flags_fn_t) ndr_push_initshutdown_Init, - (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Init, - (ndr_print_function_t) ndr_print_initshutdown_Init, - false, - }, - { - "initshutdown_Abort", - sizeof(struct initshutdown_Abort), - (ndr_push_flags_fn_t) ndr_push_initshutdown_Abort, - (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Abort, - (ndr_print_function_t) ndr_print_initshutdown_Abort, - false, - }, - { - "initshutdown_InitEx", - sizeof(struct initshutdown_InitEx), - (ndr_push_flags_fn_t) ndr_push_initshutdown_InitEx, - (ndr_pull_flags_fn_t) ndr_pull_initshutdown_InitEx, - (ndr_print_function_t) ndr_print_initshutdown_InitEx, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const initshutdown_endpoint_strings[] = { - "ncacn_np:[\\pipe\\InitShutdown]", -}; - -static const struct ndr_interface_string_array initshutdown_endpoints = { - .count = 1, - .names = initshutdown_endpoint_strings -}; - -static const char * const initshutdown_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array initshutdown_authservices = { - .count = 1, - .names = initshutdown_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_initshutdown = { - .name = "initshutdown", - .syntax_id = { - {0x894de0c0,0x0d55,0x11d3,{0xa3,0x22},{0x00,0xc0,0x4f,0xa3,0x21,0xa1}}, - NDR_INITSHUTDOWN_VERSION - }, - .helpstring = NDR_INITSHUTDOWN_HELPSTRING, - .num_calls = 3, - .calls = initshutdown_calls, - .endpoints = &initshutdown_endpoints, - .authservices = &initshutdown_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_initshutdown.h b/source3/librpc/gen_ndr/ndr_initshutdown.h deleted file mode 100644 index 2cb5a530b0..0000000000 --- a/source3/librpc/gen_ndr/ndr_initshutdown.h +++ /dev/null @@ -1,24 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/initshutdown.h" - -#ifndef _HEADER_NDR_initshutdown -#define _HEADER_NDR_initshutdown - -#define NDR_INITSHUTDOWN_UUID "894de0c0-0d55-11d3-a322-00c04fa321a1" -#define NDR_INITSHUTDOWN_VERSION 1.0 -#define NDR_INITSHUTDOWN_NAME "initshutdown" -#define NDR_INITSHUTDOWN_HELPSTRING "Init shutdown service" -extern const struct ndr_interface_table ndr_table_initshutdown; -#define NDR_INITSHUTDOWN_INIT (0x00) - -#define NDR_INITSHUTDOWN_ABORT (0x01) - -#define NDR_INITSHUTDOWN_INITEX (0x02) - -#define NDR_INITSHUTDOWN_CALL_COUNT (3) -void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Init *r); -void ndr_print_initshutdown_Abort(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Abort *r); -void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_InitEx *r); -#endif /* _HEADER_NDR_initshutdown */ diff --git a/source3/librpc/gen_ndr/ndr_krb5pac.c b/source3/librpc/gen_ndr/ndr_krb5pac.c deleted file mode 100644 index 125fb7eb77..0000000000 --- a/source3/librpc/gen_ndr/ndr_krb5pac.c +++ /dev/null @@ -1,984 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_krb5pac.h" - -#include "librpc/gen_ndr/ndr_security.h" -#include "librpc/gen_ndr/ndr_netlogon.h" -#include "librpc/gen_ndr/ndr_samr.h" -static enum ndr_err_code ndr_push_PAC_LOGON_NAME(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_NAME *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->logon_time)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->account_name))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, 2 * strlen_m(r->account_name), sizeof(uint8_t), CH_UTF16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PAC_LOGON_NAME(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_NAME *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->logon_time)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, r->size, sizeof(uint8_t), CH_UTF16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_LOGON_NAME(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_NAME *r) -{ - ndr_print_struct(ndr, name, "PAC_LOGON_NAME"); - ndr->depth++; - ndr_print_NTTIME(ndr, "logon_time", r->logon_time); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->account_name):r->size); - ndr_print_string(ndr, "account_name", r->account_name); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_PAC_SIGNATURE_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_SIGNATURE_DATA *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->type)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->signature)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_PAC_SIGNATURE_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_SIGNATURE_DATA *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->type)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->signature)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_SIGNATURE_DATA(struct ndr_print *ndr, const char *name, const struct PAC_SIGNATURE_DATA *r) -{ - ndr_print_struct(ndr, name, "PAC_SIGNATURE_DATA"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint32(ndr, "type", r->type); - ndr_print_DATA_BLOB(ndr, "signature", r->signature); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_PAC_LOGON_INFO(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->res_group_dom_sid)); - NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->res_groups)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); - if (r->res_group_dom_sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->res_group_dom_sid)); - } - NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->res_groups)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PAC_LOGON_INFO(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO *r) -{ - uint32_t _ptr_res_group_dom_sid; - TALLOC_CTX *_mem_save_res_group_dom_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_res_group_dom_sid)); - if (_ptr_res_group_dom_sid) { - NDR_PULL_ALLOC(ndr, r->res_group_dom_sid); - } else { - r->res_group_dom_sid = NULL; - } - NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->res_groups)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); - if (r->res_group_dom_sid) { - _mem_save_res_group_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->res_group_dom_sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->res_group_dom_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_group_dom_sid_0, 0); - } - NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->res_groups)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_LOGON_INFO(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO *r) -{ - ndr_print_struct(ndr, name, "PAC_LOGON_INFO"); - ndr->depth++; - ndr_print_netr_SamInfo3(ndr, "info3", &r->info3); - ndr_print_ptr(ndr, "res_group_dom_sid", r->res_group_dom_sid); - ndr->depth++; - if (r->res_group_dom_sid) { - ndr_print_dom_sid2(ndr, "res_group_dom_sid", r->res_group_dom_sid); - } - ndr->depth--; - ndr_print_samr_RidWithAttributeArray(ndr, "res_groups", &r->res_groups); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_PAC_LOGON_INFO_CTR(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO_CTR *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_PAC_LOGON_INFO_CTR(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO_CTR *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_info_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->info); - } else { - r->info = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); - NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_LOGON_INFO_CTR(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO_CTR *r) -{ - ndr_print_struct(ndr, name, "PAC_LOGON_INFO_CTR"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->info); - ndr->depth++; - if (r->info) { - ndr_print_PAC_LOGON_INFO(ndr, "info", r->info); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_PAC_TYPE(struct ndr_push *ndr, int ndr_flags, enum PAC_TYPE r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_PAC_TYPE(struct ndr_pull *ndr, int ndr_flags, enum PAC_TYPE *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_TYPE(struct ndr_print *ndr, const char *name, enum PAC_TYPE r) -{ - const char *val = NULL; - - switch (r) { - case PAC_TYPE_LOGON_INFO: val = "PAC_TYPE_LOGON_INFO"; break; - case PAC_TYPE_SRV_CHECKSUM: val = "PAC_TYPE_SRV_CHECKSUM"; break; - case PAC_TYPE_KDC_CHECKSUM: val = "PAC_TYPE_KDC_CHECKSUM"; break; - case PAC_TYPE_LOGON_NAME: val = "PAC_TYPE_LOGON_NAME"; break; - case PAC_TYPE_CONSTRAINED_DELEGATION: val = "PAC_TYPE_CONSTRAINED_DELEGATION"; break; - case PAC_TYPE_UNKNOWN_12: val = "PAC_TYPE_UNKNOWN_12"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_DATA_BLOB_REM(struct ndr_push *ndr, int ndr_flags, const struct DATA_BLOB_REM *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DATA_BLOB_REM(struct ndr_pull *ndr, int ndr_flags, struct DATA_BLOB_REM *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DATA_BLOB_REM(struct ndr_print *ndr, const char *name, const struct DATA_BLOB_REM *r) -{ - ndr_print_struct(ndr, name, "DATA_BLOB_REM"); - ndr->depth++; - ndr_print_DATA_BLOB(ndr, "remaining", r->remaining); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_PAC_INFO(struct ndr_push *ndr, int ndr_flags, const union PAC_INFO *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case PAC_TYPE_LOGON_INFO: { - { - struct ndr_push *_ndr_logon_info; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_logon_info, 0xFFFFFC01, -1)); - NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(_ndr_logon_info, NDR_SCALARS|NDR_BUFFERS, &r->logon_info)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_logon_info, 0xFFFFFC01, -1)); - } - break; } - - case PAC_TYPE_SRV_CHECKSUM: { - NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum)); - break; } - - case PAC_TYPE_KDC_CHECKSUM: { - NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum)); - break; } - - case PAC_TYPE_LOGON_NAME: { - NDR_CHECK(ndr_push_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name)); - break; } - - default: { - { - struct ndr_push *_ndr_unknown; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_unknown, 0, -1)); - NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_unknown, NDR_SCALARS, &r->unknown)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_unknown, 0, -1)); - } - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case PAC_TYPE_LOGON_INFO: - break; - - case PAC_TYPE_SRV_CHECKSUM: - break; - - case PAC_TYPE_KDC_CHECKSUM: - break; - - case PAC_TYPE_LOGON_NAME: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_PAC_INFO(struct ndr_pull *ndr, int ndr_flags, union PAC_INFO *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case PAC_TYPE_LOGON_INFO: { - { - struct ndr_pull *_ndr_logon_info; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_logon_info, 0xFFFFFC01, -1)); - NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(_ndr_logon_info, NDR_SCALARS|NDR_BUFFERS, &r->logon_info)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_logon_info, 0xFFFFFC01, -1)); - } - break; } - - case PAC_TYPE_SRV_CHECKSUM: { - NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum)); - break; } - - case PAC_TYPE_KDC_CHECKSUM: { - NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum)); - break; } - - case PAC_TYPE_LOGON_NAME: { - NDR_CHECK(ndr_pull_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name)); - break; } - - default: { - { - struct ndr_pull *_ndr_unknown; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_unknown, 0, -1)); - NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_unknown, NDR_SCALARS, &r->unknown)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_unknown, 0, -1)); - } - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case PAC_TYPE_LOGON_INFO: - break; - - case PAC_TYPE_SRV_CHECKSUM: - break; - - case PAC_TYPE_KDC_CHECKSUM: - break; - - case PAC_TYPE_LOGON_NAME: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_INFO(struct ndr_print *ndr, const char *name, const union PAC_INFO *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "PAC_INFO"); - switch (level) { - case PAC_TYPE_LOGON_INFO: - ndr_print_PAC_LOGON_INFO_CTR(ndr, "logon_info", &r->logon_info); - break; - - case PAC_TYPE_SRV_CHECKSUM: - ndr_print_PAC_SIGNATURE_DATA(ndr, "srv_cksum", &r->srv_cksum); - break; - - case PAC_TYPE_KDC_CHECKSUM: - ndr_print_PAC_SIGNATURE_DATA(ndr, "kdc_cksum", &r->kdc_cksum); - break; - - case PAC_TYPE_LOGON_NAME: - ndr_print_PAC_LOGON_NAME(ndr, "logon_name", &r->logon_name); - break; - - default: - ndr_print_DATA_BLOB_REM(ndr, "unknown", &r->unknown); - break; - - } -} - -_PUBLIC_ size_t ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags) -{ - return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_PAC_INFO); -} - -_PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA *r) -{ - uint32_t cntr_buffers_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { - NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { - NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA *r) -{ - uint32_t cntr_buffers_0; - TALLOC_CTX *_mem_save_buffers_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers); - _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); - for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { - NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); - for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { - NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_DATA(struct ndr_print *ndr, const char *name, const struct PAC_DATA *r) -{ - uint32_t cntr_buffers_0; - ndr_print_struct(ndr, name, "PAC_DATA"); - ndr->depth++; - ndr_print_uint32(ndr, "num_buffers", r->num_buffers); - ndr_print_uint32(ndr, "version", r->version); - ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers); - ndr->depth++; - for (cntr_buffers_0=0;cntr_buffers_0num_buffers;cntr_buffers_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) { - ndr_print_PAC_BUFFER(ndr, "buffers", &r->buffers[cntr_buffers_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ndr_size)); - { - uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info)); - ndr->flags = _flags_save_DATA_BLOB_REM; - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); - if (r->info) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->info)); - { - struct ndr_push *_ndr_info; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); - NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); - } - } - ndr->flags = _flags_save_DATA_BLOB_REM; - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_PAC_BUFFER_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER_RAW *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_info_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_PAC_TYPE(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ndr_size)); - { - uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->info); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info)); - } else { - r->info = NULL; - } - ndr->flags = _flags_save_DATA_BLOB_REM; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad)); - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); - if (r->info) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->info)); - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); - { - struct ndr_pull *_ndr_info; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); - NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - ndr->offset = _relative_save_offset; - } - ndr->flags = _flags_save_DATA_BLOB_REM; - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_BUFFER_RAW(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER_RAW *r) -{ - ndr_print_struct(ndr, name, "PAC_BUFFER_RAW"); - ndr->depth++; - ndr_print_PAC_TYPE(ndr, "type", r->type); - ndr_print_uint32(ndr, "ndr_size", r->ndr_size); - ndr_print_ptr(ndr, "info", r->info); - ndr->depth++; - if (r->info) { - ndr_print_DATA_BLOB_REM(ndr, "info", r->info); - } - ndr->depth--; - ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA_RAW *r) -{ - uint32_t cntr_buffers_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { - NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { - NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA_RAW *r) -{ - uint32_t cntr_buffers_0; - TALLOC_CTX *_mem_save_buffers_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers); - _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); - for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { - NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); - for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { - NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_DATA_RAW(struct ndr_print *ndr, const char *name, const struct PAC_DATA_RAW *r) -{ - uint32_t cntr_buffers_0; - ndr_print_struct(ndr, name, "PAC_DATA_RAW"); - ndr->depth++; - ndr_print_uint32(ndr, "num_buffers", r->num_buffers); - ndr_print_uint32(ndr, "version", r->version); - ndr->print(ndr, "%s: ARRAY(%d)", "buffers", (int)r->num_buffers); - ndr->depth++; - for (cntr_buffers_0=0;cntr_buffers_0num_buffers;cntr_buffers_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) { - ndr_print_PAC_BUFFER_RAW(ndr, "buffers", &r->buffers[cntr_buffers_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_PAC_Validate(struct ndr_push *ndr, int ndr_flags, const struct PAC_Validate *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NETLOGON_GENERIC_KRB5_PAC_VALIDATE)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ChecksumLength)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->SignatureType)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SignatureLength)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->ChecksumAndSignature)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_PAC_Validate(struct ndr_pull *ndr, int ndr_flags, struct PAC_Validate *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MessageType)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ChecksumLength)); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->SignatureType)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SignatureLength)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->ChecksumAndSignature)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PAC_Validate(struct ndr_print *ndr, const char *name, const struct PAC_Validate *r) -{ - ndr_print_struct(ndr, name, "PAC_Validate"); - ndr->depth++; - ndr_print_uint32(ndr, "MessageType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NETLOGON_GENERIC_KRB5_PAC_VALIDATE:r->MessageType); - ndr_print_uint32(ndr, "ChecksumLength", r->ChecksumLength); - ndr_print_int32(ndr, "SignatureType", r->SignatureType); - ndr_print_uint32(ndr, "SignatureLength", r->SignatureLength); - ndr_print_DATA_BLOB(ndr, "ChecksumAndSignature", r->ChecksumAndSignature); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netsamlogoncache_entry(struct ndr_push *ndr, int ndr_flags, const struct netsamlogoncache_entry *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp)); - NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netsamlogoncache_entry(struct ndr_pull *ndr, int ndr_flags, struct netsamlogoncache_entry *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp)); - NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netsamlogoncache_entry(struct ndr_print *ndr, const char *name, const struct netsamlogoncache_entry *r) -{ - ndr_print_struct(ndr, name, "netsamlogoncache_entry"); - ndr->depth++; - ndr_print_time_t(ndr, "timestamp", r->timestamp); - ndr_print_netr_SamInfo3(ndr, "info3", &r->info3); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_pac(struct ndr_push *ndr, int flags, const struct decode_pac *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_pac(struct ndr_pull *ndr, int flags, struct decode_pac *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_pac(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac *r) -{ - ndr_print_struct(ndr, name, "decode_pac"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_pac"); - ndr->depth++; - ndr_print_PAC_DATA(ndr, "pac", &r->in.pac); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_pac"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_pac_raw(struct ndr_push *ndr, int flags, const struct decode_pac_raw *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_pac_raw(struct ndr_pull *ndr, int flags, struct decode_pac_raw *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_pac_raw(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_raw *r) -{ - ndr_print_struct(ndr, name, "decode_pac_raw"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_pac_raw"); - ndr->depth++; - ndr_print_PAC_DATA_RAW(ndr, "pac", &r->in.pac); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_pac_raw"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_login_info(struct ndr_push *ndr, int flags, const struct decode_login_info *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_login_info(struct ndr_pull *ndr, int flags, struct decode_login_info *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_login_info(struct ndr_print *ndr, const char *name, int flags, const struct decode_login_info *r) -{ - ndr_print_struct(ndr, name, "decode_login_info"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_login_info"); - ndr->depth++; - ndr_print_PAC_LOGON_INFO(ndr, "logon_info", &r->in.logon_info); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_login_info"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_decode_pac_validate(struct ndr_push *ndr, int flags, const struct decode_pac_validate *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_PAC_Validate(ndr, NDR_SCALARS, &r->in.pac_validate)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_decode_pac_validate(struct ndr_pull *ndr, int flags, struct decode_pac_validate *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_PAC_Validate(ndr, NDR_SCALARS, &r->in.pac_validate)); - } - if (flags & NDR_OUT) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_decode_pac_validate(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_validate *r) -{ - ndr_print_struct(ndr, name, "decode_pac_validate"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "decode_pac_validate"); - ndr->depth++; - ndr_print_PAC_Validate(ndr, "pac_validate", &r->in.pac_validate); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "decode_pac_validate"); - ndr->depth++; - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call krb5pac_calls[] = { - { - "decode_pac", - sizeof(struct decode_pac), - (ndr_push_flags_fn_t) ndr_push_decode_pac, - (ndr_pull_flags_fn_t) ndr_pull_decode_pac, - (ndr_print_function_t) ndr_print_decode_pac, - false, - }, - { - "decode_pac_raw", - sizeof(struct decode_pac_raw), - (ndr_push_flags_fn_t) ndr_push_decode_pac_raw, - (ndr_pull_flags_fn_t) ndr_pull_decode_pac_raw, - (ndr_print_function_t) ndr_print_decode_pac_raw, - false, - }, - { - "decode_login_info", - sizeof(struct decode_login_info), - (ndr_push_flags_fn_t) ndr_push_decode_login_info, - (ndr_pull_flags_fn_t) ndr_pull_decode_login_info, - (ndr_print_function_t) ndr_print_decode_login_info, - false, - }, - { - "decode_pac_validate", - sizeof(struct decode_pac_validate), - (ndr_push_flags_fn_t) ndr_push_decode_pac_validate, - (ndr_pull_flags_fn_t) ndr_pull_decode_pac_validate, - (ndr_print_function_t) ndr_print_decode_pac_validate, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const krb5pac_endpoint_strings[] = { - "ncacn_np:[\\pipe\\krb5pac]", -}; - -static const struct ndr_interface_string_array krb5pac_endpoints = { - .count = 1, - .names = krb5pac_endpoint_strings -}; - -static const char * const krb5pac_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array krb5pac_authservices = { - .count = 1, - .names = krb5pac_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_krb5pac = { - .name = "krb5pac", - .syntax_id = { - {0x12345778,0x1234,0xabcd,{0x00,0x00},{0x00,0x00,0x00,0x00}}, - NDR_KRB5PAC_VERSION - }, - .helpstring = NDR_KRB5PAC_HELPSTRING, - .num_calls = 4, - .calls = krb5pac_calls, - .endpoints = &krb5pac_endpoints, - .authservices = &krb5pac_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_krb5pac.h b/source3/librpc/gen_ndr/ndr_krb5pac.h deleted file mode 100644 index bf09e3fad5..0000000000 --- a/source3/librpc/gen_ndr/ndr_krb5pac.h +++ /dev/null @@ -1,61 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/krb5pac.h" - -#ifndef _HEADER_NDR_krb5pac -#define _HEADER_NDR_krb5pac - -#define NDR_KRB5PAC_UUID "12345778-1234-abcd-0000-00000000" -#define NDR_KRB5PAC_VERSION 0.0 -#define NDR_KRB5PAC_NAME "krb5pac" -#define NDR_KRB5PAC_HELPSTRING "Active Directory KRB5 PAC" -extern const struct ndr_interface_table ndr_table_krb5pac; -#define NDR_DECODE_PAC (0x00) - -#define NDR_DECODE_PAC_RAW (0x01) - -#define NDR_DECODE_LOGIN_INFO (0x02) - -#define NDR_DECODE_PAC_VALIDATE (0x03) - -#define NDR_KRB5PAC_CALL_COUNT (4) -void ndr_print_PAC_LOGON_NAME(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_NAME *r); -enum ndr_err_code ndr_push_PAC_SIGNATURE_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_SIGNATURE_DATA *r); -enum ndr_err_code ndr_pull_PAC_SIGNATURE_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_SIGNATURE_DATA *r); -void ndr_print_PAC_SIGNATURE_DATA(struct ndr_print *ndr, const char *name, const struct PAC_SIGNATURE_DATA *r); -void ndr_print_PAC_LOGON_INFO(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO *r); -enum ndr_err_code ndr_push_PAC_LOGON_INFO_CTR(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO_CTR *r); -enum ndr_err_code ndr_pull_PAC_LOGON_INFO_CTR(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO_CTR *r); -void ndr_print_PAC_LOGON_INFO_CTR(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO_CTR *r); -enum ndr_err_code ndr_push_PAC_TYPE(struct ndr_push *ndr, int ndr_flags, enum PAC_TYPE r); -enum ndr_err_code ndr_pull_PAC_TYPE(struct ndr_pull *ndr, int ndr_flags, enum PAC_TYPE *r); -void ndr_print_PAC_TYPE(struct ndr_print *ndr, const char *name, enum PAC_TYPE r); -void ndr_print_DATA_BLOB_REM(struct ndr_print *ndr, const char *name, const struct DATA_BLOB_REM *r); -enum ndr_err_code ndr_push_PAC_INFO(struct ndr_push *ndr, int ndr_flags, const union PAC_INFO *r); -enum ndr_err_code ndr_pull_PAC_INFO(struct ndr_pull *ndr, int ndr_flags, union PAC_INFO *r); -void ndr_print_PAC_INFO(struct ndr_print *ndr, const char *name, const union PAC_INFO *r); -size_t ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags); -enum ndr_err_code ndr_push_PAC_BUFFER(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER *r); -enum ndr_err_code ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER *r); -void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER *r); -enum ndr_err_code ndr_push_PAC_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA *r); -enum ndr_err_code ndr_pull_PAC_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA *r); -void ndr_print_PAC_DATA(struct ndr_print *ndr, const char *name, const struct PAC_DATA *r); -enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r); -enum ndr_err_code ndr_pull_PAC_BUFFER_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER_RAW *r); -void ndr_print_PAC_BUFFER_RAW(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER_RAW *r); -enum ndr_err_code ndr_push_PAC_DATA_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA_RAW *r); -enum ndr_err_code ndr_pull_PAC_DATA_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA_RAW *r); -void ndr_print_PAC_DATA_RAW(struct ndr_print *ndr, const char *name, const struct PAC_DATA_RAW *r); -enum ndr_err_code ndr_push_PAC_Validate(struct ndr_push *ndr, int ndr_flags, const struct PAC_Validate *r); -enum ndr_err_code ndr_pull_PAC_Validate(struct ndr_pull *ndr, int ndr_flags, struct PAC_Validate *r); -void ndr_print_PAC_Validate(struct ndr_print *ndr, const char *name, const struct PAC_Validate *r); -enum ndr_err_code ndr_push_netsamlogoncache_entry(struct ndr_push *ndr, int ndr_flags, const struct netsamlogoncache_entry *r); -enum ndr_err_code ndr_pull_netsamlogoncache_entry(struct ndr_pull *ndr, int ndr_flags, struct netsamlogoncache_entry *r); -void ndr_print_netsamlogoncache_entry(struct ndr_print *ndr, const char *name, const struct netsamlogoncache_entry *r); -void ndr_print_decode_pac(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac *r); -void ndr_print_decode_pac_raw(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_raw *r); -void ndr_print_decode_login_info(struct ndr_print *ndr, const char *name, int flags, const struct decode_login_info *r); -void ndr_print_decode_pac_validate(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_validate *r); -#endif /* _HEADER_NDR_krb5pac */ diff --git a/source3/librpc/gen_ndr/ndr_lsa.c b/source3/librpc/gen_ndr/ndr_lsa.c deleted file mode 100644 index 926903865e..0000000000 --- a/source3/librpc/gen_ndr/ndr_lsa.c +++ /dev/null @@ -1,13236 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_lsa.h" - -#include "librpc/gen_ndr/ndr_misc.h" -#include "librpc/gen_ndr/ndr_security.h" -_PUBLIC_ enum ndr_err_code ndr_push_lsa_String(struct ndr_push *ndr, int ndr_flags, const struct lsa_String *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, 2 * strlen_m(r->string) / 2, sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_String(struct ndr_pull *ndr, int ndr_flags, struct lsa_String *r) -{ - uint32_t _ptr_string; - TALLOC_CTX *_mem_save_string_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); - if (_ptr_string) { - NDR_PULL_ALLOC(ndr, r->string); - } else { - r->string = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); - if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); - } - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); - } - if (r->string) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size / 2)); - } - if (r->string) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length / 2)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_String(struct ndr_print *ndr, const char *name, const struct lsa_String *r) -{ - ndr_print_struct(ndr, name, "lsa_String"); - ndr->depth++; - ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->length); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->size); - ndr_print_ptr(ndr, "string", r->string); - ndr->depth++; - if (r->string) { - ndr_print_string(ndr, "string", r->string); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_StringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_StringLarge *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m_term(r->string))); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m_term(r->string) / 2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, 2 * strlen_m(r->string) / 2, sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_StringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_StringLarge *r) -{ - uint32_t _ptr_string; - TALLOC_CTX *_mem_save_string_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); - if (_ptr_string) { - NDR_PULL_ALLOC(ndr, r->string); - } else { - r->string = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); - if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); - } - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); - } - if (r->string) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size / 2)); - } - if (r->string) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length / 2)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_StringLarge(struct ndr_print *ndr, const char *name, const struct lsa_StringLarge *r) -{ - ndr_print_struct(ndr, name, "lsa_StringLarge"); - ndr->depth++; - ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->length); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m_term(r->string):r->size); - ndr_print_ptr(ndr, "string", r->string); - ndr->depth++; - if (r->string) { - ndr_print_string(ndr, "string", r->string); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_Strings(struct ndr_push *ndr, int ndr_flags, const struct lsa_Strings *r) -{ - uint32_t cntr_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_Strings(struct ndr_pull *ndr, int ndr_flags, struct lsa_Strings *r) -{ - uint32_t _ptr_names; - uint32_t cntr_names_1; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); - if (_ptr_names) { - NDR_PULL_ALLOC(ndr, r->names); - } else { - r->names = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); - NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); - _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - } - if (r->names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_Strings(struct ndr_print *ndr, const char *name, const struct lsa_Strings *r) -{ - uint32_t cntr_names_1; - ndr_print_struct(ndr, name, "lsa_Strings"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "names", r->names); - ndr->depth++; - if (r->names) { - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); - ndr->depth++; - for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { - ndr_print_lsa_String(ndr, "names", &r->names[cntr_names_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_AsciiString(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiString *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string))); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string))); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, strlen_m(r->string), sizeof(uint8_t), CH_DOS)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_AsciiString(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiString *r) -{ - uint32_t _ptr_string; - TALLOC_CTX *_mem_save_string_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); - if (_ptr_string) { - NDR_PULL_ALLOC(ndr, r->string); - } else { - r->string = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); - if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); - } - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint8_t), CH_DOS)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); - } - if (r->string) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size)); - } - if (r->string) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_AsciiString(struct ndr_print *ndr, const char *name, const struct lsa_AsciiString *r) -{ - ndr_print_struct(ndr, name, "lsa_AsciiString"); - ndr->depth++; - ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->length); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->size); - ndr_print_ptr(ndr, "string", r->string); - ndr->depth++; - if (r->string) { - ndr_print_string(ndr, "string", r->string); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_AsciiStringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiStringLarge *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string))); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->string))); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->string))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, strlen_m(r->string), sizeof(uint8_t), CH_DOS)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_AsciiStringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiStringLarge *r) -{ - uint32_t _ptr_string; - TALLOC_CTX *_mem_save_string_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); - if (_ptr_string) { - NDR_PULL_ALLOC(ndr, r->string); - } else { - r->string = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); - if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); - } - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint8_t), CH_DOS)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); - } - if (r->string) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size)); - } - if (r->string) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_AsciiStringLarge(struct ndr_print *ndr, const char *name, const struct lsa_AsciiStringLarge *r) -{ - ndr_print_struct(ndr, name, "lsa_AsciiStringLarge"); - ndr->depth++; - ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->length); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->string):r->size); - ndr_print_ptr(ndr, "string", r->string); - ndr->depth++; - if (r->string) { - ndr_print_string(ndr, "string", r->string); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct lsa_BinaryString *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length / 2)); - for (cntr_array_1 = 0; cntr_array_1 < r->length / 2; cntr_array_1++) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct lsa_BinaryString *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->array)); - if (ndr_get_array_length(ndr, &r->array) > ndr_get_array_size(ndr, &r->array)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->array), ndr_get_array_length(ndr, &r->array)); - } - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->length / 2; cntr_array_1++) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->size / 2)); - } - if (r->array) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->array, r->length / 2)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_BinaryString(struct ndr_print *ndr, const char *name, const struct lsa_BinaryString *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "lsa_BinaryString"); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr_print_uint16(ndr, "size", r->size); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->length / 2); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1length / 2;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_uint16(ndr, "array", r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LUID(struct ndr_push *ndr, int ndr_flags, const struct lsa_LUID *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->low)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->high)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LUID(struct ndr_pull *ndr, int ndr_flags, struct lsa_LUID *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->low)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->high)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LUID(struct ndr_print *ndr, const char *name, const struct lsa_LUID *r) -{ - ndr_print_struct(ndr, name, "lsa_LUID"); - ndr->depth++; - ndr_print_uint32(ndr, "low", r->low); - ndr_print_uint32(ndr, "high", r->high); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_PrivEntry(struct ndr_push *ndr, int ndr_flags, const struct lsa_PrivEntry *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_push_lsa_LUID(ndr, NDR_SCALARS, &r->luid)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_PrivEntry(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivEntry *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, &r->luid)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_PrivEntry(struct ndr_print *ndr, const char *name, const struct lsa_PrivEntry *r) -{ - ndr_print_struct(ndr, name, "lsa_PrivEntry"); - ndr->depth++; - ndr_print_lsa_StringLarge(ndr, "name", &r->name); - ndr_print_lsa_LUID(ndr, "luid", &r->luid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_PrivArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_PrivArray *r) -{ - uint32_t cntr_privs_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->privs)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->privs) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) { - NDR_CHECK(ndr_push_lsa_PrivEntry(ndr, NDR_SCALARS, &r->privs[cntr_privs_1])); - } - for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) { - NDR_CHECK(ndr_push_lsa_PrivEntry(ndr, NDR_BUFFERS, &r->privs[cntr_privs_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_PrivArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivArray *r) -{ - uint32_t _ptr_privs; - uint32_t cntr_privs_1; - TALLOC_CTX *_mem_save_privs_0; - TALLOC_CTX *_mem_save_privs_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privs)); - if (_ptr_privs) { - NDR_PULL_ALLOC(ndr, r->privs); - } else { - r->privs = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->privs) { - _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->privs, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->privs)); - NDR_PULL_ALLOC_N(ndr, r->privs, ndr_get_array_size(ndr, &r->privs)); - _mem_save_privs_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->privs, 0); - for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) { - NDR_CHECK(ndr_pull_lsa_PrivEntry(ndr, NDR_SCALARS, &r->privs[cntr_privs_1])); - } - for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) { - NDR_CHECK(ndr_pull_lsa_PrivEntry(ndr, NDR_BUFFERS, &r->privs[cntr_privs_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, 0); - } - if (r->privs) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privs, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_PrivArray(struct ndr_print *ndr, const char *name, const struct lsa_PrivArray *r) -{ - uint32_t cntr_privs_1; - ndr_print_struct(ndr, name, "lsa_PrivArray"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "privs", r->privs); - ndr->depth++; - if (r->privs) { - ndr->print(ndr, "%s: ARRAY(%d)", "privs", (int)r->count); - ndr->depth++; - for (cntr_privs_1=0;cntr_privs_1count;cntr_privs_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_privs_1) != -1) { - ndr_print_lsa_PrivEntry(ndr, "privs", &r->privs[cntr_privs_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_QosInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_QosInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->impersonation_level)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->context_mode)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->effective_only)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_QosInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_QosInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->impersonation_level)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->context_mode)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->effective_only)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_QosInfo(struct ndr_print *ndr, const char *name, const struct lsa_QosInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_QosInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "len", r->len); - ndr_print_uint16(ndr, "impersonation_level", r->impersonation_level); - ndr_print_uint8(ndr, "context_mode", r->context_mode); - ndr_print_uint8(ndr, "effective_only", r->effective_only); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_ObjectAttribute(struct ndr_push *ndr, int ndr_flags, const struct lsa_ObjectAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->root_dir)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sec_desc)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sec_qos)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->root_dir) { - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->root_dir)); - } - if (r->object_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_name, ndr_charset_length(r->object_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->sec_desc) { - NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sec_desc)); - } - if (r->sec_qos) { - NDR_CHECK(ndr_push_lsa_QosInfo(ndr, NDR_SCALARS, r->sec_qos)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ObjectAttribute(struct ndr_pull *ndr, int ndr_flags, struct lsa_ObjectAttribute *r) -{ - uint32_t _ptr_root_dir; - TALLOC_CTX *_mem_save_root_dir_0; - uint32_t _ptr_object_name; - TALLOC_CTX *_mem_save_object_name_0; - uint32_t _ptr_sec_desc; - TALLOC_CTX *_mem_save_sec_desc_0; - uint32_t _ptr_sec_qos; - TALLOC_CTX *_mem_save_sec_qos_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_root_dir)); - if (_ptr_root_dir) { - NDR_PULL_ALLOC(ndr, r->root_dir); - } else { - r->root_dir = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_name)); - if (_ptr_object_name) { - NDR_PULL_ALLOC(ndr, r->object_name); - } else { - r->object_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sec_desc)); - if (_ptr_sec_desc) { - NDR_PULL_ALLOC(ndr, r->sec_desc); - } else { - r->sec_desc = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sec_qos)); - if (_ptr_sec_qos) { - NDR_PULL_ALLOC(ndr, r->sec_qos); - } else { - r->sec_qos = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->root_dir) { - _mem_save_root_dir_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->root_dir, 0); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->root_dir)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_root_dir_0, 0); - } - if (r->object_name) { - _mem_save_object_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->object_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->object_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->object_name)); - if (ndr_get_array_length(ndr, &r->object_name) > ndr_get_array_size(ndr, &r->object_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_name), ndr_get_array_length(ndr, &r->object_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_name, ndr_get_array_length(ndr, &r->object_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_name_0, 0); - } - if (r->sec_desc) { - _mem_save_sec_desc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sec_desc, 0); - NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sec_desc)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_desc_0, 0); - } - if (r->sec_qos) { - _mem_save_sec_qos_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sec_qos, 0); - NDR_CHECK(ndr_pull_lsa_QosInfo(ndr, NDR_SCALARS, r->sec_qos)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_qos_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ObjectAttribute(struct ndr_print *ndr, const char *name, const struct lsa_ObjectAttribute *r) -{ - ndr_print_struct(ndr, name, "lsa_ObjectAttribute"); - ndr->depth++; - ndr_print_uint32(ndr, "len", r->len); - ndr_print_ptr(ndr, "root_dir", r->root_dir); - ndr->depth++; - if (r->root_dir) { - ndr_print_uint8(ndr, "root_dir", *r->root_dir); - } - ndr->depth--; - ndr_print_ptr(ndr, "object_name", r->object_name); - ndr->depth++; - if (r->object_name) { - ndr_print_string(ndr, "object_name", r->object_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "attributes", r->attributes); - ndr_print_ptr(ndr, "sec_desc", r->sec_desc); - ndr->depth++; - if (r->sec_desc) { - ndr_print_security_descriptor(ndr, "sec_desc", r->sec_desc); - } - ndr->depth--; - ndr_print_ptr(ndr, "sec_qos", r->sec_qos); - ndr->depth++; - if (r->sec_qos) { - ndr_print_lsa_QosInfo(ndr, "sec_qos", r->sec_qos); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_PolicyAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_PolicyAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_PolicyAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_VIEW_LOCAL_INFORMATION", LSA_POLICY_VIEW_LOCAL_INFORMATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_VIEW_AUDIT_INFORMATION", LSA_POLICY_VIEW_AUDIT_INFORMATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_GET_PRIVATE_INFORMATION", LSA_POLICY_GET_PRIVATE_INFORMATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_TRUST_ADMIN", LSA_POLICY_TRUST_ADMIN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_ACCOUNT", LSA_POLICY_CREATE_ACCOUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_SECRET", LSA_POLICY_CREATE_SECRET, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_PRIVILEGE", LSA_POLICY_CREATE_PRIVILEGE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS", LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SET_AUDIT_REQUIREMENTS", LSA_POLICY_SET_AUDIT_REQUIREMENTS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_AUDIT_LOG_ADMIN", LSA_POLICY_AUDIT_LOG_ADMIN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SERVER_ADMIN", LSA_POLICY_SERVER_ADMIN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_LOOKUP_NAMES", LSA_POLICY_LOOKUP_NAMES, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_AuditLogInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditLogInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->percent_full)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximum_log_size)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->retention_time)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->shutdown_in_progress)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->time_to_shutdown)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->next_audit_record)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_AuditLogInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditLogInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->percent_full)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximum_log_size)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->retention_time)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->shutdown_in_progress)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->time_to_shutdown)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->next_audit_record)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_AuditLogInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditLogInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_AuditLogInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "percent_full", r->percent_full); - ndr_print_uint32(ndr, "maximum_log_size", r->maximum_log_size); - ndr_print_hyper(ndr, "retention_time", r->retention_time); - ndr_print_uint8(ndr, "shutdown_in_progress", r->shutdown_in_progress); - ndr_print_hyper(ndr, "time_to_shutdown", r->time_to_shutdown); - ndr_print_uint32(ndr, "next_audit_record", r->next_audit_record); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_PolicyAuditPolicy(struct ndr_push *ndr, int ndr_flags, enum lsa_PolicyAuditPolicy r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_PolicyAuditPolicy(struct ndr_pull *ndr, int ndr_flags, enum lsa_PolicyAuditPolicy *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_PolicyAuditPolicy(struct ndr_print *ndr, const char *name, enum lsa_PolicyAuditPolicy r) -{ - const char *val = NULL; - - switch (r) { - case LSA_AUDIT_POLICY_NONE: val = "LSA_AUDIT_POLICY_NONE"; break; - case LSA_AUDIT_POLICY_SUCCESS: val = "LSA_AUDIT_POLICY_SUCCESS"; break; - case LSA_AUDIT_POLICY_FAILURE: val = "LSA_AUDIT_POLICY_FAILURE"; break; - case LSA_AUDIT_POLICY_ALL: val = "LSA_AUDIT_POLICY_ALL"; break; - case LSA_AUDIT_POLICY_CLEAR: val = "LSA_AUDIT_POLICY_CLEAR"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_lsa_AuditEventsInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditEventsInfo *r) -{ - uint32_t cntr_settings_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auditing_mode)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->settings)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->settings) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_settings_1 = 0; cntr_settings_1 < r->count; cntr_settings_1++) { - NDR_CHECK(ndr_push_lsa_PolicyAuditPolicy(ndr, NDR_SCALARS, r->settings[cntr_settings_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_AuditEventsInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditEventsInfo *r) -{ - uint32_t _ptr_settings; - uint32_t cntr_settings_1; - TALLOC_CTX *_mem_save_settings_0; - TALLOC_CTX *_mem_save_settings_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auditing_mode)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_settings)); - if (_ptr_settings) { - NDR_PULL_ALLOC(ndr, r->settings); - } else { - r->settings = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->settings) { - _mem_save_settings_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->settings, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->settings)); - NDR_PULL_ALLOC_N(ndr, r->settings, ndr_get_array_size(ndr, &r->settings)); - _mem_save_settings_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->settings, 0); - for (cntr_settings_1 = 0; cntr_settings_1 < r->count; cntr_settings_1++) { - NDR_CHECK(ndr_pull_lsa_PolicyAuditPolicy(ndr, NDR_SCALARS, &r->settings[cntr_settings_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_settings_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_settings_0, 0); - } - if (r->settings) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->settings, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_AuditEventsInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditEventsInfo *r) -{ - uint32_t cntr_settings_1; - ndr_print_struct(ndr, name, "lsa_AuditEventsInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "auditing_mode", r->auditing_mode); - ndr_print_ptr(ndr, "settings", r->settings); - ndr->depth++; - if (r->settings) { - ndr->print(ndr, "%s: ARRAY(%d)", "settings", (int)r->count); - ndr->depth++; - for (cntr_settings_1=0;cntr_settings_1count;cntr_settings_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_settings_1) != -1) { - ndr_print_lsa_PolicyAuditPolicy(ndr, "settings", r->settings[cntr_settings_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_uint32(ndr, "count", r->count); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DomainInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInfo *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_DomainInfo"); - ndr->depth++; - ndr_print_lsa_StringLarge(ndr, "name", &r->name); - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_PDAccountInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_PDAccountInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_PDAccountInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_PDAccountInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_PDAccountInfo(struct ndr_print *ndr, const char *name, const struct lsa_PDAccountInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_PDAccountInfo"); - ndr->depth++; - ndr_print_lsa_String(ndr, "name", &r->name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_Role(struct ndr_push *ndr, int ndr_flags, enum lsa_Role r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_Role(struct ndr_pull *ndr, int ndr_flags, enum lsa_Role *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_Role(struct ndr_print *ndr, const char *name, enum lsa_Role r) -{ - const char *val = NULL; - - switch (r) { - case LSA_ROLE_BACKUP: val = "LSA_ROLE_BACKUP"; break; - case LSA_ROLE_PRIMARY: val = "LSA_ROLE_PRIMARY"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_lsa_ServerRole(struct ndr_push *ndr, int ndr_flags, const struct lsa_ServerRole *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_Role(ndr, NDR_SCALARS, r->role)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ServerRole(struct ndr_pull *ndr, int ndr_flags, struct lsa_ServerRole *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_Role(ndr, NDR_SCALARS, &r->role)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ServerRole(struct ndr_print *ndr, const char *name, const struct lsa_ServerRole *r) -{ - ndr_print_struct(ndr, name, "lsa_ServerRole"); - ndr->depth++; - ndr_print_lsa_Role(ndr, "role", r->role); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_ReplicaSourceInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_ReplicaSourceInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->source)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->source)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ReplicaSourceInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ReplicaSourceInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->source)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->source)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ReplicaSourceInfo(struct ndr_print *ndr, const char *name, const struct lsa_ReplicaSourceInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_ReplicaSourceInfo"); - ndr->depth++; - ndr_print_lsa_String(ndr, "source", &r->source); - ndr_print_lsa_String(ndr, "account", &r->account); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DefaultQuotaInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_DefaultQuotaInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->paged_pool)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->non_paged_pool)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->min_wss)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_wss)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagefile)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DefaultQuotaInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DefaultQuotaInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->paged_pool)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->non_paged_pool)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->min_wss)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_wss)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagefile)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DefaultQuotaInfo(struct ndr_print *ndr, const char *name, const struct lsa_DefaultQuotaInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_DefaultQuotaInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "paged_pool", r->paged_pool); - ndr_print_uint32(ndr, "non_paged_pool", r->non_paged_pool); - ndr_print_uint32(ndr, "min_wss", r->min_wss); - ndr_print_uint32(ndr, "max_wss", r->max_wss); - ndr_print_uint32(ndr, "pagefile", r->pagefile); - ndr_print_hyper(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_ModificationInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_ModificationInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->modified_id)); - NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->db_create_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ModificationInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ModificationInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->modified_id)); - NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->db_create_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ModificationInfo(struct ndr_print *ndr, const char *name, const struct lsa_ModificationInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_ModificationInfo"); - ndr->depth++; - ndr_print_hyper(ndr, "modified_id", r->modified_id); - ndr_print_NTTIME_hyper(ndr, "db_create_time", r->db_create_time); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_AuditFullSetInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditFullSetInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->shutdown_on_full)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_AuditFullSetInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditFullSetInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->shutdown_on_full)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_AuditFullSetInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullSetInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_AuditFullSetInfo"); - ndr->depth++; - ndr_print_uint8(ndr, "shutdown_on_full", r->shutdown_on_full); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_AuditFullQueryInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditFullQueryInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->shutdown_on_full)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->log_is_full)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_AuditFullQueryInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditFullQueryInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->shutdown_on_full)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->log_is_full)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_AuditFullQueryInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullQueryInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_AuditFullQueryInfo"); - ndr->depth++; - ndr_print_uint8(ndr, "shutdown_on_full", r->shutdown_on_full); - ndr_print_uint8(ndr, "log_is_full", r->log_is_full); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DnsDomainInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_DnsDomainInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forest)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forest)); - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DnsDomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DnsDomainInfo *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forest)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forest)); - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DnsDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DnsDomainInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_DnsDomainInfo"); - ndr->depth++; - ndr_print_lsa_StringLarge(ndr, "name", &r->name); - ndr_print_lsa_StringLarge(ndr, "dns_domain", &r->dns_domain); - ndr_print_lsa_StringLarge(ndr, "dns_forest", &r->dns_forest); - ndr_print_GUID(ndr, "domain_guid", &r->domain_guid); - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_PolicyInfo(struct ndr_push *ndr, int ndr_flags, enum lsa_PolicyInfo r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_PolicyInfo(struct ndr_pull *ndr, int ndr_flags, enum lsa_PolicyInfo *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_PolicyInfo(struct ndr_print *ndr, const char *name, enum lsa_PolicyInfo r) -{ - const char *val = NULL; - - switch (r) { - case LSA_POLICY_INFO_AUDIT_LOG: val = "LSA_POLICY_INFO_AUDIT_LOG"; break; - case LSA_POLICY_INFO_AUDIT_EVENTS: val = "LSA_POLICY_INFO_AUDIT_EVENTS"; break; - case LSA_POLICY_INFO_DOMAIN: val = "LSA_POLICY_INFO_DOMAIN"; break; - case LSA_POLICY_INFO_PD: val = "LSA_POLICY_INFO_PD"; break; - case LSA_POLICY_INFO_ACCOUNT_DOMAIN: val = "LSA_POLICY_INFO_ACCOUNT_DOMAIN"; break; - case LSA_POLICY_INFO_ROLE: val = "LSA_POLICY_INFO_ROLE"; break; - case LSA_POLICY_INFO_REPLICA: val = "LSA_POLICY_INFO_REPLICA"; break; - case LSA_POLICY_INFO_QUOTA: val = "LSA_POLICY_INFO_QUOTA"; break; - case LSA_POLICY_INFO_MOD: val = "LSA_POLICY_INFO_MOD"; break; - case LSA_POLICY_INFO_AUDIT_FULL_SET: val = "LSA_POLICY_INFO_AUDIT_FULL_SET"; break; - case LSA_POLICY_INFO_AUDIT_FULL_QUERY: val = "LSA_POLICY_INFO_AUDIT_FULL_QUERY"; break; - case LSA_POLICY_INFO_DNS: val = "LSA_POLICY_INFO_DNS"; break; - case LSA_POLICY_INFO_DNS_INT: val = "LSA_POLICY_INFO_DNS_INT"; break; - case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: val = "LSA_POLICY_INFO_L_ACCOUNT_DOMAIN"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_lsa_PolicyInformation(struct ndr_push *ndr, int ndr_flags, const union lsa_PolicyInformation *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case LSA_POLICY_INFO_AUDIT_LOG: { - NDR_CHECK(ndr_push_lsa_AuditLogInfo(ndr, NDR_SCALARS, &r->audit_log)); - break; } - - case LSA_POLICY_INFO_AUDIT_EVENTS: { - NDR_CHECK(ndr_push_lsa_AuditEventsInfo(ndr, NDR_SCALARS, &r->audit_events)); - break; } - - case LSA_POLICY_INFO_DOMAIN: { - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domain)); - break; } - - case LSA_POLICY_INFO_PD: { - NDR_CHECK(ndr_push_lsa_PDAccountInfo(ndr, NDR_SCALARS, &r->pd)); - break; } - - case LSA_POLICY_INFO_ACCOUNT_DOMAIN: { - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->account_domain)); - break; } - - case LSA_POLICY_INFO_ROLE: { - NDR_CHECK(ndr_push_lsa_ServerRole(ndr, NDR_SCALARS, &r->role)); - break; } - - case LSA_POLICY_INFO_REPLICA: { - NDR_CHECK(ndr_push_lsa_ReplicaSourceInfo(ndr, NDR_SCALARS, &r->replica)); - break; } - - case LSA_POLICY_INFO_QUOTA: { - NDR_CHECK(ndr_push_lsa_DefaultQuotaInfo(ndr, NDR_SCALARS, &r->quota)); - break; } - - case LSA_POLICY_INFO_MOD: { - NDR_CHECK(ndr_push_lsa_ModificationInfo(ndr, NDR_SCALARS, &r->mod)); - break; } - - case LSA_POLICY_INFO_AUDIT_FULL_SET: { - NDR_CHECK(ndr_push_lsa_AuditFullSetInfo(ndr, NDR_SCALARS, &r->auditfullset)); - break; } - - case LSA_POLICY_INFO_AUDIT_FULL_QUERY: { - NDR_CHECK(ndr_push_lsa_AuditFullQueryInfo(ndr, NDR_SCALARS, &r->auditfullquery)); - break; } - - case LSA_POLICY_INFO_DNS: { - NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns)); - break; } - - case LSA_POLICY_INFO_DNS_INT: { - NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns)); - break; } - - case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: { - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->l_account_domain)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case LSA_POLICY_INFO_AUDIT_LOG: - break; - - case LSA_POLICY_INFO_AUDIT_EVENTS: - NDR_CHECK(ndr_push_lsa_AuditEventsInfo(ndr, NDR_BUFFERS, &r->audit_events)); - break; - - case LSA_POLICY_INFO_DOMAIN: - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domain)); - break; - - case LSA_POLICY_INFO_PD: - NDR_CHECK(ndr_push_lsa_PDAccountInfo(ndr, NDR_BUFFERS, &r->pd)); - break; - - case LSA_POLICY_INFO_ACCOUNT_DOMAIN: - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->account_domain)); - break; - - case LSA_POLICY_INFO_ROLE: - break; - - case LSA_POLICY_INFO_REPLICA: - NDR_CHECK(ndr_push_lsa_ReplicaSourceInfo(ndr, NDR_BUFFERS, &r->replica)); - break; - - case LSA_POLICY_INFO_QUOTA: - break; - - case LSA_POLICY_INFO_MOD: - break; - - case LSA_POLICY_INFO_AUDIT_FULL_SET: - break; - - case LSA_POLICY_INFO_AUDIT_FULL_QUERY: - break; - - case LSA_POLICY_INFO_DNS: - NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns)); - break; - - case LSA_POLICY_INFO_DNS_INT: - NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns)); - break; - - case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->l_account_domain)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_PolicyInformation(struct ndr_pull *ndr, int ndr_flags, union lsa_PolicyInformation *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case LSA_POLICY_INFO_AUDIT_LOG: { - NDR_CHECK(ndr_pull_lsa_AuditLogInfo(ndr, NDR_SCALARS, &r->audit_log)); - break; } - - case LSA_POLICY_INFO_AUDIT_EVENTS: { - NDR_CHECK(ndr_pull_lsa_AuditEventsInfo(ndr, NDR_SCALARS, &r->audit_events)); - break; } - - case LSA_POLICY_INFO_DOMAIN: { - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domain)); - break; } - - case LSA_POLICY_INFO_PD: { - NDR_CHECK(ndr_pull_lsa_PDAccountInfo(ndr, NDR_SCALARS, &r->pd)); - break; } - - case LSA_POLICY_INFO_ACCOUNT_DOMAIN: { - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->account_domain)); - break; } - - case LSA_POLICY_INFO_ROLE: { - NDR_CHECK(ndr_pull_lsa_ServerRole(ndr, NDR_SCALARS, &r->role)); - break; } - - case LSA_POLICY_INFO_REPLICA: { - NDR_CHECK(ndr_pull_lsa_ReplicaSourceInfo(ndr, NDR_SCALARS, &r->replica)); - break; } - - case LSA_POLICY_INFO_QUOTA: { - NDR_CHECK(ndr_pull_lsa_DefaultQuotaInfo(ndr, NDR_SCALARS, &r->quota)); - break; } - - case LSA_POLICY_INFO_MOD: { - NDR_CHECK(ndr_pull_lsa_ModificationInfo(ndr, NDR_SCALARS, &r->mod)); - break; } - - case LSA_POLICY_INFO_AUDIT_FULL_SET: { - NDR_CHECK(ndr_pull_lsa_AuditFullSetInfo(ndr, NDR_SCALARS, &r->auditfullset)); - break; } - - case LSA_POLICY_INFO_AUDIT_FULL_QUERY: { - NDR_CHECK(ndr_pull_lsa_AuditFullQueryInfo(ndr, NDR_SCALARS, &r->auditfullquery)); - break; } - - case LSA_POLICY_INFO_DNS: { - NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns)); - break; } - - case LSA_POLICY_INFO_DNS_INT: { - NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns)); - break; } - - case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: { - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->l_account_domain)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case LSA_POLICY_INFO_AUDIT_LOG: - break; - - case LSA_POLICY_INFO_AUDIT_EVENTS: - NDR_CHECK(ndr_pull_lsa_AuditEventsInfo(ndr, NDR_BUFFERS, &r->audit_events)); - break; - - case LSA_POLICY_INFO_DOMAIN: - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domain)); - break; - - case LSA_POLICY_INFO_PD: - NDR_CHECK(ndr_pull_lsa_PDAccountInfo(ndr, NDR_BUFFERS, &r->pd)); - break; - - case LSA_POLICY_INFO_ACCOUNT_DOMAIN: - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->account_domain)); - break; - - case LSA_POLICY_INFO_ROLE: - break; - - case LSA_POLICY_INFO_REPLICA: - NDR_CHECK(ndr_pull_lsa_ReplicaSourceInfo(ndr, NDR_BUFFERS, &r->replica)); - break; - - case LSA_POLICY_INFO_QUOTA: - break; - - case LSA_POLICY_INFO_MOD: - break; - - case LSA_POLICY_INFO_AUDIT_FULL_SET: - break; - - case LSA_POLICY_INFO_AUDIT_FULL_QUERY: - break; - - case LSA_POLICY_INFO_DNS: - NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns)); - break; - - case LSA_POLICY_INFO_DNS_INT: - NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns)); - break; - - case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->l_account_domain)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_PolicyInformation(struct ndr_print *ndr, const char *name, const union lsa_PolicyInformation *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "lsa_PolicyInformation"); - switch (level) { - case LSA_POLICY_INFO_AUDIT_LOG: - ndr_print_lsa_AuditLogInfo(ndr, "audit_log", &r->audit_log); - break; - - case LSA_POLICY_INFO_AUDIT_EVENTS: - ndr_print_lsa_AuditEventsInfo(ndr, "audit_events", &r->audit_events); - break; - - case LSA_POLICY_INFO_DOMAIN: - ndr_print_lsa_DomainInfo(ndr, "domain", &r->domain); - break; - - case LSA_POLICY_INFO_PD: - ndr_print_lsa_PDAccountInfo(ndr, "pd", &r->pd); - break; - - case LSA_POLICY_INFO_ACCOUNT_DOMAIN: - ndr_print_lsa_DomainInfo(ndr, "account_domain", &r->account_domain); - break; - - case LSA_POLICY_INFO_ROLE: - ndr_print_lsa_ServerRole(ndr, "role", &r->role); - break; - - case LSA_POLICY_INFO_REPLICA: - ndr_print_lsa_ReplicaSourceInfo(ndr, "replica", &r->replica); - break; - - case LSA_POLICY_INFO_QUOTA: - ndr_print_lsa_DefaultQuotaInfo(ndr, "quota", &r->quota); - break; - - case LSA_POLICY_INFO_MOD: - ndr_print_lsa_ModificationInfo(ndr, "mod", &r->mod); - break; - - case LSA_POLICY_INFO_AUDIT_FULL_SET: - ndr_print_lsa_AuditFullSetInfo(ndr, "auditfullset", &r->auditfullset); - break; - - case LSA_POLICY_INFO_AUDIT_FULL_QUERY: - ndr_print_lsa_AuditFullQueryInfo(ndr, "auditfullquery", &r->auditfullquery); - break; - - case LSA_POLICY_INFO_DNS: - ndr_print_lsa_DnsDomainInfo(ndr, "dns", &r->dns); - break; - - case LSA_POLICY_INFO_DNS_INT: - ndr_print_lsa_DnsDomainInfo(ndr, "dns", &r->dns); - break; - - case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: - ndr_print_lsa_DomainInfo(ndr, "l_account_domain", &r->l_account_domain); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_lsa_SidPtr(struct ndr_push *ndr, int ndr_flags, const struct lsa_SidPtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SidPtr(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidPtr *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SidPtr(struct ndr_print *ndr, const char *name, const struct lsa_SidPtr *r) -{ - ndr_print_struct(ndr, name, "lsa_SidPtr"); - ndr->depth++; - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_SidArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_SidArray *r) -{ - uint32_t cntr_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); - for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { - NDR_CHECK(ndr_push_lsa_SidPtr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { - NDR_CHECK(ndr_push_lsa_SidPtr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_SidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidArray *r) -{ - uint32_t _ptr_sids; - uint32_t cntr_sids_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids)); - if (r->num_sids < 0 || r->num_sids > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); - if (_ptr_sids) { - NDR_PULL_ALLOC(ndr, r->sids); - } else { - r->sids = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sids) { - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); - NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); - _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { - NDR_CHECK(ndr_pull_lsa_SidPtr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) { - NDR_CHECK(ndr_pull_lsa_SidPtr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); - } - if (r->sids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SidArray(struct ndr_print *ndr, const char *name, const struct lsa_SidArray *r) -{ - uint32_t cntr_sids_1; - ndr_print_struct(ndr, name, "lsa_SidArray"); - ndr->depth++; - ndr_print_uint32(ndr, "num_sids", r->num_sids); - ndr_print_ptr(ndr, "sids", r->sids); - ndr->depth++; - if (r->sids) { - ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids); - ndr->depth++; - for (cntr_sids_1=0;cntr_sids_1num_sids;cntr_sids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { - ndr_print_lsa_SidPtr(ndr, "sids", &r->sids[cntr_sids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DomainList(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainList *r) -{ - uint32_t cntr_domains_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domains)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domains) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); - } - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainList *r) -{ - uint32_t _ptr_domains; - uint32_t cntr_domains_1; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->domains); - } else { - r->domains = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domains)); - NDR_PULL_ALLOC_N(ndr, r->domains, ndr_get_array_size(ndr, &r->domains)); - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); - } - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); - } - if (r->domains) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->domains, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DomainList(struct ndr_print *ndr, const char *name, const struct lsa_DomainList *r) -{ - uint32_t cntr_domains_1; - ndr_print_struct(ndr, name, "lsa_DomainList"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "domains", r->domains); - ndr->depth++; - if (r->domains) { - ndr->print(ndr, "%s: ARRAY(%d)", "domains", (int)r->count); - ndr->depth++; - for (cntr_domains_1=0;cntr_domains_1count;cntr_domains_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) { - ndr_print_lsa_DomainInfo(ndr, "domains", &r->domains[cntr_domains_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_SidType(struct ndr_push *ndr, int ndr_flags, enum lsa_SidType r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_SidType(struct ndr_pull *ndr, int ndr_flags, enum lsa_SidType *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SidType(struct ndr_print *ndr, const char *name, enum lsa_SidType r) -{ - const char *val = NULL; - - switch (r) { - case SID_NAME_USE_NONE: val = "SID_NAME_USE_NONE"; break; - case SID_NAME_USER: val = "SID_NAME_USER"; break; - case SID_NAME_DOM_GRP: val = "SID_NAME_DOM_GRP"; break; - case SID_NAME_DOMAIN: val = "SID_NAME_DOMAIN"; break; - case SID_NAME_ALIAS: val = "SID_NAME_ALIAS"; break; - case SID_NAME_WKN_GRP: val = "SID_NAME_WKN_GRP"; break; - case SID_NAME_DELETED: val = "SID_NAME_DELETED"; break; - case SID_NAME_INVALID: val = "SID_NAME_INVALID"; break; - case SID_NAME_UNKNOWN: val = "SID_NAME_UNKNOWN"; break; - case SID_NAME_COMPUTER: val = "SID_NAME_COMPUTER"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_lsa_TranslatedSid(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedSid *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TranslatedSid(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedSid *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TranslatedSid(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid *r) -{ - ndr_print_struct(ndr, name, "lsa_TranslatedSid"); - ndr->depth++; - ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "sid_index", r->sid_index); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TransSidArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransSidArray *r) -{ - uint32_t cntr_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { - NDR_CHECK(ndr_push_lsa_TranslatedSid(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TransSidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransSidArray *r) -{ - uint32_t _ptr_sids; - uint32_t cntr_sids_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); - if (_ptr_sids) { - NDR_PULL_ALLOC(ndr, r->sids); - } else { - r->sids = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sids) { - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); - NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); - _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { - NDR_CHECK(ndr_pull_lsa_TranslatedSid(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); - } - if (r->sids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TransSidArray(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray *r) -{ - uint32_t cntr_sids_1; - ndr_print_struct(ndr, name, "lsa_TransSidArray"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "sids", r->sids); - ndr->depth++; - if (r->sids) { - ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->count); - ndr->depth++; - for (cntr_sids_1=0;cntr_sids_1count;cntr_sids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { - ndr_print_lsa_TranslatedSid(ndr, "sids", &r->sids[cntr_sids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_RefDomainList(struct ndr_push *ndr, int ndr_flags, const struct lsa_RefDomainList *r) -{ - uint32_t cntr_domains_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domains)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_size)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domains) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); - } - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_RefDomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_RefDomainList *r) -{ - uint32_t _ptr_domains; - uint32_t cntr_domains_1; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->domains); - } else { - r->domains = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_size)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domains)); - NDR_PULL_ALLOC_N(ndr, r->domains, ndr_get_array_size(ndr, &r->domains)); - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); - } - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); - } - if (r->domains) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->domains, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_RefDomainList(struct ndr_print *ndr, const char *name, const struct lsa_RefDomainList *r) -{ - uint32_t cntr_domains_1; - ndr_print_struct(ndr, name, "lsa_RefDomainList"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "domains", r->domains); - ndr->depth++; - if (r->domains) { - ndr->print(ndr, "%s: ARRAY(%d)", "domains", (int)r->count); - ndr->depth++; - for (cntr_domains_1=0;cntr_domains_1count;cntr_domains_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) { - ndr_print_lsa_DomainInfo(ndr, "domains", &r->domains[cntr_domains_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_uint32(ndr, "max_size", r->max_size); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LookupNamesLevel(struct ndr_push *ndr, int ndr_flags, enum lsa_LookupNamesLevel r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LookupNamesLevel(struct ndr_pull *ndr, int ndr_flags, enum lsa_LookupNamesLevel *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupNamesLevel(struct ndr_print *ndr, const char *name, enum lsa_LookupNamesLevel r) -{ - const char *val = NULL; - - switch (r) { - case LSA_LOOKUP_NAMES_ALL: val = "LSA_LOOKUP_NAMES_ALL"; break; - case LSA_LOOKUP_NAMES_DOMAINS_ONLY: val = "LSA_LOOKUP_NAMES_DOMAINS_ONLY"; break; - case LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY: val = "LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY"; break; - case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY"; break; - case LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY"; break; - case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2"; break; - case LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC: val = "LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_lsa_TranslatedName(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedName *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TranslatedName(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedName *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TranslatedName(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName *r) -{ - ndr_print_struct(ndr, name, "lsa_TranslatedName"); - ndr->depth++; - ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); - ndr_print_lsa_String(ndr, "name", &r->name); - ndr_print_uint32(ndr, "sid_index", r->sid_index); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TransNameArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransNameArray *r) -{ - uint32_t cntr_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_lsa_TranslatedName(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_lsa_TranslatedName(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TransNameArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransNameArray *r) -{ - uint32_t _ptr_names; - uint32_t cntr_names_1; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); - if (_ptr_names) { - NDR_PULL_ALLOC(ndr, r->names); - } else { - r->names = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); - NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); - _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_lsa_TranslatedName(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_lsa_TranslatedName(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - } - if (r->names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TransNameArray(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray *r) -{ - uint32_t cntr_names_1; - ndr_print_struct(ndr, name, "lsa_TransNameArray"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "names", r->names); - ndr->depth++; - if (r->names) { - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); - ndr->depth++; - for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { - ndr_print_lsa_TranslatedName(ndr, "names", &r->names[cntr_names_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LUIDAttribute(struct ndr_push *ndr, int ndr_flags, const struct lsa_LUIDAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_LUID(ndr, NDR_SCALARS, &r->luid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribute)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LUIDAttribute(struct ndr_pull *ndr, int ndr_flags, struct lsa_LUIDAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, &r->luid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribute)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LUIDAttribute(struct ndr_print *ndr, const char *name, const struct lsa_LUIDAttribute *r) -{ - ndr_print_struct(ndr, name, "lsa_LUIDAttribute"); - ndr->depth++; - ndr_print_lsa_LUID(ndr, "luid", &r->luid); - ndr_print_uint32(ndr, "attribute", r->attribute); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_PrivilegeSet(struct ndr_push *ndr, int ndr_flags, const struct lsa_PrivilegeSet *r) -{ - uint32_t cntr_set_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); - for (cntr_set_0 = 0; cntr_set_0 < r->count; cntr_set_0++) { - NDR_CHECK(ndr_push_lsa_LUIDAttribute(ndr, NDR_SCALARS, &r->set[cntr_set_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_PrivilegeSet(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivilegeSet *r) -{ - uint32_t cntr_set_0; - TALLOC_CTX *_mem_save_set_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->set)); - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); - NDR_PULL_ALLOC_N(ndr, r->set, ndr_get_array_size(ndr, &r->set)); - _mem_save_set_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->set, 0); - for (cntr_set_0 = 0; cntr_set_0 < r->count; cntr_set_0++) { - NDR_CHECK(ndr_pull_lsa_LUIDAttribute(ndr, NDR_SCALARS, &r->set[cntr_set_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_set_0, 0); - if (r->set) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->set, r->count)); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_PrivilegeSet(struct ndr_print *ndr, const char *name, const struct lsa_PrivilegeSet *r) -{ - uint32_t cntr_set_0; - ndr_print_struct(ndr, name, "lsa_PrivilegeSet"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_uint32(ndr, "unknown", r->unknown); - ndr->print(ndr, "%s: ARRAY(%d)", "set", (int)r->count); - ndr->depth++; - for (cntr_set_0=0;cntr_set_0count;cntr_set_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_set_0) != -1) { - ndr_print_lsa_LUIDAttribute(ndr, "set", &r->set[cntr_set_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DATA_BUF(struct ndr_push *ndr, int ndr_flags, const struct lsa_DATA_BUF *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DATA_BUF(struct ndr_pull *ndr, int ndr_flags, struct lsa_DATA_BUF *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->data)); - if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data)); - } - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size)); - } - if (r->data) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DATA_BUF(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF *r) -{ - ndr_print_struct(ndr, name, "lsa_DATA_BUF"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint32(ndr, "length", r->length); - ndr_print_uint32(ndr, "size", r->size); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->length); - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_lsa_DATA_BUF2(struct ndr_push *ndr, int ndr_flags, const struct lsa_DATA_BUF2 *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->size)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DATA_BUF2(struct ndr_pull *ndr, int ndr_flags, struct lsa_DATA_BUF2 *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - if (r->size < 0 || r->size > 65536) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DATA_BUF2(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF2 *r) -{ - ndr_print_struct(ndr, name, "lsa_DATA_BUF2"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint32(ndr, "size", r->size); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->size); - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_lsa_TrustDomInfoEnum(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustDomInfoEnum r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustDomInfoEnum *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomInfoEnum(struct ndr_print *ndr, const char *name, enum lsa_TrustDomInfoEnum r) -{ - const char *val = NULL; - - switch (r) { - case LSA_TRUSTED_DOMAIN_INFO_NAME: val = "LSA_TRUSTED_DOMAIN_INFO_NAME"; break; - case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: val = "LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS"; break; - case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: val = "LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET"; break; - case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: val = "LSA_TRUSTED_DOMAIN_INFO_PASSWORD"; break; - case LSA_TRUSTED_DOMAIN_INFO_BASIC: val = "LSA_TRUSTED_DOMAIN_INFO_BASIC"; break; - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_EX"; break; - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: val = "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO"; break; - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO"; break; - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL"; break; - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL"; break; - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL"; break; - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL"; break; - case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: val = "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustDirection(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustDirection(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDirection(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_DIRECTION_INBOUND", LSA_TRUST_DIRECTION_INBOUND, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_DIRECTION_OUTBOUND", LSA_TRUST_DIRECTION_OUTBOUND, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustType r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustType *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustType(struct ndr_print *ndr, const char *name, enum lsa_TrustType r) -{ - const char *val = NULL; - - switch (r) { - case LSA_TRUST_TYPE_DOWNLEVEL: val = "LSA_TRUST_TYPE_DOWNLEVEL"; break; - case LSA_TRUST_TYPE_UPLEVEL: val = "LSA_TRUST_TYPE_UPLEVEL"; break; - case LSA_TRUST_TYPE_MIT: val = "LSA_TRUST_TYPE_MIT"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE", LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY", LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_WITHIN_FOREST", LSA_TRUST_ATTRIBUTE_WITHIN_FOREST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION", LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoName(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoName *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoName(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoName *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoName(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoName *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoName"); - ndr->depth++; - ndr_print_lsa_StringLarge(ndr, "netbios_name", &r->netbios_name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoControllers(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoControllers *r) -{ - uint32_t cntr_netbios_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_names)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_names) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries)); - for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_names[cntr_netbios_names_1])); - } - for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_names[cntr_netbios_names_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoControllers(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoControllers *r) -{ - uint32_t _ptr_netbios_names; - uint32_t cntr_netbios_names_1; - TALLOC_CTX *_mem_save_netbios_names_0; - TALLOC_CTX *_mem_save_netbios_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entries)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_names)); - if (_ptr_netbios_names) { - NDR_PULL_ALLOC(ndr, r->netbios_names); - } else { - r->netbios_names = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_names) { - _mem_save_netbios_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->netbios_names, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_names)); - NDR_PULL_ALLOC_N(ndr, r->netbios_names, ndr_get_array_size(ndr, &r->netbios_names)); - _mem_save_netbios_names_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->netbios_names, 0); - for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_names[cntr_netbios_names_1])); - } - for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_names[cntr_netbios_names_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_names_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_names_0, 0); - } - if (r->netbios_names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->netbios_names, r->entries)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoControllers(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoControllers *r) -{ - uint32_t cntr_netbios_names_1; - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoControllers"); - ndr->depth++; - ndr_print_uint32(ndr, "entries", r->entries); - ndr_print_ptr(ndr, "netbios_names", r->netbios_names); - ndr->depth++; - if (r->netbios_names) { - ndr->print(ndr, "%s: ARRAY(%d)", "netbios_names", (int)r->entries); - ndr->depth++; - for (cntr_netbios_names_1=0;cntr_netbios_names_1entries;cntr_netbios_names_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_netbios_names_1) != -1) { - ndr_print_lsa_StringLarge(ndr, "netbios_names", &r->netbios_names[cntr_netbios_names_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoPosixOffset(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoPosixOffset *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->posix_offset)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoPosixOffset(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoPosixOffset *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->posix_offset)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoPosixOffset(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPosixOffset *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoPosixOffset"); - ndr->depth++; - ndr_print_uint32(ndr, "posix_offset", r->posix_offset); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoPassword(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoPassword *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->old_password)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->password) { - NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - } - if (r->old_password) { - NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->old_password)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoPassword(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoPassword *r) -{ - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_password_0; - uint32_t _ptr_old_password; - TALLOC_CTX *_mem_save_old_password_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->password); - } else { - r->password = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_password)); - if (_ptr_old_password) { - NDR_PULL_ALLOC(ndr, r->old_password); - } else { - r->old_password = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); - NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - if (r->old_password) { - _mem_save_old_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->old_password, 0); - NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->old_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_password_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoPassword(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPassword *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoPassword"); - ndr->depth++; - ndr_print_ptr(ndr, "password", r->password); - ndr->depth++; - if (r->password) { - ndr_print_lsa_DATA_BUF(ndr, "password", r->password); - } - ndr->depth--; - ndr_print_ptr(ndr, "old_password", r->old_password); - ndr->depth++; - if (r->old_password) { - ndr_print_lsa_DATA_BUF(ndr, "old_password", r->old_password); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoBasic(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoBasic *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->netbios_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->netbios_name)); - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoBasic(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoBasic *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->netbios_name)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->netbios_name)); - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoBasic(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBasic *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoBasic"); - ndr->depth++; - ndr_print_lsa_String(ndr, "netbios_name", &r->netbios_name); - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoInfoEx(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoInfoEx *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - NDR_CHECK(ndr_push_lsa_TrustDirection(ndr, NDR_SCALARS, r->trust_direction)); - NDR_CHECK(ndr_push_lsa_TrustType(ndr, NDR_SCALARS, r->trust_type)); - NDR_CHECK(ndr_push_lsa_TrustAttributes(ndr, NDR_SCALARS, r->trust_attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain_name)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name)); - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoInfoEx(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoInfoEx *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - NDR_CHECK(ndr_pull_lsa_TrustDirection(ndr, NDR_SCALARS, &r->trust_direction)); - NDR_CHECK(ndr_pull_lsa_TrustType(ndr, NDR_SCALARS, &r->trust_type)); - NDR_CHECK(ndr_pull_lsa_TrustAttributes(ndr, NDR_SCALARS, &r->trust_attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain_name)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name)); - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoEx(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoInfoEx"); - ndr->depth++; - ndr_print_lsa_StringLarge(ndr, "domain_name", &r->domain_name); - ndr_print_lsa_StringLarge(ndr, "netbios_name", &r->netbios_name); - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr_print_lsa_TrustDirection(ndr, "trust_direction", r->trust_direction); - ndr_print_lsa_TrustType(ndr, "trust_type", r->trust_type); - ndr_print_lsa_TrustAttributes(ndr, "trust_attributes", r->trust_attributes); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustAuthType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustAuthType r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustAuthType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustAuthType *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustAuthType(struct ndr_print *ndr, const char *name, enum lsa_TrustAuthType r) -{ - const char *val = NULL; - - switch (r) { - case TRUST_AUTH_TYPE_NONE: val = "TRUST_AUTH_TYPE_NONE"; break; - case TRUST_AUTH_TYPE_NT4OWF: val = "TRUST_AUTH_TYPE_NT4OWF"; break; - case TRUST_AUTH_TYPE_CLEAR: val = "TRUST_AUTH_TYPE_CLEAR"; break; - case TRUST_AUTH_TYPE_VERSION: val = "TRUST_AUTH_TYPE_VERSION"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoBuffer(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoBuffer *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->last_update_time)); - NDR_CHECK(ndr_push_lsa_TrustAuthType(ndr, NDR_SCALARS, r->AuthType)); - NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->data)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoBuffer(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoBuffer *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->last_update_time)); - NDR_CHECK(ndr_pull_lsa_TrustAuthType(ndr, NDR_SCALARS, &r->AuthType)); - NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->data)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoBuffer(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBuffer *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoBuffer"); - ndr->depth++; - ndr_print_NTTIME_hyper(ndr, "last_update_time", r->last_update_time); - ndr_print_lsa_TrustAuthType(ndr, "AuthType", r->AuthType); - ndr_print_lsa_DATA_BUF2(ndr, "data", &r->data); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoAuthInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoAuthInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->incoming_count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->incoming_current_auth_info)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->incoming_previous_auth_info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->outgoing_count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->outgoing_current_auth_info)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->outgoing_previous_auth_info)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->incoming_current_auth_info) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->incoming_current_auth_info)); - } - if (r->incoming_previous_auth_info) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->incoming_previous_auth_info)); - } - if (r->outgoing_current_auth_info) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->outgoing_current_auth_info)); - } - if (r->outgoing_previous_auth_info) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->outgoing_previous_auth_info)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoAuthInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoAuthInfo *r) -{ - uint32_t _ptr_incoming_current_auth_info; - TALLOC_CTX *_mem_save_incoming_current_auth_info_0; - uint32_t _ptr_incoming_previous_auth_info; - TALLOC_CTX *_mem_save_incoming_previous_auth_info_0; - uint32_t _ptr_outgoing_current_auth_info; - TALLOC_CTX *_mem_save_outgoing_current_auth_info_0; - uint32_t _ptr_outgoing_previous_auth_info; - TALLOC_CTX *_mem_save_outgoing_previous_auth_info_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->incoming_count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_incoming_current_auth_info)); - if (_ptr_incoming_current_auth_info) { - NDR_PULL_ALLOC(ndr, r->incoming_current_auth_info); - } else { - r->incoming_current_auth_info = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_incoming_previous_auth_info)); - if (_ptr_incoming_previous_auth_info) { - NDR_PULL_ALLOC(ndr, r->incoming_previous_auth_info); - } else { - r->incoming_previous_auth_info = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->outgoing_count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_outgoing_current_auth_info)); - if (_ptr_outgoing_current_auth_info) { - NDR_PULL_ALLOC(ndr, r->outgoing_current_auth_info); - } else { - r->outgoing_current_auth_info = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_outgoing_previous_auth_info)); - if (_ptr_outgoing_previous_auth_info) { - NDR_PULL_ALLOC(ndr, r->outgoing_previous_auth_info); - } else { - r->outgoing_previous_auth_info = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->incoming_current_auth_info) { - _mem_save_incoming_current_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->incoming_current_auth_info, 0); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->incoming_current_auth_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_incoming_current_auth_info_0, 0); - } - if (r->incoming_previous_auth_info) { - _mem_save_incoming_previous_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->incoming_previous_auth_info, 0); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->incoming_previous_auth_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_incoming_previous_auth_info_0, 0); - } - if (r->outgoing_current_auth_info) { - _mem_save_outgoing_current_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->outgoing_current_auth_info, 0); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->outgoing_current_auth_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_outgoing_current_auth_info_0, 0); - } - if (r->outgoing_previous_auth_info) { - _mem_save_outgoing_previous_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->outgoing_previous_auth_info, 0); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBuffer(ndr, NDR_SCALARS|NDR_BUFFERS, r->outgoing_previous_auth_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_outgoing_previous_auth_info_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoAuthInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoAuthInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "incoming_count", r->incoming_count); - ndr_print_ptr(ndr, "incoming_current_auth_info", r->incoming_current_auth_info); - ndr->depth++; - if (r->incoming_current_auth_info) { - ndr_print_lsa_TrustDomainInfoBuffer(ndr, "incoming_current_auth_info", r->incoming_current_auth_info); - } - ndr->depth--; - ndr_print_ptr(ndr, "incoming_previous_auth_info", r->incoming_previous_auth_info); - ndr->depth++; - if (r->incoming_previous_auth_info) { - ndr_print_lsa_TrustDomainInfoBuffer(ndr, "incoming_previous_auth_info", r->incoming_previous_auth_info); - } - ndr->depth--; - ndr_print_uint32(ndr, "outgoing_count", r->outgoing_count); - ndr_print_ptr(ndr, "outgoing_current_auth_info", r->outgoing_current_auth_info); - ndr->depth++; - if (r->outgoing_current_auth_info) { - ndr_print_lsa_TrustDomainInfoBuffer(ndr, "outgoing_current_auth_info", r->outgoing_current_auth_info); - } - ndr->depth--; - ndr_print_ptr(ndr, "outgoing_previous_auth_info", r->outgoing_previous_auth_info); - ndr->depth++; - if (r->outgoing_previous_auth_info) { - ndr_print_lsa_TrustDomainInfoBuffer(ndr, "outgoing_previous_auth_info", r->outgoing_previous_auth_info); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoFullInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoFullInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoFullInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoFullInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoFullInfo"); - ndr->depth++; - ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex); - ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset); - ndr_print_lsa_TrustDomainInfoAuthInfo(ndr, "auth_info", &r->auth_info); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoAuthInfoInternal *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->auth_blob)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->auth_blob)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoAuthInfoInternal *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->auth_blob)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->auth_blob)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfoInternal *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoAuthInfoInternal"); - ndr->depth++; - ndr_print_lsa_DATA_BUF2(ndr, "auth_blob", &r->auth_blob); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoFullInfoInternal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoFullInfoInternal *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoFullInfoInternal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoFullInfoInternal *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfoInternal *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoFullInfoInternal"); - ndr->depth++; - ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex); - ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset); - ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info", &r->auth_info); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoInfoEx2Internal *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->forest_trust_length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest_trust_data)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); - if (r->forest_trust_data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->forest_trust_length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->forest_trust_data, r->forest_trust_length)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoInfoEx2Internal *r) -{ - uint32_t _ptr_forest_trust_data; - TALLOC_CTX *_mem_save_forest_trust_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->forest_trust_length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_data)); - if (_ptr_forest_trust_data) { - NDR_PULL_ALLOC(ndr, r->forest_trust_data); - } else { - r->forest_trust_data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); - if (r->forest_trust_data) { - _mem_save_forest_trust_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->forest_trust_data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->forest_trust_data)); - NDR_PULL_ALLOC_N(ndr, r->forest_trust_data, ndr_get_array_size(ndr, &r->forest_trust_data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->forest_trust_data, ndr_get_array_size(ndr, &r->forest_trust_data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_data_0, 0); - } - if (r->forest_trust_data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->forest_trust_data, r->forest_trust_length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx2Internal *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoInfoEx2Internal"); - ndr->depth++; - ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex); - ndr_print_uint32(ndr, "forest_trust_length", r->forest_trust_length); - ndr_print_ptr(ndr, "forest_trust_data", r->forest_trust_data); - ndr->depth++; - if (r->forest_trust_data) { - ndr_print_array_uint8(ndr, "forest_trust_data", r->forest_trust_data, r->forest_trust_length); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoFullInfo2Internal *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info)); - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoFullInfo2Internal *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info)); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo2Internal *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoFullInfo2Internal"); - ndr->depth++; - ndr_print_lsa_TrustDomainInfoInfoEx2Internal(ndr, "info", &r->info); - ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset); - ndr_print_lsa_TrustDomainInfoAuthInfo(ndr, "auth_info", &r->auth_info); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoSupportedEncTypes *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_kerb_EncTypes(ndr, NDR_SCALARS, r->enc_types)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoSupportedEncTypes *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_kerb_EncTypes(ndr, NDR_SCALARS, &r->enc_types)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoSupportedEncTypes *r) -{ - ndr_print_struct(ndr, name, "lsa_TrustDomainInfoSupportedEncTypes"); - ndr->depth++; - ndr_print_kerb_EncTypes(ndr, "enc_types", r->enc_types); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, int ndr_flags, const union lsa_TrustedDomainInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, level)); - switch (level) { - case LSA_TRUSTED_DOMAIN_INFO_NAME: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoName(ndr, NDR_SCALARS, &r->name)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoControllers(ndr, NDR_SCALARS, &r->controllers)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoPassword(ndr, NDR_SCALARS, &r->password)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_BASIC: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoBasic(ndr, NDR_SCALARS, &r->info_basic)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo(ndr, NDR_SCALARS, &r->full_info)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info_internal)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_SCALARS, &r->full_info_internal)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info_ex2_internal)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_SCALARS, &r->full_info2_internal)); - break; } - - case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoSupportedEncTypes(ndr, NDR_SCALARS, &r->enc_types)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case LSA_TRUSTED_DOMAIN_INFO_NAME: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoName(ndr, NDR_BUFFERS, &r->name)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoControllers(ndr, NDR_BUFFERS, &r->controllers)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: - break; - - case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoPassword(ndr, NDR_BUFFERS, &r->password)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_BASIC: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoBasic(ndr, NDR_BUFFERS, &r->info_basic)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo(ndr, NDR_BUFFERS, &r->full_info)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info_internal)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_BUFFERS, &r->full_info_internal)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info_ex2_internal)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: - NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_BUFFERS, &r->full_info2_internal)); - break; - - case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TrustedDomainInfo(struct ndr_pull *ndr, int ndr_flags, union lsa_TrustedDomainInfo *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case LSA_TRUSTED_DOMAIN_INFO_NAME: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoName(ndr, NDR_SCALARS, &r->name)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoControllers(ndr, NDR_SCALARS, &r->controllers)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPassword(ndr, NDR_SCALARS, &r->password)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_BASIC: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBasic(ndr, NDR_SCALARS, &r->info_basic)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo(ndr, NDR_SCALARS, &r->full_info)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info_internal)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_SCALARS, &r->full_info_internal)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info_ex2_internal)); - break; } - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_SCALARS, &r->full_info2_internal)); - break; } - - case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoSupportedEncTypes(ndr, NDR_SCALARS, &r->enc_types)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case LSA_TRUSTED_DOMAIN_INFO_NAME: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoName(ndr, NDR_BUFFERS, &r->name)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoControllers(ndr, NDR_BUFFERS, &r->controllers)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: - break; - - case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPassword(ndr, NDR_BUFFERS, &r->password)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_BASIC: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoBasic(ndr, NDR_BUFFERS, &r->info_basic)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo(ndr, NDR_BUFFERS, &r->full_info)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info_internal)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_BUFFERS, &r->full_info_internal)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info_ex2_internal)); - break; - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_BUFFERS, &r->full_info2_internal)); - break; - - case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char *name, const union lsa_TrustedDomainInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "lsa_TrustedDomainInfo"); - switch (level) { - case LSA_TRUSTED_DOMAIN_INFO_NAME: - ndr_print_lsa_TrustDomainInfoName(ndr, "name", &r->name); - break; - - case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: - ndr_print_lsa_TrustDomainInfoControllers(ndr, "controllers", &r->controllers); - break; - - case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: - ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset); - break; - - case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: - ndr_print_lsa_TrustDomainInfoPassword(ndr, "password", &r->password); - break; - - case LSA_TRUSTED_DOMAIN_INFO_BASIC: - ndr_print_lsa_TrustDomainInfoBasic(ndr, "info_basic", &r->info_basic); - break; - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: - ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex); - break; - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: - ndr_print_lsa_TrustDomainInfoAuthInfo(ndr, "auth_info", &r->auth_info); - break; - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: - ndr_print_lsa_TrustDomainInfoFullInfo(ndr, "full_info", &r->full_info); - break; - - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: - ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info_internal", &r->auth_info_internal); - break; - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: - ndr_print_lsa_TrustDomainInfoFullInfoInternal(ndr, "full_info_internal", &r->full_info_internal); - break; - - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: - ndr_print_lsa_TrustDomainInfoInfoEx2Internal(ndr, "info_ex2_internal", &r->info_ex2_internal); - break; - - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: - ndr_print_lsa_TrustDomainInfoFullInfo2Internal(ndr, "full_info2_internal", &r->full_info2_internal); - break; - - case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: - ndr_print_lsa_TrustDomainInfoSupportedEncTypes(ndr, "enc_types", &r->enc_types); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_lsa_DATA_BUF_PTR(struct ndr_push *ndr, int ndr_flags, const struct lsa_DATA_BUF_PTR *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->buf)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->buf) { - NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->buf)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DATA_BUF_PTR(struct ndr_pull *ndr, int ndr_flags, struct lsa_DATA_BUF_PTR *r) -{ - uint32_t _ptr_buf; - TALLOC_CTX *_mem_save_buf_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buf)); - if (_ptr_buf) { - NDR_PULL_ALLOC(ndr, r->buf); - } else { - r->buf = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->buf) { - _mem_save_buf_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->buf, 0); - NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->buf)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buf_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DATA_BUF_PTR(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF_PTR *r) -{ - ndr_print_struct(ndr, name, "lsa_DATA_BUF_PTR"); - ndr->depth++; - ndr_print_ptr(ndr, "buf", r->buf); - ndr->depth++; - if (r->buf) { - ndr_print_lsa_DATA_BUF(ndr, "buf", r->buf); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_RightSet(struct ndr_push *ndr, int ndr_flags, const struct lsa_RightSet *r) -{ - uint32_t cntr_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_RightSet(struct ndr_pull *ndr, int ndr_flags, struct lsa_RightSet *r) -{ - uint32_t _ptr_names; - uint32_t cntr_names_1; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 256) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); - if (_ptr_names) { - NDR_PULL_ALLOC(ndr, r->names); - } else { - r->names = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); - NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); - _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - } - if (r->names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, const struct lsa_RightSet *r) -{ - uint32_t cntr_names_1; - ndr_print_struct(ndr, name, "lsa_RightSet"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "names", r->names); - ndr->depth++; - if (r->names) { - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); - ndr->depth++; - for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { - ndr_print_lsa_StringLarge(ndr, "names", &r->names[cntr_names_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DomainListEx(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainListEx *r) -{ - uint32_t cntr_domains_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domains)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domains) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); - } - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DomainListEx(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainListEx *r) -{ - uint32_t _ptr_domains; - uint32_t cntr_domains_1; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->domains); - } else { - r->domains = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domains)); - NDR_PULL_ALLOC_N(ndr, r->domains, ndr_get_array_size(ndr, &r->domains)); - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0); - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->domains[cntr_domains_1])); - } - for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) { - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); - } - if (r->domains) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->domains, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DomainListEx(struct ndr_print *ndr, const char *name, const struct lsa_DomainListEx *r) -{ - uint32_t cntr_domains_1; - ndr_print_struct(ndr, name, "lsa_DomainListEx"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "domains", r->domains); - ndr->depth++; - if (r->domains) { - ndr->print(ndr, "%s: ARRAY(%d)", "domains", (int)r->count); - ndr->depth++; - for (cntr_domains_1=0;cntr_domains_1count;cntr_domains_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) { - ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "domains", &r->domains[cntr_domains_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DomainInfoKerberos(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainInfoKerberos *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enforce_restrictions)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->service_tkt_lifetime)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->user_tkt_lifetime)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->user_tkt_renewaltime)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->clock_skew)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown6)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DomainInfoKerberos(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInfoKerberos *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enforce_restrictions)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->service_tkt_lifetime)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->user_tkt_lifetime)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->user_tkt_renewaltime)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->clock_skew)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown6)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DomainInfoKerberos(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoKerberos *r) -{ - ndr_print_struct(ndr, name, "lsa_DomainInfoKerberos"); - ndr->depth++; - ndr_print_uint32(ndr, "enforce_restrictions", r->enforce_restrictions); - ndr_print_hyper(ndr, "service_tkt_lifetime", r->service_tkt_lifetime); - ndr_print_hyper(ndr, "user_tkt_lifetime", r->user_tkt_lifetime); - ndr_print_hyper(ndr, "user_tkt_renewaltime", r->user_tkt_renewaltime); - ndr_print_hyper(ndr, "clock_skew", r->clock_skew); - ndr_print_hyper(ndr, "unknown6", r->unknown6); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DomainInfoEfs(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainInfoEfs *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->blob_size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->efs_blob)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->efs_blob) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->blob_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->efs_blob, r->blob_size)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DomainInfoEfs(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInfoEfs *r) -{ - uint32_t _ptr_efs_blob; - TALLOC_CTX *_mem_save_efs_blob_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->blob_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_efs_blob)); - if (_ptr_efs_blob) { - NDR_PULL_ALLOC(ndr, r->efs_blob); - } else { - r->efs_blob = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->efs_blob) { - _mem_save_efs_blob_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->efs_blob, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->efs_blob)); - NDR_PULL_ALLOC_N(ndr, r->efs_blob, ndr_get_array_size(ndr, &r->efs_blob)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->efs_blob, ndr_get_array_size(ndr, &r->efs_blob))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_efs_blob_0, 0); - } - if (r->efs_blob) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->efs_blob, r->blob_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DomainInfoEfs(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoEfs *r) -{ - ndr_print_struct(ndr, name, "lsa_DomainInfoEfs"); - ndr->depth++; - ndr_print_uint32(ndr, "blob_size", r->blob_size); - ndr_print_ptr(ndr, "efs_blob", r->efs_blob); - ndr->depth++; - if (r->efs_blob) { - ndr_print_array_uint8(ndr, "efs_blob", r->efs_blob, r->blob_size); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DomainInformationPolicy(struct ndr_push *ndr, int ndr_flags, const union lsa_DomainInformationPolicy *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case LSA_DOMAIN_INFO_POLICY_EFS: { - NDR_CHECK(ndr_push_lsa_DomainInfoEfs(ndr, NDR_SCALARS, &r->efs_info)); - break; } - - case LSA_DOMAIN_INFO_POLICY_KERBEROS: { - NDR_CHECK(ndr_push_lsa_DomainInfoKerberos(ndr, NDR_SCALARS, &r->kerberos_info)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case LSA_DOMAIN_INFO_POLICY_EFS: - NDR_CHECK(ndr_push_lsa_DomainInfoEfs(ndr, NDR_BUFFERS, &r->efs_info)); - break; - - case LSA_DOMAIN_INFO_POLICY_KERBEROS: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DomainInformationPolicy(struct ndr_pull *ndr, int ndr_flags, union lsa_DomainInformationPolicy *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case LSA_DOMAIN_INFO_POLICY_EFS: { - NDR_CHECK(ndr_pull_lsa_DomainInfoEfs(ndr, NDR_SCALARS, &r->efs_info)); - break; } - - case LSA_DOMAIN_INFO_POLICY_KERBEROS: { - NDR_CHECK(ndr_pull_lsa_DomainInfoKerberos(ndr, NDR_SCALARS, &r->kerberos_info)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case LSA_DOMAIN_INFO_POLICY_EFS: - NDR_CHECK(ndr_pull_lsa_DomainInfoEfs(ndr, NDR_BUFFERS, &r->efs_info)); - break; - - case LSA_DOMAIN_INFO_POLICY_KERBEROS: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DomainInformationPolicy(struct ndr_print *ndr, const char *name, const union lsa_DomainInformationPolicy *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "lsa_DomainInformationPolicy"); - switch (level) { - case LSA_DOMAIN_INFO_POLICY_EFS: - ndr_print_lsa_DomainInfoEfs(ndr, "efs_info", &r->efs_info); - break; - - case LSA_DOMAIN_INFO_POLICY_KERBEROS: - ndr_print_lsa_DomainInfoKerberos(ndr, "kerberos_info", &r->kerberos_info); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_lsa_TranslatedName2(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedName2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TranslatedName2(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedName2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TranslatedName2(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName2 *r) -{ - ndr_print_struct(ndr, name, "lsa_TranslatedName2"); - ndr->depth++; - ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); - ndr_print_lsa_String(ndr, "name", &r->name); - ndr_print_uint32(ndr, "sid_index", r->sid_index); - ndr_print_uint32(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TransNameArray2(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransNameArray2 *r) -{ - uint32_t cntr_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->names)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_lsa_TranslatedName2(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_push_lsa_TranslatedName2(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TransNameArray2(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransNameArray2 *r) -{ - uint32_t _ptr_names; - uint32_t cntr_names_1; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); - if (_ptr_names) { - NDR_PULL_ALLOC(ndr, r->names); - } else { - r->names = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->names) { - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->names)); - NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names)); - _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_lsa_TranslatedName2(ndr, NDR_SCALARS, &r->names[cntr_names_1])); - } - for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) { - NDR_CHECK(ndr_pull_lsa_TranslatedName2(ndr, NDR_BUFFERS, &r->names[cntr_names_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - } - if (r->names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TransNameArray2(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray2 *r) -{ - uint32_t cntr_names_1; - ndr_print_struct(ndr, name, "lsa_TransNameArray2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "names", r->names); - ndr->depth++; - if (r->names) { - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count); - ndr->depth++; - for (cntr_names_1=0;cntr_names_1count;cntr_names_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { - ndr_print_lsa_TranslatedName2(ndr, "names", &r->names[cntr_names_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TranslatedSid2(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedSid2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TranslatedSid2(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedSid2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TranslatedSid2(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid2 *r) -{ - ndr_print_struct(ndr, name, "lsa_TranslatedSid2"); - ndr->depth++; - ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "sid_index", r->sid_index); - ndr_print_uint32(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TransSidArray2(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransSidArray2 *r) -{ - uint32_t cntr_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { - NDR_CHECK(ndr_push_lsa_TranslatedSid2(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TransSidArray2(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransSidArray2 *r) -{ - uint32_t _ptr_sids; - uint32_t cntr_sids_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); - if (_ptr_sids) { - NDR_PULL_ALLOC(ndr, r->sids); - } else { - r->sids = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sids) { - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); - NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); - _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { - NDR_CHECK(ndr_pull_lsa_TranslatedSid2(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); - } - if (r->sids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TransSidArray2(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray2 *r) -{ - uint32_t cntr_sids_1; - ndr_print_struct(ndr, name, "lsa_TransSidArray2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "sids", r->sids); - ndr->depth++; - if (r->sids) { - ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->count); - ndr->depth++; - for (cntr_sids_1=0;cntr_sids_1count;cntr_sids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { - ndr_print_lsa_TranslatedSid2(ndr, "sids", &r->sids[cntr_sids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TranslatedSid3(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedSid3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TranslatedSid3(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedSid3 *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TranslatedSid3(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid3 *r) -{ - ndr_print_struct(ndr, name, "lsa_TranslatedSid3"); - ndr->depth++; - ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type); - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr_print_uint32(ndr, "sid_index", r->sid_index); - ndr_print_uint32(ndr, "flags", r->flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TransSidArray3(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransSidArray3 *r) -{ - uint32_t cntr_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { - NDR_CHECK(ndr_push_lsa_TranslatedSid3(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { - NDR_CHECK(ndr_push_lsa_TranslatedSid3(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TransSidArray3(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransSidArray3 *r) -{ - uint32_t _ptr_sids; - uint32_t cntr_sids_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); - if (_ptr_sids) { - NDR_PULL_ALLOC(ndr, r->sids); - } else { - r->sids = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sids) { - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); - NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); - _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { - NDR_CHECK(ndr_pull_lsa_TranslatedSid3(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) { - NDR_CHECK(ndr_pull_lsa_TranslatedSid3(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); - } - if (r->sids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TransSidArray3(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray3 *r) -{ - uint32_t cntr_sids_1; - ndr_print_struct(ndr, name, "lsa_TransSidArray3"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "sids", r->sids); - ndr->depth++; - if (r->sids) { - ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->count); - ndr->depth++; - for (cntr_sids_1=0;cntr_sids_1count;cntr_sids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { - ndr_print_lsa_TranslatedSid3(ndr, "sids", &r->sids[cntr_sids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_ForestTrustBinaryData(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustBinaryData *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ForestTrustBinaryData(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustBinaryData *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - if (r->length < 0 || r->length > 131072) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ForestTrustBinaryData(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustBinaryData *r) -{ - ndr_print_struct(ndr, name, "lsa_ForestTrustBinaryData"); - ndr->depth++; - ndr_print_uint32(ndr, "length", r->length); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->length); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_ForestTrustDomainInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustDomainInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain_name)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_domain_name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain_sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); - } - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain_name)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_domain_name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ForestTrustDomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustDomainInfo *r) -{ - uint32_t _ptr_domain_sid; - TALLOC_CTX *_mem_save_domain_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid)); - if (_ptr_domain_sid) { - NDR_PULL_ALLOC(ndr, r->domain_sid); - } else { - r->domain_sid = NULL; - } - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain_name)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_domain_name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain_sid) { - _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0); - } - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain_name)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_domain_name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ForestTrustDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustDomainInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_ForestTrustDomainInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_sid", r->domain_sid); - ndr->depth++; - if (r->domain_sid) { - ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid); - } - ndr->depth--; - ndr_print_lsa_StringLarge(ndr, "dns_domain_name", &r->dns_domain_name); - ndr_print_lsa_StringLarge(ndr, "netbios_domain_name", &r->netbios_domain_name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_ForestTrustData(struct ndr_push *ndr, int ndr_flags, const union lsa_ForestTrustData *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case LSA_FOREST_TRUST_TOP_LEVEL_NAME: { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->top_level_name)); - break; } - - case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->top_level_name_ex)); - break; } - - case LSA_FOREST_TRUST_DOMAIN_INFO: { - NDR_CHECK(ndr_push_lsa_ForestTrustDomainInfo(ndr, NDR_SCALARS, &r->domain_info)); - break; } - - default: { - NDR_CHECK(ndr_push_lsa_ForestTrustBinaryData(ndr, NDR_SCALARS, &r->data)); - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case LSA_FOREST_TRUST_TOP_LEVEL_NAME: - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->top_level_name)); - break; - - case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->top_level_name_ex)); - break; - - case LSA_FOREST_TRUST_DOMAIN_INFO: - NDR_CHECK(ndr_push_lsa_ForestTrustDomainInfo(ndr, NDR_BUFFERS, &r->domain_info)); - break; - - default: - NDR_CHECK(ndr_push_lsa_ForestTrustBinaryData(ndr, NDR_BUFFERS, &r->data)); - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ForestTrustData(struct ndr_pull *ndr, int ndr_flags, union lsa_ForestTrustData *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case LSA_FOREST_TRUST_TOP_LEVEL_NAME: { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->top_level_name)); - break; } - - case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: { - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->top_level_name_ex)); - break; } - - case LSA_FOREST_TRUST_DOMAIN_INFO: { - NDR_CHECK(ndr_pull_lsa_ForestTrustDomainInfo(ndr, NDR_SCALARS, &r->domain_info)); - break; } - - default: { - NDR_CHECK(ndr_pull_lsa_ForestTrustBinaryData(ndr, NDR_SCALARS, &r->data)); - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case LSA_FOREST_TRUST_TOP_LEVEL_NAME: - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->top_level_name)); - break; - - case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->top_level_name_ex)); - break; - - case LSA_FOREST_TRUST_DOMAIN_INFO: - NDR_CHECK(ndr_pull_lsa_ForestTrustDomainInfo(ndr, NDR_BUFFERS, &r->domain_info)); - break; - - default: - NDR_CHECK(ndr_pull_lsa_ForestTrustBinaryData(ndr, NDR_BUFFERS, &r->data)); - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ForestTrustData(struct ndr_print *ndr, const char *name, const union lsa_ForestTrustData *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "lsa_ForestTrustData"); - switch (level) { - case LSA_FOREST_TRUST_TOP_LEVEL_NAME: - ndr_print_lsa_String(ndr, "top_level_name", &r->top_level_name); - break; - - case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: - ndr_print_lsa_StringLarge(ndr, "top_level_name_ex", &r->top_level_name_ex); - break; - - case LSA_FOREST_TRUST_DOMAIN_INFO: - ndr_print_lsa_ForestTrustDomainInfo(ndr, "domain_info", &r->domain_info); - break; - - default: - ndr_print_lsa_ForestTrustBinaryData(ndr, "data", &r->data); - break; - - } -} - -static enum ndr_err_code ndr_push_lsa_ForestTrustRecordType(struct ndr_push *ndr, int ndr_flags, enum lsa_ForestTrustRecordType r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ForestTrustRecordType(struct ndr_pull *ndr, int ndr_flags, enum lsa_ForestTrustRecordType *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ForestTrustRecordType(struct ndr_print *ndr, const char *name, enum lsa_ForestTrustRecordType r) -{ - const char *val = NULL; - - switch (r) { - case LSA_FOREST_TRUST_TOP_LEVEL_NAME: val = "LSA_FOREST_TRUST_TOP_LEVEL_NAME"; break; - case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: val = "LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX"; break; - case LSA_FOREST_TRUST_DOMAIN_INFO: val = "LSA_FOREST_TRUST_DOMAIN_INFO"; break; - case LSA_FOREST_TRUST_RECORD_TYPE_LAST: val = "LSA_FOREST_TRUST_RECORD_TYPE_LAST"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_lsa_ForestTrustRecord(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustRecord *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_lsa_ForestTrustRecordType(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->forest_trust_data, r->level)); - NDR_CHECK(ndr_push_lsa_ForestTrustData(ndr, NDR_SCALARS, &r->forest_trust_data)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_ForestTrustData(ndr, NDR_BUFFERS, &r->forest_trust_data)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ForestTrustRecord(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustRecord *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_lsa_ForestTrustRecordType(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->forest_trust_data, r->level)); - NDR_CHECK(ndr_pull_lsa_ForestTrustData(ndr, NDR_SCALARS, &r->forest_trust_data)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_ForestTrustData(ndr, NDR_BUFFERS, &r->forest_trust_data)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ForestTrustRecord(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustRecord *r) -{ - ndr_print_struct(ndr, name, "lsa_ForestTrustRecord"); - ndr->depth++; - ndr_print_uint32(ndr, "flags", r->flags); - ndr_print_lsa_ForestTrustRecordType(ndr, "level", r->level); - ndr_print_hyper(ndr, "unknown", r->unknown); - ndr_print_set_switch_value(ndr, &r->forest_trust_data, r->level); - ndr_print_lsa_ForestTrustData(ndr, "forest_trust_data", &r->forest_trust_data); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_ForestTrustInformation(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustInformation *r) -{ - uint32_t cntr_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - if (r->entries[cntr_entries_1]) { - NDR_CHECK(ndr_push_lsa_ForestTrustRecord(ndr, NDR_SCALARS|NDR_BUFFERS, r->entries[cntr_entries_1])); - } - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_ForestTrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustInformation *r) -{ - uint32_t _ptr_entries; - uint32_t cntr_entries_1; - TALLOC_CTX *_mem_save_entries_0; - TALLOC_CTX *_mem_save_entries_1; - TALLOC_CTX *_mem_save_entries_2; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 4000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); - if (_ptr_entries) { - NDR_PULL_ALLOC(ndr, r->entries); - } else { - r->entries = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); - NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); - _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); - if (_ptr_entries) { - NDR_PULL_ALLOC(ndr, r->entries[cntr_entries_1]); - } else { - r->entries[cntr_entries_1] = NULL; - } - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - if (r->entries[cntr_entries_1]) { - _mem_save_entries_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries[cntr_entries_1], 0); - NDR_CHECK(ndr_pull_lsa_ForestTrustRecord(ndr, NDR_SCALARS|NDR_BUFFERS, r->entries[cntr_entries_1])); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_2, 0); - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - } - if (r->entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ForestTrustInformation(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustInformation *r) -{ - uint32_t cntr_entries_1; - ndr_print_struct(ndr, name, "lsa_ForestTrustInformation"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "entries", r->entries); - ndr->depth++; - if (r->entries) { - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); - ndr->depth++; - for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { - ndr_print_ptr(ndr, "entries", r->entries[cntr_entries_1]); - ndr->depth++; - if (r->entries[cntr_entries_1]) { - ndr_print_lsa_ForestTrustRecord(ndr, "entries", r->entries[cntr_entries_1]); - } - ndr->depth--; - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_Close(struct ndr_pull *ndr, int flags, struct lsa_Close *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.handle); - *r->out.handle = *r->in.handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_Close(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Close *r) -{ - ndr_print_struct(ndr, name, "lsa_Close"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_Close"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_Close"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_Delete(struct ndr_pull *ndr, int flags, struct lsa_Delete *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_Delete(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Delete *r) -{ - ndr_print_struct(ndr, name, "lsa_Delete"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_Delete"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_Delete"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_EnumPrivs(struct ndr_pull *ndr, int flags, struct lsa_EnumPrivs *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_privs_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_count)); - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - *r->out.resume_handle = *r->in.resume_handle; - NDR_PULL_ALLOC(ndr, r->out.privs); - ZERO_STRUCTP(r->out.privs); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.privs); - } - _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.privs, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_PrivArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.privs)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_EnumPrivs(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivs *r) -{ - ndr_print_struct(ndr, name, "lsa_EnumPrivs"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_EnumPrivs"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - ndr->depth--; - ndr_print_uint32(ndr, "max_count", r->in.max_count); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_EnumPrivs"); - ndr->depth++; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - ndr->depth--; - ndr_print_ptr(ndr, "privs", r->out.privs); - ndr->depth++; - ndr_print_lsa_PrivArray(ndr, "privs", r->out.privs); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); - } - if (flags & NDR_OUT) { - if (r->out.sdbuf == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sdbuf)); - if (*r->out.sdbuf) { - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_QuerySecurity(struct ndr_pull *ndr, int flags, struct lsa_QuerySecurity *r) -{ - uint32_t _ptr_sdbuf; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sdbuf_0; - TALLOC_CTX *_mem_save_sdbuf_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); - NDR_PULL_ALLOC(ndr, r->out.sdbuf); - ZERO_STRUCTP(r->out.sdbuf); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sdbuf); - } - _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sdbuf, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sdbuf)); - if (_ptr_sdbuf) { - NDR_PULL_ALLOC(ndr, *r->out.sdbuf); - } else { - *r->out.sdbuf = NULL; - } - if (*r->out.sdbuf) { - _mem_save_sdbuf_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.sdbuf, 0); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecurity *r) -{ - ndr_print_struct(ndr, name, "lsa_QuerySecurity"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_QuerySecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_QuerySecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "sdbuf", r->out.sdbuf); - ndr->depth++; - ndr_print_ptr(ndr, "sdbuf", *r->out.sdbuf); - ndr->depth++; - if (*r->out.sdbuf) { - ndr_print_sec_desc_buf(ndr, "sdbuf", *r->out.sdbuf); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_SetSecObj(struct ndr_push *ndr, int flags, const struct lsa_SetSecObj *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); - if (r->in.sdbuf == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SetSecObj(struct ndr_pull *ndr, int flags, struct lsa_SetSecObj *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sdbuf_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sdbuf); - } - _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sdbuf, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetSecObj(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecObj *r) -{ - ndr_print_struct(ndr, name, "lsa_SetSecObj"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetSecObj"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); - ndr_print_ptr(ndr, "sdbuf", r->in.sdbuf); - ndr->depth++; - ndr_print_sec_desc_buf(ndr, "sdbuf", r->in.sdbuf); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetSecObj"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_ChangePassword(struct ndr_push *ndr, int flags, const struct lsa_ChangePassword *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ChangePassword(struct ndr_pull *ndr, int flags, struct lsa_ChangePassword *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ChangePassword(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ChangePassword *r) -{ - ndr_print_struct(ndr, name, "lsa_ChangePassword"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_ChangePassword"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_ChangePassword"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - 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_lsa_PolicyAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_OpenPolicy(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_attr_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.attr); - } - _mem_save_attr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.attr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_PolicyAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_OpenPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy *r) -{ - ndr_print_struct(ndr, name, "lsa_OpenPolicy"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_OpenPolicy"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "attr", r->in.attr); - ndr->depth++; - ndr_print_lsa_ObjectAttribute(ndr, "attr", r->in.attr); - ndr->depth--; - ndr_print_lsa_PolicyAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_OpenPolicy"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_QueryInfoPolicy(struct ndr_pull *ndr, int flags, struct lsa_QueryInfoPolicy *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_PolicyInfo(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_QueryInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy *r) -{ - ndr_print_struct(ndr, name, "lsa_QueryInfoPolicy"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_QueryInfoPolicy"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_lsa_PolicyInfo(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_QueryInfoPolicy"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_lsa_PolicyInformation(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_SetInfoPolicy(struct ndr_push *ndr, int flags, const struct lsa_SetInfoPolicy *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); - 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_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SetInfoPolicy(struct ndr_pull *ndr, int flags, struct lsa_SetInfoPolicy *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_PolicyInfo(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInfoPolicy *r) -{ - ndr_print_struct(ndr, name, "lsa_SetInfoPolicy"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetInfoPolicy"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_lsa_PolicyInfo(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_lsa_PolicyInformation(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetInfoPolicy"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_ClearAuditLog(struct ndr_push *ndr, int flags, const struct lsa_ClearAuditLog *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_ClearAuditLog(struct ndr_pull *ndr, int flags, struct lsa_ClearAuditLog *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_ClearAuditLog(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ClearAuditLog *r) -{ - ndr_print_struct(ndr, name, "lsa_ClearAuditLog"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_ClearAuditLog"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_ClearAuditLog"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.acct_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, int flags, struct lsa_CreateAccount *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_acct_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.acct_handle); - ZERO_STRUCTP(r->out.acct_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.acct_handle); - } - _mem_save_acct_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.acct_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.acct_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CreateAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateAccount *r) -{ - ndr_print_struct(ndr, name, "lsa_CreateAccount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CreateAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CreateAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "acct_handle", r->out.acct_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "acct_handle", r->out.acct_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_EnumAccounts(struct ndr_pull *ndr, int flags, struct lsa_EnumAccounts *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_sids_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_entries)); - if (r->in.num_entries < 0 || r->in.num_entries > 8192) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - *r->out.resume_handle = *r->in.resume_handle; - NDR_PULL_ALLOC(ndr, r->out.sids); - ZERO_STRUCTP(r->out.sids); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_EnumAccounts(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccounts *r) -{ - ndr_print_struct(ndr, name, "lsa_EnumAccounts"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_EnumAccounts"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - ndr->depth--; - ndr_print_uint32(ndr, "num_entries", r->in.num_entries); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_EnumAccounts"); - ndr->depth++; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->out.sids); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", r->out.sids); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_CreateTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomain *r) -{ - if (flags & NDR_IN) { - if (r->in.policy_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); - 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomain *r) -{ - TALLOC_CTX *_mem_save_policy_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_trustdom_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.policy_handle); - } - _mem_save_policy_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.policy_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - ZERO_STRUCTP(r->out.trustdom_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - } - _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CreateTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomain *r) -{ - ndr_print_struct(ndr, name, "lsa_CreateTrustedDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CreateTrustedDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "policy_handle", r->in.policy_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "policy_handle", r->in.policy_handle); - ndr->depth--; - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_lsa_DomainInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CreateTrustedDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_EnumTrustDom(struct ndr_pull *ndr, int flags, struct lsa_EnumTrustDom *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_domains_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - *r->out.resume_handle = *r->in.resume_handle; - NDR_PULL_ALLOC(ndr, r->out.domains); - ZERO_STRUCTP(r->out.domains); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domains); - } - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_DomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_EnumTrustDom(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumTrustDom *r) -{ - ndr_print_struct(ndr, name, "lsa_EnumTrustDom"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_EnumTrustDom"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - ndr->depth--; - ndr_print_uint32(ndr, "max_size", r->in.max_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_EnumTrustDom"); - ndr->depth++; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - ndr->depth--; - ndr_print_ptr(ndr, "domains", r->out.domains); - ndr->depth++; - ndr_print_lsa_DomainList(ndr, "domains", r->out.domains); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const struct lsa_LookupNames *r) -{ - uint32_t cntr_names_0; - if (flags & NDR_IN) { - 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, 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)); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - 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 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_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); - 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) { - if (r->out.domains == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); - if (*r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - } - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flags, struct lsa_LookupNames *r) -{ - uint32_t cntr_names_0; - uint32_t _ptr_domains; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_count_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); - if (r->in.num_names < 0 || r->in.num_names > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); - NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransSidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.domains); - ZERO_STRUCTP(r->out.domains); - NDR_PULL_ALLOC(ndr, r->out.sids); - *r->out.sids = *r->in.sids; - NDR_PULL_ALLOC(ndr, r->out.count); - *r->out.count = *r->in.count; - if (r->in.names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, r->in.num_names)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domains); - } - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, *r->out.domains); - } else { - *r->out.domains = NULL; - } - if (*r->out.domains) { - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransSidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames *r) -{ - uint32_t cntr_names_0; - ndr_print_struct(ndr, name, "lsa_LookupNames"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupNames"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "num_names", r->in.num_names); - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); - ndr->depth++; - for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { - ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_TransSidArray(ndr, "sids", r->in.sids); - ndr->depth--; - ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "count", r->in.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->in.count); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupNames"); - ndr->depth++; - ndr_print_ptr(ndr, "domains", r->out.domains); - ndr->depth++; - ndr_print_ptr(ndr, "domains", *r->out.domains); - ndr->depth++; - if (*r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->out.sids); - ndr->depth++; - ndr_print_lsa_TransSidArray(ndr, "sids", r->out.sids); - ndr->depth--; - ndr_print_ptr(ndr, "count", r->out.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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 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) { - if (r->out.domains == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); - if (*r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - } - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupSids(struct ndr_pull *ndr, int flags, struct lsa_LookupSids *r) -{ - uint32_t _ptr_domains; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_count_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.names); - } - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.names, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransNameArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.names)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.domains); - ZERO_STRUCTP(r->out.domains); - NDR_PULL_ALLOC(ndr, r->out.names); - *r->out.names = *r->in.names; - NDR_PULL_ALLOC(ndr, r->out.count); - *r->out.count = *r->in.count; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domains); - } - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, *r->out.domains); - } else { - *r->out.domains = NULL; - } - if (*r->out.domains) { - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.names); - } - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransNameArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupSids(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids *r) -{ - ndr_print_struct(ndr, name, "lsa_LookupSids"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupSids"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); - ndr->depth--; - ndr_print_ptr(ndr, "names", r->in.names); - ndr->depth++; - ndr_print_lsa_TransNameArray(ndr, "names", r->in.names); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "count", r->in.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->in.count); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupSids"); - ndr->depth++; - ndr_print_ptr(ndr, "domains", r->out.domains); - ndr->depth++; - ndr_print_ptr(ndr, "domains", *r->out.domains); - ndr->depth++; - if (*r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "names", r->out.names); - ndr->depth++; - ndr_print_lsa_TransNameArray(ndr, "names", r->out.names); - ndr->depth--; - ndr_print_ptr(ndr, "count", r->out.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.sec_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateSecret(struct ndr_pull *ndr, int flags, struct lsa_CreateSecret *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sec_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.sec_handle); - ZERO_STRUCTP(r->out.sec_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sec_handle); - } - _mem_save_sec_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sec_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.sec_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CreateSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateSecret *r) -{ - ndr_print_struct(ndr, name, "lsa_CreateSecret"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CreateSecret"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_lsa_String(ndr, "name", &r->in.name); - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CreateSecret"); - ndr->depth++; - ndr_print_ptr(ndr, "sec_handle", r->out.sec_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "sec_handle", r->out.sec_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.acct_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_OpenAccount(struct ndr_pull *ndr, int flags, struct lsa_OpenAccount *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_acct_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.acct_handle); - ZERO_STRUCTP(r->out.acct_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.acct_handle); - } - _mem_save_acct_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.acct_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.acct_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_OpenAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenAccount *r) -{ - ndr_print_struct(ndr, name, "lsa_OpenAccount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_OpenAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_OpenAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "acct_handle", r->out.acct_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "acct_handle", r->out.acct_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - if (r->out.privs == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.privs)); - if (*r->out.privs) { - NDR_CHECK(ndr_push_lsa_PrivilegeSet(ndr, NDR_SCALARS, *r->out.privs)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_EnumPrivsAccount(struct ndr_pull *ndr, int flags, struct lsa_EnumPrivsAccount *r) -{ - uint32_t _ptr_privs; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_privs_0; - TALLOC_CTX *_mem_save_privs_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.privs); - ZERO_STRUCTP(r->out.privs); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.privs); - } - _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.privs, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privs)); - if (_ptr_privs) { - NDR_PULL_ALLOC(ndr, *r->out.privs); - } else { - *r->out.privs = NULL; - } - if (*r->out.privs) { - _mem_save_privs_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.privs, 0); - NDR_CHECK(ndr_pull_lsa_PrivilegeSet(ndr, NDR_SCALARS, *r->out.privs)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_EnumPrivsAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivsAccount *r) -{ - ndr_print_struct(ndr, name, "lsa_EnumPrivsAccount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_EnumPrivsAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_EnumPrivsAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "privs", r->out.privs); - ndr->depth++; - ndr_print_ptr(ndr, "privs", *r->out.privs); - ndr->depth++; - if (*r->out.privs) { - ndr_print_lsa_PrivilegeSet(ndr, "privs", *r->out.privs); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_AddPrivilegesToAccount(struct ndr_pull *ndr, int flags, struct lsa_AddPrivilegesToAccount *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_privs_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.privs); - } - _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.privs, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_PrivilegeSet(ndr, NDR_SCALARS, r->in.privs)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_AddPrivilegesToAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_AddPrivilegesToAccount *r) -{ - ndr_print_struct(ndr, name, "lsa_AddPrivilegesToAccount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_AddPrivilegesToAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "privs", r->in.privs); - ndr->depth++; - ndr_print_lsa_PrivilegeSet(ndr, "privs", r->in.privs); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_AddPrivilegesToAccount"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - if (r->in.privs) { - NDR_CHECK(ndr_push_lsa_PrivilegeSet(ndr, NDR_SCALARS, r->in.privs)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_RemovePrivilegesFromAccount(struct ndr_pull *ndr, int flags, struct lsa_RemovePrivilegesFromAccount *r) -{ - uint32_t _ptr_privs; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_privs_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.remove_all)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privs)); - if (_ptr_privs) { - NDR_PULL_ALLOC(ndr, r->in.privs); - } else { - r->in.privs = NULL; - } - if (r->in.privs) { - _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.privs, 0); - NDR_CHECK(ndr_pull_lsa_PrivilegeSet(ndr, NDR_SCALARS, r->in.privs)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_RemovePrivilegesFromAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RemovePrivilegesFromAccount *r) -{ - ndr_print_struct(ndr, name, "lsa_RemovePrivilegesFromAccount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_RemovePrivilegesFromAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint8(ndr, "remove_all", r->in.remove_all); - ndr_print_ptr(ndr, "privs", r->in.privs); - ndr->depth++; - if (r->in.privs) { - ndr_print_lsa_PrivilegeSet(ndr, "privs", r->in.privs); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_RemovePrivilegesFromAccount"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_GetQuotasForAccount(struct ndr_push *ndr, int flags, const struct lsa_GetQuotasForAccount *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_GetQuotasForAccount(struct ndr_pull *ndr, int flags, struct lsa_GetQuotasForAccount *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_GetQuotasForAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetQuotasForAccount *r) -{ - ndr_print_struct(ndr, name, "lsa_GetQuotasForAccount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_GetQuotasForAccount"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_GetQuotasForAccount"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_SetQuotasForAccount(struct ndr_push *ndr, int flags, const struct lsa_SetQuotasForAccount *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SetQuotasForAccount(struct ndr_pull *ndr, int flags, struct lsa_SetQuotasForAccount *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetQuotasForAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetQuotasForAccount *r) -{ - ndr_print_struct(ndr, name, "lsa_SetQuotasForAccount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetQuotasForAccount"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetQuotasForAccount"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_GetSystemAccessAccount(struct ndr_push *ndr, int flags, const struct lsa_GetSystemAccessAccount *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - } - if (flags & NDR_OUT) { - if (r->out.access_mask == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.access_mask)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_GetSystemAccessAccount(struct ndr_pull *ndr, int flags, struct lsa_GetSystemAccessAccount *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_access_mask_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.access_mask); - ZERO_STRUCTP(r->out.access_mask); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.access_mask); - } - _mem_save_access_mask_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.access_mask, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.access_mask)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_access_mask_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_GetSystemAccessAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetSystemAccessAccount *r) -{ - ndr_print_struct(ndr, name, "lsa_GetSystemAccessAccount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_GetSystemAccessAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_GetSystemAccessAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "access_mask", r->out.access_mask); - ndr->depth++; - ndr_print_uint32(ndr, "access_mask", *r->out.access_mask); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_SetSystemAccessAccount(struct ndr_push *ndr, int flags, const struct lsa_SetSystemAccessAccount *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SetSystemAccessAccount(struct ndr_pull *ndr, int flags, struct lsa_SetSystemAccessAccount *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetSystemAccessAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSystemAccessAccount *r) -{ - ndr_print_struct(ndr, name, "lsa_SetSystemAccessAccount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetSystemAccessAccount"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetSystemAccessAccount"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_OpenTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_OpenTrustedDomain *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_trustdom_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - ZERO_STRUCTP(r->out.trustdom_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - } - _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_OpenTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomain *r) -{ - ndr_print_struct(ndr, name, "lsa_OpenTrustedDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_OpenTrustedDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_OpenTrustedDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.trustdom_handle)); - NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_QueryTrustedDomainInfo(struct ndr_pull *ndr, int flags, struct lsa_QueryTrustedDomainInfo *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_trustdom_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.trustdom_handle); - } - _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.trustdom_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_QueryTrustedDomainInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_QueryTrustedDomainInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "trustdom_handle", r->in.trustdom_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "trustdom_handle", r->in.trustdom_handle); - ndr->depth--; - ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_QueryTrustedDomainInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_lsa_TrustedDomainInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_SetInformationTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_SetInformationTrustedDomain *r) -{ - if (flags & NDR_IN) { - 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, r->in.trustdom_handle)); - NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); - 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_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SetInformationTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_SetInformationTrustedDomain *r) -{ - TALLOC_CTX *_mem_save_trustdom_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.trustdom_handle); - } - _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.trustdom_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetInformationTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInformationTrustedDomain *r) -{ - ndr_print_struct(ndr, name, "lsa_SetInformationTrustedDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetInformationTrustedDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "trustdom_handle", r->in.trustdom_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "trustdom_handle", r->in.trustdom_handle); - ndr->depth--; - ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetInformationTrustedDomain"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.sec_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_OpenSecret(struct ndr_pull *ndr, int flags, struct lsa_OpenSecret *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sec_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.sec_handle); - ZERO_STRUCTP(r->out.sec_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sec_handle); - } - _mem_save_sec_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sec_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.sec_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_OpenSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenSecret *r) -{ - ndr_print_struct(ndr, name, "lsa_OpenSecret"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_OpenSecret"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_lsa_String(ndr, "name", &r->in.name); - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_OpenSecret"); - ndr->depth++; - ndr_print_ptr(ndr, "sec_handle", r->out.sec_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "sec_handle", r->out.sec_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.sec_handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_val)); - if (r->in.new_val) { - NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_val)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_val)); - if (r->in.old_val) { - NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.old_val)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_SetSecret(struct ndr_pull *ndr, int flags, struct lsa_SetSecret *r) -{ - uint32_t _ptr_new_val; - uint32_t _ptr_old_val; - TALLOC_CTX *_mem_save_sec_handle_0; - TALLOC_CTX *_mem_save_new_val_0; - TALLOC_CTX *_mem_save_old_val_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sec_handle); - } - _mem_save_sec_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sec_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.sec_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_val)); - if (_ptr_new_val) { - NDR_PULL_ALLOC(ndr, r->in.new_val); - } else { - r->in.new_val = NULL; - } - if (r->in.new_val) { - _mem_save_new_val_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.new_val, 0); - NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_val)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_val_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_val)); - if (_ptr_old_val) { - NDR_PULL_ALLOC(ndr, r->in.old_val); - } else { - r->in.old_val = NULL; - } - if (r->in.old_val) { - _mem_save_old_val_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.old_val, 0); - NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.old_val)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_val_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecret *r) -{ - ndr_print_struct(ndr, name, "lsa_SetSecret"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetSecret"); - ndr->depth++; - ndr_print_ptr(ndr, "sec_handle", r->in.sec_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "sec_handle", r->in.sec_handle); - ndr->depth--; - ndr_print_ptr(ndr, "new_val", r->in.new_val); - ndr->depth++; - if (r->in.new_val) { - ndr_print_lsa_DATA_BUF(ndr, "new_val", r->in.new_val); - } - ndr->depth--; - ndr_print_ptr(ndr, "old_val", r->in.old_val); - ndr->depth++; - if (r->in.old_val) { - ndr_print_lsa_DATA_BUF(ndr, "old_val", r->in.old_val); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetSecret"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.sec_handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_val)); - if (r->in.new_val) { - NDR_CHECK(ndr_push_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_val)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_mtime)); - if (r->in.new_mtime) { - NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, *r->in.new_mtime)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_val)); - if (r->in.old_val) { - NDR_CHECK(ndr_push_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.old_val)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_mtime)); - if (r->in.old_mtime) { - NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, *r->in.old_mtime)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.new_val)); - if (r->out.new_val) { - NDR_CHECK(ndr_push_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.new_val)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.new_mtime)); - if (r->out.new_mtime) { - NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, *r->out.new_mtime)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.old_val)); - if (r->out.old_val) { - NDR_CHECK(ndr_push_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.old_val)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.old_mtime)); - if (r->out.old_mtime) { - NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, *r->out.old_mtime)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_QuerySecret(struct ndr_pull *ndr, int flags, struct lsa_QuerySecret *r) -{ - uint32_t _ptr_new_val; - uint32_t _ptr_new_mtime; - uint32_t _ptr_old_val; - uint32_t _ptr_old_mtime; - TALLOC_CTX *_mem_save_sec_handle_0; - TALLOC_CTX *_mem_save_new_val_0; - TALLOC_CTX *_mem_save_new_mtime_0; - TALLOC_CTX *_mem_save_old_val_0; - TALLOC_CTX *_mem_save_old_mtime_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sec_handle); - } - _mem_save_sec_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sec_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.sec_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_val)); - if (_ptr_new_val) { - NDR_PULL_ALLOC(ndr, r->in.new_val); - } else { - r->in.new_val = NULL; - } - if (r->in.new_val) { - _mem_save_new_val_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.new_val, 0); - NDR_CHECK(ndr_pull_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_val)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_val_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_mtime)); - if (_ptr_new_mtime) { - NDR_PULL_ALLOC(ndr, r->in.new_mtime); - } else { - r->in.new_mtime = NULL; - } - if (r->in.new_mtime) { - _mem_save_new_mtime_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.new_mtime, 0); - NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, r->in.new_mtime)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_mtime_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_val)); - if (_ptr_old_val) { - NDR_PULL_ALLOC(ndr, r->in.old_val); - } else { - r->in.old_val = NULL; - } - if (r->in.old_val) { - _mem_save_old_val_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.old_val, 0); - NDR_CHECK(ndr_pull_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.old_val)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_val_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_mtime)); - if (_ptr_old_mtime) { - NDR_PULL_ALLOC(ndr, r->in.old_mtime); - } else { - r->in.old_mtime = NULL; - } - if (r->in.old_mtime) { - _mem_save_old_mtime_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.old_mtime, 0); - NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, r->in.old_mtime)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_mtime_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_val)); - if (_ptr_new_val) { - NDR_PULL_ALLOC(ndr, r->out.new_val); - } else { - r->out.new_val = NULL; - } - if (r->out.new_val) { - _mem_save_new_val_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.new_val, 0); - NDR_CHECK(ndr_pull_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.new_val)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_val_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_mtime)); - if (_ptr_new_mtime) { - NDR_PULL_ALLOC(ndr, r->out.new_mtime); - } else { - r->out.new_mtime = NULL; - } - if (r->out.new_mtime) { - _mem_save_new_mtime_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.new_mtime, 0); - NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, r->out.new_mtime)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_mtime_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_val)); - if (_ptr_old_val) { - NDR_PULL_ALLOC(ndr, r->out.old_val); - } else { - r->out.old_val = NULL; - } - if (r->out.old_val) { - _mem_save_old_val_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.old_val, 0); - NDR_CHECK(ndr_pull_lsa_DATA_BUF_PTR(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.old_val)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_val_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_mtime)); - if (_ptr_old_mtime) { - NDR_PULL_ALLOC(ndr, r->out.old_mtime); - } else { - r->out.old_mtime = NULL; - } - if (r->out.old_mtime) { - _mem_save_old_mtime_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.old_mtime, 0); - NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, r->out.old_mtime)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_mtime_0, 0); - } - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_QuerySecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecret *r) -{ - ndr_print_struct(ndr, name, "lsa_QuerySecret"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_QuerySecret"); - ndr->depth++; - ndr_print_ptr(ndr, "sec_handle", r->in.sec_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "sec_handle", r->in.sec_handle); - ndr->depth--; - ndr_print_ptr(ndr, "new_val", r->in.new_val); - ndr->depth++; - if (r->in.new_val) { - ndr_print_lsa_DATA_BUF_PTR(ndr, "new_val", r->in.new_val); - } - ndr->depth--; - ndr_print_ptr(ndr, "new_mtime", r->in.new_mtime); - ndr->depth++; - if (r->in.new_mtime) { - ndr_print_NTTIME_hyper(ndr, "new_mtime", *r->in.new_mtime); - } - ndr->depth--; - ndr_print_ptr(ndr, "old_val", r->in.old_val); - ndr->depth++; - if (r->in.old_val) { - ndr_print_lsa_DATA_BUF_PTR(ndr, "old_val", r->in.old_val); - } - ndr->depth--; - ndr_print_ptr(ndr, "old_mtime", r->in.old_mtime); - ndr->depth++; - if (r->in.old_mtime) { - ndr_print_NTTIME_hyper(ndr, "old_mtime", *r->in.old_mtime); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_QuerySecret"); - ndr->depth++; - ndr_print_ptr(ndr, "new_val", r->out.new_val); - ndr->depth++; - if (r->out.new_val) { - ndr_print_lsa_DATA_BUF_PTR(ndr, "new_val", r->out.new_val); - } - ndr->depth--; - ndr_print_ptr(ndr, "new_mtime", r->out.new_mtime); - ndr->depth++; - if (r->out.new_mtime) { - ndr_print_NTTIME_hyper(ndr, "new_mtime", *r->out.new_mtime); - } - ndr->depth--; - ndr_print_ptr(ndr, "old_val", r->out.old_val); - ndr->depth++; - if (r->out.old_val) { - ndr_print_lsa_DATA_BUF_PTR(ndr, "old_val", r->out.old_val); - } - ndr->depth--; - ndr_print_ptr(ndr, "old_mtime", r->out.old_mtime); - ndr->depth++; - if (r->out.old_mtime) { - ndr_print_NTTIME_hyper(ndr, "old_mtime", *r->out.old_mtime); - } - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LookupPrivValue(struct ndr_pull *ndr, int flags, struct lsa_LookupPrivValue *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_luid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.luid); - ZERO_STRUCTP(r->out.luid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.luid); - } - _mem_save_luid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.luid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, r->out.luid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_luid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupPrivValue(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivValue *r) -{ - ndr_print_struct(ndr, name, "lsa_LookupPrivValue"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupPrivValue"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - ndr_print_lsa_String(ndr, "name", r->in.name); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupPrivValue"); - ndr->depth++; - ndr_print_ptr(ndr, "luid", r->out.luid); - ndr->depth++; - ndr_print_lsa_LUID(ndr, "luid", r->out.luid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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) { - if (r->out.name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name)); - if (*r->out.name) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.name)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LookupPrivName(struct ndr_pull *ndr, int flags, struct lsa_LookupPrivName *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_luid_0; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_name_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.luid); - } - _mem_save_luid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.luid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, r->in.luid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_luid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.name); - ZERO_STRUCTP(r->out.name); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, *r->out.name); - } else { - *r->out.name = NULL; - } - if (*r->out.name) { - _mem_save_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.name, 0); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupPrivName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivName *r) -{ - ndr_print_struct(ndr, name, "lsa_LookupPrivName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupPrivName"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "luid", r->in.luid); - ndr->depth++; - ndr_print_lsa_LUID(ndr, "luid", r->in.luid); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupPrivName"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->out.name); - ndr->depth++; - ndr_print_ptr(ndr, "name", *r->out.name); - ndr->depth++; - if (*r->out.name) { - ndr_print_lsa_StringLarge(ndr, "name", *r->out.name); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.language_id)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.language_id_sys)); - } - if (flags & NDR_OUT) { - if (r->out.disp_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.disp_name)); - if (*r->out.disp_name) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.disp_name)); - } - if (r->out.returned_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.returned_language_id)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LookupPrivDisplayName(struct ndr_pull *ndr, int flags, struct lsa_LookupPrivDisplayName *r) -{ - uint32_t _ptr_disp_name; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_disp_name_0; - TALLOC_CTX *_mem_save_disp_name_1; - TALLOC_CTX *_mem_save_returned_language_id_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.language_id)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.language_id_sys)); - NDR_PULL_ALLOC(ndr, r->out.disp_name); - ZERO_STRUCTP(r->out.disp_name); - NDR_PULL_ALLOC(ndr, r->out.returned_language_id); - ZERO_STRUCTP(r->out.returned_language_id); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.disp_name); - } - _mem_save_disp_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.disp_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_disp_name)); - if (_ptr_disp_name) { - NDR_PULL_ALLOC(ndr, *r->out.disp_name); - } else { - *r->out.disp_name = NULL; - } - if (*r->out.disp_name) { - _mem_save_disp_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.disp_name, 0); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.disp_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disp_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disp_name_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.returned_language_id); - } - _mem_save_returned_language_id_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_language_id, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.returned_language_id)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_language_id_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupPrivDisplayName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivDisplayName *r) -{ - ndr_print_struct(ndr, name, "lsa_LookupPrivDisplayName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupPrivDisplayName"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - ndr_print_lsa_String(ndr, "name", r->in.name); - ndr->depth--; - ndr_print_uint16(ndr, "language_id", r->in.language_id); - ndr_print_uint16(ndr, "language_id_sys", r->in.language_id_sys); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupPrivDisplayName"); - ndr->depth++; - ndr_print_ptr(ndr, "disp_name", r->out.disp_name); - ndr->depth++; - ndr_print_ptr(ndr, "disp_name", *r->out.disp_name); - ndr->depth++; - if (*r->out.disp_name) { - ndr_print_lsa_StringLarge(ndr, "disp_name", *r->out.disp_name); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "returned_language_id", r->out.returned_language_id); - ndr->depth++; - ndr_print_uint16(ndr, "returned_language_id", *r->out.returned_language_id); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_DeleteObject(struct ndr_push *ndr, int flags, const struct lsa_DeleteObject *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DeleteObject(struct ndr_pull *ndr, int flags, struct lsa_DeleteObject *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.handle); - *r->out.handle = *r->in.handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DeleteObject(struct ndr_print *ndr, const char *name, int flags, const struct lsa_DeleteObject *r) -{ - ndr_print_struct(ndr, name, "lsa_DeleteObject"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_DeleteObject"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_DeleteObject"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.name)); - if (r->in.name) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - } - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_EnumAccountsWithUserRight(struct ndr_pull *ndr, int flags, struct lsa_EnumAccountsWithUserRight *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_sids_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->in.name); - } else { - r->in.name = NULL; - } - if (r->in.name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.sids); - ZERO_STRUCTP(r->out.sids); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_EnumAccountsWithUserRight(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccountsWithUserRight *r) -{ - ndr_print_struct(ndr, name, "lsa_EnumAccountsWithUserRight"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_EnumAccountsWithUserRight"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - if (r->in.name) { - ndr_print_lsa_String(ndr, "name", r->in.name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_EnumAccountsWithUserRight"); - ndr->depth++; - ndr_print_ptr(ndr, "sids", r->out.sids); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", r->out.sids); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_EnumAccountRights(struct ndr_pull *ndr, int flags, struct lsa_EnumAccountRights *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_rights_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.rights); - ZERO_STRUCTP(r->out.rights); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rights); - } - _mem_save_rights_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rights, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rights)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rights_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_EnumAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccountRights *r) -{ - ndr_print_struct(ndr, name, "lsa_EnumAccountRights"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_EnumAccountRights"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_EnumAccountRights"); - ndr->depth++; - ndr_print_ptr(ndr, "rights", r->out.rights); - ndr->depth++; - ndr_print_lsa_RightSet(ndr, "rights", r->out.rights); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_AddAccountRights(struct ndr_pull *ndr, int flags, struct lsa_AddAccountRights *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_rights_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.rights); - } - _mem_save_rights_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.rights, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.rights)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rights_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_AddAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_AddAccountRights *r) -{ - ndr_print_struct(ndr, name, "lsa_AddAccountRights"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_AddAccountRights"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr_print_ptr(ndr, "rights", r->in.rights); - ndr->depth++; - ndr_print_lsa_RightSet(ndr, "rights", r->in.rights); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_AddAccountRights"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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_uint8(ndr, NDR_SCALARS, r->in.remove_all)); - 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) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_RemoveAccountRights(struct ndr_pull *ndr, int flags, struct lsa_RemoveAccountRights *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_rights_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.remove_all)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.rights); - } - _mem_save_rights_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.rights, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.rights)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rights_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_RemoveAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RemoveAccountRights *r) -{ - ndr_print_struct(ndr, name, "lsa_RemoveAccountRights"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_RemoveAccountRights"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr_print_uint8(ndr, "remove_all", r->in.remove_all); - ndr_print_ptr(ndr, "rights", r->in.rights); - ndr->depth++; - ndr_print_lsa_RightSet(ndr, "rights", r->in.rights); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_RemoveAccountRights"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_QueryTrustedDomainInfoBySid(struct ndr_pull *ndr, int flags, struct lsa_QueryTrustedDomainInfoBySid *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_dom_sid_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.dom_sid); - } - _mem_save_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfoBySid(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfoBySid *r) -{ - ndr_print_struct(ndr, name, "lsa_QueryTrustedDomainInfoBySid"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_QueryTrustedDomainInfoBySid"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "dom_sid", r->in.dom_sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "dom_sid", r->in.dom_sid); - ndr->depth--; - ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_QueryTrustedDomainInfoBySid"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_lsa_TrustedDomainInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_SetTrustedDomainInfo(struct ndr_push *ndr, int flags, const struct lsa_SetTrustedDomainInfo *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - 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)); - 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_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SetTrustedDomainInfo(struct ndr_pull *ndr, int flags, struct lsa_SetTrustedDomainInfo *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_dom_sid_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.dom_sid); - } - _mem_save_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetTrustedDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetTrustedDomainInfo *r) -{ - ndr_print_struct(ndr, name, "lsa_SetTrustedDomainInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetTrustedDomainInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "dom_sid", r->in.dom_sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "dom_sid", r->in.dom_sid); - ndr->depth--; - ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetTrustedDomainInfo"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_DeleteTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_DeleteTrustedDomain *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_dom_sid_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.dom_sid); - } - _mem_save_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_sid_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_DeleteTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_DeleteTrustedDomain *r) -{ - ndr_print_struct(ndr, name, "lsa_DeleteTrustedDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_DeleteTrustedDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "dom_sid", r->in.dom_sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "dom_sid", r->in.dom_sid); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_DeleteTrustedDomain"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_StorePrivateData(struct ndr_push *ndr, int flags, const struct lsa_StorePrivateData *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_StorePrivateData(struct ndr_pull *ndr, int flags, struct lsa_StorePrivateData *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_StorePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_StorePrivateData *r) -{ - ndr_print_struct(ndr, name, "lsa_StorePrivateData"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_StorePrivateData"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_StorePrivateData"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_RetrievePrivateData(struct ndr_push *ndr, int flags, const struct lsa_RetrievePrivateData *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_RetrievePrivateData(struct ndr_pull *ndr, int flags, struct lsa_RetrievePrivateData *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_RetrievePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RetrievePrivateData *r) -{ - ndr_print_struct(ndr, name, "lsa_RetrievePrivateData"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_RetrievePrivateData"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_RetrievePrivateData"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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 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_lsa_PolicyAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_OpenPolicy2(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy2 *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_attr_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); - if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.attr); - } - _mem_save_attr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.attr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_PolicyAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_OpenPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy2 *r) -{ - ndr_print_struct(ndr, name, "lsa_OpenPolicy2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_OpenPolicy2"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_string(ndr, "system_name", r->in.system_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "attr", r->in.attr); - ndr->depth++; - ndr_print_lsa_ObjectAttribute(ndr, "attr", r->in.attr); - ndr->depth--; - ndr_print_lsa_PolicyAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_OpenPolicy2"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_GetUserName(struct ndr_push *ndr, int flags, const struct lsa_GetUserName *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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.account_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.account_name)); - if (*r->in.account_name) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.account_name)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.authority_name)); - if (r->in.authority_name) { - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.authority_name)); - if (*r->in.authority_name) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.authority_name)); - } - } - } - if (flags & NDR_OUT) { - if (r->out.account_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.account_name)); - if (*r->out.account_name) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.account_name)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.authority_name)); - if (r->out.authority_name) { - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.authority_name)); - if (*r->out.authority_name) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.authority_name)); - } - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_GetUserName(struct ndr_pull *ndr, int flags, struct lsa_GetUserName *r) -{ - uint32_t _ptr_system_name; - uint32_t _ptr_account_name; - uint32_t _ptr_authority_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_account_name_0; - TALLOC_CTX *_mem_save_account_name_1; - TALLOC_CTX *_mem_save_authority_name_0; - TALLOC_CTX *_mem_save_authority_name_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); - if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.account_name); - } - _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.account_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name)); - if (_ptr_account_name) { - NDR_PULL_ALLOC(ndr, *r->in.account_name); - } else { - *r->in.account_name = NULL; - } - if (*r->in.account_name) { - _mem_save_account_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->in.account_name, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.account_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); - if (_ptr_authority_name) { - NDR_PULL_ALLOC(ndr, r->in.authority_name); - } else { - r->in.authority_name = NULL; - } - if (r->in.authority_name) { - _mem_save_authority_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.authority_name, 0); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); - if (_ptr_authority_name) { - NDR_PULL_ALLOC(ndr, *r->in.authority_name); - } else { - *r->in.authority_name = NULL; - } - if (*r->in.authority_name) { - _mem_save_authority_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->in.authority_name, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.authority_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.account_name); - *r->out.account_name = *r->in.account_name; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.account_name); - } - _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.account_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name)); - if (_ptr_account_name) { - NDR_PULL_ALLOC(ndr, *r->out.account_name); - } else { - *r->out.account_name = NULL; - } - if (*r->out.account_name) { - _mem_save_account_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.account_name, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.account_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); - if (_ptr_authority_name) { - NDR_PULL_ALLOC(ndr, r->out.authority_name); - } else { - r->out.authority_name = NULL; - } - if (r->out.authority_name) { - _mem_save_authority_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.authority_name, 0); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); - if (_ptr_authority_name) { - NDR_PULL_ALLOC(ndr, *r->out.authority_name); - } else { - *r->out.authority_name = NULL; - } - if (*r->out.authority_name) { - _mem_save_authority_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.authority_name, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.authority_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_0, 0); - } - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_GetUserName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetUserName *r) -{ - ndr_print_struct(ndr, name, "lsa_GetUserName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_GetUserName"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_string(ndr, "system_name", r->in.system_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "account_name", r->in.account_name); - ndr->depth++; - ndr_print_ptr(ndr, "account_name", *r->in.account_name); - ndr->depth++; - if (*r->in.account_name) { - ndr_print_lsa_String(ndr, "account_name", *r->in.account_name); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "authority_name", r->in.authority_name); - ndr->depth++; - if (r->in.authority_name) { - ndr_print_ptr(ndr, "authority_name", *r->in.authority_name); - ndr->depth++; - if (*r->in.authority_name) { - ndr_print_lsa_String(ndr, "authority_name", *r->in.authority_name); - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_GetUserName"); - ndr->depth++; - ndr_print_ptr(ndr, "account_name", r->out.account_name); - ndr->depth++; - ndr_print_ptr(ndr, "account_name", *r->out.account_name); - ndr->depth++; - if (*r->out.account_name) { - ndr_print_lsa_String(ndr, "account_name", *r->out.account_name); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "authority_name", r->out.authority_name); - ndr->depth++; - if (r->out.authority_name) { - ndr_print_ptr(ndr, "authority_name", *r->out.authority_name); - ndr->depth++; - if (*r->out.authority_name) { - ndr_print_lsa_String(ndr, "authority_name", *r->out.authority_name); - } - ndr->depth--; - } - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_QueryInfoPolicy2(struct ndr_pull *ndr, int flags, struct lsa_QueryInfoPolicy2 *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_PolicyInfo(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_QueryInfoPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy2 *r) -{ - ndr_print_struct(ndr, name, "lsa_QueryInfoPolicy2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_QueryInfoPolicy2"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_lsa_PolicyInfo(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_QueryInfoPolicy2"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_lsa_PolicyInformation(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_SetInfoPolicy2(struct ndr_push *ndr, int flags, const struct lsa_SetInfoPolicy2 *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); - 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_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SetInfoPolicy2(struct ndr_pull *ndr, int flags, struct lsa_SetInfoPolicy2 *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_PolicyInfo(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetInfoPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInfoPolicy2 *r) -{ - ndr_print_struct(ndr, name, "lsa_SetInfoPolicy2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetInfoPolicy2"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_lsa_PolicyInfo(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_lsa_PolicyInformation(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetInfoPolicy2"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - if (r->in.trusted_domain == 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.trusted_domain)); - NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_QueryTrustedDomainInfoByName(struct ndr_pull *ndr, int flags, struct lsa_QueryTrustedDomainInfoByName *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_trusted_domain_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.trusted_domain); - } - _mem_save_trusted_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.trusted_domain)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfoByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfoByName *r) -{ - ndr_print_struct(ndr, name, "lsa_QueryTrustedDomainInfoByName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_QueryTrustedDomainInfoByName"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "trusted_domain", r->in.trusted_domain); - ndr->depth++; - ndr_print_lsa_String(ndr, "trusted_domain", r->in.trusted_domain); - ndr->depth--; - ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_QueryTrustedDomainInfoByName"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_lsa_TrustedDomainInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); - if (r->in.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SetTrustedDomainInfoByName(struct ndr_pull *ndr, int flags, struct lsa_SetTrustedDomainInfoByName *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.trusted_domain)); - NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->in.info); - } else { - r->in.info = NULL; - } - if (r->in.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetTrustedDomainInfoByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetTrustedDomainInfoByName *r) -{ - ndr_print_struct(ndr, name, "lsa_SetTrustedDomainInfoByName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetTrustedDomainInfoByName"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_lsa_String(ndr, "trusted_domain", &r->in.trusted_domain); - ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - if (r->in.info) { - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->in.info); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetTrustedDomainInfoByName"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_EnumTrustedDomainsEx(struct ndr_pull *ndr, int flags, struct lsa_EnumTrustedDomainsEx *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_domains_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - *r->out.resume_handle = *r->in.resume_handle; - NDR_PULL_ALLOC(ndr, r->out.domains); - ZERO_STRUCTP(r->out.domains); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domains); - } - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_DomainListEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_EnumTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumTrustedDomainsEx *r) -{ - ndr_print_struct(ndr, name, "lsa_EnumTrustedDomainsEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_EnumTrustedDomainsEx"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - ndr->depth--; - ndr_print_uint32(ndr, "max_size", r->in.max_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_EnumTrustedDomainsEx"); - ndr->depth++; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - ndr->depth--; - ndr_print_ptr(ndr, "domains", r->out.domains); - ndr->depth++; - ndr_print_lsa_DomainListEx(ndr, "domains", r->out.domains); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CreateTrustedDomainEx(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomainEx *r) -{ - if (flags & NDR_IN) { - if (r->in.policy_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); - if (r->in.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - if (r->in.auth_info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.trustdom_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CreateTrustedDomainEx(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomainEx *r) -{ - TALLOC_CTX *_mem_save_policy_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_auth_info_0; - TALLOC_CTX *_mem_save_trustdom_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.policy_handle); - } - _mem_save_policy_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.policy_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.auth_info); - } - _mem_save_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.auth_info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - ZERO_STRUCTP(r->out.trustdom_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - } - _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CreateTrustedDomainEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomainEx *r) -{ - ndr_print_struct(ndr, name, "lsa_CreateTrustedDomainEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CreateTrustedDomainEx"); - ndr->depth++; - ndr_print_ptr(ndr, "policy_handle", r->in.policy_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "policy_handle", r->in.policy_handle); - ndr->depth--; - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_ptr(ndr, "auth_info", r->in.auth_info); - ndr->depth++; - ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info", r->in.auth_info); - ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CreateTrustedDomainEx"); - ndr->depth++; - ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CloseTrustedDomainEx(struct ndr_pull *ndr, int flags, struct lsa_CloseTrustedDomainEx *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.handle); - *r->out.handle = *r->in.handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CloseTrustedDomainEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CloseTrustedDomainEx *r) -{ - ndr_print_struct(ndr, name, "lsa_CloseTrustedDomainEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CloseTrustedDomainEx"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CloseTrustedDomainEx"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_DomainInformationPolicy(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_QueryDomainInformationPolicy(struct ndr_pull *ndr, int flags, struct lsa_QueryDomainInformationPolicy *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_DomainInformationPolicy(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_QueryDomainInformationPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryDomainInformationPolicy *r) -{ - ndr_print_struct(ndr, name, "lsa_QueryDomainInformationPolicy"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_QueryDomainInformationPolicy"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_QueryDomainInformationPolicy"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_lsa_DomainInformationPolicy(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info)); - if (r->in.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_DomainInformationPolicy(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_SetDomainInformationPolicy(struct ndr_pull *ndr, int flags, struct lsa_SetDomainInformationPolicy *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->in.info); - } else { - r->in.info = NULL; - } - if (r->in.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_DomainInformationPolicy(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_SetDomainInformationPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetDomainInformationPolicy *r) -{ - ndr_print_struct(ndr, name, "lsa_SetDomainInformationPolicy"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_SetDomainInformationPolicy"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - if (r->in.info) { - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_lsa_DomainInformationPolicy(ndr, "info", r->in.info); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_SetDomainInformationPolicy"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_OpenTrustedDomainByName(struct ndr_pull *ndr, int flags, struct lsa_OpenTrustedDomainByName *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_trustdom_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - ZERO_STRUCTP(r->out.trustdom_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - } - _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_OpenTrustedDomainByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomainByName *r) -{ - ndr_print_struct(ndr, name, "lsa_OpenTrustedDomainByName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_OpenTrustedDomainByName"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_lsa_String(ndr, "name", &r->in.name); - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_OpenTrustedDomainByName"); - ndr->depth++; - ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_TestCall(struct ndr_push *ndr, int flags, const struct lsa_TestCall *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_TestCall(struct ndr_pull *ndr, int flags, struct lsa_TestCall *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct lsa_TestCall *r) -{ - ndr_print_struct(ndr, name, "lsa_TestCall"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_TestCall"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_TestCall"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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 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)); - } - if (flags & NDR_OUT) { - if (r->out.domains == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); - if (*r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - } - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupSids2(struct ndr_pull *ndr, int flags, struct lsa_LookupSids2 *r) -{ - uint32_t _ptr_domains; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_count_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.names); - } - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.names, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.names)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); - NDR_PULL_ALLOC(ndr, r->out.domains); - ZERO_STRUCTP(r->out.domains); - NDR_PULL_ALLOC(ndr, r->out.names); - *r->out.names = *r->in.names; - NDR_PULL_ALLOC(ndr, r->out.count); - *r->out.count = *r->in.count; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domains); - } - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, *r->out.domains); - } else { - *r->out.domains = NULL; - } - if (*r->out.domains) { - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.names); - } - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupSids2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids2 *r) -{ - ndr_print_struct(ndr, name, "lsa_LookupSids2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupSids2"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); - ndr->depth--; - ndr_print_ptr(ndr, "names", r->in.names); - ndr->depth++; - ndr_print_lsa_TransNameArray2(ndr, "names", r->in.names); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "count", r->in.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->in.count); - ndr->depth--; - ndr_print_uint32(ndr, "unknown1", r->in.unknown1); - ndr_print_uint32(ndr, "unknown2", r->in.unknown2); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupSids2"); - ndr->depth++; - ndr_print_ptr(ndr, "domains", r->out.domains); - ndr->depth++; - ndr_print_ptr(ndr, "domains", *r->out.domains); - ndr->depth++; - if (*r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "names", r->out.names); - ndr->depth++; - ndr_print_lsa_TransNameArray2(ndr, "names", r->out.names); - ndr->depth--; - ndr_print_ptr(ndr, "count", r->out.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const struct lsa_LookupNames2 *r) -{ - uint32_t cntr_names_0; - if (flags & NDR_IN) { - 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, 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)); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - 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 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_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); - 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.lookup_options)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.client_revision)); - } - if (flags & NDR_OUT) { - if (r->out.domains == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); - if (*r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - } - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int flags, struct lsa_LookupNames2 *r) -{ - uint32_t cntr_names_0; - uint32_t _ptr_domains; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_count_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); - if (r->in.num_names < 0 || r->in.num_names > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); - NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransSidArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.lookup_options)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_revision)); - NDR_PULL_ALLOC(ndr, r->out.domains); - ZERO_STRUCTP(r->out.domains); - NDR_PULL_ALLOC(ndr, r->out.sids); - *r->out.sids = *r->in.sids; - NDR_PULL_ALLOC(ndr, r->out.count); - *r->out.count = *r->in.count; - if (r->in.names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, r->in.num_names)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domains); - } - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, *r->out.domains); - } else { - *r->out.domains = NULL; - } - if (*r->out.domains) { - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransSidArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames2 *r) -{ - uint32_t cntr_names_0; - ndr_print_struct(ndr, name, "lsa_LookupNames2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupNames2"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "num_names", r->in.num_names); - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); - ndr->depth++; - for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { - ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_TransSidArray2(ndr, "sids", r->in.sids); - ndr->depth--; - ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "count", r->in.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->in.count); - ndr->depth--; - ndr_print_uint32(ndr, "lookup_options", r->in.lookup_options); - ndr_print_uint32(ndr, "client_revision", r->in.client_revision); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupNames2"); - ndr->depth++; - ndr_print_ptr(ndr, "domains", r->out.domains); - ndr->depth++; - ndr_print_ptr(ndr, "domains", *r->out.domains); - ndr->depth++; - if (*r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->out.sids); - ndr->depth++; - ndr_print_lsa_TransSidArray2(ndr, "sids", r->out.sids); - ndr->depth--; - ndr_print_ptr(ndr, "count", r->out.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CreateTrustedDomainEx2(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomainEx2 *r) -{ - if (flags & NDR_IN) { - if (r->in.policy_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); - if (r->in.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - if (r->in.auth_info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.trustdom_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CreateTrustedDomainEx2(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomainEx2 *r) -{ - TALLOC_CTX *_mem_save_policy_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_auth_info_0; - TALLOC_CTX *_mem_save_trustdom_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.policy_handle); - } - _mem_save_policy_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.policy_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.auth_info); - } - _mem_save_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.auth_info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - ZERO_STRUCTP(r->out.trustdom_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.trustdom_handle); - } - _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CreateTrustedDomainEx2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomainEx2 *r) -{ - ndr_print_struct(ndr, name, "lsa_CreateTrustedDomainEx2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CreateTrustedDomainEx2"); - ndr->depth++; - ndr_print_ptr(ndr, "policy_handle", r->in.policy_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "policy_handle", r->in.policy_handle); - ndr->depth--; - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_ptr(ndr, "auth_info", r->in.auth_info); - ndr->depth++; - ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info", r->in.auth_info); - ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CreateTrustedDomainEx2"); - ndr->depth++; - ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRWRITE(struct ndr_push *ndr, int flags, const struct lsa_CREDRWRITE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRWRITE(struct ndr_pull *ndr, int flags, struct lsa_CREDRWRITE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRWRITE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRWRITE *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRWRITE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRWRITE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRWRITE"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRREAD(struct ndr_push *ndr, int flags, const struct lsa_CREDRREAD *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRREAD(struct ndr_pull *ndr, int flags, struct lsa_CREDRREAD *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRREAD(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRREAD *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRREAD"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRREAD"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRREAD"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRENUMERATE(struct ndr_push *ndr, int flags, const struct lsa_CREDRENUMERATE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRENUMERATE(struct ndr_pull *ndr, int flags, struct lsa_CREDRENUMERATE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRENUMERATE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRENUMERATE *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRENUMERATE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRENUMERATE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRENUMERATE"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRWRITEDOMAINCREDENTIALS(struct ndr_push *ndr, int flags, const struct lsa_CREDRWRITEDOMAINCREDENTIALS *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRWRITEDOMAINCREDENTIALS(struct ndr_pull *ndr, int flags, struct lsa_CREDRWRITEDOMAINCREDENTIALS *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRWRITEDOMAINCREDENTIALS(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRWRITEDOMAINCREDENTIALS *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRWRITEDOMAINCREDENTIALS"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRWRITEDOMAINCREDENTIALS"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRWRITEDOMAINCREDENTIALS"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRREADDOMAINCREDENTIALS(struct ndr_push *ndr, int flags, const struct lsa_CREDRREADDOMAINCREDENTIALS *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRREADDOMAINCREDENTIALS(struct ndr_pull *ndr, int flags, struct lsa_CREDRREADDOMAINCREDENTIALS *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRREADDOMAINCREDENTIALS(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRREADDOMAINCREDENTIALS *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRREADDOMAINCREDENTIALS"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRREADDOMAINCREDENTIALS"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRREADDOMAINCREDENTIALS"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRDELETE(struct ndr_push *ndr, int flags, const struct lsa_CREDRDELETE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRDELETE(struct ndr_pull *ndr, int flags, struct lsa_CREDRDELETE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRDELETE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRDELETE *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRDELETE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRDELETE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRDELETE"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRGETTARGETINFO(struct ndr_push *ndr, int flags, const struct lsa_CREDRGETTARGETINFO *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRGETTARGETINFO(struct ndr_pull *ndr, int flags, struct lsa_CREDRGETTARGETINFO *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRGETTARGETINFO(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETTARGETINFO *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRGETTARGETINFO"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRGETTARGETINFO"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRGETTARGETINFO"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRPROFILELOADED(struct ndr_push *ndr, int flags, const struct lsa_CREDRPROFILELOADED *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRPROFILELOADED(struct ndr_pull *ndr, int flags, struct lsa_CREDRPROFILELOADED *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRPROFILELOADED(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRPROFILELOADED *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRPROFILELOADED"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRPROFILELOADED"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRPROFILELOADED"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const struct lsa_LookupNames3 *r) -{ - uint32_t cntr_names_0; - if (flags & NDR_IN) { - 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, 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)); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - 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 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_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); - 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.lookup_options)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.client_revision)); - } - if (flags & NDR_OUT) { - if (r->out.domains == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); - if (*r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - } - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int flags, struct lsa_LookupNames3 *r) -{ - uint32_t cntr_names_0; - uint32_t _ptr_domains; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_count_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); - if (r->in.num_names < 0 || r->in.num_names > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); - NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.lookup_options)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_revision)); - NDR_PULL_ALLOC(ndr, r->out.domains); - ZERO_STRUCTP(r->out.domains); - NDR_PULL_ALLOC(ndr, r->out.sids); - *r->out.sids = *r->in.sids; - NDR_PULL_ALLOC(ndr, r->out.count); - *r->out.count = *r->in.count; - if (r->in.names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, r->in.num_names)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domains); - } - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, *r->out.domains); - } else { - *r->out.domains = NULL; - } - if (*r->out.domains) { - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupNames3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames3 *r) -{ - uint32_t cntr_names_0; - ndr_print_struct(ndr, name, "lsa_LookupNames3"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupNames3"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "num_names", r->in.num_names); - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); - ndr->depth++; - for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { - ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_TransSidArray3(ndr, "sids", r->in.sids); - ndr->depth--; - ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "count", r->in.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->in.count); - ndr->depth--; - ndr_print_uint32(ndr, "lookup_options", r->in.lookup_options); - ndr_print_uint32(ndr, "client_revision", r->in.client_revision); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupNames3"); - ndr->depth++; - ndr_print_ptr(ndr, "domains", r->out.domains); - ndr->depth++; - ndr_print_ptr(ndr, "domains", *r->out.domains); - ndr->depth++; - if (*r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->out.sids); - ndr->depth++; - ndr_print_lsa_TransSidArray3(ndr, "sids", r->out.sids); - ndr->depth--; - ndr_print_ptr(ndr, "count", r->out.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRGETSESSIONTYPES(struct ndr_push *ndr, int flags, const struct lsa_CREDRGETSESSIONTYPES *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRGETSESSIONTYPES(struct ndr_pull *ndr, int flags, struct lsa_CREDRGETSESSIONTYPES *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRGETSESSIONTYPES(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETSESSIONTYPES *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRGETSESSIONTYPES"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRGETSESSIONTYPES"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRGETSESSIONTYPES"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LSARREGISTERAUDITEVENT(struct ndr_push *ndr, int flags, const struct lsa_LSARREGISTERAUDITEVENT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LSARREGISTERAUDITEVENT(struct ndr_pull *ndr, int flags, struct lsa_LSARREGISTERAUDITEVENT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LSARREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARREGISTERAUDITEVENT *r) -{ - ndr_print_struct(ndr, name, "lsa_LSARREGISTERAUDITEVENT"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LSARREGISTERAUDITEVENT"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LSARREGISTERAUDITEVENT"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LSARGENAUDITEVENT(struct ndr_push *ndr, int flags, const struct lsa_LSARGENAUDITEVENT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LSARGENAUDITEVENT(struct ndr_pull *ndr, int flags, struct lsa_LSARGENAUDITEVENT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LSARGENAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARGENAUDITEVENT *r) -{ - ndr_print_struct(ndr, name, "lsa_LSARGENAUDITEVENT"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LSARGENAUDITEVENT"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LSARGENAUDITEVENT"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_push *ndr, int flags, const struct lsa_LSARUNREGISTERAUDITEVENT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_pull *ndr, int flags, struct lsa_LSARUNREGISTERAUDITEVENT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARUNREGISTERAUDITEVENT *r) -{ - ndr_print_struct(ndr, name, "lsa_LSARUNREGISTERAUDITEVENT"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LSARUNREGISTERAUDITEVENT"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LSARUNREGISTERAUDITEVENT"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_lsaRQueryForestTrustInformation(struct ndr_push *ndr, int flags, const struct lsa_lsaRQueryForestTrustInformation *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - if (r->in.trusted_domain_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.trusted_domain_name)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.unknown)); - } - if (flags & NDR_OUT) { - if (r->out.forest_trust_info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info)); - if (*r->out.forest_trust_info) { - NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_lsaRQueryForestTrustInformation(struct ndr_pull *ndr, int flags, struct lsa_lsaRQueryForestTrustInformation *r) -{ - uint32_t _ptr_forest_trust_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_trusted_domain_name_0; - TALLOC_CTX *_mem_save_forest_trust_info_0; - TALLOC_CTX *_mem_save_forest_trust_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.trusted_domain_name); - } - _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.trusted_domain_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.unknown)); - NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); - ZERO_STRUCTP(r->out.forest_trust_info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); - } - _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info)); - if (_ptr_forest_trust_info) { - NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info); - } else { - *r->out.forest_trust_info = NULL; - } - if (*r->out.forest_trust_info) { - _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0); - NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_lsaRQueryForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct lsa_lsaRQueryForestTrustInformation *r) -{ - ndr_print_struct(ndr, name, "lsa_lsaRQueryForestTrustInformation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_lsaRQueryForestTrustInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name); - ndr->depth++; - ndr_print_lsa_String(ndr, "trusted_domain_name", r->in.trusted_domain_name); - ndr->depth--; - ndr_print_uint16(ndr, "unknown", r->in.unknown); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_lsaRQueryForestTrustInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info); - ndr->depth++; - ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info); - ndr->depth++; - if (*r->out.forest_trust_info) { - ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LSARSETFORESTTRUSTINFORMATION(struct ndr_push *ndr, int flags, const struct lsa_LSARSETFORESTTRUSTINFORMATION *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LSARSETFORESTTRUSTINFORMATION(struct ndr_pull *ndr, int flags, struct lsa_LSARSETFORESTTRUSTINFORMATION *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LSARSETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARSETFORESTTRUSTINFORMATION *r) -{ - ndr_print_struct(ndr, name, "lsa_LSARSETFORESTTRUSTINFORMATION"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LSARSETFORESTTRUSTINFORMATION"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LSARSETFORESTTRUSTINFORMATION"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_CREDRRENAME(struct ndr_push *ndr, int flags, const struct lsa_CREDRRENAME *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_CREDRRENAME(struct ndr_pull *ndr, int flags, struct lsa_CREDRRENAME *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_CREDRRENAME(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRRENAME *r) -{ - ndr_print_struct(ndr, name, "lsa_CREDRRENAME"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_CREDRRENAME"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_CREDRRENAME"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 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 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 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)); - } - if (flags & NDR_OUT) { - if (r->out.domains == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); - if (*r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - } - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupSids3(struct ndr_pull *ndr, int flags, struct lsa_LookupSids3 *r) -{ - uint32_t _ptr_domains; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_count_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.names); - } - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.names, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.names)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); - NDR_PULL_ALLOC(ndr, r->out.domains); - ZERO_STRUCTP(r->out.domains); - NDR_PULL_ALLOC(ndr, r->out.names); - *r->out.names = *r->in.names; - NDR_PULL_ALLOC(ndr, r->out.count); - *r->out.count = *r->in.count; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domains); - } - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, *r->out.domains); - } else { - *r->out.domains = NULL; - } - if (*r->out.domains) { - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.names); - } - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransNameArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupSids3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids3 *r) -{ - ndr_print_struct(ndr, name, "lsa_LookupSids3"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupSids3"); - ndr->depth++; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); - ndr->depth--; - ndr_print_ptr(ndr, "names", r->in.names); - ndr->depth++; - ndr_print_lsa_TransNameArray2(ndr, "names", r->in.names); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "count", r->in.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->in.count); - ndr->depth--; - ndr_print_uint32(ndr, "unknown1", r->in.unknown1); - ndr_print_uint32(ndr, "unknown2", r->in.unknown2); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupSids3"); - ndr->depth++; - ndr_print_ptr(ndr, "domains", r->out.domains); - ndr->depth++; - ndr_print_ptr(ndr, "domains", *r->out.domains); - ndr->depth++; - if (*r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "names", r->out.names); - ndr->depth++; - ndr_print_lsa_TransNameArray2(ndr, "names", r->out.names); - ndr->depth--; - ndr_print_ptr(ndr, "count", r->out.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LookupNames4(struct ndr_push *ndr, int flags, const struct lsa_LookupNames4 *r) -{ - uint32_t cntr_names_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - 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 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_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); - 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.lookup_options)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.client_revision)); - } - if (flags & NDR_OUT) { - if (r->out.domains == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); - if (*r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - } - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LookupNames4(struct ndr_pull *ndr, int flags, struct lsa_LookupNames4 *r) -{ - uint32_t cntr_names_0; - uint32_t _ptr_domains; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_domains_0; - TALLOC_CTX *_mem_save_domains_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_count_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); - if (r->in.num_names < 0 || r->in.num_names > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); - NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.lookup_options)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_revision)); - NDR_PULL_ALLOC(ndr, r->out.domains); - ZERO_STRUCTP(r->out.domains); - NDR_PULL_ALLOC(ndr, r->out.sids); - *r->out.sids = *r->in.sids; - NDR_PULL_ALLOC(ndr, r->out.count); - *r->out.count = *r->in.count; - if (r->in.names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, r->in.num_names)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domains); - } - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); - if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, *r->out.domains); - } else { - *r->out.domains = NULL; - } - if (*r->out.domains) { - _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LookupNames4(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames4 *r) -{ - uint32_t cntr_names_0; - ndr_print_struct(ndr, name, "lsa_LookupNames4"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LookupNames4"); - ndr->depth++; - ndr_print_uint32(ndr, "num_names", r->in.num_names); - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); - ndr->depth++; - for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { - ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_TransSidArray3(ndr, "sids", r->in.sids); - ndr->depth--; - ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "count", r->in.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->in.count); - ndr->depth--; - ndr_print_uint32(ndr, "lookup_options", r->in.lookup_options); - ndr_print_uint32(ndr, "client_revision", r->in.client_revision); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LookupNames4"); - ndr->depth++; - ndr_print_ptr(ndr, "domains", r->out.domains); - ndr->depth++; - ndr_print_ptr(ndr, "domains", *r->out.domains); - ndr->depth++; - if (*r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->out.sids); - ndr->depth++; - ndr_print_lsa_TransSidArray3(ndr, "sids", r->out.sids); - ndr->depth--; - ndr_print_ptr(ndr, "count", r->out.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LSAROPENPOLICYSCE(struct ndr_push *ndr, int flags, const struct lsa_LSAROPENPOLICYSCE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LSAROPENPOLICYSCE(struct ndr_pull *ndr, int flags, struct lsa_LSAROPENPOLICYSCE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LSAROPENPOLICYSCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSAROPENPOLICYSCE *r) -{ - ndr_print_struct(ndr, name, "lsa_LSAROPENPOLICYSCE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LSAROPENPOLICYSCE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LSAROPENPOLICYSCE"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct ndr_push *ndr, int flags, const struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct ndr_pull *ndr, int flags, struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r) -{ - ndr_print_struct(ndr, name, "lsa_LSARADTREGISTERSECURITYEVENTSOURCE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LSARADTREGISTERSECURITYEVENTSOURCE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LSARADTREGISTERSECURITYEVENTSOURCE"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct ndr_push *ndr, int flags, const struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct ndr_pull *ndr, int flags, struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r) -{ - ndr_print_struct(ndr, name, "lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_lsa_LSARADTREPORTSECURITYEVENT(struct ndr_push *ndr, int flags, const struct lsa_LSARADTREPORTSECURITYEVENT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_LSARADTREPORTSECURITYEVENT(struct ndr_pull *ndr, int flags, struct lsa_LSARADTREPORTSECURITYEVENT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_LSARADTREPORTSECURITYEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTREPORTSECURITYEVENT *r) -{ - ndr_print_struct(ndr, name, "lsa_LSARADTREPORTSECURITYEVENT"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LSARADTREPORTSECURITYEVENT"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LSARADTREPORTSECURITYEVENT"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call lsarpc_calls[] = { - { - "lsa_Close", - sizeof(struct lsa_Close), - (ndr_push_flags_fn_t) ndr_push_lsa_Close, - (ndr_pull_flags_fn_t) ndr_pull_lsa_Close, - (ndr_print_function_t) ndr_print_lsa_Close, - false, - }, - { - "lsa_Delete", - sizeof(struct lsa_Delete), - (ndr_push_flags_fn_t) ndr_push_lsa_Delete, - (ndr_pull_flags_fn_t) ndr_pull_lsa_Delete, - (ndr_print_function_t) ndr_print_lsa_Delete, - false, - }, - { - "lsa_EnumPrivs", - sizeof(struct lsa_EnumPrivs), - (ndr_push_flags_fn_t) ndr_push_lsa_EnumPrivs, - (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumPrivs, - (ndr_print_function_t) ndr_print_lsa_EnumPrivs, - false, - }, - { - "lsa_QuerySecurity", - sizeof(struct lsa_QuerySecurity), - (ndr_push_flags_fn_t) ndr_push_lsa_QuerySecurity, - (ndr_pull_flags_fn_t) ndr_pull_lsa_QuerySecurity, - (ndr_print_function_t) ndr_print_lsa_QuerySecurity, - false, - }, - { - "lsa_SetSecObj", - sizeof(struct lsa_SetSecObj), - (ndr_push_flags_fn_t) ndr_push_lsa_SetSecObj, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetSecObj, - (ndr_print_function_t) ndr_print_lsa_SetSecObj, - false, - }, - { - "lsa_ChangePassword", - sizeof(struct lsa_ChangePassword), - (ndr_push_flags_fn_t) ndr_push_lsa_ChangePassword, - (ndr_pull_flags_fn_t) ndr_pull_lsa_ChangePassword, - (ndr_print_function_t) ndr_print_lsa_ChangePassword, - false, - }, - { - "lsa_OpenPolicy", - sizeof(struct lsa_OpenPolicy), - (ndr_push_flags_fn_t) ndr_push_lsa_OpenPolicy, - (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenPolicy, - (ndr_print_function_t) ndr_print_lsa_OpenPolicy, - false, - }, - { - "lsa_QueryInfoPolicy", - sizeof(struct lsa_QueryInfoPolicy), - (ndr_push_flags_fn_t) ndr_push_lsa_QueryInfoPolicy, - (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryInfoPolicy, - (ndr_print_function_t) ndr_print_lsa_QueryInfoPolicy, - false, - }, - { - "lsa_SetInfoPolicy", - sizeof(struct lsa_SetInfoPolicy), - (ndr_push_flags_fn_t) ndr_push_lsa_SetInfoPolicy, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetInfoPolicy, - (ndr_print_function_t) ndr_print_lsa_SetInfoPolicy, - false, - }, - { - "lsa_ClearAuditLog", - sizeof(struct lsa_ClearAuditLog), - (ndr_push_flags_fn_t) ndr_push_lsa_ClearAuditLog, - (ndr_pull_flags_fn_t) ndr_pull_lsa_ClearAuditLog, - (ndr_print_function_t) ndr_print_lsa_ClearAuditLog, - false, - }, - { - "lsa_CreateAccount", - sizeof(struct lsa_CreateAccount), - (ndr_push_flags_fn_t) ndr_push_lsa_CreateAccount, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateAccount, - (ndr_print_function_t) ndr_print_lsa_CreateAccount, - false, - }, - { - "lsa_EnumAccounts", - sizeof(struct lsa_EnumAccounts), - (ndr_push_flags_fn_t) ndr_push_lsa_EnumAccounts, - (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumAccounts, - (ndr_print_function_t) ndr_print_lsa_EnumAccounts, - false, - }, - { - "lsa_CreateTrustedDomain", - sizeof(struct lsa_CreateTrustedDomain), - (ndr_push_flags_fn_t) ndr_push_lsa_CreateTrustedDomain, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateTrustedDomain, - (ndr_print_function_t) ndr_print_lsa_CreateTrustedDomain, - false, - }, - { - "lsa_EnumTrustDom", - sizeof(struct lsa_EnumTrustDom), - (ndr_push_flags_fn_t) ndr_push_lsa_EnumTrustDom, - (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumTrustDom, - (ndr_print_function_t) ndr_print_lsa_EnumTrustDom, - false, - }, - { - "lsa_LookupNames", - sizeof(struct lsa_LookupNames), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames, - (ndr_print_function_t) ndr_print_lsa_LookupNames, - false, - }, - { - "lsa_LookupSids", - sizeof(struct lsa_LookupSids), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupSids, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupSids, - (ndr_print_function_t) ndr_print_lsa_LookupSids, - false, - }, - { - "lsa_CreateSecret", - sizeof(struct lsa_CreateSecret), - (ndr_push_flags_fn_t) ndr_push_lsa_CreateSecret, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateSecret, - (ndr_print_function_t) ndr_print_lsa_CreateSecret, - false, - }, - { - "lsa_OpenAccount", - sizeof(struct lsa_OpenAccount), - (ndr_push_flags_fn_t) ndr_push_lsa_OpenAccount, - (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenAccount, - (ndr_print_function_t) ndr_print_lsa_OpenAccount, - false, - }, - { - "lsa_EnumPrivsAccount", - sizeof(struct lsa_EnumPrivsAccount), - (ndr_push_flags_fn_t) ndr_push_lsa_EnumPrivsAccount, - (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumPrivsAccount, - (ndr_print_function_t) ndr_print_lsa_EnumPrivsAccount, - false, - }, - { - "lsa_AddPrivilegesToAccount", - sizeof(struct lsa_AddPrivilegesToAccount), - (ndr_push_flags_fn_t) ndr_push_lsa_AddPrivilegesToAccount, - (ndr_pull_flags_fn_t) ndr_pull_lsa_AddPrivilegesToAccount, - (ndr_print_function_t) ndr_print_lsa_AddPrivilegesToAccount, - false, - }, - { - "lsa_RemovePrivilegesFromAccount", - sizeof(struct lsa_RemovePrivilegesFromAccount), - (ndr_push_flags_fn_t) ndr_push_lsa_RemovePrivilegesFromAccount, - (ndr_pull_flags_fn_t) ndr_pull_lsa_RemovePrivilegesFromAccount, - (ndr_print_function_t) ndr_print_lsa_RemovePrivilegesFromAccount, - false, - }, - { - "lsa_GetQuotasForAccount", - sizeof(struct lsa_GetQuotasForAccount), - (ndr_push_flags_fn_t) ndr_push_lsa_GetQuotasForAccount, - (ndr_pull_flags_fn_t) ndr_pull_lsa_GetQuotasForAccount, - (ndr_print_function_t) ndr_print_lsa_GetQuotasForAccount, - false, - }, - { - "lsa_SetQuotasForAccount", - sizeof(struct lsa_SetQuotasForAccount), - (ndr_push_flags_fn_t) ndr_push_lsa_SetQuotasForAccount, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetQuotasForAccount, - (ndr_print_function_t) ndr_print_lsa_SetQuotasForAccount, - false, - }, - { - "lsa_GetSystemAccessAccount", - sizeof(struct lsa_GetSystemAccessAccount), - (ndr_push_flags_fn_t) ndr_push_lsa_GetSystemAccessAccount, - (ndr_pull_flags_fn_t) ndr_pull_lsa_GetSystemAccessAccount, - (ndr_print_function_t) ndr_print_lsa_GetSystemAccessAccount, - false, - }, - { - "lsa_SetSystemAccessAccount", - sizeof(struct lsa_SetSystemAccessAccount), - (ndr_push_flags_fn_t) ndr_push_lsa_SetSystemAccessAccount, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetSystemAccessAccount, - (ndr_print_function_t) ndr_print_lsa_SetSystemAccessAccount, - false, - }, - { - "lsa_OpenTrustedDomain", - sizeof(struct lsa_OpenTrustedDomain), - (ndr_push_flags_fn_t) ndr_push_lsa_OpenTrustedDomain, - (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenTrustedDomain, - (ndr_print_function_t) ndr_print_lsa_OpenTrustedDomain, - false, - }, - { - "lsa_QueryTrustedDomainInfo", - sizeof(struct lsa_QueryTrustedDomainInfo), - (ndr_push_flags_fn_t) ndr_push_lsa_QueryTrustedDomainInfo, - (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryTrustedDomainInfo, - (ndr_print_function_t) ndr_print_lsa_QueryTrustedDomainInfo, - false, - }, - { - "lsa_SetInformationTrustedDomain", - sizeof(struct lsa_SetInformationTrustedDomain), - (ndr_push_flags_fn_t) ndr_push_lsa_SetInformationTrustedDomain, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetInformationTrustedDomain, - (ndr_print_function_t) ndr_print_lsa_SetInformationTrustedDomain, - false, - }, - { - "lsa_OpenSecret", - sizeof(struct lsa_OpenSecret), - (ndr_push_flags_fn_t) ndr_push_lsa_OpenSecret, - (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenSecret, - (ndr_print_function_t) ndr_print_lsa_OpenSecret, - false, - }, - { - "lsa_SetSecret", - sizeof(struct lsa_SetSecret), - (ndr_push_flags_fn_t) ndr_push_lsa_SetSecret, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetSecret, - (ndr_print_function_t) ndr_print_lsa_SetSecret, - false, - }, - { - "lsa_QuerySecret", - sizeof(struct lsa_QuerySecret), - (ndr_push_flags_fn_t) ndr_push_lsa_QuerySecret, - (ndr_pull_flags_fn_t) ndr_pull_lsa_QuerySecret, - (ndr_print_function_t) ndr_print_lsa_QuerySecret, - false, - }, - { - "lsa_LookupPrivValue", - sizeof(struct lsa_LookupPrivValue), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupPrivValue, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupPrivValue, - (ndr_print_function_t) ndr_print_lsa_LookupPrivValue, - false, - }, - { - "lsa_LookupPrivName", - sizeof(struct lsa_LookupPrivName), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupPrivName, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupPrivName, - (ndr_print_function_t) ndr_print_lsa_LookupPrivName, - false, - }, - { - "lsa_LookupPrivDisplayName", - sizeof(struct lsa_LookupPrivDisplayName), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupPrivDisplayName, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupPrivDisplayName, - (ndr_print_function_t) ndr_print_lsa_LookupPrivDisplayName, - false, - }, - { - "lsa_DeleteObject", - sizeof(struct lsa_DeleteObject), - (ndr_push_flags_fn_t) ndr_push_lsa_DeleteObject, - (ndr_pull_flags_fn_t) ndr_pull_lsa_DeleteObject, - (ndr_print_function_t) ndr_print_lsa_DeleteObject, - false, - }, - { - "lsa_EnumAccountsWithUserRight", - sizeof(struct lsa_EnumAccountsWithUserRight), - (ndr_push_flags_fn_t) ndr_push_lsa_EnumAccountsWithUserRight, - (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumAccountsWithUserRight, - (ndr_print_function_t) ndr_print_lsa_EnumAccountsWithUserRight, - false, - }, - { - "lsa_EnumAccountRights", - sizeof(struct lsa_EnumAccountRights), - (ndr_push_flags_fn_t) ndr_push_lsa_EnumAccountRights, - (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumAccountRights, - (ndr_print_function_t) ndr_print_lsa_EnumAccountRights, - false, - }, - { - "lsa_AddAccountRights", - sizeof(struct lsa_AddAccountRights), - (ndr_push_flags_fn_t) ndr_push_lsa_AddAccountRights, - (ndr_pull_flags_fn_t) ndr_pull_lsa_AddAccountRights, - (ndr_print_function_t) ndr_print_lsa_AddAccountRights, - false, - }, - { - "lsa_RemoveAccountRights", - sizeof(struct lsa_RemoveAccountRights), - (ndr_push_flags_fn_t) ndr_push_lsa_RemoveAccountRights, - (ndr_pull_flags_fn_t) ndr_pull_lsa_RemoveAccountRights, - (ndr_print_function_t) ndr_print_lsa_RemoveAccountRights, - false, - }, - { - "lsa_QueryTrustedDomainInfoBySid", - sizeof(struct lsa_QueryTrustedDomainInfoBySid), - (ndr_push_flags_fn_t) ndr_push_lsa_QueryTrustedDomainInfoBySid, - (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryTrustedDomainInfoBySid, - (ndr_print_function_t) ndr_print_lsa_QueryTrustedDomainInfoBySid, - false, - }, - { - "lsa_SetTrustedDomainInfo", - sizeof(struct lsa_SetTrustedDomainInfo), - (ndr_push_flags_fn_t) ndr_push_lsa_SetTrustedDomainInfo, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetTrustedDomainInfo, - (ndr_print_function_t) ndr_print_lsa_SetTrustedDomainInfo, - false, - }, - { - "lsa_DeleteTrustedDomain", - sizeof(struct lsa_DeleteTrustedDomain), - (ndr_push_flags_fn_t) ndr_push_lsa_DeleteTrustedDomain, - (ndr_pull_flags_fn_t) ndr_pull_lsa_DeleteTrustedDomain, - (ndr_print_function_t) ndr_print_lsa_DeleteTrustedDomain, - false, - }, - { - "lsa_StorePrivateData", - sizeof(struct lsa_StorePrivateData), - (ndr_push_flags_fn_t) ndr_push_lsa_StorePrivateData, - (ndr_pull_flags_fn_t) ndr_pull_lsa_StorePrivateData, - (ndr_print_function_t) ndr_print_lsa_StorePrivateData, - false, - }, - { - "lsa_RetrievePrivateData", - sizeof(struct lsa_RetrievePrivateData), - (ndr_push_flags_fn_t) ndr_push_lsa_RetrievePrivateData, - (ndr_pull_flags_fn_t) ndr_pull_lsa_RetrievePrivateData, - (ndr_print_function_t) ndr_print_lsa_RetrievePrivateData, - false, - }, - { - "lsa_OpenPolicy2", - sizeof(struct lsa_OpenPolicy2), - (ndr_push_flags_fn_t) ndr_push_lsa_OpenPolicy2, - (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenPolicy2, - (ndr_print_function_t) ndr_print_lsa_OpenPolicy2, - false, - }, - { - "lsa_GetUserName", - sizeof(struct lsa_GetUserName), - (ndr_push_flags_fn_t) ndr_push_lsa_GetUserName, - (ndr_pull_flags_fn_t) ndr_pull_lsa_GetUserName, - (ndr_print_function_t) ndr_print_lsa_GetUserName, - false, - }, - { - "lsa_QueryInfoPolicy2", - sizeof(struct lsa_QueryInfoPolicy2), - (ndr_push_flags_fn_t) ndr_push_lsa_QueryInfoPolicy2, - (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryInfoPolicy2, - (ndr_print_function_t) ndr_print_lsa_QueryInfoPolicy2, - false, - }, - { - "lsa_SetInfoPolicy2", - sizeof(struct lsa_SetInfoPolicy2), - (ndr_push_flags_fn_t) ndr_push_lsa_SetInfoPolicy2, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetInfoPolicy2, - (ndr_print_function_t) ndr_print_lsa_SetInfoPolicy2, - false, - }, - { - "lsa_QueryTrustedDomainInfoByName", - sizeof(struct lsa_QueryTrustedDomainInfoByName), - (ndr_push_flags_fn_t) ndr_push_lsa_QueryTrustedDomainInfoByName, - (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryTrustedDomainInfoByName, - (ndr_print_function_t) ndr_print_lsa_QueryTrustedDomainInfoByName, - false, - }, - { - "lsa_SetTrustedDomainInfoByName", - sizeof(struct lsa_SetTrustedDomainInfoByName), - (ndr_push_flags_fn_t) ndr_push_lsa_SetTrustedDomainInfoByName, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetTrustedDomainInfoByName, - (ndr_print_function_t) ndr_print_lsa_SetTrustedDomainInfoByName, - false, - }, - { - "lsa_EnumTrustedDomainsEx", - sizeof(struct lsa_EnumTrustedDomainsEx), - (ndr_push_flags_fn_t) ndr_push_lsa_EnumTrustedDomainsEx, - (ndr_pull_flags_fn_t) ndr_pull_lsa_EnumTrustedDomainsEx, - (ndr_print_function_t) ndr_print_lsa_EnumTrustedDomainsEx, - false, - }, - { - "lsa_CreateTrustedDomainEx", - sizeof(struct lsa_CreateTrustedDomainEx), - (ndr_push_flags_fn_t) ndr_push_lsa_CreateTrustedDomainEx, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateTrustedDomainEx, - (ndr_print_function_t) ndr_print_lsa_CreateTrustedDomainEx, - false, - }, - { - "lsa_CloseTrustedDomainEx", - sizeof(struct lsa_CloseTrustedDomainEx), - (ndr_push_flags_fn_t) ndr_push_lsa_CloseTrustedDomainEx, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CloseTrustedDomainEx, - (ndr_print_function_t) ndr_print_lsa_CloseTrustedDomainEx, - false, - }, - { - "lsa_QueryDomainInformationPolicy", - sizeof(struct lsa_QueryDomainInformationPolicy), - (ndr_push_flags_fn_t) ndr_push_lsa_QueryDomainInformationPolicy, - (ndr_pull_flags_fn_t) ndr_pull_lsa_QueryDomainInformationPolicy, - (ndr_print_function_t) ndr_print_lsa_QueryDomainInformationPolicy, - false, - }, - { - "lsa_SetDomainInformationPolicy", - sizeof(struct lsa_SetDomainInformationPolicy), - (ndr_push_flags_fn_t) ndr_push_lsa_SetDomainInformationPolicy, - (ndr_pull_flags_fn_t) ndr_pull_lsa_SetDomainInformationPolicy, - (ndr_print_function_t) ndr_print_lsa_SetDomainInformationPolicy, - false, - }, - { - "lsa_OpenTrustedDomainByName", - sizeof(struct lsa_OpenTrustedDomainByName), - (ndr_push_flags_fn_t) ndr_push_lsa_OpenTrustedDomainByName, - (ndr_pull_flags_fn_t) ndr_pull_lsa_OpenTrustedDomainByName, - (ndr_print_function_t) ndr_print_lsa_OpenTrustedDomainByName, - false, - }, - { - "lsa_TestCall", - sizeof(struct lsa_TestCall), - (ndr_push_flags_fn_t) ndr_push_lsa_TestCall, - (ndr_pull_flags_fn_t) ndr_pull_lsa_TestCall, - (ndr_print_function_t) ndr_print_lsa_TestCall, - false, - }, - { - "lsa_LookupSids2", - sizeof(struct lsa_LookupSids2), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupSids2, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupSids2, - (ndr_print_function_t) ndr_print_lsa_LookupSids2, - false, - }, - { - "lsa_LookupNames2", - sizeof(struct lsa_LookupNames2), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames2, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames2, - (ndr_print_function_t) ndr_print_lsa_LookupNames2, - false, - }, - { - "lsa_CreateTrustedDomainEx2", - sizeof(struct lsa_CreateTrustedDomainEx2), - (ndr_push_flags_fn_t) ndr_push_lsa_CreateTrustedDomainEx2, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CreateTrustedDomainEx2, - (ndr_print_function_t) ndr_print_lsa_CreateTrustedDomainEx2, - false, - }, - { - "lsa_CREDRWRITE", - sizeof(struct lsa_CREDRWRITE), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRWRITE, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRWRITE, - (ndr_print_function_t) ndr_print_lsa_CREDRWRITE, - false, - }, - { - "lsa_CREDRREAD", - sizeof(struct lsa_CREDRREAD), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRREAD, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRREAD, - (ndr_print_function_t) ndr_print_lsa_CREDRREAD, - false, - }, - { - "lsa_CREDRENUMERATE", - sizeof(struct lsa_CREDRENUMERATE), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRENUMERATE, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRENUMERATE, - (ndr_print_function_t) ndr_print_lsa_CREDRENUMERATE, - false, - }, - { - "lsa_CREDRWRITEDOMAINCREDENTIALS", - sizeof(struct lsa_CREDRWRITEDOMAINCREDENTIALS), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRWRITEDOMAINCREDENTIALS, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRWRITEDOMAINCREDENTIALS, - (ndr_print_function_t) ndr_print_lsa_CREDRWRITEDOMAINCREDENTIALS, - false, - }, - { - "lsa_CREDRREADDOMAINCREDENTIALS", - sizeof(struct lsa_CREDRREADDOMAINCREDENTIALS), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRREADDOMAINCREDENTIALS, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRREADDOMAINCREDENTIALS, - (ndr_print_function_t) ndr_print_lsa_CREDRREADDOMAINCREDENTIALS, - false, - }, - { - "lsa_CREDRDELETE", - sizeof(struct lsa_CREDRDELETE), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRDELETE, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRDELETE, - (ndr_print_function_t) ndr_print_lsa_CREDRDELETE, - false, - }, - { - "lsa_CREDRGETTARGETINFO", - sizeof(struct lsa_CREDRGETTARGETINFO), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRGETTARGETINFO, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRGETTARGETINFO, - (ndr_print_function_t) ndr_print_lsa_CREDRGETTARGETINFO, - false, - }, - { - "lsa_CREDRPROFILELOADED", - sizeof(struct lsa_CREDRPROFILELOADED), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRPROFILELOADED, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRPROFILELOADED, - (ndr_print_function_t) ndr_print_lsa_CREDRPROFILELOADED, - false, - }, - { - "lsa_LookupNames3", - sizeof(struct lsa_LookupNames3), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames3, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames3, - (ndr_print_function_t) ndr_print_lsa_LookupNames3, - false, - }, - { - "lsa_CREDRGETSESSIONTYPES", - sizeof(struct lsa_CREDRGETSESSIONTYPES), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRGETSESSIONTYPES, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRGETSESSIONTYPES, - (ndr_print_function_t) ndr_print_lsa_CREDRGETSESSIONTYPES, - false, - }, - { - "lsa_LSARREGISTERAUDITEVENT", - sizeof(struct lsa_LSARREGISTERAUDITEVENT), - (ndr_push_flags_fn_t) ndr_push_lsa_LSARREGISTERAUDITEVENT, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARREGISTERAUDITEVENT, - (ndr_print_function_t) ndr_print_lsa_LSARREGISTERAUDITEVENT, - false, - }, - { - "lsa_LSARGENAUDITEVENT", - sizeof(struct lsa_LSARGENAUDITEVENT), - (ndr_push_flags_fn_t) ndr_push_lsa_LSARGENAUDITEVENT, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARGENAUDITEVENT, - (ndr_print_function_t) ndr_print_lsa_LSARGENAUDITEVENT, - false, - }, - { - "lsa_LSARUNREGISTERAUDITEVENT", - sizeof(struct lsa_LSARUNREGISTERAUDITEVENT), - (ndr_push_flags_fn_t) ndr_push_lsa_LSARUNREGISTERAUDITEVENT, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARUNREGISTERAUDITEVENT, - (ndr_print_function_t) ndr_print_lsa_LSARUNREGISTERAUDITEVENT, - false, - }, - { - "lsa_lsaRQueryForestTrustInformation", - sizeof(struct lsa_lsaRQueryForestTrustInformation), - (ndr_push_flags_fn_t) ndr_push_lsa_lsaRQueryForestTrustInformation, - (ndr_pull_flags_fn_t) ndr_pull_lsa_lsaRQueryForestTrustInformation, - (ndr_print_function_t) ndr_print_lsa_lsaRQueryForestTrustInformation, - false, - }, - { - "lsa_LSARSETFORESTTRUSTINFORMATION", - sizeof(struct lsa_LSARSETFORESTTRUSTINFORMATION), - (ndr_push_flags_fn_t) ndr_push_lsa_LSARSETFORESTTRUSTINFORMATION, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARSETFORESTTRUSTINFORMATION, - (ndr_print_function_t) ndr_print_lsa_LSARSETFORESTTRUSTINFORMATION, - false, - }, - { - "lsa_CREDRRENAME", - sizeof(struct lsa_CREDRRENAME), - (ndr_push_flags_fn_t) ndr_push_lsa_CREDRRENAME, - (ndr_pull_flags_fn_t) ndr_pull_lsa_CREDRRENAME, - (ndr_print_function_t) ndr_print_lsa_CREDRRENAME, - false, - }, - { - "lsa_LookupSids3", - sizeof(struct lsa_LookupSids3), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupSids3, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupSids3, - (ndr_print_function_t) ndr_print_lsa_LookupSids3, - false, - }, - { - "lsa_LookupNames4", - sizeof(struct lsa_LookupNames4), - (ndr_push_flags_fn_t) ndr_push_lsa_LookupNames4, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LookupNames4, - (ndr_print_function_t) ndr_print_lsa_LookupNames4, - false, - }, - { - "lsa_LSAROPENPOLICYSCE", - sizeof(struct lsa_LSAROPENPOLICYSCE), - (ndr_push_flags_fn_t) ndr_push_lsa_LSAROPENPOLICYSCE, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LSAROPENPOLICYSCE, - (ndr_print_function_t) ndr_print_lsa_LSAROPENPOLICYSCE, - false, - }, - { - "lsa_LSARADTREGISTERSECURITYEVENTSOURCE", - sizeof(struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE), - (ndr_push_flags_fn_t) ndr_push_lsa_LSARADTREGISTERSECURITYEVENTSOURCE, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARADTREGISTERSECURITYEVENTSOURCE, - (ndr_print_function_t) ndr_print_lsa_LSARADTREGISTERSECURITYEVENTSOURCE, - false, - }, - { - "lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE", - sizeof(struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE), - (ndr_push_flags_fn_t) ndr_push_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, - (ndr_print_function_t) ndr_print_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, - false, - }, - { - "lsa_LSARADTREPORTSECURITYEVENT", - sizeof(struct lsa_LSARADTREPORTSECURITYEVENT), - (ndr_push_flags_fn_t) ndr_push_lsa_LSARADTREPORTSECURITYEVENT, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARADTREPORTSECURITYEVENT, - (ndr_print_function_t) ndr_print_lsa_LSARADTREPORTSECURITYEVENT, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const lsarpc_endpoint_strings[] = { - "ncacn_np:[\\pipe\\lsarpc]", - "ncacn_np:[\\pipe\\netlogon]", - "ncacn_np:[\\pipe\\lsass]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array lsarpc_endpoints = { - .count = 5, - .names = lsarpc_endpoint_strings -}; - -static const char * const lsarpc_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array lsarpc_authservices = { - .count = 1, - .names = lsarpc_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_lsarpc = { - .name = "lsarpc", - .syntax_id = { - {0x12345778,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xab}}, - NDR_LSARPC_VERSION - }, - .helpstring = NDR_LSARPC_HELPSTRING, - .num_calls = 82, - .calls = lsarpc_calls, - .endpoints = &lsarpc_endpoints, - .authservices = &lsarpc_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_lsa.h b/source3/librpc/gen_ndr/ndr_lsa.h deleted file mode 100644 index 2f623c2ba9..0000000000 --- a/source3/librpc/gen_ndr/ndr_lsa.h +++ /dev/null @@ -1,400 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/lsa.h" - -#ifndef _HEADER_NDR_lsarpc -#define _HEADER_NDR_lsarpc - -#define NDR_LSARPC_UUID "12345778-1234-abcd-ef00-0123456789ab" -#define NDR_LSARPC_VERSION 0.0 -#define NDR_LSARPC_NAME "lsarpc" -#define NDR_LSARPC_HELPSTRING "Local Security Authority" -extern const struct ndr_interface_table ndr_table_lsarpc; -#define NDR_LSA_CLOSE (0x00) - -#define NDR_LSA_DELETE (0x01) - -#define NDR_LSA_ENUMPRIVS (0x02) - -#define NDR_LSA_QUERYSECURITY (0x03) - -#define NDR_LSA_SETSECOBJ (0x04) - -#define NDR_LSA_CHANGEPASSWORD (0x05) - -#define NDR_LSA_OPENPOLICY (0x06) - -#define NDR_LSA_QUERYINFOPOLICY (0x07) - -#define NDR_LSA_SETINFOPOLICY (0x08) - -#define NDR_LSA_CLEARAUDITLOG (0x09) - -#define NDR_LSA_CREATEACCOUNT (0x0a) - -#define NDR_LSA_ENUMACCOUNTS (0x0b) - -#define NDR_LSA_CREATETRUSTEDDOMAIN (0x0c) - -#define NDR_LSA_ENUMTRUSTDOM (0x0d) - -#define NDR_LSA_LOOKUPNAMES (0x0e) - -#define NDR_LSA_LOOKUPSIDS (0x0f) - -#define NDR_LSA_CREATESECRET (0x10) - -#define NDR_LSA_OPENACCOUNT (0x11) - -#define NDR_LSA_ENUMPRIVSACCOUNT (0x12) - -#define NDR_LSA_ADDPRIVILEGESTOACCOUNT (0x13) - -#define NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT (0x14) - -#define NDR_LSA_GETQUOTASFORACCOUNT (0x15) - -#define NDR_LSA_SETQUOTASFORACCOUNT (0x16) - -#define NDR_LSA_GETSYSTEMACCESSACCOUNT (0x17) - -#define NDR_LSA_SETSYSTEMACCESSACCOUNT (0x18) - -#define NDR_LSA_OPENTRUSTEDDOMAIN (0x19) - -#define NDR_LSA_QUERYTRUSTEDDOMAININFO (0x1a) - -#define NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN (0x1b) - -#define NDR_LSA_OPENSECRET (0x1c) - -#define NDR_LSA_SETSECRET (0x1d) - -#define NDR_LSA_QUERYSECRET (0x1e) - -#define NDR_LSA_LOOKUPPRIVVALUE (0x1f) - -#define NDR_LSA_LOOKUPPRIVNAME (0x20) - -#define NDR_LSA_LOOKUPPRIVDISPLAYNAME (0x21) - -#define NDR_LSA_DELETEOBJECT (0x22) - -#define NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT (0x23) - -#define NDR_LSA_ENUMACCOUNTRIGHTS (0x24) - -#define NDR_LSA_ADDACCOUNTRIGHTS (0x25) - -#define NDR_LSA_REMOVEACCOUNTRIGHTS (0x26) - -#define NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID (0x27) - -#define NDR_LSA_SETTRUSTEDDOMAININFO (0x28) - -#define NDR_LSA_DELETETRUSTEDDOMAIN (0x29) - -#define NDR_LSA_STOREPRIVATEDATA (0x2a) - -#define NDR_LSA_RETRIEVEPRIVATEDATA (0x2b) - -#define NDR_LSA_OPENPOLICY2 (0x2c) - -#define NDR_LSA_GETUSERNAME (0x2d) - -#define NDR_LSA_QUERYINFOPOLICY2 (0x2e) - -#define NDR_LSA_SETINFOPOLICY2 (0x2f) - -#define NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME (0x30) - -#define NDR_LSA_SETTRUSTEDDOMAININFOBYNAME (0x31) - -#define NDR_LSA_ENUMTRUSTEDDOMAINSEX (0x32) - -#define NDR_LSA_CREATETRUSTEDDOMAINEX (0x33) - -#define NDR_LSA_CLOSETRUSTEDDOMAINEX (0x34) - -#define NDR_LSA_QUERYDOMAININFORMATIONPOLICY (0x35) - -#define NDR_LSA_SETDOMAININFORMATIONPOLICY (0x36) - -#define NDR_LSA_OPENTRUSTEDDOMAINBYNAME (0x37) - -#define NDR_LSA_TESTCALL (0x38) - -#define NDR_LSA_LOOKUPSIDS2 (0x39) - -#define NDR_LSA_LOOKUPNAMES2 (0x3a) - -#define NDR_LSA_CREATETRUSTEDDOMAINEX2 (0x3b) - -#define NDR_LSA_CREDRWRITE (0x3c) - -#define NDR_LSA_CREDRREAD (0x3d) - -#define NDR_LSA_CREDRENUMERATE (0x3e) - -#define NDR_LSA_CREDRWRITEDOMAINCREDENTIALS (0x3f) - -#define NDR_LSA_CREDRREADDOMAINCREDENTIALS (0x40) - -#define NDR_LSA_CREDRDELETE (0x41) - -#define NDR_LSA_CREDRGETTARGETINFO (0x42) - -#define NDR_LSA_CREDRPROFILELOADED (0x43) - -#define NDR_LSA_LOOKUPNAMES3 (0x44) - -#define NDR_LSA_CREDRGETSESSIONTYPES (0x45) - -#define NDR_LSA_LSARREGISTERAUDITEVENT (0x46) - -#define NDR_LSA_LSARGENAUDITEVENT (0x47) - -#define NDR_LSA_LSARUNREGISTERAUDITEVENT (0x48) - -#define NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION (0x49) - -#define NDR_LSA_LSARSETFORESTTRUSTINFORMATION (0x4a) - -#define NDR_LSA_CREDRRENAME (0x4b) - -#define NDR_LSA_LOOKUPSIDS3 (0x4c) - -#define NDR_LSA_LOOKUPNAMES4 (0x4d) - -#define NDR_LSA_LSAROPENPOLICYSCE (0x4e) - -#define NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE (0x4f) - -#define NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE (0x50) - -#define NDR_LSA_LSARADTREPORTSECURITYEVENT (0x51) - -#define NDR_LSARPC_CALL_COUNT (82) -enum ndr_err_code ndr_push_lsa_String(struct ndr_push *ndr, int ndr_flags, const struct lsa_String *r); -enum ndr_err_code ndr_pull_lsa_String(struct ndr_pull *ndr, int ndr_flags, struct lsa_String *r); -void ndr_print_lsa_String(struct ndr_print *ndr, const char *name, const struct lsa_String *r); -enum ndr_err_code ndr_push_lsa_StringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_StringLarge *r); -enum ndr_err_code ndr_pull_lsa_StringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_StringLarge *r); -void ndr_print_lsa_StringLarge(struct ndr_print *ndr, const char *name, const struct lsa_StringLarge *r); -enum ndr_err_code ndr_push_lsa_Strings(struct ndr_push *ndr, int ndr_flags, const struct lsa_Strings *r); -enum ndr_err_code ndr_pull_lsa_Strings(struct ndr_pull *ndr, int ndr_flags, struct lsa_Strings *r); -void ndr_print_lsa_Strings(struct ndr_print *ndr, const char *name, const struct lsa_Strings *r); -enum ndr_err_code ndr_push_lsa_AsciiString(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiString *r); -enum ndr_err_code ndr_pull_lsa_AsciiString(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiString *r); -void ndr_print_lsa_AsciiString(struct ndr_print *ndr, const char *name, const struct lsa_AsciiString *r); -enum ndr_err_code ndr_push_lsa_AsciiStringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiStringLarge *r); -enum ndr_err_code ndr_pull_lsa_AsciiStringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiStringLarge *r); -void ndr_print_lsa_AsciiStringLarge(struct ndr_print *ndr, const char *name, const struct lsa_AsciiStringLarge *r); -enum ndr_err_code ndr_push_lsa_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct lsa_BinaryString *r); -enum ndr_err_code ndr_pull_lsa_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct lsa_BinaryString *r); -void ndr_print_lsa_BinaryString(struct ndr_print *ndr, const char *name, const struct lsa_BinaryString *r); -void ndr_print_lsa_LUID(struct ndr_print *ndr, const char *name, const struct lsa_LUID *r); -void ndr_print_lsa_PrivEntry(struct ndr_print *ndr, const char *name, const struct lsa_PrivEntry *r); -void ndr_print_lsa_PrivArray(struct ndr_print *ndr, const char *name, const struct lsa_PrivArray *r); -void ndr_print_lsa_QosInfo(struct ndr_print *ndr, const char *name, const struct lsa_QosInfo *r); -void ndr_print_lsa_ObjectAttribute(struct ndr_print *ndr, const char *name, const struct lsa_ObjectAttribute *r); -enum ndr_err_code ndr_push_lsa_PolicyAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_lsa_PolicyAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_lsa_PolicyAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_lsa_AuditLogInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditLogInfo *r); -void ndr_print_lsa_PolicyAuditPolicy(struct ndr_print *ndr, const char *name, enum lsa_PolicyAuditPolicy r); -void ndr_print_lsa_AuditEventsInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditEventsInfo *r); -void ndr_print_lsa_DomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfo *r); -void ndr_print_lsa_PDAccountInfo(struct ndr_print *ndr, const char *name, const struct lsa_PDAccountInfo *r); -void ndr_print_lsa_Role(struct ndr_print *ndr, const char *name, enum lsa_Role r); -void ndr_print_lsa_ServerRole(struct ndr_print *ndr, const char *name, const struct lsa_ServerRole *r); -void ndr_print_lsa_ReplicaSourceInfo(struct ndr_print *ndr, const char *name, const struct lsa_ReplicaSourceInfo *r); -void ndr_print_lsa_DefaultQuotaInfo(struct ndr_print *ndr, const char *name, const struct lsa_DefaultQuotaInfo *r); -void ndr_print_lsa_ModificationInfo(struct ndr_print *ndr, const char *name, const struct lsa_ModificationInfo *r); -void ndr_print_lsa_AuditFullSetInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullSetInfo *r); -void ndr_print_lsa_AuditFullQueryInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullQueryInfo *r); -void ndr_print_lsa_DnsDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DnsDomainInfo *r); -void ndr_print_lsa_PolicyInfo(struct ndr_print *ndr, const char *name, enum lsa_PolicyInfo r); -void ndr_print_lsa_PolicyInformation(struct ndr_print *ndr, const char *name, const union lsa_PolicyInformation *r); -void ndr_print_lsa_SidPtr(struct ndr_print *ndr, const char *name, const struct lsa_SidPtr *r); -enum ndr_err_code ndr_push_lsa_SidArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_SidArray *r); -enum ndr_err_code ndr_pull_lsa_SidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidArray *r); -void ndr_print_lsa_SidArray(struct ndr_print *ndr, const char *name, const struct lsa_SidArray *r); -void ndr_print_lsa_DomainList(struct ndr_print *ndr, const char *name, const struct lsa_DomainList *r); -enum ndr_err_code ndr_push_lsa_SidType(struct ndr_push *ndr, int ndr_flags, enum lsa_SidType r); -enum ndr_err_code ndr_pull_lsa_SidType(struct ndr_pull *ndr, int ndr_flags, enum lsa_SidType *r); -void ndr_print_lsa_SidType(struct ndr_print *ndr, const char *name, enum lsa_SidType r); -void ndr_print_lsa_TranslatedSid(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid *r); -void ndr_print_lsa_TransSidArray(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray *r); -void ndr_print_lsa_RefDomainList(struct ndr_print *ndr, const char *name, const struct lsa_RefDomainList *r); -void ndr_print_lsa_LookupNamesLevel(struct ndr_print *ndr, const char *name, enum lsa_LookupNamesLevel r); -void ndr_print_lsa_TranslatedName(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName *r); -void ndr_print_lsa_TransNameArray(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray *r); -void ndr_print_lsa_LUIDAttribute(struct ndr_print *ndr, const char *name, const struct lsa_LUIDAttribute *r); -void ndr_print_lsa_PrivilegeSet(struct ndr_print *ndr, const char *name, const struct lsa_PrivilegeSet *r); -void ndr_print_lsa_DATA_BUF(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF *r); -void ndr_print_lsa_DATA_BUF2(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF2 *r); -void ndr_print_lsa_TrustDomInfoEnum(struct ndr_print *ndr, const char *name, enum lsa_TrustDomInfoEnum r); -enum ndr_err_code ndr_push_lsa_TrustDirection(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_lsa_TrustDirection(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_lsa_TrustDirection(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_lsa_TrustType(struct ndr_print *ndr, const char *name, enum lsa_TrustType r); -enum ndr_err_code ndr_push_lsa_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_lsa_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_lsa_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_lsa_TrustDomainInfoName(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoName *r); -void ndr_print_lsa_TrustDomainInfoControllers(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoControllers *r); -void ndr_print_lsa_TrustDomainInfoPosixOffset(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPosixOffset *r); -void ndr_print_lsa_TrustDomainInfoPassword(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPassword *r); -void ndr_print_lsa_TrustDomainInfoBasic(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBasic *r); -void ndr_print_lsa_TrustDomainInfoInfoEx(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx *r); -enum ndr_err_code ndr_push_lsa_TrustAuthType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustAuthType r); -enum ndr_err_code ndr_pull_lsa_TrustAuthType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustAuthType *r); -void ndr_print_lsa_TrustAuthType(struct ndr_print *ndr, const char *name, enum lsa_TrustAuthType r); -void ndr_print_lsa_TrustDomainInfoBuffer(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBuffer *r); -void ndr_print_lsa_TrustDomainInfoAuthInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfo *r); -void ndr_print_lsa_TrustDomainInfoFullInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo *r); -void ndr_print_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfoInternal *r); -void ndr_print_lsa_TrustDomainInfoFullInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfoInternal *r); -void ndr_print_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx2Internal *r); -void ndr_print_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo2Internal *r); -void ndr_print_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoSupportedEncTypes *r); -void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char *name, const union lsa_TrustedDomainInfo *r); -void ndr_print_lsa_DATA_BUF_PTR(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF_PTR *r); -void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, const struct lsa_RightSet *r); -void ndr_print_lsa_DomainListEx(struct ndr_print *ndr, const char *name, const struct lsa_DomainListEx *r); -void ndr_print_lsa_DomainInfoKerberos(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoKerberos *r); -void ndr_print_lsa_DomainInfoEfs(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoEfs *r); -void ndr_print_lsa_DomainInformationPolicy(struct ndr_print *ndr, const char *name, const union lsa_DomainInformationPolicy *r); -void ndr_print_lsa_TranslatedName2(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName2 *r); -void ndr_print_lsa_TransNameArray2(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray2 *r); -void ndr_print_lsa_TranslatedSid2(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid2 *r); -void ndr_print_lsa_TransSidArray2(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray2 *r); -void ndr_print_lsa_TranslatedSid3(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid3 *r); -void ndr_print_lsa_TransSidArray3(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray3 *r); -void ndr_print_lsa_ForestTrustBinaryData(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustBinaryData *r); -void ndr_print_lsa_ForestTrustDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustDomainInfo *r); -void ndr_print_lsa_ForestTrustData(struct ndr_print *ndr, const char *name, const union lsa_ForestTrustData *r); -void ndr_print_lsa_ForestTrustRecordType(struct ndr_print *ndr, const char *name, enum lsa_ForestTrustRecordType r); -void ndr_print_lsa_ForestTrustRecord(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustRecord *r); -enum ndr_err_code ndr_push_lsa_ForestTrustInformation(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustInformation *r); -enum ndr_err_code ndr_pull_lsa_ForestTrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustInformation *r); -void ndr_print_lsa_ForestTrustInformation(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustInformation *r); -void ndr_print_lsa_Close(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Close *r); -enum ndr_err_code ndr_push_lsa_Delete(struct ndr_push *ndr, int flags, const struct lsa_Delete *r); -enum ndr_err_code ndr_pull_lsa_Delete(struct ndr_pull *ndr, int flags, struct lsa_Delete *r); -void ndr_print_lsa_Delete(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Delete *r); -enum ndr_err_code ndr_push_lsa_EnumPrivs(struct ndr_push *ndr, int flags, const struct lsa_EnumPrivs *r); -enum ndr_err_code ndr_pull_lsa_EnumPrivs(struct ndr_pull *ndr, int flags, struct lsa_EnumPrivs *r); -void ndr_print_lsa_EnumPrivs(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivs *r); -void ndr_print_lsa_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecurity *r); -void ndr_print_lsa_SetSecObj(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecObj *r); -void ndr_print_lsa_ChangePassword(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ChangePassword *r); -enum ndr_err_code ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy *r); -enum ndr_err_code ndr_pull_lsa_OpenPolicy(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy *r); -void ndr_print_lsa_OpenPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy *r); -void ndr_print_lsa_QueryInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy *r); -void ndr_print_lsa_SetInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInfoPolicy *r); -void ndr_print_lsa_ClearAuditLog(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ClearAuditLog *r); -enum ndr_err_code ndr_push_lsa_CreateAccount(struct ndr_push *ndr, int flags, const struct lsa_CreateAccount *r); -enum ndr_err_code ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, int flags, struct lsa_CreateAccount *r); -void ndr_print_lsa_CreateAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateAccount *r); -enum ndr_err_code ndr_push_lsa_EnumAccounts(struct ndr_push *ndr, int flags, const struct lsa_EnumAccounts *r); -enum ndr_err_code ndr_pull_lsa_EnumAccounts(struct ndr_pull *ndr, int flags, struct lsa_EnumAccounts *r); -void ndr_print_lsa_EnumAccounts(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccounts *r); -enum ndr_err_code ndr_push_lsa_CreateTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomain *r); -enum ndr_err_code ndr_pull_lsa_CreateTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomain *r); -void ndr_print_lsa_CreateTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomain *r); -void ndr_print_lsa_EnumTrustDom(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumTrustDom *r); -enum ndr_err_code ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const struct lsa_LookupNames *r); -enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flags, struct lsa_LookupNames *r); -void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames *r); -enum ndr_err_code ndr_push_lsa_LookupSids(struct ndr_push *ndr, int flags, const struct lsa_LookupSids *r); -enum ndr_err_code ndr_pull_lsa_LookupSids(struct ndr_pull *ndr, int flags, struct lsa_LookupSids *r); -void ndr_print_lsa_LookupSids(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids *r); -enum ndr_err_code ndr_push_lsa_CreateSecret(struct ndr_push *ndr, int flags, const struct lsa_CreateSecret *r); -enum ndr_err_code ndr_pull_lsa_CreateSecret(struct ndr_pull *ndr, int flags, struct lsa_CreateSecret *r); -void ndr_print_lsa_CreateSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateSecret *r); -void ndr_print_lsa_OpenAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenAccount *r); -void ndr_print_lsa_EnumPrivsAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivsAccount *r); -void ndr_print_lsa_AddPrivilegesToAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_AddPrivilegesToAccount *r); -void ndr_print_lsa_RemovePrivilegesFromAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RemovePrivilegesFromAccount *r); -void ndr_print_lsa_GetQuotasForAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetQuotasForAccount *r); -void ndr_print_lsa_SetQuotasForAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetQuotasForAccount *r); -void ndr_print_lsa_GetSystemAccessAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetSystemAccessAccount *r); -void ndr_print_lsa_SetSystemAccessAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSystemAccessAccount *r); -void ndr_print_lsa_OpenTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomain *r); -void ndr_print_lsa_QueryTrustedDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfo *r); -void ndr_print_lsa_SetInformationTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInformationTrustedDomain *r); -enum ndr_err_code ndr_push_lsa_OpenSecret(struct ndr_push *ndr, int flags, const struct lsa_OpenSecret *r); -enum ndr_err_code ndr_pull_lsa_OpenSecret(struct ndr_pull *ndr, int flags, struct lsa_OpenSecret *r); -void ndr_print_lsa_OpenSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenSecret *r); -enum ndr_err_code ndr_push_lsa_SetSecret(struct ndr_push *ndr, int flags, const struct lsa_SetSecret *r); -enum ndr_err_code ndr_pull_lsa_SetSecret(struct ndr_pull *ndr, int flags, struct lsa_SetSecret *r); -void ndr_print_lsa_SetSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecret *r); -enum ndr_err_code ndr_push_lsa_QuerySecret(struct ndr_push *ndr, int flags, const struct lsa_QuerySecret *r); -enum ndr_err_code ndr_pull_lsa_QuerySecret(struct ndr_pull *ndr, int flags, struct lsa_QuerySecret *r); -void ndr_print_lsa_QuerySecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecret *r); -void ndr_print_lsa_LookupPrivValue(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivValue *r); -void ndr_print_lsa_LookupPrivName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivName *r); -void ndr_print_lsa_LookupPrivDisplayName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivDisplayName *r); -void ndr_print_lsa_DeleteObject(struct ndr_print *ndr, const char *name, int flags, const struct lsa_DeleteObject *r); -void ndr_print_lsa_EnumAccountsWithUserRight(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccountsWithUserRight *r); -void ndr_print_lsa_EnumAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccountRights *r); -void ndr_print_lsa_AddAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_AddAccountRights *r); -void ndr_print_lsa_RemoveAccountRights(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RemoveAccountRights *r); -void ndr_print_lsa_QueryTrustedDomainInfoBySid(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfoBySid *r); -void ndr_print_lsa_SetTrustedDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetTrustedDomainInfo *r); -void ndr_print_lsa_DeleteTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_DeleteTrustedDomain *r); -void ndr_print_lsa_StorePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_StorePrivateData *r); -void ndr_print_lsa_RetrievePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RetrievePrivateData *r); -enum ndr_err_code ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy2 *r); -enum ndr_err_code ndr_pull_lsa_OpenPolicy2(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy2 *r); -void ndr_print_lsa_OpenPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy2 *r); -void ndr_print_lsa_GetUserName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetUserName *r); -void ndr_print_lsa_QueryInfoPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy2 *r); -void ndr_print_lsa_SetInfoPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInfoPolicy2 *r); -void ndr_print_lsa_QueryTrustedDomainInfoByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfoByName *r); -void ndr_print_lsa_SetTrustedDomainInfoByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetTrustedDomainInfoByName *r); -void ndr_print_lsa_EnumTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumTrustedDomainsEx *r); -void ndr_print_lsa_CreateTrustedDomainEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomainEx *r); -void ndr_print_lsa_CloseTrustedDomainEx(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CloseTrustedDomainEx *r); -void ndr_print_lsa_QueryDomainInformationPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryDomainInformationPolicy *r); -void ndr_print_lsa_SetDomainInformationPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetDomainInformationPolicy *r); -void ndr_print_lsa_OpenTrustedDomainByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomainByName *r); -void ndr_print_lsa_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct lsa_TestCall *r); -enum ndr_err_code ndr_push_lsa_LookupSids2(struct ndr_push *ndr, int flags, const struct lsa_LookupSids2 *r); -enum ndr_err_code ndr_pull_lsa_LookupSids2(struct ndr_pull *ndr, int flags, struct lsa_LookupSids2 *r); -void ndr_print_lsa_LookupSids2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids2 *r); -enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const struct lsa_LookupNames2 *r); -enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int flags, struct lsa_LookupNames2 *r); -void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames2 *r); -void ndr_print_lsa_CreateTrustedDomainEx2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomainEx2 *r); -void ndr_print_lsa_CREDRWRITE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRWRITE *r); -void ndr_print_lsa_CREDRREAD(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRREAD *r); -void ndr_print_lsa_CREDRENUMERATE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRENUMERATE *r); -void ndr_print_lsa_CREDRWRITEDOMAINCREDENTIALS(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRWRITEDOMAINCREDENTIALS *r); -void ndr_print_lsa_CREDRREADDOMAINCREDENTIALS(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRREADDOMAINCREDENTIALS *r); -void ndr_print_lsa_CREDRDELETE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRDELETE *r); -void ndr_print_lsa_CREDRGETTARGETINFO(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETTARGETINFO *r); -void ndr_print_lsa_CREDRPROFILELOADED(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRPROFILELOADED *r); -enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const struct lsa_LookupNames3 *r); -enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int flags, struct lsa_LookupNames3 *r); -void ndr_print_lsa_LookupNames3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames3 *r); -void ndr_print_lsa_CREDRGETSESSIONTYPES(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETSESSIONTYPES *r); -void ndr_print_lsa_LSARREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARREGISTERAUDITEVENT *r); -void ndr_print_lsa_LSARGENAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARGENAUDITEVENT *r); -void ndr_print_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARUNREGISTERAUDITEVENT *r); -void ndr_print_lsa_lsaRQueryForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct lsa_lsaRQueryForestTrustInformation *r); -void ndr_print_lsa_LSARSETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARSETFORESTTRUSTINFORMATION *r); -void ndr_print_lsa_CREDRRENAME(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRRENAME *r); -enum ndr_err_code ndr_push_lsa_LookupSids3(struct ndr_push *ndr, int flags, const struct lsa_LookupSids3 *r); -enum ndr_err_code ndr_pull_lsa_LookupSids3(struct ndr_pull *ndr, int flags, struct lsa_LookupSids3 *r); -void ndr_print_lsa_LookupSids3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids3 *r); -void ndr_print_lsa_LookupNames4(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames4 *r); -void ndr_print_lsa_LSAROPENPOLICYSCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSAROPENPOLICYSCE *r); -void ndr_print_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r); -void ndr_print_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r); -void ndr_print_lsa_LSARADTREPORTSECURITYEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARADTREPORTSECURITYEVENT *r); -#endif /* _HEADER_NDR_lsarpc */ diff --git a/source3/librpc/gen_ndr/ndr_misc.c b/source3/librpc/gen_ndr/ndr_misc.c deleted file mode 100644 index 971cbdac24..0000000000 --- a/source3/librpc/gen_ndr/ndr_misc.c +++ /dev/null @@ -1,134 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_misc.h" - -_PUBLIC_ enum ndr_err_code ndr_push_GUID(struct ndr_push *ndr, int ndr_flags, const struct GUID *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_low)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_mid)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_hi_and_version)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->node, 6)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_low)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_mid)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_hi_and_version)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->node, 6)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ size_t ndr_size_GUID(const struct GUID *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_GUID); -} - -_PUBLIC_ enum ndr_err_code ndr_push_ndr_syntax_id(struct ndr_push *ndr, int ndr_flags, const struct ndr_syntax_id *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->if_version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_ndr_syntax_id(struct ndr_pull *ndr, int ndr_flags, struct ndr_syntax_id *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->if_version)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ndr_syntax_id(struct ndr_print *ndr, const char *name, const struct ndr_syntax_id *r) -{ - ndr_print_struct(ndr, name, "ndr_syntax_id"); - ndr->depth++; - ndr_print_GUID(ndr, "uuid", &r->uuid); - ndr_print_uint32(ndr, "if_version", r->if_version); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->handle_type)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->handle_type)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r) -{ - ndr_print_struct(ndr, name, "policy_handle"); - ndr->depth++; - ndr_print_uint32(ndr, "handle_type", r->handle_type); - ndr_print_GUID(ndr, "uuid", &r->uuid); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r) -{ - const char *val = NULL; - - switch (r) { - case SEC_CHAN_NULL: val = "SEC_CHAN_NULL"; break; - case SEC_CHAN_WKSTA: val = "SEC_CHAN_WKSTA"; break; - case SEC_CHAN_DNS_DOMAIN: val = "SEC_CHAN_DNS_DOMAIN"; break; - case SEC_CHAN_DOMAIN: val = "SEC_CHAN_DOMAIN"; break; - case SEC_CHAN_BDC: val = "SEC_CHAN_BDC"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - diff --git a/source3/librpc/gen_ndr/ndr_misc.h b/source3/librpc/gen_ndr/ndr_misc.h deleted file mode 100644 index b907af0605..0000000000 --- a/source3/librpc/gen_ndr/ndr_misc.h +++ /dev/null @@ -1,23 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/misc.h" - -#ifndef _HEADER_NDR_misc -#define _HEADER_NDR_misc - -#define NDR_MISC_CALL_COUNT (0) -enum ndr_err_code ndr_push_GUID(struct ndr_push *ndr, int ndr_flags, const struct GUID *r); -enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r); -void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *r); -size_t ndr_size_GUID(const struct GUID *r, int flags); -enum ndr_err_code ndr_push_ndr_syntax_id(struct ndr_push *ndr, int ndr_flags, const struct ndr_syntax_id *r); -enum ndr_err_code ndr_pull_ndr_syntax_id(struct ndr_pull *ndr, int ndr_flags, struct ndr_syntax_id *r); -void ndr_print_ndr_syntax_id(struct ndr_print *ndr, const char *name, const struct ndr_syntax_id *r); -enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r); -enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r); -void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r); -enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r); -enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r); -void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r); -#endif /* _HEADER_NDR_misc */ diff --git a/source3/librpc/gen_ndr/ndr_named_pipe_auth.c b/source3/librpc/gen_ndr/ndr_named_pipe_auth.c deleted file mode 100644 index 69412bf427..0000000000 --- a/source3/librpc/gen_ndr/ndr_named_pipe_auth.c +++ /dev/null @@ -1,302 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_named_pipe_auth.h" - -#include "librpc/gen_ndr/ndr_netlogon.h" -static enum ndr_err_code ndr_push_named_pipe_auth_req_info(struct ndr_push *ndr, int ndr_flags, const union named_pipe_auth_req_info *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - break; } - - case 1: { - NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - break; - - case 1: - NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info1)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_named_pipe_auth_req_info(struct ndr_pull *ndr, int ndr_flags, union named_pipe_auth_req_info *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - break; } - - case 1: { - NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - break; - - case 1: - NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info1)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_named_pipe_auth_req_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_req_info *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "named_pipe_auth_req_info"); - switch (level) { - case 0: - break; - - case 1: - ndr_print_netr_SamInfo3(ndr, "info1", &r->info1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_req(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_req *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_uint32 = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_req(r, ndr->flags) - 4)); - ndr->flags = _flags_save_uint32; - } - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level)); - NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_req(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_req *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_uint32 = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - ndr->flags = _flags_save_uint32; - } - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, 4, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level)); - NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_named_pipe_auth_req(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req *r) -{ - ndr_print_struct(ndr, name, "named_pipe_auth_req"); - ndr->depth++; - ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_req(r, ndr->flags) - 4:r->length); - ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic); - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->info, r->level); - ndr_print_named_pipe_auth_req_info(ndr, "info", &r->info); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_named_pipe_auth_req(const struct named_pipe_auth_req *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_req); -} - -static enum ndr_err_code ndr_push_named_pipe_auth_rep_info(struct ndr_push *ndr, int ndr_flags, const union named_pipe_auth_rep_info *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - break; } - - case 1: { - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - break; - - case 1: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_named_pipe_auth_rep_info(struct ndr_pull *ndr, int ndr_flags, union named_pipe_auth_rep_info *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - break; } - - case 1: { - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - break; - - case 1: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_named_pipe_auth_rep_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_rep_info *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "named_pipe_auth_rep_info"); - switch (level) { - case 0: - break; - - case 1: - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_rep(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_rep *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_uint32 = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_rep(r, ndr->flags) - 4)); - ndr->flags = _flags_save_uint32; - } - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level)); - NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_rep(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_rep *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_uint32 = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - ndr->flags = _flags_save_uint32; - } - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, 4, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level)); - NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_named_pipe_auth_rep(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep *r) -{ - ndr_print_struct(ndr, name, "named_pipe_auth_rep"); - ndr->depth++; - ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_rep(r, ndr->flags) - 4:r->length); - ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic); - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->info, r->level); - ndr_print_named_pipe_auth_rep_info(ndr, "info", &r->info); - ndr_print_NTSTATUS(ndr, "status", r->status); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_named_pipe_auth_rep(const struct named_pipe_auth_rep *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_rep); -} - diff --git a/source3/librpc/gen_ndr/ndr_named_pipe_auth.h b/source3/librpc/gen_ndr/ndr_named_pipe_auth.h deleted file mode 100644 index fbef9d5f1c..0000000000 --- a/source3/librpc/gen_ndr/ndr_named_pipe_auth.h +++ /dev/null @@ -1,20 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/named_pipe_auth.h" - -#ifndef _HEADER_NDR_named_pipe_auth -#define _HEADER_NDR_named_pipe_auth - -#define NDR_NAMED_PIPE_AUTH_CALL_COUNT (0) -void ndr_print_named_pipe_auth_req_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_req_info *r); -enum ndr_err_code ndr_push_named_pipe_auth_req(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_req *r); -enum ndr_err_code ndr_pull_named_pipe_auth_req(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_req *r); -void ndr_print_named_pipe_auth_req(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req *r); -size_t ndr_size_named_pipe_auth_req(const struct named_pipe_auth_req *r, int flags); -void ndr_print_named_pipe_auth_rep_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_rep_info *r); -enum ndr_err_code ndr_push_named_pipe_auth_rep(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_rep *r); -enum ndr_err_code ndr_pull_named_pipe_auth_rep(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_rep *r); -void ndr_print_named_pipe_auth_rep(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep *r); -size_t ndr_size_named_pipe_auth_rep(const struct named_pipe_auth_rep *r, int flags); -#endif /* _HEADER_NDR_named_pipe_auth */ diff --git a/source3/librpc/gen_ndr/ndr_nbt.c b/source3/librpc/gen_ndr/ndr_nbt.c deleted file mode 100644 index c02b539da5..0000000000 --- a/source3/librpc/gen_ndr/ndr_nbt.c +++ /dev/null @@ -1,3364 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_nbt.h" - -#include "librpc/gen_ndr/ndr_misc.h" -#include "librpc/gen_ndr/ndr_security.h" -#include "librpc/gen_ndr/ndr_svcctl.h" -#include "librpc/gen_ndr/ndr_samr.h" -static enum ndr_err_code ndr_push_nbt_operation(struct ndr_push *ndr, int ndr_flags, uint16_t r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_operation(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r) -{ - ndr_print_uint16(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_RCODE", NBT_RCODE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_BROADCAST", NBT_FLAG_BROADCAST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_RECURSION_AVAIL", NBT_FLAG_RECURSION_AVAIL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_RECURSION_DESIRED", NBT_FLAG_RECURSION_DESIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_TRUNCATION", NBT_FLAG_TRUNCATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_AUTHORITIVE", NBT_FLAG_AUTHORITIVE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_OPCODE", NBT_OPCODE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_FLAG_REPLY", NBT_FLAG_REPLY, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_name_type(struct ndr_push *ndr, int ndr_flags, enum nbt_name_type r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_name_type(struct ndr_pull *ndr, int ndr_flags, enum nbt_name_type *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_name_type(struct ndr_print *ndr, const char *name, enum nbt_name_type r) -{ - const char *val = NULL; - - switch (r) { - case NBT_NAME_CLIENT: val = "NBT_NAME_CLIENT"; break; - case NBT_NAME_MS: val = "NBT_NAME_MS"; break; - case NBT_NAME_USER: val = "NBT_NAME_USER"; break; - case NBT_NAME_SERVER: val = "NBT_NAME_SERVER"; break; - case NBT_NAME_PDC: val = "NBT_NAME_PDC"; break; - case NBT_NAME_LOGON: val = "NBT_NAME_LOGON"; break; - case NBT_NAME_MASTER: val = "NBT_NAME_MASTER"; break; - case NBT_NAME_BROWSER: val = "NBT_NAME_BROWSER"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ void ndr_print_nbt_name(struct ndr_print *ndr, const char *name, const struct nbt_name *r) -{ - ndr_print_struct(ndr, name, "nbt_name"); - ndr->depth++; - ndr_print_string(ndr, "name", r->name); - ndr_print_string(ndr, "scope", r->scope); - ndr_print_nbt_name_type(ndr, "type", r->type); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_qclass(struct ndr_push *ndr, int ndr_flags, enum nbt_qclass r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_qclass(struct ndr_pull *ndr, int ndr_flags, enum nbt_qclass *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_qclass(struct ndr_print *ndr, const char *name, enum nbt_qclass r) -{ - const char *val = NULL; - - switch (r) { - case NBT_QCLASS_IP: val = "NBT_QCLASS_IP"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_qtype(struct ndr_push *ndr, int ndr_flags, enum nbt_qtype r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_qtype(struct ndr_pull *ndr, int ndr_flags, enum nbt_qtype *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_qtype(struct ndr_print *ndr, const char *name, enum nbt_qtype r) -{ - const char *val = NULL; - - switch (r) { - case NBT_QTYPE_ADDRESS: val = "NBT_QTYPE_ADDRESS"; break; - case NBT_QTYPE_NAMESERVICE: val = "NBT_QTYPE_NAMESERVICE"; break; - case NBT_QTYPE_NULL: val = "NBT_QTYPE_NULL"; break; - case NBT_QTYPE_NETBIOS: val = "NBT_QTYPE_NETBIOS"; break; - case NBT_QTYPE_STATUS: val = "NBT_QTYPE_STATUS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_nbt_name_question(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_question *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_push_nbt_qtype(ndr, NDR_SCALARS, r->question_type)); - NDR_CHECK(ndr_push_nbt_qclass(ndr, NDR_SCALARS, r->question_class)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_name_question(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_question *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_pull_nbt_qtype(ndr, NDR_SCALARS, &r->question_type)); - NDR_CHECK(ndr_pull_nbt_qclass(ndr, NDR_SCALARS, &r->question_class)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_name_question(struct ndr_print *ndr, const char *name, const struct nbt_name_question *r) -{ - ndr_print_struct(ndr, name, "nbt_name_question"); - ndr->depth++; - ndr_print_nbt_name(ndr, "name", &r->name); - ndr_print_nbt_qtype(ndr, "question_type", r->question_type); - ndr_print_nbt_qclass(ndr, "question_class", r->question_class); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nb_flags(struct ndr_push *ndr, int ndr_flags, uint16_t r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nb_flags(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nb_flags(struct ndr_print *ndr, const char *name, uint16_t r) -{ - ndr_print_uint16(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_PERMANENT", NBT_NM_PERMANENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_ACTIVE", NBT_NM_ACTIVE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_CONFLICT", NBT_NM_CONFLICT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_DEREGISTER", NBT_NM_DEREGISTER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_OWNER_TYPE", NBT_NM_OWNER_TYPE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NBT_NM_GROUP", NBT_NM_GROUP, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_rdata_address(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_address *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nb_flags(ndr, NDR_SCALARS, r->nb_flags)); - NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipaddr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_rdata_address(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_address *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nb_flags(ndr, NDR_SCALARS, &r->nb_flags)); - NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipaddr)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_rdata_address(struct ndr_print *ndr, const char *name, const struct nbt_rdata_address *r) -{ - ndr_print_struct(ndr, name, "nbt_rdata_address"); - ndr->depth++; - ndr_print_nb_flags(ndr, "nb_flags", r->nb_flags); - ndr_print_ipv4address(ndr, "ipaddr", r->ipaddr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_rdata_netbios(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_netbios *r) -{ - uint32_t cntr_addresses_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - for (cntr_addresses_0 = 0; cntr_addresses_0 < r->length / 6; cntr_addresses_0++) { - NDR_CHECK(ndr_push_nbt_rdata_address(ndr, NDR_SCALARS, &r->addresses[cntr_addresses_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_rdata_netbios(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_netbios *r) -{ - uint32_t cntr_addresses_0; - TALLOC_CTX *_mem_save_addresses_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_PULL_ALLOC_N(ndr, r->addresses, r->length / 6); - _mem_save_addresses_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->addresses, 0); - for (cntr_addresses_0 = 0; cntr_addresses_0 < r->length / 6; cntr_addresses_0++) { - NDR_CHECK(ndr_pull_nbt_rdata_address(ndr, NDR_SCALARS, &r->addresses[cntr_addresses_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_rdata_netbios(struct ndr_print *ndr, const char *name, const struct nbt_rdata_netbios *r) -{ - uint32_t cntr_addresses_0; - ndr_print_struct(ndr, name, "nbt_rdata_netbios"); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->length / 6); - ndr->depth++; - for (cntr_addresses_0=0;cntr_addresses_0length / 6;cntr_addresses_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_addresses_0) != -1) { - ndr_print_nbt_rdata_address(ndr, "addresses", &r->addresses[cntr_addresses_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_statistics(struct ndr_push *ndr, int ndr_flags, const struct nbt_statistics *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->unit_id, 6)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->jumpers)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->test_result)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version_number)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->period_of_statistics)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_of_crcs)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_alignment_errors)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_of_collisions)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_send_aborts)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_good_sends)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_good_receives)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_retransmits)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_no_resource_conditions)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_free_command_blocks)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_number_command_blocks)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_total_number_command_blocks)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->number_pending_sessions)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_number_pending_sessions)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_total_sessions_possible)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->session_data_packet_size)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_statistics(struct ndr_pull *ndr, int ndr_flags, struct nbt_statistics *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->unit_id, 6)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->jumpers)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->test_result)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version_number)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->period_of_statistics)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_of_crcs)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_alignment_errors)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_of_collisions)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_send_aborts)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_good_sends)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_good_receives)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_retransmits)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_no_resource_conditions)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_free_command_blocks)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_number_command_blocks)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_total_number_command_blocks)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->number_pending_sessions)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_number_pending_sessions)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_total_sessions_possible)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->session_data_packet_size)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_statistics(struct ndr_print *ndr, const char *name, const struct nbt_statistics *r) -{ - ndr_print_struct(ndr, name, "nbt_statistics"); - ndr->depth++; - ndr_print_array_uint8(ndr, "unit_id", r->unit_id, 6); - ndr_print_uint8(ndr, "jumpers", r->jumpers); - ndr_print_uint8(ndr, "test_result", r->test_result); - ndr_print_uint16(ndr, "version_number", r->version_number); - ndr_print_uint16(ndr, "period_of_statistics", r->period_of_statistics); - ndr_print_uint16(ndr, "number_of_crcs", r->number_of_crcs); - ndr_print_uint16(ndr, "number_alignment_errors", r->number_alignment_errors); - ndr_print_uint16(ndr, "number_of_collisions", r->number_of_collisions); - ndr_print_uint16(ndr, "number_send_aborts", r->number_send_aborts); - ndr_print_uint32(ndr, "number_good_sends", r->number_good_sends); - ndr_print_uint32(ndr, "number_good_receives", r->number_good_receives); - ndr_print_uint16(ndr, "number_retransmits", r->number_retransmits); - ndr_print_uint16(ndr, "number_no_resource_conditions", r->number_no_resource_conditions); - ndr_print_uint16(ndr, "number_free_command_blocks", r->number_free_command_blocks); - ndr_print_uint16(ndr, "total_number_command_blocks", r->total_number_command_blocks); - ndr_print_uint16(ndr, "max_total_number_command_blocks", r->max_total_number_command_blocks); - ndr_print_uint16(ndr, "number_pending_sessions", r->number_pending_sessions); - ndr_print_uint16(ndr, "max_number_pending_sessions", r->max_number_pending_sessions); - ndr_print_uint16(ndr, "max_total_sessions_possible", r->max_total_sessions_possible); - ndr_print_uint16(ndr, "session_data_packet_size", r->session_data_packet_size); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_status_name(struct ndr_push *ndr, int ndr_flags, const struct nbt_status_name *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, 15, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_push_nbt_name_type(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_nb_flags(ndr, NDR_SCALARS, r->nb_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_status_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_status_name *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, 15, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_pull_nbt_name_type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_nb_flags(ndr, NDR_SCALARS, &r->nb_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_status_name(struct ndr_print *ndr, const char *name, const struct nbt_status_name *r) -{ - ndr_print_struct(ndr, name, "nbt_status_name"); - ndr->depth++; - ndr_print_string(ndr, "name", r->name); - ndr_print_nbt_name_type(ndr, "type", r->type); - ndr_print_nb_flags(ndr, "nb_flags", r->nb_flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_rdata_status(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_status *r) -{ - uint32_t cntr_names_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_names * 18 + 47)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->num_names)); - for (cntr_names_0 = 0; cntr_names_0 < r->num_names; cntr_names_0++) { - NDR_CHECK(ndr_push_nbt_status_name(ndr, NDR_SCALARS, &r->names[cntr_names_0])); - } - NDR_CHECK(ndr_push_nbt_statistics(ndr, NDR_SCALARS, &r->statistics)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_rdata_status(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_status *r) -{ - uint32_t cntr_names_0; - TALLOC_CTX *_mem_save_names_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->num_names)); - NDR_PULL_ALLOC_N(ndr, r->names, r->num_names); - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->names, 0); - for (cntr_names_0 = 0; cntr_names_0 < r->num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_nbt_status_name(ndr, NDR_SCALARS, &r->names[cntr_names_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - NDR_CHECK(ndr_pull_nbt_statistics(ndr, NDR_SCALARS, &r->statistics)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_rdata_status(struct ndr_print *ndr, const char *name, const struct nbt_rdata_status *r) -{ - uint32_t cntr_names_0; - ndr_print_struct(ndr, name, "nbt_rdata_status"); - ndr->depth++; - ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->num_names * 18 + 47:r->length); - ndr_print_uint8(ndr, "num_names", r->num_names); - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->num_names); - ndr->depth++; - for (cntr_names_0=0;cntr_names_0num_names;cntr_names_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { - ndr_print_nbt_status_name(ndr, "names", &r->names[cntr_names_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_nbt_statistics(ndr, "statistics", &r->statistics); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_rdata_data(struct ndr_push *ndr, int ndr_flags, const struct nbt_rdata_data *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_rdata_data(struct ndr_pull *ndr, int ndr_flags, struct nbt_rdata_data *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_PULL_ALLOC_N(ndr, r->data, r->length); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const struct nbt_rdata_data *r) -{ - ndr_print_struct(ndr, name, "nbt_rdata_data"); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr_print_array_uint8(ndr, "data", r->data, r->length); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_rdata(struct ndr_push *ndr, int ndr_flags, const union nbt_rdata *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NBT_QTYPE_NETBIOS: { - NDR_CHECK(ndr_push_nbt_rdata_netbios(ndr, NDR_SCALARS, &r->netbios)); - break; } - - case NBT_QTYPE_STATUS: { - NDR_CHECK(ndr_push_nbt_rdata_status(ndr, NDR_SCALARS, &r->status)); - break; } - - default: { - NDR_CHECK(ndr_push_nbt_rdata_data(ndr, NDR_SCALARS, &r->data)); - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NBT_QTYPE_NETBIOS: - break; - - case NBT_QTYPE_STATUS: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_rdata(struct ndr_pull *ndr, int ndr_flags, union nbt_rdata *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case NBT_QTYPE_NETBIOS: { - NDR_CHECK(ndr_pull_nbt_rdata_netbios(ndr, NDR_SCALARS, &r->netbios)); - break; } - - case NBT_QTYPE_STATUS: { - NDR_CHECK(ndr_pull_nbt_rdata_status(ndr, NDR_SCALARS, &r->status)); - break; } - - default: { - NDR_CHECK(ndr_pull_nbt_rdata_data(ndr, NDR_SCALARS, &r->data)); - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case NBT_QTYPE_NETBIOS: - break; - - case NBT_QTYPE_STATUS: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "nbt_rdata"); - switch (level) { - case NBT_QTYPE_NETBIOS: - ndr_print_nbt_rdata_netbios(ndr, "netbios", &r->netbios); - break; - - case NBT_QTYPE_STATUS: - ndr_print_nbt_rdata_status(ndr, "status", &r->status); - break; - - default: - ndr_print_nbt_rdata_data(ndr, "data", &r->data); - break; - - } -} - -static enum ndr_err_code ndr_pull_nbt_res_rec(struct ndr_pull *ndr, int ndr_flags, struct nbt_res_rec *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_pull_nbt_qtype(ndr, NDR_SCALARS, &r->rr_type)); - NDR_CHECK(ndr_pull_nbt_qclass(ndr, NDR_SCALARS, &r->rr_class)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ttl)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->rdata, r->rr_type)); - NDR_CHECK(ndr_pull_nbt_rdata(ndr, NDR_SCALARS, &r->rdata)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r) -{ - ndr_print_struct(ndr, name, "nbt_res_rec"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_nbt_name(ndr, "name", &r->name); - ndr_print_nbt_qtype(ndr, "rr_type", r->rr_type); - ndr_print_nbt_qclass(ndr, "rr_class", r->rr_class); - ndr_print_uint32(ndr, "ttl", r->ttl); - ndr_print_set_switch_value(ndr, &r->rdata, r->rr_type); - ndr_print_nbt_rdata(ndr, "rdata", &r->rdata); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r) -{ - uint32_t cntr_questions_0; - uint32_t cntr_answers_0; - uint32_t cntr_nsrecs_0; - uint32_t cntr_additional_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->name_trn_id)); - NDR_CHECK(ndr_push_nbt_operation(ndr, NDR_SCALARS, r->operation)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->qdcount)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ancount)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nscount)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->arcount)); - for (cntr_questions_0 = 0; cntr_questions_0 < r->qdcount; cntr_questions_0++) { - NDR_CHECK(ndr_push_nbt_name_question(ndr, NDR_SCALARS, &r->questions[cntr_questions_0])); - } - for (cntr_answers_0 = 0; cntr_answers_0 < r->ancount; cntr_answers_0++) { - NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->answers[cntr_answers_0])); - } - for (cntr_nsrecs_0 = 0; cntr_nsrecs_0 < r->nscount; cntr_nsrecs_0++) { - NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->nsrecs[cntr_nsrecs_0])); - } - for (cntr_additional_0 = 0; cntr_additional_0 < r->arcount; cntr_additional_0++) { - NDR_CHECK(ndr_push_nbt_res_rec(ndr, NDR_SCALARS, &r->additional[cntr_additional_0])); - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->padding)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r) -{ - uint32_t cntr_questions_0; - TALLOC_CTX *_mem_save_questions_0; - uint32_t cntr_answers_0; - TALLOC_CTX *_mem_save_answers_0; - uint32_t cntr_nsrecs_0; - TALLOC_CTX *_mem_save_nsrecs_0; - uint32_t cntr_additional_0; - TALLOC_CTX *_mem_save_additional_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_trn_id)); - NDR_CHECK(ndr_pull_nbt_operation(ndr, NDR_SCALARS, &r->operation)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->qdcount)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ancount)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nscount)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->arcount)); - NDR_PULL_ALLOC_N(ndr, r->questions, r->qdcount); - _mem_save_questions_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->questions, 0); - for (cntr_questions_0 = 0; cntr_questions_0 < r->qdcount; cntr_questions_0++) { - NDR_CHECK(ndr_pull_nbt_name_question(ndr, NDR_SCALARS, &r->questions[cntr_questions_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_questions_0, 0); - NDR_PULL_ALLOC_N(ndr, r->answers, r->ancount); - _mem_save_answers_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->answers, 0); - for (cntr_answers_0 = 0; cntr_answers_0 < r->ancount; cntr_answers_0++) { - NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->answers[cntr_answers_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_answers_0, 0); - NDR_PULL_ALLOC_N(ndr, r->nsrecs, r->nscount); - _mem_save_nsrecs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->nsrecs, 0); - for (cntr_nsrecs_0 = 0; cntr_nsrecs_0 < r->nscount; cntr_nsrecs_0++) { - NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->nsrecs[cntr_nsrecs_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nsrecs_0, 0); - NDR_PULL_ALLOC_N(ndr, r->additional, r->arcount); - _mem_save_additional_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->additional, 0); - for (cntr_additional_0 = 0; cntr_additional_0 < r->arcount; cntr_additional_0++) { - NDR_CHECK(ndr_pull_nbt_res_rec(ndr, NDR_SCALARS, &r->additional[cntr_additional_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_additional_0, 0); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->padding)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_name_packet(struct ndr_print *ndr, const char *name, const struct nbt_name_packet *r) -{ - uint32_t cntr_questions_0; - uint32_t cntr_answers_0; - uint32_t cntr_nsrecs_0; - uint32_t cntr_additional_0; - ndr_print_struct(ndr, name, "nbt_name_packet"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint16(ndr, "name_trn_id", r->name_trn_id); - ndr_print_nbt_operation(ndr, "operation", r->operation); - ndr_print_uint16(ndr, "qdcount", r->qdcount); - ndr_print_uint16(ndr, "ancount", r->ancount); - ndr_print_uint16(ndr, "nscount", r->nscount); - ndr_print_uint16(ndr, "arcount", r->arcount); - ndr->print(ndr, "%s: ARRAY(%d)", "questions", (int)r->qdcount); - ndr->depth++; - for (cntr_questions_0=0;cntr_questions_0qdcount;cntr_questions_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_questions_0) != -1) { - ndr_print_nbt_name_question(ndr, "questions", &r->questions[cntr_questions_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "answers", (int)r->ancount); - ndr->depth++; - for (cntr_answers_0=0;cntr_answers_0ancount;cntr_answers_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_answers_0) != -1) { - ndr_print_nbt_res_rec(ndr, "answers", &r->answers[cntr_answers_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "nsrecs", (int)r->nscount); - ndr->depth++; - for (cntr_nsrecs_0=0;cntr_nsrecs_0nscount;cntr_nsrecs_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_nsrecs_0) != -1) { - ndr_print_nbt_res_rec(ndr, "nsrecs", &r->nsrecs[cntr_nsrecs_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "additional", (int)r->arcount); - ndr->depth++; - for (cntr_additional_0=0;cntr_additional_0arcount;cntr_additional_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_additional_0) != -1) { - ndr_print_nbt_res_rec(ndr, "additional", &r->additional[cntr_additional_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_DATA_BLOB(ndr, "padding", r->padding); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_dgram_msg_type(struct ndr_push *ndr, int ndr_flags, enum dgram_msg_type r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dgram_msg_type(struct ndr_pull *ndr, int ndr_flags, enum dgram_msg_type *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dgram_msg_type(struct ndr_print *ndr, const char *name, enum dgram_msg_type r) -{ - const char *val = NULL; - - switch (r) { - case DGRAM_DIRECT_UNIQUE: val = "DGRAM_DIRECT_UNIQUE"; break; - case DGRAM_DIRECT_GROUP: val = "DGRAM_DIRECT_GROUP"; break; - case DGRAM_BCAST: val = "DGRAM_BCAST"; break; - case DGRAM_ERROR: val = "DGRAM_ERROR"; break; - case DGRAM_QUERY: val = "DGRAM_QUERY"; break; - case DGRAM_QUERY_POSITIVE: val = "DGRAM_QUERY_POSITIVE"; break; - case DGRAM_QUERY_NEGATIVE: val = "DGRAM_QUERY_NEGATIVE"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dgram_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dgram_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dgram_flags(struct ndr_print *ndr, const char *name, uint8_t r) -{ - ndr_print_uint8(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_MORE", DGRAM_FLAG_MORE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_FIRST", DGRAM_FLAG_FIRST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "DGRAM_FLAG_NODE_TYPE", DGRAM_FLAG_NODE_TYPE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_smb_command(struct ndr_push *ndr, int ndr_flags, enum smb_command r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_smb_command(struct ndr_pull *ndr, int ndr_flags, enum smb_command *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_smb_command(struct ndr_print *ndr, const char *name, enum smb_command r) -{ - const char *val = NULL; - - switch (r) { - case SMB_TRANSACTION: val = "SMB_TRANSACTION"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_smb_trans_body(struct ndr_push *ndr, int ndr_flags, const struct smb_trans_body *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 17)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_param_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->total_data_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_param_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->max_data_count)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->max_setup_count)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->trans_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timeout)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->param_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->param_offset)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data_offset)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 3)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->opcode)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->priority)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->_class)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->mailslot_name) + 1 + r->data.length)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_smb_trans_body(struct ndr_pull *ndr, int ndr_flags, struct smb_trans_body *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->wct)); - if (r->wct < 17 || r->wct > 17) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_param_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->total_data_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_param_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->max_data_count)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->max_setup_count)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->trans_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timeout)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->param_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->param_offset)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_offset)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->setup_count)); - if (r->setup_count < 3 || r->setup_count > 3) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->opcode)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->priority)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->_class)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->byte_count)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_smb_trans_body(struct ndr_print *ndr, const char *name, const struct smb_trans_body *r) -{ - ndr_print_struct(ndr, name, "smb_trans_body"); - ndr->depth++; - ndr_print_uint8(ndr, "wct", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?17:r->wct); - ndr_print_uint16(ndr, "total_param_count", r->total_param_count); - ndr_print_uint16(ndr, "total_data_count", r->total_data_count); - ndr_print_uint16(ndr, "max_param_count", r->max_param_count); - ndr_print_uint16(ndr, "max_data_count", r->max_data_count); - ndr_print_uint8(ndr, "max_setup_count", r->max_setup_count); - ndr_print_uint8(ndr, "pad", r->pad); - ndr_print_uint16(ndr, "trans_flags", r->trans_flags); - ndr_print_uint32(ndr, "timeout", r->timeout); - ndr_print_uint16(ndr, "reserved", r->reserved); - ndr_print_uint16(ndr, "param_count", r->param_count); - ndr_print_uint16(ndr, "param_offset", r->param_offset); - ndr_print_uint16(ndr, "data_count", r->data_count); - ndr_print_uint16(ndr, "data_offset", r->data_offset); - ndr_print_uint8(ndr, "setup_count", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?3:r->setup_count); - ndr_print_uint8(ndr, "pad2", r->pad2); - ndr_print_uint16(ndr, "opcode", r->opcode); - ndr_print_uint16(ndr, "priority", r->priority); - ndr_print_uint16(ndr, "_class", r->_class); - ndr_print_uint16(ndr, "byte_count", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->mailslot_name) + 1 + r->data.length:r->byte_count); - ndr_print_string(ndr, "mailslot_name", r->mailslot_name); - ndr_print_DATA_BLOB(ndr, "data", r->data); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_smb_body(struct ndr_push *ndr, int ndr_flags, const union smb_body *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case SMB_TRANSACTION: { - NDR_CHECK(ndr_push_smb_trans_body(ndr, NDR_SCALARS, &r->trans)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case SMB_TRANSACTION: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_smb_body(struct ndr_pull *ndr, int ndr_flags, union smb_body *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SMB_TRANSACTION: { - NDR_CHECK(ndr_pull_smb_trans_body(ndr, NDR_SCALARS, &r->trans)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SMB_TRANSACTION: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_smb_body(struct ndr_print *ndr, const char *name, const union smb_body *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "smb_body"); - switch (level) { - case SMB_TRANSACTION: - ndr_print_smb_trans_body(ndr, "trans", &r->trans); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_dgram_smb_packet(struct ndr_push *ndr, int ndr_flags, const struct dgram_smb_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_smb_command(ndr, NDR_SCALARS, r->smb_command)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->err_class)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pad)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->err_code)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->flags2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->pid_high)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->signature, 8)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->tid)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->pid)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->vuid)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->mid)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->body, r->smb_command)); - NDR_CHECK(ndr_push_smb_body(ndr, NDR_SCALARS, &r->body)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_dgram_smb_packet(struct ndr_pull *ndr, int ndr_flags, struct dgram_smb_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_smb_command(ndr, NDR_SCALARS, &r->smb_command)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->err_class)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pad)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->err_code)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->pid_high)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->signature, 8)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->tid)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->pid)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->vuid)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->mid)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->body, r->smb_command)); - NDR_CHECK(ndr_pull_smb_body(ndr, NDR_SCALARS, &r->body)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dgram_smb_packet(struct ndr_print *ndr, const char *name, const struct dgram_smb_packet *r) -{ - ndr_print_struct(ndr, name, "dgram_smb_packet"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_smb_command(ndr, "smb_command", r->smb_command); - ndr_print_uint8(ndr, "err_class", r->err_class); - ndr_print_uint8(ndr, "pad", r->pad); - ndr_print_uint16(ndr, "err_code", r->err_code); - ndr_print_uint8(ndr, "flags", r->flags); - ndr_print_uint16(ndr, "flags2", r->flags2); - ndr_print_uint16(ndr, "pid_high", r->pid_high); - ndr_print_array_uint8(ndr, "signature", r->signature, 8); - ndr_print_uint16(ndr, "reserved", r->reserved); - ndr_print_uint16(ndr, "tid", r->tid); - ndr_print_uint16(ndr, "pid", r->pid); - ndr_print_uint16(ndr, "vuid", r->vuid); - ndr_print_uint16(ndr, "mid", r->mid); - ndr_print_set_switch_value(ndr, &r->body, r->smb_command); - ndr_print_smb_body(ndr, "body", &r->body); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_dgram_message_body(struct ndr_push *ndr, int ndr_flags, const union dgram_message_body *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case DGRAM_SMB: { - NDR_CHECK(ndr_push_dgram_smb_packet(ndr, NDR_SCALARS, &r->smb)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case DGRAM_SMB: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dgram_message_body(struct ndr_pull *ndr, int ndr_flags, union dgram_message_body *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case DGRAM_SMB: { - NDR_CHECK(ndr_pull_dgram_smb_packet(ndr, NDR_SCALARS, &r->smb)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case DGRAM_SMB: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dgram_message_body(struct ndr_print *ndr, const char *name, const union dgram_message_body *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "dgram_message_body"); - switch (level) { - case DGRAM_SMB: - ndr_print_dgram_smb_packet(ndr, "smb", &r->smb); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_dgram_message(struct ndr_push *ndr, int ndr_flags, const struct dgram_message *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->offset)); - NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->source_name)); - NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dgram_body_type)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->body, r->dgram_body_type)); - NDR_CHECK(ndr_push_dgram_message_body(ndr, NDR_SCALARS, &r->body)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dgram_message(struct ndr_pull *ndr, int ndr_flags, struct dgram_message *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->offset)); - NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->source_name)); - NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dgram_body_type)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->body, r->dgram_body_type)); - NDR_CHECK(ndr_pull_dgram_message_body(ndr, NDR_SCALARS, &r->body)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dgram_message(struct ndr_print *ndr, const char *name, const struct dgram_message *r) -{ - ndr_print_struct(ndr, name, "dgram_message"); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr_print_uint16(ndr, "offset", r->offset); - ndr_print_nbt_name(ndr, "source_name", &r->source_name); - ndr_print_nbt_name(ndr, "dest_name", &r->dest_name); - ndr_print_uint32(ndr, "dgram_body_type", r->dgram_body_type); - ndr_print_set_switch_value(ndr, &r->body, r->dgram_body_type); - ndr_print_dgram_message_body(ndr, "body", &r->body); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_dgram_err_code(struct ndr_push *ndr, int ndr_flags, enum dgram_err_code r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dgram_err_code(struct ndr_pull *ndr, int ndr_flags, enum dgram_err_code *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dgram_err_code(struct ndr_print *ndr, const char *name, enum dgram_err_code r) -{ - const char *val = NULL; - - switch (r) { - case DGRAM_ERROR_NAME_NOT_PRESENT: val = "DGRAM_ERROR_NAME_NOT_PRESENT"; break; - case DGRAM_ERROR_INVALID_SOURCE: val = "DGRAM_ERROR_INVALID_SOURCE"; break; - case DGRAM_ERROR_INVALID_DEST: val = "DGRAM_ERROR_INVALID_DEST"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_dgram_data(struct ndr_push *ndr, int ndr_flags, const union dgram_data *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case DGRAM_DIRECT_UNIQUE: { - NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg)); - break; } - - case DGRAM_DIRECT_GROUP: { - NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg)); - break; } - - case DGRAM_BCAST: { - NDR_CHECK(ndr_push_dgram_message(ndr, NDR_SCALARS, &r->msg)); - break; } - - case DGRAM_ERROR: { - NDR_CHECK(ndr_push_dgram_err_code(ndr, NDR_SCALARS, r->error)); - break; } - - case DGRAM_QUERY: { - NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); - break; } - - case DGRAM_QUERY_POSITIVE: { - NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); - break; } - - case DGRAM_QUERY_NEGATIVE: { - NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case DGRAM_DIRECT_UNIQUE: - break; - - case DGRAM_DIRECT_GROUP: - break; - - case DGRAM_BCAST: - break; - - case DGRAM_ERROR: - break; - - case DGRAM_QUERY: - break; - - case DGRAM_QUERY_POSITIVE: - break; - - case DGRAM_QUERY_NEGATIVE: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_dgram_data(struct ndr_pull *ndr, int ndr_flags, union dgram_data *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case DGRAM_DIRECT_UNIQUE: { - NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg)); - break; } - - case DGRAM_DIRECT_GROUP: { - NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg)); - break; } - - case DGRAM_BCAST: { - NDR_CHECK(ndr_pull_dgram_message(ndr, NDR_SCALARS, &r->msg)); - break; } - - case DGRAM_ERROR: { - NDR_CHECK(ndr_pull_dgram_err_code(ndr, NDR_SCALARS, &r->error)); - break; } - - case DGRAM_QUERY: { - NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); - break; } - - case DGRAM_QUERY_POSITIVE: { - NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); - break; } - - case DGRAM_QUERY_NEGATIVE: { - NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->dest_name)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case DGRAM_DIRECT_UNIQUE: - break; - - case DGRAM_DIRECT_GROUP: - break; - - case DGRAM_BCAST: - break; - - case DGRAM_ERROR: - break; - - case DGRAM_QUERY: - break; - - case DGRAM_QUERY_POSITIVE: - break; - - case DGRAM_QUERY_NEGATIVE: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union dgram_data *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "dgram_data"); - switch (level) { - case DGRAM_DIRECT_UNIQUE: - ndr_print_dgram_message(ndr, "msg", &r->msg); - break; - - case DGRAM_DIRECT_GROUP: - ndr_print_dgram_message(ndr, "msg", &r->msg); - break; - - case DGRAM_BCAST: - ndr_print_dgram_message(ndr, "msg", &r->msg); - break; - - case DGRAM_ERROR: - ndr_print_dgram_err_code(ndr, "error", r->error); - break; - - case DGRAM_QUERY: - ndr_print_nbt_name(ndr, "dest_name", &r->dest_name); - break; - - case DGRAM_QUERY_POSITIVE: - ndr_print_nbt_name(ndr, "dest_name", &r->dest_name); - break; - - case DGRAM_QUERY_NEGATIVE: - ndr_print_nbt_name(ndr, "dest_name", &r->dest_name); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dgram_msg_type(ndr, NDR_SCALARS, r->msg_type)); - NDR_CHECK(ndr_push_dgram_flags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->dgram_id)); - NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->src_addr)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->src_port)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->data, r->msg_type)); - NDR_CHECK(ndr_push_dgram_data(ndr, NDR_SCALARS, &r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dgram_msg_type(ndr, NDR_SCALARS, &r->msg_type)); - NDR_CHECK(ndr_pull_dgram_flags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->dgram_id)); - NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->src_addr)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->src_port)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->data, r->msg_type)); - NDR_CHECK(ndr_pull_dgram_data(ndr, NDR_SCALARS, &r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r) -{ - ndr_print_struct(ndr, name, "nbt_dgram_packet"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_dgram_msg_type(ndr, "msg_type", r->msg_type); - ndr_print_dgram_flags(ndr, "flags", r->flags); - ndr_print_uint16(ndr, "dgram_id", r->dgram_id); - ndr_print_ipv4address(ndr, "src_addr", r->src_addr); - ndr_print_uint16(ndr, "src_port", r->src_port); - ndr_print_set_switch_value(ndr, &r->data, r->msg_type); - ndr_print_dgram_data(ndr, "data", &r->data); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_sockaddr(struct ndr_push *ndr, int ndr_flags, const struct nbt_sockaddr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sockaddr_family)); - { - uint32_t _flags_save_ipv4address = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip)); - ndr->flags = _flags_save_ipv4address; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_sockaddr(struct ndr_pull *ndr, int ndr_flags, struct nbt_sockaddr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sockaddr_family)); - { - uint32_t _flags_save_ipv4address = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN); - NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip)); - ndr->flags = _flags_save_ipv4address; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_sockaddr(struct ndr_print *ndr, const char *name, const struct nbt_sockaddr *r) -{ - ndr_print_struct(ndr, name, "nbt_sockaddr"); - ndr->depth++; - ndr_print_uint32(ndr, "sockaddr_family", r->sockaddr_family); - ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip); - ndr_print_DATA_BLOB(ndr, "remaining", r->remaining); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_nbt_sockaddr(const struct nbt_sockaddr *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_nbt_sockaddr); -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_server_type(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_server_type(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_PDC", NBT_SERVER_PDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GC", NBT_SERVER_GC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_LDAP", NBT_SERVER_LDAP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_DS", NBT_SERVER_DS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_KDC", NBT_SERVER_KDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_TIMESERV", NBT_SERVER_TIMESERV, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_CLOSEST", NBT_SERVER_CLOSEST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_WRITABLE", NBT_SERVER_WRITABLE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_GOOD_TIMESERV", NBT_SERVER_GOOD_TIMESERV, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_NDNC", NBT_SERVER_NDNC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_SELECT_SECRET_DOMAIN_6", NBT_SERVER_SELECT_SECRET_DOMAIN_6, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NBT_SERVER_FULL_SECRET_DOMAIN_6", NBT_SERVER_FULL_SECRET_DOMAIN_6, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netlogon_nt_version_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netlogon_nt_version_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netlogon_nt_version_flags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_1", NETLOGON_NT_VERSION_1, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5", NETLOGON_NT_VERSION_5, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX", NETLOGON_NT_VERSION_5EX, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_5EX_WITH_IP", NETLOGON_NT_VERSION_5EX_WITH_IP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", NETLOGON_NT_VERSION_WITH_CLOSEST_SITE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_AVIOD_NT4EMUL", NETLOGON_NT_VERSION_AVIOD_NT4EMUL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_PDC", NETLOGON_NT_VERSION_PDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_IP", NETLOGON_NT_VERSION_IP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_LOCAL", NETLOGON_NT_VERSION_LOCAL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NT_VERSION_GC", NETLOGON_NT_VERSION_GC, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netlogon_command(struct ndr_push *ndr, int ndr_flags, enum netlogon_command r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netlogon_command(struct ndr_pull *ndr, int ndr_flags, enum netlogon_command *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netlogon_command(struct ndr_print *ndr, const char *name, enum netlogon_command r) -{ - const char *val = NULL; - - switch (r) { - case LOGON_PRIMARY_QUERY: val = "LOGON_PRIMARY_QUERY"; break; - case NETLOGON_ANNOUNCE_UAS: val = "NETLOGON_ANNOUNCE_UAS"; break; - case NETLOGON_RESPONSE_FROM_PDC: val = "NETLOGON_RESPONSE_FROM_PDC"; break; - case LOGON_SAM_LOGON_REQUEST: val = "LOGON_SAM_LOGON_REQUEST"; break; - case LOGON_SAM_LOGON_RESPONSE: val = "LOGON_SAM_LOGON_RESPONSE"; break; - case LOGON_SAM_LOGON_PAUSE_RESPONSE: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE"; break; - case LOGON_SAM_LOGON_USER_UNKNOWN: val = "LOGON_SAM_LOGON_USER_UNKNOWN"; break; - case LOGON_SAM_LOGON_RESPONSE_EX: val = "LOGON_SAM_LOGON_RESPONSE_EX"; break; - case LOGON_SAM_LOGON_PAUSE_RESPONSE_EX: val = "LOGON_SAM_LOGON_PAUSE_RESPONSE_EX"; break; - case LOGON_SAM_LOGON_USER_UNKNOWN_EX: val = "LOGON_SAM_LOGON_USER_UNKNOWN_EX"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_REQUEST(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_REQUEST *r) -{ - ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_REQUEST"); - ndr->depth++; - ndr_print_uint16(ndr, "request_count", r->request_count); - ndr_print_string(ndr, "computer_name", r->computer_name); - ndr_print_string(ndr, "user_name", r->user_name); - ndr_print_string(ndr, "mailslot_name", r->mailslot_name); - ndr_print_samr_AcctFlags(ndr, "acct_control", r->acct_control); - ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size); - ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); - ndr_print_dom_sid0(ndr, "sid", &r->sid); - ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r) -{ - ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_NT40"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - ndr->depth++; - ndr_print_netlogon_command(ndr, "command", r->command); - ndr_print_string(ndr, "server", r->server); - ndr_print_string(ndr, "user_name", r->user_name); - ndr_print_string(ndr, "domain", r->domain); - ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->zero_uuid)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); - NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->pdc_ip)); - NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->zero_uuid)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); - NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->pdc_ip)); - NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE *r) -{ - ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - ndr->depth++; - ndr_print_netlogon_command(ndr, "command", r->command); - ndr_print_string(ndr, "pdc_name", r->pdc_name); - ndr_print_string(ndr, "user_name", r->user_name); - ndr_print_string(ndr, "domain_name", r->domain_name); - ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); - ndr_print_GUID(ndr, "zero_uuid", &r->zero_uuid); - ndr_print_nbt_string(ndr, "forest", r->forest); - ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); - ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); - ndr_print_ipv4address(ndr, "pdc_ip", r->pdc_ip); - ndr_print_nbt_server_type(ndr, "server_type", r->server_type); - ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz)); - NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site)); - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); - { - struct ndr_push *_ndr_sockaddr; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); - NDR_CHECK(ndr_push_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); - } - NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->next_closest_site)); - NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz)); - NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site)); - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sockaddr_size)); - { - struct ndr_pull *_ndr_sockaddr; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sockaddr, 0, r->sockaddr_size)); - NDR_CHECK(ndr_pull_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS, &r->sockaddr)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sockaddr, 0, r->sockaddr_size)); - } - NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->next_closest_site)); - NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r) -{ - ndr_print_struct(ndr, name, "NETLOGON_SAM_LOGON_RESPONSE_EX"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - ndr->depth++; - ndr_print_netlogon_command(ndr, "command", r->command); - ndr_print_uint16(ndr, "sbz", r->sbz); - ndr_print_nbt_server_type(ndr, "server_type", r->server_type); - ndr_print_GUID(ndr, "domain_uuid", &r->domain_uuid); - ndr_print_nbt_string(ndr, "forest", r->forest); - ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain); - ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name); - ndr_print_nbt_string(ndr, "domain", r->domain); - ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name); - ndr_print_nbt_string(ndr, "user_name", r->user_name); - ndr_print_nbt_string(ndr, "server_site", r->server_site); - ndr_print_nbt_string(ndr, "client_site", r->client_site); - ndr_print_uint8(ndr, "sockaddr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags):r->sockaddr_size); - ndr_print_nbt_sockaddr(ndr, "sockaddr", &r->sockaddr); - ndr_print_nbt_string(ndr, "next_closest_site", r->next_closest_site); - ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_nbt_netlogon_query_for_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_query_for_pdc *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_netlogon_query_for_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_query_for_pdc *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r) -{ - ndr_print_struct(ndr, name, "nbt_netlogon_query_for_pdc"); - ndr->depth++; - ndr_print_string(ndr, "computer_name", r->computer_name); - ndr_print_string(ndr, "mailslot_name", r->mailslot_name); - ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); - ndr_print_string(ndr, "unicode_name", r->unicode_name); - ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_response_from_pdc *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_response_from_pdc *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r) -{ - ndr_print_struct(ndr, name, "nbt_netlogon_response_from_pdc"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - ndr->depth++; - ndr_print_netlogon_command(ndr, "command", r->command); - ndr_print_string(ndr, "pdc_name", r->pdc_name); - ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); - ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name); - ndr_print_string(ndr, "domain_name", r->domain_name); - ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version); - ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token); - ndr_print_uint16(ndr, "lm20_token", r->lm20_token); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_nbt_db_change_info(struct ndr_push *ndr, int ndr_flags, const struct nbt_db_change_info *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_netr_SamDatabaseID(ndr, NDR_SCALARS, r->db_index)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->serial)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->timestamp)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_db_change_info(struct ndr_pull *ndr, int ndr_flags, struct nbt_db_change_info *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->db_index)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->serial)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->timestamp)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_db_change_info(struct ndr_print *ndr, const char *name, const struct nbt_db_change_info *r) -{ - ndr_print_struct(ndr, name, "nbt_db_change_info"); - ndr->depth++; - ndr_print_netr_SamDatabaseID(ndr, "db_index", r->db_index); - ndr_print_hyper(ndr, "serial", r->serial); - ndr_print_NTTIME(ndr, "timestamp", r->timestamp); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_NETLOGON_DB_CHANGE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_DB_CHANGE *r) -{ - uint32_t cntr_dbchange_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_lo)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pulse)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->random)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->unicode_domain)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->db_count)); - for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) { - NDR_CHECK(ndr_push_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0])); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags))); - { - struct ndr_push *_ndr_sid; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags))); - NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags))); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_format_version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->message_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_NETLOGON_DB_CHANGE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_DB_CHANGE *r) -{ - uint32_t cntr_dbchange_0; - TALLOC_CTX *_mem_save_dbchange_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_lo)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pulse)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->random)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad)); - ndr->flags = _flags_save_DATA_BLOB; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_pdc_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->unicode_domain)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->db_count)); - NDR_PULL_ALLOC_N(ndr, r->dbchange, r->db_count); - _mem_save_dbchange_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dbchange, 0); - for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) { - NDR_CHECK(ndr_pull_nbt_db_change_info(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dbchange_0, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size)); - { - struct ndr_pull *_ndr_sid; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size)); - NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size)); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_format_version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->message_token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_NETLOGON_DB_CHANGE(struct ndr_print *ndr, const char *name, const struct NETLOGON_DB_CHANGE *r) -{ - uint32_t cntr_dbchange_0; - ndr_print_struct(ndr, name, "NETLOGON_DB_CHANGE"); - ndr->depth++; - ndr_print_uint32(ndr, "serial_lo", r->serial_lo); - ndr_print_time_t(ndr, "timestamp", r->timestamp); - ndr_print_uint32(ndr, "pulse", r->pulse); - ndr_print_uint32(ndr, "random", r->random); - ndr_print_string(ndr, "pdc_name", r->pdc_name); - ndr_print_string(ndr, "domain", r->domain); - ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); - ndr_print_string(ndr, "unicode_pdc_name", r->unicode_pdc_name); - ndr_print_string(ndr, "unicode_domain", r->unicode_domain); - ndr_print_uint32(ndr, "db_count", r->db_count); - ndr->print(ndr, "%s: ARRAY(%d)", "dbchange", (int)r->db_count); - ndr->depth++; - for (cntr_dbchange_0=0;cntr_dbchange_0db_count;cntr_dbchange_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_dbchange_0) != -1) { - ndr_print_nbt_db_change_info(ndr, "dbchange", &r->dbchange[cntr_dbchange_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size); - ndr_print_dom_sid0(ndr, "sid", &r->sid); - ndr_print_uint32(ndr, "message_format_version", r->message_format_version); - ndr_print_uint32(ndr, "message_token", r->message_token); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_netlogon_request(struct ndr_push *ndr, int ndr_flags, const union nbt_netlogon_request *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case LOGON_SAM_LOGON_REQUEST: { - NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon)); - break; } - - case LOGON_PRIMARY_QUERY: { - NDR_CHECK(ndr_push_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc)); - break; } - - case NETLOGON_ANNOUNCE_UAS: { - NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case LOGON_SAM_LOGON_REQUEST: - NDR_CHECK(ndr_push_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon)); - break; - - case LOGON_PRIMARY_QUERY: - break; - - case NETLOGON_ANNOUNCE_UAS: - NDR_CHECK(ndr_push_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_netlogon_request(struct ndr_pull *ndr, int ndr_flags, union nbt_netlogon_request *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case LOGON_SAM_LOGON_REQUEST: { - NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_SCALARS, &r->logon)); - break; } - - case LOGON_PRIMARY_QUERY: { - NDR_CHECK(ndr_pull_nbt_netlogon_query_for_pdc(ndr, NDR_SCALARS, &r->pdc)); - break; } - - case NETLOGON_ANNOUNCE_UAS: { - NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_SCALARS, &r->uas)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case LOGON_SAM_LOGON_REQUEST: - NDR_CHECK(ndr_pull_NETLOGON_SAM_LOGON_REQUEST(ndr, NDR_BUFFERS, &r->logon)); - break; - - case LOGON_PRIMARY_QUERY: - break; - - case NETLOGON_ANNOUNCE_UAS: - NDR_CHECK(ndr_pull_NETLOGON_DB_CHANGE(ndr, NDR_BUFFERS, &r->uas)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "nbt_netlogon_request"); - switch (level) { - case LOGON_SAM_LOGON_REQUEST: - ndr_print_NETLOGON_SAM_LOGON_REQUEST(ndr, "logon", &r->logon); - break; - - case LOGON_PRIMARY_QUERY: - ndr_print_nbt_netlogon_query_for_pdc(ndr, "pdc", &r->pdc); - break; - - case NETLOGON_ANNOUNCE_UAS: - ndr_print_NETLOGON_DB_CHANGE(ndr, "uas", &r->uas); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->req, r->command)); - NDR_CHECK(ndr_push_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_nbt_netlogon_request(ndr, NDR_BUFFERS, &r->req)); - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->req, r->command)); - NDR_CHECK(ndr_pull_nbt_netlogon_request(ndr, NDR_SCALARS, &r->req)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_nbt_netlogon_request(ndr, NDR_BUFFERS, &r->req)); - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r) -{ - ndr_print_struct(ndr, name, "nbt_netlogon_packet"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - ndr->depth++; - ndr_print_netlogon_command(ndr, "command", r->command); - ndr_print_set_switch_value(ndr, &r->req, r->command); - ndr_print_nbt_netlogon_request(ndr, "req", &r->req); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_nbt_browse_opcode(struct ndr_push *ndr, int ndr_flags, enum nbt_browse_opcode r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_opcode(struct ndr_pull *ndr, int ndr_flags, enum nbt_browse_opcode *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r) -{ - const char *val = NULL; - - switch (r) { - case HostAnnouncement: val = "HostAnnouncement"; break; - case AnnouncementRequest: val = "AnnouncementRequest"; break; - case Election: val = "Election"; break; - case GetBackupListReq: val = "GetBackupListReq"; break; - case GetBackupListResp: val = "GetBackupListResp"; break; - case BecomeBackup: val = "BecomeBackup"; break; - case DomainAnnouncement: val = "DomainAnnouncement"; break; - case MasterAnnouncement: val = "MasterAnnouncement"; break; - case ResetBrowserState: val = "ResetBrowserState"; break; - case LocalMasterAnnouncement: val = "LocalMasterAnnouncement"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_nbt_browse_host_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_host_announcement *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor)); - NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMajorVer)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMinorVer)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Signature)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_host_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_host_announcement *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, 16, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor)); - NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMajorVer)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMinorVer)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Signature)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_host_announcement"); - ndr->depth++; - ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount); - ndr_print_uint32(ndr, "Periodicity", r->Periodicity); - ndr_print_string(ndr, "ServerName", r->ServerName); - ndr_print_uint8(ndr, "OSMajor", r->OSMajor); - ndr_print_uint8(ndr, "OSMinor", r->OSMinor); - ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType); - ndr_print_uint8(ndr, "BroMajorVer", r->BroMajorVer); - ndr_print_uint8(ndr, "BroMinorVer", r->BroMinorVer); - ndr_print_uint16(ndr, "Signature", r->Signature); - ndr_print_string(ndr, "Comment", r->Comment); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_announcement_request(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_announcement_request *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Unused)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ResponseName)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_announcement_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_announcement_request *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Unused)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ResponseName)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_announcement_request"); - ndr->depth++; - ndr_print_uint8(ndr, "Unused", r->Unused); - ndr_print_string(ndr, "ResponseName", r->ResponseName); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_election_request(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_election_request *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Criteria)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->UpTime)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Reserved)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ServerName)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_election_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_election_request *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Criteria)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->UpTime)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Reserved)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ServerName)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_election_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_election_request *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_election_request"); - ndr->depth++; - ndr_print_uint8(ndr, "Version", r->Version); - ndr_print_uint32(ndr, "Criteria", r->Criteria); - ndr_print_uint32(ndr, "UpTime", r->UpTime); - ndr_print_uint32(ndr, "Reserved", r->Reserved); - ndr_print_string(ndr, "ServerName", r->ServerName); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_backup_list_request(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_backup_list_request *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->ReqCount)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_backup_list_request(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_backup_list_request *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->ReqCount)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Token)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_backup_list_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_request *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_backup_list_request"); - ndr->depth++; - ndr_print_uint8(ndr, "ReqCount", r->ReqCount); - ndr_print_uint32(ndr, "Token", r->Token); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_backup_list_response(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_backup_list_response *r) -{ - uint32_t cntr_BackupServerList_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BackupCount)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Token)); - for (cntr_BackupServerList_0 = 0; cntr_BackupServerList_0 < r->BackupCount; cntr_BackupServerList_0++) { - NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->BackupServerList[cntr_BackupServerList_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_backup_list_response(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_backup_list_response *r) -{ - uint32_t cntr_BackupServerList_0; - TALLOC_CTX *_mem_save_BackupServerList_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BackupCount)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Token)); - NDR_PULL_ALLOC_N(ndr, r->BackupServerList, r->BackupCount); - _mem_save_BackupServerList_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->BackupServerList, 0); - for (cntr_BackupServerList_0 = 0; cntr_BackupServerList_0 < r->BackupCount; cntr_BackupServerList_0++) { - NDR_CHECK(ndr_pull_nbt_name(ndr, NDR_SCALARS, &r->BackupServerList[cntr_BackupServerList_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_BackupServerList_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_backup_list_response(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_response *r) -{ - uint32_t cntr_BackupServerList_0; - ndr_print_struct(ndr, name, "nbt_browse_backup_list_response"); - ndr->depth++; - ndr_print_uint8(ndr, "BackupCount", r->BackupCount); - ndr_print_uint32(ndr, "Token", r->Token); - ndr->print(ndr, "%s: ARRAY(%d)", "BackupServerList", (int)r->BackupCount); - ndr->depth++; - for (cntr_BackupServerList_0=0;cntr_BackupServerList_0BackupCount;cntr_BackupServerList_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_BackupServerList_0) != -1) { - ndr_print_nbt_name(ndr, "BackupServerList", &r->BackupServerList[cntr_BackupServerList_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_become_backup(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_become_backup *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->BrowserName)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_become_backup(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_become_backup *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->BrowserName)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_become_backup(struct ndr_print *ndr, const char *name, const struct nbt_browse_become_backup *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_become_backup"); - ndr->depth++; - ndr_print_string(ndr, "BrowserName", r->BrowserName); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_domain_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_domain_announcement *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor)); - NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->MysteriousField)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_domain_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_domain_announcement *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, 16, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor)); - NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->MysteriousField)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_domain_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_domain_announcement *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_domain_announcement"); - ndr->depth++; - ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount); - ndr_print_uint32(ndr, "Periodicity", r->Periodicity); - ndr_print_string(ndr, "ServerName", r->ServerName); - ndr_print_uint8(ndr, "OSMajor", r->OSMajor); - ndr_print_uint8(ndr, "OSMinor", r->OSMinor); - ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType); - ndr_print_uint32(ndr, "MysteriousField", r->MysteriousField); - ndr_print_string(ndr, "Comment", r->Comment); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_master_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_master_announcement *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->ServerName)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_master_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_master_announcement *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->ServerName)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_master_announcement *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_master_announcement"); - ndr->depth++; - ndr_print_string(ndr, "ServerName", r->ServerName); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_reset_state(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_reset_state *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->Command)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_reset_state(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_reset_state *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Command)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_reset_state(struct ndr_print *ndr, const char *name, const struct nbt_browse_reset_state *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_reset_state"); - ndr->depth++; - ndr_print_uint8(ndr, "Command", r->Command); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_local_master_announcement(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_local_master_announcement *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->UpdateCount)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Periodicity)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ServerName, 16, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMajor)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->OSMinor)); - NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->ServerType)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMajorVer)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->BroMinorVer)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Signature)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->Comment)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_local_master_announcement(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_local_master_announcement *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->UpdateCount)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Periodicity)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ServerName, 16, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMajor)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->OSMinor)); - NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->ServerType)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMajorVer)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->BroMinorVer)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Signature)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->Comment)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_local_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_local_master_announcement *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_local_master_announcement"); - ndr->depth++; - ndr_print_uint8(ndr, "UpdateCount", r->UpdateCount); - ndr_print_uint32(ndr, "Periodicity", r->Periodicity); - ndr_print_string(ndr, "ServerName", r->ServerName); - ndr_print_uint8(ndr, "OSMajor", r->OSMajor); - ndr_print_uint8(ndr, "OSMinor", r->OSMinor); - ndr_print_svcctl_ServerType(ndr, "ServerType", r->ServerType); - ndr_print_uint8(ndr, "BroMajorVer", r->BroMajorVer); - ndr_print_uint8(ndr, "BroMinorVer", r->BroMinorVer); - ndr_print_uint16(ndr, "Signature", r->Signature); - ndr_print_string(ndr, "Comment", r->Comment); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_nbt_browse_payload(struct ndr_push *ndr, int ndr_flags, const union nbt_browse_payload *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case HostAnnouncement: { - NDR_CHECK(ndr_push_nbt_browse_host_announcement(ndr, NDR_SCALARS, &r->host_annoucement)); - break; } - - case AnnouncementRequest: { - NDR_CHECK(ndr_push_nbt_browse_announcement_request(ndr, NDR_SCALARS, &r->announcement_request)); - break; } - - case Election: { - NDR_CHECK(ndr_push_nbt_browse_election_request(ndr, NDR_SCALARS, &r->election_request)); - break; } - - case GetBackupListReq: { - NDR_CHECK(ndr_push_nbt_browse_backup_list_request(ndr, NDR_SCALARS, &r->backup_list_request)); - break; } - - case GetBackupListResp: { - NDR_CHECK(ndr_push_nbt_browse_backup_list_response(ndr, NDR_SCALARS, &r->backup_list_response)); - break; } - - case BecomeBackup: { - NDR_CHECK(ndr_push_nbt_browse_become_backup(ndr, NDR_SCALARS, &r->become_backup)); - break; } - - case DomainAnnouncement: { - NDR_CHECK(ndr_push_nbt_browse_domain_announcement(ndr, NDR_SCALARS, &r->domain_announcement)); - break; } - - case MasterAnnouncement: { - NDR_CHECK(ndr_push_nbt_browse_master_announcement(ndr, NDR_SCALARS, &r->master_announcement)); - break; } - - case ResetBrowserState: { - NDR_CHECK(ndr_push_nbt_browse_reset_state(ndr, NDR_SCALARS, &r->reset_browser_state)); - break; } - - case LocalMasterAnnouncement: { - NDR_CHECK(ndr_push_nbt_browse_local_master_announcement(ndr, NDR_SCALARS, &r->local_master_announcement)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case HostAnnouncement: - break; - - case AnnouncementRequest: - break; - - case Election: - break; - - case GetBackupListReq: - break; - - case GetBackupListResp: - break; - - case BecomeBackup: - break; - - case DomainAnnouncement: - break; - - case MasterAnnouncement: - break; - - case ResetBrowserState: - break; - - case LocalMasterAnnouncement: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_nbt_browse_payload(struct ndr_pull *ndr, int ndr_flags, union nbt_browse_payload *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case HostAnnouncement: { - NDR_CHECK(ndr_pull_nbt_browse_host_announcement(ndr, NDR_SCALARS, &r->host_annoucement)); - break; } - - case AnnouncementRequest: { - NDR_CHECK(ndr_pull_nbt_browse_announcement_request(ndr, NDR_SCALARS, &r->announcement_request)); - break; } - - case Election: { - NDR_CHECK(ndr_pull_nbt_browse_election_request(ndr, NDR_SCALARS, &r->election_request)); - break; } - - case GetBackupListReq: { - NDR_CHECK(ndr_pull_nbt_browse_backup_list_request(ndr, NDR_SCALARS, &r->backup_list_request)); - break; } - - case GetBackupListResp: { - NDR_CHECK(ndr_pull_nbt_browse_backup_list_response(ndr, NDR_SCALARS, &r->backup_list_response)); - break; } - - case BecomeBackup: { - NDR_CHECK(ndr_pull_nbt_browse_become_backup(ndr, NDR_SCALARS, &r->become_backup)); - break; } - - case DomainAnnouncement: { - NDR_CHECK(ndr_pull_nbt_browse_domain_announcement(ndr, NDR_SCALARS, &r->domain_announcement)); - break; } - - case MasterAnnouncement: { - NDR_CHECK(ndr_pull_nbt_browse_master_announcement(ndr, NDR_SCALARS, &r->master_announcement)); - break; } - - case ResetBrowserState: { - NDR_CHECK(ndr_pull_nbt_browse_reset_state(ndr, NDR_SCALARS, &r->reset_browser_state)); - break; } - - case LocalMasterAnnouncement: { - NDR_CHECK(ndr_pull_nbt_browse_local_master_announcement(ndr, NDR_SCALARS, &r->local_master_announcement)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case HostAnnouncement: - break; - - case AnnouncementRequest: - break; - - case Election: - break; - - case GetBackupListReq: - break; - - case GetBackupListResp: - break; - - case BecomeBackup: - break; - - case DomainAnnouncement: - break; - - case MasterAnnouncement: - break; - - case ResetBrowserState: - break; - - case LocalMasterAnnouncement: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_payload(struct ndr_print *ndr, const char *name, const union nbt_browse_payload *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "nbt_browse_payload"); - switch (level) { - case HostAnnouncement: - ndr_print_nbt_browse_host_announcement(ndr, "host_annoucement", &r->host_annoucement); - break; - - case AnnouncementRequest: - ndr_print_nbt_browse_announcement_request(ndr, "announcement_request", &r->announcement_request); - break; - - case Election: - ndr_print_nbt_browse_election_request(ndr, "election_request", &r->election_request); - break; - - case GetBackupListReq: - ndr_print_nbt_browse_backup_list_request(ndr, "backup_list_request", &r->backup_list_request); - break; - - case GetBackupListResp: - ndr_print_nbt_browse_backup_list_response(ndr, "backup_list_response", &r->backup_list_response); - break; - - case BecomeBackup: - ndr_print_nbt_browse_become_backup(ndr, "become_backup", &r->become_backup); - break; - - case DomainAnnouncement: - ndr_print_nbt_browse_domain_announcement(ndr, "domain_announcement", &r->domain_announcement); - break; - - case MasterAnnouncement: - ndr_print_nbt_browse_master_announcement(ndr, "master_announcement", &r->master_announcement); - break; - - case ResetBrowserState: - ndr_print_nbt_browse_reset_state(ndr, "reset_browser_state", &r->reset_browser_state); - break; - - case LocalMasterAnnouncement: - ndr_print_nbt_browse_local_master_announcement(ndr, "local_master_announcement", &r->local_master_announcement); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_nbt_browse_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_nbt_browse_opcode(ndr, NDR_SCALARS, r->opcode)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->payload, r->opcode)); - NDR_CHECK(ndr_push_nbt_browse_payload(ndr, NDR_SCALARS, &r->payload)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_nbt_browse_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_packet *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_nbt_browse_opcode(ndr, NDR_SCALARS, &r->opcode)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->payload, r->opcode)); - NDR_CHECK(ndr_pull_nbt_browse_payload(ndr, NDR_SCALARS, &r->payload)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_nbt_browse_packet(struct ndr_print *ndr, const char *name, const struct nbt_browse_packet *r) -{ - ndr_print_struct(ndr, name, "nbt_browse_packet"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - ndr->depth++; - ndr_print_nbt_browse_opcode(ndr, "opcode", r->opcode); - ndr_print_set_switch_value(ndr, &r->payload, r->opcode); - ndr_print_nbt_browse_payload(ndr, "payload", &r->payload); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - diff --git a/source3/librpc/gen_ndr/ndr_nbt.h b/source3/librpc/gen_ndr/ndr_nbt.h deleted file mode 100644 index 1a0ca0c302..0000000000 --- a/source3/librpc/gen_ndr/ndr_nbt.h +++ /dev/null @@ -1,104 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/nbt.h" - -#ifndef _HEADER_NDR_nbt -#define _HEADER_NDR_nbt - -#include "../libcli/netlogon.h" -#include "../libcli/nbt/libnbt.h" -#define NDR_NBT_CALL_COUNT (0) -void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r); -void ndr_print_nbt_name_type(struct ndr_print *ndr, const char *name, enum nbt_name_type r); -enum ndr_err_code ndr_push_nbt_name(struct ndr_push *ndr, int ndr_flags, const struct nbt_name *r); -enum ndr_err_code ndr_pull_nbt_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_name *r); -void ndr_print_nbt_name(struct ndr_print *ndr, const char *name, const struct nbt_name *r); -enum ndr_err_code ndr_push_nbt_qclass(struct ndr_push *ndr, int ndr_flags, enum nbt_qclass r); -enum ndr_err_code ndr_pull_nbt_qclass(struct ndr_pull *ndr, int ndr_flags, enum nbt_qclass *r); -void ndr_print_nbt_qclass(struct ndr_print *ndr, const char *name, enum nbt_qclass r); -enum ndr_err_code ndr_push_nbt_qtype(struct ndr_push *ndr, int ndr_flags, enum nbt_qtype r); -enum ndr_err_code ndr_pull_nbt_qtype(struct ndr_pull *ndr, int ndr_flags, enum nbt_qtype *r); -void ndr_print_nbt_qtype(struct ndr_print *ndr, const char *name, enum nbt_qtype r); -void ndr_print_nbt_name_question(struct ndr_print *ndr, const char *name, const struct nbt_name_question *r); -void ndr_print_nb_flags(struct ndr_print *ndr, const char *name, uint16_t r); -void ndr_print_nbt_rdata_address(struct ndr_print *ndr, const char *name, const struct nbt_rdata_address *r); -void ndr_print_nbt_rdata_netbios(struct ndr_print *ndr, const char *name, const struct nbt_rdata_netbios *r); -void ndr_print_nbt_statistics(struct ndr_print *ndr, const char *name, const struct nbt_statistics *r); -void ndr_print_nbt_status_name(struct ndr_print *ndr, const char *name, const struct nbt_status_name *r); -void ndr_print_nbt_rdata_status(struct ndr_print *ndr, const char *name, const struct nbt_rdata_status *r); -void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const struct nbt_rdata_data *r); -enum ndr_err_code ndr_push_nbt_rdata(struct ndr_push *ndr, int ndr_flags, const union nbt_rdata *r); -enum ndr_err_code ndr_pull_nbt_rdata(struct ndr_pull *ndr, int ndr_flags, union nbt_rdata *r); -void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r); -enum ndr_err_code ndr_push_nbt_res_rec(struct ndr_push *ndr, int ndr_flags, const struct nbt_res_rec *r); -void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r); -enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r); -enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r); -void ndr_print_nbt_name_packet(struct ndr_print *ndr, const char *name, const struct nbt_name_packet *r); -void ndr_print_dgram_msg_type(struct ndr_print *ndr, const char *name, enum dgram_msg_type r); -void ndr_print_dgram_flags(struct ndr_print *ndr, const char *name, uint8_t r); -void ndr_print_smb_command(struct ndr_print *ndr, const char *name, enum smb_command r); -void ndr_print_smb_trans_body(struct ndr_print *ndr, const char *name, const struct smb_trans_body *r); -void ndr_print_smb_body(struct ndr_print *ndr, const char *name, const union smb_body *r); -enum ndr_err_code ndr_push_dgram_smb_packet(struct ndr_push *ndr, int ndr_flags, const struct dgram_smb_packet *r); -enum ndr_err_code ndr_pull_dgram_smb_packet(struct ndr_pull *ndr, int ndr_flags, struct dgram_smb_packet *r); -void ndr_print_dgram_smb_packet(struct ndr_print *ndr, const char *name, const struct dgram_smb_packet *r); -void ndr_print_dgram_message_body(struct ndr_print *ndr, const char *name, const union dgram_message_body *r); -void ndr_print_dgram_message(struct ndr_print *ndr, const char *name, const struct dgram_message *r); -void ndr_print_dgram_err_code(struct ndr_print *ndr, const char *name, enum dgram_err_code r); -void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union dgram_data *r); -enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r); -enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r); -void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r); -enum ndr_err_code ndr_push_nbt_sockaddr(struct ndr_push *ndr, int ndr_flags, const struct nbt_sockaddr *r); -enum ndr_err_code ndr_pull_nbt_sockaddr(struct ndr_pull *ndr, int ndr_flags, struct nbt_sockaddr *r); -void ndr_print_nbt_sockaddr(struct ndr_print *ndr, const char *name, const struct nbt_sockaddr *r); -size_t ndr_size_nbt_sockaddr(const struct nbt_sockaddr *r, int flags); -enum ndr_err_code ndr_push_nbt_server_type(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_nbt_server_type(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r); -enum ndr_err_code ndr_push_netlogon_nt_version_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_netlogon_nt_version_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_netlogon_nt_version_flags(struct ndr_print *ndr, const char *name, uint32_t r); -enum ndr_err_code ndr_push_netlogon_command(struct ndr_push *ndr, int ndr_flags, enum netlogon_command r); -enum ndr_err_code ndr_pull_netlogon_command(struct ndr_pull *ndr, int ndr_flags, enum netlogon_command *r); -void ndr_print_netlogon_command(struct ndr_print *ndr, const char *name, enum netlogon_command r); -enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r); -enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_REQUEST(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_REQUEST *r); -void ndr_print_NETLOGON_SAM_LOGON_REQUEST(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_REQUEST *r); -enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r); -enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r); -void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_NT40 *r); -enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE *r); -enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE *r); -void ndr_print_NETLOGON_SAM_LOGON_RESPONSE(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE *r); -enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r); -enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r); -void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_print *ndr, const char *name, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r); -void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r); -enum ndr_err_code ndr_push_nbt_netlogon_response_from_pdc(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_response_from_pdc *r); -enum ndr_err_code ndr_pull_nbt_netlogon_response_from_pdc(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_response_from_pdc *r); -void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r); -void ndr_print_nbt_db_change_info(struct ndr_print *ndr, const char *name, const struct nbt_db_change_info *r); -void ndr_print_NETLOGON_DB_CHANGE(struct ndr_print *ndr, const char *name, const struct NETLOGON_DB_CHANGE *r); -void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r); -enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r); -enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r); -void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r); -void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r); -void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r); -void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r); -void ndr_print_nbt_browse_election_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_election_request *r); -void ndr_print_nbt_browse_backup_list_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_request *r); -void ndr_print_nbt_browse_backup_list_response(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_response *r); -void ndr_print_nbt_browse_become_backup(struct ndr_print *ndr, const char *name, const struct nbt_browse_become_backup *r); -void ndr_print_nbt_browse_domain_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_domain_announcement *r); -void ndr_print_nbt_browse_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_master_announcement *r); -void ndr_print_nbt_browse_reset_state(struct ndr_print *ndr, const char *name, const struct nbt_browse_reset_state *r); -void ndr_print_nbt_browse_local_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_local_master_announcement *r); -void ndr_print_nbt_browse_payload(struct ndr_print *ndr, const char *name, const union nbt_browse_payload *r); -enum ndr_err_code ndr_push_nbt_browse_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_packet *r); -enum ndr_err_code ndr_pull_nbt_browse_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_packet *r); -void ndr_print_nbt_browse_packet(struct ndr_print *ndr, const char *name, const struct nbt_browse_packet *r); -#endif /* _HEADER_NDR_nbt */ diff --git a/source3/librpc/gen_ndr/ndr_netlogon.c b/source3/librpc/gen_ndr/ndr_netlogon.c deleted file mode 100644 index 81f8ddcab9..0000000000 --- a/source3/librpc/gen_ndr/ndr_netlogon.c +++ /dev/null @@ -1,16203 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_netlogon.h" - -#include "librpc/gen_ndr/ndr_misc.h" -#include "librpc/gen_ndr/ndr_lsa.h" -#include "librpc/gen_ndr/ndr_samr.h" -#include "librpc/gen_ndr/ndr_security.h" -#include "librpc/gen_ndr/ndr_nbt.h" -static enum ndr_err_code ndr_push_netr_UasInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priv)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_pw_count)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->last_logon)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->last_logoff)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->logoff_time)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->kickoff_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->password_age)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->pw_can_change)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->pw_must_change)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->script_path)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->account_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->computer) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer, ndr_charset_length(r->computer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->script_path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->script_path, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->script_path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->script_path, ndr_charset_length(r->script_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_UasInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasInfo *r) -{ - uint32_t _ptr_account_name; - TALLOC_CTX *_mem_save_account_name_0; - uint32_t _ptr_computer; - TALLOC_CTX *_mem_save_computer_0; - uint32_t _ptr_domain; - TALLOC_CTX *_mem_save_domain_0; - uint32_t _ptr_script_path; - TALLOC_CTX *_mem_save_script_path_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name)); - if (_ptr_account_name) { - NDR_PULL_ALLOC(ndr, r->account_name); - } else { - r->account_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priv)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_pw_count)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logon)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logoff)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->logoff_time)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->kickoff_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->password_age)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_can_change)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_must_change)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer)); - if (_ptr_computer) { - NDR_PULL_ALLOC(ndr, r->computer); - } else { - r->computer = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_script_path)); - if (_ptr_script_path) { - NDR_PULL_ALLOC(ndr, r->script_path); - } else { - r->script_path = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->account_name) { - _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name)); - if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->account_name), ndr_get_array_length(ndr, &r->account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0); - } - if (r->computer) { - _mem_save_computer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->computer, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->computer)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->computer)); - if (ndr_get_array_length(ndr, &r->computer) > ndr_get_array_size(ndr, &r->computer)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer), ndr_get_array_length(ndr, &r->computer)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer, ndr_get_array_length(ndr, &r->computer), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_0, 0); - } - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - if (r->script_path) { - _mem_save_script_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->script_path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->script_path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->script_path)); - if (ndr_get_array_length(ndr, &r->script_path) > ndr_get_array_size(ndr, &r->script_path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->script_path), ndr_get_array_length(ndr, &r->script_path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->script_path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->script_path, ndr_get_array_length(ndr, &r->script_path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_script_path_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r) -{ - ndr_print_struct(ndr, name, "netr_UasInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "account_name", r->account_name); - ndr->depth++; - if (r->account_name) { - ndr_print_string(ndr, "account_name", r->account_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "priv", r->priv); - ndr_print_uint32(ndr, "auth_flags", r->auth_flags); - ndr_print_uint32(ndr, "logon_count", r->logon_count); - ndr_print_uint32(ndr, "bad_pw_count", r->bad_pw_count); - ndr_print_time_t(ndr, "last_logon", r->last_logon); - ndr_print_time_t(ndr, "last_logoff", r->last_logoff); - ndr_print_time_t(ndr, "logoff_time", r->logoff_time); - ndr_print_time_t(ndr, "kickoff_time", r->kickoff_time); - ndr_print_uint32(ndr, "password_age", r->password_age); - ndr_print_time_t(ndr, "pw_can_change", r->pw_can_change); - ndr_print_time_t(ndr, "pw_must_change", r->pw_must_change); - ndr_print_ptr(ndr, "computer", r->computer); - ndr->depth++; - if (r->computer) { - ndr_print_string(ndr, "computer", r->computer); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - ndr_print_ptr(ndr, "script_path", r->script_path); - ndr->depth++; - if (r->script_path) { - ndr_print_string(ndr, "script_path", r->script_path); - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_UasLogoffInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasLogoffInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->duration)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_UasLogoffInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasLogoffInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->duration)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r) -{ - ndr_print_struct(ndr, name, "netr_UasLogoffInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "duration", r->duration); - ndr_print_uint16(ndr, "logon_count", r->logon_count); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->lockout_duration)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->reset_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_attempt_lockout)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->lockout_duration)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->reset_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_attempt_lockout)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r) -{ - ndr_print_struct(ndr, name, "netr_AcctLockStr"); - ndr->depth++; - ndr_print_dlong(ndr, "lockout_duration", r->lockout_duration); - ndr_print_udlong(ndr, "reset_count", r->reset_count); - ndr_print_uint32(ndr, "bad_attempt_lockout", r->bad_attempt_lockout); - ndr_print_uint32(ndr, "dummy", r->dummy); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonParameterControl(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", MSV1_0_CLEARTEXT_PASSWORD_ALLOWED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_UPDATE_LOGON_STATISTICS", MSV1_0_UPDATE_LOGON_STATISTICS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_USER_PARAMETERS", MSV1_0_RETURN_USER_PARAMETERS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PROFILE_PATH", MSV1_0_RETURN_PROFILE_PATH, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_IdentityInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_push_netr_LogonParameterControl(ndr, NDR_SCALARS, r->parameter_control)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_low)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_high)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstation)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstation)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_IdentityInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_pull_netr_LogonParameterControl(ndr, NDR_SCALARS, &r->parameter_control)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_low)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_high)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstation)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstation)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r) -{ - ndr_print_struct(ndr, name, "netr_IdentityInfo"); - ndr->depth++; - ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); - ndr_print_netr_LogonParameterControl(ndr, "parameter_control", r->parameter_control); - ndr_print_uint32(ndr, "logon_id_low", r->logon_id_low); - ndr_print_uint32(ndr, "logon_id_high", r->logon_id_high); - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "workstation", &r->workstation); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_PasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword)); - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_PasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword)); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r) -{ - ndr_print_struct(ndr, name, "netr_PasswordInfo"); - ndr->depth++; - ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info); - ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword); - ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ChallengeResponse(struct ndr_push *ndr, int ndr_flags, const struct netr_ChallengeResponse *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ChallengeResponse(struct ndr_pull *ndr, int ndr_flags, struct netr_ChallengeResponse *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->data)); - if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data)); - } - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); - } - if (r->data) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r) -{ - ndr_print_struct(ndr, name, "netr_ChallengeResponse"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->length); - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_netr_NetworkInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_NetworkInfo *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->challenge, 8)); - NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt)); - NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); - NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt)); - NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm)); - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NetworkInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_NetworkInfo *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->challenge, 8)); - NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt)); - NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); - NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt)); - NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm)); - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r) -{ - ndr_print_struct(ndr, name, "netr_NetworkInfo"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info); - ndr_print_array_uint8(ndr, "challenge", r->challenge, 8); - ndr_print_netr_ChallengeResponse(ndr, "nt", &r->nt); - ndr_print_netr_ChallengeResponse(ndr, "lm", &r->lm); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_netr_GenericInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->package_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->package_name)); - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_GenericInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->package_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->package_name)); - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r) -{ - ndr_print_struct(ndr, name, "netr_GenericInfo"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info); - ndr_print_lsa_String(ndr, "package_name", &r->package_name); - ndr_print_uint32(ndr, "length", r->length); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->length); - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_netr_LogonInfoClass(struct ndr_push *ndr, int ndr_flags, enum netr_LogonInfoClass r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonInfoClass(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonInfoClass *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r) -{ - const char *val = NULL; - - switch (r) { - case NetlogonInteractiveInformation: val = "NetlogonInteractiveInformation"; break; - case NetlogonNetworkInformation: val = "NetlogonNetworkInformation"; break; - case NetlogonServiceInformation: val = "NetlogonServiceInformation"; break; - case NetlogonGenericInformation: val = "NetlogonGenericInformation"; break; - case NetlogonInteractiveTransitiveInformation: val = "NetlogonInteractiveTransitiveInformation"; break; - case NetlogonNetworkTransitiveInformation: val = "NetlogonNetworkTransitiveInformation"; break; - case NetlogonServiceTransitiveInformation: val = "NetlogonServiceTransitiveInformation"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, level)); - switch (level) { - case NetlogonInteractiveInformation: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - break; } - - case NetlogonNetworkInformation: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->network)); - break; } - - case NetlogonServiceInformation: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - break; } - - case NetlogonGenericInformation: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic)); - break; } - - case NetlogonInteractiveTransitiveInformation: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - break; } - - case NetlogonNetworkTransitiveInformation: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->network)); - break; } - - case NetlogonServiceTransitiveInformation: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NetlogonInteractiveInformation: - if (r->password) { - NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - } - break; - - case NetlogonNetworkInformation: - if (r->network) { - NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network)); - } - break; - - case NetlogonServiceInformation: - if (r->password) { - NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - } - break; - - case NetlogonGenericInformation: - if (r->generic) { - NDR_CHECK(ndr_push_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic)); - } - break; - - case NetlogonInteractiveTransitiveInformation: - if (r->password) { - NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - } - break; - - case NetlogonNetworkTransitiveInformation: - if (r->network) { - NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network)); - } - break; - - case NetlogonServiceTransitiveInformation: - if (r->password) { - NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r) -{ - int level; - uint16_t _level; - TALLOC_CTX *_mem_save_password_0; - TALLOC_CTX *_mem_save_network_0; - TALLOC_CTX *_mem_save_generic_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case NetlogonInteractiveInformation: { - uint32_t _ptr_password; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->password); - } else { - r->password = NULL; - } - break; } - - case NetlogonNetworkInformation: { - uint32_t _ptr_network; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network)); - if (_ptr_network) { - NDR_PULL_ALLOC(ndr, r->network); - } else { - r->network = NULL; - } - break; } - - case NetlogonServiceInformation: { - uint32_t _ptr_password; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->password); - } else { - r->password = NULL; - } - break; } - - case NetlogonGenericInformation: { - uint32_t _ptr_generic; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic)); - if (_ptr_generic) { - NDR_PULL_ALLOC(ndr, r->generic); - } else { - r->generic = NULL; - } - break; } - - case NetlogonInteractiveTransitiveInformation: { - uint32_t _ptr_password; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->password); - } else { - r->password = NULL; - } - break; } - - case NetlogonNetworkTransitiveInformation: { - uint32_t _ptr_network; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network)); - if (_ptr_network) { - NDR_PULL_ALLOC(ndr, r->network); - } else { - r->network = NULL; - } - break; } - - case NetlogonServiceTransitiveInformation: { - uint32_t _ptr_password; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->password); - } else { - r->password = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case NetlogonInteractiveInformation: - if (r->password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); - NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - break; - - case NetlogonNetworkInformation: - if (r->network) { - _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->network, 0); - NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0); - } - break; - - case NetlogonServiceInformation: - if (r->password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); - NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - break; - - case NetlogonGenericInformation: - if (r->generic) { - _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0); - NDR_CHECK(ndr_pull_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0); - } - break; - - case NetlogonInteractiveTransitiveInformation: - if (r->password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); - NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - break; - - case NetlogonNetworkTransitiveInformation: - if (r->network) { - _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->network, 0); - NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0); - } - break; - - case NetlogonServiceTransitiveInformation: - if (r->password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); - NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "netr_LogonLevel"); - switch (level) { - case NetlogonInteractiveInformation: - ndr_print_ptr(ndr, "password", r->password); - ndr->depth++; - if (r->password) { - ndr_print_netr_PasswordInfo(ndr, "password", r->password); - } - ndr->depth--; - break; - - case NetlogonNetworkInformation: - ndr_print_ptr(ndr, "network", r->network); - ndr->depth++; - if (r->network) { - ndr_print_netr_NetworkInfo(ndr, "network", r->network); - } - ndr->depth--; - break; - - case NetlogonServiceInformation: - ndr_print_ptr(ndr, "password", r->password); - ndr->depth++; - if (r->password) { - ndr_print_netr_PasswordInfo(ndr, "password", r->password); - } - ndr->depth--; - break; - - case NetlogonGenericInformation: - ndr_print_ptr(ndr, "generic", r->generic); - ndr->depth++; - if (r->generic) { - ndr_print_netr_GenericInfo(ndr, "generic", r->generic); - } - ndr->depth--; - break; - - case NetlogonInteractiveTransitiveInformation: - ndr_print_ptr(ndr, "password", r->password); - ndr->depth++; - if (r->password) { - ndr_print_netr_PasswordInfo(ndr, "password", r->password); - } - ndr->depth--; - break; - - case NetlogonNetworkTransitiveInformation: - ndr_print_ptr(ndr, "network", r->network); - ndr->depth++; - if (r->network) { - ndr_print_netr_NetworkInfo(ndr, "network", r->network); - } - ndr->depth--; - break; - - case NetlogonServiceTransitiveInformation: - ndr_print_ptr(ndr, "password", r->password); - ndr->depth++; - if (r->password) { - ndr_print_netr_PasswordInfo(ndr, "password", r->password); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r) -{ - ndr_print_struct(ndr, name, "netr_UserSessionKey"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "key", r->key, 16); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 8)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 8)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *name, const struct netr_LMSessionKey *r) -{ - ndr_print_struct(ndr, name, "netr_LMSessionKey"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "key", r->key, 8); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GUEST", NETLOGON_GUEST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NOENCRYPTION", NETLOGON_NOENCRYPTION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CACHED_ACCOUNT", NETLOGON_CACHED_ACCOUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_USED_LM_PASSWORD", NETLOGON_USED_LM_PASSWORD, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_EXTRA_SIDS", NETLOGON_EXTRA_SIDS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SUBAUTH_SESSION_KEY", NETLOGON_SUBAUTH_SESSION_KEY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SERVER_TRUST_ACCOUNT", NETLOGON_SERVER_TRUST_ACCOUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GRACE_LOGON", NETLOGON_GRACE_LOGON, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_SamBaseInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_SamBaseInfo *r) -{ - uint32_t cntr_unknown_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); - NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups)); - NDR_CHECK(ndr_push_netr_UserFlags(ndr, NDR_SCALARS, r->user_flags)); - NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid)); - NDR_CHECK(ndr_push_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey)); - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); - for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown[cntr_unknown_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain)); - if (r->domain_sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_SamBaseInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_SamBaseInfo *r) -{ - uint32_t _ptr_domain_sid; - TALLOC_CTX *_mem_save_domain_sid_0; - uint32_t cntr_unknown_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); - NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups)); - NDR_CHECK(ndr_pull_netr_UserFlags(ndr, NDR_SCALARS, &r->user_flags)); - NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid)); - if (_ptr_domain_sid) { - NDR_PULL_ALLOC(ndr, r->domain_sid); - } else { - r->domain_sid = NULL; - } - NDR_CHECK(ndr_pull_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey)); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); - for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown[cntr_unknown_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain)); - if (r->domain_sid) { - _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name, const struct netr_SamBaseInfo *r) -{ - uint32_t cntr_unknown_0; - ndr_print_struct(ndr, name, "netr_SamBaseInfo"); - ndr->depth++; - ndr_print_NTTIME(ndr, "last_logon", r->last_logon); - ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); - ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); - ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); - ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change); - ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change); - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "full_name", &r->full_name); - ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); - ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); - ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); - ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); - ndr_print_uint16(ndr, "logon_count", r->logon_count); - ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "primary_gid", r->primary_gid); - ndr_print_samr_RidWithAttributeArray(ndr, "groups", &r->groups); - ndr_print_netr_UserFlags(ndr, "user_flags", r->user_flags); - ndr_print_netr_UserSessionKey(ndr, "key", &r->key); - ndr_print_lsa_StringLarge(ndr, "logon_server", &r->logon_server); - ndr_print_lsa_StringLarge(ndr, "domain", &r->domain); - ndr_print_ptr(ndr, "domain_sid", r->domain_sid); - ndr->depth++; - if (r->domain_sid) { - ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid); - } - ndr->depth--; - ndr_print_netr_LMSessionKey(ndr, "LMSessKey", &r->LMSessKey); - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); - ndr->print(ndr, "%s: ARRAY(%d)", "unknown", (int)7); - ndr->depth++; - for (cntr_unknown_0=0;cntr_unknown_0<7;cntr_unknown_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) { - ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_SamInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_SamInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, const struct netr_SamInfo2 *r) -{ - ndr_print_struct(ndr, name, "netr_SamInfo2"); - ndr->depth++; - ndr_print_netr_SamBaseInfo(ndr, "base", &r->base); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_SidAttr(struct ndr_push *ndr, int ndr_flags, const struct netr_SidAttr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struct netr_SidAttr *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, const struct netr_SidAttr *r) -{ - ndr_print_struct(ndr, name, "netr_SidAttr"); - ndr->depth++; - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r) -{ - uint32_t cntr_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); - if (r->sids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount)); - for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { - NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { - NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r) -{ - uint32_t _ptr_sids; - uint32_t cntr_sids_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); - if (_ptr_sids) { - NDR_PULL_ALLOC(ndr, r->sids); - } else { - r->sids = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); - if (r->sids) { - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); - NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); - _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { - NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { - NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); - } - if (r->sids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r) -{ - uint32_t cntr_sids_1; - ndr_print_struct(ndr, name, "netr_SamInfo3"); - ndr->depth++; - ndr_print_netr_SamBaseInfo(ndr, "base", &r->base); - ndr_print_uint32(ndr, "sidcount", r->sidcount); - ndr_print_ptr(ndr, "sids", r->sids); - ndr->depth++; - if (r->sids) { - ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount); - ndr->depth++; - for (cntr_sids_1=0;cntr_sids_1sidcount;cntr_sids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { - ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo6 *r) -{ - uint32_t cntr_sids_1; - uint32_t cntr_unknown4_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principle)); - for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4[cntr_unknown4_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); - if (r->sids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount)); - for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { - NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { - NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); - } - } - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principle)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo6 *r) -{ - uint32_t _ptr_sids; - uint32_t cntr_sids_1; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_sids_1; - uint32_t cntr_unknown4_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); - if (_ptr_sids) { - NDR_PULL_ALLOC(ndr, r->sids); - } else { - r->sids = NULL; - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principle)); - for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4[cntr_unknown4_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base)); - if (r->sids) { - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); - NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); - _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { - NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1])); - } - for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) { - NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->forest)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principle)); - if (r->sids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r) -{ - uint32_t cntr_sids_1; - uint32_t cntr_unknown4_0; - ndr_print_struct(ndr, name, "netr_SamInfo6"); - ndr->depth++; - ndr_print_netr_SamBaseInfo(ndr, "base", &r->base); - ndr_print_uint32(ndr, "sidcount", r->sidcount); - ndr_print_ptr(ndr, "sids", r->sids); - ndr->depth++; - if (r->sids) { - ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount); - ndr->depth++; - for (cntr_sids_1=0;cntr_sids_1sidcount;cntr_sids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { - ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_lsa_String(ndr, "forest", &r->forest); - ndr_print_lsa_String(ndr, "principle", &r->principle); - ndr->print(ndr, "%s: ARRAY(%d)", "unknown4", (int)20); - ndr->depth++; - for (cntr_unknown4_0=0;cntr_unknown4_0<20;cntr_unknown4_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_unknown4_0) != -1) { - ndr_print_uint32(ndr, "unknown4", r->unknown4[cntr_unknown4_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_PacInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PacInfo *r) -{ - uint32_t cntr_expansionroom_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_domain)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_server)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principal_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->auth)); - NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key)); - for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->expansionroom[cntr_expansionroom_0])); - } - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->pac) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->pac, r->pac_size)); - } - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_server)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principal_name)); - if (r->auth) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->auth, r->auth_size)); - } - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_PacInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PacInfo *r) -{ - uint32_t _ptr_pac; - TALLOC_CTX *_mem_save_pac_0; - uint32_t _ptr_auth; - TALLOC_CTX *_mem_save_auth_0; - uint32_t cntr_expansionroom_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pac_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac)); - if (_ptr_pac) { - NDR_PULL_ALLOC(ndr, r->pac); - } else { - r->pac = NULL; - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_domain)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_server)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principal_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_auth)); - if (_ptr_auth) { - NDR_PULL_ALLOC(ndr, r->auth); - } else { - r->auth = NULL; - } - NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key)); - for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->expansionroom[cntr_expansionroom_0])); - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->pac) { - _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->pac)); - NDR_PULL_ALLOC_N(ndr, r->pac, ndr_get_array_size(ndr, &r->pac)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->pac, ndr_get_array_size(ndr, &r->pac))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0); - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_server)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principal_name)); - if (r->auth) { - _mem_save_auth_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->auth, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->auth)); - NDR_PULL_ALLOC_N(ndr, r->auth, ndr_get_array_size(ndr, &r->auth)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->auth, ndr_get_array_size(ndr, &r->auth))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_0, 0); - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - if (r->pac) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->pac, r->pac_size)); - } - if (r->auth) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->auth, r->auth_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r) -{ - uint32_t cntr_expansionroom_0; - ndr_print_struct(ndr, name, "netr_PacInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "pac_size", r->pac_size); - ndr_print_ptr(ndr, "pac", r->pac); - ndr->depth++; - if (r->pac) { - ndr_print_array_uint8(ndr, "pac", r->pac, r->pac_size); - } - ndr->depth--; - ndr_print_lsa_String(ndr, "logon_domain", &r->logon_domain); - ndr_print_lsa_String(ndr, "logon_server", &r->logon_server); - ndr_print_lsa_String(ndr, "principal_name", &r->principal_name); - ndr_print_uint32(ndr, "auth_size", r->auth_size); - ndr_print_ptr(ndr, "auth", r->auth); - ndr->depth++; - if (r->auth) { - ndr_print_array_uint8(ndr, "auth", r->auth, r->auth_size); - } - ndr->depth--; - ndr_print_netr_UserSessionKey(ndr, "user_session_key", &r->user_session_key); - ndr->print(ndr, "%s: ARRAY(%d)", "expansionroom", (int)10); - ndr->depth++; - for (cntr_expansionroom_0=0;cntr_expansionroom_0<10;cntr_expansionroom_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_expansionroom_0) != -1) { - ndr_print_uint32(ndr, "expansionroom", r->expansionroom[cntr_expansionroom_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_GenericInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo2 *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_GenericInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo2 *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r) -{ - ndr_print_struct(ndr, name, "netr_GenericInfo2"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint32(ndr, "length", r->length); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->length); - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case NetlogonValidationSamInfo: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam2)); - break; } - - case NetlogonValidationSamInfo2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam3)); - break; } - - case 4: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac)); - break; } - - case NetlogonValidationGenericInfo2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic)); - break; } - - case NetlogonValidationSamInfo4: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam6)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NetlogonValidationSamInfo: - if (r->sam2) { - NDR_CHECK(ndr_push_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2)); - } - break; - - case NetlogonValidationSamInfo2: - if (r->sam3) { - NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3)); - } - break; - - case 4: - if (r->pac) { - NDR_CHECK(ndr_push_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac)); - } - break; - - case NetlogonValidationGenericInfo2: - if (r->generic) { - NDR_CHECK(ndr_push_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic)); - } - break; - - case NetlogonValidationSamInfo4: - if (r->sam6) { - NDR_CHECK(ndr_push_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r) -{ - int level; - uint16_t _level; - TALLOC_CTX *_mem_save_sam2_0; - TALLOC_CTX *_mem_save_sam3_0; - TALLOC_CTX *_mem_save_pac_0; - TALLOC_CTX *_mem_save_generic_0; - TALLOC_CTX *_mem_save_sam6_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case NetlogonValidationSamInfo: { - uint32_t _ptr_sam2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam2)); - if (_ptr_sam2) { - NDR_PULL_ALLOC(ndr, r->sam2); - } else { - r->sam2 = NULL; - } - break; } - - case NetlogonValidationSamInfo2: { - uint32_t _ptr_sam3; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam3)); - if (_ptr_sam3) { - NDR_PULL_ALLOC(ndr, r->sam3); - } else { - r->sam3 = NULL; - } - break; } - - case 4: { - uint32_t _ptr_pac; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac)); - if (_ptr_pac) { - NDR_PULL_ALLOC(ndr, r->pac); - } else { - r->pac = NULL; - } - break; } - - case NetlogonValidationGenericInfo2: { - uint32_t _ptr_generic; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic)); - if (_ptr_generic) { - NDR_PULL_ALLOC(ndr, r->generic); - } else { - r->generic = NULL; - } - break; } - - case NetlogonValidationSamInfo4: { - uint32_t _ptr_sam6; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam6)); - if (_ptr_sam6) { - NDR_PULL_ALLOC(ndr, r->sam6); - } else { - r->sam6 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case NetlogonValidationSamInfo: - if (r->sam2) { - _mem_save_sam2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sam2, 0); - NDR_CHECK(ndr_pull_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam2_0, 0); - } - break; - - case NetlogonValidationSamInfo2: - if (r->sam3) { - _mem_save_sam3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sam3, 0); - NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam3_0, 0); - } - break; - - case 4: - if (r->pac) { - _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0); - NDR_CHECK(ndr_pull_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0); - } - break; - - case NetlogonValidationGenericInfo2: - if (r->generic) { - _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0); - NDR_CHECK(ndr_pull_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0); - } - break; - - case NetlogonValidationSamInfo4: - if (r->sam6) { - _mem_save_sam6_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sam6, 0); - NDR_CHECK(ndr_pull_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam6_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "netr_Validation"); - switch (level) { - case NetlogonValidationSamInfo: - ndr_print_ptr(ndr, "sam2", r->sam2); - ndr->depth++; - if (r->sam2) { - ndr_print_netr_SamInfo2(ndr, "sam2", r->sam2); - } - ndr->depth--; - break; - - case NetlogonValidationSamInfo2: - ndr_print_ptr(ndr, "sam3", r->sam3); - ndr->depth++; - if (r->sam3) { - ndr_print_netr_SamInfo3(ndr, "sam3", r->sam3); - } - ndr->depth--; - break; - - case 4: - ndr_print_ptr(ndr, "pac", r->pac); - ndr->depth++; - if (r->pac) { - ndr_print_netr_PacInfo(ndr, "pac", r->pac); - } - ndr->depth--; - break; - - case NetlogonValidationGenericInfo2: - ndr_print_ptr(ndr, "generic", r->generic); - ndr->depth++; - if (r->generic) { - ndr_print_netr_GenericInfo2(ndr, "generic", r->generic); - } - ndr->depth--; - break; - - case NetlogonValidationSamInfo4: - ndr_print_ptr(ndr, "sam6", r->sam6); - ndr->depth++; - if (r->sam6) { - ndr_print_netr_SamInfo6(ndr, "sam6", r->sam6); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 8)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 8)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const struct netr_Credential *r) -{ - ndr_print_struct(ndr, name, "netr_Credential"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "data", r->data, 8); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, &r->cred)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, &r->cred)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r) -{ - ndr_print_struct(ndr, name, "netr_Authenticator"); - ndr->depth++; - ndr_print_netr_Credential(ndr, "cred", &r->cred); - ndr_print_time_t(ndr, "timestamp", r->timestamp); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_DELETE_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_USER *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->account_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_USER *r) -{ - uint32_t _ptr_account_name; - TALLOC_CTX *_mem_save_account_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name)); - if (_ptr_account_name) { - NDR_PULL_ALLOC(ndr, r->account_name); - } else { - r->account_name = NULL; - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->account_name) { - _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name)); - if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->account_name), ndr_get_array_length(ndr, &r->account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0); - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_DELETE_USER"); - ndr->depth++; - ndr_print_ptr(ndr, "account_name", r->account_name); - ndr->depth++; - if (r->account_name) { - ndr_print_string(ndr, "account_name", r->account_name); - } - ndr->depth--; - ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_USER_KEY16(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY16 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->pwd)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_USER_KEY16(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY16 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->pwd)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r) -{ - ndr_print_struct(ndr, name, "netr_USER_KEY16"); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size); - ndr_print_uint32(ndr, "flags", r->flags); - ndr_print_samr_Password(ndr, "pwd", &r->pwd); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_PasswordHistory(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordHistory *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_flags)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lm_flags)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_PasswordHistory(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordHistory *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nt_flags)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lm_flags)); - NDR_PULL_ALLOC_N(ndr, r->nt_history, r->nt_length); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length)); - NDR_PULL_ALLOC_N(ndr, r->lm_history, r->lm_length); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r) -{ - ndr_print_struct(ndr, name, "netr_PasswordHistory"); - ndr->depth++; - ndr_print_uint16(ndr, "nt_length", r->nt_length); - ndr_print_uint16(ndr, "nt_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->nt_length:r->nt_size); - ndr_print_uint32(ndr, "nt_flags", r->nt_flags); - ndr_print_uint16(ndr, "lm_length", r->lm_length); - ndr_print_uint16(ndr, "lm_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->lm_length:r->lm_size); - ndr_print_uint32(ndr, "lm_flags", r->lm_flags); - ndr_print_array_uint8(ndr, "nt_history", r->nt_history, r->nt_length); - ndr_print_array_uint8(ndr, "lm_history", r->lm_history, r->lm_length); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_USER_KEYS2(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword)); - NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword)); - NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_USER_KEYS2(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword)); - NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword)); - NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS2 *r) -{ - ndr_print_struct(ndr, name, "netr_USER_KEYS2"); - ndr->depth++; - ndr_print_netr_USER_KEY16(ndr, "lmpassword", &r->lmpassword); - ndr_print_netr_USER_KEY16(ndr, "ntpassword", &r->ntpassword); - ndr_print_netr_PasswordHistory(ndr, "history", &r->history); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_USER_KEY_UNION(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY_UNION *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_USER_KEY_UNION(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY_UNION *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY_UNION *r) -{ - ndr_print_struct(ndr, name, "netr_USER_KEY_UNION"); - ndr->depth++; - ndr_print_netr_USER_KEYS2(ndr, "keys2", &r->keys2); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS *r) -{ - ndr_print_struct(ndr, name, "netr_USER_KEYS"); - ndr->depth++; - ndr_print_uint32(ndr, "version", r->version); - ndr_print_netr_USER_KEY_UNION(ndr, "keys", &r->keys); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_USER_PRIVATE_INFO(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_PRIVATE_INFO *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->SensitiveDataFlag)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength)); - { - uint32_t _flags_save_uint8 = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->SensitiveData)); - ndr->flags = _flags_save_uint8; - } - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_uint8 = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (r->SensitiveData) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, r->DataLength)); - } - ndr->flags = _flags_save_uint8; - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_PRIVATE_INFO *r) -{ - uint32_t _ptr_SensitiveData; - TALLOC_CTX *_mem_save_SensitiveData_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->SensitiveDataFlag)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->DataLength)); - { - uint32_t _flags_save_uint8 = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_SensitiveData)); - if (_ptr_SensitiveData) { - NDR_PULL_ALLOC(ndr, r->SensitiveData); - } else { - r->SensitiveData = NULL; - } - ndr->flags = _flags_save_uint8; - } - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_uint8 = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (r->SensitiveData) { - _mem_save_SensitiveData_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->SensitiveData, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->SensitiveData)); - NDR_PULL_ALLOC_N(ndr, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_SensitiveData_0, 0); - } - ndr->flags = _flags_save_uint8; - } - if (r->SensitiveData) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->SensitiveData, r->DataLength)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char *name, const struct netr_USER_PRIVATE_INFO *r) -{ - ndr_print_struct(ndr, name, "netr_USER_PRIVATE_INFO"); - ndr->depth++; - ndr_print_uint8(ndr, "SensitiveDataFlag", r->SensitiveDataFlag); - ndr_print_uint32(ndr, "DataLength", r->DataLength); - ndr_print_ptr(ndr, "SensitiveData", r->SensitiveData); - ndr->depth++; - if (r->SensitiveData) { - ndr_print_array_uint8(ndr, "SensitiveData", r->SensitiveData, r->DataLength); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_USER *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword)); - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_present)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_present)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page)); - NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); - NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_USER *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword)); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_present)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_present)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page)); - NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); - NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_USER *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_USER"); - ndr->depth++; - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "full_name", &r->full_name); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "primary_gid", r->primary_gid); - ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); - ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); - ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr_print_lsa_String(ndr, "workstations", &r->workstations); - ndr_print_NTTIME(ndr, "last_logon", r->last_logon); - ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); - ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); - ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); - ndr_print_uint16(ndr, "logon_count", r->logon_count); - ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); - ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); - ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword); - ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword); - ndr_print_uint8(ndr, "nt_password_present", r->nt_password_present); - ndr_print_uint8(ndr, "lm_password_present", r->lm_password_present); - ndr_print_uint8(ndr, "password_expired", r->password_expired); - ndr_print_lsa_String(ndr, "comment", &r->comment); - ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters); - ndr_print_uint16(ndr, "country_code", r->country_code); - ndr_print_uint16(ndr, "code_page", r->code_page); - ndr_print_netr_USER_PRIVATE_INFO(ndr, "user_private_info", &r->user_private_info); - ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); - ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); - ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DOMAIN *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); - NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->force_logoff_time)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length)); - NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age)); - NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_to_chgpass)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DOMAIN *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); - NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->force_logoff_time)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length)); - NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age)); - NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_to_chgpass)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DOMAIN *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_DOMAIN"); - ndr->depth++; - ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); - ndr_print_lsa_String(ndr, "oem_information", &r->oem_information); - ndr_print_dlong(ndr, "force_logoff_time", r->force_logoff_time); - ndr_print_uint16(ndr, "min_password_length", r->min_password_length); - ndr_print_uint16(ndr, "password_history_length", r->password_history_length); - ndr_print_dlong(ndr, "max_password_age", r->max_password_age); - ndr_print_dlong(ndr, "min_password_age", r->min_password_age); - ndr_print_udlong(ndr, "sequence_num", r->sequence_num); - ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time); - ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); - ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); - ndr_print_lsa_BinaryString(ndr, "account_lockout", &r->account_lockout); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "logon_to_chgpass", r->logon_to_chgpass); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_GROUP(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->group_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->group_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_GROUP(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->group_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->group_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_GROUP"); - ndr->depth++; - ndr_print_lsa_String(ndr, "group_name", &r->group_name); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "attributes", r->attributes); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); - ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); - ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_RENAME(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_RENAME *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->OldName)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->NewName)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->OldName)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->NewName)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_RENAME(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_RENAME *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->OldName)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->NewName)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->OldName)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->NewName)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *name, const struct netr_DELTA_RENAME *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_RENAME"); - ndr->depth++; - ndr_print_lsa_String(ndr, "OldName", &r->OldName); - ndr_print_lsa_String(ndr, "NewName", &r->NewName); - ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_GROUP_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP_MEMBER *r) -{ - uint32_t cntr_rids_1; - uint32_t cntr_attribs_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->rids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids)); - for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1])); - } - } - if (r->attribs) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids)); - for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribs[cntr_attribs_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP_MEMBER *r) -{ - uint32_t _ptr_rids; - uint32_t cntr_rids_1; - TALLOC_CTX *_mem_save_rids_0; - TALLOC_CTX *_mem_save_rids_1; - uint32_t _ptr_attribs; - uint32_t cntr_attribs_1; - TALLOC_CTX *_mem_save_attribs_0; - TALLOC_CTX *_mem_save_attribs_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); - if (_ptr_rids) { - NDR_PULL_ALLOC(ndr, r->rids); - } else { - r->rids = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribs)); - if (_ptr_attribs) { - NDR_PULL_ALLOC(ndr, r->attribs); - } else { - r->attribs = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->rids) { - _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->rids)); - NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids)); - _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); - for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); - } - if (r->attribs) { - _mem_save_attribs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->attribs)); - NDR_PULL_ALLOC_N(ndr, r->attribs, ndr_get_array_size(ndr, &r->attribs)); - _mem_save_attribs_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0); - for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribs[cntr_attribs_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_0, 0); - } - if (r->rids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids)); - } - if (r->attribs) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attribs, r->num_rids)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP_MEMBER *r) -{ - uint32_t cntr_rids_1; - uint32_t cntr_attribs_1; - ndr_print_struct(ndr, name, "netr_DELTA_GROUP_MEMBER"); - ndr->depth++; - ndr_print_ptr(ndr, "rids", r->rids); - ndr->depth++; - if (r->rids) { - ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->num_rids); - ndr->depth++; - for (cntr_rids_1=0;cntr_rids_1num_rids;cntr_rids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) { - ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_ptr(ndr, "attribs", r->attribs); - ndr->depth++; - if (r->attribs) { - ndr->print(ndr, "%s: ARRAY(%d)", "attribs", (int)r->num_rids); - ndr->depth++; - for (cntr_attribs_1=0;cntr_attribs_1num_rids;cntr_attribs_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_attribs_1) != -1) { - ndr_print_uint32(ndr, "attribs", r->attribs[cntr_attribs_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_uint32(ndr, "num_rids", r->num_rids); - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr_print_uint32(ndr, "unknown3", r->unknown3); - ndr_print_uint32(ndr, "unknown4", r->unknown4); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_ALIAS(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->alias_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->alias_name)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->alias_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->alias_name)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_ALIAS(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_ALIAS"); - ndr->depth++; - ndr_print_lsa_String(ndr, "alias_name", &r->alias_name); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); - ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_ALIAS_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS_MEMBER *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS, &r->sids)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS_MEMBER *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS, &r->sids)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS_MEMBER *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_ALIAS_MEMBER"); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", &r->sids); - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr_print_uint32(ndr, "unknown3", r->unknown3); - ndr_print_uint32(ndr, "unknown4", r->unknown4); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_QUOTA_LIMITS(struct ndr_push *ndr, int ndr_flags, const struct netr_QUOTA_LIMITS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagedpoollimit)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nonpagedpoollimit)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minimumworkingsetsize)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximumworkingsetsize)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagefilelimit)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->timelimit)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull *ndr, int ndr_flags, struct netr_QUOTA_LIMITS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagedpoollimit)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nonpagedpoollimit)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minimumworkingsetsize)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximumworkingsetsize)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagefilelimit)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->timelimit)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_QUOTA_LIMITS(struct ndr_print *ndr, const char *name, const struct netr_QUOTA_LIMITS *r) -{ - ndr_print_struct(ndr, name, "netr_QUOTA_LIMITS"); - ndr->depth++; - ndr_print_uint32(ndr, "pagedpoollimit", r->pagedpoollimit); - ndr_print_uint32(ndr, "nonpagedpoollimit", r->nonpagedpoollimit); - ndr_print_uint32(ndr, "minimumworkingsetsize", r->minimumworkingsetsize); - ndr_print_uint32(ndr, "maximumworkingsetsize", r->maximumworkingsetsize); - ndr_print_uint32(ndr, "pagefilelimit", r->pagefilelimit); - ndr_print_NTTIME(ndr, "timelimit", r->timelimit); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_POLICY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_POLICY *r) -{ - uint32_t cntr_eventauditoptions_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlogsize)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->auditretentionperiod)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auditingmode)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxauditeventcount)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->eventauditoptions)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->db_create_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->eventauditoptions) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxauditeventcount + 1)); - for (cntr_eventauditoptions_1 = 0; cntr_eventauditoptions_1 < r->maxauditeventcount + 1; cntr_eventauditoptions_1++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->eventauditoptions[cntr_eventauditoptions_1])); - } - } - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary_domain_name)); - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_POLICY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_POLICY *r) -{ - uint32_t _ptr_eventauditoptions; - uint32_t cntr_eventauditoptions_1; - TALLOC_CTX *_mem_save_eventauditoptions_0; - TALLOC_CTX *_mem_save_eventauditoptions_1; - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlogsize)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->auditretentionperiod)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auditingmode)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxauditeventcount)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_eventauditoptions)); - if (_ptr_eventauditoptions) { - NDR_PULL_ALLOC(ndr, r->eventauditoptions); - } else { - r->eventauditoptions = NULL; - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->db_create_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->eventauditoptions) { - _mem_save_eventauditoptions_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->eventauditoptions, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->eventauditoptions)); - NDR_PULL_ALLOC_N(ndr, r->eventauditoptions, ndr_get_array_size(ndr, &r->eventauditoptions)); - _mem_save_eventauditoptions_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->eventauditoptions, 0); - for (cntr_eventauditoptions_1 = 0; cntr_eventauditoptions_1 < r->maxauditeventcount + 1; cntr_eventauditoptions_1++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->eventauditoptions[cntr_eventauditoptions_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eventauditoptions_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eventauditoptions_0, 0); - } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary_domain_name)); - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - if (r->eventauditoptions) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->eventauditoptions, r->maxauditeventcount + 1)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_POLICY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_POLICY *r) -{ - uint32_t cntr_eventauditoptions_1; - ndr_print_struct(ndr, name, "netr_DELTA_POLICY"); - ndr->depth++; - ndr_print_uint32(ndr, "maxlogsize", r->maxlogsize); - ndr_print_NTTIME(ndr, "auditretentionperiod", r->auditretentionperiod); - ndr_print_uint8(ndr, "auditingmode", r->auditingmode); - ndr_print_uint32(ndr, "maxauditeventcount", r->maxauditeventcount); - ndr_print_ptr(ndr, "eventauditoptions", r->eventauditoptions); - ndr->depth++; - if (r->eventauditoptions) { - ndr->print(ndr, "%s: ARRAY(%d)", "eventauditoptions", (int)r->maxauditeventcount + 1); - ndr->depth++; - for (cntr_eventauditoptions_1=0;cntr_eventauditoptions_1maxauditeventcount + 1;cntr_eventauditoptions_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_eventauditoptions_1) != -1) { - ndr_print_uint32(ndr, "eventauditoptions", r->eventauditoptions[cntr_eventauditoptions_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_lsa_String(ndr, "primary_domain_name", &r->primary_domain_name); - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr_print_netr_QUOTA_LIMITS(ndr, "quota_limits", &r->quota_limits); - ndr_print_udlong(ndr, "sequence_num", r->sequence_num); - ndr_print_NTTIME(ndr, "db_create_time", r->db_create_time); - ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); - ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); - ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_TRUSTED_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_TRUSTED_DOMAIN *r) -{ - uint32_t cntr_controller_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_controllers)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->controller_names)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->posix_offset)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - if (r->controller_names) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_controllers)); - for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->controller_names[cntr_controller_names_1])); - } - for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->controller_names[cntr_controller_names_1])); - } - } - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_TRUSTED_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_TRUSTED_DOMAIN *r) -{ - uint32_t _ptr_controller_names; - uint32_t cntr_controller_names_1; - TALLOC_CTX *_mem_save_controller_names_0; - TALLOC_CTX *_mem_save_controller_names_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_controllers)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_controller_names)); - if (_ptr_controller_names) { - NDR_PULL_ALLOC(ndr, r->controller_names); - } else { - r->controller_names = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->posix_offset)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - if (r->controller_names) { - _mem_save_controller_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->controller_names, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->controller_names)); - NDR_PULL_ALLOC_N(ndr, r->controller_names, ndr_get_array_size(ndr, &r->controller_names)); - _mem_save_controller_names_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->controller_names, 0); - for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->controller_names[cntr_controller_names_1])); - } - for (cntr_controller_names_1 = 0; cntr_controller_names_1 < r->num_controllers; cntr_controller_names_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->controller_names[cntr_controller_names_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_controller_names_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_controller_names_0, 0); - } - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - if (r->controller_names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->controller_names, r->num_controllers)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_TRUSTED_DOMAIN *r) -{ - uint32_t cntr_controller_names_1; - ndr_print_struct(ndr, name, "netr_DELTA_TRUSTED_DOMAIN"); - ndr->depth++; - ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); - ndr_print_uint32(ndr, "num_controllers", r->num_controllers); - ndr_print_ptr(ndr, "controller_names", r->controller_names); - ndr->depth++; - if (r->controller_names) { - ndr->print(ndr, "%s: ARRAY(%d)", "controller_names", (int)r->num_controllers); - ndr->depth++; - for (cntr_controller_names_1=0;cntr_controller_names_1num_controllers;cntr_controller_names_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_controller_names_1) != -1) { - ndr_print_lsa_String(ndr, "controller_names", &r->controller_names[cntr_controller_names_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); - ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); - ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "posix_offset", r->posix_offset); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_DELETE_TRUST(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_TRUST *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_TRUST(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_TRUST *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_TRUST *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_DELETE_TRUST"); - ndr->depth++; - ndr_print_uint16(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ACCOUNT *r) -{ - uint32_t cntr_privilege_attrib_1; - uint32_t cntr_privilege_name_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_entries)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_control)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->privilege_attrib)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->privilege_name)); - NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quotalimits)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->system_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->privilege_attrib) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_entries)); - for (cntr_privilege_attrib_1 = 0; cntr_privilege_attrib_1 < r->privilege_entries; cntr_privilege_attrib_1++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_attrib[cntr_privilege_attrib_1])); - } - } - if (r->privilege_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->privilege_entries)); - for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->privilege_name[cntr_privilege_name_1])); - } - for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->privilege_name[cntr_privilege_name_1])); - } - } - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ACCOUNT *r) -{ - uint32_t _ptr_privilege_attrib; - uint32_t cntr_privilege_attrib_1; - TALLOC_CTX *_mem_save_privilege_attrib_0; - TALLOC_CTX *_mem_save_privilege_attrib_1; - uint32_t _ptr_privilege_name; - uint32_t cntr_privilege_name_1; - TALLOC_CTX *_mem_save_privilege_name_0; - TALLOC_CTX *_mem_save_privilege_name_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_entries)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_control)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privilege_attrib)); - if (_ptr_privilege_attrib) { - NDR_PULL_ALLOC(ndr, r->privilege_attrib); - } else { - r->privilege_attrib = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privilege_name)); - if (_ptr_privilege_name) { - NDR_PULL_ALLOC(ndr, r->privilege_name); - } else { - r->privilege_name = NULL; - } - NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quotalimits)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->system_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->privilege_attrib) { - _mem_save_privilege_attrib_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->privilege_attrib, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->privilege_attrib)); - NDR_PULL_ALLOC_N(ndr, r->privilege_attrib, ndr_get_array_size(ndr, &r->privilege_attrib)); - _mem_save_privilege_attrib_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->privilege_attrib, 0); - for (cntr_privilege_attrib_1 = 0; cntr_privilege_attrib_1 < r->privilege_entries; cntr_privilege_attrib_1++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->privilege_attrib[cntr_privilege_attrib_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_attrib_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_attrib_0, 0); - } - if (r->privilege_name) { - _mem_save_privilege_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->privilege_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->privilege_name)); - NDR_PULL_ALLOC_N(ndr, r->privilege_name, ndr_get_array_size(ndr, &r->privilege_name)); - _mem_save_privilege_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->privilege_name, 0); - for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->privilege_name[cntr_privilege_name_1])); - } - for (cntr_privilege_name_1 = 0; cntr_privilege_name_1 < r->privilege_entries; cntr_privilege_name_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->privilege_name[cntr_privilege_name_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_name_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privilege_name_0, 0); - } - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - if (r->privilege_attrib) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privilege_attrib, r->privilege_entries)); - } - if (r->privilege_name) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privilege_name, r->privilege_entries)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ACCOUNT *r) -{ - uint32_t cntr_privilege_attrib_1; - uint32_t cntr_privilege_name_1; - ndr_print_struct(ndr, name, "netr_DELTA_ACCOUNT"); - ndr->depth++; - ndr_print_uint32(ndr, "privilege_entries", r->privilege_entries); - ndr_print_uint32(ndr, "privilege_control", r->privilege_control); - ndr_print_ptr(ndr, "privilege_attrib", r->privilege_attrib); - ndr->depth++; - if (r->privilege_attrib) { - ndr->print(ndr, "%s: ARRAY(%d)", "privilege_attrib", (int)r->privilege_entries); - ndr->depth++; - for (cntr_privilege_attrib_1=0;cntr_privilege_attrib_1privilege_entries;cntr_privilege_attrib_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_privilege_attrib_1) != -1) { - ndr_print_uint32(ndr, "privilege_attrib", r->privilege_attrib[cntr_privilege_attrib_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_ptr(ndr, "privilege_name", r->privilege_name); - ndr->depth++; - if (r->privilege_name) { - ndr->print(ndr, "%s: ARRAY(%d)", "privilege_name", (int)r->privilege_entries); - ndr->depth++; - for (cntr_privilege_name_1=0;cntr_privilege_name_1privilege_entries;cntr_privilege_name_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_privilege_name_1) != -1) { - ndr_print_lsa_String(ndr, "privilege_name", &r->privilege_name[cntr_privilege_name_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_netr_QUOTA_LIMITS(ndr, "quotalimits", &r->quotalimits); - ndr_print_uint32(ndr, "system_flags", r->system_flags); - ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); - ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); - ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_DELETE_ACCOUNT(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_ACCOUNT *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_ACCOUNT(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_ACCOUNT *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_ACCOUNT *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_DELETE_ACCOUNT"); - ndr->depth++; - ndr_print_uint16(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_DELETE_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_SECRET *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_SECRET *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_SECRET *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_DELETE_SECRET"); - ndr->depth++; - ndr_print_uint16(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_CIPHER_VALUE(struct ndr_push *ndr, int ndr_flags, const struct netr_CIPHER_VALUE *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlen)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->cipher_data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->cipher_data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->cipher_data, r->len)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_CIPHER_VALUE(struct ndr_pull *ndr, int ndr_flags, struct netr_CIPHER_VALUE *r) -{ - uint32_t _ptr_cipher_data; - TALLOC_CTX *_mem_save_cipher_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlen)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cipher_data)); - if (_ptr_cipher_data) { - NDR_PULL_ALLOC(ndr, r->cipher_data); - } else { - r->cipher_data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->cipher_data) { - _mem_save_cipher_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->cipher_data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->cipher_data)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->cipher_data)); - if (ndr_get_array_length(ndr, &r->cipher_data) > ndr_get_array_size(ndr, &r->cipher_data)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->cipher_data), ndr_get_array_length(ndr, &r->cipher_data)); - } - NDR_PULL_ALLOC_N(ndr, r->cipher_data, ndr_get_array_size(ndr, &r->cipher_data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->cipher_data, ndr_get_array_length(ndr, &r->cipher_data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cipher_data_0, 0); - } - if (r->cipher_data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cipher_data, r->maxlen)); - } - if (r->cipher_data) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->cipher_data, r->len)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_CIPHER_VALUE(struct ndr_print *ndr, const char *name, const struct netr_CIPHER_VALUE *r) -{ - ndr_print_struct(ndr, name, "netr_CIPHER_VALUE"); - ndr->depth++; - ndr_print_uint32(ndr, "len", r->len); - ndr_print_uint32(ndr, "maxlen", r->maxlen); - ndr_print_ptr(ndr, "cipher_data", r->cipher_data); - ndr->depth++; - if (r->cipher_data) { - ndr_print_array_uint8(ndr, "cipher_data", r->cipher_data, r->len); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_SECRET(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_SECRET *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->current_cipher)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->current_cipher_set_time)); - NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->old_cipher)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->old_cipher_set_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->current_cipher)); - NDR_CHECK(ndr_push_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->old_cipher)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_SECRET(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_SECRET *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->current_cipher)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->current_cipher_set_time)); - NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_SCALARS, &r->old_cipher)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->old_cipher_set_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->current_cipher)); - NDR_CHECK(ndr_pull_netr_CIPHER_VALUE(ndr, NDR_BUFFERS, &r->old_cipher)); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_SECRET *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_SECRET"); - ndr->depth++; - ndr_print_netr_CIPHER_VALUE(ndr, "current_cipher", &r->current_cipher); - ndr_print_NTTIME(ndr, "current_cipher_set_time", r->current_cipher_set_time); - ndr_print_netr_CIPHER_VALUE(ndr, "old_cipher", &r->old_cipher); - ndr_print_NTTIME(ndr, "old_cipher_set_time", r->old_cipher_set_time); - ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); - ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); - ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); - ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr_print_uint32(ndr, "unknown6", r->unknown6); - ndr_print_uint32(ndr, "unknown7", r->unknown7); - ndr_print_uint32(ndr, "unknown8", r->unknown8); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DeltaEnum(struct ndr_push *ndr, int ndr_flags, enum netr_DeltaEnum r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DeltaEnum(struct ndr_pull *ndr, int ndr_flags, enum netr_DeltaEnum *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DeltaEnum(struct ndr_print *ndr, const char *name, enum netr_DeltaEnum r) -{ - const char *val = NULL; - - switch (r) { - case NETR_DELTA_DOMAIN: val = "NETR_DELTA_DOMAIN"; break; - case NETR_DELTA_GROUP: val = "NETR_DELTA_GROUP"; break; - case NETR_DELTA_DELETE_GROUP: val = "NETR_DELTA_DELETE_GROUP"; break; - case NETR_DELTA_RENAME_GROUP: val = "NETR_DELTA_RENAME_GROUP"; break; - case NETR_DELTA_USER: val = "NETR_DELTA_USER"; break; - case NETR_DELTA_DELETE_USER: val = "NETR_DELTA_DELETE_USER"; break; - case NETR_DELTA_RENAME_USER: val = "NETR_DELTA_RENAME_USER"; break; - case NETR_DELTA_GROUP_MEMBER: val = "NETR_DELTA_GROUP_MEMBER"; break; - case NETR_DELTA_ALIAS: val = "NETR_DELTA_ALIAS"; break; - case NETR_DELTA_DELETE_ALIAS: val = "NETR_DELTA_DELETE_ALIAS"; break; - case NETR_DELTA_RENAME_ALIAS: val = "NETR_DELTA_RENAME_ALIAS"; break; - case NETR_DELTA_ALIAS_MEMBER: val = "NETR_DELTA_ALIAS_MEMBER"; break; - case NETR_DELTA_POLICY: val = "NETR_DELTA_POLICY"; break; - case NETR_DELTA_TRUSTED_DOMAIN: val = "NETR_DELTA_TRUSTED_DOMAIN"; break; - case NETR_DELTA_DELETE_TRUST: val = "NETR_DELTA_DELETE_TRUST"; break; - case NETR_DELTA_ACCOUNT: val = "NETR_DELTA_ACCOUNT"; break; - case NETR_DELTA_DELETE_ACCOUNT: val = "NETR_DELTA_DELETE_ACCOUNT"; break; - case NETR_DELTA_SECRET: val = "NETR_DELTA_SECRET"; break; - case NETR_DELTA_DELETE_SECRET: val = "NETR_DELTA_DELETE_SECRET"; break; - case NETR_DELTA_DELETE_GROUP2: val = "NETR_DELTA_DELETE_GROUP2"; break; - case NETR_DELTA_DELETE_USER2: val = "NETR_DELTA_DELETE_USER2"; break; - case NETR_DELTA_MODIFY_COUNT: val = "NETR_DELTA_MODIFY_COUNT"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_netr_DELTA_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_UNION *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level)); - switch (level) { - case NETR_DELTA_DOMAIN: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - break; } - - case NETR_DELTA_GROUP: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->group)); - break; } - - case NETR_DELTA_DELETE_GROUP: { - break; } - - case NETR_DELTA_RENAME_GROUP: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_group)); - break; } - - case NETR_DELTA_USER: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); - break; } - - case NETR_DELTA_DELETE_USER: { - break; } - - case NETR_DELTA_RENAME_USER: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_user)); - break; } - - case NETR_DELTA_GROUP_MEMBER: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_member)); - break; } - - case NETR_DELTA_ALIAS: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias)); - break; } - - case NETR_DELTA_DELETE_ALIAS: { - break; } - - case NETR_DELTA_RENAME_ALIAS: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_alias)); - break; } - - case NETR_DELTA_ALIAS_MEMBER: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias_member)); - break; } - - case NETR_DELTA_POLICY: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy)); - break; } - - case NETR_DELTA_TRUSTED_DOMAIN: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domain)); - break; } - - case NETR_DELTA_DELETE_TRUST: { - NDR_CHECK(ndr_push_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust)); - break; } - - case NETR_DELTA_ACCOUNT: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->account)); - break; } - - case NETR_DELTA_DELETE_ACCOUNT: { - NDR_CHECK(ndr_push_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account)); - break; } - - case NETR_DELTA_SECRET: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->secret)); - break; } - - case NETR_DELTA_DELETE_SECRET: { - NDR_CHECK(ndr_push_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret)); - break; } - - case NETR_DELTA_DELETE_GROUP2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_group)); - break; } - - case NETR_DELTA_DELETE_USER2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_user)); - break; } - - case NETR_DELTA_MODIFY_COUNT: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->modified_count)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NETR_DELTA_DOMAIN: - if (r->domain) { - NDR_CHECK(ndr_push_netr_DELTA_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain)); - } - break; - - case NETR_DELTA_GROUP: - if (r->group) { - NDR_CHECK(ndr_push_netr_DELTA_GROUP(ndr, NDR_SCALARS|NDR_BUFFERS, r->group)); - } - break; - - case NETR_DELTA_DELETE_GROUP: - break; - - case NETR_DELTA_RENAME_GROUP: - if (r->rename_group) { - NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_group)); - } - break; - - case NETR_DELTA_USER: - if (r->user) { - NDR_CHECK(ndr_push_netr_DELTA_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->user)); - } - break; - - case NETR_DELTA_DELETE_USER: - break; - - case NETR_DELTA_RENAME_USER: - if (r->rename_user) { - NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_user)); - } - break; - - case NETR_DELTA_GROUP_MEMBER: - if (r->group_member) { - NDR_CHECK(ndr_push_netr_DELTA_GROUP_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_member)); - } - break; - - case NETR_DELTA_ALIAS: - if (r->alias) { - NDR_CHECK(ndr_push_netr_DELTA_ALIAS(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias)); - } - break; - - case NETR_DELTA_DELETE_ALIAS: - break; - - case NETR_DELTA_RENAME_ALIAS: - if (r->rename_alias) { - NDR_CHECK(ndr_push_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_alias)); - } - break; - - case NETR_DELTA_ALIAS_MEMBER: - if (r->alias_member) { - NDR_CHECK(ndr_push_netr_DELTA_ALIAS_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias_member)); - } - break; - - case NETR_DELTA_POLICY: - if (r->policy) { - NDR_CHECK(ndr_push_netr_DELTA_POLICY(ndr, NDR_SCALARS|NDR_BUFFERS, r->policy)); - } - break; - - case NETR_DELTA_TRUSTED_DOMAIN: - if (r->trusted_domain) { - NDR_CHECK(ndr_push_netr_DELTA_TRUSTED_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->trusted_domain)); - } - break; - - case NETR_DELTA_DELETE_TRUST: - break; - - case NETR_DELTA_ACCOUNT: - if (r->account) { - NDR_CHECK(ndr_push_netr_DELTA_ACCOUNT(ndr, NDR_SCALARS|NDR_BUFFERS, r->account)); - } - break; - - case NETR_DELTA_DELETE_ACCOUNT: - break; - - case NETR_DELTA_SECRET: - if (r->secret) { - NDR_CHECK(ndr_push_netr_DELTA_SECRET(ndr, NDR_SCALARS|NDR_BUFFERS, r->secret)); - } - break; - - case NETR_DELTA_DELETE_SECRET: - break; - - case NETR_DELTA_DELETE_GROUP2: - if (r->delete_group) { - NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_group)); - } - break; - - case NETR_DELTA_DELETE_USER2: - if (r->delete_user) { - NDR_CHECK(ndr_push_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_user)); - } - break; - - case NETR_DELTA_MODIFY_COUNT: - if (r->modified_count) { - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->modified_count)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_UNION *r) -{ - int level; - uint16_t _level; - TALLOC_CTX *_mem_save_domain_0; - TALLOC_CTX *_mem_save_group_0; - TALLOC_CTX *_mem_save_rename_group_0; - TALLOC_CTX *_mem_save_user_0; - TALLOC_CTX *_mem_save_rename_user_0; - TALLOC_CTX *_mem_save_group_member_0; - TALLOC_CTX *_mem_save_alias_0; - TALLOC_CTX *_mem_save_rename_alias_0; - TALLOC_CTX *_mem_save_alias_member_0; - TALLOC_CTX *_mem_save_policy_0; - TALLOC_CTX *_mem_save_trusted_domain_0; - TALLOC_CTX *_mem_save_account_0; - TALLOC_CTX *_mem_save_secret_0; - TALLOC_CTX *_mem_save_delete_group_0; - TALLOC_CTX *_mem_save_delete_user_0; - TALLOC_CTX *_mem_save_modified_count_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case NETR_DELTA_DOMAIN: { - uint32_t _ptr_domain; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - break; } - - case NETR_DELTA_GROUP: { - uint32_t _ptr_group; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group)); - if (_ptr_group) { - NDR_PULL_ALLOC(ndr, r->group); - } else { - r->group = NULL; - } - break; } - - case NETR_DELTA_DELETE_GROUP: { - break; } - - case NETR_DELTA_RENAME_GROUP: { - uint32_t _ptr_rename_group; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_group)); - if (_ptr_rename_group) { - NDR_PULL_ALLOC(ndr, r->rename_group); - } else { - r->rename_group = NULL; - } - break; } - - case NETR_DELTA_USER: { - uint32_t _ptr_user; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->user); - } else { - r->user = NULL; - } - break; } - - case NETR_DELTA_DELETE_USER: { - break; } - - case NETR_DELTA_RENAME_USER: { - uint32_t _ptr_rename_user; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_user)); - if (_ptr_rename_user) { - NDR_PULL_ALLOC(ndr, r->rename_user); - } else { - r->rename_user = NULL; - } - break; } - - case NETR_DELTA_GROUP_MEMBER: { - uint32_t _ptr_group_member; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_member)); - if (_ptr_group_member) { - NDR_PULL_ALLOC(ndr, r->group_member); - } else { - r->group_member = NULL; - } - break; } - - case NETR_DELTA_ALIAS: { - uint32_t _ptr_alias; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alias)); - if (_ptr_alias) { - NDR_PULL_ALLOC(ndr, r->alias); - } else { - r->alias = NULL; - } - break; } - - case NETR_DELTA_DELETE_ALIAS: { - break; } - - case NETR_DELTA_RENAME_ALIAS: { - uint32_t _ptr_rename_alias; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rename_alias)); - if (_ptr_rename_alias) { - NDR_PULL_ALLOC(ndr, r->rename_alias); - } else { - r->rename_alias = NULL; - } - break; } - - case NETR_DELTA_ALIAS_MEMBER: { - uint32_t _ptr_alias_member; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alias_member)); - if (_ptr_alias_member) { - NDR_PULL_ALLOC(ndr, r->alias_member); - } else { - r->alias_member = NULL; - } - break; } - - case NETR_DELTA_POLICY: { - uint32_t _ptr_policy; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_policy)); - if (_ptr_policy) { - NDR_PULL_ALLOC(ndr, r->policy); - } else { - r->policy = NULL; - } - break; } - - case NETR_DELTA_TRUSTED_DOMAIN: { - uint32_t _ptr_trusted_domain; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain)); - if (_ptr_trusted_domain) { - NDR_PULL_ALLOC(ndr, r->trusted_domain); - } else { - r->trusted_domain = NULL; - } - break; } - - case NETR_DELTA_DELETE_TRUST: { - NDR_CHECK(ndr_pull_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust)); - break; } - - case NETR_DELTA_ACCOUNT: { - uint32_t _ptr_account; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account)); - if (_ptr_account) { - NDR_PULL_ALLOC(ndr, r->account); - } else { - r->account = NULL; - } - break; } - - case NETR_DELTA_DELETE_ACCOUNT: { - NDR_CHECK(ndr_pull_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account)); - break; } - - case NETR_DELTA_SECRET: { - uint32_t _ptr_secret; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secret)); - if (_ptr_secret) { - NDR_PULL_ALLOC(ndr, r->secret); - } else { - r->secret = NULL; - } - break; } - - case NETR_DELTA_DELETE_SECRET: { - NDR_CHECK(ndr_pull_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret)); - break; } - - case NETR_DELTA_DELETE_GROUP2: { - uint32_t _ptr_delete_group; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delete_group)); - if (_ptr_delete_group) { - NDR_PULL_ALLOC(ndr, r->delete_group); - } else { - r->delete_group = NULL; - } - break; } - - case NETR_DELTA_DELETE_USER2: { - uint32_t _ptr_delete_user; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delete_user)); - if (_ptr_delete_user) { - NDR_PULL_ALLOC(ndr, r->delete_user); - } else { - r->delete_user = NULL; - } - break; } - - case NETR_DELTA_MODIFY_COUNT: { - uint32_t _ptr_modified_count; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_modified_count)); - if (_ptr_modified_count) { - NDR_PULL_ALLOC(ndr, r->modified_count); - } else { - r->modified_count = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case NETR_DELTA_DOMAIN: - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_netr_DELTA_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - break; - - case NETR_DELTA_GROUP: - if (r->group) { - _mem_save_group_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->group, 0); - NDR_CHECK(ndr_pull_netr_DELTA_GROUP(ndr, NDR_SCALARS|NDR_BUFFERS, r->group)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_0, 0); - } - break; - - case NETR_DELTA_DELETE_GROUP: - break; - - case NETR_DELTA_RENAME_GROUP: - if (r->rename_group) { - _mem_save_rename_group_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->rename_group, 0); - NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_group)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_group_0, 0); - } - break; - - case NETR_DELTA_USER: - if (r->user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); - NDR_CHECK(ndr_pull_netr_DELTA_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->user)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - break; - - case NETR_DELTA_DELETE_USER: - break; - - case NETR_DELTA_RENAME_USER: - if (r->rename_user) { - _mem_save_rename_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->rename_user, 0); - NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_user)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_user_0, 0); - } - break; - - case NETR_DELTA_GROUP_MEMBER: - if (r->group_member) { - _mem_save_group_member_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->group_member, 0); - NDR_CHECK(ndr_pull_netr_DELTA_GROUP_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_member)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_member_0, 0); - } - break; - - case NETR_DELTA_ALIAS: - if (r->alias) { - _mem_save_alias_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->alias, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ALIAS(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_0, 0); - } - break; - - case NETR_DELTA_DELETE_ALIAS: - break; - - case NETR_DELTA_RENAME_ALIAS: - if (r->rename_alias) { - _mem_save_rename_alias_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->rename_alias, 0); - NDR_CHECK(ndr_pull_netr_DELTA_RENAME(ndr, NDR_SCALARS|NDR_BUFFERS, r->rename_alias)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rename_alias_0, 0); - } - break; - - case NETR_DELTA_ALIAS_MEMBER: - if (r->alias_member) { - _mem_save_alias_member_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->alias_member, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ALIAS_MEMBER(ndr, NDR_SCALARS|NDR_BUFFERS, r->alias_member)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_member_0, 0); - } - break; - - case NETR_DELTA_POLICY: - if (r->policy) { - _mem_save_policy_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->policy, 0); - NDR_CHECK(ndr_pull_netr_DELTA_POLICY(ndr, NDR_SCALARS|NDR_BUFFERS, r->policy)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_0, 0); - } - break; - - case NETR_DELTA_TRUSTED_DOMAIN: - if (r->trusted_domain) { - _mem_save_trusted_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domain, 0); - NDR_CHECK(ndr_pull_netr_DELTA_TRUSTED_DOMAIN(ndr, NDR_SCALARS|NDR_BUFFERS, r->trusted_domain)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_0, 0); - } - break; - - case NETR_DELTA_DELETE_TRUST: - break; - - case NETR_DELTA_ACCOUNT: - if (r->account) { - _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->account, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ACCOUNT(ndr, NDR_SCALARS|NDR_BUFFERS, r->account)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, 0); - } - break; - - case NETR_DELTA_DELETE_ACCOUNT: - break; - - case NETR_DELTA_SECRET: - if (r->secret) { - _mem_save_secret_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->secret, 0); - NDR_CHECK(ndr_pull_netr_DELTA_SECRET(ndr, NDR_SCALARS|NDR_BUFFERS, r->secret)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secret_0, 0); - } - break; - - case NETR_DELTA_DELETE_SECRET: - break; - - case NETR_DELTA_DELETE_GROUP2: - if (r->delete_group) { - _mem_save_delete_group_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->delete_group, 0); - NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_group)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delete_group_0, 0); - } - break; - - case NETR_DELTA_DELETE_USER2: - if (r->delete_user) { - _mem_save_delete_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->delete_user, 0); - NDR_CHECK(ndr_pull_netr_DELTA_DELETE_USER(ndr, NDR_SCALARS|NDR_BUFFERS, r->delete_user)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delete_user_0, 0); - } - break; - - case NETR_DELTA_MODIFY_COUNT: - if (r->modified_count) { - _mem_save_modified_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->modified_count, 0); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->modified_count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_modified_count_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_UNION *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "netr_DELTA_UNION"); - switch (level) { - case NETR_DELTA_DOMAIN: - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_netr_DELTA_DOMAIN(ndr, "domain", r->domain); - } - ndr->depth--; - break; - - case NETR_DELTA_GROUP: - ndr_print_ptr(ndr, "group", r->group); - ndr->depth++; - if (r->group) { - ndr_print_netr_DELTA_GROUP(ndr, "group", r->group); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_GROUP: - break; - - case NETR_DELTA_RENAME_GROUP: - ndr_print_ptr(ndr, "rename_group", r->rename_group); - ndr->depth++; - if (r->rename_group) { - ndr_print_netr_DELTA_RENAME(ndr, "rename_group", r->rename_group); - } - ndr->depth--; - break; - - case NETR_DELTA_USER: - ndr_print_ptr(ndr, "user", r->user); - ndr->depth++; - if (r->user) { - ndr_print_netr_DELTA_USER(ndr, "user", r->user); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_USER: - break; - - case NETR_DELTA_RENAME_USER: - ndr_print_ptr(ndr, "rename_user", r->rename_user); - ndr->depth++; - if (r->rename_user) { - ndr_print_netr_DELTA_RENAME(ndr, "rename_user", r->rename_user); - } - ndr->depth--; - break; - - case NETR_DELTA_GROUP_MEMBER: - ndr_print_ptr(ndr, "group_member", r->group_member); - ndr->depth++; - if (r->group_member) { - ndr_print_netr_DELTA_GROUP_MEMBER(ndr, "group_member", r->group_member); - } - ndr->depth--; - break; - - case NETR_DELTA_ALIAS: - ndr_print_ptr(ndr, "alias", r->alias); - ndr->depth++; - if (r->alias) { - ndr_print_netr_DELTA_ALIAS(ndr, "alias", r->alias); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_ALIAS: - break; - - case NETR_DELTA_RENAME_ALIAS: - ndr_print_ptr(ndr, "rename_alias", r->rename_alias); - ndr->depth++; - if (r->rename_alias) { - ndr_print_netr_DELTA_RENAME(ndr, "rename_alias", r->rename_alias); - } - ndr->depth--; - break; - - case NETR_DELTA_ALIAS_MEMBER: - ndr_print_ptr(ndr, "alias_member", r->alias_member); - ndr->depth++; - if (r->alias_member) { - ndr_print_netr_DELTA_ALIAS_MEMBER(ndr, "alias_member", r->alias_member); - } - ndr->depth--; - break; - - case NETR_DELTA_POLICY: - ndr_print_ptr(ndr, "policy", r->policy); - ndr->depth++; - if (r->policy) { - ndr_print_netr_DELTA_POLICY(ndr, "policy", r->policy); - } - ndr->depth--; - break; - - case NETR_DELTA_TRUSTED_DOMAIN: - ndr_print_ptr(ndr, "trusted_domain", r->trusted_domain); - ndr->depth++; - if (r->trusted_domain) { - ndr_print_netr_DELTA_TRUSTED_DOMAIN(ndr, "trusted_domain", r->trusted_domain); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_TRUST: - ndr_print_netr_DELTA_DELETE_TRUST(ndr, "delete_trust", &r->delete_trust); - break; - - case NETR_DELTA_ACCOUNT: - ndr_print_ptr(ndr, "account", r->account); - ndr->depth++; - if (r->account) { - ndr_print_netr_DELTA_ACCOUNT(ndr, "account", r->account); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_ACCOUNT: - ndr_print_netr_DELTA_DELETE_ACCOUNT(ndr, "delete_account", &r->delete_account); - break; - - case NETR_DELTA_SECRET: - ndr_print_ptr(ndr, "secret", r->secret); - ndr->depth++; - if (r->secret) { - ndr_print_netr_DELTA_SECRET(ndr, "secret", r->secret); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_SECRET: - ndr_print_netr_DELTA_DELETE_SECRET(ndr, "delete_secret", &r->delete_secret); - break; - - case NETR_DELTA_DELETE_GROUP2: - ndr_print_ptr(ndr, "delete_group", r->delete_group); - ndr->depth++; - if (r->delete_group) { - ndr_print_netr_DELTA_DELETE_USER(ndr, "delete_group", r->delete_group); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_USER2: - ndr_print_ptr(ndr, "delete_user", r->delete_user); - ndr->depth++; - if (r->delete_user) { - ndr_print_netr_DELTA_DELETE_USER(ndr, "delete_user", r->delete_user); - } - ndr->depth--; - break; - - case NETR_DELTA_MODIFY_COUNT: - ndr_print_ptr(ndr, "modified_count", r->modified_count); - ndr->depth++; - if (r->modified_count) { - ndr_print_udlong(ndr, "modified_count", *r->modified_count); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_netr_DELTA_ID_UNION(struct ndr_push *ndr, int ndr_flags, const union netr_DELTA_ID_UNION *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level)); - switch (level) { - case NETR_DELTA_DOMAIN: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_GROUP: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_DELETE_GROUP: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_RENAME_GROUP: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_USER: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_DELETE_USER: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_RENAME_USER: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_GROUP_MEMBER: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_ALIAS: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_DELETE_ALIAS: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_RENAME_ALIAS: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_ALIAS_MEMBER: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_POLICY: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; } - - case NETR_DELTA_TRUSTED_DOMAIN: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; } - - case NETR_DELTA_DELETE_TRUST: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; } - - case NETR_DELTA_ACCOUNT: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; } - - case NETR_DELTA_DELETE_ACCOUNT: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; } - - case NETR_DELTA_SECRET: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - break; } - - case NETR_DELTA_DELETE_SECRET: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - break; } - - case NETR_DELTA_DELETE_GROUP2: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_DELETE_USER2: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; } - - case NETR_DELTA_MODIFY_COUNT: { - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NETR_DELTA_DOMAIN: - break; - - case NETR_DELTA_GROUP: - break; - - case NETR_DELTA_DELETE_GROUP: - break; - - case NETR_DELTA_RENAME_GROUP: - break; - - case NETR_DELTA_USER: - break; - - case NETR_DELTA_DELETE_USER: - break; - - case NETR_DELTA_RENAME_USER: - break; - - case NETR_DELTA_GROUP_MEMBER: - break; - - case NETR_DELTA_ALIAS: - break; - - case NETR_DELTA_DELETE_ALIAS: - break; - - case NETR_DELTA_RENAME_ALIAS: - break; - - case NETR_DELTA_ALIAS_MEMBER: - break; - - case NETR_DELTA_POLICY: - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - break; - - case NETR_DELTA_TRUSTED_DOMAIN: - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - break; - - case NETR_DELTA_DELETE_TRUST: - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - break; - - case NETR_DELTA_ACCOUNT: - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - break; - - case NETR_DELTA_DELETE_ACCOUNT: - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - break; - - case NETR_DELTA_SECRET: - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - break; - - case NETR_DELTA_DELETE_SECRET: - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - break; - - case NETR_DELTA_DELETE_GROUP2: - break; - - case NETR_DELTA_DELETE_USER2: - break; - - case NETR_DELTA_MODIFY_COUNT: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_ID_UNION(struct ndr_pull *ndr, int ndr_flags, union netr_DELTA_ID_UNION *r) -{ - int level; - uint16_t _level; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_name_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case NETR_DELTA_DOMAIN: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_GROUP: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_DELETE_GROUP: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_RENAME_GROUP: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_USER: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_DELETE_USER: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_RENAME_USER: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_GROUP_MEMBER: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_ALIAS: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_DELETE_ALIAS: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_RENAME_ALIAS: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_ALIAS_MEMBER: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_POLICY: { - uint32_t _ptr_sid; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - break; } - - case NETR_DELTA_TRUSTED_DOMAIN: { - uint32_t _ptr_sid; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - break; } - - case NETR_DELTA_DELETE_TRUST: { - uint32_t _ptr_sid; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - break; } - - case NETR_DELTA_ACCOUNT: { - uint32_t _ptr_sid; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - break; } - - case NETR_DELTA_DELETE_ACCOUNT: { - uint32_t _ptr_sid; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - break; } - - case NETR_DELTA_SECRET: { - uint32_t _ptr_name; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - break; } - - case NETR_DELTA_DELETE_SECRET: { - uint32_t _ptr_name; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - break; } - - case NETR_DELTA_DELETE_GROUP2: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_DELETE_USER2: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - break; } - - case NETR_DELTA_MODIFY_COUNT: { - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case NETR_DELTA_DOMAIN: - break; - - case NETR_DELTA_GROUP: - break; - - case NETR_DELTA_DELETE_GROUP: - break; - - case NETR_DELTA_RENAME_GROUP: - break; - - case NETR_DELTA_USER: - break; - - case NETR_DELTA_DELETE_USER: - break; - - case NETR_DELTA_RENAME_USER: - break; - - case NETR_DELTA_GROUP_MEMBER: - break; - - case NETR_DELTA_ALIAS: - break; - - case NETR_DELTA_DELETE_ALIAS: - break; - - case NETR_DELTA_RENAME_ALIAS: - break; - - case NETR_DELTA_ALIAS_MEMBER: - break; - - case NETR_DELTA_POLICY: - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - break; - - case NETR_DELTA_TRUSTED_DOMAIN: - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - break; - - case NETR_DELTA_DELETE_TRUST: - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - break; - - case NETR_DELTA_ACCOUNT: - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - break; - - case NETR_DELTA_DELETE_ACCOUNT: - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - break; - - case NETR_DELTA_SECRET: - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - break; - - case NETR_DELTA_DELETE_SECRET: - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - break; - - case NETR_DELTA_DELETE_GROUP2: - break; - - case NETR_DELTA_DELETE_USER2: - break; - - case NETR_DELTA_MODIFY_COUNT: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_ID_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_ID_UNION *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "netr_DELTA_ID_UNION"); - switch (level) { - case NETR_DELTA_DOMAIN: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_GROUP: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_DELETE_GROUP: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_RENAME_GROUP: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_USER: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_DELETE_USER: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_RENAME_USER: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_GROUP_MEMBER: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_ALIAS: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_DELETE_ALIAS: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_RENAME_ALIAS: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_ALIAS_MEMBER: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_POLICY: - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - break; - - case NETR_DELTA_TRUSTED_DOMAIN: - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_TRUST: - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - break; - - case NETR_DELTA_ACCOUNT: - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_ACCOUNT: - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - break; - - case NETR_DELTA_SECRET: - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_SECRET: - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - break; - - case NETR_DELTA_DELETE_GROUP2: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_DELETE_USER2: - ndr_print_uint32(ndr, "rid", r->rid); - break; - - case NETR_DELTA_MODIFY_COUNT: - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_netr_DELTA_ENUM(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, r->delta_type)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->delta_id_union, r->delta_type)); - NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr, NDR_SCALARS, &r->delta_id_union)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->delta_union, r->delta_type)); - NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr, NDR_SCALARS, &r->delta_union)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union)); - NDR_CHECK(ndr_push_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_ENUM(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_DeltaEnum(ndr, NDR_SCALARS, &r->delta_type)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->delta_id_union, r->delta_type)); - NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr, NDR_SCALARS, &r->delta_id_union)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->delta_union, r->delta_type)); - NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr, NDR_SCALARS, &r->delta_union)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_DELTA_ID_UNION(ndr, NDR_BUFFERS, &r->delta_id_union)); - NDR_CHECK(ndr_pull_netr_DELTA_UNION(ndr, NDR_BUFFERS, &r->delta_union)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_ENUM(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM *r) -{ - ndr_print_struct(ndr, name, "netr_DELTA_ENUM"); - ndr->depth++; - ndr_print_netr_DeltaEnum(ndr, "delta_type", r->delta_type); - ndr_print_set_switch_value(ndr, &r->delta_id_union, r->delta_type); - ndr_print_netr_DELTA_ID_UNION(ndr, "delta_id_union", &r->delta_id_union); - ndr_print_set_switch_value(ndr, &r->delta_union, r->delta_type); - ndr_print_netr_DELTA_UNION(ndr, "delta_union", &r->delta_union); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DELTA_ENUM_ARRAY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ENUM_ARRAY *r) -{ - uint32_t cntr_delta_enum_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_deltas)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->delta_enum)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->delta_enum) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_deltas)); - for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr, NDR_SCALARS, &r->delta_enum[cntr_delta_enum_1])); - } - for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM(ndr, NDR_BUFFERS, &r->delta_enum[cntr_delta_enum_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DELTA_ENUM_ARRAY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ENUM_ARRAY *r) -{ - uint32_t _ptr_delta_enum; - uint32_t cntr_delta_enum_1; - TALLOC_CTX *_mem_save_delta_enum_0; - TALLOC_CTX *_mem_save_delta_enum_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_deltas)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum)); - if (_ptr_delta_enum) { - NDR_PULL_ALLOC(ndr, r->delta_enum); - } else { - r->delta_enum = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->delta_enum) { - _mem_save_delta_enum_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->delta_enum, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->delta_enum)); - NDR_PULL_ALLOC_N(ndr, r->delta_enum, ndr_get_array_size(ndr, &r->delta_enum)); - _mem_save_delta_enum_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->delta_enum, 0); - for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) { - NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr, NDR_SCALARS, &r->delta_enum[cntr_delta_enum_1])); - } - for (cntr_delta_enum_1 = 0; cntr_delta_enum_1 < r->num_deltas; cntr_delta_enum_1++) { - NDR_CHECK(ndr_pull_netr_DELTA_ENUM(ndr, NDR_BUFFERS, &r->delta_enum[cntr_delta_enum_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_0, 0); - } - if (r->delta_enum) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->delta_enum, r->num_deltas)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM_ARRAY *r) -{ - uint32_t cntr_delta_enum_1; - ndr_print_struct(ndr, name, "netr_DELTA_ENUM_ARRAY"); - ndr->depth++; - ndr_print_uint32(ndr, "num_deltas", r->num_deltas); - ndr_print_ptr(ndr, "delta_enum", r->delta_enum); - ndr->depth++; - if (r->delta_enum) { - ndr->print(ndr, "%s: ARRAY(%d)", "delta_enum", (int)r->num_deltas); - ndr->depth++; - for (cntr_delta_enum_1=0;cntr_delta_enum_1num_deltas;cntr_delta_enum_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_delta_enum_1) != -1) { - ndr_print_netr_DELTA_ENUM(ndr, "delta_enum", &r->delta_enum[cntr_delta_enum_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_UAS_INFO_0(struct ndr_push *ndr, int ndr_flags, const struct netr_UAS_INFO_0 *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->computer_name, 16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timecreated)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_UAS_INFO_0(struct ndr_pull *ndr, int ndr_flags, struct netr_UAS_INFO_0 *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->computer_name, 16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timecreated)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_UAS_INFO_0(struct ndr_print *ndr, const char *name, const struct netr_UAS_INFO_0 *r) -{ - ndr_print_struct(ndr, name, "netr_UAS_INFO_0"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "computer_name", r->computer_name, 16); - ndr_print_uint32(ndr, "timecreated", r->timecreated); - ndr_print_uint32(ndr, "serial_number", r->serial_number); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_netr_AccountBuffer(struct ndr_push *ndr, int ndr_flags, const struct netr_AccountBuffer *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->blob)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_AccountBuffer(struct ndr_pull *ndr, int ndr_flags, struct netr_AccountBuffer *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->blob)); - ndr->flags = _flags_save_DATA_BLOB; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_AccountBuffer(struct ndr_print *ndr, const char *name, const struct netr_AccountBuffer *r) -{ - ndr_print_struct(ndr, name, "netr_AccountBuffer"); - ndr->depth++; - ndr_print_DATA_BLOB(ndr, "blob", r->blob); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_InfoFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_InfoFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_InfoFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CTRL_REPL_NEEDED", NETLOGON_CTRL_REPL_NEEDED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CTRL_REPL_IN_PROGRESS", NETLOGON_CTRL_REPL_IN_PROGRESS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CTRL_REPL_FULL_SYNC", NETLOGON_CTRL_REPL_FULL_SYNC, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_1(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pdc_connection_status)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pdc_connection_status)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_1 *r) -{ - ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_1"); - ndr->depth++; - ndr_print_netr_InfoFlags(ndr, "flags", r->flags); - ndr_print_uint32(ndr, "pdc_connection_status", r->pdc_connection_status); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_2(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pdc_connection_status)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_dc_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tc_connection_status)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->trusted_dc_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->trusted_dc_name, ndr_charset_length(r->trusted_dc_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_2 *r) -{ - uint32_t _ptr_trusted_dc_name; - TALLOC_CTX *_mem_save_trusted_dc_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pdc_connection_status)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_dc_name)); - if (_ptr_trusted_dc_name) { - NDR_PULL_ALLOC(ndr, r->trusted_dc_name); - } else { - r->trusted_dc_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tc_connection_status)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->trusted_dc_name) { - _mem_save_trusted_dc_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->trusted_dc_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_dc_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_dc_name)); - if (ndr_get_array_length(ndr, &r->trusted_dc_name) > ndr_get_array_size(ndr, &r->trusted_dc_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->trusted_dc_name), ndr_get_array_length(ndr, &r->trusted_dc_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_dc_name, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_dc_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_2 *r) -{ - ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_2"); - ndr->depth++; - ndr_print_netr_InfoFlags(ndr, "flags", r->flags); - ndr_print_uint32(ndr, "pdc_connection_status", r->pdc_connection_status); - ndr_print_ptr(ndr, "trusted_dc_name", r->trusted_dc_name); - ndr->depth++; - if (r->trusted_dc_name) { - ndr_print_string(ndr, "trusted_dc_name", r->trusted_dc_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "tc_connection_status", r->tc_connection_status); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_3(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_attempts)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_3(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_attempts)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_3 *r) -{ - ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_3"); - ndr->depth++; - ndr_print_netr_InfoFlags(ndr, "flags", r->flags); - ndr_print_uint32(ndr, "logon_attempts", r->logon_attempts); - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr_print_uint32(ndr, "unknown3", r->unknown3); - ndr_print_uint32(ndr, "unknown4", r->unknown4); - ndr_print_uint32(ndr, "unknown5", r->unknown5); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push *ndr, int ndr_flags, const union netr_CONTROL_QUERY_INFORMATION *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - if (r->info1) { - NDR_CHECK(ndr_push_netr_NETLOGON_INFO_1(ndr, NDR_SCALARS, r->info1)); - } - break; - - case 2: - if (r->info2) { - NDR_CHECK(ndr_push_netr_NETLOGON_INFO_2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - } - break; - - case 3: - if (r->info3) { - NDR_CHECK(ndr_push_netr_NETLOGON_INFO_3(ndr, NDR_SCALARS, r->info3)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_QUERY_INFORMATION *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info1_0; - TALLOC_CTX *_mem_save_info2_0; - TALLOC_CTX *_mem_save_info3_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - uint32_t _ptr_info1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); - if (_ptr_info1) { - NDR_PULL_ALLOC(ndr, r->info1); - } else { - r->info1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_info2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); - if (_ptr_info2) { - NDR_PULL_ALLOC(ndr, r->info2); - } else { - r->info2 = NULL; - } - break; } - - case 3: { - uint32_t _ptr_info3; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); - if (_ptr_info3) { - NDR_PULL_ALLOC(ndr, r->info3); - } else { - r->info3 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - if (r->info1) { - _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); - NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_1(ndr, NDR_SCALARS, r->info1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); - } - break; - - case 2: - if (r->info2) { - _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); - NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); - } - break; - - case 3: - if (r->info3) { - _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); - NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_3(ndr, NDR_SCALARS, r->info3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_QUERY_INFORMATION *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "netr_CONTROL_QUERY_INFORMATION"); - switch (level) { - case 1: - ndr_print_ptr(ndr, "info1", r->info1); - ndr->depth++; - if (r->info1) { - ndr_print_netr_NETLOGON_INFO_1(ndr, "info1", r->info1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "info2", r->info2); - ndr->depth++; - if (r->info2) { - ndr_print_netr_NETLOGON_INFO_2(ndr, "info2", r->info2); - } - ndr->depth--; - break; - - case 3: - ndr_print_ptr(ndr, "info3", r->info3); - ndr->depth++; - if (r->info3) { - ndr_print_netr_NETLOGON_INFO_3(ndr, "info3", r->info3); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_netr_LogonControlCode(struct ndr_push *ndr, int ndr_flags, enum netr_LogonControlCode r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonControlCode(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonControlCode *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char *name, enum netr_LogonControlCode r) -{ - const char *val = NULL; - - switch (r) { - case NETLOGON_CONTROL_SYNC: val = "NETLOGON_CONTROL_SYNC"; break; - case NETLOGON_CONTROL_REDISCOVER: val = "NETLOGON_CONTROL_REDISCOVER"; break; - case NETLOGON_CONTROL_TC_QUERY: val = "NETLOGON_CONTROL_TC_QUERY"; break; - case NETLOGON_CONTROL_TRANSPORT_NOTIFY: val = "NETLOGON_CONTROL_TRANSPORT_NOTIFY"; break; - case NETLOGON_CONTROL_SET_DBFLAG: val = "NETLOGON_CONTROL_SET_DBFLAG"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_netr_CONTROL_DATA_INFORMATION(struct ndr_push *ndr, int ndr_flags, const union netr_CONTROL_DATA_INFORMATION *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case NETLOGON_CONTROL_REDISCOVER: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - break; } - - case NETLOGON_CONTROL_TC_QUERY: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - break; } - - case NETLOGON_CONTROL_TRANSPORT_NOTIFY: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - break; } - - case NETLOGON_CONTROL_SET_DBFLAG: { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->debug_level)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NETLOGON_CONTROL_REDISCOVER: - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - break; - - case NETLOGON_CONTROL_TC_QUERY: - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - break; - - case NETLOGON_CONTROL_TRANSPORT_NOTIFY: - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - break; - - case NETLOGON_CONTROL_SET_DBFLAG: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull *ndr, int ndr_flags, union netr_CONTROL_DATA_INFORMATION *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_domain_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case NETLOGON_CONTROL_REDISCOVER: { - uint32_t _ptr_domain; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - break; } - - case NETLOGON_CONTROL_TC_QUERY: { - uint32_t _ptr_domain; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - break; } - - case NETLOGON_CONTROL_TRANSPORT_NOTIFY: { - uint32_t _ptr_domain; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - break; } - - case NETLOGON_CONTROL_SET_DBFLAG: { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->debug_level)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case NETLOGON_CONTROL_REDISCOVER: - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - break; - - case NETLOGON_CONTROL_TC_QUERY: - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - break; - - case NETLOGON_CONTROL_TRANSPORT_NOTIFY: - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - break; - - case NETLOGON_CONTROL_SET_DBFLAG: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_DATA_INFORMATION *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "netr_CONTROL_DATA_INFORMATION"); - switch (level) { - case NETLOGON_CONTROL_REDISCOVER: - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - break; - - case NETLOGON_CONTROL_TC_QUERY: - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - break; - - case NETLOGON_CONTROL_TRANSPORT_NOTIFY: - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - break; - - case NETLOGON_CONTROL_SET_DBFLAG: - ndr_print_uint32(ndr, "debug_level", r->debug_level); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_netr_NegotiateFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NegotiateFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NegotiateFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_ACCOUNT_LOCKOUT", NETLOGON_NEG_ACCOUNT_LOCKOUT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PERSISTENT_SAMREPL", NETLOGON_NEG_PERSISTENT_SAMREPL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_ARCFOUR", NETLOGON_NEG_ARCFOUR, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PROMOTION_COUNT", NETLOGON_NEG_PROMOTION_COUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CHANGELOG_BDC", NETLOGON_NEG_CHANGELOG_BDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_FULL_SYNC_REPL", NETLOGON_NEG_FULL_SYNC_REPL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_MULTIPLE_SIDS", NETLOGON_NEG_MULTIPLE_SIDS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_REDO", NETLOGON_NEG_REDO, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL", NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SEND_PASSWORD_INFO_PDC", NETLOGON_NEG_SEND_PASSWORD_INFO_PDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_GENERIC_PASSTHROUGH", NETLOGON_NEG_GENERIC_PASSTHROUGH, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CONCURRENT_RPC", NETLOGON_NEG_CONCURRENT_RPC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL", NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL", NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_128BIT", NETLOGON_NEG_128BIT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_TRANSITIVE_TRUSTS", NETLOGON_NEG_TRANSITIVE_TRUSTS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_DNS_DOMAIN_TRUSTS", NETLOGON_NEG_DNS_DOMAIN_TRUSTS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_PASSWORD_SET2", NETLOGON_NEG_PASSWORD_SET2, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_GETDOMAININFO", NETLOGON_NEG_GETDOMAININFO, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_CROSS_FOREST_TRUSTS", NETLOGON_NEG_CROSS_FOREST_TRUSTS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION", NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_RODC_PASSTHROUGH", NETLOGON_NEG_RODC_PASSTHROUGH, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_AUTHENTICATED_RPC_LSASS", NETLOGON_NEG_AUTHENTICATED_RPC_LSASS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NEG_SCHANNEL", NETLOGON_NEG_SCHANNEL, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ChangeLogFlags(struct ndr_push *ndr, int ndr_flags, uint16_t r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ChangeLogFlags(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ChangeLogFlags(struct ndr_print *ndr, const char *name, uint16_t r) -{ - ndr_print_uint16(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED", NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_CHANGED_PASSWORD", NETR_CHANGELOG_CHANGED_PASSWORD, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_SID_INCLUDED", NETR_CHANGELOG_SID_INCLUDED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_NAME_INCLUDED", NETR_CHANGELOG_NAME_INCLUDED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "NETR_CHANGELOG_FIRST_PROMOTION_OBJ", NETR_CHANGELOG_FIRST_PROMOTION_OBJ, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ChangeLogObject(struct ndr_push *ndr, int ndr_flags, const union netr_ChangeLogObject *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NETR_CHANGELOG_SID_INCLUDED: { - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->object_sid)); - break; } - - case NETR_CHANGELOG_NAME_INCLUDED: { - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->object_name)); - ndr->flags = _flags_save_string; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case NETR_CHANGELOG_SID_INCLUDED: - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_BUFFERS, &r->object_sid)); - break; - - case NETR_CHANGELOG_NAME_INCLUDED: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ChangeLogObject(struct ndr_pull *ndr, int ndr_flags, union netr_ChangeLogObject *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case NETR_CHANGELOG_SID_INCLUDED: { - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->object_sid)); - break; } - - case NETR_CHANGELOG_NAME_INCLUDED: { - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->object_name)); - ndr->flags = _flags_save_string; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case NETR_CHANGELOG_SID_INCLUDED: - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_BUFFERS, &r->object_sid)); - break; - - case NETR_CHANGELOG_NAME_INCLUDED: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ChangeLogObject(struct ndr_print *ndr, const char *name, const union netr_ChangeLogObject *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "netr_ChangeLogObject"); - switch (level) { - case NETR_CHANGELOG_SID_INCLUDED: - ndr_print_dom_sid(ndr, "object_sid", &r->object_sid); - break; - - case NETR_CHANGELOG_NAME_INCLUDED: - ndr_print_string(ndr, "object_name", r->object_name); - break; - - default: - break; - - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_ChangeLogEntry(struct ndr_push *ndr, int ndr_flags, const struct netr_ChangeLogEntry *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_number2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_rid)); - NDR_CHECK(ndr_push_netr_ChangeLogFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_netr_SamDatabaseID8Bit(ndr, NDR_SCALARS, r->db_index)); - NDR_CHECK(ndr_push_netr_DeltaEnum8Bit(ndr, NDR_SCALARS, r->delta_type)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED))); - NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr, NDR_SCALARS, &r->object)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_ChangeLogObject(ndr, NDR_BUFFERS, &r->object)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_ChangeLogEntry(struct ndr_pull *ndr, int ndr_flags, struct netr_ChangeLogEntry *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_number2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_rid)); - NDR_CHECK(ndr_pull_netr_ChangeLogFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_netr_SamDatabaseID8Bit(ndr, NDR_SCALARS, &r->db_index)); - NDR_CHECK(ndr_pull_netr_DeltaEnum8Bit(ndr, NDR_SCALARS, &r->delta_type)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED))); - NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr, NDR_SCALARS, &r->object)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_ChangeLogObject(ndr, NDR_BUFFERS, &r->object)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ChangeLogEntry(struct ndr_print *ndr, const char *name, const struct netr_ChangeLogEntry *r) -{ - ndr_print_struct(ndr, name, "netr_ChangeLogEntry"); - ndr->depth++; - ndr_print_uint32(ndr, "serial_number1", r->serial_number1); - ndr_print_uint32(ndr, "serial_number2", r->serial_number2); - ndr_print_uint32(ndr, "object_rid", r->object_rid); - ndr_print_netr_ChangeLogFlags(ndr, "flags", r->flags); - ndr_print_netr_SamDatabaseID8Bit(ndr, "db_index", r->db_index); - ndr_print_netr_DeltaEnum8Bit(ndr, "delta_type", r->delta_type); - ndr_print_set_switch_value(ndr, &r->object, r->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED)); - ndr_print_netr_ChangeLogObject(ndr, "object", &r->object); - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_netr_ChangeLogEntry(const struct netr_ChangeLogEntry *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_netr_ChangeLogEntry); -} - -static enum ndr_err_code ndr_push_netr_Blob(struct ndr_push *ndr, int ndr_flags, const struct netr_Blob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_Blob(struct ndr_pull *ndr, int ndr_flags, struct netr_Blob *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r) -{ - ndr_print_struct(ndr, name, "netr_Blob"); - ndr->depth++; - ndr_print_uint32(ndr, "length", r->length); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->length); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRGetDCName_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRGetDCName_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRGetDCName_flags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_FORCE_REDISCOVERY", DS_FORCE_REDISCOVERY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_REQUIRED", DS_DIRECTORY_SERVICE_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_PREFERRED", DS_DIRECTORY_SERVICE_PREFERRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GC_SERVER_REQUIRED", DS_GC_SERVER_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_PDC_REQUIRED", DS_PDC_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_BACKGROUND_ONLY", DS_BACKGROUND_ONLY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IP_REQUIRED", DS_IP_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_KDC_REQUIRED", DS_KDC_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TIMESERV_REQUIRED", DS_TIMESERV_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_WRITABLE_REQUIRED", DS_WRITABLE_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GOOD_TIMESERV_PREFERRED", DS_GOOD_TIMESERV_PREFERRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_AVOID_SELF", DS_AVOID_SELF, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ONLY_LDAP_NEEDED", DS_ONLY_LDAP_NEEDED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_FLAT_NAME", DS_IS_FLAT_NAME, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_DNS_NAME", DS_IS_DNS_NAME, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TRY_NEXTCLOSEST_SITE", DS_TRY_NEXTCLOSEST_SITE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_6_REQUIRED", DS_DIRECTORY_SERVICE_6_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_DNS_NAME", DS_RETURN_DNS_NAME, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_FLAT_NAME", DS_RETURN_FLAT_NAME, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo_AddressType(struct ndr_push *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo_AddressType(struct ndr_pull *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print *ndr, const char *name, enum netr_DsRGetDCNameInfo_AddressType r) -{ - const char *val = NULL; - - switch (r) { - case DS_ADDRESS_TYPE_INET: val = "DS_ADDRESS_TYPE_INET"; break; - case DS_ADDRESS_TYPE_NETBIOS: val = "DS_ADDRESS_TYPE_NETBIOS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_netr_DsR_DcFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsR_DcFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_PDC", DS_SERVER_PDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GC", DS_SERVER_GC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_LDAP", DS_SERVER_LDAP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_DS", DS_SERVER_DS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_KDC", DS_SERVER_KDC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_TIMESERV", DS_SERVER_TIMESERV, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_CLOSEST", DS_SERVER_CLOSEST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_WRITABLE", DS_SERVER_WRITABLE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GOOD_TIMESERV", DS_SERVER_GOOD_TIMESERV, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_NDNC", DS_SERVER_NDNC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_SELECT_SECRET_DOMAIN_6", DS_SERVER_SELECT_SECRET_DOMAIN_6, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_FULL_SECRET_DOMAIN_6", DS_SERVER_FULL_SECRET_DOMAIN_6, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_CONTROLLER", DS_DNS_CONTROLLER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_DOMAIN", DS_DNS_DOMAIN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_FOREST", DS_DNS_FOREST, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_unc)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_address)); - NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, r->dc_address_type)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest_name)); - NDR_CHECK(ndr_push_netr_DsR_DcFlags(ndr, NDR_SCALARS, r->dc_flags)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_site_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_site_name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dc_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_unc, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_unc, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_unc, ndr_charset_length(r->dc_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->dc_address) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_address, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_address, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_address, ndr_charset_length(r->dc_address, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->forest_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->forest_name, ndr_charset_length(r->forest_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->dc_site_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_site_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dc_site_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dc_site_name, ndr_charset_length(r->dc_site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->client_site_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_site_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_site_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_site_name, ndr_charset_length(r->client_site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r) -{ - uint32_t _ptr_dc_unc; - TALLOC_CTX *_mem_save_dc_unc_0; - uint32_t _ptr_dc_address; - TALLOC_CTX *_mem_save_dc_address_0; - uint32_t _ptr_domain_name; - TALLOC_CTX *_mem_save_domain_name_0; - uint32_t _ptr_forest_name; - TALLOC_CTX *_mem_save_forest_name_0; - uint32_t _ptr_dc_site_name; - TALLOC_CTX *_mem_save_dc_site_name_0; - uint32_t _ptr_client_site_name; - TALLOC_CTX *_mem_save_client_site_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_unc)); - if (_ptr_dc_unc) { - NDR_PULL_ALLOC(ndr, r->dc_unc); - } else { - r->dc_unc = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_address)); - if (_ptr_dc_address) { - NDR_PULL_ALLOC(ndr, r->dc_address); - } else { - r->dc_address = NULL; - } - NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, &r->dc_address_type)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->domain_name); - } else { - r->domain_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_name)); - if (_ptr_forest_name) { - NDR_PULL_ALLOC(ndr, r->forest_name); - } else { - r->forest_name = NULL; - } - NDR_CHECK(ndr_pull_netr_DsR_DcFlags(ndr, NDR_SCALARS, &r->dc_flags)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_site_name)); - if (_ptr_dc_site_name) { - NDR_PULL_ALLOC(ndr, r->dc_site_name); - } else { - r->dc_site_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_site_name)); - if (_ptr_client_site_name) { - NDR_PULL_ALLOC(ndr, r->client_site_name); - } else { - r->client_site_name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->dc_unc) { - _mem_save_dc_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dc_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_unc)); - if (ndr_get_array_length(ndr, &r->dc_unc) > ndr_get_array_size(ndr, &r->dc_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dc_unc), ndr_get_array_length(ndr, &r->dc_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dc_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_unc, ndr_get_array_length(ndr, &r->dc_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_unc_0, 0); - } - if (r->dc_address) { - _mem_save_dc_address_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dc_address, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_address)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_address)); - if (ndr_get_array_length(ndr, &r->dc_address) > ndr_get_array_size(ndr, &r->dc_address)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dc_address), ndr_get_array_length(ndr, &r->dc_address)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dc_address), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_address, ndr_get_array_length(ndr, &r->dc_address), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_address_0, 0); - } - if (r->domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); - if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - if (r->forest_name) { - _mem_save_forest_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->forest_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->forest_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->forest_name)); - if (ndr_get_array_length(ndr, &r->forest_name) > ndr_get_array_size(ndr, &r->forest_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->forest_name), ndr_get_array_length(ndr, &r->forest_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->forest_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->forest_name, ndr_get_array_length(ndr, &r->forest_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_name_0, 0); - } - if (r->dc_site_name) { - _mem_save_dc_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dc_site_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dc_site_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dc_site_name)); - if (ndr_get_array_length(ndr, &r->dc_site_name) > ndr_get_array_size(ndr, &r->dc_site_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dc_site_name), ndr_get_array_length(ndr, &r->dc_site_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dc_site_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dc_site_name, ndr_get_array_length(ndr, &r->dc_site_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_site_name_0, 0); - } - if (r->client_site_name) { - _mem_save_client_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->client_site_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->client_site_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->client_site_name)); - if (ndr_get_array_length(ndr, &r->client_site_name) > ndr_get_array_size(ndr, &r->client_site_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_site_name), ndr_get_array_length(ndr, &r->client_site_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_site_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_site_name, ndr_get_array_length(ndr, &r->client_site_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_site_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r) -{ - ndr_print_struct(ndr, name, "netr_DsRGetDCNameInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "dc_unc", r->dc_unc); - ndr->depth++; - if (r->dc_unc) { - ndr_print_string(ndr, "dc_unc", r->dc_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "dc_address", r->dc_address); - ndr->depth++; - if (r->dc_address) { - ndr_print_string(ndr, "dc_address", r->dc_address); - } - ndr->depth--; - ndr_print_netr_DsRGetDCNameInfo_AddressType(ndr, "dc_address_type", r->dc_address_type); - ndr_print_GUID(ndr, "domain_guid", &r->domain_guid); - ndr_print_ptr(ndr, "domain_name", r->domain_name); - ndr->depth++; - if (r->domain_name) { - ndr_print_string(ndr, "domain_name", r->domain_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "forest_name", r->forest_name); - ndr->depth++; - if (r->forest_name) { - ndr_print_string(ndr, "forest_name", r->forest_name); - } - ndr->depth--; - ndr_print_netr_DsR_DcFlags(ndr, "dc_flags", r->dc_flags); - ndr_print_ptr(ndr, "dc_site_name", r->dc_site_name); - ndr->depth++; - if (r->dc_site_name) { - ndr_print_string(ndr, "dc_site_name", r->dc_site_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "client_site_name", r->client_site_name); - ndr->depth++; - if (r->client_site_name) { - ndr_print_string(ndr, "client_site_name", r->client_site_name); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_TrustFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_TrustFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_MIT_KRB5", NETR_TRUST_FLAG_MIT_KRB5, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_AES", NETR_TRUST_FLAG_AES, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct netr_BinaryString *r) -{ - uint32_t cntr_data_1; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length / 2)); - for (cntr_data_1 = 0; cntr_data_1 < r->length / 2; cntr_data_1++) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data[cntr_data_1])); - } - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct netr_BinaryString *r) -{ - uint32_t _ptr_data; - uint32_t cntr_data_1; - TALLOC_CTX *_mem_save_data_0; - TALLOC_CTX *_mem_save_data_1; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->data)); - if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data)); - } - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - for (cntr_data_1 = 0; cntr_data_1 < r->length / 2; cntr_data_1++) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data[cntr_data_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size / 2)); - } - if (r->data) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length / 2)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r) -{ - uint32_t cntr_data_1; - ndr_print_struct(ndr, name, "netr_BinaryString"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr_print_uint16(ndr, "size", r->size); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr->print(ndr, "%s: ARRAY(%d)", "data", (int)r->length / 2); - ndr->depth++; - for (cntr_data_1=0;cntr_data_1length / 2;cntr_data_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_data_1) != -1) { - ndr_print_uint16(ndr, "data", r->data[cntr_data_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_netr_DomainQuery1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainQuery1 *r) -{ - uint32_t cntr_unknown7_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_SCALARS, &r->blob)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->workstation_domain)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->workstation_site)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown1)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown2)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown3)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown4)); - NDR_CHECK(ndr_push_netr_BinaryString(ndr, NDR_SCALARS, &r->blob2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->product)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown6)); - for (cntr_unknown7_0 = 0; cntr_unknown7_0 < 4; cntr_unknown7_0++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7[cntr_unknown7_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_BUFFERS, &r->blob)); - if (r->workstation_domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->workstation_domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->workstation_domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->workstation_domain, ndr_charset_length(r->workstation_domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->workstation_site) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->workstation_site, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->workstation_site, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->workstation_site, ndr_charset_length(r->workstation_site, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->unknown1) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown1, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown1, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown1, ndr_charset_length(r->unknown1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->unknown2) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown2, ndr_charset_length(r->unknown2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->unknown3) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown3, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown3, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown3, ndr_charset_length(r->unknown3, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->unknown4) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown4, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown4, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown4, ndr_charset_length(r->unknown4, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_netr_BinaryString(ndr, NDR_BUFFERS, &r->blob2)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->product)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown5)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown6)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DomainQuery1(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainQuery1 *r) -{ - uint32_t _ptr_workstation_domain; - TALLOC_CTX *_mem_save_workstation_domain_0; - uint32_t _ptr_workstation_site; - TALLOC_CTX *_mem_save_workstation_site_0; - uint32_t _ptr_unknown1; - TALLOC_CTX *_mem_save_unknown1_0; - uint32_t _ptr_unknown2; - TALLOC_CTX *_mem_save_unknown2_0; - uint32_t _ptr_unknown3; - TALLOC_CTX *_mem_save_unknown3_0; - uint32_t _ptr_unknown4; - TALLOC_CTX *_mem_save_unknown4_0; - uint32_t cntr_unknown7_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_SCALARS, &r->blob)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_workstation_domain)); - if (_ptr_workstation_domain) { - NDR_PULL_ALLOC(ndr, r->workstation_domain); - } else { - r->workstation_domain = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_workstation_site)); - if (_ptr_workstation_site) { - NDR_PULL_ALLOC(ndr, r->workstation_site); - } else { - r->workstation_site = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown1)); - if (_ptr_unknown1) { - NDR_PULL_ALLOC(ndr, r->unknown1); - } else { - r->unknown1 = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); - if (_ptr_unknown2) { - NDR_PULL_ALLOC(ndr, r->unknown2); - } else { - r->unknown2 = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown3)); - if (_ptr_unknown3) { - NDR_PULL_ALLOC(ndr, r->unknown3); - } else { - r->unknown3 = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown4)); - if (_ptr_unknown4) { - NDR_PULL_ALLOC(ndr, r->unknown4); - } else { - r->unknown4 = NULL; - } - NDR_CHECK(ndr_pull_netr_BinaryString(ndr, NDR_SCALARS, &r->blob2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->product)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown6)); - for (cntr_unknown7_0 = 0; cntr_unknown7_0 < 4; cntr_unknown7_0++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7[cntr_unknown7_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_BUFFERS, &r->blob)); - if (r->workstation_domain) { - _mem_save_workstation_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->workstation_domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->workstation_domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->workstation_domain)); - if (ndr_get_array_length(ndr, &r->workstation_domain) > ndr_get_array_size(ndr, &r->workstation_domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->workstation_domain), ndr_get_array_length(ndr, &r->workstation_domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->workstation_domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->workstation_domain, ndr_get_array_length(ndr, &r->workstation_domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_workstation_domain_0, 0); - } - if (r->workstation_site) { - _mem_save_workstation_site_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->workstation_site, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->workstation_site)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->workstation_site)); - if (ndr_get_array_length(ndr, &r->workstation_site) > ndr_get_array_size(ndr, &r->workstation_site)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->workstation_site), ndr_get_array_length(ndr, &r->workstation_site)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->workstation_site), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->workstation_site, ndr_get_array_length(ndr, &r->workstation_site), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_workstation_site_0, 0); - } - if (r->unknown1) { - _mem_save_unknown1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->unknown1, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown1)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown1)); - if (ndr_get_array_length(ndr, &r->unknown1) > ndr_get_array_size(ndr, &r->unknown1)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown1), ndr_get_array_length(ndr, &r->unknown1)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown1), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown1, ndr_get_array_length(ndr, &r->unknown1), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown1_0, 0); - } - if (r->unknown2) { - _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->unknown2, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown2)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown2)); - if (ndr_get_array_length(ndr, &r->unknown2) > ndr_get_array_size(ndr, &r->unknown2)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown2), ndr_get_array_length(ndr, &r->unknown2)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown2, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); - } - if (r->unknown3) { - _mem_save_unknown3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->unknown3, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown3)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown3)); - if (ndr_get_array_length(ndr, &r->unknown3) > ndr_get_array_size(ndr, &r->unknown3)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown3), ndr_get_array_length(ndr, &r->unknown3)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown3), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown3, ndr_get_array_length(ndr, &r->unknown3), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown3_0, 0); - } - if (r->unknown4) { - _mem_save_unknown4_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->unknown4, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown4)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown4)); - if (ndr_get_array_length(ndr, &r->unknown4) > ndr_get_array_size(ndr, &r->unknown4)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown4), ndr_get_array_length(ndr, &r->unknown4)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown4), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown4, ndr_get_array_length(ndr, &r->unknown4), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown4_0, 0); - } - NDR_CHECK(ndr_pull_netr_BinaryString(ndr, NDR_BUFFERS, &r->blob2)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->product)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown5)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown6)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *name, const struct netr_DomainQuery1 *r) -{ - uint32_t cntr_unknown7_0; - ndr_print_struct(ndr, name, "netr_DomainQuery1"); - ndr->depth++; - ndr_print_netr_Blob(ndr, "blob", &r->blob); - ndr_print_ptr(ndr, "workstation_domain", r->workstation_domain); - ndr->depth++; - if (r->workstation_domain) { - ndr_print_string(ndr, "workstation_domain", r->workstation_domain); - } - ndr->depth--; - ndr_print_ptr(ndr, "workstation_site", r->workstation_site); - ndr->depth++; - if (r->workstation_site) { - ndr_print_string(ndr, "workstation_site", r->workstation_site); - } - ndr->depth--; - ndr_print_ptr(ndr, "unknown1", r->unknown1); - ndr->depth++; - if (r->unknown1) { - ndr_print_string(ndr, "unknown1", r->unknown1); - } - ndr->depth--; - ndr_print_ptr(ndr, "unknown2", r->unknown2); - ndr->depth++; - if (r->unknown2) { - ndr_print_string(ndr, "unknown2", r->unknown2); - } - ndr->depth--; - ndr_print_ptr(ndr, "unknown3", r->unknown3); - ndr->depth++; - if (r->unknown3) { - ndr_print_string(ndr, "unknown3", r->unknown3); - } - ndr->depth--; - ndr_print_ptr(ndr, "unknown4", r->unknown4); - ndr->depth++; - if (r->unknown4) { - ndr_print_string(ndr, "unknown4", r->unknown4); - } - ndr->depth--; - ndr_print_netr_BinaryString(ndr, "blob2", &r->blob2); - ndr_print_lsa_String(ndr, "product", &r->product); - ndr_print_lsa_String(ndr, "unknown5", &r->unknown5); - ndr_print_lsa_String(ndr, "unknown6", &r->unknown6); - ndr->print(ndr, "%s: ARRAY(%d)", "unknown7", (int)4); - ndr->depth++; - for (cntr_unknown7_0=0;cntr_unknown7_0<4;cntr_unknown7_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_unknown7_0) != -1) { - ndr_print_uint32(ndr, "unknown7", r->unknown7[cntr_unknown7_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DomainQuery(struct ndr_push *ndr, int ndr_flags, const union netr_DomainQuery *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->query1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->query1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - if (r->query1) { - NDR_CHECK(ndr_push_netr_DomainQuery1(ndr, NDR_SCALARS|NDR_BUFFERS, r->query1)); - } - break; - - case 2: - if (r->query1) { - NDR_CHECK(ndr_push_netr_DomainQuery1(ndr, NDR_SCALARS|NDR_BUFFERS, r->query1)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DomainQuery(struct ndr_pull *ndr, int ndr_flags, union netr_DomainQuery *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_query1_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - uint32_t _ptr_query1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_query1)); - if (_ptr_query1) { - NDR_PULL_ALLOC(ndr, r->query1); - } else { - r->query1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_query1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_query1)); - if (_ptr_query1) { - NDR_PULL_ALLOC(ndr, r->query1); - } else { - r->query1 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - if (r->query1) { - _mem_save_query1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->query1, 0); - NDR_CHECK(ndr_pull_netr_DomainQuery1(ndr, NDR_SCALARS|NDR_BUFFERS, r->query1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query1_0, 0); - } - break; - - case 2: - if (r->query1) { - _mem_save_query1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->query1, 0); - NDR_CHECK(ndr_pull_netr_DomainQuery1(ndr, NDR_SCALARS|NDR_BUFFERS, r->query1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query1_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name, const union netr_DomainQuery *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "netr_DomainQuery"); - switch (level) { - case 1: - ndr_print_ptr(ndr, "query1", r->query1); - ndr->depth++; - if (r->query1) { - ndr_print_netr_DomainQuery1(ndr, "query1", r->query1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "query1", r->query1); - ndr->depth++; - if (r->query1) { - ndr_print_netr_DomainQuery1(ndr, "query1", r->query1); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_netr_trust_extension(struct ndr_push *ndr, int ndr_flags, const struct netr_trust_extension *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8)); - NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parent_index)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_trust_extension(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parent_index)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r) -{ - ndr_print_struct(ndr, name, "netr_trust_extension"); - ndr->depth++; - ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->length); - ndr_print_uint32(ndr, "dummy", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->dummy); - ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->size); - ndr_print_netr_TrustFlags(ndr, "flags", r->flags); - ndr_print_uint32(ndr, "parent_index", r->parent_index); - ndr_print_uint32(ndr, "trust_type", r->trust_type); - ndr_print_uint32(ndr, "trust_attributes", r->trust_attributes); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_trust_extension_container(struct ndr_push *ndr, int ndr_flags, const struct netr_trust_extension_container *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - NDR_CHECK(ndr_push_netr_trust_extension(ndr, NDR_SCALARS, r->info)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_trust_extension_container(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension_container *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_info_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->info); - } else { - r->info = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); - NDR_CHECK(ndr_pull_netr_trust_extension(ndr, NDR_SCALARS, r->info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_trust_extension_container(struct ndr_print *ndr, const char *name, const struct netr_trust_extension_container *r) -{ - ndr_print_struct(ndr, name, "netr_trust_extension_container"); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size); - ndr_print_ptr(ndr, "info", r->info); - ndr->depth++; - if (r->info) { - ndr_print_netr_trust_extension(ndr, "info", r->info); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DomainTrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustInfo *r) -{ - uint32_t cntr_dummystring_0; - uint32_t cntr_dummy_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domainname)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->fulldomainname)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension)); - for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0])); - } - for (cntr_dummy_0 = 0; cntr_dummy_0 < 4; cntr_dummy_0++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy[cntr_dummy_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domainname)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->fulldomainname)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest)); - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension)); - for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DomainTrustInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustInfo *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - uint32_t cntr_dummystring_0; - uint32_t cntr_dummy_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domainname)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->fulldomainname)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->forest)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension)); - for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0])); - } - for (cntr_dummy_0 = 0; cntr_dummy_0 < 4; cntr_dummy_0++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy[cntr_dummy_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domainname)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->fulldomainname)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->forest)); - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension)); - for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0])); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustInfo *r) -{ - uint32_t cntr_dummystring_0; - uint32_t cntr_dummy_0; - ndr_print_struct(ndr, name, "netr_DomainTrustInfo"); - ndr->depth++; - ndr_print_lsa_String(ndr, "domainname", &r->domainname); - ndr_print_lsa_String(ndr, "fulldomainname", &r->fulldomainname); - ndr_print_lsa_String(ndr, "forest", &r->forest); - ndr_print_GUID(ndr, "guid", &r->guid); - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr_print_netr_trust_extension_container(ndr, "trust_extension", &r->trust_extension); - ndr->print(ndr, "%s: ARRAY(%d)", "dummystring", (int)3); - ndr->depth++; - for (cntr_dummystring_0=0;cntr_dummystring_0<3;cntr_dummystring_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_dummystring_0) != -1) { - ndr_print_lsa_String(ndr, "dummystring", &r->dummystring[cntr_dummystring_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "dummy", (int)4); - ndr->depth++; - for (cntr_dummy_0=0;cntr_dummy_0<4;cntr_dummy_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_dummy_0) != -1) { - ndr_print_uint32(ndr, "dummy", r->dummy[cntr_dummy_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LsaPolicyInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_LsaPolicyInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->policy_size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->policy) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->policy_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->policy, r->policy_size)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LsaPolicyInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_LsaPolicyInfo *r) -{ - uint32_t _ptr_policy; - TALLOC_CTX *_mem_save_policy_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->policy_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_policy)); - if (_ptr_policy) { - NDR_PULL_ALLOC(ndr, r->policy); - } else { - r->policy = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->policy) { - _mem_save_policy_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->policy, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->policy)); - NDR_PULL_ALLOC_N(ndr, r->policy, ndr_get_array_size(ndr, &r->policy)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->policy, ndr_get_array_size(ndr, &r->policy))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_0, 0); - } - if (r->policy) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->policy, r->policy_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LsaPolicyInfo(struct ndr_print *ndr, const char *name, const struct netr_LsaPolicyInfo *r) -{ - ndr_print_struct(ndr, name, "netr_LsaPolicyInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "policy_size", r->policy_size); - ndr_print_ptr(ndr, "policy", r->policy); - ndr->depth++; - if (r->policy) { - ndr_print_array_uint8(ndr, "policy", r->policy, r->policy_size); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_WorkstationFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_WorkstationFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_WorkstationFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS", NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_SPN_UPDATE", NETR_WS_FLAG_HANDLES_SPN_UPDATE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DomainInfo1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainInfo1 *r) -{ - uint32_t cntr_trusts_1; - uint32_t cntr_dummystring_0; - uint32_t cntr_dummy_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->domaininfo)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_trusts)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusts)); - NDR_CHECK(ndr_push_netr_LsaPolicyInfo(ndr, NDR_SCALARS, &r->lsa_policy)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dns_hostname)); - for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0])); - } - NDR_CHECK(ndr_push_netr_WorkstationFlags(ndr, NDR_SCALARS, r->workstation_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->supported_enc_types)); - for (cntr_dummy_0 = 0; cntr_dummy_0 < 2; cntr_dummy_0++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy[cntr_dummy_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_BUFFERS, &r->domaininfo)); - if (r->trusts) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_trusts)); - for (cntr_trusts_1 = 0; cntr_trusts_1 < r->num_trusts; cntr_trusts_1++) { - NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->trusts[cntr_trusts_1])); - } - for (cntr_trusts_1 = 0; cntr_trusts_1 < r->num_trusts; cntr_trusts_1++) { - NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_BUFFERS, &r->trusts[cntr_trusts_1])); - } - } - NDR_CHECK(ndr_push_netr_LsaPolicyInfo(ndr, NDR_BUFFERS, &r->lsa_policy)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dns_hostname)); - for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0])); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DomainInfo1(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainInfo1 *r) -{ - uint32_t _ptr_trusts; - uint32_t cntr_trusts_1; - TALLOC_CTX *_mem_save_trusts_0; - TALLOC_CTX *_mem_save_trusts_1; - uint32_t cntr_dummystring_0; - uint32_t cntr_dummy_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->domaininfo)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_trusts)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusts)); - if (_ptr_trusts) { - NDR_PULL_ALLOC(ndr, r->trusts); - } else { - r->trusts = NULL; - } - NDR_CHECK(ndr_pull_netr_LsaPolicyInfo(ndr, NDR_SCALARS, &r->lsa_policy)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dns_hostname)); - for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0])); - } - NDR_CHECK(ndr_pull_netr_WorkstationFlags(ndr, NDR_SCALARS, &r->workstation_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->supported_enc_types)); - for (cntr_dummy_0 = 0; cntr_dummy_0 < 2; cntr_dummy_0++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy[cntr_dummy_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr, NDR_BUFFERS, &r->domaininfo)); - if (r->trusts) { - _mem_save_trusts_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->trusts, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->trusts)); - NDR_PULL_ALLOC_N(ndr, r->trusts, ndr_get_array_size(ndr, &r->trusts)); - _mem_save_trusts_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->trusts, 0); - for (cntr_trusts_1 = 0; cntr_trusts_1 < r->num_trusts; cntr_trusts_1++) { - NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->trusts[cntr_trusts_1])); - } - for (cntr_trusts_1 = 0; cntr_trusts_1 < r->num_trusts; cntr_trusts_1++) { - NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr, NDR_BUFFERS, &r->trusts[cntr_trusts_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, 0); - } - NDR_CHECK(ndr_pull_netr_LsaPolicyInfo(ndr, NDR_BUFFERS, &r->lsa_policy)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dns_hostname)); - for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0])); - } - if (r->trusts) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->trusts, r->num_trusts)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name, const struct netr_DomainInfo1 *r) -{ - uint32_t cntr_trusts_1; - uint32_t cntr_dummystring_0; - uint32_t cntr_dummy_0; - ndr_print_struct(ndr, name, "netr_DomainInfo1"); - ndr->depth++; - ndr_print_netr_DomainTrustInfo(ndr, "domaininfo", &r->domaininfo); - ndr_print_uint32(ndr, "num_trusts", r->num_trusts); - ndr_print_ptr(ndr, "trusts", r->trusts); - ndr->depth++; - if (r->trusts) { - ndr->print(ndr, "%s: ARRAY(%d)", "trusts", (int)r->num_trusts); - ndr->depth++; - for (cntr_trusts_1=0;cntr_trusts_1num_trusts;cntr_trusts_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_trusts_1) != -1) { - ndr_print_netr_DomainTrustInfo(ndr, "trusts", &r->trusts[cntr_trusts_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_netr_LsaPolicyInfo(ndr, "lsa_policy", &r->lsa_policy); - ndr_print_lsa_String(ndr, "dns_hostname", &r->dns_hostname); - ndr->print(ndr, "%s: ARRAY(%d)", "dummystring", (int)3); - ndr->depth++; - for (cntr_dummystring_0=0;cntr_dummystring_0<3;cntr_dummystring_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_dummystring_0) != -1) { - ndr_print_lsa_String(ndr, "dummystring", &r->dummystring[cntr_dummystring_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_netr_WorkstationFlags(ndr, "workstation_flags", r->workstation_flags); - ndr_print_uint32(ndr, "supported_enc_types", r->supported_enc_types); - ndr->print(ndr, "%s: ARRAY(%d)", "dummy", (int)2); - ndr->depth++; - for (cntr_dummy_0=0;cntr_dummy_0<2;cntr_dummy_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_dummy_0) != -1) { - ndr_print_uint32(ndr, "dummy", r->dummy[cntr_dummy_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union netr_DomainInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - if (r->info1) { - NDR_CHECK(ndr_push_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - } - break; - - case 2: - if (r->info2) { - NDR_CHECK(ndr_push_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union netr_DomainInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info1_0; - TALLOC_CTX *_mem_save_info2_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - uint32_t _ptr_info1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); - if (_ptr_info1) { - NDR_PULL_ALLOC(ndr, r->info1); - } else { - r->info1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_info2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); - if (_ptr_info2) { - NDR_PULL_ALLOC(ndr, r->info2); - } else { - r->info2 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - if (r->info1) { - _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); - NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); - } - break; - - case 2: - if (r->info2) { - _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); - NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "netr_DomainInfo"); - switch (level) { - case 1: - ndr_print_ptr(ndr, "info1", r->info1); - ndr->depth++; - if (r->info1) { - ndr_print_netr_DomainInfo1(ndr, "info1", r->info1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "info2", r->info2); - ndr->depth++; - if (r->info2) { - ndr_print_netr_DomainInfo1(ndr, "info2", r->info2); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_netr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct netr_CryptPassword *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 512)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct netr_CryptPassword *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 512)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r) -{ - ndr_print_struct(ndr, name, "netr_CryptPassword"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "data", r->data, 512); - ndr_print_uint32(ndr, "length", r->length); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesWCtr *r) -{ - uint32_t cntr_sitename_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sitename) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); - } - for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesWCtr *r) -{ - uint32_t _ptr_sitename; - uint32_t cntr_sitename_1; - TALLOC_CTX *_mem_save_sitename_0; - TALLOC_CTX *_mem_save_sitename_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename)); - if (_ptr_sitename) { - NDR_PULL_ALLOC(ndr, r->sitename); - } else { - r->sitename = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sitename) { - _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename)); - NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename)); - _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); - for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); - } - for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0); - } - if (r->sitename) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r) -{ - uint32_t cntr_sitename_1; - ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesWCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "sitename", r->sitename); - ndr->depth++; - if (r->sitename) { - ndr->print(ndr, "%s: ARRAY(%d)", "sitename", (int)r->count); - ndr->depth++; - for (cntr_sitename_1=0;cntr_sitename_1count;cntr_sitename_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) { - ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRAddress(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddress *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->buffer) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->size)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRAddress(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddress *r) -{ - uint32_t _ptr_buffer; - TALLOC_CTX *_mem_save_buffer_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); - if (_ptr_buffer) { - NDR_PULL_ALLOC(ndr, r->buffer); - } else { - r->buffer = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->buffer) { - _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer)); - NDR_PULL_ALLOC_N(ndr, r->buffer, ndr_get_array_size(ndr, &r->buffer)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, ndr_get_array_size(ndr, &r->buffer))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); - } - if (r->buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r) -{ - ndr_print_struct(ndr, name, "netr_DsRAddress"); - ndr->depth++; - ndr_print_ptr(ndr, "buffer", r->buffer); - ndr->depth++; - if (r->buffer) { - ndr_print_array_uint8(ndr, "buffer", r->buffer, r->size); - } - ndr->depth--; - ndr_print_uint32(ndr, "size", r->size); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_TrustType(struct ndr_push *ndr, int ndr_flags, enum netr_TrustType r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_TrustType(struct ndr_pull *ndr, int ndr_flags, enum netr_TrustType *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r) -{ - const char *val = NULL; - - switch (r) { - case NETR_TRUST_TYPE_DOWNLEVEL: val = "NETR_TRUST_TYPE_DOWNLEVEL"; break; - case NETR_TRUST_TYPE_UPLEVEL: val = "NETR_TRUST_TYPE_UPLEVEL"; break; - case NETR_TRUST_TYPE_MIT: val = "NETR_TRUST_TYPE_MIT"; break; - case NETR_TRUST_TYPE_DCE: val = "NETR_TRUST_TYPE_DCE"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_netr_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE", NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY", NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_WITHIN_FOREST", NETR_TRUST_ATTRIBUTE_WITHIN_FOREST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DomainTrust(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrust *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name)); - NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->trust_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parent_index)); - NDR_CHECK(ndr_push_netr_TrustType(ndr, NDR_SCALARS, r->trust_type)); - NDR_CHECK(ndr_push_netr_TrustAttributes(ndr, NDR_SCALARS, r->trust_attributes)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->dns_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DomainTrust(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrust *r) -{ - uint32_t _ptr_netbios_name; - TALLOC_CTX *_mem_save_netbios_name_0; - uint32_t _ptr_dns_name; - TALLOC_CTX *_mem_save_dns_name_0; - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_sid_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name)); - if (_ptr_netbios_name) { - NDR_PULL_ALLOC(ndr, r->netbios_name); - } else { - r->netbios_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name)); - if (_ptr_dns_name) { - NDR_PULL_ALLOC(ndr, r->dns_name); - } else { - r->dns_name = NULL; - } - NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->trust_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parent_index)); - NDR_CHECK(ndr_pull_netr_TrustType(ndr, NDR_SCALARS, &r->trust_type)); - NDR_CHECK(ndr_pull_netr_TrustAttributes(ndr, NDR_SCALARS, &r->trust_attributes)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, r->sid); - } else { - r->sid = NULL; - } - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->netbios_name) { - _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name)); - if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0); - } - if (r->dns_name) { - _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name)); - if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0); - } - if (r->sid) { - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r) -{ - ndr_print_struct(ndr, name, "netr_DomainTrust"); - ndr->depth++; - ndr_print_ptr(ndr, "netbios_name", r->netbios_name); - ndr->depth++; - if (r->netbios_name) { - ndr_print_string(ndr, "netbios_name", r->netbios_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "dns_name", r->dns_name); - ndr->depth++; - if (r->dns_name) { - ndr_print_string(ndr, "dns_name", r->dns_name); - } - ndr->depth--; - ndr_print_netr_TrustFlags(ndr, "trust_flags", r->trust_flags); - ndr_print_uint32(ndr, "parent_index", r->parent_index); - ndr_print_netr_TrustType(ndr, "trust_type", r->trust_type); - ndr_print_netr_TrustAttributes(ndr, "trust_attributes", r->trust_attributes); - ndr_print_ptr(ndr, "sid", r->sid); - ndr->depth++; - if (r->sid) { - ndr_print_dom_sid2(ndr, "sid", r->sid); - } - ndr->depth--; - ndr_print_GUID(ndr, "guid", &r->guid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DomainTrustList(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustList *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DomainTrustList(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustList *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "netr_DomainTrustList"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_netr_DomainTrust(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesExWCtr *r) -{ - uint32_t cntr_sitename_1; - uint32_t cntr_subnetname_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sitename)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->subnetname)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sitename) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); - } - for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); - } - } - if (r->subnetname) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1])); - } - for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesExWCtr *r) -{ - uint32_t _ptr_sitename; - uint32_t cntr_sitename_1; - TALLOC_CTX *_mem_save_sitename_0; - TALLOC_CTX *_mem_save_sitename_1; - uint32_t _ptr_subnetname; - uint32_t cntr_subnetname_1; - TALLOC_CTX *_mem_save_subnetname_0; - TALLOC_CTX *_mem_save_subnetname_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sitename)); - if (_ptr_sitename) { - NDR_PULL_ALLOC(ndr, r->sitename); - } else { - r->sitename = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_subnetname)); - if (_ptr_subnetname) { - NDR_PULL_ALLOC(ndr, r->subnetname); - } else { - r->subnetname = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sitename) { - _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename)); - NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename)); - _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); - for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); - } - for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0); - } - if (r->subnetname) { - _mem_save_subnetname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->subnetname)); - NDR_PULL_ALLOC_N(ndr, r->subnetname, ndr_get_array_size(ndr, &r->subnetname)); - _mem_save_subnetname_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0); - for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1])); - } - for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_0, 0); - } - if (r->sitename) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count)); - } - if (r->subnetname) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->subnetname, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r) -{ - uint32_t cntr_sitename_1; - uint32_t cntr_subnetname_1; - ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExWCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "sitename", r->sitename); - ndr->depth++; - if (r->sitename) { - ndr->print(ndr, "%s: ARRAY(%d)", "sitename", (int)r->count); - ndr->depth++; - for (cntr_sitename_1=0;cntr_sitename_1count;cntr_sitename_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) { - ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_ptr(ndr, "subnetname", r->subnetname); - ndr->depth++; - if (r->subnetname) { - ndr->print(ndr, "%s: ARRAY(%d)", "subnetname", (int)r->count); - ndr->depth++; - for (cntr_subnetname_1=0;cntr_subnetname_1count;cntr_subnetname_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_subnetname_1) != -1) { - ndr_print_lsa_String(ndr, "subnetname", &r->subnetname[cntr_subnetname_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_DcSitesCtr(struct ndr_push *ndr, int ndr_flags, const struct DcSitesCtr *r) -{ - uint32_t cntr_sites_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sites)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sites) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites)); - for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1])); - } - for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_DcSitesCtr(struct ndr_pull *ndr, int ndr_flags, struct DcSitesCtr *r) -{ - uint32_t _ptr_sites; - uint32_t cntr_sites_1; - TALLOC_CTX *_mem_save_sites_0; - TALLOC_CTX *_mem_save_sites_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sites)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sites)); - if (_ptr_sites) { - NDR_PULL_ALLOC(ndr, r->sites); - } else { - r->sites = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sites) { - _mem_save_sites_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sites)); - NDR_PULL_ALLOC_N(ndr, r->sites, ndr_get_array_size(ndr, &r->sites)); - _mem_save_sites_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0); - for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1])); - } - for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_0, 0); - } - if (r->sites) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sites, r->num_sites)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r) -{ - uint32_t cntr_sites_1; - ndr_print_struct(ndr, name, "DcSitesCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "num_sites", r->num_sites); - ndr_print_ptr(ndr, "sites", r->sites); - ndr->depth++; - if (r->sites) { - ndr->print(ndr, "%s: ARRAY(%d)", "sites", (int)r->num_sites); - ndr->depth++; - for (cntr_sites_1=0;cntr_sites_1num_sites;cntr_sites_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_sites_1) != -1) { - ndr_print_lsa_String(ndr, "sites", &r->sites[cntr_sites_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_TrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_TrustInfo *r) -{ - uint32_t cntr_data_1; - uint32_t cntr_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entry_count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_data_1 = 0; cntr_data_1 < r->count; cntr_data_1++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data[cntr_data_1])); - } - } - if (r->entries) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_TrustInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_TrustInfo *r) -{ - uint32_t _ptr_data; - uint32_t cntr_data_1; - TALLOC_CTX *_mem_save_data_0; - TALLOC_CTX *_mem_save_data_1; - uint32_t _ptr_entries; - uint32_t cntr_entries_1; - TALLOC_CTX *_mem_save_entries_0; - TALLOC_CTX *_mem_save_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entry_count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); - if (_ptr_entries) { - NDR_PULL_ALLOC(ndr, r->entries); - } else { - r->entries = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - for (cntr_data_1 = 0; cntr_data_1 < r->count; cntr_data_1++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data[cntr_data_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->entries) { - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); - NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); - _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->count)); - } - if (r->entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_TrustInfo(struct ndr_print *ndr, const char *name, const struct netr_TrustInfo *r) -{ - uint32_t cntr_data_1; - uint32_t cntr_entries_1; - ndr_print_struct(ndr, name, "netr_TrustInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr->print(ndr, "%s: ARRAY(%d)", "data", (int)r->count); - ndr->depth++; - for (cntr_data_1=0;cntr_data_1count;cntr_data_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_data_1) != -1) { - ndr_print_uint32(ndr, "data", r->data[cntr_data_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_uint32(ndr, "entry_count", r->entry_count); - ndr_print_ptr(ndr, "entries", r->entries); - ndr->depth++; - if (r->entries) { - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); - ndr->depth++; - for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { - ndr_print_lsa_String(ndr, "entries", &r->entries[cntr_entries_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogon *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16))); - 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonUasLogon(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogon *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.workstation)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.workstation)); - if (ndr_get_array_length(ndr, &r->in.workstation) > ndr_get_array_size(ndr, &r->in.workstation)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.workstation), ndr_get_array_length(ndr, &r->in.workstation)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogon *r) -{ - ndr_print_struct(ndr, name, "netr_LogonUasLogon"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonUasLogon"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr_print_string(ndr, "workstation", r->in.workstation); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonUasLogon"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_netr_UasInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonUasLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogoff *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.workstation, CH_UTF16))); - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonUasLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogoff *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.workstation)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.workstation)); - if (ndr_get_array_length(ndr, &r->in.workstation) > ndr_get_array_size(ndr, &r->in.workstation)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.workstation), ndr_get_array_length(ndr, &r->in.workstation)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_UasLogoffInfo(ndr, NDR_SCALARS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogoff *r) -{ - ndr_print_struct(ndr, name, "netr_LogonUasLogoff"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonUasLogoff"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr_print_string(ndr, "workstation", r->in.workstation); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonUasLogoff"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_netr_UasLogoffInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogon *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); - if (r->in.computer_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential)); - if (r->in.credential) { - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator)); - if (r->in.return_authenticator) { - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - } - NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level)); - if (r->in.logon == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - 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 (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator)); - if (r->out.return_authenticator) { - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - } - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogon *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_computer_name; - uint32_t _ptr_credential; - uint32_t _ptr_return_authenticator; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_computer_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_logon_0; - TALLOC_CTX *_mem_save_validation_0; - TALLOC_CTX *_mem_save_authoritative_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); - if (_ptr_computer_name) { - NDR_PULL_ALLOC(ndr, r->in.computer_name); - } else { - r->in.computer_name = NULL; - } - if (r->in.computer_name) { - _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential)); - if (_ptr_credential) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } else { - r->in.credential = NULL; - } - if (r->in.credential) { - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); - if (_ptr_return_authenticator) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } else { - r->in.return_authenticator = NULL; - } - if (r->in.return_authenticator) { - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); - } - NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.logon); - } - _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level)); - NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level)); - NDR_PULL_ALLOC(ndr, r->out.validation); - ZERO_STRUCTP(r->out.validation); - NDR_PULL_ALLOC(ndr, r->out.authoritative); - ZERO_STRUCTP(r->out.authoritative); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); - if (_ptr_return_authenticator) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } else { - r->out.return_authenticator = NULL; - } - if (r->out.return_authenticator) { - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.validation); - } - _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level)); - NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.authoritative); - } - _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogon *r) -{ - ndr_print_struct(ndr, name, "netr_LogonSamLogon"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonSamLogon"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "computer_name", r->in.computer_name); - ndr->depth++; - if (r->in.computer_name) { - ndr_print_string(ndr, "computer_name", r->in.computer_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - if (r->in.credential) { - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - } - ndr->depth--; - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - if (r->in.return_authenticator) { - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - } - ndr->depth--; - ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level); - ndr_print_ptr(ndr, "logon", r->in.logon); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level); - ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon); - ndr->depth--; - ndr_print_uint16(ndr, "validation_level", r->in.validation_level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonSamLogon"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - if (r->out.return_authenticator) { - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - } - ndr->depth--; - ndr_print_ptr(ndr, "validation", r->out.validation); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level); - ndr_print_netr_Validation(ndr, "validation", r->out.validation); - ndr->depth--; - ndr_print_ptr(ndr, "authoritative", r->out.authoritative); - ndr->depth++; - ndr_print_uint8(ndr, "authoritative", *r->out.authoritative); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonSamLogoff(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogoff *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); - if (r->in.computer_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential)); - if (r->in.credential) { - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator)); - if (r->in.return_authenticator) { - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - } - NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level)); - 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)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator)); - if (r->out.return_authenticator) { - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonSamLogoff(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogoff *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_computer_name; - uint32_t _ptr_credential; - uint32_t _ptr_return_authenticator; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_computer_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); - if (_ptr_computer_name) { - NDR_PULL_ALLOC(ndr, r->in.computer_name); - } else { - r->in.computer_name = NULL; - } - if (r->in.computer_name) { - _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential)); - if (_ptr_credential) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } else { - r->in.credential = NULL; - } - if (r->in.credential) { - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); - if (_ptr_return_authenticator) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } else { - r->in.return_authenticator = NULL; - } - if (r->in.return_authenticator) { - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); - } - NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level)); - NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); - if (_ptr_return_authenticator) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } else { - r->out.return_authenticator = NULL; - } - if (r->out.return_authenticator) { - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); - } - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonSamLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogoff *r) -{ - ndr_print_struct(ndr, name, "netr_LogonSamLogoff"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonSamLogoff"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "computer_name", r->in.computer_name); - ndr->depth++; - if (r->in.computer_name) { - ndr_print_string(ndr, "computer_name", r->in.computer_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - if (r->in.credential) { - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - } - ndr->depth--; - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - if (r->in.return_authenticator) { - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - } - ndr->depth--; - ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level); - ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level); - ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonSamLogoff"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - if (r->out.return_authenticator) { - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - } - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags, const struct netr_ServerReqChallenge *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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.return_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.return_credentials)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, int flags, struct netr_ServerReqChallenge *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credentials_0; - TALLOC_CTX *_mem_save_return_credentials_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credentials); - } - _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_credentials); - ZERO_STRUCTP(r->out.return_credentials); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_credentials); - } - _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerReqChallenge *r) -{ - ndr_print_struct(ndr, name, "netr_ServerReqChallenge"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_ServerReqChallenge"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr_print_ptr(ndr, "credentials", r->in.credentials); - ndr->depth++; - ndr_print_netr_Credential(ndr, "credentials", r->in.credentials); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_ServerReqChallenge"); - ndr->depth++; - ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); - ndr->depth++; - ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ServerAuthenticate(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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.return_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.return_credentials)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ServerAuthenticate(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credentials_0; - TALLOC_CTX *_mem_save_return_credentials_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credentials); - } - _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_credentials); - ZERO_STRUCTP(r->out.return_credentials); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_credentials); - } - _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate *r) -{ - ndr_print_struct(ndr, name, "netr_ServerAuthenticate"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_ServerAuthenticate"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr_print_ptr(ndr, "credentials", r->in.credentials); - ndr->depth++; - ndr_print_netr_Credential(ndr, "credentials", r->in.credentials); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_ServerAuthenticate"); - ndr->depth++; - ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); - ndr->depth++; - ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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.new_password == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_password)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_new_password_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.new_password); - } - _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - ZERO_STRUCTP(r->out.return_authenticator); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet *r) -{ - ndr_print_struct(ndr, name, "netr_ServerPasswordSet"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_ServerPasswordSet"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr_print_ptr(ndr, "new_password", r->in.new_password); - ndr->depth++; - ndr_print_samr_Password(ndr, "new_password", r->in.new_password); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_ServerPasswordSet"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int flags, const struct netr_DatabaseDeltas *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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)); - 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 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 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->out.sequence_num)); - if (r->out.delta_enum_array == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); - if (*r->out.delta_enum_array) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, struct netr_DatabaseDeltas *r) -{ - uint32_t _ptr_delta_enum_array; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_sequence_num_0; - TALLOC_CTX *_mem_save_delta_enum_array_0; - TALLOC_CTX *_mem_save_delta_enum_array_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); - if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sequence_num); - } - _mem_save_sequence_num_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sequence_num, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->in.sequence_num)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength)); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - *r->out.return_authenticator = *r->in.return_authenticator; - NDR_PULL_ALLOC(ndr, r->out.sequence_num); - *r->out.sequence_num = *r->in.sequence_num; - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - ZERO_STRUCTP(r->out.delta_enum_array); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sequence_num); - } - _mem_save_sequence_num_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence_num, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->out.sequence_num)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - } - _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); - if (_ptr_delta_enum_array) { - NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); - } else { - *r->out.delta_enum_array = NULL; - } - if (*r->out.delta_enum_array) { - _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseDeltas *r) -{ - ndr_print_struct(ndr, name, "netr_DatabaseDeltas"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DatabaseDeltas"); - ndr->depth++; - ndr_print_string(ndr, "logon_server", r->in.logon_server); - ndr_print_string(ndr, "computername", r->in.computername); - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth--; - ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id); - ndr_print_ptr(ndr, "sequence_num", r->in.sequence_num); - ndr->depth++; - ndr_print_udlong(ndr, "sequence_num", *r->in.sequence_num); - ndr->depth--; - ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DatabaseDeltas"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "sequence_num", r->out.sequence_num); - ndr->depth++; - ndr_print_udlong(ndr, "sequence_num", *r->out.sequence_num); - ndr->depth--; - ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); - ndr->depth++; - ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); - ndr->depth++; - if (*r->out.delta_enum_array) { - ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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)); - 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 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 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context)); - if (r->out.delta_enum_array == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); - if (*r->out.delta_enum_array) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync *r) -{ - uint32_t _ptr_delta_enum_array; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_sync_context_0; - TALLOC_CTX *_mem_save_delta_enum_array_0; - TALLOC_CTX *_mem_save_delta_enum_array_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); - if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sync_context); - } - _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sync_context, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.sync_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength)); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - *r->out.return_authenticator = *r->in.return_authenticator; - NDR_PULL_ALLOC(ndr, r->out.sync_context); - *r->out.sync_context = *r->in.sync_context; - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - ZERO_STRUCTP(r->out.delta_enum_array); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sync_context); - } - _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - } - _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); - if (_ptr_delta_enum_array) { - NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); - } else { - *r->out.delta_enum_array = NULL; - } - if (*r->out.delta_enum_array) { - _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync *r) -{ - ndr_print_struct(ndr, name, "netr_DatabaseSync"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DatabaseSync"); - ndr->depth++; - ndr_print_string(ndr, "logon_server", r->in.logon_server); - ndr_print_string(ndr, "computername", r->in.computername); - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth--; - ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id); - ndr_print_ptr(ndr, "sync_context", r->in.sync_context); - ndr->depth++; - ndr_print_uint32(ndr, "sync_context", *r->in.sync_context); - ndr->depth--; - ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DatabaseSync"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "sync_context", r->out.sync_context); - ndr->depth++; - ndr_print_uint32(ndr, "sync_context", *r->out.sync_context); - ndr->depth--; - ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); - ndr->depth++; - ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); - ndr->depth++; - if (*r->out.delta_enum_array) { - ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_AccountDeltas(struct ndr_push *ndr, int flags, const struct netr_AccountDeltas *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); - if (r->in.logon_server) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffersize)); - } - if (flags & NDR_OUT) { - 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 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 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_AccountDeltas(struct ndr_pull *ndr, int flags, struct netr_AccountDeltas *r) -{ - uint32_t _ptr_logon_server; - TALLOC_CTX *_mem_save_logon_server_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_buffer_0; - TALLOC_CTX *_mem_save_count_returned_0; - TALLOC_CTX *_mem_save_total_entries_0; - TALLOC_CTX *_mem_save_recordid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); - if (_ptr_logon_server) { - NDR_PULL_ALLOC(ndr, r->in.logon_server); - } else { - r->in.logon_server = NULL; - } - if (r->in.logon_server) { - _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); - if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, &r->in.uas)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffersize)); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - *r->out.return_authenticator = *r->in.return_authenticator; - NDR_PULL_ALLOC(ndr, r->out.buffer); - ZERO_STRUCTP(r->out.buffer); - NDR_PULL_ALLOC(ndr, r->out.count_returned); - ZERO_STRUCTP(r->out.count_returned); - NDR_PULL_ALLOC(ndr, r->out.total_entries); - ZERO_STRUCTP(r->out.total_entries); - NDR_PULL_ALLOC(ndr, r->out.recordid); - ZERO_STRUCTP(r->out.recordid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.buffer); - } - _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, LIBNDR_FLAG_REF_ALLOC); - { - struct ndr_pull *_ndr_buffer; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 4, -1)); - NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 4, -1)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count_returned); - } - _mem_save_count_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count_returned, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count_returned)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_returned_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.total_entries); - } - _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.recordid); - } - _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.recordid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_AccountDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountDeltas *r) -{ - ndr_print_struct(ndr, name, "netr_AccountDeltas"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_AccountDeltas"); - ndr->depth++; - ndr_print_ptr(ndr, "logon_server", r->in.logon_server); - ndr->depth++; - if (r->in.logon_server) { - ndr_print_string(ndr, "logon_server", r->in.logon_server); - } - ndr->depth--; - ndr_print_string(ndr, "computername", r->in.computername); - ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential); - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth--; - ndr_print_netr_UAS_INFO_0(ndr, "uas", &r->in.uas); - ndr_print_uint32(ndr, "count", r->in.count); - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_uint32(ndr, "buffersize", r->in.buffersize); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_AccountDeltas"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "buffer", r->out.buffer); - ndr->depth++; - ndr_print_netr_AccountBuffer(ndr, "buffer", r->out.buffer); - ndr->depth--; - ndr_print_ptr(ndr, "count_returned", r->out.count_returned); - ndr->depth++; - ndr_print_uint32(ndr, "count_returned", *r->out.count_returned); - ndr->depth--; - ndr_print_ptr(ndr, "total_entries", r->out.total_entries); - ndr->depth++; - ndr_print_uint32(ndr, "total_entries", *r->out.total_entries); - ndr->depth--; - ndr_print_ptr(ndr, "recordid", r->out.recordid); - ndr->depth++; - ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->out.recordid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_AccountSync(struct ndr_push *ndr, int flags, const struct netr_AccountSync *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); - if (r->in.logon_server) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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 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 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 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 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 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 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_AccountSync(struct ndr_pull *ndr, int flags, struct netr_AccountSync *r) -{ - uint32_t _ptr_logon_server; - TALLOC_CTX *_mem_save_logon_server_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_buffer_0; - TALLOC_CTX *_mem_save_count_returned_0; - TALLOC_CTX *_mem_save_total_entries_0; - TALLOC_CTX *_mem_save_next_reference_0; - TALLOC_CTX *_mem_save_recordid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); - if (_ptr_logon_server) { - NDR_PULL_ALLOC(ndr, r->in.logon_server); - } else { - r->in.logon_server = NULL; - } - if (r->in.logon_server) { - _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); - if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reference)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffersize)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.recordid); - } - _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.recordid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->in.recordid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - *r->out.return_authenticator = *r->in.return_authenticator; - NDR_PULL_ALLOC(ndr, r->out.buffer); - ZERO_STRUCTP(r->out.buffer); - NDR_PULL_ALLOC(ndr, r->out.count_returned); - ZERO_STRUCTP(r->out.count_returned); - NDR_PULL_ALLOC(ndr, r->out.total_entries); - ZERO_STRUCTP(r->out.total_entries); - NDR_PULL_ALLOC(ndr, r->out.next_reference); - ZERO_STRUCTP(r->out.next_reference); - NDR_PULL_ALLOC(ndr, r->out.recordid); - *r->out.recordid = *r->in.recordid; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.buffer); - } - _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, LIBNDR_FLAG_REF_ALLOC); - { - struct ndr_pull *_ndr_buffer; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 4, -1)); - NDR_CHECK(ndr_pull_netr_AccountBuffer(_ndr_buffer, NDR_SCALARS, r->out.buffer)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 4, -1)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count_returned); - } - _mem_save_count_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count_returned, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count_returned)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_returned_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.total_entries); - } - _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.next_reference); - } - _mem_save_next_reference_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.next_reference, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.next_reference)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_reference_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.recordid); - } - _mem_save_recordid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.recordid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_UAS_INFO_0(ndr, NDR_SCALARS, r->out.recordid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_recordid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_AccountSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountSync *r) -{ - ndr_print_struct(ndr, name, "netr_AccountSync"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_AccountSync"); - ndr->depth++; - ndr_print_ptr(ndr, "logon_server", r->in.logon_server); - ndr->depth++; - if (r->in.logon_server) { - ndr_print_string(ndr, "logon_server", r->in.logon_server); - } - ndr->depth--; - ndr_print_string(ndr, "computername", r->in.computername); - ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential); - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth--; - ndr_print_uint32(ndr, "reference", r->in.reference); - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_uint32(ndr, "buffersize", r->in.buffersize); - ndr_print_ptr(ndr, "recordid", r->in.recordid); - ndr->depth++; - ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->in.recordid); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_AccountSync"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "buffer", r->out.buffer); - ndr->depth++; - ndr_print_netr_AccountBuffer(ndr, "buffer", r->out.buffer); - ndr->depth--; - ndr_print_ptr(ndr, "count_returned", r->out.count_returned); - ndr->depth++; - ndr_print_uint32(ndr, "count_returned", *r->out.count_returned); - ndr->depth--; - ndr_print_ptr(ndr, "total_entries", r->out.total_entries); - ndr->depth++; - ndr_print_uint32(ndr, "total_entries", *r->out.total_entries); - ndr->depth--; - ndr_print_ptr(ndr, "next_reference", r->out.next_reference); - ndr->depth++; - ndr_print_uint32(ndr, "next_reference", *r->out.next_reference); - ndr->depth--; - ndr_print_ptr(ndr, "recordid", r->out.recordid); - ndr->depth++; - ndr_print_netr_UAS_INFO_0(ndr, "recordid", r->out.recordid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_GetDcName(struct ndr_push *ndr, int flags, const struct netr_GetDcName *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domainname)); - if (r->in.domainname) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domainname, ndr_charset_length(r->in.domainname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - if (r->out.dcname == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname)); - if (*r->out.dcname) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_GetDcName(struct ndr_pull *ndr, int flags, struct netr_GetDcName *r) -{ - uint32_t _ptr_domainname; - uint32_t _ptr_dcname; - TALLOC_CTX *_mem_save_domainname_0; - TALLOC_CTX *_mem_save_dcname_0; - TALLOC_CTX *_mem_save_dcname_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domainname)); - if (_ptr_domainname) { - NDR_PULL_ALLOC(ndr, r->in.domainname); - } else { - r->in.domainname = NULL; - } - if (r->in.domainname) { - _mem_save_domainname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domainname, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domainname)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domainname)); - if (ndr_get_array_length(ndr, &r->in.domainname) > ndr_get_array_size(ndr, &r->in.domainname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domainname), ndr_get_array_length(ndr, &r->in.domainname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domainname, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domainname_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.dcname); - ZERO_STRUCTP(r->out.dcname); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.dcname); - } - _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname)); - if (_ptr_dcname) { - NDR_PULL_ALLOC(ndr, *r->out.dcname); - } else { - *r->out.dcname = NULL; - } - if (*r->out.dcname) { - _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname)); - if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_GetDcName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetDcName *r) -{ - ndr_print_struct(ndr, name, "netr_GetDcName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_GetDcName"); - ndr->depth++; - ndr_print_string(ndr, "logon_server", r->in.logon_server); - ndr_print_ptr(ndr, "domainname", r->in.domainname); - ndr->depth++; - if (r->in.domainname) { - ndr_print_string(ndr, "domainname", r->in.domainname); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_GetDcName"); - ndr->depth++; - ndr_print_ptr(ndr, "dcname", r->out.dcname); - ndr->depth++; - ndr_print_ptr(ndr, "dcname", *r->out.dcname); - ndr->depth++; - if (*r->out.dcname) { - ndr_print_string(ndr, "dcname", *r->out.dcname); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonControl(struct ndr_push *ndr, int flags, const struct netr_LogonControl *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); - if (r->in.logon_server) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonControl(struct ndr_pull *ndr, int flags, struct netr_LogonControl *r) -{ - uint32_t _ptr_logon_server; - TALLOC_CTX *_mem_save_logon_server_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); - if (_ptr_logon_server) { - NDR_PULL_ALLOC(ndr, r->in.logon_server); - } else { - r->in.logon_server = NULL; - } - if (r->in.logon_server) { - _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); - } - NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonControl(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl *r) -{ - ndr_print_struct(ndr, name, "netr_LogonControl"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonControl"); - ndr->depth++; - ndr_print_ptr(ndr, "logon_server", r->in.logon_server); - ndr->depth++; - if (r->in.logon_server) { - ndr_print_string(ndr, "logon_server", r->in.logon_server); - } - ndr->depth--; - ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code); - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonControl"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_GetAnyDCName(struct ndr_push *ndr, int flags, const struct netr_GetAnyDCName *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); - if (r->in.logon_server) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domainname)); - if (r->in.domainname) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domainname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domainname, ndr_charset_length(r->in.domainname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - if (r->out.dcname == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname)); - if (*r->out.dcname) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int flags, struct netr_GetAnyDCName *r) -{ - uint32_t _ptr_logon_server; - uint32_t _ptr_domainname; - uint32_t _ptr_dcname; - TALLOC_CTX *_mem_save_logon_server_0; - TALLOC_CTX *_mem_save_domainname_0; - TALLOC_CTX *_mem_save_dcname_0; - TALLOC_CTX *_mem_save_dcname_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); - if (_ptr_logon_server) { - NDR_PULL_ALLOC(ndr, r->in.logon_server); - } else { - r->in.logon_server = NULL; - } - if (r->in.logon_server) { - _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domainname)); - if (_ptr_domainname) { - NDR_PULL_ALLOC(ndr, r->in.domainname); - } else { - r->in.domainname = NULL; - } - if (r->in.domainname) { - _mem_save_domainname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domainname, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domainname)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domainname)); - if (ndr_get_array_length(ndr, &r->in.domainname) > ndr_get_array_size(ndr, &r->in.domainname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domainname), ndr_get_array_length(ndr, &r->in.domainname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domainname, ndr_get_array_length(ndr, &r->in.domainname), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domainname_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.dcname); - ZERO_STRUCTP(r->out.dcname); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.dcname); - } - _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname)); - if (_ptr_dcname) { - NDR_PULL_ALLOC(ndr, *r->out.dcname); - } else { - *r->out.dcname = NULL; - } - if (*r->out.dcname) { - _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname)); - if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetAnyDCName *r) -{ - ndr_print_struct(ndr, name, "netr_GetAnyDCName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_GetAnyDCName"); - ndr->depth++; - ndr_print_ptr(ndr, "logon_server", r->in.logon_server); - ndr->depth++; - if (r->in.logon_server) { - ndr_print_string(ndr, "logon_server", r->in.logon_server); - } - ndr->depth--; - ndr_print_ptr(ndr, "domainname", r->in.domainname); - ndr->depth++; - if (r->in.domainname) { - ndr_print_string(ndr, "domainname", r->in.domainname); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_GetAnyDCName"); - ndr->depth++; - ndr_print_ptr(ndr, "dcname", r->out.dcname); - ndr->depth++; - ndr_print_ptr(ndr, "dcname", *r->out.dcname); - ndr->depth++; - if (*r->out.dcname) { - ndr_print_string(ndr, "dcname", *r->out.dcname); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonControl2(struct ndr_push *ndr, int flags, const struct netr_LogonControl2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); - if (r->in.logon_server) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.data == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.data, r->in.function_code)); - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int flags, struct netr_LogonControl2 *r) -{ - uint32_t _ptr_logon_server; - TALLOC_CTX *_mem_save_logon_server_0; - TALLOC_CTX *_mem_save_data_0; - TALLOC_CTX *_mem_save_query_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); - if (_ptr_logon_server) { - NDR_PULL_ALLOC(ndr, r->in.logon_server); - } else { - r->in.logon_server = NULL; - } - if (r->in.logon_server) { - _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); - } - NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.data); - } - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.data, r->in.function_code)); - NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.query); - ZERO_STRUCTP(r->out.query); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.query); - } - _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level)); - NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2 *r) -{ - ndr_print_struct(ndr, name, "netr_LogonControl2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonControl2"); - ndr->depth++; - ndr_print_ptr(ndr, "logon_server", r->in.logon_server); - ndr->depth++; - if (r->in.logon_server) { - ndr_print_string(ndr, "logon_server", r->in.logon_server); - } - ndr->depth--; - ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code); - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "data", r->in.data); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.data, r->in.function_code); - ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", r->in.data); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonControl2"); - ndr->depth++; - ndr_print_ptr(ndr, "query", r->out.query); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.query, r->in.level); - ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ServerAuthenticate2(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->in.negotiate_flags)); - } - if (flags & NDR_OUT) { - if (r->out.return_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.return_credentials)); - if (r->out.negotiate_flags == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->out.negotiate_flags)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate2 *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credentials_0; - TALLOC_CTX *_mem_save_return_credentials_0; - TALLOC_CTX *_mem_save_negotiate_flags_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credentials); - } - _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.negotiate_flags); - } - _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->in.negotiate_flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_credentials); - ZERO_STRUCTP(r->out.return_credentials); - NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); - *r->out.negotiate_flags = *r->in.negotiate_flags; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_credentials); - } - _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); - } - _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.negotiate_flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->out.negotiate_flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate2 *r) -{ - ndr_print_struct(ndr, name, "netr_ServerAuthenticate2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_ServerAuthenticate2"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr_print_ptr(ndr, "credentials", r->in.credentials); - ndr->depth++; - ndr_print_netr_Credential(ndr, "credentials", r->in.credentials); - ndr->depth--; - ndr_print_ptr(ndr, "negotiate_flags", r->in.negotiate_flags); - ndr->depth++; - ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->in.negotiate_flags); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_ServerAuthenticate2"); - ndr->depth++; - ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); - ndr->depth++; - ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); - ndr->depth--; - ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags); - ndr->depth++; - ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->out.negotiate_flags); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int flags, const struct netr_DatabaseSync2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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)); - 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 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 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context)); - if (r->out.delta_enum_array == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); - if (*r->out.delta_enum_array) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync2 *r) -{ - uint32_t _ptr_delta_enum_array; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_sync_context_0; - TALLOC_CTX *_mem_save_delta_enum_array_0; - TALLOC_CTX *_mem_save_delta_enum_array_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); - if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_SamDatabaseID(ndr, NDR_SCALARS, &r->in.database_id)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.restart_state)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sync_context); - } - _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sync_context, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.sync_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.preferredmaximumlength)); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - *r->out.return_authenticator = *r->in.return_authenticator; - NDR_PULL_ALLOC(ndr, r->out.sync_context); - *r->out.sync_context = *r->in.sync_context; - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - ZERO_STRUCTP(r->out.delta_enum_array); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sync_context); - } - _mem_save_sync_context_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - } - _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); - if (_ptr_delta_enum_array) { - NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); - } else { - *r->out.delta_enum_array = NULL; - } - if (*r->out.delta_enum_array) { - _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync2 *r) -{ - ndr_print_struct(ndr, name, "netr_DatabaseSync2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DatabaseSync2"); - ndr->depth++; - ndr_print_string(ndr, "logon_server", r->in.logon_server); - ndr_print_string(ndr, "computername", r->in.computername); - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth--; - ndr_print_netr_SamDatabaseID(ndr, "database_id", r->in.database_id); - ndr_print_uint16(ndr, "restart_state", r->in.restart_state); - ndr_print_ptr(ndr, "sync_context", r->in.sync_context); - ndr->depth++; - ndr_print_uint32(ndr, "sync_context", *r->in.sync_context); - ndr->depth--; - ndr_print_uint32(ndr, "preferredmaximumlength", r->in.preferredmaximumlength); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DatabaseSync2"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "sync_context", r->out.sync_context); - ndr->depth++; - ndr_print_uint32(ndr, "sync_context", *r->out.sync_context); - ndr->depth--; - ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); - ndr->depth++; - ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); - ndr->depth++; - if (*r->out.delta_enum_array) { - ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int flags, const struct netr_DatabaseRedo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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)); - 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - { - struct ndr_push *_ndr_change_log_entry; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_change_log_entry, 4, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->flags))); - NDR_CHECK(ndr_push_netr_ChangeLogEntry(_ndr_change_log_entry, NDR_SCALARS|NDR_BUFFERS, &r->in.change_log_entry)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_change_log_entry, 4, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->flags))); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->flags))); - } - if (flags & NDR_OUT) { - 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.delta_enum_array == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); - if (*r->out.delta_enum_array) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int flags, struct netr_DatabaseRedo *r) -{ - uint32_t _ptr_delta_enum_array; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_delta_enum_array_0; - TALLOC_CTX *_mem_save_delta_enum_array_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computername)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computername)); - if (ndr_get_array_length(ndr, &r->in.computername) > ndr_get_array_size(ndr, &r->in.computername)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computername), ndr_get_array_length(ndr, &r->in.computername)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - { - struct ndr_pull *_ndr_change_log_entry; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_change_log_entry, 4, r->in.change_log_entry_size)); - NDR_CHECK(ndr_pull_netr_ChangeLogEntry(_ndr_change_log_entry, NDR_SCALARS|NDR_BUFFERS, &r->in.change_log_entry)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_change_log_entry, 4, r->in.change_log_entry_size)); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.change_log_entry_size)); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - *r->out.return_authenticator = *r->in.return_authenticator; - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - ZERO_STRUCTP(r->out.delta_enum_array); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - } - _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); - if (_ptr_delta_enum_array) { - NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); - } else { - *r->out.delta_enum_array = NULL; - } - if (*r->out.delta_enum_array) { - _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseRedo *r) -{ - ndr_print_struct(ndr, name, "netr_DatabaseRedo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DatabaseRedo"); - ndr->depth++; - ndr_print_string(ndr, "logon_server", r->in.logon_server); - ndr_print_string(ndr, "computername", r->in.computername); - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth--; - ndr_print_netr_ChangeLogEntry(ndr, "change_log_entry", &r->in.change_log_entry); - ndr_print_uint32(ndr, "change_log_entry_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_netr_ChangeLogEntry(&r->in.change_log_entry, ndr->flags):r->in.change_log_entry_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DatabaseRedo"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); - ndr->depth++; - ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); - ndr->depth++; - if (*r->out.delta_enum_array) { - ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonControl2Ex(struct ndr_push *ndr, int flags, const struct netr_LogonControl2Ex *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.logon_server)); - if (r->in.logon_server) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_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.logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.function_code)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.data, r->in.function_code)); - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonControl2Ex(struct ndr_pull *ndr, int flags, struct netr_LogonControl2Ex *r) -{ - uint32_t _ptr_logon_server; - TALLOC_CTX *_mem_save_logon_server_0; - TALLOC_CTX *_mem_save_query_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); - if (_ptr_logon_server) { - NDR_PULL_ALLOC(ndr, r->in.logon_server); - } else { - r->in.logon_server = NULL; - } - if (r->in.logon_server) { - _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logon_server, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.logon_server)); - if (ndr_get_array_length(ndr, &r->in.logon_server) > ndr_get_array_size(ndr, &r->in.logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.logon_server), ndr_get_array_length(ndr, &r->in.logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.function_code)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.data, r->in.function_code)); - NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data)); - NDR_PULL_ALLOC(ndr, r->out.query); - ZERO_STRUCTP(r->out.query); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.query); - } - _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.query, r->in.level)); - NDR_CHECK(ndr_pull_netr_CONTROL_QUERY_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2Ex *r) -{ - ndr_print_struct(ndr, name, "netr_LogonControl2Ex"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonControl2Ex"); - ndr->depth++; - ndr_print_ptr(ndr, "logon_server", r->in.logon_server); - ndr->depth++; - if (r->in.logon_server) { - ndr_print_string(ndr, "logon_server", r->in.logon_server); - } - ndr->depth--; - ndr_print_uint32(ndr, "function_code", r->in.function_code); - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_set_switch_value(ndr, &r->in.data, r->in.function_code); - ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", &r->in.data); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonControl2Ex"); - ndr->depth++; - ndr_print_ptr(ndr, "query", r->out.query); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.query, r->in.level); - ndr_print_netr_CONTROL_QUERY_INFORMATION(ndr, "query", r->out.query); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomains(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomains *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 (flags & NDR_OUT) { - if (r->out.trusted_domains_blob == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomains(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomains *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_trusted_domains_blob_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob); - ZERO_STRUCTP(r->out.trusted_domains_blob); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob); - } - _mem_save_trusted_domains_blob_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trusted_domains_blob, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_blob_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomains *r) -{ - ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomains"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomains"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomains"); - ndr->depth++; - ndr_print_ptr(ndr, "trusted_domains_blob", r->out.trusted_domains_blob); - ndr->depth++; - ndr_print_netr_Blob(ndr, "trusted_domains_blob", r->out.trusted_domains_blob); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRGetDCName(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCName *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); - if (r->in.domain_name) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid)); - if (r->in.domain_guid) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_guid)); - if (r->in.site_guid) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.site_guid)); - } - NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCName *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_domain_name; - uint32_t _ptr_domain_guid; - uint32_t _ptr_site_guid; - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_domain_name_0; - TALLOC_CTX *_mem_save_domain_guid_0; - TALLOC_CTX *_mem_save_site_guid_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->in.domain_name); - } else { - r->in.domain_name = NULL; - } - if (r->in.domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid)); - if (_ptr_domain_guid) { - NDR_PULL_ALLOC(ndr, r->in.domain_guid); - } else { - r->in.domain_guid = NULL; - } - if (r->in.domain_guid) { - _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_guid)); - if (_ptr_site_guid) { - NDR_PULL_ALLOC(ndr, r->in.site_guid); - } else { - r->in.site_guid = NULL; - } - if (r->in.site_guid) { - _mem_save_site_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.site_guid, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.site_guid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_guid_0, 0); - } - NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCName *r) -{ - ndr_print_struct(ndr, name, "netr_DsRGetDCName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsRGetDCName"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - if (r->in.domain_name) { - ndr_print_string(ndr, "domain_name", r->in.domain_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid); - ndr->depth++; - if (r->in.domain_guid) { - ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid); - } - ndr->depth--; - ndr_print_ptr(ndr, "site_guid", r->in.site_guid); - ndr->depth++; - if (r->in.site_guid) { - ndr_print_GUID(ndr, "site_guid", r->in.site_guid); - } - ndr->depth--; - ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsRGetDCName"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NETRLOGONDUMMYROUTINE1(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NETRLOGONDUMMYROUTINE1(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONDUMMYROUTINE1 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NETRLOGONDUMMYROUTINE1(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r) -{ - ndr_print_struct(ndr, name, "netr_NETRLOGONDUMMYROUTINE1"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRLOGONDUMMYROUTINE1"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRLOGONDUMMYROUTINE1"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NETRLOGONSETSERVICEBITS(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NETRLOGONSETSERVICEBITS(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSETSERVICEBITS *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r) -{ - ndr_print_struct(ndr, name, "netr_NETRLOGONSETSERVICEBITS"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRLOGONSETSERVICEBITS"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRLOGONSETSERVICEBITS"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonGetTrustRid(struct ndr_push *ndr, int flags, const struct netr_LogonGetTrustRid *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); - if (r->in.domain_name) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - 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_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonGetTrustRid(struct ndr_pull *ndr, int flags, struct netr_LogonGetTrustRid *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_domain_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_domain_name_0; - TALLOC_CTX *_mem_save_rid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->in.domain_name); - } else { - r->in.domain_name = NULL; - } - if (r->in.domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.rid); - ZERO_STRUCTP(r->out.rid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rid); - } - _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonGetTrustRid(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetTrustRid *r) -{ - ndr_print_struct(ndr, name, "netr_LogonGetTrustRid"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonGetTrustRid"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - if (r->in.domain_name) { - ndr_print_string(ndr, "domain_name", r->in.domain_name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonGetTrustRid"); - ndr->depth++; - ndr_print_ptr(ndr, "rid", r->out.rid); - ndr->depth++; - ndr_print_uint32(ndr, "rid", *r->out.rid); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r) -{ - ndr_print_struct(ndr, name, "netr_NETRLOGONCOMPUTESERVERDIGEST"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRLOGONCOMPUTESERVERDIGEST"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRLOGONCOMPUTESERVERDIGEST"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r) -{ - ndr_print_struct(ndr, name, "netr_NETRLOGONCOMPUTECLIENTDIGEST"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRLOGONCOMPUTECLIENTDIGEST"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRLOGONCOMPUTECLIENTDIGEST"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate3 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->in.negotiate_flags)); - } - if (flags & NDR_OUT) { - if (r->out.return_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.return_credentials)); - if (r->out.negotiate_flags == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_NegotiateFlags(ndr, NDR_SCALARS, *r->out.negotiate_flags)); - 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_ServerAuthenticate3(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate3 *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credentials_0; - TALLOC_CTX *_mem_save_return_credentials_0; - TALLOC_CTX *_mem_save_negotiate_flags_0; - TALLOC_CTX *_mem_save_rid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credentials); - } - _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.negotiate_flags); - } - _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->in.negotiate_flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_credentials); - ZERO_STRUCTP(r->out.return_credentials); - NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); - *r->out.negotiate_flags = *r->in.negotiate_flags; - NDR_PULL_ALLOC(ndr, r->out.rid); - ZERO_STRUCTP(r->out.rid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_credentials); - } - _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); - } - _mem_save_negotiate_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.negotiate_flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_NegotiateFlags(ndr, NDR_SCALARS, r->out.negotiate_flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rid); - } - _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ServerAuthenticate3(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate3 *r) -{ - ndr_print_struct(ndr, name, "netr_ServerAuthenticate3"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_ServerAuthenticate3"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr_print_ptr(ndr, "credentials", r->in.credentials); - ndr->depth++; - ndr_print_netr_Credential(ndr, "credentials", r->in.credentials); - ndr->depth--; - ndr_print_ptr(ndr, "negotiate_flags", r->in.negotiate_flags); - ndr->depth++; - ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->in.negotiate_flags); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_ServerAuthenticate3"); - ndr->depth++; - ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); - ndr->depth++; - ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); - ndr->depth--; - ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags); - ndr->depth++; - ndr_print_netr_NegotiateFlags(ndr, "negotiate_flags", *r->out.negotiate_flags); - ndr->depth--; - ndr_print_ptr(ndr, "rid", r->out.rid); - ndr->depth++; - ndr_print_uint32(ndr, "rid", *r->out.rid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); - if (r->in.domain_name) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid)); - if (r->in.domain_guid) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name)); - if (r->in.site_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_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.site_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.site_name, ndr_charset_length(r->in.site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_domain_name; - uint32_t _ptr_domain_guid; - uint32_t _ptr_site_name; - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_domain_name_0; - TALLOC_CTX *_mem_save_domain_guid_0; - TALLOC_CTX *_mem_save_site_name_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->in.domain_name); - } else { - r->in.domain_name = NULL; - } - if (r->in.domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid)); - if (_ptr_domain_guid) { - NDR_PULL_ALLOC(ndr, r->in.domain_guid); - } else { - r->in.domain_guid = NULL; - } - if (r->in.domain_guid) { - _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); - if (_ptr_site_name) { - NDR_PULL_ALLOC(ndr, r->in.site_name); - } else { - r->in.site_name = NULL; - } - if (r->in.site_name) { - _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name)); - if (ndr_get_array_length(ndr, &r->in.site_name) > ndr_get_array_size(ndr, &r->in.site_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.site_name), ndr_get_array_length(ndr, &r->in.site_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); - } - NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx *r) -{ - ndr_print_struct(ndr, name, "netr_DsRGetDCNameEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsRGetDCNameEx"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - if (r->in.domain_name) { - ndr_print_string(ndr, "domain_name", r->in.domain_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid); - ndr->depth++; - if (r->in.domain_guid) { - ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid); - } - ndr->depth--; - ndr_print_ptr(ndr, "site_name", r->in.site_name); - ndr->depth++; - if (r->in.site_name) { - ndr_print_string(ndr, "site_name", r->in.site_name); - } - ndr->depth--; - ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsRGetDCNameEx"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRGetSiteName(struct ndr_push *ndr, int flags, const struct netr_DsRGetSiteName *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); - if (r->in.computer_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 (flags & NDR_OUT) { - if (r->out.site == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.site)); - if (*r->out.site) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.site, ndr_charset_length(*r->out.site, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRGetSiteName(struct ndr_pull *ndr, int flags, struct netr_DsRGetSiteName *r) -{ - uint32_t _ptr_computer_name; - uint32_t _ptr_site; - TALLOC_CTX *_mem_save_computer_name_0; - TALLOC_CTX *_mem_save_site_0; - TALLOC_CTX *_mem_save_site_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); - if (_ptr_computer_name) { - NDR_PULL_ALLOC(ndr, r->in.computer_name); - } else { - r->in.computer_name = NULL; - } - if (r->in.computer_name) { - _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.site); - ZERO_STRUCTP(r->out.site); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.site); - } - _mem_save_site_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.site, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site)); - if (_ptr_site) { - NDR_PULL_ALLOC(ndr, *r->out.site); - } else { - *r->out.site = NULL; - } - if (*r->out.site) { - _mem_save_site_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.site, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.site)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.site)); - if (ndr_get_array_length(ndr, r->out.site) > ndr_get_array_size(ndr, r->out.site)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.site), ndr_get_array_length(ndr, r->out.site)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.site, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetSiteName *r) -{ - ndr_print_struct(ndr, name, "netr_DsRGetSiteName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsRGetSiteName"); - ndr->depth++; - ndr_print_ptr(ndr, "computer_name", r->in.computer_name); - ndr->depth++; - if (r->in.computer_name) { - ndr_print_string(ndr, "computer_name", r->in.computer_name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsRGetSiteName"); - ndr->depth++; - ndr_print_ptr(ndr, "site", r->out.site); - ndr->depth++; - ndr_print_ptr(ndr, "site", *r->out.site); - ndr->depth++; - if (*r->out.site) { - ndr_print_string(ndr, "site", *r->out.site); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonGetDomainInfo(struct ndr_push *ndr, int flags, const struct netr_LogonGetDomainInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); - if (r->in.computer_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonGetDomainInfo(struct ndr_pull *ndr, int flags, struct netr_LogonGetDomainInfo *r) -{ - uint32_t _ptr_computer_name; - TALLOC_CTX *_mem_save_computer_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); - if (_ptr_computer_name) { - NDR_PULL_ALLOC(ndr, r->in.computer_name); - } else { - r->in.computer_name = NULL; - } - if (r->in.computer_name) { - _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.query, r->in.level)); - NDR_CHECK(ndr_pull_netr_DomainQuery(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.query)); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - *r->out.return_authenticator = *r->in.return_authenticator; - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_netr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonGetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetDomainInfo *r) -{ - ndr_print_struct(ndr, name, "netr_LogonGetDomainInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonGetDomainInfo"); - ndr->depth++; - ndr_print_string(ndr, "server_name", r->in.server_name); - ndr_print_ptr(ndr, "computer_name", r->in.computer_name); - ndr->depth++; - if (r->in.computer_name) { - ndr_print_string(ndr, "computer_name", r->in.computer_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_set_switch_value(ndr, &r->in.query, r->in.level); - ndr_print_netr_DomainQuery(ndr, "query", &r->in.query); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonGetDomainInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_netr_DomainInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ServerPasswordSet2(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordSet2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 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.new_password == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ServerPasswordSet2(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordSet2 *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_new_password_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.new_password); - } - _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_CryptPassword(ndr, NDR_SCALARS, r->in.new_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - ZERO_STRUCTP(r->out.return_authenticator); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet2 *r) -{ - ndr_print_struct(ndr, name, "netr_ServerPasswordSet2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_ServerPasswordSet2"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr_print_ptr(ndr, "new_password", r->in.new_password); - ndr->depth++; - ndr_print_netr_CryptPassword(ndr, "new_password", r->in.new_password); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_ServerPasswordSet2"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ServerPasswordGet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordGet *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - } - if (flags & NDR_OUT) { - 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.password == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ServerPasswordGet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordGet *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_password_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - ZERO_STRUCTP(r->out.return_authenticator); - NDR_PULL_ALLOC(ndr, r->out.password); - ZERO_STRUCTP(r->out.password); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.password); - } - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ServerPasswordGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordGet *r) -{ - ndr_print_struct(ndr, name, "netr_ServerPasswordGet"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_ServerPasswordGet"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_ServerPasswordGet"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "password", r->out.password); - ndr->depth++; - ndr_print_samr_Password(ndr, "password", r->out.password); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NETRLOGONSENDTOSAM(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONSENDTOSAM *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NETRLOGONSENDTOSAM(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONSENDTOSAM *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSENDTOSAM *r) -{ - ndr_print_struct(ndr, name, "netr_NETRLOGONSENDTOSAM"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRLOGONSENDTOSAM"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRLOGONSENDTOSAM"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesW *r) -{ - uint32_t cntr_addresses_1; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); - if (r->in.addresses == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); - for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { - NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); - } - for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { - NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); - } - } - if (flags & NDR_OUT) { - if (r->out.ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); - if (*r->out.ctr) { - NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesW *r) -{ - uint32_t _ptr_server_name; - uint32_t cntr_addresses_1; - uint32_t _ptr_ctr; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_addresses_1; - TALLOC_CTX *_mem_save_ctr_0; - TALLOC_CTX *_mem_save_ctr_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); - if (r->in.count < 0 || r->in.count > 32000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses)); - } - _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0); - for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { - NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); - } - for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { - NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - if (r->in.addresses) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); - if (_ptr_ctr) { - NDR_PULL_ALLOC(ndr, *r->out.ctr); - } else { - *r->out.ctr = NULL; - } - if (*r->out.ctr) { - _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); - NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesW *r) -{ - uint32_t cntr_addresses_1; - ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesW"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "count", r->in.count); - ndr_print_ptr(ndr, "addresses", r->in.addresses); - ndr->depth++; - ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->in.count); - ndr->depth++; - for (cntr_addresses_1=0;cntr_addresses_1in.count;cntr_addresses_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) { - ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]); - free(idx_1); - } - } - ndr->depth--; - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesW"); - ndr->depth++; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_ptr(ndr, "ctr", *r->out.ctr); - ndr->depth++; - if (*r->out.ctr) { - ndr_print_netr_DsRAddressToSitenamesWCtr(ndr, "ctr", *r->out.ctr); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int flags, const struct netr_DsRGetDCNameEx2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client_account)); - if (r->in.client_account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client_account, ndr_charset_length(r->in.client_account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.mask)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); - if (r->in.domain_name) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid)); - if (r->in.domain_guid) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name)); - if (r->in.site_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_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.site_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.site_name, ndr_charset_length(r->in.site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int flags, struct netr_DsRGetDCNameEx2 *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_client_account; - uint32_t _ptr_domain_name; - uint32_t _ptr_domain_guid; - uint32_t _ptr_site_name; - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_client_account_0; - TALLOC_CTX *_mem_save_domain_name_0; - TALLOC_CTX *_mem_save_domain_guid_0; - TALLOC_CTX *_mem_save_site_name_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_account)); - if (_ptr_client_account) { - NDR_PULL_ALLOC(ndr, r->in.client_account); - } else { - r->in.client_account = NULL; - } - if (r->in.client_account) { - _mem_save_client_account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.client_account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client_account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client_account)); - if (ndr_get_array_length(ndr, &r->in.client_account) > ndr_get_array_size(ndr, &r->in.client_account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.client_account), ndr_get_array_length(ndr, &r->in.client_account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.client_account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_account, ndr_get_array_length(ndr, &r->in.client_account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0); - } - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.mask)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->in.domain_name); - } else { - r->in.domain_name = NULL; - } - if (r->in.domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid)); - if (_ptr_domain_guid) { - NDR_PULL_ALLOC(ndr, r->in.domain_guid); - } else { - r->in.domain_guid = NULL; - } - if (r->in.domain_guid) { - _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name)); - if (_ptr_site_name) { - NDR_PULL_ALLOC(ndr, r->in.site_name); - } else { - r->in.site_name = NULL; - } - if (r->in.site_name) { - _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name)); - if (ndr_get_array_length(ndr, &r->in.site_name) > ndr_get_array_size(ndr, &r->in.site_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.site_name), ndr_get_array_length(ndr, &r->in.site_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); - } - NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx2 *r) -{ - ndr_print_struct(ndr, name, "netr_DsRGetDCNameEx2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsRGetDCNameEx2"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "client_account", r->in.client_account); - ndr->depth++; - if (r->in.client_account) { - ndr_print_string(ndr, "client_account", r->in.client_account); - } - ndr->depth--; - ndr_print_samr_AcctFlags(ndr, "mask", r->in.mask); - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - if (r->in.domain_name) { - ndr_print_string(ndr, "domain_name", r->in.domain_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid); - ndr->depth++; - if (r->in.domain_guid) { - ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid); - } - ndr->depth--; - ndr_print_ptr(ndr, "site_name", r->in.site_name); - ndr->depth++; - if (r->in.site_name) { - ndr_print_string(ndr, "site_name", r->in.site_name); - } - ndr->depth--; - ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsRGetDCNameEx2"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r) -{ - ndr_print_struct(ndr, name, "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomainsEx(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 (flags & NDR_OUT) { - if (r->out.dom_trust_list == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomainsEx(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomainsEx *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_dom_trust_list_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.dom_trust_list); - ZERO_STRUCTP(r->out.dom_trust_list); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.dom_trust_list); - } - _mem_save_dom_trust_list_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.dom_trust_list, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_trust_list_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r) -{ - ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomainsEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomainsEx"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomainsEx"); - ndr->depth++; - ndr_print_ptr(ndr, "dom_trust_list", r->out.dom_trust_list); - ndr->depth++; - ndr_print_netr_DomainTrustList(ndr, "dom_trust_list", r->out.dom_trust_list); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesExW *r) -{ - uint32_t cntr_addresses_1; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); - if (r->in.addresses == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); - for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { - NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); - } - for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { - NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); - } - } - if (flags & NDR_OUT) { - if (r->out.ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); - if (*r->out.ctr) { - NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesExW *r) -{ - uint32_t _ptr_server_name; - uint32_t cntr_addresses_1; - uint32_t _ptr_ctr; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_addresses_1; - TALLOC_CTX *_mem_save_ctr_0; - TALLOC_CTX *_mem_save_ctr_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); - if (r->in.count < 0 || r->in.count > 32000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses)); - } - _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0); - for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { - NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); - } - for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { - NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - if (r->in.addresses) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); - if (_ptr_ctr) { - NDR_PULL_ALLOC(ndr, *r->out.ctr); - } else { - *r->out.ctr = NULL; - } - if (*r->out.ctr) { - _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); - NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesExW *r) -{ - uint32_t cntr_addresses_1; - ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesExW"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "count", r->in.count); - ndr_print_ptr(ndr, "addresses", r->in.addresses); - ndr->depth++; - ndr->print(ndr, "%s: ARRAY(%d)", "addresses", (int)r->in.count); - ndr->depth++; - for (cntr_addresses_1=0;cntr_addresses_1in.count;cntr_addresses_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) { - ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]); - free(idx_1); - } - } - ndr->depth--; - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesExW"); - ndr->depth++; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_ptr(ndr, "ctr", *r->out.ctr); - ndr->depth++; - if (*r->out.ctr) { - ndr_print_netr_DsRAddressToSitenamesExWCtr(ndr, "ctr", *r->out.ctr); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsrGetDcSiteCoverageW(struct ndr_push *ndr, int flags, const struct netr_DsrGetDcSiteCoverageW *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 (flags & NDR_OUT) { - if (r->out.ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); - if (*r->out.ctr) { - NDR_CHECK(ndr_push_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsrGetDcSiteCoverageW(struct ndr_pull *ndr, int flags, struct netr_DsrGetDcSiteCoverageW *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_ctr; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_ctr_0; - TALLOC_CTX *_mem_save_ctr_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); - if (_ptr_ctr) { - NDR_PULL_ALLOC(ndr, *r->out.ctr); - } else { - *r->out.ctr = NULL; - } - if (*r->out.ctr) { - _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); - NDR_CHECK(ndr_pull_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrGetDcSiteCoverageW *r) -{ - ndr_print_struct(ndr, name, "netr_DsrGetDcSiteCoverageW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsrGetDcSiteCoverageW"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsrGetDcSiteCoverageW"); - ndr->depth++; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_ptr(ndr, "ctr", *r->out.ctr); - ndr->depth++; - if (*r->out.ctr) { - ndr_print_DcSitesCtr(ndr, "ctr", *r->out.ctr); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonEx *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); - if (r->in.computer_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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)); - } - NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level)); - if (r->in.logon == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - 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 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 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonEx *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_computer_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_computer_name_0; - TALLOC_CTX *_mem_save_logon_0; - TALLOC_CTX *_mem_save_validation_0; - TALLOC_CTX *_mem_save_authoritative_0; - TALLOC_CTX *_mem_save_flags_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); - if (_ptr_computer_name) { - NDR_PULL_ALLOC(ndr, r->in.computer_name); - } else { - r->in.computer_name = NULL; - } - if (r->in.computer_name) { - _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); - } - NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.logon); - } - _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level)); - NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.flags); - } - _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.validation); - ZERO_STRUCTP(r->out.validation); - NDR_PULL_ALLOC(ndr, r->out.authoritative); - ZERO_STRUCTP(r->out.authoritative); - NDR_PULL_ALLOC(ndr, r->out.flags); - *r->out.flags = *r->in.flags; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.validation); - } - _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level)); - NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.authoritative); - } - _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.flags); - } - _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonEx *r) -{ - ndr_print_struct(ndr, name, "netr_LogonSamLogonEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonSamLogonEx"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "computer_name", r->in.computer_name); - ndr->depth++; - if (r->in.computer_name) { - ndr_print_string(ndr, "computer_name", r->in.computer_name); - } - ndr->depth--; - ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level); - ndr_print_ptr(ndr, "logon", r->in.logon); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level); - ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon); - ndr->depth--; - ndr_print_uint16(ndr, "validation_level", r->in.validation_level); - ndr_print_ptr(ndr, "flags", r->in.flags); - ndr->depth++; - ndr_print_uint32(ndr, "flags", *r->in.flags); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonSamLogonEx"); - ndr->depth++; - ndr_print_ptr(ndr, "validation", r->out.validation); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level); - ndr_print_netr_Validation(ndr, "validation", r->out.validation); - ndr->depth--; - ndr_print_ptr(ndr, "authoritative", r->out.authoritative); - ndr->depth++; - ndr_print_uint8(ndr, "authoritative", *r->out.authoritative); - ndr->depth--; - ndr_print_ptr(ndr, "flags", r->out.flags); - ndr->depth++; - ndr_print_uint32(ndr, "flags", *r->out.flags); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push *ndr, int flags, const struct netr_DsrEnumerateDomainTrusts *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->in.trust_flags)); - } - if (flags & NDR_OUT) { - if (r->out.trusts == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull *ndr, int flags, struct netr_DsrEnumerateDomainTrusts *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_trusts_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->in.trust_flags)); - NDR_PULL_ALLOC(ndr, r->out.trusts); - ZERO_STRUCTP(r->out.trusts); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.trusts); - } - _mem_save_trusts_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrEnumerateDomainTrusts *r) -{ - ndr_print_struct(ndr, name, "netr_DsrEnumerateDomainTrusts"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsrEnumerateDomainTrusts"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_netr_TrustFlags(ndr, "trust_flags", r->in.trust_flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsrEnumerateDomainTrusts"); - ndr->depth++; - ndr_print_ptr(ndr, "trusts", r->out.trusts); - ndr->depth++; - ndr_print_netr_DomainTrustList(ndr, "trusts", r->out.trusts); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsrDeregisterDNSHostRecords(struct ndr_push *ndr, int flags, const struct netr_DsrDeregisterDNSHostRecords *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain)); - if (r->in.domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, 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, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid)); - if (r->in.domain_guid) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dsa_guid)); - if (r->in.dsa_guid) { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.dsa_guid)); - } - if (r->in.dns_host == 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.dns_host, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dns_host, ndr_charset_length(r->in.dns_host, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsrDeregisterDNSHostRecords(struct ndr_pull *ndr, int flags, struct netr_DsrDeregisterDNSHostRecords *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_domain; - uint32_t _ptr_domain_guid; - uint32_t _ptr_dsa_guid; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_domain_0; - TALLOC_CTX *_mem_save_domain_guid_0; - TALLOC_CTX *_mem_save_dsa_guid_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->in.domain); - } else { - r->in.domain = NULL; - } - if (r->in.domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain)); - if (ndr_get_array_length(ndr, &r->in.domain) > ndr_get_array_size(ndr, &r->in.domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain), ndr_get_array_length(ndr, &r->in.domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid)); - if (_ptr_domain_guid) { - NDR_PULL_ALLOC(ndr, r->in.domain_guid); - } else { - r->in.domain_guid = NULL; - } - if (r->in.domain_guid) { - _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_guid)); - if (_ptr_dsa_guid) { - NDR_PULL_ALLOC(ndr, r->in.dsa_guid); - } else { - r->in.dsa_guid = NULL; - } - if (r->in.dsa_guid) { - _mem_save_dsa_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.dsa_guid, 0); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.dsa_guid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_guid_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_host)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_host)); - if (ndr_get_array_length(ndr, &r->in.dns_host) > ndr_get_array_size(ndr, &r->in.dns_host)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dns_host), ndr_get_array_length(ndr, &r->in.dns_host)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_host, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrDeregisterDNSHostRecords *r) -{ - ndr_print_struct(ndr, name, "netr_DsrDeregisterDNSHostRecords"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsrDeregisterDNSHostRecords"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain", r->in.domain); - ndr->depth++; - if (r->in.domain) { - ndr_print_string(ndr, "domain", r->in.domain); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid); - ndr->depth++; - if (r->in.domain_guid) { - ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid); - } - ndr->depth--; - ndr_print_ptr(ndr, "dsa_guid", r->in.dsa_guid); - ndr->depth++; - if (r->in.dsa_guid) { - ndr_print_GUID(ndr, "dsa_guid", r->in.dsa_guid); - } - ndr->depth--; - ndr_print_ptr(ndr, "dns_host", r->in.dns_host); - ndr->depth++; - ndr_print_string(ndr, "dns_host", r->in.dns_host); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsrDeregisterDNSHostRecords"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ServerTrustPasswordsGet(struct ndr_push *ndr, int flags, const struct netr_ServerTrustPasswordsGet *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - } - if (flags & NDR_OUT) { - 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.password == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password)); - if (r->out.password2 == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.password2)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ServerTrustPasswordsGet(struct ndr_pull *ndr, int flags, struct netr_ServerTrustPasswordsGet *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_password_0; - TALLOC_CTX *_mem_save_password2_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - ZERO_STRUCTP(r->out.return_authenticator); - NDR_PULL_ALLOC(ndr, r->out.password); - ZERO_STRUCTP(r->out.password); - NDR_PULL_ALLOC(ndr, r->out.password2); - ZERO_STRUCTP(r->out.password2); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.password); - } - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.password2); - } - _mem_save_password2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.password2, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.password2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password2_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerTrustPasswordsGet *r) -{ - ndr_print_struct(ndr, name, "netr_ServerTrustPasswordsGet"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_ServerTrustPasswordsGet"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_ServerTrustPasswordsGet"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "password", r->out.password); - ndr->depth++; - ndr_print_samr_Password(ndr, "password", r->out.password); - ndr->depth--; - ndr_print_ptr(ndr, "password2", r->out.password2); - ndr->depth++; - ndr_print_samr_Password(ndr, "password2", r->out.password2); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_DsRGetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_DsRGetForestTrustInformation *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.trusted_domain_name)); - if (r->in.trusted_domain_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_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.trusted_domain_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.trusted_domain_name, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - if (r->out.forest_trust_info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info)); - if (*r->out.forest_trust_info) { - NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_DsRGetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_DsRGetForestTrustInformation *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_trusted_domain_name; - uint32_t _ptr_forest_trust_info; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_trusted_domain_name_0; - TALLOC_CTX *_mem_save_forest_trust_info_0; - TALLOC_CTX *_mem_save_forest_trust_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain_name)); - if (_ptr_trusted_domain_name) { - NDR_PULL_ALLOC(ndr, r->in.trusted_domain_name); - } else { - r->in.trusted_domain_name = NULL; - } - if (r->in.trusted_domain_name) { - _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name)); - if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); - ZERO_STRUCTP(r->out.forest_trust_info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); - } - _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info)); - if (_ptr_forest_trust_info) { - NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info); - } else { - *r->out.forest_trust_info = NULL; - } - if (*r->out.forest_trust_info) { - _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0); - NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r) -{ - ndr_print_struct(ndr, name, "netr_DsRGetForestTrustInformation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DsRGetForestTrustInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name); - ndr->depth++; - if (r->in.trusted_domain_name) { - ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DsRGetForestTrustInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info); - ndr->depth++; - ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info); - ndr->depth++; - if (*r->out.forest_trust_info) { - ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_GetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_GetForestTrustInformation *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.trusted_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.trusted_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.trusted_domain_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.trusted_domain_name, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - 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.forest_trust_info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info)); - if (*r->out.forest_trust_info) { - NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_GetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_GetForestTrustInformation *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_forest_trust_info; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_forest_trust_info_0; - TALLOC_CTX *_mem_save_forest_trust_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name)); - if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - ZERO_STRUCTP(r->out.return_authenticator); - NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); - ZERO_STRUCTP(r->out.forest_trust_info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); - } - _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info)); - if (_ptr_forest_trust_info) { - NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info); - } else { - *r->out.forest_trust_info = NULL; - } - if (*r->out.forest_trust_info) { - _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0); - NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r) -{ - ndr_print_struct(ndr, name, "netr_GetForestTrustInformation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_GetForestTrustInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name); - ndr->depth++; - ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name); - ndr->depth--; - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_GetForestTrustInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info); - ndr->depth++; - ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info); - ndr->depth++; - if (*r->out.forest_trust_info) { - ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *ndr, int flags, const struct netr_LogonSamLogonWithFlags *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.computer_name)); - if (r->in.computer_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.credential)); - if (r->in.credential) { - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.return_authenticator)); - if (r->in.return_authenticator) { - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - } - NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level)); - if (r->in.logon == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - 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 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) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator)); - if (r->out.return_authenticator) { - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - } - 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull *ndr, int flags, struct netr_LogonSamLogonWithFlags *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_computer_name; - uint32_t _ptr_credential; - uint32_t _ptr_return_authenticator; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_computer_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_logon_0; - TALLOC_CTX *_mem_save_validation_0; - TALLOC_CTX *_mem_save_authoritative_0; - TALLOC_CTX *_mem_save_flags_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); - if (_ptr_computer_name) { - NDR_PULL_ALLOC(ndr, r->in.computer_name); - } else { - r->in.computer_name = NULL; - } - if (r->in.computer_name) { - _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_credential)); - if (_ptr_credential) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } else { - r->in.credential = NULL; - } - if (r->in.credential) { - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, 0); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); - if (_ptr_return_authenticator) { - NDR_PULL_ALLOC(ndr, r->in.return_authenticator); - } else { - r->in.return_authenticator = NULL; - } - if (r->in.return_authenticator) { - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, 0); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); - } - NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.logon); - } - _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level)); - NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.flags); - } - _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.validation); - ZERO_STRUCTP(r->out.validation); - NDR_PULL_ALLOC(ndr, r->out.authoritative); - ZERO_STRUCTP(r->out.authoritative); - NDR_PULL_ALLOC(ndr, r->out.flags); - *r->out.flags = *r->in.flags; - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator)); - if (_ptr_return_authenticator) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } else { - r->out.return_authenticator = NULL; - } - if (r->out.return_authenticator) { - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, 0); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.validation); - } - _mem_save_validation_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.validation, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.validation, r->in.validation_level)); - NDR_CHECK(ndr_pull_netr_Validation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.validation)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_validation_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.authoritative); - } - _mem_save_authoritative_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.authoritative, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.authoritative)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authoritative_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.flags); - } - _mem_save_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonWithFlags *r) -{ - ndr_print_struct(ndr, name, "netr_LogonSamLogonWithFlags"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_LogonSamLogonWithFlags"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "computer_name", r->in.computer_name); - ndr->depth++; - if (r->in.computer_name) { - ndr_print_string(ndr, "computer_name", r->in.computer_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - if (r->in.credential) { - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - } - ndr->depth--; - ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); - ndr->depth++; - if (r->in.return_authenticator) { - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); - } - ndr->depth--; - ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level); - ndr_print_ptr(ndr, "logon", r->in.logon); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level); - ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon); - ndr->depth--; - ndr_print_uint16(ndr, "validation_level", r->in.validation_level); - ndr_print_ptr(ndr, "flags", r->in.flags); - ndr->depth++; - ndr_print_uint32(ndr, "flags", *r->in.flags); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_LogonSamLogonWithFlags"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - if (r->out.return_authenticator) { - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - } - ndr->depth--; - ndr_print_ptr(ndr, "validation", r->out.validation); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.validation, r->in.validation_level); - ndr_print_netr_Validation(ndr, "validation", r->out.validation); - ndr->depth--; - ndr_print_ptr(ndr, "authoritative", r->out.authoritative); - ndr->depth++; - ndr_print_uint8(ndr, "authoritative", *r->out.authoritative); - ndr->depth--; - ndr_print_ptr(ndr, "flags", r->out.flags); - ndr->depth++; - ndr_print_uint32(ndr, "flags", *r->out.flags); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_netr_ServerGetTrustInfo(struct ndr_push *ndr, int flags, const struct netr_ServerGetTrustInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.account_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.account_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.account_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); - if (r->in.computer_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.computer_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.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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - } - if (flags & NDR_OUT) { - 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.new_owf_password == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password)); - if (r->out.old_owf_password == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password)); - if (r->out.trust_info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.trust_info)); - if (*r->out.trust_info) { - NDR_CHECK(ndr_push_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_ServerGetTrustInfo(struct ndr_pull *ndr, int flags, struct netr_ServerGetTrustInfo *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_trust_info; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_credential_0; - TALLOC_CTX *_mem_save_return_authenticator_0; - TALLOC_CTX *_mem_save_new_owf_password_0; - TALLOC_CTX *_mem_save_old_owf_password_0; - TALLOC_CTX *_mem_save_trust_info_0; - TALLOC_CTX *_mem_save_trust_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); - if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.credential); - } - _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - ZERO_STRUCTP(r->out.return_authenticator); - NDR_PULL_ALLOC(ndr, r->out.new_owf_password); - ZERO_STRUCTP(r->out.new_owf_password); - NDR_PULL_ALLOC(ndr, r->out.old_owf_password); - ZERO_STRUCTP(r->out.old_owf_password); - NDR_PULL_ALLOC(ndr, r->out.trust_info); - ZERO_STRUCTP(r->out.trust_info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.return_authenticator); - } - _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.new_owf_password); - } - _mem_save_new_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.new_owf_password, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_owf_password_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.old_owf_password); - } - _mem_save_old_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.old_owf_password, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_owf_password_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.trust_info); - } - _mem_save_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trust_info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trust_info)); - if (_ptr_trust_info) { - NDR_PULL_ALLOC(ndr, *r->out.trust_info); - } else { - *r->out.trust_info = NULL; - } - if (*r->out.trust_info) { - _mem_save_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.trust_info, 0); - NDR_CHECK(ndr_pull_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_ServerGetTrustInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerGetTrustInfo *r) -{ - ndr_print_struct(ndr, name, "netr_ServerGetTrustInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_ServerGetTrustInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "account_name", r->in.account_name); - ndr->depth++; - ndr_print_string(ndr, "account_name", r->in.account_name); - ndr->depth--; - ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); - ndr_print_ptr(ndr, "computer_name", r->in.computer_name); - ndr->depth++; - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr->depth--; - ndr_print_ptr(ndr, "credential", r->in.credential); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_ServerGetTrustInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth++; - ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); - ndr->depth--; - ndr_print_ptr(ndr, "new_owf_password", r->out.new_owf_password); - ndr->depth++; - ndr_print_samr_Password(ndr, "new_owf_password", r->out.new_owf_password); - ndr->depth--; - ndr_print_ptr(ndr, "old_owf_password", r->out.old_owf_password); - ndr->depth++; - ndr_print_samr_Password(ndr, "old_owf_password", r->out.old_owf_password); - ndr->depth--; - ndr_print_ptr(ndr, "trust_info", r->out.trust_info); - ndr->depth++; - ndr_print_ptr(ndr, "trust_info", *r->out.trust_info); - ndr->depth++; - if (*r->out.trust_info) { - ndr_print_netr_TrustInfo(ndr, "trust_info", *r->out.trust_info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call netlogon_calls[] = { - { - "netr_LogonUasLogon", - sizeof(struct netr_LogonUasLogon), - (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogon, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogon, - (ndr_print_function_t) ndr_print_netr_LogonUasLogon, - false, - }, - { - "netr_LogonUasLogoff", - sizeof(struct netr_LogonUasLogoff), - (ndr_push_flags_fn_t) ndr_push_netr_LogonUasLogoff, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonUasLogoff, - (ndr_print_function_t) ndr_print_netr_LogonUasLogoff, - false, - }, - { - "netr_LogonSamLogon", - sizeof(struct netr_LogonSamLogon), - (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogon, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogon, - (ndr_print_function_t) ndr_print_netr_LogonSamLogon, - false, - }, - { - "netr_LogonSamLogoff", - sizeof(struct netr_LogonSamLogoff), - (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogoff, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogoff, - (ndr_print_function_t) ndr_print_netr_LogonSamLogoff, - false, - }, - { - "netr_ServerReqChallenge", - sizeof(struct netr_ServerReqChallenge), - (ndr_push_flags_fn_t) ndr_push_netr_ServerReqChallenge, - (ndr_pull_flags_fn_t) ndr_pull_netr_ServerReqChallenge, - (ndr_print_function_t) ndr_print_netr_ServerReqChallenge, - false, - }, - { - "netr_ServerAuthenticate", - sizeof(struct netr_ServerAuthenticate), - (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate, - (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate, - (ndr_print_function_t) ndr_print_netr_ServerAuthenticate, - false, - }, - { - "netr_ServerPasswordSet", - sizeof(struct netr_ServerPasswordSet), - (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet, - (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet, - (ndr_print_function_t) ndr_print_netr_ServerPasswordSet, - false, - }, - { - "netr_DatabaseDeltas", - sizeof(struct netr_DatabaseDeltas), - (ndr_push_flags_fn_t) ndr_push_netr_DatabaseDeltas, - (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseDeltas, - (ndr_print_function_t) ndr_print_netr_DatabaseDeltas, - false, - }, - { - "netr_DatabaseSync", - sizeof(struct netr_DatabaseSync), - (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync, - (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync, - (ndr_print_function_t) ndr_print_netr_DatabaseSync, - false, - }, - { - "netr_AccountDeltas", - sizeof(struct netr_AccountDeltas), - (ndr_push_flags_fn_t) ndr_push_netr_AccountDeltas, - (ndr_pull_flags_fn_t) ndr_pull_netr_AccountDeltas, - (ndr_print_function_t) ndr_print_netr_AccountDeltas, - false, - }, - { - "netr_AccountSync", - sizeof(struct netr_AccountSync), - (ndr_push_flags_fn_t) ndr_push_netr_AccountSync, - (ndr_pull_flags_fn_t) ndr_pull_netr_AccountSync, - (ndr_print_function_t) ndr_print_netr_AccountSync, - false, - }, - { - "netr_GetDcName", - sizeof(struct netr_GetDcName), - (ndr_push_flags_fn_t) ndr_push_netr_GetDcName, - (ndr_pull_flags_fn_t) ndr_pull_netr_GetDcName, - (ndr_print_function_t) ndr_print_netr_GetDcName, - false, - }, - { - "netr_LogonControl", - sizeof(struct netr_LogonControl), - (ndr_push_flags_fn_t) ndr_push_netr_LogonControl, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl, - (ndr_print_function_t) ndr_print_netr_LogonControl, - false, - }, - { - "netr_GetAnyDCName", - sizeof(struct netr_GetAnyDCName), - (ndr_push_flags_fn_t) ndr_push_netr_GetAnyDCName, - (ndr_pull_flags_fn_t) ndr_pull_netr_GetAnyDCName, - (ndr_print_function_t) ndr_print_netr_GetAnyDCName, - false, - }, - { - "netr_LogonControl2", - sizeof(struct netr_LogonControl2), - (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2, - (ndr_print_function_t) ndr_print_netr_LogonControl2, - false, - }, - { - "netr_ServerAuthenticate2", - sizeof(struct netr_ServerAuthenticate2), - (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate2, - (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate2, - (ndr_print_function_t) ndr_print_netr_ServerAuthenticate2, - false, - }, - { - "netr_DatabaseSync2", - sizeof(struct netr_DatabaseSync2), - (ndr_push_flags_fn_t) ndr_push_netr_DatabaseSync2, - (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseSync2, - (ndr_print_function_t) ndr_print_netr_DatabaseSync2, - false, - }, - { - "netr_DatabaseRedo", - sizeof(struct netr_DatabaseRedo), - (ndr_push_flags_fn_t) ndr_push_netr_DatabaseRedo, - (ndr_pull_flags_fn_t) ndr_pull_netr_DatabaseRedo, - (ndr_print_function_t) ndr_print_netr_DatabaseRedo, - false, - }, - { - "netr_LogonControl2Ex", - sizeof(struct netr_LogonControl2Ex), - (ndr_push_flags_fn_t) ndr_push_netr_LogonControl2Ex, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonControl2Ex, - (ndr_print_function_t) ndr_print_netr_LogonControl2Ex, - false, - }, - { - "netr_NetrEnumerateTrustedDomains", - sizeof(struct netr_NetrEnumerateTrustedDomains), - (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomains, - (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomains, - (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomains, - false, - }, - { - "netr_DsRGetDCName", - sizeof(struct netr_DsRGetDCName), - (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCName, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCName, - (ndr_print_function_t) ndr_print_netr_DsRGetDCName, - false, - }, - { - "netr_NETRLOGONDUMMYROUTINE1", - sizeof(struct netr_NETRLOGONDUMMYROUTINE1), - (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONDUMMYROUTINE1, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONDUMMYROUTINE1, - (ndr_print_function_t) ndr_print_netr_NETRLOGONDUMMYROUTINE1, - false, - }, - { - "netr_NETRLOGONSETSERVICEBITS", - sizeof(struct netr_NETRLOGONSETSERVICEBITS), - (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSETSERVICEBITS, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSETSERVICEBITS, - (ndr_print_function_t) ndr_print_netr_NETRLOGONSETSERVICEBITS, - false, - }, - { - "netr_LogonGetTrustRid", - sizeof(struct netr_LogonGetTrustRid), - (ndr_push_flags_fn_t) ndr_push_netr_LogonGetTrustRid, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetTrustRid, - (ndr_print_function_t) ndr_print_netr_LogonGetTrustRid, - false, - }, - { - "netr_NETRLOGONCOMPUTESERVERDIGEST", - sizeof(struct netr_NETRLOGONCOMPUTESERVERDIGEST), - (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST, - (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST, - false, - }, - { - "netr_NETRLOGONCOMPUTECLIENTDIGEST", - sizeof(struct netr_NETRLOGONCOMPUTECLIENTDIGEST), - (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST, - (ndr_print_function_t) ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST, - false, - }, - { - "netr_ServerAuthenticate3", - sizeof(struct netr_ServerAuthenticate3), - (ndr_push_flags_fn_t) ndr_push_netr_ServerAuthenticate3, - (ndr_pull_flags_fn_t) ndr_pull_netr_ServerAuthenticate3, - (ndr_print_function_t) ndr_print_netr_ServerAuthenticate3, - false, - }, - { - "netr_DsRGetDCNameEx", - sizeof(struct netr_DsRGetDCNameEx), - (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx, - (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx, - false, - }, - { - "netr_DsRGetSiteName", - sizeof(struct netr_DsRGetSiteName), - (ndr_push_flags_fn_t) ndr_push_netr_DsRGetSiteName, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetSiteName, - (ndr_print_function_t) ndr_print_netr_DsRGetSiteName, - false, - }, - { - "netr_LogonGetDomainInfo", - sizeof(struct netr_LogonGetDomainInfo), - (ndr_push_flags_fn_t) ndr_push_netr_LogonGetDomainInfo, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetDomainInfo, - (ndr_print_function_t) ndr_print_netr_LogonGetDomainInfo, - false, - }, - { - "netr_ServerPasswordSet2", - sizeof(struct netr_ServerPasswordSet2), - (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordSet2, - (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordSet2, - (ndr_print_function_t) ndr_print_netr_ServerPasswordSet2, - false, - }, - { - "netr_ServerPasswordGet", - sizeof(struct netr_ServerPasswordGet), - (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordGet, - (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordGet, - (ndr_print_function_t) ndr_print_netr_ServerPasswordGet, - false, - }, - { - "netr_NETRLOGONSENDTOSAM", - sizeof(struct netr_NETRLOGONSENDTOSAM), - (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONSENDTOSAM, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONSENDTOSAM, - (ndr_print_function_t) ndr_print_netr_NETRLOGONSENDTOSAM, - false, - }, - { - "netr_DsRAddressToSitenamesW", - sizeof(struct netr_DsRAddressToSitenamesW), - (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesW, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesW, - (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesW, - false, - }, - { - "netr_DsRGetDCNameEx2", - sizeof(struct netr_DsRGetDCNameEx2), - (ndr_push_flags_fn_t) ndr_push_netr_DsRGetDCNameEx2, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetDCNameEx2, - (ndr_print_function_t) ndr_print_netr_DsRGetDCNameEx2, - false, - }, - { - "netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN", - sizeof(struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN), - (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, - (ndr_print_function_t) ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, - false, - }, - { - "netr_NetrEnumerateTrustedDomainsEx", - sizeof(struct netr_NetrEnumerateTrustedDomainsEx), - (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomainsEx, - (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomainsEx, - (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomainsEx, - false, - }, - { - "netr_DsRAddressToSitenamesExW", - sizeof(struct netr_DsRAddressToSitenamesExW), - (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesExW, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesExW, - (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesExW, - false, - }, - { - "netr_DsrGetDcSiteCoverageW", - sizeof(struct netr_DsrGetDcSiteCoverageW), - (ndr_push_flags_fn_t) ndr_push_netr_DsrGetDcSiteCoverageW, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsrGetDcSiteCoverageW, - (ndr_print_function_t) ndr_print_netr_DsrGetDcSiteCoverageW, - false, - }, - { - "netr_LogonSamLogonEx", - sizeof(struct netr_LogonSamLogonEx), - (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonEx, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonEx, - (ndr_print_function_t) ndr_print_netr_LogonSamLogonEx, - false, - }, - { - "netr_DsrEnumerateDomainTrusts", - sizeof(struct netr_DsrEnumerateDomainTrusts), - (ndr_push_flags_fn_t) ndr_push_netr_DsrEnumerateDomainTrusts, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsrEnumerateDomainTrusts, - (ndr_print_function_t) ndr_print_netr_DsrEnumerateDomainTrusts, - false, - }, - { - "netr_DsrDeregisterDNSHostRecords", - sizeof(struct netr_DsrDeregisterDNSHostRecords), - (ndr_push_flags_fn_t) ndr_push_netr_DsrDeregisterDNSHostRecords, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsrDeregisterDNSHostRecords, - (ndr_print_function_t) ndr_print_netr_DsrDeregisterDNSHostRecords, - false, - }, - { - "netr_ServerTrustPasswordsGet", - sizeof(struct netr_ServerTrustPasswordsGet), - (ndr_push_flags_fn_t) ndr_push_netr_ServerTrustPasswordsGet, - (ndr_pull_flags_fn_t) ndr_pull_netr_ServerTrustPasswordsGet, - (ndr_print_function_t) ndr_print_netr_ServerTrustPasswordsGet, - false, - }, - { - "netr_DsRGetForestTrustInformation", - sizeof(struct netr_DsRGetForestTrustInformation), - (ndr_push_flags_fn_t) ndr_push_netr_DsRGetForestTrustInformation, - (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetForestTrustInformation, - (ndr_print_function_t) ndr_print_netr_DsRGetForestTrustInformation, - false, - }, - { - "netr_GetForestTrustInformation", - sizeof(struct netr_GetForestTrustInformation), - (ndr_push_flags_fn_t) ndr_push_netr_GetForestTrustInformation, - (ndr_pull_flags_fn_t) ndr_pull_netr_GetForestTrustInformation, - (ndr_print_function_t) ndr_print_netr_GetForestTrustInformation, - false, - }, - { - "netr_LogonSamLogonWithFlags", - sizeof(struct netr_LogonSamLogonWithFlags), - (ndr_push_flags_fn_t) ndr_push_netr_LogonSamLogonWithFlags, - (ndr_pull_flags_fn_t) ndr_pull_netr_LogonSamLogonWithFlags, - (ndr_print_function_t) ndr_print_netr_LogonSamLogonWithFlags, - false, - }, - { - "netr_ServerGetTrustInfo", - sizeof(struct netr_ServerGetTrustInfo), - (ndr_push_flags_fn_t) ndr_push_netr_ServerGetTrustInfo, - (ndr_pull_flags_fn_t) ndr_pull_netr_ServerGetTrustInfo, - (ndr_print_function_t) ndr_print_netr_ServerGetTrustInfo, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const netlogon_endpoint_strings[] = { - "ncacn_np:[\\pipe\\netlogon]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array netlogon_endpoints = { - .count = 3, - .names = netlogon_endpoint_strings -}; - -static const char * const netlogon_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array netlogon_authservices = { - .count = 1, - .names = netlogon_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_netlogon = { - .name = "netlogon", - .syntax_id = { - {0x12345678,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0xcf,0xfb}}, - NDR_NETLOGON_VERSION - }, - .helpstring = NDR_NETLOGON_HELPSTRING, - .num_calls = 47, - .calls = netlogon_calls, - .endpoints = &netlogon_endpoints, - .authservices = &netlogon_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_netlogon.h b/source3/librpc/gen_ndr/ndr_netlogon.h deleted file mode 100644 index 5858906c1c..0000000000 --- a/source3/librpc/gen_ndr/ndr_netlogon.h +++ /dev/null @@ -1,281 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/netlogon.h" - -#ifndef _HEADER_NDR_netlogon -#define _HEADER_NDR_netlogon - -#include "../librpc/ndr/ndr_netlogon.h" -#define NDR_NETLOGON_UUID "12345678-1234-abcd-ef00-01234567cffb" -#define NDR_NETLOGON_VERSION 1.0 -#define NDR_NETLOGON_NAME "netlogon" -#define NDR_NETLOGON_HELPSTRING NULL -extern const struct ndr_interface_table ndr_table_netlogon; -#define NDR_NETR_LOGONUASLOGON (0x00) - -#define NDR_NETR_LOGONUASLOGOFF (0x01) - -#define NDR_NETR_LOGONSAMLOGON (0x02) - -#define NDR_NETR_LOGONSAMLOGOFF (0x03) - -#define NDR_NETR_SERVERREQCHALLENGE (0x04) - -#define NDR_NETR_SERVERAUTHENTICATE (0x05) - -#define NDR_NETR_SERVERPASSWORDSET (0x06) - -#define NDR_NETR_DATABASEDELTAS (0x07) - -#define NDR_NETR_DATABASESYNC (0x08) - -#define NDR_NETR_ACCOUNTDELTAS (0x09) - -#define NDR_NETR_ACCOUNTSYNC (0x0a) - -#define NDR_NETR_GETDCNAME (0x0b) - -#define NDR_NETR_LOGONCONTROL (0x0c) - -#define NDR_NETR_GETANYDCNAME (0x0d) - -#define NDR_NETR_LOGONCONTROL2 (0x0e) - -#define NDR_NETR_SERVERAUTHENTICATE2 (0x0f) - -#define NDR_NETR_DATABASESYNC2 (0x10) - -#define NDR_NETR_DATABASEREDO (0x11) - -#define NDR_NETR_LOGONCONTROL2EX (0x12) - -#define NDR_NETR_NETRENUMERATETRUSTEDDOMAINS (0x13) - -#define NDR_NETR_DSRGETDCNAME (0x14) - -#define NDR_NETR_NETRLOGONDUMMYROUTINE1 (0x15) - -#define NDR_NETR_NETRLOGONSETSERVICEBITS (0x16) - -#define NDR_NETR_LOGONGETTRUSTRID (0x17) - -#define NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST (0x18) - -#define NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST (0x19) - -#define NDR_NETR_SERVERAUTHENTICATE3 (0x1a) - -#define NDR_NETR_DSRGETDCNAMEEX (0x1b) - -#define NDR_NETR_DSRGETSITENAME (0x1c) - -#define NDR_NETR_LOGONGETDOMAININFO (0x1d) - -#define NDR_NETR_SERVERPASSWORDSET2 (0x1e) - -#define NDR_NETR_SERVERPASSWORDGET (0x1f) - -#define NDR_NETR_NETRLOGONSENDTOSAM (0x20) - -#define NDR_NETR_DSRADDRESSTOSITENAMESW (0x21) - -#define NDR_NETR_DSRGETDCNAMEEX2 (0x22) - -#define NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN (0x23) - -#define NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX (0x24) - -#define NDR_NETR_DSRADDRESSTOSITENAMESEXW (0x25) - -#define NDR_NETR_DSRGETDCSITECOVERAGEW (0x26) - -#define NDR_NETR_LOGONSAMLOGONEX (0x27) - -#define NDR_NETR_DSRENUMERATEDOMAINTRUSTS (0x28) - -#define NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS (0x29) - -#define NDR_NETR_SERVERTRUSTPASSWORDSGET (0x2a) - -#define NDR_NETR_DSRGETFORESTTRUSTINFORMATION (0x2b) - -#define NDR_NETR_GETFORESTTRUSTINFORMATION (0x2c) - -#define NDR_NETR_LOGONSAMLOGONWITHFLAGS (0x2d) - -#define NDR_NETR_SERVERGETTRUSTINFO (0x2e) - -#define NDR_NETLOGON_CALL_COUNT (47) -void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r); -void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r); -enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r); -enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r); -void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r); -enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_netr_LogonParameterControl(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r); -void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r); -void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r); -void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r); -void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r); -void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r); -enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r); -enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r); -void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r); -enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r); -enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r); -void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r); -enum ndr_err_code ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r); -enum ndr_err_code ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r); -void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *name, const struct netr_LMSessionKey *r); -enum ndr_err_code ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name, const struct netr_SamBaseInfo *r); -void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, const struct netr_SamInfo2 *r); -void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, const struct netr_SidAttr *r); -enum ndr_err_code ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r); -enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r); -void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r); -void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r); -void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r); -void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r); -enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r); -enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r); -void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r); -enum ndr_err_code ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r); -enum ndr_err_code ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r); -void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const struct netr_Credential *r); -enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r); -enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r); -void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r); -void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r); -void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r); -void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r); -void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS2 *r); -void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY_UNION *r); -enum ndr_err_code ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r); -enum ndr_err_code ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r); -void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS *r); -void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char *name, const struct netr_USER_PRIVATE_INFO *r); -void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_USER *r); -void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DOMAIN *r); -void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP *r); -void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *name, const struct netr_DELTA_RENAME *r); -void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP_MEMBER *r); -void ndr_print_netr_DELTA_ALIAS(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS *r); -void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS_MEMBER *r); -void ndr_print_netr_QUOTA_LIMITS(struct ndr_print *ndr, const char *name, const struct netr_QUOTA_LIMITS *r); -void ndr_print_netr_DELTA_POLICY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_POLICY *r); -void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_TRUSTED_DOMAIN *r); -void ndr_print_netr_DELTA_DELETE_TRUST(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_TRUST *r); -void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ACCOUNT *r); -void ndr_print_netr_DELTA_DELETE_ACCOUNT(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_ACCOUNT *r); -void ndr_print_netr_DELTA_DELETE_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_SECRET *r); -void ndr_print_netr_CIPHER_VALUE(struct ndr_print *ndr, const char *name, const struct netr_CIPHER_VALUE *r); -void ndr_print_netr_DELTA_SECRET(struct ndr_print *ndr, const char *name, const struct netr_DELTA_SECRET *r); -void ndr_print_netr_DeltaEnum(struct ndr_print *ndr, const char *name, enum netr_DeltaEnum r); -void ndr_print_netr_DELTA_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_UNION *r); -void ndr_print_netr_DELTA_ID_UNION(struct ndr_print *ndr, const char *name, const union netr_DELTA_ID_UNION *r); -void ndr_print_netr_DELTA_ENUM(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM *r); -void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ENUM_ARRAY *r); -void ndr_print_netr_UAS_INFO_0(struct ndr_print *ndr, const char *name, const struct netr_UAS_INFO_0 *r); -void ndr_print_netr_AccountBuffer(struct ndr_print *ndr, const char *name, const struct netr_AccountBuffer *r); -void ndr_print_netr_InfoFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_1 *r); -void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_2 *r); -void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_3 *r); -void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_QUERY_INFORMATION *r); -void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char *name, enum netr_LogonControlCode r); -void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_DATA_INFORMATION *r); -void ndr_print_netr_NegotiateFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_netr_ChangeLogFlags(struct ndr_print *ndr, const char *name, uint16_t r); -void ndr_print_netr_ChangeLogObject(struct ndr_print *ndr, const char *name, const union netr_ChangeLogObject *r); -enum ndr_err_code ndr_push_netr_ChangeLogEntry(struct ndr_push *ndr, int ndr_flags, const struct netr_ChangeLogEntry *r); -enum ndr_err_code ndr_pull_netr_ChangeLogEntry(struct ndr_pull *ndr, int ndr_flags, struct netr_ChangeLogEntry *r); -void ndr_print_netr_ChangeLogEntry(struct ndr_print *ndr, const char *name, const struct netr_ChangeLogEntry *r); -size_t ndr_size_netr_ChangeLogEntry(const struct netr_ChangeLogEntry *r, int flags); -void ndr_print_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r); -void ndr_print_netr_DsRGetDCName_flags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print *ndr, const char *name, enum netr_DsRGetDCNameInfo_AddressType r); -void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_t r); -enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r); -enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r); -void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r); -void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r); -void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *name, const struct netr_DomainQuery1 *r); -void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name, const union netr_DomainQuery *r); -void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r); -void ndr_print_netr_trust_extension_container(struct ndr_print *ndr, const char *name, const struct netr_trust_extension_container *r); -void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustInfo *r); -void ndr_print_netr_LsaPolicyInfo(struct ndr_print *ndr, const char *name, const struct netr_LsaPolicyInfo *r); -enum ndr_err_code ndr_push_netr_WorkstationFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_netr_WorkstationFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_netr_WorkstationFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name, const struct netr_DomainInfo1 *r); -void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r); -void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r); -void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r); -void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r); -void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r); -void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r); -void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r); -void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r); -void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r); -void ndr_print_netr_TrustInfo(struct ndr_print *ndr, const char *name, const struct netr_TrustInfo *r); -void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogon *r); -void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogoff *r); -void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogon *r); -void ndr_print_netr_LogonSamLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogoff *r); -enum ndr_err_code ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, int flags, const struct netr_ServerReqChallenge *r); -enum ndr_err_code ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, int flags, struct netr_ServerReqChallenge *r); -void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerReqChallenge *r); -void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate *r); -void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet *r); -void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseDeltas *r); -void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync *r); -void ndr_print_netr_AccountDeltas(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountDeltas *r); -void ndr_print_netr_AccountSync(struct ndr_print *ndr, const char *name, int flags, const struct netr_AccountSync *r); -void ndr_print_netr_GetDcName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetDcName *r); -void ndr_print_netr_LogonControl(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl *r); -void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetAnyDCName *r); -void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2 *r); -void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate2 *r); -void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync2 *r); -void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseRedo *r); -void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2Ex *r); -void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomains *r); -void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCName *r); -void ndr_print_netr_NETRLOGONDUMMYROUTINE1(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r); -void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r); -void ndr_print_netr_LogonGetTrustRid(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetTrustRid *r); -void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r); -void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r); -enum ndr_err_code ndr_push_netr_ServerAuthenticate3(struct ndr_push *ndr, int flags, const struct netr_ServerAuthenticate3 *r); -enum ndr_err_code ndr_pull_netr_ServerAuthenticate3(struct ndr_pull *ndr, int flags, struct netr_ServerAuthenticate3 *r); -void ndr_print_netr_ServerAuthenticate3(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate3 *r); -void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx *r); -void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetSiteName *r); -void ndr_print_netr_LogonGetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetDomainInfo *r); -void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet2 *r); -void ndr_print_netr_ServerPasswordGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordGet *r); -void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSENDTOSAM *r); -void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesW *r); -void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx2 *r); -void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r); -void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r); -void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesExW *r); -void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrGetDcSiteCoverageW *r); -void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonEx *r); -void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrEnumerateDomainTrusts *r); -void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrDeregisterDNSHostRecords *r); -void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerTrustPasswordsGet *r); -void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r); -void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r); -void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonWithFlags *r); -void ndr_print_netr_ServerGetTrustInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerGetTrustInfo *r); -#endif /* _HEADER_NDR_netlogon */ diff --git a/source3/librpc/gen_ndr/ndr_ntsvcs.c b/source3/librpc/gen_ndr/ndr_ntsvcs.c deleted file mode 100644 index ced6fb7767..0000000000 --- a/source3/librpc/gen_ndr/ndr_ntsvcs.c +++ /dev/null @@ -1,3890 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_ntsvcs.h" - -#include "librpc/gen_ndr/ndr_winreg.h" -static enum ndr_err_code ndr_push_PNP_HwProfInfo(struct ndr_push *ndr, int ndr_flags, const struct PNP_HwProfInfo *r) -{ - uint32_t cntr_friendly_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->profile_handle)); - for (cntr_friendly_name_0 = 0; cntr_friendly_name_0 < 80; cntr_friendly_name_0++) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->friendly_name[cntr_friendly_name_0])); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_HwProfInfo(struct ndr_pull *ndr, int ndr_flags, struct PNP_HwProfInfo *r) -{ - uint32_t cntr_friendly_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->profile_handle)); - for (cntr_friendly_name_0 = 0; cntr_friendly_name_0 < 80; cntr_friendly_name_0++) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->friendly_name[cntr_friendly_name_0])); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_HwProfInfo(struct ndr_print *ndr, const char *name, const struct PNP_HwProfInfo *r) -{ - uint32_t cntr_friendly_name_0; - ndr_print_struct(ndr, name, "PNP_HwProfInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "profile_handle", r->profile_handle); - ndr->print(ndr, "%s: ARRAY(%d)", "friendly_name", (int)80); - ndr->depth++; - for (cntr_friendly_name_0=0;cntr_friendly_name_0<80;cntr_friendly_name_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_friendly_name_0) != -1) { - ndr_print_uint16(ndr, "friendly_name", r->friendly_name[cntr_friendly_name_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_Disconnect(struct ndr_push *ndr, int flags, const struct PNP_Disconnect *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_Disconnect(struct ndr_pull *ndr, int flags, struct PNP_Disconnect *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_Disconnect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Disconnect *r) -{ - ndr_print_struct(ndr, name, "PNP_Disconnect"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_Disconnect"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_Disconnect"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_Connect(struct ndr_push *ndr, int flags, const struct PNP_Connect *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_Connect(struct ndr_pull *ndr, int flags, struct PNP_Connect *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_Connect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Connect *r) -{ - ndr_print_struct(ndr, name, "PNP_Connect"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_Connect"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_Connect"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetVersion(struct ndr_push *ndr, int flags, const struct PNP_GetVersion *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - if (r->out.version == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.version)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetVersion(struct ndr_pull *ndr, int flags, struct PNP_GetVersion *r) -{ - TALLOC_CTX *_mem_save_version_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_PULL_ALLOC(ndr, r->out.version); - ZERO_STRUCTP(r->out.version); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.version); - } - _mem_save_version_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.version, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.version)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersion *r) -{ - ndr_print_struct(ndr, name, "PNP_GetVersion"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetVersion"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetVersion"); - ndr->depth++; - ndr_print_ptr(ndr, "version", r->out.version); - ndr->depth++; - ndr_print_uint16(ndr, "version", *r->out.version); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetGlobalState(struct ndr_push *ndr, int flags, const struct PNP_GetGlobalState *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetGlobalState(struct ndr_pull *ndr, int flags, struct PNP_GetGlobalState *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetGlobalState(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetGlobalState *r) -{ - ndr_print_struct(ndr, name, "PNP_GetGlobalState"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetGlobalState"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetGlobalState"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_InitDetection(struct ndr_push *ndr, int flags, const struct PNP_InitDetection *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_InitDetection(struct ndr_pull *ndr, int flags, struct PNP_InitDetection *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_InitDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_InitDetection *r) -{ - ndr_print_struct(ndr, name, "PNP_InitDetection"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_InitDetection"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_InitDetection"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_ReportLogOn(struct ndr_push *ndr, int flags, const struct PNP_ReportLogOn *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_ReportLogOn(struct ndr_pull *ndr, int flags, struct PNP_ReportLogOn *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_ReportLogOn(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ReportLogOn *r) -{ - ndr_print_struct(ndr, name, "PNP_ReportLogOn"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_ReportLogOn"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_ReportLogOn"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_ValidateDeviceInstance(struct ndr_push *ndr, int flags, const struct PNP_ValidateDeviceInstance *r) -{ - if (flags & NDR_IN) { - if (r->in.devicepath == 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.devicepath, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicepath, ndr_charset_length(r->in.devicepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_ValidateDeviceInstance(struct ndr_pull *ndr, int flags, struct PNP_ValidateDeviceInstance *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicepath)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicepath)); - if (ndr_get_array_length(ndr, &r->in.devicepath) > ndr_get_array_size(ndr, &r->in.devicepath)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.devicepath), ndr_get_array_length(ndr, &r->in.devicepath)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicepath, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_ValidateDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ValidateDeviceInstance *r) -{ - ndr_print_struct(ndr, name, "PNP_ValidateDeviceInstance"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_ValidateDeviceInstance"); - ndr->depth++; - ndr_print_ptr(ndr, "devicepath", r->in.devicepath); - ndr->depth++; - ndr_print_string(ndr, "devicepath", r->in.devicepath); - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_ValidateDeviceInstance"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetRootDeviceInstance(struct ndr_push *ndr, int flags, const struct PNP_GetRootDeviceInstance *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetRootDeviceInstance(struct ndr_pull *ndr, int flags, struct PNP_GetRootDeviceInstance *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetRootDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRootDeviceInstance *r) -{ - ndr_print_struct(ndr, name, "PNP_GetRootDeviceInstance"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetRootDeviceInstance"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetRootDeviceInstance"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetRelatedDeviceInstance(struct ndr_push *ndr, int flags, const struct PNP_GetRelatedDeviceInstance *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetRelatedDeviceInstance(struct ndr_pull *ndr, int flags, struct PNP_GetRelatedDeviceInstance *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetRelatedDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRelatedDeviceInstance *r) -{ - ndr_print_struct(ndr, name, "PNP_GetRelatedDeviceInstance"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetRelatedDeviceInstance"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetRelatedDeviceInstance"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_EnumerateSubKeys(struct ndr_push *ndr, int flags, const struct PNP_EnumerateSubKeys *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_EnumerateSubKeys(struct ndr_pull *ndr, int flags, struct PNP_EnumerateSubKeys *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_EnumerateSubKeys(struct ndr_print *ndr, const char *name, int flags, const struct PNP_EnumerateSubKeys *r) -{ - ndr_print_struct(ndr, name, "PNP_EnumerateSubKeys"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_EnumerateSubKeys"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_EnumerateSubKeys"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetDeviceList(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceList *r) -{ - uint32_t cntr_buffer_1; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.filter)); - if (r->in.filter) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.filter, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.filter, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.filter, ndr_charset_length(r->in.filter, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->in.length == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - if (r->out.buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); - for (cntr_buffer_1 = 0; cntr_buffer_1 < *r->out.length; cntr_buffer_1++) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.buffer[cntr_buffer_1])); - } - if (r->out.length == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetDeviceList(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceList *r) -{ - uint32_t _ptr_filter; - uint32_t cntr_buffer_1; - TALLOC_CTX *_mem_save_filter_0; - TALLOC_CTX *_mem_save_buffer_1; - TALLOC_CTX *_mem_save_length_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_filter)); - if (_ptr_filter) { - NDR_PULL_ALLOC(ndr, r->in.filter); - } else { - r->in.filter = NULL; - } - if (r->in.filter) { - _mem_save_filter_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.filter, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.filter)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.filter)); - if (ndr_get_array_length(ndr, &r->in.filter) > ndr_get_array_size(ndr, &r->in.filter)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.filter), ndr_get_array_length(ndr, &r->in.filter)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.filter), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.filter, ndr_get_array_length(ndr, &r->in.filter), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filter_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.length); - } - _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.length, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC_N(ndr, r->out.buffer, *r->in.length); - memset(r->out.buffer, 0, (*r->in.length) * sizeof(*r->out.buffer)); - NDR_PULL_ALLOC(ndr, r->out.length); - *r->out.length = *r->in.length; - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->out.buffer)); - if (ndr_get_array_length(ndr, &r->out.buffer) > ndr_get_array_size(ndr, &r->out.buffer)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.buffer), ndr_get_array_length(ndr, &r->out.buffer)); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); - } - _mem_save_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, 0); - for (cntr_buffer_1 = 0; cntr_buffer_1 < *r->out.length; cntr_buffer_1++) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.buffer[cntr_buffer_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_1, 0); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.length); - } - _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.length, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, *r->out.length)); - } - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.buffer, *r->out.length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceList *r) -{ - uint32_t cntr_buffer_1; - ndr_print_struct(ndr, name, "PNP_GetDeviceList"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetDeviceList"); - ndr->depth++; - ndr_print_ptr(ndr, "filter", r->in.filter); - ndr->depth++; - if (r->in.filter) { - ndr_print_string(ndr, "filter", r->in.filter); - } - ndr->depth--; - ndr_print_ptr(ndr, "length", r->in.length); - ndr->depth++; - ndr_print_uint32(ndr, "length", *r->in.length); - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetDeviceList"); - ndr->depth++; - ndr_print_ptr(ndr, "buffer", r->out.buffer); - ndr->depth++; - ndr->print(ndr, "%s: ARRAY(%d)", "buffer", (int)*r->out.length); - ndr->depth++; - for (cntr_buffer_1=0;cntr_buffer_1<*r->out.length;cntr_buffer_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_buffer_1) != -1) { - ndr_print_uint16(ndr, "buffer", r->out.buffer[cntr_buffer_1]); - free(idx_1); - } - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "length", r->out.length); - ndr->depth++; - ndr_print_uint32(ndr, "length", *r->out.length); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetDeviceListSize(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceListSize *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.devicename)); - if (r->in.devicename) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicename, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicename, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicename, ndr_charset_length(r->in.devicename, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - if (r->out.size == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetDeviceListSize(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceListSize *r) -{ - uint32_t _ptr_devicename; - TALLOC_CTX *_mem_save_devicename_0; - TALLOC_CTX *_mem_save_size_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devicename)); - if (_ptr_devicename) { - NDR_PULL_ALLOC(ndr, r->in.devicename); - } else { - r->in.devicename = NULL; - } - if (r->in.devicename) { - _mem_save_devicename_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.devicename, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicename)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicename)); - if (ndr_get_array_length(ndr, &r->in.devicename) > ndr_get_array_size(ndr, &r->in.devicename)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.devicename), ndr_get_array_length(ndr, &r->in.devicename)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicename), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicename, ndr_get_array_length(ndr, &r->in.devicename), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devicename_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC(ndr, r->out.size); - ZERO_STRUCTP(r->out.size); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.size); - } - _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceListSize *r) -{ - ndr_print_struct(ndr, name, "PNP_GetDeviceListSize"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetDeviceListSize"); - ndr->depth++; - ndr_print_ptr(ndr, "devicename", r->in.devicename); - ndr->depth++; - if (r->in.devicename) { - ndr_print_string(ndr, "devicename", r->in.devicename); - } - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetDeviceListSize"); - ndr->depth++; - ndr_print_ptr(ndr, "size", r->out.size); - ndr->depth++; - ndr_print_uint32(ndr, "size", *r->out.size); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetDepth(struct ndr_push *ndr, int flags, const struct PNP_GetDepth *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetDepth(struct ndr_pull *ndr, int flags, struct PNP_GetDepth *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetDepth(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDepth *r) -{ - ndr_print_struct(ndr, name, "PNP_GetDepth"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetDepth"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetDepth"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetDeviceRegProp(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceRegProp *r) -{ - if (flags & NDR_IN) { - if (r->in.devicepath == 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.devicepath, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicepath, ndr_charset_length(r->in.devicepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.property)); - if (r->in.reg_data_type == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.reg_data_type)); - 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 (r->in.needed == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.needed)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - if (r->out.reg_data_type == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.reg_data_type)); - if (r->out.buffer == 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_uint32(ndr, NDR_SCALARS, 0)); - 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.buffer_size)); - if (r->out.needed == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetDeviceRegProp(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceRegProp *r) -{ - TALLOC_CTX *_mem_save_reg_data_type_0; - TALLOC_CTX *_mem_save_buffer_size_0; - TALLOC_CTX *_mem_save_needed_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicepath)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicepath)); - if (ndr_get_array_length(ndr, &r->in.devicepath) > ndr_get_array_size(ndr, &r->in.devicepath)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.devicepath), ndr_get_array_length(ndr, &r->in.devicepath)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicepath, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.property)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.reg_data_type); - } - _mem_save_reg_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.reg_data_type, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->in.reg_data_type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reg_data_type_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.buffer_size); - } - _mem_save_buffer_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.needed); - } - _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.needed)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC(ndr, r->out.reg_data_type); - *r->out.reg_data_type = *r->in.reg_data_type; - NDR_PULL_ALLOC_N(ndr, r->out.buffer, *r->in.buffer_size); - memset(r->out.buffer, 0, (*r->in.buffer_size) * sizeof(*r->out.buffer)); - NDR_PULL_ALLOC(ndr, r->out.buffer_size); - *r->out.buffer_size = *r->in.buffer_size; - NDR_PULL_ALLOC(ndr, r->out.needed); - *r->out.needed = *r->in.needed; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.reg_data_type); - } - _mem_save_reg_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.reg_data_type, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.reg_data_type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reg_data_type_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->out.buffer)); - if (ndr_get_array_length(ndr, &r->out.buffer) > ndr_get_array_size(ndr, &r->out.buffer)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.buffer), ndr_get_array_length(ndr, &r->out.buffer)); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_length(ndr, &r->out.buffer))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.buffer_size); - } - _mem_save_buffer_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.buffer_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.needed); - } - _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, *r->out.buffer_size)); - } - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.buffer, *r->out.buffer_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceRegProp *r) -{ - ndr_print_struct(ndr, name, "PNP_GetDeviceRegProp"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetDeviceRegProp"); - ndr->depth++; - ndr_print_ptr(ndr, "devicepath", r->in.devicepath); - ndr->depth++; - ndr_print_string(ndr, "devicepath", r->in.devicepath); - ndr->depth--; - ndr_print_uint32(ndr, "property", r->in.property); - ndr_print_ptr(ndr, "reg_data_type", r->in.reg_data_type); - ndr->depth++; - ndr_print_winreg_Type(ndr, "reg_data_type", *r->in.reg_data_type); - ndr->depth--; - ndr_print_ptr(ndr, "buffer_size", r->in.buffer_size); - ndr->depth++; - ndr_print_uint32(ndr, "buffer_size", *r->in.buffer_size); - ndr->depth--; - ndr_print_ptr(ndr, "needed", r->in.needed); - ndr->depth++; - ndr_print_uint32(ndr, "needed", *r->in.needed); - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetDeviceRegProp"); - ndr->depth++; - ndr_print_ptr(ndr, "reg_data_type", r->out.reg_data_type); - ndr->depth++; - ndr_print_winreg_Type(ndr, "reg_data_type", *r->out.reg_data_type); - ndr->depth--; - ndr_print_ptr(ndr, "buffer", r->out.buffer); - ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->out.buffer, *r->out.buffer_size); - ndr->depth--; - ndr_print_ptr(ndr, "buffer_size", r->out.buffer_size); - ndr->depth++; - ndr_print_uint32(ndr, "buffer_size", *r->out.buffer_size); - ndr->depth--; - ndr_print_ptr(ndr, "needed", r->out.needed); - ndr->depth++; - ndr_print_uint32(ndr, "needed", *r->out.needed); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_SetDeviceRegProp(struct ndr_push *ndr, int flags, const struct PNP_SetDeviceRegProp *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_SetDeviceRegProp(struct ndr_pull *ndr, int flags, struct PNP_SetDeviceRegProp *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_SetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceRegProp *r) -{ - ndr_print_struct(ndr, name, "PNP_SetDeviceRegProp"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_SetDeviceRegProp"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_SetDeviceRegProp"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetClassInstance(struct ndr_push *ndr, int flags, const struct PNP_GetClassInstance *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetClassInstance(struct ndr_pull *ndr, int flags, struct PNP_GetClassInstance *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetClassInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassInstance *r) -{ - ndr_print_struct(ndr, name, "PNP_GetClassInstance"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetClassInstance"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetClassInstance"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_CreateKey(struct ndr_push *ndr, int flags, const struct PNP_CreateKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_CreateKey(struct ndr_pull *ndr, int flags, struct PNP_CreateKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateKey *r) -{ - ndr_print_struct(ndr, name, "PNP_CreateKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_CreateKey"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_CreateKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_DeleteRegistryKey(struct ndr_push *ndr, int flags, const struct PNP_DeleteRegistryKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_DeleteRegistryKey(struct ndr_pull *ndr, int flags, struct PNP_DeleteRegistryKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_DeleteRegistryKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteRegistryKey *r) -{ - ndr_print_struct(ndr, name, "PNP_DeleteRegistryKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_DeleteRegistryKey"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_DeleteRegistryKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetClassCount(struct ndr_push *ndr, int flags, const struct PNP_GetClassCount *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetClassCount(struct ndr_pull *ndr, int flags, struct PNP_GetClassCount *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetClassCount(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassCount *r) -{ - ndr_print_struct(ndr, name, "PNP_GetClassCount"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetClassCount"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetClassCount"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetClassName(struct ndr_push *ndr, int flags, const struct PNP_GetClassName *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetClassName(struct ndr_pull *ndr, int flags, struct PNP_GetClassName *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetClassName(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassName *r) -{ - ndr_print_struct(ndr, name, "PNP_GetClassName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetClassName"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetClassName"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_DeleteClassKey(struct ndr_push *ndr, int flags, const struct PNP_DeleteClassKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_DeleteClassKey(struct ndr_pull *ndr, int flags, struct PNP_DeleteClassKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_DeleteClassKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteClassKey *r) -{ - ndr_print_struct(ndr, name, "PNP_DeleteClassKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_DeleteClassKey"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_DeleteClassKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetInterfaceDeviceAlias(struct ndr_push *ndr, int flags, const struct PNP_GetInterfaceDeviceAlias *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetInterfaceDeviceAlias(struct ndr_pull *ndr, int flags, struct PNP_GetInterfaceDeviceAlias *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetInterfaceDeviceAlias(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceAlias *r) -{ - ndr_print_struct(ndr, name, "PNP_GetInterfaceDeviceAlias"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetInterfaceDeviceAlias"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetInterfaceDeviceAlias"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetInterfaceDeviceList(struct ndr_push *ndr, int flags, const struct PNP_GetInterfaceDeviceList *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetInterfaceDeviceList(struct ndr_pull *ndr, int flags, struct PNP_GetInterfaceDeviceList *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetInterfaceDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceList *r) -{ - ndr_print_struct(ndr, name, "PNP_GetInterfaceDeviceList"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetInterfaceDeviceList"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetInterfaceDeviceList"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetInterfaceDeviceListSize(struct ndr_push *ndr, int flags, const struct PNP_GetInterfaceDeviceListSize *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetInterfaceDeviceListSize(struct ndr_pull *ndr, int flags, struct PNP_GetInterfaceDeviceListSize *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetInterfaceDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceListSize *r) -{ - ndr_print_struct(ndr, name, "PNP_GetInterfaceDeviceListSize"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetInterfaceDeviceListSize"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetInterfaceDeviceListSize"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_RegisterDeviceClassAssociation(struct ndr_push *ndr, int flags, const struct PNP_RegisterDeviceClassAssociation *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_RegisterDeviceClassAssociation(struct ndr_pull *ndr, int flags, struct PNP_RegisterDeviceClassAssociation *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_RegisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDeviceClassAssociation *r) -{ - ndr_print_struct(ndr, name, "PNP_RegisterDeviceClassAssociation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_RegisterDeviceClassAssociation"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_RegisterDeviceClassAssociation"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_UnregisterDeviceClassAssociation(struct ndr_push *ndr, int flags, const struct PNP_UnregisterDeviceClassAssociation *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_UnregisterDeviceClassAssociation(struct ndr_pull *ndr, int flags, struct PNP_UnregisterDeviceClassAssociation *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_UnregisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterDeviceClassAssociation *r) -{ - ndr_print_struct(ndr, name, "PNP_UnregisterDeviceClassAssociation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_UnregisterDeviceClassAssociation"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_UnregisterDeviceClassAssociation"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetClassRegProp(struct ndr_push *ndr, int flags, const struct PNP_GetClassRegProp *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetClassRegProp(struct ndr_pull *ndr, int flags, struct PNP_GetClassRegProp *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassRegProp *r) -{ - ndr_print_struct(ndr, name, "PNP_GetClassRegProp"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetClassRegProp"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetClassRegProp"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_SetClassRegProp(struct ndr_push *ndr, int flags, const struct PNP_SetClassRegProp *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_SetClassRegProp(struct ndr_pull *ndr, int flags, struct PNP_SetClassRegProp *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_SetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetClassRegProp *r) -{ - ndr_print_struct(ndr, name, "PNP_SetClassRegProp"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_SetClassRegProp"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_SetClassRegProp"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_CreateDevInst(struct ndr_push *ndr, int flags, const struct PNP_CreateDevInst *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_CreateDevInst(struct ndr_pull *ndr, int flags, struct PNP_CreateDevInst *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_CreateDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateDevInst *r) -{ - ndr_print_struct(ndr, name, "PNP_CreateDevInst"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_CreateDevInst"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_CreateDevInst"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_DeviceInstanceAction(struct ndr_push *ndr, int flags, const struct PNP_DeviceInstanceAction *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_DeviceInstanceAction(struct ndr_pull *ndr, int flags, struct PNP_DeviceInstanceAction *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_DeviceInstanceAction(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeviceInstanceAction *r) -{ - ndr_print_struct(ndr, name, "PNP_DeviceInstanceAction"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_DeviceInstanceAction"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_DeviceInstanceAction"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetDeviceStatus(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceStatus *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetDeviceStatus(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceStatus *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetDeviceStatus(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceStatus *r) -{ - ndr_print_struct(ndr, name, "PNP_GetDeviceStatus"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetDeviceStatus"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetDeviceStatus"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_SetDeviceProblem(struct ndr_push *ndr, int flags, const struct PNP_SetDeviceProblem *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_SetDeviceProblem(struct ndr_pull *ndr, int flags, struct PNP_SetDeviceProblem *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_SetDeviceProblem(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceProblem *r) -{ - ndr_print_struct(ndr, name, "PNP_SetDeviceProblem"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_SetDeviceProblem"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_SetDeviceProblem"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_DisableDevInst(struct ndr_push *ndr, int flags, const struct PNP_DisableDevInst *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_DisableDevInst(struct ndr_pull *ndr, int flags, struct PNP_DisableDevInst *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_DisableDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DisableDevInst *r) -{ - ndr_print_struct(ndr, name, "PNP_DisableDevInst"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_DisableDevInst"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_DisableDevInst"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_UninstallDevInst(struct ndr_push *ndr, int flags, const struct PNP_UninstallDevInst *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_UninstallDevInst(struct ndr_pull *ndr, int flags, struct PNP_UninstallDevInst *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_UninstallDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UninstallDevInst *r) -{ - ndr_print_struct(ndr, name, "PNP_UninstallDevInst"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_UninstallDevInst"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_UninstallDevInst"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_AddID(struct ndr_push *ndr, int flags, const struct PNP_AddID *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_AddID(struct ndr_pull *ndr, int flags, struct PNP_AddID *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_AddID(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddID *r) -{ - ndr_print_struct(ndr, name, "PNP_AddID"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_AddID"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_AddID"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_RegisterDriver(struct ndr_push *ndr, int flags, const struct PNP_RegisterDriver *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_RegisterDriver(struct ndr_pull *ndr, int flags, struct PNP_RegisterDriver *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_RegisterDriver(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDriver *r) -{ - ndr_print_struct(ndr, name, "PNP_RegisterDriver"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_RegisterDriver"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_RegisterDriver"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_QueryRemove(struct ndr_push *ndr, int flags, const struct PNP_QueryRemove *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_QueryRemove(struct ndr_pull *ndr, int flags, struct PNP_QueryRemove *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_QueryRemove(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryRemove *r) -{ - ndr_print_struct(ndr, name, "PNP_QueryRemove"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_QueryRemove"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_QueryRemove"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_RequestDeviceEject(struct ndr_push *ndr, int flags, const struct PNP_RequestDeviceEject *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_RequestDeviceEject(struct ndr_pull *ndr, int flags, struct PNP_RequestDeviceEject *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_RequestDeviceEject(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestDeviceEject *r) -{ - ndr_print_struct(ndr, name, "PNP_RequestDeviceEject"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_RequestDeviceEject"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_RequestDeviceEject"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_IsDockStationPresent(struct ndr_push *ndr, int flags, const struct PNP_IsDockStationPresent *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_IsDockStationPresent(struct ndr_pull *ndr, int flags, struct PNP_IsDockStationPresent *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_IsDockStationPresent(struct ndr_print *ndr, const char *name, int flags, const struct PNP_IsDockStationPresent *r) -{ - ndr_print_struct(ndr, name, "PNP_IsDockStationPresent"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_IsDockStationPresent"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_IsDockStationPresent"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_RequestEjectPC(struct ndr_push *ndr, int flags, const struct PNP_RequestEjectPC *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_RequestEjectPC(struct ndr_pull *ndr, int flags, struct PNP_RequestEjectPC *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_RequestEjectPC(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestEjectPC *r) -{ - ndr_print_struct(ndr, name, "PNP_RequestEjectPC"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_RequestEjectPC"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_RequestEjectPC"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_HwProfFlags(struct ndr_push *ndr, int flags, const struct PNP_HwProfFlags *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.action)); - if (r->in.devicepath == 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.devicepath, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicepath, ndr_charset_length(r->in.devicepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.config)); - if (r->in.profile_flags == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.profile_flags)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.veto_type)); - if (r->in.veto_type) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.veto_type)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown5)); - if (r->in.unknown5) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown5, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown5, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown5, ndr_charset_length(r->in.unknown5, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.name_length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - if (r->out.profile_flags == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.profile_flags)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.veto_type)); - if (r->out.veto_type) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.veto_type)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.unknown5a)); - if (r->out.unknown5a) { - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.unknown5a)); - if (*r->out.unknown5a) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.unknown5a, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.unknown5a, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.unknown5a, ndr_charset_length(*r->out.unknown5a, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_HwProfFlags(struct ndr_pull *ndr, int flags, struct PNP_HwProfFlags *r) -{ - uint32_t _ptr_veto_type; - uint32_t _ptr_unknown5; - uint32_t _ptr_unknown5a; - TALLOC_CTX *_mem_save_profile_flags_0; - TALLOC_CTX *_mem_save_veto_type_0; - TALLOC_CTX *_mem_save_unknown5_0; - TALLOC_CTX *_mem_save_unknown5a_0; - TALLOC_CTX *_mem_save_unknown5a_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.action)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicepath)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicepath)); - if (ndr_get_array_length(ndr, &r->in.devicepath) > ndr_get_array_size(ndr, &r->in.devicepath)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.devicepath), ndr_get_array_length(ndr, &r->in.devicepath)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicepath, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.config)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.profile_flags); - } - _mem_save_profile_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.profile_flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.profile_flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_profile_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_veto_type)); - if (_ptr_veto_type) { - NDR_PULL_ALLOC(ndr, r->in.veto_type); - } else { - r->in.veto_type = NULL; - } - if (r->in.veto_type) { - _mem_save_veto_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.veto_type, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.veto_type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_veto_type_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown5)); - if (_ptr_unknown5) { - NDR_PULL_ALLOC(ndr, r->in.unknown5); - } else { - r->in.unknown5 = NULL; - } - if (r->in.unknown5) { - _mem_save_unknown5_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown5, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown5)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown5)); - if (ndr_get_array_length(ndr, &r->in.unknown5) > ndr_get_array_size(ndr, &r->in.unknown5)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown5), ndr_get_array_length(ndr, &r->in.unknown5)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown5), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown5, ndr_get_array_length(ndr, &r->in.unknown5), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown5_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.name_length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC(ndr, r->out.profile_flags); - *r->out.profile_flags = *r->in.profile_flags; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.profile_flags); - } - _mem_save_profile_flags_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.profile_flags, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.profile_flags)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_profile_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_veto_type)); - if (_ptr_veto_type) { - NDR_PULL_ALLOC(ndr, r->out.veto_type); - } else { - r->out.veto_type = NULL; - } - if (r->out.veto_type) { - _mem_save_veto_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.veto_type, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.veto_type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_veto_type_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown5a)); - if (_ptr_unknown5a) { - NDR_PULL_ALLOC(ndr, r->out.unknown5a); - } else { - r->out.unknown5a = NULL; - } - if (r->out.unknown5a) { - _mem_save_unknown5a_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown5a, 0); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown5a)); - if (_ptr_unknown5a) { - NDR_PULL_ALLOC(ndr, *r->out.unknown5a); - } else { - *r->out.unknown5a = NULL; - } - if (*r->out.unknown5a) { - _mem_save_unknown5a_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.unknown5a, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.unknown5a)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.unknown5a)); - if (ndr_get_array_length(ndr, r->out.unknown5a) > ndr_get_array_size(ndr, r->out.unknown5a)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.unknown5a), ndr_get_array_length(ndr, r->out.unknown5a)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.unknown5a), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.unknown5a, ndr_get_array_length(ndr, r->out.unknown5a), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown5a_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown5a_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_HwProfFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_HwProfFlags *r) -{ - ndr_print_struct(ndr, name, "PNP_HwProfFlags"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_HwProfFlags"); - ndr->depth++; - ndr_print_uint32(ndr, "action", r->in.action); - ndr_print_ptr(ndr, "devicepath", r->in.devicepath); - ndr->depth++; - ndr_print_string(ndr, "devicepath", r->in.devicepath); - ndr->depth--; - ndr_print_uint32(ndr, "config", r->in.config); - ndr_print_ptr(ndr, "profile_flags", r->in.profile_flags); - ndr->depth++; - ndr_print_uint32(ndr, "profile_flags", *r->in.profile_flags); - ndr->depth--; - ndr_print_ptr(ndr, "veto_type", r->in.veto_type); - ndr->depth++; - if (r->in.veto_type) { - ndr_print_uint16(ndr, "veto_type", *r->in.veto_type); - } - ndr->depth--; - ndr_print_ptr(ndr, "unknown5", r->in.unknown5); - ndr->depth++; - if (r->in.unknown5) { - ndr_print_string(ndr, "unknown5", r->in.unknown5); - } - ndr->depth--; - ndr_print_uint32(ndr, "name_length", r->in.name_length); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_HwProfFlags"); - ndr->depth++; - ndr_print_ptr(ndr, "profile_flags", r->out.profile_flags); - ndr->depth++; - ndr_print_uint32(ndr, "profile_flags", *r->out.profile_flags); - ndr->depth--; - ndr_print_ptr(ndr, "veto_type", r->out.veto_type); - ndr->depth++; - if (r->out.veto_type) { - ndr_print_uint16(ndr, "veto_type", *r->out.veto_type); - } - ndr->depth--; - ndr_print_ptr(ndr, "unknown5a", r->out.unknown5a); - ndr->depth++; - if (r->out.unknown5a) { - ndr_print_ptr(ndr, "unknown5a", *r->out.unknown5a); - ndr->depth++; - if (*r->out.unknown5a) { - ndr_print_string(ndr, "unknown5a", *r->out.unknown5a); - } - ndr->depth--; - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetHwProfInfo(struct ndr_push *ndr, int flags, const struct PNP_GetHwProfInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.idx)); - if (r->in.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_PNP_HwProfInfo(ndr, NDR_SCALARS, r->in.info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_PNP_HwProfInfo(ndr, NDR_SCALARS, r->out.info)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetHwProfInfo(struct ndr_pull *ndr, int flags, struct PNP_GetHwProfInfo *r) -{ - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.idx)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_PNP_HwProfInfo(ndr, NDR_SCALARS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - NDR_PULL_ALLOC(ndr, r->out.info); - *r->out.info = *r->in.info; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_PNP_HwProfInfo(ndr, NDR_SCALARS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetHwProfInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetHwProfInfo *r) -{ - ndr_print_struct(ndr, name, "PNP_GetHwProfInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetHwProfInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "idx", r->in.idx); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_PNP_HwProfInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_uint32(ndr, "size", r->in.size); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetHwProfInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_PNP_HwProfInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_AddEmptyLogConf(struct ndr_push *ndr, int flags, const struct PNP_AddEmptyLogConf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_AddEmptyLogConf(struct ndr_pull *ndr, int flags, struct PNP_AddEmptyLogConf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_AddEmptyLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddEmptyLogConf *r) -{ - ndr_print_struct(ndr, name, "PNP_AddEmptyLogConf"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_AddEmptyLogConf"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_AddEmptyLogConf"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_FreeLogConf(struct ndr_push *ndr, int flags, const struct PNP_FreeLogConf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_FreeLogConf(struct ndr_pull *ndr, int flags, struct PNP_FreeLogConf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_FreeLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeLogConf *r) -{ - ndr_print_struct(ndr, name, "PNP_FreeLogConf"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_FreeLogConf"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_FreeLogConf"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetFirstLogConf(struct ndr_push *ndr, int flags, const struct PNP_GetFirstLogConf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetFirstLogConf(struct ndr_pull *ndr, int flags, struct PNP_GetFirstLogConf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetFirstLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetFirstLogConf *r) -{ - ndr_print_struct(ndr, name, "PNP_GetFirstLogConf"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetFirstLogConf"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetFirstLogConf"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetNextLogConf(struct ndr_push *ndr, int flags, const struct PNP_GetNextLogConf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetNextLogConf(struct ndr_pull *ndr, int flags, struct PNP_GetNextLogConf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetNextLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextLogConf *r) -{ - ndr_print_struct(ndr, name, "PNP_GetNextLogConf"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetNextLogConf"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetNextLogConf"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetLogConfPriority(struct ndr_push *ndr, int flags, const struct PNP_GetLogConfPriority *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetLogConfPriority(struct ndr_pull *ndr, int flags, struct PNP_GetLogConfPriority *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetLogConfPriority(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetLogConfPriority *r) -{ - ndr_print_struct(ndr, name, "PNP_GetLogConfPriority"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetLogConfPriority"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetLogConfPriority"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_AddResDes(struct ndr_push *ndr, int flags, const struct PNP_AddResDes *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_AddResDes(struct ndr_pull *ndr, int flags, struct PNP_AddResDes *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_AddResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddResDes *r) -{ - ndr_print_struct(ndr, name, "PNP_AddResDes"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_AddResDes"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_AddResDes"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_FreeResDes(struct ndr_push *ndr, int flags, const struct PNP_FreeResDes *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_FreeResDes(struct ndr_pull *ndr, int flags, struct PNP_FreeResDes *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_FreeResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeResDes *r) -{ - ndr_print_struct(ndr, name, "PNP_FreeResDes"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_FreeResDes"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_FreeResDes"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetNextResDes(struct ndr_push *ndr, int flags, const struct PNP_GetNextResDes *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetNextResDes(struct ndr_pull *ndr, int flags, struct PNP_GetNextResDes *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetNextResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextResDes *r) -{ - ndr_print_struct(ndr, name, "PNP_GetNextResDes"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetNextResDes"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetNextResDes"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetResDesData(struct ndr_push *ndr, int flags, const struct PNP_GetResDesData *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetResDesData(struct ndr_pull *ndr, int flags, struct PNP_GetResDesData *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetResDesData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesData *r) -{ - ndr_print_struct(ndr, name, "PNP_GetResDesData"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetResDesData"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetResDesData"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetResDesDataSize(struct ndr_push *ndr, int flags, const struct PNP_GetResDesDataSize *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetResDesDataSize(struct ndr_pull *ndr, int flags, struct PNP_GetResDesDataSize *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetResDesDataSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesDataSize *r) -{ - ndr_print_struct(ndr, name, "PNP_GetResDesDataSize"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetResDesDataSize"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetResDesDataSize"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_ModifyResDes(struct ndr_push *ndr, int flags, const struct PNP_ModifyResDes *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_ModifyResDes(struct ndr_pull *ndr, int flags, struct PNP_ModifyResDes *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_ModifyResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ModifyResDes *r) -{ - ndr_print_struct(ndr, name, "PNP_ModifyResDes"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_ModifyResDes"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_ModifyResDes"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_DetectResourceLimit(struct ndr_push *ndr, int flags, const struct PNP_DetectResourceLimit *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_DetectResourceLimit(struct ndr_pull *ndr, int flags, struct PNP_DetectResourceLimit *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_DetectResourceLimit(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DetectResourceLimit *r) -{ - ndr_print_struct(ndr, name, "PNP_DetectResourceLimit"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_DetectResourceLimit"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_DetectResourceLimit"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_QueryResConfList(struct ndr_push *ndr, int flags, const struct PNP_QueryResConfList *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_QueryResConfList(struct ndr_pull *ndr, int flags, struct PNP_QueryResConfList *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_QueryResConfList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryResConfList *r) -{ - ndr_print_struct(ndr, name, "PNP_QueryResConfList"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_QueryResConfList"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_QueryResConfList"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_SetHwProf(struct ndr_push *ndr, int flags, const struct PNP_SetHwProf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_SetHwProf(struct ndr_pull *ndr, int flags, struct PNP_SetHwProf *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_SetHwProf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetHwProf *r) -{ - ndr_print_struct(ndr, name, "PNP_SetHwProf"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_SetHwProf"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_SetHwProf"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_QueryArbitratorFreeData(struct ndr_push *ndr, int flags, const struct PNP_QueryArbitratorFreeData *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_QueryArbitratorFreeData(struct ndr_pull *ndr, int flags, struct PNP_QueryArbitratorFreeData *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_QueryArbitratorFreeData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeData *r) -{ - ndr_print_struct(ndr, name, "PNP_QueryArbitratorFreeData"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_QueryArbitratorFreeData"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_QueryArbitratorFreeData"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_QueryArbitratorFreeSize(struct ndr_push *ndr, int flags, const struct PNP_QueryArbitratorFreeSize *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_QueryArbitratorFreeSize(struct ndr_pull *ndr, int flags, struct PNP_QueryArbitratorFreeSize *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_QueryArbitratorFreeSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeSize *r) -{ - ndr_print_struct(ndr, name, "PNP_QueryArbitratorFreeSize"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_QueryArbitratorFreeSize"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_QueryArbitratorFreeSize"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_RunDetection(struct ndr_push *ndr, int flags, const struct PNP_RunDetection *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_RunDetection(struct ndr_pull *ndr, int flags, struct PNP_RunDetection *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_RunDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RunDetection *r) -{ - ndr_print_struct(ndr, name, "PNP_RunDetection"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_RunDetection"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_RunDetection"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_RegisterNotification(struct ndr_push *ndr, int flags, const struct PNP_RegisterNotification *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_RegisterNotification(struct ndr_pull *ndr, int flags, struct PNP_RegisterNotification *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_RegisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterNotification *r) -{ - ndr_print_struct(ndr, name, "PNP_RegisterNotification"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_RegisterNotification"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_RegisterNotification"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_UnregisterNotification(struct ndr_push *ndr, int flags, const struct PNP_UnregisterNotification *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_UnregisterNotification(struct ndr_pull *ndr, int flags, struct PNP_UnregisterNotification *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_UnregisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterNotification *r) -{ - ndr_print_struct(ndr, name, "PNP_UnregisterNotification"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_UnregisterNotification"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_UnregisterNotification"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetCustomDevProp(struct ndr_push *ndr, int flags, const struct PNP_GetCustomDevProp *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetCustomDevProp(struct ndr_pull *ndr, int flags, struct PNP_GetCustomDevProp *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetCustomDevProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetCustomDevProp *r) -{ - ndr_print_struct(ndr, name, "PNP_GetCustomDevProp"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetCustomDevProp"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetCustomDevProp"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetVersionInternal(struct ndr_push *ndr, int flags, const struct PNP_GetVersionInternal *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetVersionInternal(struct ndr_pull *ndr, int flags, struct PNP_GetVersionInternal *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetVersionInternal(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersionInternal *r) -{ - ndr_print_struct(ndr, name, "PNP_GetVersionInternal"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetVersionInternal"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetVersionInternal"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetBlockedDriverInfo(struct ndr_push *ndr, int flags, const struct PNP_GetBlockedDriverInfo *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetBlockedDriverInfo(struct ndr_pull *ndr, int flags, struct PNP_GetBlockedDriverInfo *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetBlockedDriverInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetBlockedDriverInfo *r) -{ - ndr_print_struct(ndr, name, "PNP_GetBlockedDriverInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetBlockedDriverInfo"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetBlockedDriverInfo"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_PNP_GetServerSideDeviceInstallFlags(struct ndr_push *ndr, int flags, const struct PNP_GetServerSideDeviceInstallFlags *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_PNP_GetServerSideDeviceInstallFlags(struct ndr_pull *ndr, int flags, struct PNP_GetServerSideDeviceInstallFlags *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_PNP_GetServerSideDeviceInstallFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetServerSideDeviceInstallFlags *r) -{ - ndr_print_struct(ndr, name, "PNP_GetServerSideDeviceInstallFlags"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "PNP_GetServerSideDeviceInstallFlags"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "PNP_GetServerSideDeviceInstallFlags"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call ntsvcs_calls[] = { - { - "PNP_Disconnect", - sizeof(struct PNP_Disconnect), - (ndr_push_flags_fn_t) ndr_push_PNP_Disconnect, - (ndr_pull_flags_fn_t) ndr_pull_PNP_Disconnect, - (ndr_print_function_t) ndr_print_PNP_Disconnect, - false, - }, - { - "PNP_Connect", - sizeof(struct PNP_Connect), - (ndr_push_flags_fn_t) ndr_push_PNP_Connect, - (ndr_pull_flags_fn_t) ndr_pull_PNP_Connect, - (ndr_print_function_t) ndr_print_PNP_Connect, - false, - }, - { - "PNP_GetVersion", - sizeof(struct PNP_GetVersion), - (ndr_push_flags_fn_t) ndr_push_PNP_GetVersion, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetVersion, - (ndr_print_function_t) ndr_print_PNP_GetVersion, - false, - }, - { - "PNP_GetGlobalState", - sizeof(struct PNP_GetGlobalState), - (ndr_push_flags_fn_t) ndr_push_PNP_GetGlobalState, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetGlobalState, - (ndr_print_function_t) ndr_print_PNP_GetGlobalState, - false, - }, - { - "PNP_InitDetection", - sizeof(struct PNP_InitDetection), - (ndr_push_flags_fn_t) ndr_push_PNP_InitDetection, - (ndr_pull_flags_fn_t) ndr_pull_PNP_InitDetection, - (ndr_print_function_t) ndr_print_PNP_InitDetection, - false, - }, - { - "PNP_ReportLogOn", - sizeof(struct PNP_ReportLogOn), - (ndr_push_flags_fn_t) ndr_push_PNP_ReportLogOn, - (ndr_pull_flags_fn_t) ndr_pull_PNP_ReportLogOn, - (ndr_print_function_t) ndr_print_PNP_ReportLogOn, - false, - }, - { - "PNP_ValidateDeviceInstance", - sizeof(struct PNP_ValidateDeviceInstance), - (ndr_push_flags_fn_t) ndr_push_PNP_ValidateDeviceInstance, - (ndr_pull_flags_fn_t) ndr_pull_PNP_ValidateDeviceInstance, - (ndr_print_function_t) ndr_print_PNP_ValidateDeviceInstance, - false, - }, - { - "PNP_GetRootDeviceInstance", - sizeof(struct PNP_GetRootDeviceInstance), - (ndr_push_flags_fn_t) ndr_push_PNP_GetRootDeviceInstance, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetRootDeviceInstance, - (ndr_print_function_t) ndr_print_PNP_GetRootDeviceInstance, - false, - }, - { - "PNP_GetRelatedDeviceInstance", - sizeof(struct PNP_GetRelatedDeviceInstance), - (ndr_push_flags_fn_t) ndr_push_PNP_GetRelatedDeviceInstance, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetRelatedDeviceInstance, - (ndr_print_function_t) ndr_print_PNP_GetRelatedDeviceInstance, - false, - }, - { - "PNP_EnumerateSubKeys", - sizeof(struct PNP_EnumerateSubKeys), - (ndr_push_flags_fn_t) ndr_push_PNP_EnumerateSubKeys, - (ndr_pull_flags_fn_t) ndr_pull_PNP_EnumerateSubKeys, - (ndr_print_function_t) ndr_print_PNP_EnumerateSubKeys, - false, - }, - { - "PNP_GetDeviceList", - sizeof(struct PNP_GetDeviceList), - (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceList, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceList, - (ndr_print_function_t) ndr_print_PNP_GetDeviceList, - false, - }, - { - "PNP_GetDeviceListSize", - sizeof(struct PNP_GetDeviceListSize), - (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceListSize, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceListSize, - (ndr_print_function_t) ndr_print_PNP_GetDeviceListSize, - false, - }, - { - "PNP_GetDepth", - sizeof(struct PNP_GetDepth), - (ndr_push_flags_fn_t) ndr_push_PNP_GetDepth, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDepth, - (ndr_print_function_t) ndr_print_PNP_GetDepth, - false, - }, - { - "PNP_GetDeviceRegProp", - sizeof(struct PNP_GetDeviceRegProp), - (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceRegProp, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceRegProp, - (ndr_print_function_t) ndr_print_PNP_GetDeviceRegProp, - false, - }, - { - "PNP_SetDeviceRegProp", - sizeof(struct PNP_SetDeviceRegProp), - (ndr_push_flags_fn_t) ndr_push_PNP_SetDeviceRegProp, - (ndr_pull_flags_fn_t) ndr_pull_PNP_SetDeviceRegProp, - (ndr_print_function_t) ndr_print_PNP_SetDeviceRegProp, - false, - }, - { - "PNP_GetClassInstance", - sizeof(struct PNP_GetClassInstance), - (ndr_push_flags_fn_t) ndr_push_PNP_GetClassInstance, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassInstance, - (ndr_print_function_t) ndr_print_PNP_GetClassInstance, - false, - }, - { - "PNP_CreateKey", - sizeof(struct PNP_CreateKey), - (ndr_push_flags_fn_t) ndr_push_PNP_CreateKey, - (ndr_pull_flags_fn_t) ndr_pull_PNP_CreateKey, - (ndr_print_function_t) ndr_print_PNP_CreateKey, - false, - }, - { - "PNP_DeleteRegistryKey", - sizeof(struct PNP_DeleteRegistryKey), - (ndr_push_flags_fn_t) ndr_push_PNP_DeleteRegistryKey, - (ndr_pull_flags_fn_t) ndr_pull_PNP_DeleteRegistryKey, - (ndr_print_function_t) ndr_print_PNP_DeleteRegistryKey, - false, - }, - { - "PNP_GetClassCount", - sizeof(struct PNP_GetClassCount), - (ndr_push_flags_fn_t) ndr_push_PNP_GetClassCount, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassCount, - (ndr_print_function_t) ndr_print_PNP_GetClassCount, - false, - }, - { - "PNP_GetClassName", - sizeof(struct PNP_GetClassName), - (ndr_push_flags_fn_t) ndr_push_PNP_GetClassName, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassName, - (ndr_print_function_t) ndr_print_PNP_GetClassName, - false, - }, - { - "PNP_DeleteClassKey", - sizeof(struct PNP_DeleteClassKey), - (ndr_push_flags_fn_t) ndr_push_PNP_DeleteClassKey, - (ndr_pull_flags_fn_t) ndr_pull_PNP_DeleteClassKey, - (ndr_print_function_t) ndr_print_PNP_DeleteClassKey, - false, - }, - { - "PNP_GetInterfaceDeviceAlias", - sizeof(struct PNP_GetInterfaceDeviceAlias), - (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceAlias, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceAlias, - (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceAlias, - false, - }, - { - "PNP_GetInterfaceDeviceList", - sizeof(struct PNP_GetInterfaceDeviceList), - (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceList, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceList, - (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceList, - false, - }, - { - "PNP_GetInterfaceDeviceListSize", - sizeof(struct PNP_GetInterfaceDeviceListSize), - (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceListSize, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceListSize, - (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceListSize, - false, - }, - { - "PNP_RegisterDeviceClassAssociation", - sizeof(struct PNP_RegisterDeviceClassAssociation), - (ndr_push_flags_fn_t) ndr_push_PNP_RegisterDeviceClassAssociation, - (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterDeviceClassAssociation, - (ndr_print_function_t) ndr_print_PNP_RegisterDeviceClassAssociation, - false, - }, - { - "PNP_UnregisterDeviceClassAssociation", - sizeof(struct PNP_UnregisterDeviceClassAssociation), - (ndr_push_flags_fn_t) ndr_push_PNP_UnregisterDeviceClassAssociation, - (ndr_pull_flags_fn_t) ndr_pull_PNP_UnregisterDeviceClassAssociation, - (ndr_print_function_t) ndr_print_PNP_UnregisterDeviceClassAssociation, - false, - }, - { - "PNP_GetClassRegProp", - sizeof(struct PNP_GetClassRegProp), - (ndr_push_flags_fn_t) ndr_push_PNP_GetClassRegProp, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassRegProp, - (ndr_print_function_t) ndr_print_PNP_GetClassRegProp, - false, - }, - { - "PNP_SetClassRegProp", - sizeof(struct PNP_SetClassRegProp), - (ndr_push_flags_fn_t) ndr_push_PNP_SetClassRegProp, - (ndr_pull_flags_fn_t) ndr_pull_PNP_SetClassRegProp, - (ndr_print_function_t) ndr_print_PNP_SetClassRegProp, - false, - }, - { - "PNP_CreateDevInst", - sizeof(struct PNP_CreateDevInst), - (ndr_push_flags_fn_t) ndr_push_PNP_CreateDevInst, - (ndr_pull_flags_fn_t) ndr_pull_PNP_CreateDevInst, - (ndr_print_function_t) ndr_print_PNP_CreateDevInst, - false, - }, - { - "PNP_DeviceInstanceAction", - sizeof(struct PNP_DeviceInstanceAction), - (ndr_push_flags_fn_t) ndr_push_PNP_DeviceInstanceAction, - (ndr_pull_flags_fn_t) ndr_pull_PNP_DeviceInstanceAction, - (ndr_print_function_t) ndr_print_PNP_DeviceInstanceAction, - false, - }, - { - "PNP_GetDeviceStatus", - sizeof(struct PNP_GetDeviceStatus), - (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceStatus, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceStatus, - (ndr_print_function_t) ndr_print_PNP_GetDeviceStatus, - false, - }, - { - "PNP_SetDeviceProblem", - sizeof(struct PNP_SetDeviceProblem), - (ndr_push_flags_fn_t) ndr_push_PNP_SetDeviceProblem, - (ndr_pull_flags_fn_t) ndr_pull_PNP_SetDeviceProblem, - (ndr_print_function_t) ndr_print_PNP_SetDeviceProblem, - false, - }, - { - "PNP_DisableDevInst", - sizeof(struct PNP_DisableDevInst), - (ndr_push_flags_fn_t) ndr_push_PNP_DisableDevInst, - (ndr_pull_flags_fn_t) ndr_pull_PNP_DisableDevInst, - (ndr_print_function_t) ndr_print_PNP_DisableDevInst, - false, - }, - { - "PNP_UninstallDevInst", - sizeof(struct PNP_UninstallDevInst), - (ndr_push_flags_fn_t) ndr_push_PNP_UninstallDevInst, - (ndr_pull_flags_fn_t) ndr_pull_PNP_UninstallDevInst, - (ndr_print_function_t) ndr_print_PNP_UninstallDevInst, - false, - }, - { - "PNP_AddID", - sizeof(struct PNP_AddID), - (ndr_push_flags_fn_t) ndr_push_PNP_AddID, - (ndr_pull_flags_fn_t) ndr_pull_PNP_AddID, - (ndr_print_function_t) ndr_print_PNP_AddID, - false, - }, - { - "PNP_RegisterDriver", - sizeof(struct PNP_RegisterDriver), - (ndr_push_flags_fn_t) ndr_push_PNP_RegisterDriver, - (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterDriver, - (ndr_print_function_t) ndr_print_PNP_RegisterDriver, - false, - }, - { - "PNP_QueryRemove", - sizeof(struct PNP_QueryRemove), - (ndr_push_flags_fn_t) ndr_push_PNP_QueryRemove, - (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryRemove, - (ndr_print_function_t) ndr_print_PNP_QueryRemove, - false, - }, - { - "PNP_RequestDeviceEject", - sizeof(struct PNP_RequestDeviceEject), - (ndr_push_flags_fn_t) ndr_push_PNP_RequestDeviceEject, - (ndr_pull_flags_fn_t) ndr_pull_PNP_RequestDeviceEject, - (ndr_print_function_t) ndr_print_PNP_RequestDeviceEject, - false, - }, - { - "PNP_IsDockStationPresent", - sizeof(struct PNP_IsDockStationPresent), - (ndr_push_flags_fn_t) ndr_push_PNP_IsDockStationPresent, - (ndr_pull_flags_fn_t) ndr_pull_PNP_IsDockStationPresent, - (ndr_print_function_t) ndr_print_PNP_IsDockStationPresent, - false, - }, - { - "PNP_RequestEjectPC", - sizeof(struct PNP_RequestEjectPC), - (ndr_push_flags_fn_t) ndr_push_PNP_RequestEjectPC, - (ndr_pull_flags_fn_t) ndr_pull_PNP_RequestEjectPC, - (ndr_print_function_t) ndr_print_PNP_RequestEjectPC, - false, - }, - { - "PNP_HwProfFlags", - sizeof(struct PNP_HwProfFlags), - (ndr_push_flags_fn_t) ndr_push_PNP_HwProfFlags, - (ndr_pull_flags_fn_t) ndr_pull_PNP_HwProfFlags, - (ndr_print_function_t) ndr_print_PNP_HwProfFlags, - false, - }, - { - "PNP_GetHwProfInfo", - sizeof(struct PNP_GetHwProfInfo), - (ndr_push_flags_fn_t) ndr_push_PNP_GetHwProfInfo, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetHwProfInfo, - (ndr_print_function_t) ndr_print_PNP_GetHwProfInfo, - false, - }, - { - "PNP_AddEmptyLogConf", - sizeof(struct PNP_AddEmptyLogConf), - (ndr_push_flags_fn_t) ndr_push_PNP_AddEmptyLogConf, - (ndr_pull_flags_fn_t) ndr_pull_PNP_AddEmptyLogConf, - (ndr_print_function_t) ndr_print_PNP_AddEmptyLogConf, - false, - }, - { - "PNP_FreeLogConf", - sizeof(struct PNP_FreeLogConf), - (ndr_push_flags_fn_t) ndr_push_PNP_FreeLogConf, - (ndr_pull_flags_fn_t) ndr_pull_PNP_FreeLogConf, - (ndr_print_function_t) ndr_print_PNP_FreeLogConf, - false, - }, - { - "PNP_GetFirstLogConf", - sizeof(struct PNP_GetFirstLogConf), - (ndr_push_flags_fn_t) ndr_push_PNP_GetFirstLogConf, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetFirstLogConf, - (ndr_print_function_t) ndr_print_PNP_GetFirstLogConf, - false, - }, - { - "PNP_GetNextLogConf", - sizeof(struct PNP_GetNextLogConf), - (ndr_push_flags_fn_t) ndr_push_PNP_GetNextLogConf, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetNextLogConf, - (ndr_print_function_t) ndr_print_PNP_GetNextLogConf, - false, - }, - { - "PNP_GetLogConfPriority", - sizeof(struct PNP_GetLogConfPriority), - (ndr_push_flags_fn_t) ndr_push_PNP_GetLogConfPriority, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetLogConfPriority, - (ndr_print_function_t) ndr_print_PNP_GetLogConfPriority, - false, - }, - { - "PNP_AddResDes", - sizeof(struct PNP_AddResDes), - (ndr_push_flags_fn_t) ndr_push_PNP_AddResDes, - (ndr_pull_flags_fn_t) ndr_pull_PNP_AddResDes, - (ndr_print_function_t) ndr_print_PNP_AddResDes, - false, - }, - { - "PNP_FreeResDes", - sizeof(struct PNP_FreeResDes), - (ndr_push_flags_fn_t) ndr_push_PNP_FreeResDes, - (ndr_pull_flags_fn_t) ndr_pull_PNP_FreeResDes, - (ndr_print_function_t) ndr_print_PNP_FreeResDes, - false, - }, - { - "PNP_GetNextResDes", - sizeof(struct PNP_GetNextResDes), - (ndr_push_flags_fn_t) ndr_push_PNP_GetNextResDes, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetNextResDes, - (ndr_print_function_t) ndr_print_PNP_GetNextResDes, - false, - }, - { - "PNP_GetResDesData", - sizeof(struct PNP_GetResDesData), - (ndr_push_flags_fn_t) ndr_push_PNP_GetResDesData, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetResDesData, - (ndr_print_function_t) ndr_print_PNP_GetResDesData, - false, - }, - { - "PNP_GetResDesDataSize", - sizeof(struct PNP_GetResDesDataSize), - (ndr_push_flags_fn_t) ndr_push_PNP_GetResDesDataSize, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetResDesDataSize, - (ndr_print_function_t) ndr_print_PNP_GetResDesDataSize, - false, - }, - { - "PNP_ModifyResDes", - sizeof(struct PNP_ModifyResDes), - (ndr_push_flags_fn_t) ndr_push_PNP_ModifyResDes, - (ndr_pull_flags_fn_t) ndr_pull_PNP_ModifyResDes, - (ndr_print_function_t) ndr_print_PNP_ModifyResDes, - false, - }, - { - "PNP_DetectResourceLimit", - sizeof(struct PNP_DetectResourceLimit), - (ndr_push_flags_fn_t) ndr_push_PNP_DetectResourceLimit, - (ndr_pull_flags_fn_t) ndr_pull_PNP_DetectResourceLimit, - (ndr_print_function_t) ndr_print_PNP_DetectResourceLimit, - false, - }, - { - "PNP_QueryResConfList", - sizeof(struct PNP_QueryResConfList), - (ndr_push_flags_fn_t) ndr_push_PNP_QueryResConfList, - (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryResConfList, - (ndr_print_function_t) ndr_print_PNP_QueryResConfList, - false, - }, - { - "PNP_SetHwProf", - sizeof(struct PNP_SetHwProf), - (ndr_push_flags_fn_t) ndr_push_PNP_SetHwProf, - (ndr_pull_flags_fn_t) ndr_pull_PNP_SetHwProf, - (ndr_print_function_t) ndr_print_PNP_SetHwProf, - false, - }, - { - "PNP_QueryArbitratorFreeData", - sizeof(struct PNP_QueryArbitratorFreeData), - (ndr_push_flags_fn_t) ndr_push_PNP_QueryArbitratorFreeData, - (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryArbitratorFreeData, - (ndr_print_function_t) ndr_print_PNP_QueryArbitratorFreeData, - false, - }, - { - "PNP_QueryArbitratorFreeSize", - sizeof(struct PNP_QueryArbitratorFreeSize), - (ndr_push_flags_fn_t) ndr_push_PNP_QueryArbitratorFreeSize, - (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryArbitratorFreeSize, - (ndr_print_function_t) ndr_print_PNP_QueryArbitratorFreeSize, - false, - }, - { - "PNP_RunDetection", - sizeof(struct PNP_RunDetection), - (ndr_push_flags_fn_t) ndr_push_PNP_RunDetection, - (ndr_pull_flags_fn_t) ndr_pull_PNP_RunDetection, - (ndr_print_function_t) ndr_print_PNP_RunDetection, - false, - }, - { - "PNP_RegisterNotification", - sizeof(struct PNP_RegisterNotification), - (ndr_push_flags_fn_t) ndr_push_PNP_RegisterNotification, - (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterNotification, - (ndr_print_function_t) ndr_print_PNP_RegisterNotification, - false, - }, - { - "PNP_UnregisterNotification", - sizeof(struct PNP_UnregisterNotification), - (ndr_push_flags_fn_t) ndr_push_PNP_UnregisterNotification, - (ndr_pull_flags_fn_t) ndr_pull_PNP_UnregisterNotification, - (ndr_print_function_t) ndr_print_PNP_UnregisterNotification, - false, - }, - { - "PNP_GetCustomDevProp", - sizeof(struct PNP_GetCustomDevProp), - (ndr_push_flags_fn_t) ndr_push_PNP_GetCustomDevProp, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetCustomDevProp, - (ndr_print_function_t) ndr_print_PNP_GetCustomDevProp, - false, - }, - { - "PNP_GetVersionInternal", - sizeof(struct PNP_GetVersionInternal), - (ndr_push_flags_fn_t) ndr_push_PNP_GetVersionInternal, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetVersionInternal, - (ndr_print_function_t) ndr_print_PNP_GetVersionInternal, - false, - }, - { - "PNP_GetBlockedDriverInfo", - sizeof(struct PNP_GetBlockedDriverInfo), - (ndr_push_flags_fn_t) ndr_push_PNP_GetBlockedDriverInfo, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetBlockedDriverInfo, - (ndr_print_function_t) ndr_print_PNP_GetBlockedDriverInfo, - false, - }, - { - "PNP_GetServerSideDeviceInstallFlags", - sizeof(struct PNP_GetServerSideDeviceInstallFlags), - (ndr_push_flags_fn_t) ndr_push_PNP_GetServerSideDeviceInstallFlags, - (ndr_pull_flags_fn_t) ndr_pull_PNP_GetServerSideDeviceInstallFlags, - (ndr_print_function_t) ndr_print_PNP_GetServerSideDeviceInstallFlags, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const ntsvcs_endpoint_strings[] = { - "ncacn_np:[\\pipe\\ntsvcs]", - "ncacn_np:[\\pipe\\plugplay]", -}; - -static const struct ndr_interface_string_array ntsvcs_endpoints = { - .count = 2, - .names = ntsvcs_endpoint_strings -}; - -static const char * const ntsvcs_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array ntsvcs_authservices = { - .count = 1, - .names = ntsvcs_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_ntsvcs = { - .name = "ntsvcs", - .syntax_id = { - {0x8d9f4e40,0xa03d,0x11ce,{0x8f,0x69},{0x08,0x00,0x3e,0x30,0x05,0x1b}}, - NDR_NTSVCS_VERSION - }, - .helpstring = NDR_NTSVCS_HELPSTRING, - .num_calls = 65, - .calls = ntsvcs_calls, - .endpoints = &ntsvcs_endpoints, - .authservices = &ntsvcs_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_ntsvcs.h b/source3/librpc/gen_ndr/ndr_ntsvcs.h deleted file mode 100644 index 0e3b6b91c4..0000000000 --- a/source3/librpc/gen_ndr/ndr_ntsvcs.h +++ /dev/null @@ -1,211 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/ntsvcs.h" - -#ifndef _HEADER_NDR_ntsvcs -#define _HEADER_NDR_ntsvcs - -#define NDR_NTSVCS_UUID "8d9f4e40-a03d-11ce-8f69-08003e30051b" -#define NDR_NTSVCS_VERSION 1.0 -#define NDR_NTSVCS_NAME "ntsvcs" -#define NDR_NTSVCS_HELPSTRING "Plug and Play services" -extern const struct ndr_interface_table ndr_table_ntsvcs; -#define NDR_PNP_DISCONNECT (0x00) - -#define NDR_PNP_CONNECT (0x01) - -#define NDR_PNP_GETVERSION (0x02) - -#define NDR_PNP_GETGLOBALSTATE (0x03) - -#define NDR_PNP_INITDETECTION (0x04) - -#define NDR_PNP_REPORTLOGON (0x05) - -#define NDR_PNP_VALIDATEDEVICEINSTANCE (0x06) - -#define NDR_PNP_GETROOTDEVICEINSTANCE (0x07) - -#define NDR_PNP_GETRELATEDDEVICEINSTANCE (0x08) - -#define NDR_PNP_ENUMERATESUBKEYS (0x09) - -#define NDR_PNP_GETDEVICELIST (0x0a) - -#define NDR_PNP_GETDEVICELISTSIZE (0x0b) - -#define NDR_PNP_GETDEPTH (0x0c) - -#define NDR_PNP_GETDEVICEREGPROP (0x0d) - -#define NDR_PNP_SETDEVICEREGPROP (0x0e) - -#define NDR_PNP_GETCLASSINSTANCE (0x0f) - -#define NDR_PNP_CREATEKEY (0x10) - -#define NDR_PNP_DELETEREGISTRYKEY (0x11) - -#define NDR_PNP_GETCLASSCOUNT (0x12) - -#define NDR_PNP_GETCLASSNAME (0x13) - -#define NDR_PNP_DELETECLASSKEY (0x14) - -#define NDR_PNP_GETINTERFACEDEVICEALIAS (0x15) - -#define NDR_PNP_GETINTERFACEDEVICELIST (0x16) - -#define NDR_PNP_GETINTERFACEDEVICELISTSIZE (0x17) - -#define NDR_PNP_REGISTERDEVICECLASSASSOCIATION (0x18) - -#define NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION (0x19) - -#define NDR_PNP_GETCLASSREGPROP (0x1a) - -#define NDR_PNP_SETCLASSREGPROP (0x1b) - -#define NDR_PNP_CREATEDEVINST (0x1c) - -#define NDR_PNP_DEVICEINSTANCEACTION (0x1d) - -#define NDR_PNP_GETDEVICESTATUS (0x1e) - -#define NDR_PNP_SETDEVICEPROBLEM (0x1f) - -#define NDR_PNP_DISABLEDEVINST (0x20) - -#define NDR_PNP_UNINSTALLDEVINST (0x21) - -#define NDR_PNP_ADDID (0x22) - -#define NDR_PNP_REGISTERDRIVER (0x23) - -#define NDR_PNP_QUERYREMOVE (0x24) - -#define NDR_PNP_REQUESTDEVICEEJECT (0x25) - -#define NDR_PNP_ISDOCKSTATIONPRESENT (0x26) - -#define NDR_PNP_REQUESTEJECTPC (0x27) - -#define NDR_PNP_HWPROFFLAGS (0x28) - -#define NDR_PNP_GETHWPROFINFO (0x29) - -#define NDR_PNP_ADDEMPTYLOGCONF (0x2a) - -#define NDR_PNP_FREELOGCONF (0x2b) - -#define NDR_PNP_GETFIRSTLOGCONF (0x2c) - -#define NDR_PNP_GETNEXTLOGCONF (0x2d) - -#define NDR_PNP_GETLOGCONFPRIORITY (0x2e) - -#define NDR_PNP_ADDRESDES (0x2f) - -#define NDR_PNP_FREERESDES (0x30) - -#define NDR_PNP_GETNEXTRESDES (0x31) - -#define NDR_PNP_GETRESDESDATA (0x32) - -#define NDR_PNP_GETRESDESDATASIZE (0x33) - -#define NDR_PNP_MODIFYRESDES (0x34) - -#define NDR_PNP_DETECTRESOURCELIMIT (0x35) - -#define NDR_PNP_QUERYRESCONFLIST (0x36) - -#define NDR_PNP_SETHWPROF (0x37) - -#define NDR_PNP_QUERYARBITRATORFREEDATA (0x38) - -#define NDR_PNP_QUERYARBITRATORFREESIZE (0x39) - -#define NDR_PNP_RUNDETECTION (0x3a) - -#define NDR_PNP_REGISTERNOTIFICATION (0x3b) - -#define NDR_PNP_UNREGISTERNOTIFICATION (0x3c) - -#define NDR_PNP_GETCUSTOMDEVPROP (0x3d) - -#define NDR_PNP_GETVERSIONINTERNAL (0x3e) - -#define NDR_PNP_GETBLOCKEDDRIVERINFO (0x3f) - -#define NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS (0x40) - -#define NDR_NTSVCS_CALL_COUNT (65) -void ndr_print_PNP_HwProfInfo(struct ndr_print *ndr, const char *name, const struct PNP_HwProfInfo *r); -void ndr_print_PNP_Disconnect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Disconnect *r); -void ndr_print_PNP_Connect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Connect *r); -void ndr_print_PNP_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersion *r); -void ndr_print_PNP_GetGlobalState(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetGlobalState *r); -void ndr_print_PNP_InitDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_InitDetection *r); -void ndr_print_PNP_ReportLogOn(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ReportLogOn *r); -void ndr_print_PNP_ValidateDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ValidateDeviceInstance *r); -void ndr_print_PNP_GetRootDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRootDeviceInstance *r); -void ndr_print_PNP_GetRelatedDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRelatedDeviceInstance *r); -void ndr_print_PNP_EnumerateSubKeys(struct ndr_print *ndr, const char *name, int flags, const struct PNP_EnumerateSubKeys *r); -void ndr_print_PNP_GetDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceList *r); -void ndr_print_PNP_GetDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceListSize *r); -void ndr_print_PNP_GetDepth(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDepth *r); -void ndr_print_PNP_GetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceRegProp *r); -void ndr_print_PNP_SetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceRegProp *r); -void ndr_print_PNP_GetClassInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassInstance *r); -void ndr_print_PNP_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateKey *r); -void ndr_print_PNP_DeleteRegistryKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteRegistryKey *r); -void ndr_print_PNP_GetClassCount(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassCount *r); -void ndr_print_PNP_GetClassName(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassName *r); -void ndr_print_PNP_DeleteClassKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteClassKey *r); -void ndr_print_PNP_GetInterfaceDeviceAlias(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceAlias *r); -void ndr_print_PNP_GetInterfaceDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceList *r); -void ndr_print_PNP_GetInterfaceDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceListSize *r); -void ndr_print_PNP_RegisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDeviceClassAssociation *r); -void ndr_print_PNP_UnregisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterDeviceClassAssociation *r); -void ndr_print_PNP_GetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassRegProp *r); -void ndr_print_PNP_SetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetClassRegProp *r); -void ndr_print_PNP_CreateDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateDevInst *r); -void ndr_print_PNP_DeviceInstanceAction(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeviceInstanceAction *r); -void ndr_print_PNP_GetDeviceStatus(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceStatus *r); -void ndr_print_PNP_SetDeviceProblem(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceProblem *r); -void ndr_print_PNP_DisableDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DisableDevInst *r); -void ndr_print_PNP_UninstallDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UninstallDevInst *r); -void ndr_print_PNP_AddID(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddID *r); -void ndr_print_PNP_RegisterDriver(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDriver *r); -void ndr_print_PNP_QueryRemove(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryRemove *r); -void ndr_print_PNP_RequestDeviceEject(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestDeviceEject *r); -void ndr_print_PNP_IsDockStationPresent(struct ndr_print *ndr, const char *name, int flags, const struct PNP_IsDockStationPresent *r); -void ndr_print_PNP_RequestEjectPC(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestEjectPC *r); -void ndr_print_PNP_HwProfFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_HwProfFlags *r); -void ndr_print_PNP_GetHwProfInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetHwProfInfo *r); -void ndr_print_PNP_AddEmptyLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddEmptyLogConf *r); -void ndr_print_PNP_FreeLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeLogConf *r); -void ndr_print_PNP_GetFirstLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetFirstLogConf *r); -void ndr_print_PNP_GetNextLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextLogConf *r); -void ndr_print_PNP_GetLogConfPriority(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetLogConfPriority *r); -void ndr_print_PNP_AddResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddResDes *r); -void ndr_print_PNP_FreeResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeResDes *r); -void ndr_print_PNP_GetNextResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextResDes *r); -void ndr_print_PNP_GetResDesData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesData *r); -void ndr_print_PNP_GetResDesDataSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesDataSize *r); -void ndr_print_PNP_ModifyResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ModifyResDes *r); -void ndr_print_PNP_DetectResourceLimit(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DetectResourceLimit *r); -void ndr_print_PNP_QueryResConfList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryResConfList *r); -void ndr_print_PNP_SetHwProf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetHwProf *r); -void ndr_print_PNP_QueryArbitratorFreeData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeData *r); -void ndr_print_PNP_QueryArbitratorFreeSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeSize *r); -void ndr_print_PNP_RunDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RunDetection *r); -void ndr_print_PNP_RegisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterNotification *r); -void ndr_print_PNP_UnregisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterNotification *r); -void ndr_print_PNP_GetCustomDevProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetCustomDevProp *r); -void ndr_print_PNP_GetVersionInternal(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersionInternal *r); -void ndr_print_PNP_GetBlockedDriverInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetBlockedDriverInfo *r); -void ndr_print_PNP_GetServerSideDeviceInstallFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetServerSideDeviceInstallFlags *r); -#endif /* _HEADER_NDR_ntsvcs */ diff --git a/source3/librpc/gen_ndr/ndr_samr.c b/source3/librpc/gen_ndr/ndr_samr.c deleted file mode 100644 index 83db0faaef..0000000000 --- a/source3/librpc/gen_ndr/ndr_samr.c +++ /dev/null @@ -1,12856 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_samr.h" - -#include "librpc/gen_ndr/ndr_misc.h" -#include "librpc/gen_ndr/ndr_lsa.h" -#include "librpc/gen_ndr/ndr_security.h" -_PUBLIC_ enum ndr_err_code ndr_push_netr_SamDatabaseID(struct ndr_push *ndr, int ndr_flags, enum netr_SamDatabaseID r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_SamDatabaseID(struct ndr_pull *ndr, int ndr_flags, enum netr_SamDatabaseID *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_SamDatabaseID(struct ndr_print *ndr, const char *name, enum netr_SamDatabaseID r) -{ - const char *val = NULL; - - switch (r) { - case SAM_DATABASE_DOMAIN: val = "SAM_DATABASE_DOMAIN"; break; - case SAM_DATABASE_BUILTIN: val = "SAM_DATABASE_BUILTIN"; break; - case SAM_DATABASE_PRIVS: val = "SAM_DATABASE_PRIVS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int ndr_flags, enum samr_RejectReason r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r) -{ - const char *val = NULL; - - switch (r) { - case SAMR_REJECT_OTHER: val = "SAMR_REJECT_OTHER"; break; - case SAMR_REJECT_TOO_SHORT: val = "SAMR_REJECT_TOO_SHORT"; break; - case SAMR_REJECT_IN_HISTORY: val = "SAMR_REJECT_IN_HISTORY"; break; - case SAMR_REJECT_COMPLEXITY: val = "SAMR_REJECT_COMPLEXITY"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_AcctFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_AcctFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_AcctFlags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DISABLED", ACB_DISABLED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_HOMDIRREQ", ACB_HOMDIRREQ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PWNOTREQ", ACB_PWNOTREQ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_TEMPDUP", ACB_TEMPDUP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NORMAL", ACB_NORMAL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_MNS", ACB_MNS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DOMTRUST", ACB_DOMTRUST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_WSTRUST", ACB_WSTRUST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_SVRTRUST", ACB_SVRTRUST, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PWNOEXP", ACB_PWNOEXP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_AUTOLOCK", ACB_AUTOLOCK, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_ENC_TXT_PWD_ALLOWED", ACB_ENC_TXT_PWD_ALLOWED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_SMARTCARD_REQUIRED", ACB_SMARTCARD_REQUIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_TRUSTED_FOR_DELEGATION", ACB_TRUSTED_FOR_DELEGATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NOT_DELEGATED", ACB_NOT_DELEGATED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_USE_DES_KEY_ONLY", ACB_USE_DES_KEY_ONLY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DONT_REQUIRE_PREAUTH", ACB_DONT_REQUIRE_PREAUTH, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PW_EXPIRED", ACB_PW_EXPIRED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NO_AUTH_DATA_REQD", ACB_NO_AUTH_DATA_REQD, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ConnectAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ConnectAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ConnectAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_CONNECT_TO_SERVER", SAMR_ACCESS_CONNECT_TO_SERVER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_SHUTDOWN_SERVER", SAMR_ACCESS_SHUTDOWN_SERVER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_INITIALIZE_SERVER", SAMR_ACCESS_INITIALIZE_SERVER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_CREATE_DOMAIN", SAMR_ACCESS_CREATE_DOMAIN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_ENUM_DOMAINS", SAMR_ACCESS_ENUM_DOMAINS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_OPEN_DOMAIN", SAMR_ACCESS_OPEN_DOMAIN, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_NAME_ETC", SAMR_USER_ACCESS_GET_NAME_ETC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_LOCALE", SAMR_USER_ACCESS_GET_LOCALE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_LOC_COM", SAMR_USER_ACCESS_SET_LOC_COM, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_LOGONINFO", SAMR_USER_ACCESS_GET_LOGONINFO, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_ATTRIBUTES", SAMR_USER_ACCESS_GET_ATTRIBUTES, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_ATTRIBUTES", SAMR_USER_ACCESS_SET_ATTRIBUTES, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_CHANGE_PASSWORD", SAMR_USER_ACCESS_CHANGE_PASSWORD, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_PASSWORD", SAMR_USER_ACCESS_SET_PASSWORD, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_GROUPS", SAMR_USER_ACCESS_GET_GROUPS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP", SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP", SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomainAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomainAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomainAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1", SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_1", SAMR_DOMAIN_ACCESS_SET_INFO_1, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2", SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_2", SAMR_DOMAIN_ACCESS_SET_INFO_2, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_USER", SAMR_DOMAIN_ACCESS_CREATE_USER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_GROUP", SAMR_DOMAIN_ACCESS_CREATE_GROUP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_ALIAS", SAMR_DOMAIN_ACCESS_CREATE_ALIAS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS", SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS", SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT", SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_3", SAMR_DOMAIN_ACCESS_SET_INFO_3, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GroupAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GroupAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GroupAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_LOOKUP_INFO", SAMR_GROUP_ACCESS_LOOKUP_INFO, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_SET_INFO", SAMR_GROUP_ACCESS_SET_INFO, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_ADD_MEMBER", SAMR_GROUP_ACCESS_ADD_MEMBER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_REMOVE_MEMBER", SAMR_GROUP_ACCESS_REMOVE_MEMBER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_GET_MEMBERS", SAMR_GROUP_ACCESS_GET_MEMBERS, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_AliasAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_AliasAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_AliasAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_ADD_MEMBER", SAMR_ALIAS_ACCESS_ADD_MEMBER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_REMOVE_MEMBER", SAMR_ALIAS_ACCESS_REMOVE_MEMBER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_GET_MEMBERS", SAMR_ALIAS_ACCESS_GET_MEMBERS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_LOOKUP_INFO", SAMR_ALIAS_ACCESS_LOOKUP_INFO, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_SET_INFO", SAMR_ALIAS_ACCESS_SET_INFO, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_SamEntry(struct ndr_push *ndr, int ndr_flags, const struct samr_SamEntry *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_SamEntry(struct ndr_pull *ndr, int ndr_flags, struct samr_SamEntry *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, const struct samr_SamEntry *r) -{ - ndr_print_struct(ndr, name, "samr_SamEntry"); - ndr->depth++; - ndr_print_uint32(ndr, "idx", r->idx); - ndr_print_lsa_String(ndr, "name", &r->name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_SamArray(struct ndr_push *ndr, int ndr_flags, const struct samr_SamArray *r) -{ - uint32_t cntr_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_SamArray(struct ndr_pull *ndr, int ndr_flags, struct samr_SamArray *r) -{ - uint32_t _ptr_entries; - uint32_t cntr_entries_1; - TALLOC_CTX *_mem_save_entries_0; - TALLOC_CTX *_mem_save_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); - if (_ptr_entries) { - NDR_PULL_ALLOC(ndr, r->entries); - } else { - r->entries = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); - NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); - _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - } - if (r->entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SamArray(struct ndr_print *ndr, const char *name, const struct samr_SamArray *r) -{ - uint32_t cntr_entries_1; - ndr_print_struct(ndr, name, "samr_SamArray"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "entries", r->entries); - ndr->depth++; - if (r->entries) { - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); - ndr->depth++; - for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { - ndr_print_samr_SamEntry(ndr, "entries", &r->entries[cntr_entries_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_Role(struct ndr_push *ndr, int ndr_flags, enum samr_Role r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_Role(struct ndr_pull *ndr, int ndr_flags, enum samr_Role *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Role(struct ndr_print *ndr, const char *name, enum samr_Role r) -{ - const char *val = NULL; - - switch (r) { - case SAMR_ROLE_STANDALONE: val = "SAMR_ROLE_STANDALONE"; break; - case SAMR_ROLE_DOMAIN_MEMBER: val = "SAMR_ROLE_DOMAIN_MEMBER"; break; - case SAMR_ROLE_DOMAIN_BDC: val = "SAMR_ROLE_DOMAIN_BDC"; break; - case SAMR_ROLE_DOMAIN_PDC: val = "SAMR_ROLE_DOMAIN_PDC"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_COMPLEX", DOMAIN_PASSWORD_COMPLEX, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_ANON_CHANGE", DOMAIN_PASSWORD_NO_ANON_CHANGE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_CLEAR_CHANGE", DOMAIN_PASSWORD_NO_CLEAR_CHANGE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_LOCKOUT_ADMINS", DOMAIN_PASSWORD_LOCKOUT_ADMINS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_STORE_CLEARTEXT", DOMAIN_PASSWORD_STORE_CLEARTEXT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_REFUSE_PASSWORD_CHANGE", DOMAIN_REFUSE_PASSWORD_CHANGE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomainServerState(struct ndr_push *ndr, int ndr_flags, enum samr_DomainServerState r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomainServerState(struct ndr_pull *ndr, int ndr_flags, enum samr_DomainServerState *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomainServerState(struct ndr_print *ndr, const char *name, enum samr_DomainServerState r) -{ - const char *val = NULL; - - switch (r) { - case DOMAIN_SERVER_ENABLED: val = "DOMAIN_SERVER_ENABLED"; break; - case DOMAIN_SERVER_DISABLED: val = "DOMAIN_SERVER_DISABLED"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_samr_DomInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length)); - NDR_CHECK(ndr_push_samr_PasswordProperties(ndr, NDR_SCALARS, r->password_properties)); - NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age)); - NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length)); - NDR_CHECK(ndr_pull_samr_PasswordProperties(ndr, NDR_SCALARS, &r->password_properties)); - NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age)); - NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r) -{ - ndr_print_struct(ndr, name, "samr_DomInfo1"); - ndr->depth++; - ndr_print_uint16(ndr, "min_password_length", r->min_password_length); - ndr_print_uint16(ndr, "password_history_length", r->password_history_length); - ndr_print_samr_PasswordProperties(ndr, "password_properties", r->password_properties); - ndr_print_dlong(ndr, "max_password_age", r->max_password_age); - ndr_print_dlong(ndr, "min_password_age", r->min_password_age); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomGeneralInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num)); - NDR_CHECK(ndr_push_samr_DomainServerState(ndr, NDR_SCALARS, r->domain_server_state)); - NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_users)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_groups)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aliases)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomGeneralInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num)); - NDR_CHECK(ndr_pull_samr_DomainServerState(ndr, NDR_SCALARS, &r->domain_server_state)); - NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_users)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_groups)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aliases)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomGeneralInformation(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation *r) -{ - ndr_print_struct(ndr, name, "samr_DomGeneralInformation"); - ndr->depth++; - ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time); - ndr_print_lsa_String(ndr, "oem_information", &r->oem_information); - ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); - ndr_print_lsa_String(ndr, "primary", &r->primary); - ndr_print_udlong(ndr, "sequence_num", r->sequence_num); - ndr_print_samr_DomainServerState(ndr, "domain_server_state", r->domain_server_state); - ndr_print_samr_Role(ndr, "role", r->role); - ndr_print_uint32(ndr, "unknown3", r->unknown3); - ndr_print_uint32(ndr, "num_users", r->num_users); - ndr_print_uint32(ndr, "num_groups", r->num_groups); - ndr_print_uint32(ndr, "num_aliases", r->num_aliases); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r) -{ - ndr_print_struct(ndr, name, "samr_DomInfo3"); - ndr->depth++; - ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomOEMInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomOEMInformation *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomOEMInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomOEMInformation *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomOEMInformation(struct ndr_print *ndr, const char *name, const struct samr_DomOEMInformation *r) -{ - ndr_print_struct(ndr, name, "samr_DomOEMInformation"); - ndr->depth++; - ndr_print_lsa_String(ndr, "oem_information", &r->oem_information); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r) -{ - ndr_print_struct(ndr, name, "samr_DomInfo5"); - ndr->depth++; - ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo6 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo6 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r) -{ - ndr_print_struct(ndr, name, "samr_DomInfo6"); - ndr->depth++; - ndr_print_lsa_String(ndr, "primary", &r->primary); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r) -{ - ndr_print_struct(ndr, name, "samr_DomInfo7"); - ndr->depth++; - ndr_print_samr_Role(ndr, "role", r->role); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo8 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo8 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r) -{ - ndr_print_struct(ndr, name, "samr_DomInfo8"); - ndr->depth++; - ndr_print_hyper(ndr, "sequence_num", r->sequence_num); - ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo9 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_samr_DomainServerState(ndr, NDR_SCALARS, r->domain_server_state)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo9 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_samr_DomainServerState(ndr, NDR_SCALARS, &r->domain_server_state)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r) -{ - ndr_print_struct(ndr, name, "samr_DomInfo9"); - ndr->depth++; - ndr_print_samr_DomainServerState(ndr, "domain_server_state", r->domain_server_state); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomGeneralInformation2(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomGeneralInformation2(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomGeneralInformation2(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation2 *r) -{ - ndr_print_struct(ndr, name, "samr_DomGeneralInformation2"); - ndr->depth++; - ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general); - ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration); - ndr_print_hyper(ndr, "lockout_window", r->lockout_window); - ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo12 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo12 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r) -{ - ndr_print_struct(ndr, name, "samr_DomInfo12"); - ndr->depth++; - ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration); - ndr_print_hyper(ndr, "lockout_window", r->lockout_window); - ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo13 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->modified_count_at_last_promotion)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo13 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->modified_count_at_last_promotion)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r) -{ - ndr_print_struct(ndr, name, "samr_DomInfo13"); - ndr->depth++; - ndr_print_hyper(ndr, "sequence_num", r->sequence_num); - ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time); - ndr_print_hyper(ndr, "modified_count_at_last_promotion", r->modified_count_at_last_promotion); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union samr_DomainInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general)); - break; } - - case 3: { - NDR_CHECK(ndr_push_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem)); - break; } - - case 5: { - NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5)); - break; } - - case 6: { - NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6)); - break; } - - case 7: { - NDR_CHECK(ndr_push_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7)); - break; } - - case 8: { - NDR_CHECK(ndr_push_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8)); - break; } - - case 9: { - NDR_CHECK(ndr_push_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9)); - break; } - - case 11: { - NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2)); - break; } - - case 12: { - NDR_CHECK(ndr_push_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12)); - break; } - - case 13: { - NDR_CHECK(ndr_push_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - break; - - case 2: - NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general)); - break; - - case 3: - break; - - case 4: - NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem)); - break; - - case 5: - NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5)); - break; - - case 6: - NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6)); - break; - - case 7: - break; - - case 8: - break; - - case 9: - break; - - case 11: - NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2)); - break; - - case 12: - break; - - case 13: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union samr_DomainInfo *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general)); - break; } - - case 3: { - NDR_CHECK(ndr_pull_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem)); - break; } - - case 5: { - NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5)); - break; } - - case 6: { - NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6)); - break; } - - case 7: { - NDR_CHECK(ndr_pull_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7)); - break; } - - case 8: { - NDR_CHECK(ndr_pull_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8)); - break; } - - case 9: { - NDR_CHECK(ndr_pull_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9)); - break; } - - case 11: { - NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2)); - break; } - - case 12: { - NDR_CHECK(ndr_pull_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12)); - break; } - - case 13: { - NDR_CHECK(ndr_pull_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - break; - - case 2: - NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general)); - break; - - case 3: - break; - - case 4: - NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem)); - break; - - case 5: - NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5)); - break; - - case 6: - NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6)); - break; - - case 7: - break; - - case 8: - break; - - case 9: - break; - - case 11: - NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2)); - break; - - case 12: - break; - - case 13: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "samr_DomainInfo"); - switch (level) { - case 1: - ndr_print_samr_DomInfo1(ndr, "info1", &r->info1); - break; - - case 2: - ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general); - break; - - case 3: - ndr_print_samr_DomInfo3(ndr, "info3", &r->info3); - break; - - case 4: - ndr_print_samr_DomOEMInformation(ndr, "oem", &r->oem); - break; - - case 5: - ndr_print_samr_DomInfo5(ndr, "info5", &r->info5); - break; - - case 6: - ndr_print_samr_DomInfo6(ndr, "info6", &r->info6); - break; - - case 7: - ndr_print_samr_DomInfo7(ndr, "info7", &r->info7); - break; - - case 8: - ndr_print_samr_DomInfo8(ndr, "info8", &r->info8); - break; - - case 9: - ndr_print_samr_DomInfo9(ndr, "info9", &r->info9); - break; - - case 11: - ndr_print_samr_DomGeneralInformation2(ndr, "general2", &r->general2); - break; - - case 12: - ndr_print_samr_DomInfo12(ndr, "info12", &r->info12); - break; - - case 13: - ndr_print_samr_DomInfo13(ndr, "info13", &r->info13); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_samr_Ids(struct ndr_push *ndr, int ndr_flags, const struct samr_Ids *r) -{ - uint32_t cntr_ids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ids)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->ids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ids[cntr_ids_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_Ids(struct ndr_pull *ndr, int ndr_flags, struct samr_Ids *r) -{ - uint32_t _ptr_ids; - uint32_t cntr_ids_1; - TALLOC_CTX *_mem_save_ids_0; - TALLOC_CTX *_mem_save_ids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - if (r->count < 0 || r->count > 1024) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ids)); - if (_ptr_ids) { - NDR_PULL_ALLOC(ndr, r->ids); - } else { - r->ids = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->ids) { - _mem_save_ids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->ids)); - NDR_PULL_ALLOC_N(ndr, r->ids, ndr_get_array_size(ndr, &r->ids)); - _mem_save_ids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0); - for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ids[cntr_ids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_0, 0); - } - if (r->ids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->ids, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Ids(struct ndr_print *ndr, const char *name, const struct samr_Ids *r) -{ - uint32_t cntr_ids_1; - ndr_print_struct(ndr, name, "samr_Ids"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "ids", r->ids); - ndr->depth++; - if (r->ids) { - ndr->print(ndr, "%s: ARRAY(%d)", "ids", (int)r->count); - ndr->depth++; - for (cntr_ids_1=0;cntr_ids_1count;cntr_ids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_ids_1) != -1) { - ndr_print_uint32(ndr, "ids", r->ids[cntr_ids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_GroupAttrs(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_GroupAttrs(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GroupAttrs(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_MANDATORY", SE_GROUP_MANDATORY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED_BY_DEFAULT", SE_GROUP_ENABLED_BY_DEFAULT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED", SE_GROUP_ENABLED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_OWNER", SE_GROUP_OWNER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_USE_FOR_DENY_ONLY", SE_GROUP_USE_FOR_DENY_ONLY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_RESOURCE", SE_GROUP_RESOURCE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_LOGON_ID", SE_GROUP_LOGON_ID, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GroupInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAll *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GroupInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAll *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GroupInfoAll(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAll *r) -{ - ndr_print_struct(ndr, name, "samr_GroupInfoAll"); - ndr->depth++; - ndr_print_lsa_String(ndr, "name", &r->name); - ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); - ndr_print_uint32(ndr, "num_members", r->num_members); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GroupInfoAttributes(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAttributes *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GroupInfoAttributes(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAttributes *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GroupInfoAttributes(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAttributes *r) -{ - ndr_print_struct(ndr, name, "samr_GroupInfoAttributes"); - ndr->depth++; - ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GroupInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_GroupInfoEnum r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GroupInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_GroupInfoEnum *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GroupInfoEnum(struct ndr_print *ndr, const char *name, enum samr_GroupInfoEnum r) -{ - const char *val = NULL; - - switch (r) { - case GROUPINFOALL: val = "GROUPINFOALL"; break; - case GROUPINFONAME: val = "GROUPINFONAME"; break; - case GROUPINFOATTRIBUTES: val = "GROUPINFOATTRIBUTES"; break; - case GROUPINFODESCRIPTION: val = "GROUPINFODESCRIPTION"; break; - case GROUPINFOALL2: val = "GROUPINFOALL2"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_samr_GroupInfo(struct ndr_push *ndr, int ndr_flags, const union samr_GroupInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, level)); - switch (level) { - case GROUPINFOALL: { - NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all)); - break; } - - case GROUPINFONAME: { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); - break; } - - case GROUPINFOATTRIBUTES: { - NDR_CHECK(ndr_push_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes)); - break; } - - case GROUPINFODESCRIPTION: { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - break; } - - case GROUPINFOALL2: { - NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case GROUPINFOALL: - NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all)); - break; - - case GROUPINFONAME: - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); - break; - - case GROUPINFOATTRIBUTES: - break; - - case GROUPINFODESCRIPTION: - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - break; - - case GROUPINFOALL2: - NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GroupInfo(struct ndr_pull *ndr, int ndr_flags, union samr_GroupInfo *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case GROUPINFOALL: { - NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all)); - break; } - - case GROUPINFONAME: { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); - break; } - - case GROUPINFOATTRIBUTES: { - NDR_CHECK(ndr_pull_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes)); - break; } - - case GROUPINFODESCRIPTION: { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - break; } - - case GROUPINFOALL2: { - NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case GROUPINFOALL: - NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all)); - break; - - case GROUPINFONAME: - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); - break; - - case GROUPINFOATTRIBUTES: - break; - - case GROUPINFODESCRIPTION: - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - break; - - case GROUPINFOALL2: - NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GroupInfo(struct ndr_print *ndr, const char *name, const union samr_GroupInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "samr_GroupInfo"); - switch (level) { - case GROUPINFOALL: - ndr_print_samr_GroupInfoAll(ndr, "all", &r->all); - break; - - case GROUPINFONAME: - ndr_print_lsa_String(ndr, "name", &r->name); - break; - - case GROUPINFOATTRIBUTES: - ndr_print_samr_GroupInfoAttributes(ndr, "attributes", &r->attributes); - break; - - case GROUPINFODESCRIPTION: - ndr_print_lsa_String(ndr, "description", &r->description); - break; - - case GROUPINFOALL2: - ndr_print_samr_GroupInfoAll(ndr, "all2", &r->all2); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_samr_RidTypeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidTypeArray *r) -{ - uint32_t cntr_rids_1; - uint32_t cntr_types_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->types)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->rids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1])); - } - } - if (r->types) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->types[cntr_types_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_RidTypeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidTypeArray *r) -{ - uint32_t _ptr_rids; - uint32_t cntr_rids_1; - TALLOC_CTX *_mem_save_rids_0; - TALLOC_CTX *_mem_save_rids_1; - uint32_t _ptr_types; - uint32_t cntr_types_1; - TALLOC_CTX *_mem_save_types_0; - TALLOC_CTX *_mem_save_types_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); - if (_ptr_rids) { - NDR_PULL_ALLOC(ndr, r->rids); - } else { - r->rids = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_types)); - if (_ptr_types) { - NDR_PULL_ALLOC(ndr, r->types); - } else { - r->types = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->rids) { - _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->rids)); - NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids)); - _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); - for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); - } - if (r->types) { - _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->types, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->types)); - NDR_PULL_ALLOC_N(ndr, r->types, ndr_get_array_size(ndr, &r->types)); - _mem_save_types_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->types, 0); - for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->types[cntr_types_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, 0); - } - if (r->rids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->count)); - } - if (r->types) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->types, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_RidTypeArray(struct ndr_print *ndr, const char *name, const struct samr_RidTypeArray *r) -{ - uint32_t cntr_rids_1; - uint32_t cntr_types_1; - ndr_print_struct(ndr, name, "samr_RidTypeArray"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "rids", r->rids); - ndr->depth++; - if (r->rids) { - ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->count); - ndr->depth++; - for (cntr_rids_1=0;cntr_rids_1count;cntr_rids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) { - ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr_print_ptr(ndr, "types", r->types); - ndr->depth++; - if (r->types) { - ndr->print(ndr, "%s: ARRAY(%d)", "types", (int)r->count); - ndr->depth++; - for (cntr_types_1=0;cntr_types_1count;cntr_types_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_types_1) != -1) { - ndr_print_uint32(ndr, "types", r->types[cntr_types_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_AliasInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_AliasInfoAll *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_AliasInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_AliasInfoAll *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_AliasInfoAll(struct ndr_print *ndr, const char *name, const struct samr_AliasInfoAll *r) -{ - ndr_print_struct(ndr, name, "samr_AliasInfoAll"); - ndr->depth++; - ndr_print_lsa_String(ndr, "name", &r->name); - ndr_print_uint32(ndr, "num_members", r->num_members); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_AliasInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_AliasInfoEnum r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_AliasInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_AliasInfoEnum *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_AliasInfoEnum(struct ndr_print *ndr, const char *name, enum samr_AliasInfoEnum r) -{ - const char *val = NULL; - - switch (r) { - case ALIASINFOALL: val = "ALIASINFOALL"; break; - case ALIASINFONAME: val = "ALIASINFONAME"; break; - case ALIASINFODESCRIPTION: val = "ALIASINFODESCRIPTION"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_samr_AliasInfo(struct ndr_push *ndr, int ndr_flags, const union samr_AliasInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, level)); - switch (level) { - case ALIASINFOALL: { - NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all)); - break; } - - case ALIASINFONAME: { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); - break; } - - case ALIASINFODESCRIPTION: { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case ALIASINFOALL: - NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all)); - break; - - case ALIASINFONAME: - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); - break; - - case ALIASINFODESCRIPTION: - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_AliasInfo(struct ndr_pull *ndr, int ndr_flags, union samr_AliasInfo *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case ALIASINFOALL: { - NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all)); - break; } - - case ALIASINFONAME: { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); - break; } - - case ALIASINFODESCRIPTION: { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case ALIASINFOALL: - NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all)); - break; - - case ALIASINFONAME: - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); - break; - - case ALIASINFODESCRIPTION: - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_AliasInfo(struct ndr_print *ndr, const char *name, const union samr_AliasInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "samr_AliasInfo"); - switch (level) { - case ALIASINFOALL: - ndr_print_samr_AliasInfoAll(ndr, "all", &r->all); - break; - - case ALIASINFONAME: - ndr_print_lsa_String(ndr, "name", &r->name); - break; - - case ALIASINFODESCRIPTION: - ndr_print_lsa_String(ndr, "description", &r->description); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_samr_UserInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo1(struct ndr_print *ndr, const char *name, const struct samr_UserInfo1 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo1"); - ndr->depth++; - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "full_name", &r->full_name); - ndr_print_uint32(ndr, "primary_gid", r->primary_gid); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr_print_lsa_String(ndr, "comment", &r->comment); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo2(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo2(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo2(struct ndr_print *ndr, const char *name, const struct samr_UserInfo2 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo2"); - ndr->depth++; - ndr_print_lsa_String(ndr, "comment", &r->comment); - ndr_print_lsa_String(ndr, "unknown", &r->unknown); - ndr_print_uint16(ndr, "country_code", r->country_code); - ndr_print_uint16(ndr, "code_page", r->code_page); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_LogonHours(struct ndr_push *ndr, int ndr_flags, const struct samr_LogonHours *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->units_per_week)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->bits)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->bits) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1260)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->units_per_week / 8)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->bits, r->units_per_week / 8)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_LogonHours(struct ndr_pull *ndr, int ndr_flags, struct samr_LogonHours *r) -{ - uint32_t _ptr_bits; - TALLOC_CTX *_mem_save_bits_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->units_per_week)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bits)); - if (_ptr_bits) { - NDR_PULL_ALLOC(ndr, r->bits); - } else { - r->bits = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->bits) { - _mem_save_bits_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->bits, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->bits)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->bits)); - if (ndr_get_array_length(ndr, &r->bits) > ndr_get_array_size(ndr, &r->bits)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->bits), ndr_get_array_length(ndr, &r->bits)); - } - NDR_PULL_ALLOC_N(ndr, r->bits, ndr_get_array_size(ndr, &r->bits)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->bits, ndr_get_array_length(ndr, &r->bits))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bits_0, 0); - } - if (r->bits) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->bits, 1260)); - } - if (r->bits) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->bits, r->units_per_week / 8)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_LogonHours(struct ndr_print *ndr, const char *name, const struct samr_LogonHours *r) -{ - ndr_print_struct(ndr, name, "samr_LogonHours"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint16(ndr, "units_per_week", r->units_per_week); - ndr_print_ptr(ndr, "bits", r->bits); - ndr->depth++; - if (r->bits) { - ndr_print_array_uint8(ndr, "bits", r->bits, r->units_per_week / 8); - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_samr_UserInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change)); - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change)); - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo3(struct ndr_print *ndr, const char *name, const struct samr_UserInfo3 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo3"); - ndr->depth++; - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "full_name", &r->full_name); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "primary_gid", r->primary_gid); - ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); - ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); - ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); - ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); - ndr_print_lsa_String(ndr, "workstations", &r->workstations); - ndr_print_NTTIME(ndr, "last_logon", r->last_logon); - ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); - ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); - ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change); - ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change); - ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); - ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); - ndr_print_uint16(ndr, "logon_count", r->logon_count); - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo4(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo4 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo4(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo4 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo4(struct ndr_print *ndr, const char *name, const struct samr_UserInfo4 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo4"); - ndr->depth++; - ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo5 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo5(struct ndr_print *ndr, const char *name, const struct samr_UserInfo5 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo5"); - ndr->depth++; - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "full_name", &r->full_name); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "primary_gid", r->primary_gid); - ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); - ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); - ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); - ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr_print_lsa_String(ndr, "workstations", &r->workstations); - ndr_print_NTTIME(ndr, "last_logon", r->last_logon); - ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); - ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); - ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); - ndr_print_uint16(ndr, "logon_count", r->logon_count); - ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); - ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo6 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo6 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo6(struct ndr_print *ndr, const char *name, const struct samr_UserInfo6 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo6"); - ndr->depth++; - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "full_name", &r->full_name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo7 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo7(struct ndr_print *ndr, const char *name, const struct samr_UserInfo7 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo7"); - ndr->depth++; - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo8 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo8 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo8(struct ndr_print *ndr, const char *name, const struct samr_UserInfo8 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo8"); - ndr->depth++; - ndr_print_lsa_String(ndr, "full_name", &r->full_name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo9 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo9 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo9(struct ndr_print *ndr, const char *name, const struct samr_UserInfo9 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo9"); - ndr->depth++; - ndr_print_uint32(ndr, "primary_gid", r->primary_gid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo10(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo10 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo10(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo10 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo10(struct ndr_print *ndr, const char *name, const struct samr_UserInfo10 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo10"); - ndr->depth++; - ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); - ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo11(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo11 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo11(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo11 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo11(struct ndr_print *ndr, const char *name, const struct samr_UserInfo11 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo11"); - ndr->depth++; - ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo12 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo12 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo12(struct ndr_print *ndr, const char *name, const struct samr_UserInfo12 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo12"); - ndr->depth++; - ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo13 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo13 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo13(struct ndr_print *ndr, const char *name, const struct samr_UserInfo13 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo13"); - ndr->depth++; - ndr_print_lsa_String(ndr, "description", &r->description); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo14(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo14 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo14(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo14 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo14(struct ndr_print *ndr, const char *name, const struct samr_UserInfo14 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo14"); - ndr->depth++; - ndr_print_lsa_String(ndr, "workstations", &r->workstations); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo16(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo16 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo16(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo16 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo16(struct ndr_print *ndr, const char *name, const struct samr_UserInfo16 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo16"); - ndr->depth++; - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo17(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo17 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo17(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo17 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo17(struct ndr_print *ndr, const char *name, const struct samr_UserInfo17 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo17"); - ndr->depth++; - ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_Password(struct ndr_push *ndr, int ndr_flags, const struct samr_Password *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_Password(struct ndr_pull *ndr, int ndr_flags, struct samr_Password *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Password(struct ndr_print *ndr, const char *name, const struct samr_Password *r) -{ - ndr_print_struct(ndr, name, "samr_Password"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "hash", r->hash, 16); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_samr_UserInfo18(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo18 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd)); - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_pwd_active)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_pwd_active)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo18(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo18 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd)); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_pwd_active)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_pwd_active)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo18(struct ndr_print *ndr, const char *name, const struct samr_UserInfo18 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo18"); - ndr->depth++; - ndr_print_samr_Password(ndr, "nt_pwd", &r->nt_pwd); - ndr_print_samr_Password(ndr, "lm_pwd", &r->lm_pwd); - ndr_print_uint8(ndr, "nt_pwd_active", r->nt_pwd_active); - ndr_print_uint8(ndr, "lm_pwd_active", r->lm_pwd_active); - ndr_print_uint8(ndr, "password_expired", r->password_expired); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo20(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo20 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo20(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo20 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo20(struct ndr_print *ndr, const char *name, const struct samr_UserInfo20 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo20"); - ndr->depth++; - ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_FieldsPresent(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_FieldsPresent(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_FieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCOUNT_NAME", SAMR_FIELD_ACCOUNT_NAME, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FULL_NAME", SAMR_FIELD_FULL_NAME, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_RID", SAMR_FIELD_RID, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIMARY_GID", SAMR_FIELD_PRIMARY_GID, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_DESCRIPTION", SAMR_FIELD_DESCRIPTION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COMMENT", SAMR_FIELD_COMMENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DIRECTORY", SAMR_FIELD_HOME_DIRECTORY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DRIVE", SAMR_FIELD_HOME_DRIVE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_SCRIPT", SAMR_FIELD_LOGON_SCRIPT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PROFILE_PATH", SAMR_FIELD_PROFILE_PATH, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_WORKSTATIONS", SAMR_FIELD_WORKSTATIONS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGON", SAMR_FIELD_LAST_LOGON, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGOFF", SAMR_FIELD_LAST_LOGOFF, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_HOURS", SAMR_FIELD_LOGON_HOURS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_BAD_PWD_COUNT", SAMR_FIELD_BAD_PWD_COUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_NUM_LOGONS", SAMR_FIELD_NUM_LOGONS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ALLOW_PWD_CHANGE", SAMR_FIELD_ALLOW_PWD_CHANGE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FORCE_PWD_CHANGE", SAMR_FIELD_FORCE_PWD_CHANGE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_PWD_CHANGE", SAMR_FIELD_LAST_PWD_CHANGE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_EXPIRY", SAMR_FIELD_ACCT_EXPIRY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_FLAGS", SAMR_FIELD_ACCT_FLAGS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PARAMETERS", SAMR_FIELD_PARAMETERS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COUNTRY_CODE", SAMR_FIELD_COUNTRY_CODE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_CODE_PAGE", SAMR_FIELD_CODE_PAGE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_NT_PASSWORD_PRESENT", SAMR_FIELD_NT_PASSWORD_PRESENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LM_PASSWORD_PRESENT", SAMR_FIELD_LM_PASSWORD_PRESENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIVATE_DATA", SAMR_FIELD_PRIVATE_DATA, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_EXPIRED_FLAG", SAMR_FIELD_EXPIRED_FLAG, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_SEC_DESC", SAMR_FIELD_SEC_DESC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_OWF_PWD", SAMR_FIELD_OWF_PWD, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo21(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo21 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->lm_owf_password)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->nt_owf_password)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); - NDR_CHECK(ndr_push_samr_FieldsPresent(ndr, NDR_SCALARS, r->fields_present)); - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_set)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_set)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->unknown4)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->lm_owf_password)); - NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->nt_owf_password)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - if (r->buffer) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->buf_count)); - } - NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo21(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo21 *r) -{ - uint32_t _ptr_buffer; - TALLOC_CTX *_mem_save_buffer_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->lm_owf_password)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->nt_owf_password)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); - if (_ptr_buffer) { - NDR_PULL_ALLOC(ndr, r->buffer); - } else { - r->buffer = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); - NDR_CHECK(ndr_pull_samr_FieldsPresent(ndr, NDR_SCALARS, &r->fields_present)); - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_set)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_set)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown4)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->lm_owf_password)); - NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->nt_owf_password)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); - if (r->buffer) { - _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer)); - NDR_PULL_ALLOC_N(ndr, r->buffer, ndr_get_array_size(ndr, &r->buffer)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, ndr_get_array_size(ndr, &r->buffer))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); - } - NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); - if (r->buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->buf_count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo21(struct ndr_print *ndr, const char *name, const struct samr_UserInfo21 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo21"); - ndr->depth++; - ndr_print_NTTIME(ndr, "last_logon", r->last_logon); - ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); - ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); - ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); - ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change); - ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change); - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "full_name", &r->full_name); - ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); - ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); - ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); - ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr_print_lsa_String(ndr, "workstations", &r->workstations); - ndr_print_lsa_String(ndr, "comment", &r->comment); - ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters); - ndr_print_lsa_BinaryString(ndr, "lm_owf_password", &r->lm_owf_password); - ndr_print_lsa_BinaryString(ndr, "nt_owf_password", &r->nt_owf_password); - ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); - ndr_print_uint32(ndr, "buf_count", r->buf_count); - ndr_print_ptr(ndr, "buffer", r->buffer); - ndr->depth++; - if (r->buffer) { - ndr_print_array_uint8(ndr, "buffer", r->buffer, r->buf_count); - } - ndr->depth--; - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "primary_gid", r->primary_gid); - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); - ndr_print_samr_FieldsPresent(ndr, "fields_present", r->fields_present); - ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); - ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); - ndr_print_uint16(ndr, "logon_count", r->logon_count); - ndr_print_uint16(ndr, "country_code", r->country_code); - ndr_print_uint16(ndr, "code_page", r->code_page); - ndr_print_uint8(ndr, "lm_password_set", r->lm_password_set); - ndr_print_uint8(ndr, "nt_password_set", r->nt_password_set); - ndr_print_uint8(ndr, "password_expired", r->password_expired); - ndr_print_uint8(ndr, "unknown4", r->unknown4); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPassword *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 516)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPassword *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 516)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_CryptPassword(struct ndr_print *ndr, const char *name, const struct samr_CryptPassword *r) -{ - ndr_print_struct(ndr, name, "samr_CryptPassword"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "data", r->data, 516); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_samr_UserInfo23(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo23 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo23(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo23 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo23(struct ndr_print *ndr, const char *name, const struct samr_UserInfo23 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo23"); - ndr->depth++; - ndr_print_samr_UserInfo21(ndr, "info", &r->info); - ndr_print_samr_CryptPassword(ndr, "password", &r->password); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo24(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo24 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo24(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo24 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo24(struct ndr_print *ndr, const char *name, const struct samr_UserInfo24 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo24"); - ndr->depth++; - ndr_print_samr_CryptPassword(ndr, "password", &r->password); - ndr_print_uint8(ndr, "password_expired", r->password_expired); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_CryptPasswordEx(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPasswordEx *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 532)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_CryptPasswordEx(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPasswordEx *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 532)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_CryptPasswordEx(struct ndr_print *ndr, const char *name, const struct samr_CryptPasswordEx *r) -{ - ndr_print_struct(ndr, name, "samr_CryptPasswordEx"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "data", r->data, 532); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_samr_UserInfo25(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo25 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_push_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo25(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo25 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_pull_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo25(struct ndr_print *ndr, const char *name, const struct samr_UserInfo25 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo25"); - ndr->depth++; - ndr_print_samr_UserInfo21(ndr, "info", &r->info); - ndr_print_samr_CryptPasswordEx(ndr, "password", &r->password); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo26(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo26 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo26(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo26 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo26(struct ndr_print *ndr, const char *name, const struct samr_UserInfo26 *r) -{ - ndr_print_struct(ndr, name, "samr_UserInfo26"); - ndr->depth++; - ndr_print_samr_CryptPasswordEx(ndr, "password", &r->password); - ndr_print_uint8(ndr, "password_expired", r->password_expired); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_UserInfo(struct ndr_push *ndr, int ndr_flags, const union samr_UserInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_samr_UserInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_samr_UserInfo2(ndr, NDR_SCALARS, &r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_samr_UserInfo3(ndr, NDR_SCALARS, &r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_push_samr_UserInfo4(ndr, NDR_SCALARS, &r->info4)); - break; } - - case 5: { - NDR_CHECK(ndr_push_samr_UserInfo5(ndr, NDR_SCALARS, &r->info5)); - break; } - - case 6: { - NDR_CHECK(ndr_push_samr_UserInfo6(ndr, NDR_SCALARS, &r->info6)); - break; } - - case 7: { - NDR_CHECK(ndr_push_samr_UserInfo7(ndr, NDR_SCALARS, &r->info7)); - break; } - - case 8: { - NDR_CHECK(ndr_push_samr_UserInfo8(ndr, NDR_SCALARS, &r->info8)); - break; } - - case 9: { - NDR_CHECK(ndr_push_samr_UserInfo9(ndr, NDR_SCALARS, &r->info9)); - break; } - - case 10: { - NDR_CHECK(ndr_push_samr_UserInfo10(ndr, NDR_SCALARS, &r->info10)); - break; } - - case 11: { - NDR_CHECK(ndr_push_samr_UserInfo11(ndr, NDR_SCALARS, &r->info11)); - break; } - - case 12: { - NDR_CHECK(ndr_push_samr_UserInfo12(ndr, NDR_SCALARS, &r->info12)); - break; } - - case 13: { - NDR_CHECK(ndr_push_samr_UserInfo13(ndr, NDR_SCALARS, &r->info13)); - break; } - - case 14: { - NDR_CHECK(ndr_push_samr_UserInfo14(ndr, NDR_SCALARS, &r->info14)); - break; } - - case 16: { - NDR_CHECK(ndr_push_samr_UserInfo16(ndr, NDR_SCALARS, &r->info16)); - break; } - - case 17: { - NDR_CHECK(ndr_push_samr_UserInfo17(ndr, NDR_SCALARS, &r->info17)); - break; } - - case 18: { - NDR_CHECK(ndr_push_samr_UserInfo18(ndr, NDR_SCALARS, &r->info18)); - break; } - - case 20: { - NDR_CHECK(ndr_push_samr_UserInfo20(ndr, NDR_SCALARS, &r->info20)); - break; } - - case 21: { - NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info21)); - break; } - - case 23: { - NDR_CHECK(ndr_push_samr_UserInfo23(ndr, NDR_SCALARS, &r->info23)); - break; } - - case 24: { - NDR_CHECK(ndr_push_samr_UserInfo24(ndr, NDR_SCALARS, &r->info24)); - break; } - - case 25: { - NDR_CHECK(ndr_push_samr_UserInfo25(ndr, NDR_SCALARS, &r->info25)); - break; } - - case 26: { - NDR_CHECK(ndr_push_samr_UserInfo26(ndr, NDR_SCALARS, &r->info26)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_samr_UserInfo1(ndr, NDR_BUFFERS, &r->info1)); - break; - - case 2: - NDR_CHECK(ndr_push_samr_UserInfo2(ndr, NDR_BUFFERS, &r->info2)); - break; - - case 3: - NDR_CHECK(ndr_push_samr_UserInfo3(ndr, NDR_BUFFERS, &r->info3)); - break; - - case 4: - NDR_CHECK(ndr_push_samr_UserInfo4(ndr, NDR_BUFFERS, &r->info4)); - break; - - case 5: - NDR_CHECK(ndr_push_samr_UserInfo5(ndr, NDR_BUFFERS, &r->info5)); - break; - - case 6: - NDR_CHECK(ndr_push_samr_UserInfo6(ndr, NDR_BUFFERS, &r->info6)); - break; - - case 7: - NDR_CHECK(ndr_push_samr_UserInfo7(ndr, NDR_BUFFERS, &r->info7)); - break; - - case 8: - NDR_CHECK(ndr_push_samr_UserInfo8(ndr, NDR_BUFFERS, &r->info8)); - break; - - case 9: - break; - - case 10: - NDR_CHECK(ndr_push_samr_UserInfo10(ndr, NDR_BUFFERS, &r->info10)); - break; - - case 11: - NDR_CHECK(ndr_push_samr_UserInfo11(ndr, NDR_BUFFERS, &r->info11)); - break; - - case 12: - NDR_CHECK(ndr_push_samr_UserInfo12(ndr, NDR_BUFFERS, &r->info12)); - break; - - case 13: - NDR_CHECK(ndr_push_samr_UserInfo13(ndr, NDR_BUFFERS, &r->info13)); - break; - - case 14: - NDR_CHECK(ndr_push_samr_UserInfo14(ndr, NDR_BUFFERS, &r->info14)); - break; - - case 16: - break; - - case 17: - break; - - case 18: - break; - - case 20: - NDR_CHECK(ndr_push_samr_UserInfo20(ndr, NDR_BUFFERS, &r->info20)); - break; - - case 21: - NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info21)); - break; - - case 23: - NDR_CHECK(ndr_push_samr_UserInfo23(ndr, NDR_BUFFERS, &r->info23)); - break; - - case 24: - break; - - case 25: - NDR_CHECK(ndr_push_samr_UserInfo25(ndr, NDR_BUFFERS, &r->info25)); - break; - - case 26: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_UserInfo(struct ndr_pull *ndr, int ndr_flags, union samr_UserInfo *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_samr_UserInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_samr_UserInfo2(ndr, NDR_SCALARS, &r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_pull_samr_UserInfo3(ndr, NDR_SCALARS, &r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_pull_samr_UserInfo4(ndr, NDR_SCALARS, &r->info4)); - break; } - - case 5: { - NDR_CHECK(ndr_pull_samr_UserInfo5(ndr, NDR_SCALARS, &r->info5)); - break; } - - case 6: { - NDR_CHECK(ndr_pull_samr_UserInfo6(ndr, NDR_SCALARS, &r->info6)); - break; } - - case 7: { - NDR_CHECK(ndr_pull_samr_UserInfo7(ndr, NDR_SCALARS, &r->info7)); - break; } - - case 8: { - NDR_CHECK(ndr_pull_samr_UserInfo8(ndr, NDR_SCALARS, &r->info8)); - break; } - - case 9: { - NDR_CHECK(ndr_pull_samr_UserInfo9(ndr, NDR_SCALARS, &r->info9)); - break; } - - case 10: { - NDR_CHECK(ndr_pull_samr_UserInfo10(ndr, NDR_SCALARS, &r->info10)); - break; } - - case 11: { - NDR_CHECK(ndr_pull_samr_UserInfo11(ndr, NDR_SCALARS, &r->info11)); - break; } - - case 12: { - NDR_CHECK(ndr_pull_samr_UserInfo12(ndr, NDR_SCALARS, &r->info12)); - break; } - - case 13: { - NDR_CHECK(ndr_pull_samr_UserInfo13(ndr, NDR_SCALARS, &r->info13)); - break; } - - case 14: { - NDR_CHECK(ndr_pull_samr_UserInfo14(ndr, NDR_SCALARS, &r->info14)); - break; } - - case 16: { - NDR_CHECK(ndr_pull_samr_UserInfo16(ndr, NDR_SCALARS, &r->info16)); - break; } - - case 17: { - NDR_CHECK(ndr_pull_samr_UserInfo17(ndr, NDR_SCALARS, &r->info17)); - break; } - - case 18: { - NDR_CHECK(ndr_pull_samr_UserInfo18(ndr, NDR_SCALARS, &r->info18)); - break; } - - case 20: { - NDR_CHECK(ndr_pull_samr_UserInfo20(ndr, NDR_SCALARS, &r->info20)); - break; } - - case 21: { - NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info21)); - break; } - - case 23: { - NDR_CHECK(ndr_pull_samr_UserInfo23(ndr, NDR_SCALARS, &r->info23)); - break; } - - case 24: { - NDR_CHECK(ndr_pull_samr_UserInfo24(ndr, NDR_SCALARS, &r->info24)); - break; } - - case 25: { - NDR_CHECK(ndr_pull_samr_UserInfo25(ndr, NDR_SCALARS, &r->info25)); - break; } - - case 26: { - NDR_CHECK(ndr_pull_samr_UserInfo26(ndr, NDR_SCALARS, &r->info26)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_samr_UserInfo1(ndr, NDR_BUFFERS, &r->info1)); - break; - - case 2: - NDR_CHECK(ndr_pull_samr_UserInfo2(ndr, NDR_BUFFERS, &r->info2)); - break; - - case 3: - NDR_CHECK(ndr_pull_samr_UserInfo3(ndr, NDR_BUFFERS, &r->info3)); - break; - - case 4: - NDR_CHECK(ndr_pull_samr_UserInfo4(ndr, NDR_BUFFERS, &r->info4)); - break; - - case 5: - NDR_CHECK(ndr_pull_samr_UserInfo5(ndr, NDR_BUFFERS, &r->info5)); - break; - - case 6: - NDR_CHECK(ndr_pull_samr_UserInfo6(ndr, NDR_BUFFERS, &r->info6)); - break; - - case 7: - NDR_CHECK(ndr_pull_samr_UserInfo7(ndr, NDR_BUFFERS, &r->info7)); - break; - - case 8: - NDR_CHECK(ndr_pull_samr_UserInfo8(ndr, NDR_BUFFERS, &r->info8)); - break; - - case 9: - break; - - case 10: - NDR_CHECK(ndr_pull_samr_UserInfo10(ndr, NDR_BUFFERS, &r->info10)); - break; - - case 11: - NDR_CHECK(ndr_pull_samr_UserInfo11(ndr, NDR_BUFFERS, &r->info11)); - break; - - case 12: - NDR_CHECK(ndr_pull_samr_UserInfo12(ndr, NDR_BUFFERS, &r->info12)); - break; - - case 13: - NDR_CHECK(ndr_pull_samr_UserInfo13(ndr, NDR_BUFFERS, &r->info13)); - break; - - case 14: - NDR_CHECK(ndr_pull_samr_UserInfo14(ndr, NDR_BUFFERS, &r->info14)); - break; - - case 16: - break; - - case 17: - break; - - case 18: - break; - - case 20: - NDR_CHECK(ndr_pull_samr_UserInfo20(ndr, NDR_BUFFERS, &r->info20)); - break; - - case 21: - NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info21)); - break; - - case 23: - NDR_CHECK(ndr_pull_samr_UserInfo23(ndr, NDR_BUFFERS, &r->info23)); - break; - - case 24: - break; - - case 25: - NDR_CHECK(ndr_pull_samr_UserInfo25(ndr, NDR_BUFFERS, &r->info25)); - break; - - case 26: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_UserInfo(struct ndr_print *ndr, const char *name, const union samr_UserInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "samr_UserInfo"); - switch (level) { - case 1: - ndr_print_samr_UserInfo1(ndr, "info1", &r->info1); - break; - - case 2: - ndr_print_samr_UserInfo2(ndr, "info2", &r->info2); - break; - - case 3: - ndr_print_samr_UserInfo3(ndr, "info3", &r->info3); - break; - - case 4: - ndr_print_samr_UserInfo4(ndr, "info4", &r->info4); - break; - - case 5: - ndr_print_samr_UserInfo5(ndr, "info5", &r->info5); - break; - - case 6: - ndr_print_samr_UserInfo6(ndr, "info6", &r->info6); - break; - - case 7: - ndr_print_samr_UserInfo7(ndr, "info7", &r->info7); - break; - - case 8: - ndr_print_samr_UserInfo8(ndr, "info8", &r->info8); - break; - - case 9: - ndr_print_samr_UserInfo9(ndr, "info9", &r->info9); - break; - - case 10: - ndr_print_samr_UserInfo10(ndr, "info10", &r->info10); - break; - - case 11: - ndr_print_samr_UserInfo11(ndr, "info11", &r->info11); - break; - - case 12: - ndr_print_samr_UserInfo12(ndr, "info12", &r->info12); - break; - - case 13: - ndr_print_samr_UserInfo13(ndr, "info13", &r->info13); - break; - - case 14: - ndr_print_samr_UserInfo14(ndr, "info14", &r->info14); - break; - - case 16: - ndr_print_samr_UserInfo16(ndr, "info16", &r->info16); - break; - - case 17: - ndr_print_samr_UserInfo17(ndr, "info17", &r->info17); - break; - - case 18: - ndr_print_samr_UserInfo18(ndr, "info18", &r->info18); - break; - - case 20: - ndr_print_samr_UserInfo20(ndr, "info20", &r->info20); - break; - - case 21: - ndr_print_samr_UserInfo21(ndr, "info21", &r->info21); - break; - - case 23: - ndr_print_samr_UserInfo23(ndr, "info23", &r->info23); - break; - - case 24: - ndr_print_samr_UserInfo24(ndr, "info24", &r->info24); - break; - - case 25: - ndr_print_samr_UserInfo25(ndr, "info25", &r->info25); - break; - - case 26: - ndr_print_samr_UserInfo26(ndr, "info26", &r->info26); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_RidWithAttribute(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_RidWithAttribute(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_RidWithAttribute(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttribute *r) -{ - ndr_print_struct(ndr, name, "samr_RidWithAttribute"); - ndr->depth++; - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_RidWithAttributeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttributeArray *r) -{ - uint32_t cntr_rids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->rids) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { - NDR_CHECK(ndr_push_samr_RidWithAttribute(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_RidWithAttributeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttributeArray *r) -{ - uint32_t _ptr_rids; - uint32_t cntr_rids_1; - TALLOC_CTX *_mem_save_rids_0; - TALLOC_CTX *_mem_save_rids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); - if (_ptr_rids) { - NDR_PULL_ALLOC(ndr, r->rids); - } else { - r->rids = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->rids) { - _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->rids)); - NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids)); - _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); - for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { - NDR_CHECK(ndr_pull_samr_RidWithAttribute(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); - } - if (r->rids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_RidWithAttributeArray(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttributeArray *r) -{ - uint32_t cntr_rids_1; - ndr_print_struct(ndr, name, "samr_RidWithAttributeArray"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "rids", r->rids); - ndr->depth++; - if (r->rids) { - ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->count); - ndr->depth++; - for (cntr_rids_1=0;cntr_rids_1count;cntr_rids_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) { - ndr_print_samr_RidWithAttribute(ndr, "rids", &r->rids[cntr_rids_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DispEntryGeneral(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryGeneral *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DispEntryGeneral(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryGeneral *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DispEntryGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispEntryGeneral *r) -{ - ndr_print_struct(ndr, name, "samr_DispEntryGeneral"); - ndr->depth++; - ndr_print_uint32(ndr, "idx", r->idx); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr_print_lsa_String(ndr, "full_name", &r->full_name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DispInfoGeneral(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoGeneral *r) -{ - uint32_t cntr_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_DispEntryGeneral(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_DispEntryGeneral(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DispInfoGeneral(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoGeneral *r) -{ - uint32_t _ptr_entries; - uint32_t cntr_entries_1; - TALLOC_CTX *_mem_save_entries_0; - TALLOC_CTX *_mem_save_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); - if (_ptr_entries) { - NDR_PULL_ALLOC(ndr, r->entries); - } else { - r->entries = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); - NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); - _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_DispEntryGeneral(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_DispEntryGeneral(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - } - if (r->entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DispInfoGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispInfoGeneral *r) -{ - uint32_t cntr_entries_1; - ndr_print_struct(ndr, name, "samr_DispInfoGeneral"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "entries", r->entries); - ndr->depth++; - if (r->entries) { - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); - ndr->depth++; - for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { - ndr_print_samr_DispEntryGeneral(ndr, "entries", &r->entries[cntr_entries_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DispEntryFull(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryFull *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DispEntryFull(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryFull *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DispEntryFull(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFull *r) -{ - ndr_print_struct(ndr, name, "samr_DispEntryFull"); - ndr->depth++; - ndr_print_uint32(ndr, "idx", r->idx); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DispInfoFull(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoFull *r) -{ - uint32_t cntr_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_DispEntryFull(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_DispEntryFull(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DispInfoFull(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoFull *r) -{ - uint32_t _ptr_entries; - uint32_t cntr_entries_1; - TALLOC_CTX *_mem_save_entries_0; - TALLOC_CTX *_mem_save_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); - if (_ptr_entries) { - NDR_PULL_ALLOC(ndr, r->entries); - } else { - r->entries = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); - NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); - _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_DispEntryFull(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_DispEntryFull(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - } - if (r->entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DispInfoFull(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFull *r) -{ - uint32_t cntr_entries_1; - ndr_print_struct(ndr, name, "samr_DispInfoFull"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "entries", r->entries); - ndr->depth++; - if (r->entries) { - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); - ndr->depth++; - for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { - ndr_print_samr_DispEntryFull(ndr, "entries", &r->entries[cntr_entries_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DispEntryFullGroup(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryFullGroup *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->acct_flags)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DispEntryFullGroup(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryFullGroup *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); - NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->acct_flags)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DispEntryFullGroup(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFullGroup *r) -{ - ndr_print_struct(ndr, name, "samr_DispEntryFullGroup"); - ndr->depth++; - ndr_print_uint32(ndr, "idx", r->idx); - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_samr_GroupAttrs(ndr, "acct_flags", r->acct_flags); - ndr_print_lsa_String(ndr, "account_name", &r->account_name); - ndr_print_lsa_String(ndr, "description", &r->description); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DispInfoFullGroups(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoFullGroups *r) -{ - uint32_t cntr_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_DispEntryFullGroup(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_DispEntryFullGroup(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DispInfoFullGroups(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoFullGroups *r) -{ - uint32_t _ptr_entries; - uint32_t cntr_entries_1; - TALLOC_CTX *_mem_save_entries_0; - TALLOC_CTX *_mem_save_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); - if (_ptr_entries) { - NDR_PULL_ALLOC(ndr, r->entries); - } else { - r->entries = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); - NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); - _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_DispEntryFullGroup(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_DispEntryFullGroup(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - } - if (r->entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DispInfoFullGroups(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFullGroups *r) -{ - uint32_t cntr_entries_1; - ndr_print_struct(ndr, name, "samr_DispInfoFullGroups"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "entries", r->entries); - ndr->depth++; - if (r->entries) { - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); - ndr->depth++; - for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { - ndr_print_samr_DispEntryFullGroup(ndr, "entries", &r->entries[cntr_entries_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DispEntryAscii(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryAscii *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); - NDR_CHECK(ndr_push_lsa_AsciiStringLarge(ndr, NDR_SCALARS, &r->account_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_lsa_AsciiStringLarge(ndr, NDR_BUFFERS, &r->account_name)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DispEntryAscii(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryAscii *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); - NDR_CHECK(ndr_pull_lsa_AsciiStringLarge(ndr, NDR_SCALARS, &r->account_name)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_lsa_AsciiStringLarge(ndr, NDR_BUFFERS, &r->account_name)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DispEntryAscii(struct ndr_print *ndr, const char *name, const struct samr_DispEntryAscii *r) -{ - ndr_print_struct(ndr, name, "samr_DispEntryAscii"); - ndr->depth++; - ndr_print_uint32(ndr, "idx", r->idx); - ndr_print_lsa_AsciiStringLarge(ndr, "account_name", &r->account_name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DispInfoAscii(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoAscii *r) -{ - uint32_t cntr_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_DispEntryAscii(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_push_samr_DispEntryAscii(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DispInfoAscii(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoAscii *r) -{ - uint32_t _ptr_entries; - uint32_t cntr_entries_1; - TALLOC_CTX *_mem_save_entries_0; - TALLOC_CTX *_mem_save_entries_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); - if (_ptr_entries) { - NDR_PULL_ALLOC(ndr, r->entries); - } else { - r->entries = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->entries) { - _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); - NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); - _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_DispEntryAscii(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); - } - for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { - NDR_CHECK(ndr_pull_samr_DispEntryAscii(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); - } - if (r->entries) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DispInfoAscii(struct ndr_print *ndr, const char *name, const struct samr_DispInfoAscii *r) -{ - uint32_t cntr_entries_1; - ndr_print_struct(ndr, name, "samr_DispInfoAscii"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "entries", r->entries); - ndr->depth++; - if (r->entries) { - ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count); - ndr->depth++; - for (cntr_entries_1=0;cntr_entries_1count;cntr_entries_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { - ndr_print_samr_DispEntryAscii(ndr, "entries", &r->entries[cntr_entries_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DispInfo(struct ndr_push *ndr, int ndr_flags, const union samr_DispInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_samr_DispInfoGeneral(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_samr_DispInfoFull(ndr, NDR_SCALARS, &r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_samr_DispInfoFullGroups(ndr, NDR_SCALARS, &r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info4)); - break; } - - case 5: { - NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info5)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_samr_DispInfoGeneral(ndr, NDR_BUFFERS, &r->info1)); - break; - - case 2: - NDR_CHECK(ndr_push_samr_DispInfoFull(ndr, NDR_BUFFERS, &r->info2)); - break; - - case 3: - NDR_CHECK(ndr_push_samr_DispInfoFullGroups(ndr, NDR_BUFFERS, &r->info3)); - break; - - case 4: - NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info4)); - break; - - case 5: - NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info5)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DispInfo(struct ndr_pull *ndr, int ndr_flags, union samr_DispInfo *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_samr_DispInfoGeneral(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_samr_DispInfoFull(ndr, NDR_SCALARS, &r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_pull_samr_DispInfoFullGroups(ndr, NDR_SCALARS, &r->info3)); - break; } - - case 4: { - NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info4)); - break; } - - case 5: { - NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info5)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_samr_DispInfoGeneral(ndr, NDR_BUFFERS, &r->info1)); - break; - - case 2: - NDR_CHECK(ndr_pull_samr_DispInfoFull(ndr, NDR_BUFFERS, &r->info2)); - break; - - case 3: - NDR_CHECK(ndr_pull_samr_DispInfoFullGroups(ndr, NDR_BUFFERS, &r->info3)); - break; - - case 4: - NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info4)); - break; - - case 5: - NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info5)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DispInfo(struct ndr_print *ndr, const char *name, const union samr_DispInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "samr_DispInfo"); - switch (level) { - case 1: - ndr_print_samr_DispInfoGeneral(ndr, "info1", &r->info1); - break; - - case 2: - ndr_print_samr_DispInfoFull(ndr, "info2", &r->info2); - break; - - case 3: - ndr_print_samr_DispInfoFullGroups(ndr, "info3", &r->info3); - break; - - case 4: - ndr_print_samr_DispInfoAscii(ndr, "info4", &r->info4); - break; - - case 5: - ndr_print_samr_DispInfoAscii(ndr, "info5", &r->info5); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_samr_PwInfo(struct ndr_push *ndr, int ndr_flags, const struct samr_PwInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length)); - NDR_CHECK(ndr_push_samr_PasswordProperties(ndr, NDR_SCALARS, r->password_properties)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_PwInfo(struct ndr_pull *ndr, int ndr_flags, struct samr_PwInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length)); - NDR_CHECK(ndr_pull_samr_PasswordProperties(ndr, NDR_SCALARS, &r->password_properties)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_PwInfo(struct ndr_print *ndr, const char *name, const struct samr_PwInfo *r) -{ - ndr_print_struct(ndr, name, "samr_PwInfo"); - ndr->depth++; - ndr_print_uint16(ndr, "min_password_length", r->min_password_length); - ndr_print_samr_PasswordProperties(ndr, "password_properties", r->password_properties); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ConnectVersion(struct ndr_push *ndr, int ndr_flags, enum samr_ConnectVersion r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ConnectVersion(struct ndr_pull *ndr, int ndr_flags, enum samr_ConnectVersion *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ConnectVersion(struct ndr_print *ndr, const char *name, enum samr_ConnectVersion r) -{ - const char *val = NULL; - - switch (r) { - case SAMR_CONNECT_PRE_W2K: val = "SAMR_CONNECT_PRE_W2K"; break; - case SAMR_CONNECT_W2K: val = "SAMR_CONNECT_W2K"; break; - case SAMR_CONNECT_AFTER_W2K: val = "SAMR_CONNECT_AFTER_W2K"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_samr_ChangeReject(struct ndr_push *ndr, int ndr_flags, const struct samr_ChangeReject *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_samr_RejectReason(ndr, NDR_SCALARS, r->reason)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ChangeReject(struct ndr_pull *ndr, int ndr_flags, struct samr_ChangeReject *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_samr_RejectReason(ndr, NDR_SCALARS, &r->reason)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ChangeReject(struct ndr_print *ndr, const char *name, const struct samr_ChangeReject *r) -{ - ndr_print_struct(ndr, name, "samr_ChangeReject"); - ndr->depth++; - ndr_print_samr_RejectReason(ndr, "reason", r->reason); - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ConnectInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_ConnectInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_samr_ConnectVersion(ndr, NDR_SCALARS, r->client_version)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ConnectInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_ConnectInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_samr_ConnectVersion(ndr, NDR_SCALARS, &r->client_version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ConnectInfo1(struct ndr_print *ndr, const char *name, const struct samr_ConnectInfo1 *r) -{ - ndr_print_struct(ndr, name, "samr_ConnectInfo1"); - ndr->depth++; - ndr_print_samr_ConnectVersion(ndr, "client_version", r->client_version); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ConnectInfo(struct ndr_push *ndr, int ndr_flags, const union samr_ConnectInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_samr_ConnectInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ConnectInfo(struct ndr_pull *ndr, int ndr_flags, union samr_ConnectInfo *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_samr_ConnectInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ConnectInfo(struct ndr_print *ndr, const char *name, const union samr_ConnectInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "samr_ConnectInfo"); - switch (level) { - case 1: - ndr_print_samr_ConnectInfo1(ndr, "info1", &r->info1); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_samr_ValidateFieldsPresent(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidateFieldsPresent(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidateFieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET", SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME", SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_LOCKOUT_TIME", SAMR_VALIDATE_FIELD_LOCKOUT_TIME, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT", SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH", SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY", SAMR_VALIDATE_FIELD_PASSWORD_HISTORY, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ValidatePasswordLevel(struct ndr_push *ndr, int ndr_flags, enum samr_ValidatePasswordLevel r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidatePasswordLevel(struct ndr_pull *ndr, int ndr_flags, enum samr_ValidatePasswordLevel *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidatePasswordLevel(struct ndr_print *ndr, const char *name, enum samr_ValidatePasswordLevel r) -{ - const char *val = NULL; - - switch (r) { - case NetValidateAuthentication: val = "NetValidateAuthentication"; break; - case NetValidatePasswordChange: val = "NetValidatePasswordChange"; break; - case NetValidatePasswordReset: val = "NetValidatePasswordReset"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_samr_ValidationStatus(struct ndr_push *ndr, int ndr_flags, enum samr_ValidationStatus r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidationStatus(struct ndr_pull *ndr, int ndr_flags, enum samr_ValidationStatus *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidationStatus(struct ndr_print *ndr, const char *name, enum samr_ValidationStatus r) -{ - const char *val = NULL; - - switch (r) { - case SAMR_VALIDATION_STATUS_SUCCESS: val = "SAMR_VALIDATION_STATUS_SUCCESS"; break; - case SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE: val = "SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE"; break; - case SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT: val = "SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT"; break; - case SAMR_VALIDATION_STATUS_BAD_PASSWORD: val = "SAMR_VALIDATION_STATUS_BAD_PASSWORD"; break; - case SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT: val = "SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT"; break; - case SAMR_VALIDATION_STATUS_PWD_TOO_SHORT: val = "SAMR_VALIDATION_STATUS_PWD_TOO_SHORT"; break; - case SAMR_VALIDATION_STATUS_PWD_TOO_LONG: val = "SAMR_VALIDATION_STATUS_PWD_TOO_LONG"; break; - case SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH: val = "SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH"; break; - case SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT: val = "SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_samr_ValidationBlob(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidationBlob *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidationBlob(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidationBlob *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidationBlob(struct ndr_print *ndr, const char *name, const struct samr_ValidationBlob *r) -{ - ndr_print_struct(ndr, name, "samr_ValidationBlob"); - ndr->depth++; - ndr_print_uint32(ndr, "length", r->length); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->length); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ValidatePasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordInfo *r) -{ - uint32_t cntr_pwd_history_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_samr_ValidateFieldsPresent(ndr, NDR_SCALARS, r->fields_present)); - NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->last_password_change)); - NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->bad_password_time)); - NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->lockout_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_pwd_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pwd_history_len)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->pwd_history)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->pwd_history) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pwd_history_len)); - for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { - NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_SCALARS, &r->pwd_history[cntr_pwd_history_1])); - } - for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { - NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->pwd_history[cntr_pwd_history_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidatePasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordInfo *r) -{ - uint32_t _ptr_pwd_history; - uint32_t cntr_pwd_history_1; - TALLOC_CTX *_mem_save_pwd_history_0; - TALLOC_CTX *_mem_save_pwd_history_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_samr_ValidateFieldsPresent(ndr, NDR_SCALARS, &r->fields_present)); - NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->last_password_change)); - NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->bad_password_time)); - NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->lockout_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_pwd_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pwd_history_len)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pwd_history)); - if (_ptr_pwd_history) { - NDR_PULL_ALLOC(ndr, r->pwd_history); - } else { - r->pwd_history = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->pwd_history) { - _mem_save_pwd_history_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->pwd_history, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->pwd_history)); - NDR_PULL_ALLOC_N(ndr, r->pwd_history, ndr_get_array_size(ndr, &r->pwd_history)); - _mem_save_pwd_history_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->pwd_history, 0); - for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { - NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_SCALARS, &r->pwd_history[cntr_pwd_history_1])); - } - for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { - NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->pwd_history[cntr_pwd_history_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pwd_history_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pwd_history_0, 0); - } - if (r->pwd_history) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->pwd_history, r->pwd_history_len)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidatePasswordInfo(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordInfo *r) -{ - uint32_t cntr_pwd_history_1; - ndr_print_struct(ndr, name, "samr_ValidatePasswordInfo"); - ndr->depth++; - ndr_print_samr_ValidateFieldsPresent(ndr, "fields_present", r->fields_present); - ndr_print_NTTIME_hyper(ndr, "last_password_change", r->last_password_change); - ndr_print_NTTIME_hyper(ndr, "bad_password_time", r->bad_password_time); - ndr_print_NTTIME_hyper(ndr, "lockout_time", r->lockout_time); - ndr_print_uint32(ndr, "bad_pwd_count", r->bad_pwd_count); - ndr_print_uint32(ndr, "pwd_history_len", r->pwd_history_len); - ndr_print_ptr(ndr, "pwd_history", r->pwd_history); - ndr->depth++; - if (r->pwd_history) { - ndr->print(ndr, "%s: ARRAY(%d)", "pwd_history", (int)r->pwd_history_len); - ndr->depth++; - for (cntr_pwd_history_1=0;cntr_pwd_history_1pwd_history_len;cntr_pwd_history_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_pwd_history_1) != -1) { - ndr_print_samr_ValidationBlob(ndr, "pwd_history", &r->pwd_history[cntr_pwd_history_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ValidatePasswordRepCtr(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordRepCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_push_samr_ValidationStatus(ndr, NDR_SCALARS, r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidatePasswordRepCtr(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordRepCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_pull_samr_ValidationStatus(ndr, NDR_SCALARS, &r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidatePasswordRepCtr(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordRepCtr *r) -{ - ndr_print_struct(ndr, name, "samr_ValidatePasswordRepCtr"); - ndr->depth++; - ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); - ndr_print_samr_ValidationStatus(ndr, "status", r->status); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ValidatePasswordRep(struct ndr_push *ndr, int ndr_flags, const union samr_ValidatePasswordRep *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr3)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - case 2: - NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr2)); - break; - - case 3: - NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr3)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidatePasswordRep(struct ndr_pull *ndr, int ndr_flags, union samr_ValidatePasswordRep *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr2)); - break; } - - case 3: { - NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr3)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr1)); - break; - - case 2: - NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr2)); - break; - - case 3: - NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr3)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidatePasswordRep(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordRep *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "samr_ValidatePasswordRep"); - switch (level) { - case 1: - ndr_print_samr_ValidatePasswordRepCtr(ndr, "ctr1", &r->ctr1); - break; - - case 2: - ndr_print_samr_ValidatePasswordRepCtr(ndr, "ctr2", &r->ctr2); - break; - - case 3: - ndr_print_samr_ValidatePasswordRepCtr(ndr, "ctr3", &r->ctr3); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_samr_ValidatePasswordReq3(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordReq3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); - NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pwd_must_change_at_next_logon)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->clear_lockout)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); - NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq3(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordReq3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); - NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pwd_must_change_at_next_logon)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->clear_lockout)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); - NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidatePasswordReq3(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq3 *r) -{ - ndr_print_struct(ndr, name, "samr_ValidatePasswordReq3"); - ndr->depth++; - ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); - ndr_print_lsa_StringLarge(ndr, "password", &r->password); - ndr_print_lsa_StringLarge(ndr, "account", &r->account); - ndr_print_samr_ValidationBlob(ndr, "hash", &r->hash); - ndr_print_uint8(ndr, "pwd_must_change_at_next_logon", r->pwd_must_change_at_next_logon); - ndr_print_uint8(ndr, "clear_lockout", r->clear_lockout); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ValidatePasswordReq2(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordReq2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); - NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_matched)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); - NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq2(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordReq2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); - NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_matched)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); - NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidatePasswordReq2(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq2 *r) -{ - ndr_print_struct(ndr, name, "samr_ValidatePasswordReq2"); - ndr->depth++; - ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); - ndr_print_lsa_StringLarge(ndr, "password", &r->password); - ndr_print_lsa_StringLarge(ndr, "account", &r->account); - ndr_print_samr_ValidationBlob(ndr, "hash", &r->hash); - ndr_print_uint8(ndr, "password_matched", r->password_matched); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ValidatePasswordReq1(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordReq1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_matched)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq1(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordReq1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_matched)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidatePasswordReq1(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq1 *r) -{ - ndr_print_struct(ndr, name, "samr_ValidatePasswordReq1"); - ndr->depth++; - ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); - ndr_print_uint8(ndr, "password_matched", r->password_matched); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ValidatePasswordReq(struct ndr_push *ndr, int ndr_flags, const union samr_ValidatePasswordReq *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_samr_ValidatePasswordReq1(ndr, NDR_SCALARS, &r->req1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_samr_ValidatePasswordReq2(ndr, NDR_SCALARS, &r->req2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_samr_ValidatePasswordReq3(ndr, NDR_SCALARS, &r->req3)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - NDR_CHECK(ndr_push_samr_ValidatePasswordReq1(ndr, NDR_BUFFERS, &r->req1)); - break; - - case 2: - NDR_CHECK(ndr_push_samr_ValidatePasswordReq2(ndr, NDR_BUFFERS, &r->req2)); - break; - - case 3: - NDR_CHECK(ndr_push_samr_ValidatePasswordReq3(ndr, NDR_BUFFERS, &r->req3)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq(struct ndr_pull *ndr, int ndr_flags, union samr_ValidatePasswordReq *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_samr_ValidatePasswordReq1(ndr, NDR_SCALARS, &r->req1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_samr_ValidatePasswordReq2(ndr, NDR_SCALARS, &r->req2)); - break; } - - case 3: { - NDR_CHECK(ndr_pull_samr_ValidatePasswordReq3(ndr, NDR_SCALARS, &r->req3)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - NDR_CHECK(ndr_pull_samr_ValidatePasswordReq1(ndr, NDR_BUFFERS, &r->req1)); - break; - - case 2: - NDR_CHECK(ndr_pull_samr_ValidatePasswordReq2(ndr, NDR_BUFFERS, &r->req2)); - break; - - case 3: - NDR_CHECK(ndr_pull_samr_ValidatePasswordReq3(ndr, NDR_BUFFERS, &r->req3)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidatePasswordReq(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordReq *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "samr_ValidatePasswordReq"); - switch (level) { - case 1: - ndr_print_samr_ValidatePasswordReq1(ndr, "req1", &r->req1); - break; - - case 2: - ndr_print_samr_ValidatePasswordReq2(ndr, "req2", &r->req2); - break; - - case 3: - ndr_print_samr_ValidatePasswordReq3(ndr, "req3", &r->req3); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_samr_Connect(struct ndr_push *ndr, int flags, const struct samr_Connect *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - if (r->out.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_Connect(struct ndr_pull *ndr, int flags, struct samr_Connect *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_connect_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - ZERO_STRUCTP(r->out.connect_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Connect(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect *r) -{ - ndr_print_struct(ndr, name, "samr_Connect"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_Connect"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_Connect"); - ndr->depth++; - ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_Close(struct ndr_push *ndr, int flags, const struct samr_Close *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_Close(struct ndr_pull *ndr, int flags, struct samr_Close *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.handle); - *r->out.handle = *r->in.handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Close(struct ndr_print *ndr, const char *name, int flags, const struct samr_Close *r) -{ - ndr_print_struct(ndr, name, "samr_Close"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_Close"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_Close"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_SetSecurity(struct ndr_push *ndr, int flags, const struct samr_SetSecurity *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); - if (r->in.sdbuf == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_SetSecurity(struct ndr_pull *ndr, int flags, struct samr_SetSecurity *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sdbuf_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sdbuf); - } - _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sdbuf, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SetSecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetSecurity *r) -{ - ndr_print_struct(ndr, name, "samr_SetSecurity"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_SetSecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); - ndr_print_ptr(ndr, "sdbuf", r->in.sdbuf); - ndr->depth++; - ndr_print_sec_desc_buf(ndr, "sdbuf", r->in.sdbuf); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_SetSecurity"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QuerySecurity(struct ndr_push *ndr, int flags, const struct samr_QuerySecurity *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); - } - if (flags & NDR_OUT) { - if (r->out.sdbuf == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sdbuf)); - if (*r->out.sdbuf) { - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QuerySecurity(struct ndr_pull *ndr, int flags, struct samr_QuerySecurity *r) -{ - uint32_t _ptr_sdbuf; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sdbuf_0; - TALLOC_CTX *_mem_save_sdbuf_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); - NDR_PULL_ALLOC(ndr, r->out.sdbuf); - ZERO_STRUCTP(r->out.sdbuf); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sdbuf); - } - _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sdbuf, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sdbuf)); - if (_ptr_sdbuf) { - NDR_PULL_ALLOC(ndr, *r->out.sdbuf); - } else { - *r->out.sdbuf = NULL; - } - if (*r->out.sdbuf) { - _mem_save_sdbuf_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.sdbuf, 0); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_QuerySecurity *r) -{ - ndr_print_struct(ndr, name, "samr_QuerySecurity"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QuerySecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QuerySecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "sdbuf", r->out.sdbuf); - ndr->depth++; - ndr_print_ptr(ndr, "sdbuf", *r->out.sdbuf); - ndr->depth++; - if (*r->out.sdbuf) { - ndr_print_sec_desc_buf(ndr, "sdbuf", *r->out.sdbuf); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_Shutdown(struct ndr_push *ndr, int flags, const struct samr_Shutdown *r) -{ - if (flags & NDR_IN) { - if (r->in.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_Shutdown(struct ndr_pull *ndr, int flags, struct samr_Shutdown *r) -{ - TALLOC_CTX *_mem_save_connect_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Shutdown(struct ndr_print *ndr, const char *name, int flags, const struct samr_Shutdown *r) -{ - ndr_print_struct(ndr, name, "samr_Shutdown"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_Shutdown"); - ndr->depth++; - ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_Shutdown"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_LookupDomain(struct ndr_push *ndr, int flags, const struct samr_LookupDomain *r) -{ - if (flags & NDR_IN) { - if (r->in.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - if (r->in.domain_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.domain_name)); - } - if (flags & NDR_OUT) { - if (r->out.sid == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sid)); - if (*r->out.sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sid)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_LookupDomain(struct ndr_pull *ndr, int flags, struct samr_LookupDomain *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_connect_handle_0; - TALLOC_CTX *_mem_save_domain_name_0; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_sid_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_name); - } - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.sid); - ZERO_STRUCTP(r->out.sid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, *r->out.sid); - } else { - *r->out.sid = NULL; - } - if (*r->out.sid) { - _mem_save_sid_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_LookupDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupDomain *r) -{ - ndr_print_struct(ndr, name, "samr_LookupDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_LookupDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - ndr_print_lsa_String(ndr, "domain_name", r->in.domain_name); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_LookupDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "sid", r->out.sid); - ndr->depth++; - ndr_print_ptr(ndr, "sid", *r->out.sid); - ndr->depth++; - if (*r->out.sid) { - ndr_print_dom_sid2(ndr, "sid", *r->out.sid); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_EnumDomains(struct ndr_push *ndr, int flags, const struct samr_EnumDomains *r) -{ - if (flags & NDR_IN) { - if (r->in.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - 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.buf_size)); - } - if (flags & NDR_OUT) { - 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.sam == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sam)); - if (*r->out.sam) { - NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); - } - if (r->out.num_entries == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_EnumDomains(struct ndr_pull *ndr, int flags, struct samr_EnumDomains *r) -{ - uint32_t _ptr_sam; - TALLOC_CTX *_mem_save_connect_handle_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_sam_0; - TALLOC_CTX *_mem_save_sam_1; - TALLOC_CTX *_mem_save_num_entries_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - *r->out.resume_handle = *r->in.resume_handle; - NDR_PULL_ALLOC(ndr, r->out.sam); - ZERO_STRUCTP(r->out.sam); - NDR_PULL_ALLOC(ndr, r->out.num_entries); - ZERO_STRUCTP(r->out.num_entries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sam); - } - _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam)); - if (_ptr_sam) { - NDR_PULL_ALLOC(ndr, *r->out.sam); - } else { - *r->out.sam = NULL; - } - if (*r->out.sam) { - _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); - NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_entries); - } - _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_EnumDomains(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomains *r) -{ - ndr_print_struct(ndr, name, "samr_EnumDomains"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_EnumDomains"); - ndr->depth++; - ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - ndr->depth--; - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_EnumDomains"); - ndr->depth++; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sam", r->out.sam); - ndr->depth++; - ndr_print_ptr(ndr, "sam", *r->out.sam); - ndr->depth++; - if (*r->out.sam) { - ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "num_entries", r->out.num_entries); - ndr->depth++; - ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_OpenDomain(struct ndr_push *ndr, int flags, const struct samr_OpenDomain *r) -{ - if (flags & NDR_IN) { - if (r->in.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - NDR_CHECK(ndr_push_samr_DomainAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - 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.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.domain_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_OpenDomain(struct ndr_pull *ndr, int flags, struct samr_OpenDomain *r) -{ - TALLOC_CTX *_mem_save_connect_handle_0; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_domain_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_DomainAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.domain_handle); - ZERO_STRUCTP(r->out.domain_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_OpenDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenDomain *r) -{ - ndr_print_struct(ndr, name, "samr_OpenDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_OpenDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); - ndr->depth--; - ndr_print_samr_DomainAccessMask(ndr, "access_mask", r->in.access_mask); - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_OpenDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->out.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->out.domain_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QueryDomainInfo(struct ndr_push *ndr, int flags, const struct samr_QueryDomainInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QueryDomainInfo(struct ndr_pull *ndr, int flags, struct samr_QueryDomainInfo *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo *r) -{ - ndr_print_struct(ndr, name, "samr_QueryDomainInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryDomainInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryDomainInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_samr_DomainInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_SetDomainInfo(struct ndr_push *ndr, int flags, const struct samr_SetDomainInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - 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_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_SetDomainInfo(struct ndr_pull *ndr, int flags, struct samr_SetDomainInfo *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDomainInfo *r) -{ - ndr_print_struct(ndr, name, "samr_SetDomainInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_SetDomainInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_samr_DomainInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_SetDomainInfo"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_CreateDomainGroup(struct ndr_push *ndr, int flags, const struct samr_CreateDomainGroup *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - 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)); - NDR_CHECK(ndr_push_samr_GroupAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - if (r->out.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_CreateDomainGroup(struct ndr_pull *ndr, int flags, struct samr_CreateDomainGroup *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_group_handle_0; - TALLOC_CTX *_mem_save_rid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_GroupAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.group_handle); - ZERO_STRUCTP(r->out.group_handle); - NDR_PULL_ALLOC(ndr, r->out.rid); - ZERO_STRUCTP(r->out.rid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rid); - } - _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_CreateDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomainGroup *r) -{ - ndr_print_struct(ndr, name, "samr_CreateDomainGroup"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_CreateDomainGroup"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - ndr_print_lsa_String(ndr, "name", r->in.name); - ndr->depth--; - ndr_print_samr_GroupAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_CreateDomainGroup"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->out.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->out.group_handle); - ndr->depth--; - ndr_print_ptr(ndr, "rid", r->out.rid); - ndr->depth++; - ndr_print_uint32(ndr, "rid", *r->out.rid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_EnumDomainGroups(struct ndr_push *ndr, int flags, const struct samr_EnumDomainGroups *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - 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 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.sam == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sam)); - if (*r->out.sam) { - NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); - } - if (r->out.num_entries == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_EnumDomainGroups(struct ndr_pull *ndr, int flags, struct samr_EnumDomainGroups *r) -{ - uint32_t _ptr_sam; - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_sam_0; - TALLOC_CTX *_mem_save_sam_1; - TALLOC_CTX *_mem_save_num_entries_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - *r->out.resume_handle = *r->in.resume_handle; - NDR_PULL_ALLOC(ndr, r->out.sam); - ZERO_STRUCTP(r->out.sam); - NDR_PULL_ALLOC(ndr, r->out.num_entries); - ZERO_STRUCTP(r->out.num_entries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sam); - } - _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam)); - if (_ptr_sam) { - NDR_PULL_ALLOC(ndr, *r->out.sam); - } else { - *r->out.sam = NULL; - } - if (*r->out.sam) { - _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); - NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_entries); - } - _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_EnumDomainGroups(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainGroups *r) -{ - ndr_print_struct(ndr, name, "samr_EnumDomainGroups"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_EnumDomainGroups"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - ndr->depth--; - ndr_print_uint32(ndr, "max_size", r->in.max_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_EnumDomainGroups"); - ndr->depth++; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sam", r->out.sam); - ndr->depth++; - ndr_print_ptr(ndr, "sam", *r->out.sam); - ndr->depth++; - if (*r->out.sam) { - ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "num_entries", r->out.num_entries); - ndr->depth++; - ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_CreateUser(struct ndr_push *ndr, int flags, const struct samr_CreateUser *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - if (r->in.account_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.account_name)); - NDR_CHECK(ndr_push_samr_UserAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - if (r->out.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_CreateUser(struct ndr_pull *ndr, int flags, struct samr_CreateUser *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_account_name_0; - TALLOC_CTX *_mem_save_user_handle_0; - TALLOC_CTX *_mem_save_rid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.account_name); - } - _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.account_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_UserAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.user_handle); - ZERO_STRUCTP(r->out.user_handle); - NDR_PULL_ALLOC(ndr, r->out.rid); - ZERO_STRUCTP(r->out.rid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rid); - } - _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_CreateUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser *r) -{ - ndr_print_struct(ndr, name, "samr_CreateUser"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_CreateUser"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_ptr(ndr, "account_name", r->in.account_name); - ndr->depth++; - ndr_print_lsa_String(ndr, "account_name", r->in.account_name); - ndr->depth--; - ndr_print_samr_UserAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_CreateUser"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->out.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); - ndr->depth--; - ndr_print_ptr(ndr, "rid", r->out.rid); - ndr->depth++; - ndr_print_uint32(ndr, "rid", *r->out.rid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_EnumDomainUsers(struct ndr_push *ndr, int flags, const struct samr_EnumDomainUsers *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - 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_samr_AcctFlags(ndr, NDR_SCALARS, r->in.acct_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_size)); - } - if (flags & NDR_OUT) { - 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.sam == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sam)); - if (*r->out.sam) { - NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); - } - if (r->out.num_entries == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_EnumDomainUsers(struct ndr_pull *ndr, int flags, struct samr_EnumDomainUsers *r) -{ - uint32_t _ptr_sam; - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_sam_0; - TALLOC_CTX *_mem_save_sam_1; - TALLOC_CTX *_mem_save_num_entries_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.acct_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - *r->out.resume_handle = *r->in.resume_handle; - NDR_PULL_ALLOC(ndr, r->out.sam); - ZERO_STRUCTP(r->out.sam); - NDR_PULL_ALLOC(ndr, r->out.num_entries); - ZERO_STRUCTP(r->out.num_entries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sam); - } - _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam)); - if (_ptr_sam) { - NDR_PULL_ALLOC(ndr, *r->out.sam); - } else { - *r->out.sam = NULL; - } - if (*r->out.sam) { - _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); - NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_entries); - } - _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_EnumDomainUsers(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainUsers *r) -{ - ndr_print_struct(ndr, name, "samr_EnumDomainUsers"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_EnumDomainUsers"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - ndr->depth--; - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->in.acct_flags); - ndr_print_uint32(ndr, "max_size", r->in.max_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_EnumDomainUsers"); - ndr->depth++; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sam", r->out.sam); - ndr->depth++; - ndr_print_ptr(ndr, "sam", *r->out.sam); - ndr->depth++; - if (*r->out.sam) { - ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "num_entries", r->out.num_entries); - ndr->depth++; - ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_CreateDomAlias(struct ndr_push *ndr, int flags, const struct samr_CreateDomAlias *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - if (r->in.alias_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.alias_name)); - NDR_CHECK(ndr_push_samr_AliasAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - if (r->out.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_CreateDomAlias(struct ndr_pull *ndr, int flags, struct samr_CreateDomAlias *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_alias_name_0; - TALLOC_CTX *_mem_save_alias_handle_0; - TALLOC_CTX *_mem_save_rid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.alias_name); - } - _mem_save_alias_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.alias_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_AliasAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.alias_handle); - ZERO_STRUCTP(r->out.alias_handle); - NDR_PULL_ALLOC(ndr, r->out.rid); - ZERO_STRUCTP(r->out.rid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rid); - } - _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_CreateDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomAlias *r) -{ - ndr_print_struct(ndr, name, "samr_CreateDomAlias"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_CreateDomAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_ptr(ndr, "alias_name", r->in.alias_name); - ndr->depth++; - ndr_print_lsa_String(ndr, "alias_name", r->in.alias_name); - ndr->depth--; - ndr_print_samr_AliasAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_CreateDomAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->out.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->out.alias_handle); - ndr->depth--; - ndr_print_ptr(ndr, "rid", r->out.rid); - ndr->depth++; - ndr_print_uint32(ndr, "rid", *r->out.rid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_EnumDomainAliases(struct ndr_push *ndr, int flags, const struct samr_EnumDomainAliases *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - 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 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.sam == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sam)); - if (*r->out.sam) { - NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); - } - if (r->out.num_entries == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_EnumDomainAliases(struct ndr_pull *ndr, int flags, struct samr_EnumDomainAliases *r) -{ - uint32_t _ptr_sam; - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_sam_0; - TALLOC_CTX *_mem_save_sam_1; - TALLOC_CTX *_mem_save_num_entries_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - *r->out.resume_handle = *r->in.resume_handle; - NDR_PULL_ALLOC(ndr, r->out.sam); - ZERO_STRUCTP(r->out.sam); - NDR_PULL_ALLOC(ndr, r->out.num_entries); - ZERO_STRUCTP(r->out.num_entries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sam); - } - _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam)); - if (_ptr_sam) { - NDR_PULL_ALLOC(ndr, *r->out.sam); - } else { - *r->out.sam = NULL; - } - if (*r->out.sam) { - _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); - NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_entries); - } - _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_EnumDomainAliases(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainAliases *r) -{ - ndr_print_struct(ndr, name, "samr_EnumDomainAliases"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_EnumDomainAliases"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - ndr->depth--; - ndr_print_uint32(ndr, "max_size", r->in.max_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_EnumDomainAliases"); - ndr->depth++; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sam", r->out.sam); - ndr->depth++; - ndr_print_ptr(ndr, "sam", *r->out.sam); - ndr->depth++; - if (*r->out.sam) { - ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "num_entries", r->out.num_entries); - ndr->depth++; - ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GetAliasMembership(struct ndr_push *ndr, int flags, const struct samr_GetAliasMembership *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - 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 (flags & NDR_OUT) { - if (r->out.rids == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GetAliasMembership(struct ndr_pull *ndr, int flags, struct samr_GetAliasMembership *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_rids_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.rids); - ZERO_STRUCTP(r->out.rids); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rids); - } - _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GetAliasMembership(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetAliasMembership *r) -{ - ndr_print_struct(ndr, name, "samr_GetAliasMembership"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_GetAliasMembership"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_GetAliasMembership"); - ndr->depth++; - ndr_print_ptr(ndr, "rids", r->out.rids); - ndr->depth++; - ndr_print_samr_Ids(ndr, "rids", r->out.rids); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_LookupNames(struct ndr_push *ndr, int flags, const struct samr_LookupNames *r) -{ - uint32_t cntr_names_0; - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1000)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - 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 (flags & NDR_OUT) { - if (r->out.rids == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); - if (r->out.types == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_LookupNames(struct ndr_pull *ndr, int flags, struct samr_LookupNames *r) -{ - uint32_t cntr_names_0; - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_rids_0; - TALLOC_CTX *_mem_save_types_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); - if (r->in.num_names < 0 || r->in.num_names > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.names)); - if (ndr_get_array_length(ndr, &r->in.names) > ndr_get_array_size(ndr, &r->in.names)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.names), ndr_get_array_length(ndr, &r->in.names)); - } - NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); - } - for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); - NDR_PULL_ALLOC(ndr, r->out.rids); - ZERO_STRUCTP(r->out.rids); - NDR_PULL_ALLOC(ndr, r->out.types); - ZERO_STRUCTP(r->out.types); - if (r->in.names) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, 1000)); - } - if (r->in.names) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.names, r->in.num_names)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rids); - } - _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.types); - } - _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.types, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupNames *r) -{ - uint32_t cntr_names_0; - ndr_print_struct(ndr, name, "samr_LookupNames"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_LookupNames"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint32(ndr, "num_names", r->in.num_names); - ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->in.num_names); - ndr->depth++; - for (cntr_names_0=0;cntr_names_0in.num_names;cntr_names_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { - ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_LookupNames"); - ndr->depth++; - ndr_print_ptr(ndr, "rids", r->out.rids); - ndr->depth++; - ndr_print_samr_Ids(ndr, "rids", r->out.rids); - ndr->depth--; - ndr_print_ptr(ndr, "types", r->out.types); - ndr->depth++; - ndr_print_samr_Ids(ndr, "types", r->out.types); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_LookupRids(struct ndr_push *ndr, int flags, const struct samr_LookupRids *r) -{ - uint32_t cntr_rids_0; - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_rids)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1000)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_rids)); - for (cntr_rids_0 = 0; cntr_rids_0 < r->in.num_rids; cntr_rids_0++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rids[cntr_rids_0])); - } - } - if (flags & NDR_OUT) { - if (r->out.names == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_lsa_Strings(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); - if (r->out.types == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_LookupRids(struct ndr_pull *ndr, int flags, struct samr_LookupRids *r) -{ - uint32_t cntr_rids_0; - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_rids_0; - TALLOC_CTX *_mem_save_names_0; - TALLOC_CTX *_mem_save_types_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_rids)); - if (r->in.num_rids < 0 || r->in.num_rids > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rids)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rids)); - if (ndr_get_array_length(ndr, &r->in.rids) > ndr_get_array_size(ndr, &r->in.rids)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rids), ndr_get_array_length(ndr, &r->in.rids)); - } - NDR_PULL_ALLOC_N(ndr, r->in.rids, ndr_get_array_size(ndr, &r->in.rids)); - _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.rids, 0); - for (cntr_rids_0 = 0; cntr_rids_0 < r->in.num_rids; cntr_rids_0++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rids[cntr_rids_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); - NDR_PULL_ALLOC(ndr, r->out.names); - ZERO_STRUCTP(r->out.names); - NDR_PULL_ALLOC(ndr, r->out.types); - ZERO_STRUCTP(r->out.types); - if (r->in.rids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.rids, 1000)); - } - if (r->in.rids) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.rids, r->in.num_rids)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.names); - } - _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_Strings(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.types); - } - _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.types, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_LookupRids(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupRids *r) -{ - uint32_t cntr_rids_0; - ndr_print_struct(ndr, name, "samr_LookupRids"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_LookupRids"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint32(ndr, "num_rids", r->in.num_rids); - ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->in.num_rids); - ndr->depth++; - for (cntr_rids_0=0;cntr_rids_0in.num_rids;cntr_rids_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_rids_0) != -1) { - ndr_print_uint32(ndr, "rids", r->in.rids[cntr_rids_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_LookupRids"); - ndr->depth++; - ndr_print_ptr(ndr, "names", r->out.names); - ndr->depth++; - ndr_print_lsa_Strings(ndr, "names", r->out.names); - ndr->depth--; - ndr_print_ptr(ndr, "types", r->out.types); - ndr->depth++; - ndr_print_samr_Ids(ndr, "types", r->out.types); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_OpenGroup(struct ndr_push *ndr, int flags, const struct samr_OpenGroup *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_samr_GroupAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); - } - if (flags & NDR_OUT) { - if (r->out.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_OpenGroup(struct ndr_pull *ndr, int flags, struct samr_OpenGroup *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_group_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_GroupAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); - NDR_PULL_ALLOC(ndr, r->out.group_handle); - ZERO_STRUCTP(r->out.group_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_OpenGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenGroup *r) -{ - ndr_print_struct(ndr, name, "samr_OpenGroup"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_OpenGroup"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_samr_GroupAccessMask(ndr, "access_mask", r->in.access_mask); - ndr_print_uint32(ndr, "rid", r->in.rid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_OpenGroup"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->out.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->out.group_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QueryGroupInfo(struct ndr_push *ndr, int flags, const struct samr_QueryGroupInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QueryGroupInfo(struct ndr_pull *ndr, int flags, struct samr_QueryGroupInfo *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_group_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_GroupInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupInfo *r) -{ - ndr_print_struct(ndr, name, "samr_QueryGroupInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryGroupInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->in.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); - ndr->depth--; - ndr_print_samr_GroupInfoEnum(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryGroupInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_samr_GroupInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_SetGroupInfo(struct ndr_push *ndr, int flags, const struct samr_SetGroupInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, r->in.level)); - 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_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_SetGroupInfo(struct ndr_pull *ndr, int flags, struct samr_SetGroupInfo *r) -{ - TALLOC_CTX *_mem_save_group_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_GroupInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SetGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetGroupInfo *r) -{ - ndr_print_struct(ndr, name, "samr_SetGroupInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_SetGroupInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->in.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); - ndr->depth--; - ndr_print_samr_GroupInfoEnum(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_samr_GroupInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_SetGroupInfo"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_AddGroupMember(struct ndr_push *ndr, int flags, const struct samr_AddGroupMember *r) -{ - if (flags & NDR_IN) { - if (r->in.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_AddGroupMember(struct ndr_pull *ndr, int flags, struct samr_AddGroupMember *r) -{ - TALLOC_CTX *_mem_save_group_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_AddGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddGroupMember *r) -{ - ndr_print_struct(ndr, name, "samr_AddGroupMember"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_AddGroupMember"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->in.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); - ndr->depth--; - ndr_print_uint32(ndr, "rid", r->in.rid); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_AddGroupMember"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DeleteDomainGroup(struct ndr_push *ndr, int flags, const struct samr_DeleteDomainGroup *r) -{ - if (flags & NDR_IN) { - if (r->in.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - } - if (flags & NDR_OUT) { - if (r->out.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DeleteDomainGroup(struct ndr_pull *ndr, int flags, struct samr_DeleteDomainGroup *r) -{ - TALLOC_CTX *_mem_save_group_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.group_handle); - *r->out.group_handle = *r->in.group_handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DeleteDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomainGroup *r) -{ - ndr_print_struct(ndr, name, "samr_DeleteDomainGroup"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_DeleteDomainGroup"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->in.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_DeleteDomainGroup"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->out.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->out.group_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DeleteGroupMember(struct ndr_push *ndr, int flags, const struct samr_DeleteGroupMember *r) -{ - if (flags & NDR_IN) { - if (r->in.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DeleteGroupMember(struct ndr_pull *ndr, int flags, struct samr_DeleteGroupMember *r) -{ - TALLOC_CTX *_mem_save_group_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DeleteGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteGroupMember *r) -{ - ndr_print_struct(ndr, name, "samr_DeleteGroupMember"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_DeleteGroupMember"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->in.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); - ndr->depth--; - ndr_print_uint32(ndr, "rid", r->in.rid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_DeleteGroupMember"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QueryGroupMember(struct ndr_push *ndr, int flags, const struct samr_QueryGroupMember *r) -{ - if (flags & NDR_IN) { - if (r->in.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - } - if (flags & NDR_OUT) { - if (r->out.rids == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.rids)); - if (*r->out.rids) { - NDR_CHECK(ndr_push_samr_RidTypeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QueryGroupMember(struct ndr_pull *ndr, int flags, struct samr_QueryGroupMember *r) -{ - uint32_t _ptr_rids; - TALLOC_CTX *_mem_save_group_handle_0; - TALLOC_CTX *_mem_save_rids_0; - TALLOC_CTX *_mem_save_rids_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.rids); - ZERO_STRUCTP(r->out.rids); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rids); - } - _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); - if (_ptr_rids) { - NDR_PULL_ALLOC(ndr, *r->out.rids); - } else { - *r->out.rids = NULL; - } - if (*r->out.rids) { - _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.rids, 0); - NDR_CHECK(ndr_pull_samr_RidTypeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupMember *r) -{ - ndr_print_struct(ndr, name, "samr_QueryGroupMember"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryGroupMember"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->in.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryGroupMember"); - ndr->depth++; - ndr_print_ptr(ndr, "rids", r->out.rids); - ndr->depth++; - ndr_print_ptr(ndr, "rids", *r->out.rids); - ndr->depth++; - if (*r->out.rids) { - ndr_print_samr_RidTypeArray(ndr, "rids", *r->out.rids); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_SetMemberAttributesOfGroup(struct ndr_push *ndr, int flags, const struct samr_SetMemberAttributesOfGroup *r) -{ - if (flags & NDR_IN) { - if (r->in.group_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_SetMemberAttributesOfGroup(struct ndr_pull *ndr, int flags, struct samr_SetMemberAttributesOfGroup *r) -{ - TALLOC_CTX *_mem_save_group_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.group_handle); - } - _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SetMemberAttributesOfGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetMemberAttributesOfGroup *r) -{ - ndr_print_struct(ndr, name, "samr_SetMemberAttributesOfGroup"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_SetMemberAttributesOfGroup"); - ndr->depth++; - ndr_print_ptr(ndr, "group_handle", r->in.group_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); - ndr->depth--; - ndr_print_uint32(ndr, "unknown1", r->in.unknown1); - ndr_print_uint32(ndr, "unknown2", r->in.unknown2); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_SetMemberAttributesOfGroup"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_OpenAlias(struct ndr_push *ndr, int flags, const struct samr_OpenAlias *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_samr_AliasAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); - } - if (flags & NDR_OUT) { - if (r->out.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_OpenAlias(struct ndr_pull *ndr, int flags, struct samr_OpenAlias *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_alias_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_AliasAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); - NDR_PULL_ALLOC(ndr, r->out.alias_handle); - ZERO_STRUCTP(r->out.alias_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_OpenAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenAlias *r) -{ - ndr_print_struct(ndr, name, "samr_OpenAlias"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_OpenAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_samr_AliasAccessMask(ndr, "access_mask", r->in.access_mask); - ndr_print_uint32(ndr, "rid", r->in.rid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_OpenAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->out.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->out.alias_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QueryAliasInfo(struct ndr_push *ndr, int flags, const struct samr_QueryAliasInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QueryAliasInfo(struct ndr_pull *ndr, int flags, struct samr_QueryAliasInfo *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_alias_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_AliasInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryAliasInfo *r) -{ - ndr_print_struct(ndr, name, "samr_QueryAliasInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryAliasInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); - ndr->depth--; - ndr_print_samr_AliasInfoEnum(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryAliasInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_samr_AliasInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_SetAliasInfo(struct ndr_push *ndr, int flags, const struct samr_SetAliasInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, r->in.level)); - 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_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_SetAliasInfo(struct ndr_pull *ndr, int flags, struct samr_SetAliasInfo *r) -{ - TALLOC_CTX *_mem_save_alias_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_AliasInfoEnum(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SetAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetAliasInfo *r) -{ - ndr_print_struct(ndr, name, "samr_SetAliasInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_SetAliasInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); - ndr->depth--; - ndr_print_samr_AliasInfoEnum(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_samr_AliasInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_SetAliasInfo"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DeleteDomAlias(struct ndr_push *ndr, int flags, const struct samr_DeleteDomAlias *r) -{ - if (flags & NDR_IN) { - if (r->in.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - } - if (flags & NDR_OUT) { - if (r->out.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DeleteDomAlias(struct ndr_pull *ndr, int flags, struct samr_DeleteDomAlias *r) -{ - TALLOC_CTX *_mem_save_alias_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.alias_handle); - *r->out.alias_handle = *r->in.alias_handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DeleteDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomAlias *r) -{ - ndr_print_struct(ndr, name, "samr_DeleteDomAlias"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_DeleteDomAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_DeleteDomAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->out.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->out.alias_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_AddAliasMember(struct ndr_push *ndr, int flags, const struct samr_AddAliasMember *r) -{ - if (flags & NDR_IN) { - if (r->in.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - 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) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_AddAliasMember(struct ndr_pull *ndr, int flags, struct samr_AddAliasMember *r) -{ - TALLOC_CTX *_mem_save_alias_handle_0; - TALLOC_CTX *_mem_save_sid_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_AddAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddAliasMember *r) -{ - ndr_print_struct(ndr, name, "samr_AddAliasMember"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_AddAliasMember"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_AddAliasMember"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DeleteAliasMember(struct ndr_push *ndr, int flags, const struct samr_DeleteAliasMember *r) -{ - if (flags & NDR_IN) { - if (r->in.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - 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) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DeleteAliasMember(struct ndr_pull *ndr, int flags, struct samr_DeleteAliasMember *r) -{ - TALLOC_CTX *_mem_save_alias_handle_0; - TALLOC_CTX *_mem_save_sid_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DeleteAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteAliasMember *r) -{ - ndr_print_struct(ndr, name, "samr_DeleteAliasMember"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_DeleteAliasMember"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_DeleteAliasMember"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GetMembersInAlias(struct ndr_push *ndr, int flags, const struct samr_GetMembersInAlias *r) -{ - if (flags & NDR_IN) { - if (r->in.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GetMembersInAlias(struct ndr_pull *ndr, int flags, struct samr_GetMembersInAlias *r) -{ - TALLOC_CTX *_mem_save_alias_handle_0; - TALLOC_CTX *_mem_save_sids_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.sids); - ZERO_STRUCTP(r->out.sids); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GetMembersInAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetMembersInAlias *r) -{ - ndr_print_struct(ndr, name, "samr_GetMembersInAlias"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_GetMembersInAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_GetMembersInAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "sids", r->out.sids); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", r->out.sids); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_OpenUser(struct ndr_push *ndr, int flags, const struct samr_OpenUser *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_samr_UserAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); - } - if (flags & NDR_OUT) { - if (r->out.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_OpenUser(struct ndr_pull *ndr, int flags, struct samr_OpenUser *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_user_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_UserAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); - NDR_PULL_ALLOC(ndr, r->out.user_handle); - ZERO_STRUCTP(r->out.user_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_OpenUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenUser *r) -{ - ndr_print_struct(ndr, name, "samr_OpenUser"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_OpenUser"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_samr_UserAccessMask(ndr, "access_mask", r->in.access_mask); - ndr_print_uint32(ndr, "rid", r->in.rid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_OpenUser"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->out.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_DeleteUser(struct ndr_push *ndr, int flags, const struct samr_DeleteUser *r) -{ - if (flags & NDR_IN) { - if (r->in.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - } - if (flags & NDR_OUT) { - if (r->out.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_DeleteUser(struct ndr_pull *ndr, int flags, struct samr_DeleteUser *r) -{ - TALLOC_CTX *_mem_save_user_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.user_handle); - *r->out.user_handle = *r->in.user_handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_DeleteUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteUser *r) -{ - ndr_print_struct(ndr, name, "samr_DeleteUser"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_DeleteUser"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->in.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_DeleteUser"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->out.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_QueryUserInfo(struct ndr_push *ndr, int flags, const struct samr_QueryUserInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_QueryUserInfo(struct ndr_pull *ndr, int flags, struct samr_QueryUserInfo *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_user_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo *r) -{ - ndr_print_struct(ndr, name, "samr_QueryUserInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryUserInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->in.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryUserInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_samr_UserInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_SetUserInfo(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - 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_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_SetUserInfo(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo *r) -{ - TALLOC_CTX *_mem_save_user_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SetUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo *r) -{ - ndr_print_struct(ndr, name, "samr_SetUserInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_SetUserInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->in.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_samr_UserInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_SetUserInfo"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ChangePasswordUser(struct ndr_push *ndr, int flags, const struct samr_ChangePasswordUser *r) -{ - if (flags & NDR_IN) { - if (r->in.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.lm_present)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_lm_crypted)); - if (r->in.old_lm_crypted) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.old_lm_crypted)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_lm_crypted)); - if (r->in.new_lm_crypted) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_lm_crypted)); - } - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.nt_present)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_nt_crypted)); - if (r->in.old_nt_crypted) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.old_nt_crypted)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_nt_crypted)); - if (r->in.new_nt_crypted) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_nt_crypted)); - } - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.cross1_present)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_cross)); - if (r->in.nt_cross) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.nt_cross)); - } - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.cross2_present)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_cross)); - if (r->in.lm_cross) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.lm_cross)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ChangePasswordUser(struct ndr_pull *ndr, int flags, struct samr_ChangePasswordUser *r) -{ - uint32_t _ptr_old_lm_crypted; - uint32_t _ptr_new_lm_crypted; - uint32_t _ptr_old_nt_crypted; - uint32_t _ptr_new_nt_crypted; - uint32_t _ptr_nt_cross; - uint32_t _ptr_lm_cross; - TALLOC_CTX *_mem_save_user_handle_0; - TALLOC_CTX *_mem_save_old_lm_crypted_0; - TALLOC_CTX *_mem_save_new_lm_crypted_0; - TALLOC_CTX *_mem_save_old_nt_crypted_0; - TALLOC_CTX *_mem_save_new_nt_crypted_0; - TALLOC_CTX *_mem_save_nt_cross_0; - TALLOC_CTX *_mem_save_lm_cross_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.lm_present)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_lm_crypted)); - if (_ptr_old_lm_crypted) { - NDR_PULL_ALLOC(ndr, r->in.old_lm_crypted); - } else { - r->in.old_lm_crypted = NULL; - } - if (r->in.old_lm_crypted) { - _mem_save_old_lm_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.old_lm_crypted, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.old_lm_crypted)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_lm_crypted_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_lm_crypted)); - if (_ptr_new_lm_crypted) { - NDR_PULL_ALLOC(ndr, r->in.new_lm_crypted); - } else { - r->in.new_lm_crypted = NULL; - } - if (r->in.new_lm_crypted) { - _mem_save_new_lm_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.new_lm_crypted, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_lm_crypted)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_lm_crypted_0, 0); - } - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.nt_present)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_nt_crypted)); - if (_ptr_old_nt_crypted) { - NDR_PULL_ALLOC(ndr, r->in.old_nt_crypted); - } else { - r->in.old_nt_crypted = NULL; - } - if (r->in.old_nt_crypted) { - _mem_save_old_nt_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.old_nt_crypted, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.old_nt_crypted)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_nt_crypted_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_nt_crypted)); - if (_ptr_new_nt_crypted) { - NDR_PULL_ALLOC(ndr, r->in.new_nt_crypted); - } else { - r->in.new_nt_crypted = NULL; - } - if (r->in.new_nt_crypted) { - _mem_save_new_nt_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.new_nt_crypted, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_nt_crypted)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_nt_crypted_0, 0); - } - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.cross1_present)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_cross)); - if (_ptr_nt_cross) { - NDR_PULL_ALLOC(ndr, r->in.nt_cross); - } else { - r->in.nt_cross = NULL; - } - if (r->in.nt_cross) { - _mem_save_nt_cross_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_cross, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.nt_cross)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_cross_0, 0); - } - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.cross2_present)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_cross)); - if (_ptr_lm_cross) { - NDR_PULL_ALLOC(ndr, r->in.lm_cross); - } else { - r->in.lm_cross = NULL; - } - if (r->in.lm_cross) { - _mem_save_lm_cross_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_cross, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.lm_cross)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_cross_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ChangePasswordUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser *r) -{ - ndr_print_struct(ndr, name, "samr_ChangePasswordUser"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_ChangePasswordUser"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->in.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); - ndr->depth--; - ndr_print_uint8(ndr, "lm_present", r->in.lm_present); - ndr_print_ptr(ndr, "old_lm_crypted", r->in.old_lm_crypted); - ndr->depth++; - if (r->in.old_lm_crypted) { - ndr_print_samr_Password(ndr, "old_lm_crypted", r->in.old_lm_crypted); - } - ndr->depth--; - ndr_print_ptr(ndr, "new_lm_crypted", r->in.new_lm_crypted); - ndr->depth++; - if (r->in.new_lm_crypted) { - ndr_print_samr_Password(ndr, "new_lm_crypted", r->in.new_lm_crypted); - } - ndr->depth--; - ndr_print_uint8(ndr, "nt_present", r->in.nt_present); - ndr_print_ptr(ndr, "old_nt_crypted", r->in.old_nt_crypted); - ndr->depth++; - if (r->in.old_nt_crypted) { - ndr_print_samr_Password(ndr, "old_nt_crypted", r->in.old_nt_crypted); - } - ndr->depth--; - ndr_print_ptr(ndr, "new_nt_crypted", r->in.new_nt_crypted); - ndr->depth++; - if (r->in.new_nt_crypted) { - ndr_print_samr_Password(ndr, "new_nt_crypted", r->in.new_nt_crypted); - } - ndr->depth--; - ndr_print_uint8(ndr, "cross1_present", r->in.cross1_present); - ndr_print_ptr(ndr, "nt_cross", r->in.nt_cross); - ndr->depth++; - if (r->in.nt_cross) { - ndr_print_samr_Password(ndr, "nt_cross", r->in.nt_cross); - } - ndr->depth--; - ndr_print_uint8(ndr, "cross2_present", r->in.cross2_present); - ndr_print_ptr(ndr, "lm_cross", r->in.lm_cross); - ndr->depth++; - if (r->in.lm_cross) { - ndr_print_samr_Password(ndr, "lm_cross", r->in.lm_cross); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_ChangePasswordUser"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GetGroupsForUser(struct ndr_push *ndr, int flags, const struct samr_GetGroupsForUser *r) -{ - if (flags & NDR_IN) { - if (r->in.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - } - if (flags & NDR_OUT) { - if (r->out.rids == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.rids)); - if (*r->out.rids) { - NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GetGroupsForUser(struct ndr_pull *ndr, int flags, struct samr_GetGroupsForUser *r) -{ - uint32_t _ptr_rids; - TALLOC_CTX *_mem_save_user_handle_0; - TALLOC_CTX *_mem_save_rids_0; - TALLOC_CTX *_mem_save_rids_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.rids); - ZERO_STRUCTP(r->out.rids); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rids); - } - _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); - if (_ptr_rids) { - NDR_PULL_ALLOC(ndr, *r->out.rids); - } else { - *r->out.rids = NULL; - } - if (*r->out.rids) { - _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.rids, 0); - NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GetGroupsForUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetGroupsForUser *r) -{ - ndr_print_struct(ndr, name, "samr_GetGroupsForUser"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_GetGroupsForUser"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->in.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_GetGroupsForUser"); - ndr->depth++; - ndr_print_ptr(ndr, "rids", r->out.rids); - ndr->depth++; - ndr_print_ptr(ndr, "rids", *r->out.rids); - ndr->depth++; - if (*r->out.rids) { - ndr_print_samr_RidWithAttributeArray(ndr, "rids", *r->out.rids); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QueryDisplayInfo(struct ndr_push *ndr, int flags, const struct samr_QueryDisplayInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_idx)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_entries)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - } - if (flags & NDR_OUT) { - if (r->out.total_size == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_size)); - if (r->out.returned_size == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.returned_size)); - 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_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QueryDisplayInfo(struct ndr_pull *ndr, int flags, struct samr_QueryDisplayInfo *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_total_size_0; - TALLOC_CTX *_mem_save_returned_size_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_idx)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_entries)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_PULL_ALLOC(ndr, r->out.total_size); - ZERO_STRUCTP(r->out.total_size); - NDR_PULL_ALLOC(ndr, r->out.returned_size); - ZERO_STRUCTP(r->out.returned_size); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.total_size); - } - _mem_save_total_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.total_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_size_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.returned_size); - } - _mem_save_returned_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.returned_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_size_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryDisplayInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo *r) -{ - ndr_print_struct(ndr, name, "samr_QueryDisplayInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryDisplayInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_uint32(ndr, "start_idx", r->in.start_idx); - ndr_print_uint32(ndr, "max_entries", r->in.max_entries); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryDisplayInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "total_size", r->out.total_size); - ndr->depth++; - ndr_print_uint32(ndr, "total_size", *r->out.total_size); - ndr->depth--; - ndr_print_ptr(ndr, "returned_size", r->out.returned_size); - ndr->depth++; - ndr_print_uint32(ndr, "returned_size", *r->out.returned_size); - ndr->depth--; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_samr_DispInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GetDisplayEnumerationIndex(struct ndr_push *ndr, int flags, const struct samr_GetDisplayEnumerationIndex *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - 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.idx == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.idx)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GetDisplayEnumerationIndex(struct ndr_pull *ndr, int flags, struct samr_GetDisplayEnumerationIndex *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_idx_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.idx); - ZERO_STRUCTP(r->out.idx); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.idx); - } - _mem_save_idx_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.idx, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.idx)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_idx_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GetDisplayEnumerationIndex(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex *r) -{ - ndr_print_struct(ndr, name, "samr_GetDisplayEnumerationIndex"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_GetDisplayEnumerationIndex"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - ndr_print_lsa_String(ndr, "name", r->in.name); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_GetDisplayEnumerationIndex"); - ndr->depth++; - ndr_print_ptr(ndr, "idx", r->out.idx); - ndr->depth++; - ndr_print_uint32(ndr, "idx", *r->out.idx); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_TestPrivateFunctionsDomain(struct ndr_push *ndr, int flags, const struct samr_TestPrivateFunctionsDomain *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_TestPrivateFunctionsDomain(struct ndr_pull *ndr, int flags, struct samr_TestPrivateFunctionsDomain *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_TestPrivateFunctionsDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsDomain *r) -{ - ndr_print_struct(ndr, name, "samr_TestPrivateFunctionsDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_TestPrivateFunctionsDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_TestPrivateFunctionsDomain"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_TestPrivateFunctionsUser(struct ndr_push *ndr, int flags, const struct samr_TestPrivateFunctionsUser *r) -{ - if (flags & NDR_IN) { - if (r->in.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_TestPrivateFunctionsUser(struct ndr_pull *ndr, int flags, struct samr_TestPrivateFunctionsUser *r) -{ - TALLOC_CTX *_mem_save_user_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_TestPrivateFunctionsUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsUser *r) -{ - ndr_print_struct(ndr, name, "samr_TestPrivateFunctionsUser"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_TestPrivateFunctionsUser"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->in.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_TestPrivateFunctionsUser"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_GetUserPwInfo(struct ndr_push *ndr, int flags, const struct samr_GetUserPwInfo *r) -{ - if (flags & NDR_IN) { - if (r->in.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_GetUserPwInfo(struct ndr_pull *ndr, int flags, struct samr_GetUserPwInfo *r) -{ - TALLOC_CTX *_mem_save_user_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GetUserPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetUserPwInfo *r) -{ - ndr_print_struct(ndr, name, "samr_GetUserPwInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_GetUserPwInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->in.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_GetUserPwInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_samr_PwInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_RemoveMemberFromForeignDomain(struct ndr_push *ndr, int flags, const struct samr_RemoveMemberFromForeignDomain *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - 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) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_RemoveMemberFromForeignDomain(struct ndr_pull *ndr, int flags, struct samr_RemoveMemberFromForeignDomain *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_sid_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_RemoveMemberFromForeignDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMemberFromForeignDomain *r) -{ - ndr_print_struct(ndr, name, "samr_RemoveMemberFromForeignDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_RemoveMemberFromForeignDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sid", r->in.sid); - ndr->depth++; - ndr_print_dom_sid2(ndr, "sid", r->in.sid); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_RemoveMemberFromForeignDomain"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QueryDomainInfo2(struct ndr_push *ndr, int flags, const struct samr_QueryDomainInfo2 *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QueryDomainInfo2(struct ndr_pull *ndr, int flags, struct samr_QueryDomainInfo2 *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryDomainInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo2 *r) -{ - ndr_print_struct(ndr, name, "samr_QueryDomainInfo2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryDomainInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryDomainInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_samr_DomainInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QueryUserInfo2(struct ndr_push *ndr, int flags, const struct samr_QueryUserInfo2 *r) -{ - if (flags & NDR_IN) { - if (r->in.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_push_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QueryUserInfo2(struct ndr_pull *ndr, int flags, struct samr_QueryUserInfo2 *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_user_handle_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo2 *r) -{ - ndr_print_struct(ndr, name, "samr_QueryUserInfo2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryUserInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->in.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryUserInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); - ndr_print_samr_UserInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QueryDisplayInfo2(struct ndr_push *ndr, int flags, const struct samr_QueryDisplayInfo2 *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_idx)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_entries)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - } - if (flags & NDR_OUT) { - if (r->out.total_size == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_size)); - if (r->out.returned_size == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.returned_size)); - 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_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QueryDisplayInfo2(struct ndr_pull *ndr, int flags, struct samr_QueryDisplayInfo2 *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_total_size_0; - TALLOC_CTX *_mem_save_returned_size_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_idx)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_entries)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_PULL_ALLOC(ndr, r->out.total_size); - ZERO_STRUCTP(r->out.total_size); - NDR_PULL_ALLOC(ndr, r->out.returned_size); - ZERO_STRUCTP(r->out.returned_size); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.total_size); - } - _mem_save_total_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.total_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_size_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.returned_size); - } - _mem_save_returned_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.returned_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_size_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryDisplayInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo2 *r) -{ - ndr_print_struct(ndr, name, "samr_QueryDisplayInfo2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryDisplayInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_uint32(ndr, "start_idx", r->in.start_idx); - ndr_print_uint32(ndr, "max_entries", r->in.max_entries); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryDisplayInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "total_size", r->out.total_size); - ndr->depth++; - ndr_print_uint32(ndr, "total_size", *r->out.total_size); - ndr->depth--; - ndr_print_ptr(ndr, "returned_size", r->out.returned_size); - ndr->depth++; - ndr_print_uint32(ndr, "returned_size", *r->out.returned_size); - ndr->depth--; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_samr_DispInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GetDisplayEnumerationIndex2(struct ndr_push *ndr, int flags, const struct samr_GetDisplayEnumerationIndex2 *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - 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.idx == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.idx)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GetDisplayEnumerationIndex2(struct ndr_pull *ndr, int flags, struct samr_GetDisplayEnumerationIndex2 *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_idx_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.idx); - ZERO_STRUCTP(r->out.idx); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.idx); - } - _mem_save_idx_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.idx, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.idx)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_idx_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GetDisplayEnumerationIndex2(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex2 *r) -{ - ndr_print_struct(ndr, name, "samr_GetDisplayEnumerationIndex2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_GetDisplayEnumerationIndex2"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - ndr_print_lsa_String(ndr, "name", r->in.name); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_GetDisplayEnumerationIndex2"); - ndr->depth++; - ndr_print_ptr(ndr, "idx", r->out.idx); - ndr->depth++; - ndr_print_uint32(ndr, "idx", *r->out.idx); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_CreateUser2(struct ndr_push *ndr, int flags, const struct samr_CreateUser2 *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - if (r->in.account_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.account_name)); - NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.acct_flags)); - NDR_CHECK(ndr_push_samr_UserAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - if (r->out.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); - if (r->out.access_granted == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.access_granted)); - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_CreateUser2(struct ndr_pull *ndr, int flags, struct samr_CreateUser2 *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_account_name_0; - TALLOC_CTX *_mem_save_user_handle_0; - TALLOC_CTX *_mem_save_access_granted_0; - TALLOC_CTX *_mem_save_rid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.account_name); - } - _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.account_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.acct_flags)); - NDR_CHECK(ndr_pull_samr_UserAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.user_handle); - ZERO_STRUCTP(r->out.user_handle); - NDR_PULL_ALLOC(ndr, r->out.access_granted); - ZERO_STRUCTP(r->out.access_granted); - NDR_PULL_ALLOC(ndr, r->out.rid); - ZERO_STRUCTP(r->out.rid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.access_granted); - } - _mem_save_access_granted_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.access_granted, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.access_granted)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_access_granted_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rid); - } - _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_CreateUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser2 *r) -{ - ndr_print_struct(ndr, name, "samr_CreateUser2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_CreateUser2"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_ptr(ndr, "account_name", r->in.account_name); - ndr->depth++; - ndr_print_lsa_String(ndr, "account_name", r->in.account_name); - ndr->depth--; - ndr_print_samr_AcctFlags(ndr, "acct_flags", r->in.acct_flags); - ndr_print_samr_UserAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_CreateUser2"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->out.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); - ndr->depth--; - ndr_print_ptr(ndr, "access_granted", r->out.access_granted); - ndr->depth++; - ndr_print_uint32(ndr, "access_granted", *r->out.access_granted); - ndr->depth--; - ndr_print_ptr(ndr, "rid", r->out.rid); - ndr->depth++; - ndr_print_uint32(ndr, "rid", *r->out.rid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_QueryDisplayInfo3(struct ndr_push *ndr, int flags, const struct samr_QueryDisplayInfo3 *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_idx)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_entries)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - } - if (flags & NDR_OUT) { - if (r->out.total_size == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_size)); - if (r->out.returned_size == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.returned_size)); - 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_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_QueryDisplayInfo3(struct ndr_pull *ndr, int flags, struct samr_QueryDisplayInfo3 *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_total_size_0; - TALLOC_CTX *_mem_save_returned_size_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_idx)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_entries)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_PULL_ALLOC(ndr, r->out.total_size); - ZERO_STRUCTP(r->out.total_size); - NDR_PULL_ALLOC(ndr, r->out.returned_size); - ZERO_STRUCTP(r->out.returned_size); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.total_size); - } - _mem_save_total_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.total_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_size_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.returned_size); - } - _mem_save_returned_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.returned_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_size_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_QueryDisplayInfo3(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo3 *r) -{ - ndr_print_struct(ndr, name, "samr_QueryDisplayInfo3"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_QueryDisplayInfo3"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_uint32(ndr, "start_idx", r->in.start_idx); - ndr_print_uint32(ndr, "max_entries", r->in.max_entries); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_QueryDisplayInfo3"); - ndr->depth++; - ndr_print_ptr(ndr, "total_size", r->out.total_size); - ndr->depth++; - ndr_print_uint32(ndr, "total_size", *r->out.total_size); - ndr->depth--; - ndr_print_ptr(ndr, "returned_size", r->out.returned_size); - ndr->depth++; - ndr_print_uint32(ndr, "returned_size", *r->out.returned_size); - ndr->depth--; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_samr_DispInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_AddMultipleMembersToAlias(struct ndr_push *ndr, int flags, const struct samr_AddMultipleMembersToAlias *r) -{ - if (flags & NDR_IN) { - if (r->in.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - 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 (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_AddMultipleMembersToAlias(struct ndr_pull *ndr, int flags, struct samr_AddMultipleMembersToAlias *r) -{ - TALLOC_CTX *_mem_save_alias_handle_0; - TALLOC_CTX *_mem_save_sids_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_AddMultipleMembersToAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddMultipleMembersToAlias *r) -{ - ndr_print_struct(ndr, name, "samr_AddMultipleMembersToAlias"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_AddMultipleMembersToAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_AddMultipleMembersToAlias"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_RemoveMultipleMembersFromAlias(struct ndr_push *ndr, int flags, const struct samr_RemoveMultipleMembersFromAlias *r) -{ - if (flags & NDR_IN) { - if (r->in.alias_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - 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 (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_RemoveMultipleMembersFromAlias(struct ndr_pull *ndr, int flags, struct samr_RemoveMultipleMembersFromAlias *r) -{ - TALLOC_CTX *_mem_save_alias_handle_0; - TALLOC_CTX *_mem_save_sids_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.alias_handle); - } - _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sids); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_RemoveMultipleMembersFromAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMultipleMembersFromAlias *r) -{ - ndr_print_struct(ndr, name, "samr_RemoveMultipleMembersFromAlias"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_RemoveMultipleMembersFromAlias"); - ndr->depth++; - ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); - ndr->depth--; - ndr_print_ptr(ndr, "sids", r->in.sids); - ndr->depth++; - ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_RemoveMultipleMembersFromAlias"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_OemChangePasswordUser2(struct ndr_push *ndr, int flags, const struct samr_OemChangePasswordUser2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); - if (r->in.server) { - NDR_CHECK(ndr_push_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); - } - if (r->in.account == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); - if (r->in.password) { - NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hash)); - if (r->in.hash) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.hash)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_OemChangePasswordUser2(struct ndr_pull *ndr, int flags, struct samr_OemChangePasswordUser2 *r) -{ - uint32_t _ptr_server; - uint32_t _ptr_password; - uint32_t _ptr_hash; - TALLOC_CTX *_mem_save_server_0; - TALLOC_CTX *_mem_save_account_0; - TALLOC_CTX *_mem_save_password_0; - TALLOC_CTX *_mem_save_hash_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); - if (_ptr_server) { - NDR_PULL_ALLOC(ndr, r->in.server); - } else { - r->in.server = NULL; - } - if (r->in.server) { - _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); - NDR_CHECK(ndr_pull_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.account); - } - _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.account, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->in.password); - } else { - r->in.password = NULL; - } - if (r->in.password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); - NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hash)); - if (_ptr_hash) { - NDR_PULL_ALLOC(ndr, r->in.hash); - } else { - r->in.hash = NULL; - } - if (r->in.hash) { - _mem_save_hash_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.hash, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.hash)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hash_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_OemChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_OemChangePasswordUser2 *r) -{ - ndr_print_struct(ndr, name, "samr_OemChangePasswordUser2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_OemChangePasswordUser2"); - ndr->depth++; - ndr_print_ptr(ndr, "server", r->in.server); - ndr->depth++; - if (r->in.server) { - ndr_print_lsa_AsciiString(ndr, "server", r->in.server); - } - ndr->depth--; - ndr_print_ptr(ndr, "account", r->in.account); - ndr->depth++; - ndr_print_lsa_AsciiString(ndr, "account", r->in.account); - ndr->depth--; - ndr_print_ptr(ndr, "password", r->in.password); - ndr->depth++; - if (r->in.password) { - ndr_print_samr_CryptPassword(ndr, "password", r->in.password); - } - ndr->depth--; - ndr_print_ptr(ndr, "hash", r->in.hash); - ndr->depth++; - if (r->in.hash) { - ndr_print_samr_Password(ndr, "hash", r->in.hash); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_OemChangePasswordUser2"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ChangePasswordUser2(struct ndr_push *ndr, int flags, const struct samr_ChangePasswordUser2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); - if (r->in.server) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); - } - if (r->in.account == 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.account)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_password)); - if (r->in.nt_password) { - NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_verifier)); - if (r->in.nt_verifier) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); - } - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.lm_change)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_password)); - if (r->in.lm_password) { - NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_verifier)); - if (r->in.lm_verifier) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ChangePasswordUser2(struct ndr_pull *ndr, int flags, struct samr_ChangePasswordUser2 *r) -{ - uint32_t _ptr_server; - uint32_t _ptr_nt_password; - uint32_t _ptr_nt_verifier; - uint32_t _ptr_lm_password; - uint32_t _ptr_lm_verifier; - TALLOC_CTX *_mem_save_server_0; - TALLOC_CTX *_mem_save_account_0; - TALLOC_CTX *_mem_save_nt_password_0; - TALLOC_CTX *_mem_save_nt_verifier_0; - TALLOC_CTX *_mem_save_lm_password_0; - TALLOC_CTX *_mem_save_lm_verifier_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); - if (_ptr_server) { - NDR_PULL_ALLOC(ndr, r->in.server); - } else { - r->in.server = NULL; - } - if (r->in.server) { - _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.account); - } - _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.account, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_password)); - if (_ptr_nt_password) { - NDR_PULL_ALLOC(ndr, r->in.nt_password); - } else { - r->in.nt_password = NULL; - } - if (r->in.nt_password) { - _mem_save_nt_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_password, 0); - NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_password_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_verifier)); - if (_ptr_nt_verifier) { - NDR_PULL_ALLOC(ndr, r->in.nt_verifier); - } else { - r->in.nt_verifier = NULL; - } - if (r->in.nt_verifier) { - _mem_save_nt_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_verifier, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_verifier_0, 0); - } - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.lm_change)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_password)); - if (_ptr_lm_password) { - NDR_PULL_ALLOC(ndr, r->in.lm_password); - } else { - r->in.lm_password = NULL; - } - if (r->in.lm_password) { - _mem_save_lm_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_password, 0); - NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_password_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_verifier)); - if (_ptr_lm_verifier) { - NDR_PULL_ALLOC(ndr, r->in.lm_verifier); - } else { - r->in.lm_verifier = NULL; - } - if (r->in.lm_verifier) { - _mem_save_lm_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_verifier, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_verifier_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser2 *r) -{ - ndr_print_struct(ndr, name, "samr_ChangePasswordUser2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_ChangePasswordUser2"); - ndr->depth++; - ndr_print_ptr(ndr, "server", r->in.server); - ndr->depth++; - if (r->in.server) { - ndr_print_lsa_String(ndr, "server", r->in.server); - } - ndr->depth--; - ndr_print_ptr(ndr, "account", r->in.account); - ndr->depth++; - ndr_print_lsa_String(ndr, "account", r->in.account); - ndr->depth--; - ndr_print_ptr(ndr, "nt_password", r->in.nt_password); - ndr->depth++; - if (r->in.nt_password) { - ndr_print_samr_CryptPassword(ndr, "nt_password", r->in.nt_password); - } - ndr->depth--; - ndr_print_ptr(ndr, "nt_verifier", r->in.nt_verifier); - ndr->depth++; - if (r->in.nt_verifier) { - ndr_print_samr_Password(ndr, "nt_verifier", r->in.nt_verifier); - } - ndr->depth--; - ndr_print_uint8(ndr, "lm_change", r->in.lm_change); - ndr_print_ptr(ndr, "lm_password", r->in.lm_password); - ndr->depth++; - if (r->in.lm_password) { - ndr_print_samr_CryptPassword(ndr, "lm_password", r->in.lm_password); - } - ndr->depth--; - ndr_print_ptr(ndr, "lm_verifier", r->in.lm_verifier); - ndr->depth++; - if (r->in.lm_verifier) { - ndr_print_samr_Password(ndr, "lm_verifier", r->in.lm_verifier); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_ChangePasswordUser2"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GetDomPwInfo(struct ndr_push *ndr, int flags, const struct samr_GetDomPwInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); - if (r->in.domain_name) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); - } - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GetDomPwInfo(struct ndr_pull *ndr, int flags, struct samr_GetDomPwInfo *r) -{ - uint32_t _ptr_domain_name; - TALLOC_CTX *_mem_save_domain_name_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->in.domain_name); - } else { - r->in.domain_name = NULL; - } - if (r->in.domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GetDomPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDomPwInfo *r) -{ - ndr_print_struct(ndr, name, "samr_GetDomPwInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_GetDomPwInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - if (r->in.domain_name) { - ndr_print_lsa_String(ndr, "domain_name", r->in.domain_name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_GetDomPwInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_samr_PwInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_Connect2(struct ndr_push *ndr, int flags, const struct samr_Connect2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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)); - } - NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - if (r->out.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_Connect2(struct ndr_pull *ndr, int flags, struct samr_Connect2 *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_connect_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); - if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - ZERO_STRUCTP(r->out.connect_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Connect2(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect2 *r) -{ - ndr_print_struct(ndr, name, "samr_Connect2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_Connect2"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_string(ndr, "system_name", r->in.system_name); - } - ndr->depth--; - ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_Connect2"); - ndr->depth++; - ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_SetUserInfo2(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo2 *r) -{ - if (flags & NDR_IN) { - if (r->in.user_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); - 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_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_SetUserInfo2(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo2 *r) -{ - TALLOC_CTX *_mem_save_user_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.user_handle); - } - _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SetUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo2 *r) -{ - ndr_print_struct(ndr, name, "samr_SetUserInfo2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_SetUserInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "user_handle", r->in.user_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); - ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_samr_UserInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_SetUserInfo2"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_SetBootKeyInformation(struct ndr_push *ndr, int flags, const struct samr_SetBootKeyInformation *r) -{ - if (flags & NDR_IN) { - if (r->in.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_SetBootKeyInformation(struct ndr_pull *ndr, int flags, struct samr_SetBootKeyInformation *r) -{ - TALLOC_CTX *_mem_save_connect_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown3)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetBootKeyInformation *r) -{ - ndr_print_struct(ndr, name, "samr_SetBootKeyInformation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_SetBootKeyInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); - ndr->depth--; - ndr_print_uint32(ndr, "unknown1", r->in.unknown1); - ndr_print_uint32(ndr, "unknown2", r->in.unknown2); - ndr_print_uint32(ndr, "unknown3", r->in.unknown3); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_SetBootKeyInformation"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_GetBootKeyInformation(struct ndr_push *ndr, int flags, const struct samr_GetBootKeyInformation *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - } - if (flags & NDR_OUT) { - if (r->out.unknown == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.unknown)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_GetBootKeyInformation(struct ndr_pull *ndr, int flags, struct samr_GetBootKeyInformation *r) -{ - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_unknown_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.unknown); - ZERO_STRUCTP(r->out.unknown); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.unknown); - } - _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.unknown)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_GetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetBootKeyInformation *r) -{ - ndr_print_struct(ndr, name, "samr_GetBootKeyInformation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_GetBootKeyInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_GetBootKeyInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "unknown", r->out.unknown); - ndr->depth++; - ndr_print_uint32(ndr, "unknown", *r->out.unknown); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_Connect3(struct ndr_push *ndr, int flags, const struct samr_Connect3 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); - NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - if (r->out.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_Connect3(struct ndr_pull *ndr, int flags, struct samr_Connect3 *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_connect_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); - if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); - NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - ZERO_STRUCTP(r->out.connect_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Connect3(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect3 *r) -{ - ndr_print_struct(ndr, name, "samr_Connect3"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_Connect3"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_string(ndr, "system_name", r->in.system_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown", r->in.unknown); - ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_Connect3"); - ndr->depth++; - ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_Connect4(struct ndr_push *ndr, int flags, const struct samr_Connect4 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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)); - } - NDR_CHECK(ndr_push_samr_ConnectVersion(ndr, NDR_SCALARS, r->in.client_version)); - NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - if (r->out.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_Connect4(struct ndr_pull *ndr, int flags, struct samr_Connect4 *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_connect_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); - if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_samr_ConnectVersion(ndr, NDR_SCALARS, &r->in.client_version)); - NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - ZERO_STRUCTP(r->out.connect_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Connect4(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect4 *r) -{ - ndr_print_struct(ndr, name, "samr_Connect4"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_Connect4"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_string(ndr, "system_name", r->in.system_name); - } - ndr->depth--; - ndr_print_samr_ConnectVersion(ndr, "client_version", r->in.client_version); - ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_Connect4"); - ndr->depth++; - ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ChangePasswordUser3(struct ndr_push *ndr, int flags, const struct samr_ChangePasswordUser3 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); - if (r->in.server) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); - } - if (r->in.account == 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.account)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_password)); - if (r->in.nt_password) { - NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_verifier)); - if (r->in.nt_verifier) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); - } - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.lm_change)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_password)); - if (r->in.lm_password) { - NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_verifier)); - if (r->in.lm_verifier) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password3)); - if (r->in.password3) { - NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password3)); - } - } - if (flags & NDR_OUT) { - if (r->out.dominfo == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dominfo)); - if (*r->out.dominfo) { - NDR_CHECK(ndr_push_samr_DomInfo1(ndr, NDR_SCALARS, *r->out.dominfo)); - } - if (r->out.reject == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.reject)); - if (*r->out.reject) { - NDR_CHECK(ndr_push_samr_ChangeReject(ndr, NDR_SCALARS, *r->out.reject)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ChangePasswordUser3(struct ndr_pull *ndr, int flags, struct samr_ChangePasswordUser3 *r) -{ - uint32_t _ptr_server; - uint32_t _ptr_nt_password; - uint32_t _ptr_nt_verifier; - uint32_t _ptr_lm_password; - uint32_t _ptr_lm_verifier; - uint32_t _ptr_password3; - uint32_t _ptr_dominfo; - uint32_t _ptr_reject; - TALLOC_CTX *_mem_save_server_0; - TALLOC_CTX *_mem_save_account_0; - TALLOC_CTX *_mem_save_nt_password_0; - TALLOC_CTX *_mem_save_nt_verifier_0; - TALLOC_CTX *_mem_save_lm_password_0; - TALLOC_CTX *_mem_save_lm_verifier_0; - TALLOC_CTX *_mem_save_password3_0; - TALLOC_CTX *_mem_save_dominfo_0; - TALLOC_CTX *_mem_save_dominfo_1; - TALLOC_CTX *_mem_save_reject_0; - TALLOC_CTX *_mem_save_reject_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); - if (_ptr_server) { - NDR_PULL_ALLOC(ndr, r->in.server); - } else { - r->in.server = NULL; - } - if (r->in.server) { - _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.account); - } - _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.account, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_password)); - if (_ptr_nt_password) { - NDR_PULL_ALLOC(ndr, r->in.nt_password); - } else { - r->in.nt_password = NULL; - } - if (r->in.nt_password) { - _mem_save_nt_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_password, 0); - NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_password_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_verifier)); - if (_ptr_nt_verifier) { - NDR_PULL_ALLOC(ndr, r->in.nt_verifier); - } else { - r->in.nt_verifier = NULL; - } - if (r->in.nt_verifier) { - _mem_save_nt_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_verifier, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_verifier_0, 0); - } - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.lm_change)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_password)); - if (_ptr_lm_password) { - NDR_PULL_ALLOC(ndr, r->in.lm_password); - } else { - r->in.lm_password = NULL; - } - if (r->in.lm_password) { - _mem_save_lm_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_password, 0); - NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_password_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_verifier)); - if (_ptr_lm_verifier) { - NDR_PULL_ALLOC(ndr, r->in.lm_verifier); - } else { - r->in.lm_verifier = NULL; - } - if (r->in.lm_verifier) { - _mem_save_lm_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_verifier, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_verifier_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password3)); - if (_ptr_password3) { - NDR_PULL_ALLOC(ndr, r->in.password3); - } else { - r->in.password3 = NULL; - } - if (r->in.password3) { - _mem_save_password3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.password3, 0); - NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password3_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.dominfo); - ZERO_STRUCTP(r->out.dominfo); - NDR_PULL_ALLOC(ndr, r->out.reject); - ZERO_STRUCTP(r->out.reject); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.dominfo); - } - _mem_save_dominfo_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.dominfo, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dominfo)); - if (_ptr_dominfo) { - NDR_PULL_ALLOC(ndr, *r->out.dominfo); - } else { - *r->out.dominfo = NULL; - } - if (*r->out.dominfo) { - _mem_save_dominfo_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.dominfo, 0); - NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, *r->out.dominfo)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dominfo_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dominfo_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.reject); - } - _mem_save_reject_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.reject, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_reject)); - if (_ptr_reject) { - NDR_PULL_ALLOC(ndr, *r->out.reject); - } else { - *r->out.reject = NULL; - } - if (*r->out.reject) { - _mem_save_reject_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.reject, 0); - NDR_CHECK(ndr_pull_samr_ChangeReject(ndr, NDR_SCALARS, *r->out.reject)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reject_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reject_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ChangePasswordUser3(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser3 *r) -{ - ndr_print_struct(ndr, name, "samr_ChangePasswordUser3"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_ChangePasswordUser3"); - ndr->depth++; - ndr_print_ptr(ndr, "server", r->in.server); - ndr->depth++; - if (r->in.server) { - ndr_print_lsa_String(ndr, "server", r->in.server); - } - ndr->depth--; - ndr_print_ptr(ndr, "account", r->in.account); - ndr->depth++; - ndr_print_lsa_String(ndr, "account", r->in.account); - ndr->depth--; - ndr_print_ptr(ndr, "nt_password", r->in.nt_password); - ndr->depth++; - if (r->in.nt_password) { - ndr_print_samr_CryptPassword(ndr, "nt_password", r->in.nt_password); - } - ndr->depth--; - ndr_print_ptr(ndr, "nt_verifier", r->in.nt_verifier); - ndr->depth++; - if (r->in.nt_verifier) { - ndr_print_samr_Password(ndr, "nt_verifier", r->in.nt_verifier); - } - ndr->depth--; - ndr_print_uint8(ndr, "lm_change", r->in.lm_change); - ndr_print_ptr(ndr, "lm_password", r->in.lm_password); - ndr->depth++; - if (r->in.lm_password) { - ndr_print_samr_CryptPassword(ndr, "lm_password", r->in.lm_password); - } - ndr->depth--; - ndr_print_ptr(ndr, "lm_verifier", r->in.lm_verifier); - ndr->depth++; - if (r->in.lm_verifier) { - ndr_print_samr_Password(ndr, "lm_verifier", r->in.lm_verifier); - } - ndr->depth--; - ndr_print_ptr(ndr, "password3", r->in.password3); - ndr->depth++; - if (r->in.password3) { - ndr_print_samr_CryptPassword(ndr, "password3", r->in.password3); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_ChangePasswordUser3"); - ndr->depth++; - ndr_print_ptr(ndr, "dominfo", r->out.dominfo); - ndr->depth++; - ndr_print_ptr(ndr, "dominfo", *r->out.dominfo); - ndr->depth++; - if (*r->out.dominfo) { - ndr_print_samr_DomInfo1(ndr, "dominfo", *r->out.dominfo); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "reject", r->out.reject); - ndr->depth++; - ndr_print_ptr(ndr, "reject", *r->out.reject); - ndr->depth++; - if (*r->out.reject) { - ndr_print_samr_ChangeReject(ndr, "reject", *r->out.reject); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_samr_Connect5(struct ndr_push *ndr, int flags, const struct samr_Connect5 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_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.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)); - } - NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level_in)); - if (r->in.info_in == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info_in, r->in.level_in)); - NDR_CHECK(ndr_push_samr_ConnectInfo(ndr, NDR_SCALARS, r->in.info_in)); - } - if (flags & NDR_OUT) { - if (r->out.level_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level_out)); - if (r->out.info_out == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info_out, *r->out.level_out)); - NDR_CHECK(ndr_push_samr_ConnectInfo(ndr, NDR_SCALARS, r->out.info_out)); - if (r->out.connect_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_samr_Connect5(struct ndr_pull *ndr, int flags, struct samr_Connect5 *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_info_in_0; - TALLOC_CTX *_mem_save_level_out_0; - TALLOC_CTX *_mem_save_info_out_0; - TALLOC_CTX *_mem_save_connect_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); - if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level_in)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info_in); - } - _mem_save_info_in_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info_in, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info_in, r->in.level_in)); - NDR_CHECK(ndr_pull_samr_ConnectInfo(ndr, NDR_SCALARS, r->in.info_in)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_in_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.level_out); - ZERO_STRUCTP(r->out.level_out); - NDR_PULL_ALLOC(ndr, r->out.info_out); - ZERO_STRUCTP(r->out.info_out); - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - ZERO_STRUCTP(r->out.connect_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.level_out); - } - _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.level_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info_out); - } - _mem_save_info_out_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info_out, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info_out, *r->out.level_out)); - NDR_CHECK(ndr_pull_samr_ConnectInfo(ndr, NDR_SCALARS, r->out.info_out)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_out_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.connect_handle); - } - _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_Connect5(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect5 *r) -{ - ndr_print_struct(ndr, name, "samr_Connect5"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_Connect5"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_string(ndr, "system_name", r->in.system_name); - } - ndr->depth--; - ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); - ndr_print_uint32(ndr, "level_in", r->in.level_in); - ndr_print_ptr(ndr, "info_in", r->in.info_in); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info_in, r->in.level_in); - ndr_print_samr_ConnectInfo(ndr, "info_in", r->in.info_in); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_Connect5"); - ndr->depth++; - ndr_print_ptr(ndr, "level_out", r->out.level_out); - ndr->depth++; - ndr_print_uint32(ndr, "level_out", *r->out.level_out); - ndr->depth--; - ndr_print_ptr(ndr, "info_out", r->out.info_out); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info_out, *r->out.level_out); - ndr_print_samr_ConnectInfo(ndr, "info_out", r->out.info_out); - ndr->depth--; - ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_RidToSid(struct ndr_push *ndr, int flags, const struct samr_RidToSid *r) -{ - if (flags & NDR_IN) { - if (r->in.domain_handle == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); - } - if (flags & NDR_OUT) { - if (r->out.sid == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sid)); - if (*r->out.sid) { - NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sid)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_RidToSid(struct ndr_pull *ndr, int flags, struct samr_RidToSid *r) -{ - uint32_t _ptr_sid; - TALLOC_CTX *_mem_save_domain_handle_0; - TALLOC_CTX *_mem_save_sid_0; - TALLOC_CTX *_mem_save_sid_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.domain_handle); - } - _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); - NDR_PULL_ALLOC(ndr, r->out.sid); - ZERO_STRUCTP(r->out.sid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sid); - } - _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid)); - if (_ptr_sid) { - NDR_PULL_ALLOC(ndr, *r->out.sid); - } else { - *r->out.sid = NULL; - } - if (*r->out.sid) { - _mem_save_sid_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.sid, 0); - NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_RidToSid(struct ndr_print *ndr, const char *name, int flags, const struct samr_RidToSid *r) -{ - ndr_print_struct(ndr, name, "samr_RidToSid"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_RidToSid"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); - ndr->depth--; - ndr_print_uint32(ndr, "rid", r->in.rid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_RidToSid"); - ndr->depth++; - ndr_print_ptr(ndr, "sid", r->out.sid); - ndr->depth++; - ndr_print_ptr(ndr, "sid", *r->out.sid); - ndr->depth++; - if (*r->out.sid) { - ndr_print_dom_sid2(ndr, "sid", *r->out.sid); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_SetDsrmPassword(struct ndr_push *ndr, int flags, const struct samr_SetDsrmPassword *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.name)); - if (r->in.name) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hash)); - if (r->in.hash) { - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.hash)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_SetDsrmPassword(struct ndr_pull *ndr, int flags, struct samr_SetDsrmPassword *r) -{ - uint32_t _ptr_name; - uint32_t _ptr_hash; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_hash_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->in.name); - } else { - r->in.name = NULL; - } - if (r->in.name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hash)); - if (_ptr_hash) { - NDR_PULL_ALLOC(ndr, r->in.hash); - } else { - r->in.hash = NULL; - } - if (r->in.hash) { - _mem_save_hash_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.hash, 0); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.hash)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hash_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_SetDsrmPassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDsrmPassword *r) -{ - ndr_print_struct(ndr, name, "samr_SetDsrmPassword"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_SetDsrmPassword"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - if (r->in.name) { - ndr_print_lsa_String(ndr, "name", r->in.name); - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown", r->in.unknown); - ndr_print_ptr(ndr, "hash", r->in.hash); - ndr->depth++; - if (r->in.hash) { - ndr_print_samr_Password(ndr, "hash", r->in.hash); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_SetDsrmPassword"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_samr_ValidatePassword(struct ndr_push *ndr, int flags, const struct samr_ValidatePassword *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_samr_ValidatePasswordLevel(ndr, NDR_SCALARS, r->in.level)); - if (r->in.req == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_push_samr_ValidatePasswordReq(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - } - if (flags & NDR_OUT) { - if (r->out.rep == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.rep)); - if (*r->out.rep) { - NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.rep, r->in.level)); - NDR_CHECK(ndr_push_samr_ValidatePasswordRep(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rep)); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_samr_ValidatePassword(struct ndr_pull *ndr, int flags, struct samr_ValidatePassword *r) -{ - uint32_t _ptr_rep; - TALLOC_CTX *_mem_save_req_0; - TALLOC_CTX *_mem_save_rep_0; - TALLOC_CTX *_mem_save_rep_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_samr_ValidatePasswordLevel(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.req); - } - _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level)); - NDR_CHECK(ndr_pull_samr_ValidatePasswordReq(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.rep); - ZERO_STRUCTP(r->out.rep); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.rep); - } - _mem_save_rep_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.rep, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rep)); - if (_ptr_rep) { - NDR_PULL_ALLOC(ndr, *r->out.rep); - } else { - *r->out.rep = NULL; - } - if (*r->out.rep) { - _mem_save_rep_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.rep, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.rep, r->in.level)); - NDR_CHECK(ndr_pull_samr_ValidatePasswordRep(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rep)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rep_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rep_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_samr_ValidatePassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_ValidatePassword *r) -{ - ndr_print_struct(ndr, name, "samr_ValidatePassword"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "samr_ValidatePassword"); - ndr->depth++; - ndr_print_samr_ValidatePasswordLevel(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "req", r->in.req); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.req, r->in.level); - ndr_print_samr_ValidatePasswordReq(ndr, "req", r->in.req); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "samr_ValidatePassword"); - ndr->depth++; - ndr_print_ptr(ndr, "rep", r->out.rep); - ndr->depth++; - ndr_print_ptr(ndr, "rep", *r->out.rep); - ndr->depth++; - if (*r->out.rep) { - ndr_print_set_switch_value(ndr, *r->out.rep, r->in.level); - ndr_print_samr_ValidatePasswordRep(ndr, "rep", *r->out.rep); - } - ndr->depth--; - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call samr_calls[] = { - { - "samr_Connect", - sizeof(struct samr_Connect), - (ndr_push_flags_fn_t) ndr_push_samr_Connect, - (ndr_pull_flags_fn_t) ndr_pull_samr_Connect, - (ndr_print_function_t) ndr_print_samr_Connect, - false, - }, - { - "samr_Close", - sizeof(struct samr_Close), - (ndr_push_flags_fn_t) ndr_push_samr_Close, - (ndr_pull_flags_fn_t) ndr_pull_samr_Close, - (ndr_print_function_t) ndr_print_samr_Close, - false, - }, - { - "samr_SetSecurity", - sizeof(struct samr_SetSecurity), - (ndr_push_flags_fn_t) ndr_push_samr_SetSecurity, - (ndr_pull_flags_fn_t) ndr_pull_samr_SetSecurity, - (ndr_print_function_t) ndr_print_samr_SetSecurity, - false, - }, - { - "samr_QuerySecurity", - sizeof(struct samr_QuerySecurity), - (ndr_push_flags_fn_t) ndr_push_samr_QuerySecurity, - (ndr_pull_flags_fn_t) ndr_pull_samr_QuerySecurity, - (ndr_print_function_t) ndr_print_samr_QuerySecurity, - false, - }, - { - "samr_Shutdown", - sizeof(struct samr_Shutdown), - (ndr_push_flags_fn_t) ndr_push_samr_Shutdown, - (ndr_pull_flags_fn_t) ndr_pull_samr_Shutdown, - (ndr_print_function_t) ndr_print_samr_Shutdown, - false, - }, - { - "samr_LookupDomain", - sizeof(struct samr_LookupDomain), - (ndr_push_flags_fn_t) ndr_push_samr_LookupDomain, - (ndr_pull_flags_fn_t) ndr_pull_samr_LookupDomain, - (ndr_print_function_t) ndr_print_samr_LookupDomain, - false, - }, - { - "samr_EnumDomains", - sizeof(struct samr_EnumDomains), - (ndr_push_flags_fn_t) ndr_push_samr_EnumDomains, - (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomains, - (ndr_print_function_t) ndr_print_samr_EnumDomains, - false, - }, - { - "samr_OpenDomain", - sizeof(struct samr_OpenDomain), - (ndr_push_flags_fn_t) ndr_push_samr_OpenDomain, - (ndr_pull_flags_fn_t) ndr_pull_samr_OpenDomain, - (ndr_print_function_t) ndr_print_samr_OpenDomain, - false, - }, - { - "samr_QueryDomainInfo", - sizeof(struct samr_QueryDomainInfo), - (ndr_push_flags_fn_t) ndr_push_samr_QueryDomainInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDomainInfo, - (ndr_print_function_t) ndr_print_samr_QueryDomainInfo, - false, - }, - { - "samr_SetDomainInfo", - sizeof(struct samr_SetDomainInfo), - (ndr_push_flags_fn_t) ndr_push_samr_SetDomainInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_SetDomainInfo, - (ndr_print_function_t) ndr_print_samr_SetDomainInfo, - false, - }, - { - "samr_CreateDomainGroup", - sizeof(struct samr_CreateDomainGroup), - (ndr_push_flags_fn_t) ndr_push_samr_CreateDomainGroup, - (ndr_pull_flags_fn_t) ndr_pull_samr_CreateDomainGroup, - (ndr_print_function_t) ndr_print_samr_CreateDomainGroup, - false, - }, - { - "samr_EnumDomainGroups", - sizeof(struct samr_EnumDomainGroups), - (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainGroups, - (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainGroups, - (ndr_print_function_t) ndr_print_samr_EnumDomainGroups, - false, - }, - { - "samr_CreateUser", - sizeof(struct samr_CreateUser), - (ndr_push_flags_fn_t) ndr_push_samr_CreateUser, - (ndr_pull_flags_fn_t) ndr_pull_samr_CreateUser, - (ndr_print_function_t) ndr_print_samr_CreateUser, - false, - }, - { - "samr_EnumDomainUsers", - sizeof(struct samr_EnumDomainUsers), - (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainUsers, - (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainUsers, - (ndr_print_function_t) ndr_print_samr_EnumDomainUsers, - false, - }, - { - "samr_CreateDomAlias", - sizeof(struct samr_CreateDomAlias), - (ndr_push_flags_fn_t) ndr_push_samr_CreateDomAlias, - (ndr_pull_flags_fn_t) ndr_pull_samr_CreateDomAlias, - (ndr_print_function_t) ndr_print_samr_CreateDomAlias, - false, - }, - { - "samr_EnumDomainAliases", - sizeof(struct samr_EnumDomainAliases), - (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainAliases, - (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainAliases, - (ndr_print_function_t) ndr_print_samr_EnumDomainAliases, - false, - }, - { - "samr_GetAliasMembership", - sizeof(struct samr_GetAliasMembership), - (ndr_push_flags_fn_t) ndr_push_samr_GetAliasMembership, - (ndr_pull_flags_fn_t) ndr_pull_samr_GetAliasMembership, - (ndr_print_function_t) ndr_print_samr_GetAliasMembership, - false, - }, - { - "samr_LookupNames", - sizeof(struct samr_LookupNames), - (ndr_push_flags_fn_t) ndr_push_samr_LookupNames, - (ndr_pull_flags_fn_t) ndr_pull_samr_LookupNames, - (ndr_print_function_t) ndr_print_samr_LookupNames, - false, - }, - { - "samr_LookupRids", - sizeof(struct samr_LookupRids), - (ndr_push_flags_fn_t) ndr_push_samr_LookupRids, - (ndr_pull_flags_fn_t) ndr_pull_samr_LookupRids, - (ndr_print_function_t) ndr_print_samr_LookupRids, - false, - }, - { - "samr_OpenGroup", - sizeof(struct samr_OpenGroup), - (ndr_push_flags_fn_t) ndr_push_samr_OpenGroup, - (ndr_pull_flags_fn_t) ndr_pull_samr_OpenGroup, - (ndr_print_function_t) ndr_print_samr_OpenGroup, - false, - }, - { - "samr_QueryGroupInfo", - sizeof(struct samr_QueryGroupInfo), - (ndr_push_flags_fn_t) ndr_push_samr_QueryGroupInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryGroupInfo, - (ndr_print_function_t) ndr_print_samr_QueryGroupInfo, - false, - }, - { - "samr_SetGroupInfo", - sizeof(struct samr_SetGroupInfo), - (ndr_push_flags_fn_t) ndr_push_samr_SetGroupInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_SetGroupInfo, - (ndr_print_function_t) ndr_print_samr_SetGroupInfo, - false, - }, - { - "samr_AddGroupMember", - sizeof(struct samr_AddGroupMember), - (ndr_push_flags_fn_t) ndr_push_samr_AddGroupMember, - (ndr_pull_flags_fn_t) ndr_pull_samr_AddGroupMember, - (ndr_print_function_t) ndr_print_samr_AddGroupMember, - false, - }, - { - "samr_DeleteDomainGroup", - sizeof(struct samr_DeleteDomainGroup), - (ndr_push_flags_fn_t) ndr_push_samr_DeleteDomainGroup, - (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteDomainGroup, - (ndr_print_function_t) ndr_print_samr_DeleteDomainGroup, - false, - }, - { - "samr_DeleteGroupMember", - sizeof(struct samr_DeleteGroupMember), - (ndr_push_flags_fn_t) ndr_push_samr_DeleteGroupMember, - (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteGroupMember, - (ndr_print_function_t) ndr_print_samr_DeleteGroupMember, - false, - }, - { - "samr_QueryGroupMember", - sizeof(struct samr_QueryGroupMember), - (ndr_push_flags_fn_t) ndr_push_samr_QueryGroupMember, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryGroupMember, - (ndr_print_function_t) ndr_print_samr_QueryGroupMember, - false, - }, - { - "samr_SetMemberAttributesOfGroup", - sizeof(struct samr_SetMemberAttributesOfGroup), - (ndr_push_flags_fn_t) ndr_push_samr_SetMemberAttributesOfGroup, - (ndr_pull_flags_fn_t) ndr_pull_samr_SetMemberAttributesOfGroup, - (ndr_print_function_t) ndr_print_samr_SetMemberAttributesOfGroup, - false, - }, - { - "samr_OpenAlias", - sizeof(struct samr_OpenAlias), - (ndr_push_flags_fn_t) ndr_push_samr_OpenAlias, - (ndr_pull_flags_fn_t) ndr_pull_samr_OpenAlias, - (ndr_print_function_t) ndr_print_samr_OpenAlias, - false, - }, - { - "samr_QueryAliasInfo", - sizeof(struct samr_QueryAliasInfo), - (ndr_push_flags_fn_t) ndr_push_samr_QueryAliasInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryAliasInfo, - (ndr_print_function_t) ndr_print_samr_QueryAliasInfo, - false, - }, - { - "samr_SetAliasInfo", - sizeof(struct samr_SetAliasInfo), - (ndr_push_flags_fn_t) ndr_push_samr_SetAliasInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_SetAliasInfo, - (ndr_print_function_t) ndr_print_samr_SetAliasInfo, - false, - }, - { - "samr_DeleteDomAlias", - sizeof(struct samr_DeleteDomAlias), - (ndr_push_flags_fn_t) ndr_push_samr_DeleteDomAlias, - (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteDomAlias, - (ndr_print_function_t) ndr_print_samr_DeleteDomAlias, - false, - }, - { - "samr_AddAliasMember", - sizeof(struct samr_AddAliasMember), - (ndr_push_flags_fn_t) ndr_push_samr_AddAliasMember, - (ndr_pull_flags_fn_t) ndr_pull_samr_AddAliasMember, - (ndr_print_function_t) ndr_print_samr_AddAliasMember, - false, - }, - { - "samr_DeleteAliasMember", - sizeof(struct samr_DeleteAliasMember), - (ndr_push_flags_fn_t) ndr_push_samr_DeleteAliasMember, - (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteAliasMember, - (ndr_print_function_t) ndr_print_samr_DeleteAliasMember, - false, - }, - { - "samr_GetMembersInAlias", - sizeof(struct samr_GetMembersInAlias), - (ndr_push_flags_fn_t) ndr_push_samr_GetMembersInAlias, - (ndr_pull_flags_fn_t) ndr_pull_samr_GetMembersInAlias, - (ndr_print_function_t) ndr_print_samr_GetMembersInAlias, - false, - }, - { - "samr_OpenUser", - sizeof(struct samr_OpenUser), - (ndr_push_flags_fn_t) ndr_push_samr_OpenUser, - (ndr_pull_flags_fn_t) ndr_pull_samr_OpenUser, - (ndr_print_function_t) ndr_print_samr_OpenUser, - false, - }, - { - "samr_DeleteUser", - sizeof(struct samr_DeleteUser), - (ndr_push_flags_fn_t) ndr_push_samr_DeleteUser, - (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteUser, - (ndr_print_function_t) ndr_print_samr_DeleteUser, - false, - }, - { - "samr_QueryUserInfo", - sizeof(struct samr_QueryUserInfo), - (ndr_push_flags_fn_t) ndr_push_samr_QueryUserInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryUserInfo, - (ndr_print_function_t) ndr_print_samr_QueryUserInfo, - false, - }, - { - "samr_SetUserInfo", - sizeof(struct samr_SetUserInfo), - (ndr_push_flags_fn_t) ndr_push_samr_SetUserInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_SetUserInfo, - (ndr_print_function_t) ndr_print_samr_SetUserInfo, - false, - }, - { - "samr_ChangePasswordUser", - sizeof(struct samr_ChangePasswordUser), - (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser, - (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser, - (ndr_print_function_t) ndr_print_samr_ChangePasswordUser, - false, - }, - { - "samr_GetGroupsForUser", - sizeof(struct samr_GetGroupsForUser), - (ndr_push_flags_fn_t) ndr_push_samr_GetGroupsForUser, - (ndr_pull_flags_fn_t) ndr_pull_samr_GetGroupsForUser, - (ndr_print_function_t) ndr_print_samr_GetGroupsForUser, - false, - }, - { - "samr_QueryDisplayInfo", - sizeof(struct samr_QueryDisplayInfo), - (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo, - (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo, - false, - }, - { - "samr_GetDisplayEnumerationIndex", - sizeof(struct samr_GetDisplayEnumerationIndex), - (ndr_push_flags_fn_t) ndr_push_samr_GetDisplayEnumerationIndex, - (ndr_pull_flags_fn_t) ndr_pull_samr_GetDisplayEnumerationIndex, - (ndr_print_function_t) ndr_print_samr_GetDisplayEnumerationIndex, - false, - }, - { - "samr_TestPrivateFunctionsDomain", - sizeof(struct samr_TestPrivateFunctionsDomain), - (ndr_push_flags_fn_t) ndr_push_samr_TestPrivateFunctionsDomain, - (ndr_pull_flags_fn_t) ndr_pull_samr_TestPrivateFunctionsDomain, - (ndr_print_function_t) ndr_print_samr_TestPrivateFunctionsDomain, - false, - }, - { - "samr_TestPrivateFunctionsUser", - sizeof(struct samr_TestPrivateFunctionsUser), - (ndr_push_flags_fn_t) ndr_push_samr_TestPrivateFunctionsUser, - (ndr_pull_flags_fn_t) ndr_pull_samr_TestPrivateFunctionsUser, - (ndr_print_function_t) ndr_print_samr_TestPrivateFunctionsUser, - false, - }, - { - "samr_GetUserPwInfo", - sizeof(struct samr_GetUserPwInfo), - (ndr_push_flags_fn_t) ndr_push_samr_GetUserPwInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_GetUserPwInfo, - (ndr_print_function_t) ndr_print_samr_GetUserPwInfo, - false, - }, - { - "samr_RemoveMemberFromForeignDomain", - sizeof(struct samr_RemoveMemberFromForeignDomain), - (ndr_push_flags_fn_t) ndr_push_samr_RemoveMemberFromForeignDomain, - (ndr_pull_flags_fn_t) ndr_pull_samr_RemoveMemberFromForeignDomain, - (ndr_print_function_t) ndr_print_samr_RemoveMemberFromForeignDomain, - false, - }, - { - "samr_QueryDomainInfo2", - sizeof(struct samr_QueryDomainInfo2), - (ndr_push_flags_fn_t) ndr_push_samr_QueryDomainInfo2, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDomainInfo2, - (ndr_print_function_t) ndr_print_samr_QueryDomainInfo2, - false, - }, - { - "samr_QueryUserInfo2", - sizeof(struct samr_QueryUserInfo2), - (ndr_push_flags_fn_t) ndr_push_samr_QueryUserInfo2, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryUserInfo2, - (ndr_print_function_t) ndr_print_samr_QueryUserInfo2, - false, - }, - { - "samr_QueryDisplayInfo2", - sizeof(struct samr_QueryDisplayInfo2), - (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo2, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo2, - (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo2, - false, - }, - { - "samr_GetDisplayEnumerationIndex2", - sizeof(struct samr_GetDisplayEnumerationIndex2), - (ndr_push_flags_fn_t) ndr_push_samr_GetDisplayEnumerationIndex2, - (ndr_pull_flags_fn_t) ndr_pull_samr_GetDisplayEnumerationIndex2, - (ndr_print_function_t) ndr_print_samr_GetDisplayEnumerationIndex2, - false, - }, - { - "samr_CreateUser2", - sizeof(struct samr_CreateUser2), - (ndr_push_flags_fn_t) ndr_push_samr_CreateUser2, - (ndr_pull_flags_fn_t) ndr_pull_samr_CreateUser2, - (ndr_print_function_t) ndr_print_samr_CreateUser2, - false, - }, - { - "samr_QueryDisplayInfo3", - sizeof(struct samr_QueryDisplayInfo3), - (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo3, - (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo3, - (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo3, - false, - }, - { - "samr_AddMultipleMembersToAlias", - sizeof(struct samr_AddMultipleMembersToAlias), - (ndr_push_flags_fn_t) ndr_push_samr_AddMultipleMembersToAlias, - (ndr_pull_flags_fn_t) ndr_pull_samr_AddMultipleMembersToAlias, - (ndr_print_function_t) ndr_print_samr_AddMultipleMembersToAlias, - false, - }, - { - "samr_RemoveMultipleMembersFromAlias", - sizeof(struct samr_RemoveMultipleMembersFromAlias), - (ndr_push_flags_fn_t) ndr_push_samr_RemoveMultipleMembersFromAlias, - (ndr_pull_flags_fn_t) ndr_pull_samr_RemoveMultipleMembersFromAlias, - (ndr_print_function_t) ndr_print_samr_RemoveMultipleMembersFromAlias, - false, - }, - { - "samr_OemChangePasswordUser2", - sizeof(struct samr_OemChangePasswordUser2), - (ndr_push_flags_fn_t) ndr_push_samr_OemChangePasswordUser2, - (ndr_pull_flags_fn_t) ndr_pull_samr_OemChangePasswordUser2, - (ndr_print_function_t) ndr_print_samr_OemChangePasswordUser2, - false, - }, - { - "samr_ChangePasswordUser2", - sizeof(struct samr_ChangePasswordUser2), - (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser2, - (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser2, - (ndr_print_function_t) ndr_print_samr_ChangePasswordUser2, - false, - }, - { - "samr_GetDomPwInfo", - sizeof(struct samr_GetDomPwInfo), - (ndr_push_flags_fn_t) ndr_push_samr_GetDomPwInfo, - (ndr_pull_flags_fn_t) ndr_pull_samr_GetDomPwInfo, - (ndr_print_function_t) ndr_print_samr_GetDomPwInfo, - false, - }, - { - "samr_Connect2", - sizeof(struct samr_Connect2), - (ndr_push_flags_fn_t) ndr_push_samr_Connect2, - (ndr_pull_flags_fn_t) ndr_pull_samr_Connect2, - (ndr_print_function_t) ndr_print_samr_Connect2, - false, - }, - { - "samr_SetUserInfo2", - sizeof(struct samr_SetUserInfo2), - (ndr_push_flags_fn_t) ndr_push_samr_SetUserInfo2, - (ndr_pull_flags_fn_t) ndr_pull_samr_SetUserInfo2, - (ndr_print_function_t) ndr_print_samr_SetUserInfo2, - false, - }, - { - "samr_SetBootKeyInformation", - sizeof(struct samr_SetBootKeyInformation), - (ndr_push_flags_fn_t) ndr_push_samr_SetBootKeyInformation, - (ndr_pull_flags_fn_t) ndr_pull_samr_SetBootKeyInformation, - (ndr_print_function_t) ndr_print_samr_SetBootKeyInformation, - false, - }, - { - "samr_GetBootKeyInformation", - sizeof(struct samr_GetBootKeyInformation), - (ndr_push_flags_fn_t) ndr_push_samr_GetBootKeyInformation, - (ndr_pull_flags_fn_t) ndr_pull_samr_GetBootKeyInformation, - (ndr_print_function_t) ndr_print_samr_GetBootKeyInformation, - false, - }, - { - "samr_Connect3", - sizeof(struct samr_Connect3), - (ndr_push_flags_fn_t) ndr_push_samr_Connect3, - (ndr_pull_flags_fn_t) ndr_pull_samr_Connect3, - (ndr_print_function_t) ndr_print_samr_Connect3, - false, - }, - { - "samr_Connect4", - sizeof(struct samr_Connect4), - (ndr_push_flags_fn_t) ndr_push_samr_Connect4, - (ndr_pull_flags_fn_t) ndr_pull_samr_Connect4, - (ndr_print_function_t) ndr_print_samr_Connect4, - false, - }, - { - "samr_ChangePasswordUser3", - sizeof(struct samr_ChangePasswordUser3), - (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser3, - (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser3, - (ndr_print_function_t) ndr_print_samr_ChangePasswordUser3, - false, - }, - { - "samr_Connect5", - sizeof(struct samr_Connect5), - (ndr_push_flags_fn_t) ndr_push_samr_Connect5, - (ndr_pull_flags_fn_t) ndr_pull_samr_Connect5, - (ndr_print_function_t) ndr_print_samr_Connect5, - false, - }, - { - "samr_RidToSid", - sizeof(struct samr_RidToSid), - (ndr_push_flags_fn_t) ndr_push_samr_RidToSid, - (ndr_pull_flags_fn_t) ndr_pull_samr_RidToSid, - (ndr_print_function_t) ndr_print_samr_RidToSid, - false, - }, - { - "samr_SetDsrmPassword", - sizeof(struct samr_SetDsrmPassword), - (ndr_push_flags_fn_t) ndr_push_samr_SetDsrmPassword, - (ndr_pull_flags_fn_t) ndr_pull_samr_SetDsrmPassword, - (ndr_print_function_t) ndr_print_samr_SetDsrmPassword, - false, - }, - { - "samr_ValidatePassword", - sizeof(struct samr_ValidatePassword), - (ndr_push_flags_fn_t) ndr_push_samr_ValidatePassword, - (ndr_pull_flags_fn_t) ndr_pull_samr_ValidatePassword, - (ndr_print_function_t) ndr_print_samr_ValidatePassword, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const samr_endpoint_strings[] = { - "ncacn_np:[\\pipe\\samr]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array samr_endpoints = { - .count = 3, - .names = samr_endpoint_strings -}; - -static const char * const samr_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array samr_authservices = { - .count = 1, - .names = samr_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_samr = { - .name = "samr", - .syntax_id = { - {0x12345778,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xac}}, - NDR_SAMR_VERSION - }, - .helpstring = NDR_SAMR_HELPSTRING, - .num_calls = 68, - .calls = samr_calls, - .endpoints = &samr_endpoints, - .authservices = &samr_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_samr.h b/source3/librpc/gen_ndr/ndr_samr.h deleted file mode 100644 index 64c60ee704..0000000000 --- a/source3/librpc/gen_ndr/ndr_samr.h +++ /dev/null @@ -1,349 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/samr.h" - -#ifndef _HEADER_NDR_samr -#define _HEADER_NDR_samr - -#define NDR_SAMR_UUID "12345778-1234-abcd-ef00-0123456789ac" -#define NDR_SAMR_VERSION 1.0 -#define NDR_SAMR_NAME "samr" -#define NDR_SAMR_HELPSTRING NULL -extern const struct ndr_interface_table ndr_table_samr; -#define NDR_SAMR_CONNECT (0x00) - -#define NDR_SAMR_CLOSE (0x01) - -#define NDR_SAMR_SETSECURITY (0x02) - -#define NDR_SAMR_QUERYSECURITY (0x03) - -#define NDR_SAMR_SHUTDOWN (0x04) - -#define NDR_SAMR_LOOKUPDOMAIN (0x05) - -#define NDR_SAMR_ENUMDOMAINS (0x06) - -#define NDR_SAMR_OPENDOMAIN (0x07) - -#define NDR_SAMR_QUERYDOMAININFO (0x08) - -#define NDR_SAMR_SETDOMAININFO (0x09) - -#define NDR_SAMR_CREATEDOMAINGROUP (0x0a) - -#define NDR_SAMR_ENUMDOMAINGROUPS (0x0b) - -#define NDR_SAMR_CREATEUSER (0x0c) - -#define NDR_SAMR_ENUMDOMAINUSERS (0x0d) - -#define NDR_SAMR_CREATEDOMALIAS (0x0e) - -#define NDR_SAMR_ENUMDOMAINALIASES (0x0f) - -#define NDR_SAMR_GETALIASMEMBERSHIP (0x10) - -#define NDR_SAMR_LOOKUPNAMES (0x11) - -#define NDR_SAMR_LOOKUPRIDS (0x12) - -#define NDR_SAMR_OPENGROUP (0x13) - -#define NDR_SAMR_QUERYGROUPINFO (0x14) - -#define NDR_SAMR_SETGROUPINFO (0x15) - -#define NDR_SAMR_ADDGROUPMEMBER (0x16) - -#define NDR_SAMR_DELETEDOMAINGROUP (0x17) - -#define NDR_SAMR_DELETEGROUPMEMBER (0x18) - -#define NDR_SAMR_QUERYGROUPMEMBER (0x19) - -#define NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP (0x1a) - -#define NDR_SAMR_OPENALIAS (0x1b) - -#define NDR_SAMR_QUERYALIASINFO (0x1c) - -#define NDR_SAMR_SETALIASINFO (0x1d) - -#define NDR_SAMR_DELETEDOMALIAS (0x1e) - -#define NDR_SAMR_ADDALIASMEMBER (0x1f) - -#define NDR_SAMR_DELETEALIASMEMBER (0x20) - -#define NDR_SAMR_GETMEMBERSINALIAS (0x21) - -#define NDR_SAMR_OPENUSER (0x22) - -#define NDR_SAMR_DELETEUSER (0x23) - -#define NDR_SAMR_QUERYUSERINFO (0x24) - -#define NDR_SAMR_SETUSERINFO (0x25) - -#define NDR_SAMR_CHANGEPASSWORDUSER (0x26) - -#define NDR_SAMR_GETGROUPSFORUSER (0x27) - -#define NDR_SAMR_QUERYDISPLAYINFO (0x28) - -#define NDR_SAMR_GETDISPLAYENUMERATIONINDEX (0x29) - -#define NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN (0x2a) - -#define NDR_SAMR_TESTPRIVATEFUNCTIONSUSER (0x2b) - -#define NDR_SAMR_GETUSERPWINFO (0x2c) - -#define NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN (0x2d) - -#define NDR_SAMR_QUERYDOMAININFO2 (0x2e) - -#define NDR_SAMR_QUERYUSERINFO2 (0x2f) - -#define NDR_SAMR_QUERYDISPLAYINFO2 (0x30) - -#define NDR_SAMR_GETDISPLAYENUMERATIONINDEX2 (0x31) - -#define NDR_SAMR_CREATEUSER2 (0x32) - -#define NDR_SAMR_QUERYDISPLAYINFO3 (0x33) - -#define NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS (0x34) - -#define NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS (0x35) - -#define NDR_SAMR_OEMCHANGEPASSWORDUSER2 (0x36) - -#define NDR_SAMR_CHANGEPASSWORDUSER2 (0x37) - -#define NDR_SAMR_GETDOMPWINFO (0x38) - -#define NDR_SAMR_CONNECT2 (0x39) - -#define NDR_SAMR_SETUSERINFO2 (0x3a) - -#define NDR_SAMR_SETBOOTKEYINFORMATION (0x3b) - -#define NDR_SAMR_GETBOOTKEYINFORMATION (0x3c) - -#define NDR_SAMR_CONNECT3 (0x3d) - -#define NDR_SAMR_CONNECT4 (0x3e) - -#define NDR_SAMR_CHANGEPASSWORDUSER3 (0x3f) - -#define NDR_SAMR_CONNECT5 (0x40) - -#define NDR_SAMR_RIDTOSID (0x41) - -#define NDR_SAMR_SETDSRMPASSWORD (0x42) - -#define NDR_SAMR_VALIDATEPASSWORD (0x43) - -#define NDR_SAMR_CALL_COUNT (68) -enum ndr_err_code ndr_push_netr_SamDatabaseID(struct ndr_push *ndr, int ndr_flags, enum netr_SamDatabaseID r); -enum ndr_err_code ndr_pull_netr_SamDatabaseID(struct ndr_pull *ndr, int ndr_flags, enum netr_SamDatabaseID *r); -void ndr_print_netr_SamDatabaseID(struct ndr_print *ndr, const char *name, enum netr_SamDatabaseID r); -enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int ndr_flags, enum samr_RejectReason r); -enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r); -void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r); -enum ndr_err_code ndr_push_samr_AcctFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_samr_AcctFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_samr_AcctFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_ConnectAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_UserAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_DomainAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_GroupAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_AliasAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, const struct samr_SamEntry *r); -void ndr_print_samr_SamArray(struct ndr_print *ndr, const char *name, const struct samr_SamArray *r); -void ndr_print_samr_Role(struct ndr_print *ndr, const char *name, enum samr_Role r); -enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_DomainServerState(struct ndr_print *ndr, const char *name, enum samr_DomainServerState r); -void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r); -void ndr_print_samr_DomGeneralInformation(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation *r); -void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r); -void ndr_print_samr_DomOEMInformation(struct ndr_print *ndr, const char *name, const struct samr_DomOEMInformation *r); -void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r); -void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r); -void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r); -void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r); -void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r); -void ndr_print_samr_DomGeneralInformation2(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation2 *r); -void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r); -void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r); -void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r); -void ndr_print_samr_Ids(struct ndr_print *ndr, const char *name, const struct samr_Ids *r); -enum ndr_err_code ndr_push_samr_GroupAttrs(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_samr_GroupAttrs(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_samr_GroupAttrs(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_GroupInfoAll(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAll *r); -void ndr_print_samr_GroupInfoAttributes(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAttributes *r); -void ndr_print_samr_GroupInfoEnum(struct ndr_print *ndr, const char *name, enum samr_GroupInfoEnum r); -void ndr_print_samr_GroupInfo(struct ndr_print *ndr, const char *name, const union samr_GroupInfo *r); -void ndr_print_samr_RidTypeArray(struct ndr_print *ndr, const char *name, const struct samr_RidTypeArray *r); -void ndr_print_samr_AliasInfoAll(struct ndr_print *ndr, const char *name, const struct samr_AliasInfoAll *r); -void ndr_print_samr_AliasInfoEnum(struct ndr_print *ndr, const char *name, enum samr_AliasInfoEnum r); -void ndr_print_samr_AliasInfo(struct ndr_print *ndr, const char *name, const union samr_AliasInfo *r); -void ndr_print_samr_UserInfo1(struct ndr_print *ndr, const char *name, const struct samr_UserInfo1 *r); -void ndr_print_samr_UserInfo2(struct ndr_print *ndr, const char *name, const struct samr_UserInfo2 *r); -enum ndr_err_code ndr_push_samr_LogonHours(struct ndr_push *ndr, int ndr_flags, const struct samr_LogonHours *r); -enum ndr_err_code ndr_pull_samr_LogonHours(struct ndr_pull *ndr, int ndr_flags, struct samr_LogonHours *r); -void ndr_print_samr_LogonHours(struct ndr_print *ndr, const char *name, const struct samr_LogonHours *r); -void ndr_print_samr_UserInfo3(struct ndr_print *ndr, const char *name, const struct samr_UserInfo3 *r); -void ndr_print_samr_UserInfo4(struct ndr_print *ndr, const char *name, const struct samr_UserInfo4 *r); -void ndr_print_samr_UserInfo5(struct ndr_print *ndr, const char *name, const struct samr_UserInfo5 *r); -void ndr_print_samr_UserInfo6(struct ndr_print *ndr, const char *name, const struct samr_UserInfo6 *r); -void ndr_print_samr_UserInfo7(struct ndr_print *ndr, const char *name, const struct samr_UserInfo7 *r); -void ndr_print_samr_UserInfo8(struct ndr_print *ndr, const char *name, const struct samr_UserInfo8 *r); -void ndr_print_samr_UserInfo9(struct ndr_print *ndr, const char *name, const struct samr_UserInfo9 *r); -void ndr_print_samr_UserInfo10(struct ndr_print *ndr, const char *name, const struct samr_UserInfo10 *r); -void ndr_print_samr_UserInfo11(struct ndr_print *ndr, const char *name, const struct samr_UserInfo11 *r); -void ndr_print_samr_UserInfo12(struct ndr_print *ndr, const char *name, const struct samr_UserInfo12 *r); -void ndr_print_samr_UserInfo13(struct ndr_print *ndr, const char *name, const struct samr_UserInfo13 *r); -void ndr_print_samr_UserInfo14(struct ndr_print *ndr, const char *name, const struct samr_UserInfo14 *r); -void ndr_print_samr_UserInfo16(struct ndr_print *ndr, const char *name, const struct samr_UserInfo16 *r); -void ndr_print_samr_UserInfo17(struct ndr_print *ndr, const char *name, const struct samr_UserInfo17 *r); -enum ndr_err_code ndr_push_samr_Password(struct ndr_push *ndr, int ndr_flags, const struct samr_Password *r); -enum ndr_err_code ndr_pull_samr_Password(struct ndr_pull *ndr, int ndr_flags, struct samr_Password *r); -void ndr_print_samr_Password(struct ndr_print *ndr, const char *name, const struct samr_Password *r); -void ndr_print_samr_UserInfo18(struct ndr_print *ndr, const char *name, const struct samr_UserInfo18 *r); -void ndr_print_samr_UserInfo20(struct ndr_print *ndr, const char *name, const struct samr_UserInfo20 *r); -void ndr_print_samr_FieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_UserInfo21(struct ndr_print *ndr, const char *name, const struct samr_UserInfo21 *r); -enum ndr_err_code ndr_push_samr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPassword *r); -enum ndr_err_code ndr_pull_samr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPassword *r); -void ndr_print_samr_CryptPassword(struct ndr_print *ndr, const char *name, const struct samr_CryptPassword *r); -void ndr_print_samr_UserInfo23(struct ndr_print *ndr, const char *name, const struct samr_UserInfo23 *r); -void ndr_print_samr_UserInfo24(struct ndr_print *ndr, const char *name, const struct samr_UserInfo24 *r); -void ndr_print_samr_CryptPasswordEx(struct ndr_print *ndr, const char *name, const struct samr_CryptPasswordEx *r); -void ndr_print_samr_UserInfo25(struct ndr_print *ndr, const char *name, const struct samr_UserInfo25 *r); -void ndr_print_samr_UserInfo26(struct ndr_print *ndr, const char *name, const struct samr_UserInfo26 *r); -void ndr_print_samr_UserInfo(struct ndr_print *ndr, const char *name, const union samr_UserInfo *r); -enum ndr_err_code ndr_push_samr_RidWithAttribute(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttribute *r); -enum ndr_err_code ndr_pull_samr_RidWithAttribute(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttribute *r); -void ndr_print_samr_RidWithAttribute(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttribute *r); -enum ndr_err_code ndr_push_samr_RidWithAttributeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttributeArray *r); -enum ndr_err_code ndr_pull_samr_RidWithAttributeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttributeArray *r); -void ndr_print_samr_RidWithAttributeArray(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttributeArray *r); -void ndr_print_samr_DispEntryGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispEntryGeneral *r); -void ndr_print_samr_DispInfoGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispInfoGeneral *r); -void ndr_print_samr_DispEntryFull(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFull *r); -void ndr_print_samr_DispInfoFull(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFull *r); -void ndr_print_samr_DispEntryFullGroup(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFullGroup *r); -void ndr_print_samr_DispInfoFullGroups(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFullGroups *r); -void ndr_print_samr_DispEntryAscii(struct ndr_print *ndr, const char *name, const struct samr_DispEntryAscii *r); -void ndr_print_samr_DispInfoAscii(struct ndr_print *ndr, const char *name, const struct samr_DispInfoAscii *r); -void ndr_print_samr_DispInfo(struct ndr_print *ndr, const char *name, const union samr_DispInfo *r); -void ndr_print_samr_PwInfo(struct ndr_print *ndr, const char *name, const struct samr_PwInfo *r); -void ndr_print_samr_ConnectVersion(struct ndr_print *ndr, const char *name, enum samr_ConnectVersion r); -void ndr_print_samr_ChangeReject(struct ndr_print *ndr, const char *name, const struct samr_ChangeReject *r); -void ndr_print_samr_ConnectInfo1(struct ndr_print *ndr, const char *name, const struct samr_ConnectInfo1 *r); -void ndr_print_samr_ConnectInfo(struct ndr_print *ndr, const char *name, const union samr_ConnectInfo *r); -void ndr_print_samr_ValidateFieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_samr_ValidatePasswordLevel(struct ndr_print *ndr, const char *name, enum samr_ValidatePasswordLevel r); -void ndr_print_samr_ValidationStatus(struct ndr_print *ndr, const char *name, enum samr_ValidationStatus r); -void ndr_print_samr_ValidationBlob(struct ndr_print *ndr, const char *name, const struct samr_ValidationBlob *r); -void ndr_print_samr_ValidatePasswordInfo(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordInfo *r); -void ndr_print_samr_ValidatePasswordRepCtr(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordRepCtr *r); -void ndr_print_samr_ValidatePasswordRep(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordRep *r); -void ndr_print_samr_ValidatePasswordReq3(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq3 *r); -void ndr_print_samr_ValidatePasswordReq2(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq2 *r); -void ndr_print_samr_ValidatePasswordReq1(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq1 *r); -void ndr_print_samr_ValidatePasswordReq(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordReq *r); -void ndr_print_samr_Connect(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect *r); -enum ndr_err_code ndr_push_samr_Close(struct ndr_push *ndr, int flags, const struct samr_Close *r); -enum ndr_err_code ndr_pull_samr_Close(struct ndr_pull *ndr, int flags, struct samr_Close *r); -void ndr_print_samr_Close(struct ndr_print *ndr, const char *name, int flags, const struct samr_Close *r); -void ndr_print_samr_SetSecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetSecurity *r); -void ndr_print_samr_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_QuerySecurity *r); -void ndr_print_samr_Shutdown(struct ndr_print *ndr, const char *name, int flags, const struct samr_Shutdown *r); -void ndr_print_samr_LookupDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupDomain *r); -void ndr_print_samr_EnumDomains(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomains *r); -enum ndr_err_code ndr_push_samr_OpenDomain(struct ndr_push *ndr, int flags, const struct samr_OpenDomain *r); -enum ndr_err_code ndr_pull_samr_OpenDomain(struct ndr_pull *ndr, int flags, struct samr_OpenDomain *r); -void ndr_print_samr_OpenDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenDomain *r); -void ndr_print_samr_QueryDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo *r); -void ndr_print_samr_SetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDomainInfo *r); -void ndr_print_samr_CreateDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomainGroup *r); -void ndr_print_samr_EnumDomainGroups(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainGroups *r); -void ndr_print_samr_CreateUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser *r); -void ndr_print_samr_EnumDomainUsers(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainUsers *r); -void ndr_print_samr_CreateDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomAlias *r); -void ndr_print_samr_EnumDomainAliases(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainAliases *r); -void ndr_print_samr_GetAliasMembership(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetAliasMembership *r); -enum ndr_err_code ndr_push_samr_LookupNames(struct ndr_push *ndr, int flags, const struct samr_LookupNames *r); -enum ndr_err_code ndr_pull_samr_LookupNames(struct ndr_pull *ndr, int flags, struct samr_LookupNames *r); -void ndr_print_samr_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupNames *r); -void ndr_print_samr_LookupRids(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupRids *r); -void ndr_print_samr_OpenGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenGroup *r); -void ndr_print_samr_QueryGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupInfo *r); -void ndr_print_samr_SetGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetGroupInfo *r); -void ndr_print_samr_AddGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddGroupMember *r); -void ndr_print_samr_DeleteDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomainGroup *r); -void ndr_print_samr_DeleteGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteGroupMember *r); -void ndr_print_samr_QueryGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupMember *r); -void ndr_print_samr_SetMemberAttributesOfGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetMemberAttributesOfGroup *r); -void ndr_print_samr_OpenAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenAlias *r); -void ndr_print_samr_QueryAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryAliasInfo *r); -void ndr_print_samr_SetAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetAliasInfo *r); -void ndr_print_samr_DeleteDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomAlias *r); -void ndr_print_samr_AddAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddAliasMember *r); -void ndr_print_samr_DeleteAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteAliasMember *r); -void ndr_print_samr_GetMembersInAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetMembersInAlias *r); -enum ndr_err_code ndr_push_samr_OpenUser(struct ndr_push *ndr, int flags, const struct samr_OpenUser *r); -enum ndr_err_code ndr_pull_samr_OpenUser(struct ndr_pull *ndr, int flags, struct samr_OpenUser *r); -void ndr_print_samr_OpenUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenUser *r); -void ndr_print_samr_DeleteUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteUser *r); -enum ndr_err_code ndr_push_samr_QueryUserInfo(struct ndr_push *ndr, int flags, const struct samr_QueryUserInfo *r); -enum ndr_err_code ndr_pull_samr_QueryUserInfo(struct ndr_pull *ndr, int flags, struct samr_QueryUserInfo *r); -void ndr_print_samr_QueryUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo *r); -enum ndr_err_code ndr_push_samr_SetUserInfo(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo *r); -enum ndr_err_code ndr_pull_samr_SetUserInfo(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo *r); -void ndr_print_samr_SetUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo *r); -void ndr_print_samr_ChangePasswordUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser *r); -void ndr_print_samr_GetGroupsForUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetGroupsForUser *r); -void ndr_print_samr_QueryDisplayInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo *r); -void ndr_print_samr_GetDisplayEnumerationIndex(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex *r); -void ndr_print_samr_TestPrivateFunctionsDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsDomain *r); -void ndr_print_samr_TestPrivateFunctionsUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsUser *r); -enum ndr_err_code ndr_push_samr_GetUserPwInfo(struct ndr_push *ndr, int flags, const struct samr_GetUserPwInfo *r); -enum ndr_err_code ndr_pull_samr_GetUserPwInfo(struct ndr_pull *ndr, int flags, struct samr_GetUserPwInfo *r); -void ndr_print_samr_GetUserPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetUserPwInfo *r); -void ndr_print_samr_RemoveMemberFromForeignDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMemberFromForeignDomain *r); -void ndr_print_samr_QueryDomainInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo2 *r); -void ndr_print_samr_QueryUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo2 *r); -void ndr_print_samr_QueryDisplayInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo2 *r); -void ndr_print_samr_GetDisplayEnumerationIndex2(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex2 *r); -void ndr_print_samr_CreateUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser2 *r); -void ndr_print_samr_QueryDisplayInfo3(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo3 *r); -void ndr_print_samr_AddMultipleMembersToAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddMultipleMembersToAlias *r); -void ndr_print_samr_RemoveMultipleMembersFromAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMultipleMembersFromAlias *r); -void ndr_print_samr_OemChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_OemChangePasswordUser2 *r); -void ndr_print_samr_ChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser2 *r); -void ndr_print_samr_GetDomPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDomPwInfo *r); -void ndr_print_samr_Connect2(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect2 *r); -enum ndr_err_code ndr_push_samr_SetUserInfo2(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo2 *r); -enum ndr_err_code ndr_pull_samr_SetUserInfo2(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo2 *r); -void ndr_print_samr_SetUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo2 *r); -void ndr_print_samr_SetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetBootKeyInformation *r); -void ndr_print_samr_GetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetBootKeyInformation *r); -void ndr_print_samr_Connect3(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect3 *r); -void ndr_print_samr_Connect4(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect4 *r); -void ndr_print_samr_ChangePasswordUser3(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser3 *r); -enum ndr_err_code ndr_push_samr_Connect5(struct ndr_push *ndr, int flags, const struct samr_Connect5 *r); -enum ndr_err_code ndr_pull_samr_Connect5(struct ndr_pull *ndr, int flags, struct samr_Connect5 *r); -void ndr_print_samr_Connect5(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect5 *r); -void ndr_print_samr_RidToSid(struct ndr_print *ndr, const char *name, int flags, const struct samr_RidToSid *r); -void ndr_print_samr_SetDsrmPassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDsrmPassword *r); -void ndr_print_samr_ValidatePassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_ValidatePassword *r); -#endif /* _HEADER_NDR_samr */ diff --git a/source3/librpc/gen_ndr/ndr_security.c b/source3/librpc/gen_ndr/ndr_security.c deleted file mode 100644 index b4d221ac90..0000000000 --- a/source3/librpc/gen_ndr/ndr_security.c +++ /dev/null @@ -1,1032 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_security.h" - -#include "librpc/gen_ndr/ndr_misc.h" -_PUBLIC_ enum ndr_err_code ndr_push_security_ace_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_security_ace_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_ace_flags(struct ndr_print *ndr, const char *name, uint8_t r) -{ - ndr_print_uint8(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_OBJECT_INHERIT", SEC_ACE_FLAG_OBJECT_INHERIT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_CONTAINER_INHERIT", SEC_ACE_FLAG_CONTAINER_INHERIT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_NO_PROPAGATE_INHERIT", SEC_ACE_FLAG_NO_PROPAGATE_INHERIT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_INHERIT_ONLY", SEC_ACE_FLAG_INHERIT_ONLY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_INHERITED_ACE", SEC_ACE_FLAG_INHERITED_ACE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_VALID_INHERIT", SEC_ACE_FLAG_VALID_INHERIT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_SUCCESSFUL_ACCESS", SEC_ACE_FLAG_SUCCESSFUL_ACCESS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_FAILED_ACCESS", SEC_ACE_FLAG_FAILED_ACCESS, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_security_ace_type(struct ndr_push *ndr, int ndr_flags, enum security_ace_type r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_security_ace_type(struct ndr_pull *ndr, int ndr_flags, enum security_ace_type *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_ace_type(struct ndr_print *ndr, const char *name, enum security_ace_type r) -{ - const char *val = NULL; - - switch (r) { - case SEC_ACE_TYPE_ACCESS_ALLOWED: val = "SEC_ACE_TYPE_ACCESS_ALLOWED"; break; - case SEC_ACE_TYPE_ACCESS_DENIED: val = "SEC_ACE_TYPE_ACCESS_DENIED"; break; - case SEC_ACE_TYPE_SYSTEM_AUDIT: val = "SEC_ACE_TYPE_SYSTEM_AUDIT"; break; - case SEC_ACE_TYPE_SYSTEM_ALARM: val = "SEC_ACE_TYPE_SYSTEM_ALARM"; break; - case SEC_ACE_TYPE_ALLOWED_COMPOUND: val = "SEC_ACE_TYPE_ALLOWED_COMPOUND"; break; - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: val = "SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT"; break; - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: val = "SEC_ACE_TYPE_ACCESS_DENIED_OBJECT"; break; - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: val = "SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT"; break; - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: val = "SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_security_ace_object_flags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_object_flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_ace_object_flags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SEC_ACE_OBJECT_TYPE_PRESENT", SEC_ACE_OBJECT_TYPE_PRESENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT", SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_security_ace_object_type(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_type *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->type)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_object_type(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_type *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: { - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->type)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_ace_object_type(struct ndr_print *ndr, const char *name, const union security_ace_object_type *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "security_ace_object_type"); - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: - ndr_print_GUID(ndr, "type", &r->type); - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_security_ace_object_inherited_type(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_inherited_type *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: { - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->inherited_type)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_object_inherited_type(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_inherited_type *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: { - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->inherited_type)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_ace_object_inherited_type(struct ndr_print *ndr, const char *name, const union security_ace_object_inherited_type *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "security_ace_object_inherited_type"); - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: - ndr_print_GUID(ndr, "inherited_type", &r->inherited_type); - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_security_ace_object(struct ndr_push *ndr, int ndr_flags, const struct security_ace_object *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_security_ace_object_flags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->type, r->flags & SEC_ACE_OBJECT_TYPE_PRESENT)); - NDR_CHECK(ndr_push_security_ace_object_type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->inherited_type, r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)); - NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr, NDR_SCALARS, &r->inherited_type)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_security_ace_object_type(ndr, NDR_BUFFERS, &r->type)); - NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr, NDR_BUFFERS, &r->inherited_type)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_object(struct ndr_pull *ndr, int ndr_flags, struct security_ace_object *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_security_ace_object_flags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->type, r->flags & SEC_ACE_OBJECT_TYPE_PRESENT)); - NDR_CHECK(ndr_pull_security_ace_object_type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->inherited_type, r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)); - NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr, NDR_SCALARS, &r->inherited_type)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_security_ace_object_type(ndr, NDR_BUFFERS, &r->type)); - NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr, NDR_BUFFERS, &r->inherited_type)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_ace_object(struct ndr_print *ndr, const char *name, const struct security_ace_object *r) -{ - ndr_print_struct(ndr, name, "security_ace_object"); - ndr->depth++; - ndr_print_security_ace_object_flags(ndr, "flags", r->flags); - ndr_print_set_switch_value(ndr, &r->type, r->flags & SEC_ACE_OBJECT_TYPE_PRESENT); - ndr_print_security_ace_object_type(ndr, "type", &r->type); - ndr_print_set_switch_value(ndr, &r->inherited_type, r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT); - ndr_print_security_ace_object_inherited_type(ndr, "inherited_type", &r->inherited_type); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_security_ace_object_ctr(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_ctr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: { - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: { - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: { - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: { - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_security_ace_object_ctr(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_ctr *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: { - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: { - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: { - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: { - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_ace_object_ctr(struct ndr_print *ndr, const char *name, const union security_ace_object_ctr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "security_ace_object_ctr"); - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: - ndr_print_security_ace_object(ndr, "object", &r->object); - break; - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: - ndr_print_security_ace_object(ndr, "object", &r->object); - break; - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: - ndr_print_security_ace_object(ndr, "object", &r->object); - break; - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: - ndr_print_security_ace_object(ndr, "object", &r->object); - break; - - default: - break; - - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_security_ace(struct ndr_push *ndr, int ndr_flags, const struct security_ace *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_security_ace_type(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_security_ace_flags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_security_ace(r, ndr->flags))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->access_mask)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, r->type)); - NDR_CHECK(ndr_push_security_ace_object_ctr(ndr, NDR_SCALARS, &r->object)); - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->trustee)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_security_ace_object_ctr(ndr, NDR_BUFFERS, &r->object)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_ace(struct ndr_print *ndr, const char *name, const struct security_ace *r) -{ - ndr_print_struct(ndr, name, "security_ace"); - ndr->depth++; - ndr_print_security_ace_type(ndr, "type", r->type); - ndr_print_security_ace_flags(ndr, "flags", r->flags); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_ace(r, ndr->flags):r->size); - ndr_print_uint32(ndr, "access_mask", r->access_mask); - ndr_print_set_switch_value(ndr, &r->object, r->type); - ndr_print_security_ace_object_ctr(ndr, "object", &r->object); - ndr_print_dom_sid(ndr, "trustee", &r->trustee); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_security_acl_revision(struct ndr_push *ndr, int ndr_flags, enum security_acl_revision r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_acl_revision(struct ndr_pull *ndr, int ndr_flags, enum security_acl_revision *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_acl_revision(struct ndr_print *ndr, const char *name, enum security_acl_revision r) -{ - const char *val = NULL; - - switch (r) { - case SECURITY_ACL_REVISION_NT4: val = "SECURITY_ACL_REVISION_NT4"; break; - case SECURITY_ACL_REVISION_ADS: val = "SECURITY_ACL_REVISION_ADS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_security_acl(struct ndr_push *ndr, int ndr_flags, const struct security_acl *r) -{ - uint32_t cntr_aces_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_security_acl_revision(ndr, NDR_SCALARS, r->revision)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_security_acl(r, ndr->flags))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aces)); - for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { - NDR_CHECK(ndr_push_security_ace(ndr, NDR_SCALARS, &r->aces[cntr_aces_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { - NDR_CHECK(ndr_push_security_ace(ndr, NDR_BUFFERS, &r->aces[cntr_aces_0])); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_security_acl(struct ndr_pull *ndr, int ndr_flags, struct security_acl *r) -{ - uint32_t cntr_aces_0; - TALLOC_CTX *_mem_save_aces_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_security_acl_revision(ndr, NDR_SCALARS, &r->revision)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aces)); - if (r->num_aces < 0 || r->num_aces > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC_N(ndr, r->aces, r->num_aces); - _mem_save_aces_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->aces, 0); - for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { - NDR_CHECK(ndr_pull_security_ace(ndr, NDR_SCALARS, &r->aces[cntr_aces_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_aces_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_aces_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->aces, 0); - for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { - NDR_CHECK(ndr_pull_security_ace(ndr, NDR_BUFFERS, &r->aces[cntr_aces_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_aces_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_acl(struct ndr_print *ndr, const char *name, const struct security_acl *r) -{ - uint32_t cntr_aces_0; - ndr_print_struct(ndr, name, "security_acl"); - ndr->depth++; - ndr_print_security_acl_revision(ndr, "revision", r->revision); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_acl(r, ndr->flags):r->size); - ndr_print_uint32(ndr, "num_aces", r->num_aces); - ndr->print(ndr, "%s: ARRAY(%d)", "aces", (int)r->num_aces); - ndr->depth++; - for (cntr_aces_0=0;cntr_aces_0num_aces;cntr_aces_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_aces_0) != -1) { - ndr_print_security_ace(ndr, "aces", &r->aces[cntr_aces_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_security_descriptor_revision(struct ndr_push *ndr, int ndr_flags, enum security_descriptor_revision r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_descriptor_revision(struct ndr_pull *ndr, int ndr_flags, enum security_descriptor_revision *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_descriptor_revision(struct ndr_print *ndr, const char *name, enum security_descriptor_revision r) -{ - const char *val = NULL; - - switch (r) { - case SECURITY_DESCRIPTOR_REVISION_1: val = "SECURITY_DESCRIPTOR_REVISION_1"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_security_descriptor_type(struct ndr_push *ndr, int ndr_flags, uint16_t r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_descriptor_type(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_descriptor_type(struct ndr_print *ndr, const char *name, uint16_t r) -{ - ndr_print_uint16(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_OWNER_DEFAULTED", SEC_DESC_OWNER_DEFAULTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_GROUP_DEFAULTED", SEC_DESC_GROUP_DEFAULTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_PRESENT", SEC_DESC_DACL_PRESENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_DEFAULTED", SEC_DESC_DACL_DEFAULTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_PRESENT", SEC_DESC_SACL_PRESENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_DEFAULTED", SEC_DESC_SACL_DEFAULTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_TRUSTED", SEC_DESC_DACL_TRUSTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SERVER_SECURITY", SEC_DESC_SERVER_SECURITY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERIT_REQ", SEC_DESC_DACL_AUTO_INHERIT_REQ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERIT_REQ", SEC_DESC_SACL_AUTO_INHERIT_REQ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERITED", SEC_DESC_DACL_AUTO_INHERITED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERITED", SEC_DESC_SACL_AUTO_INHERITED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_PROTECTED", SEC_DESC_DACL_PROTECTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_PROTECTED", SEC_DESC_SACL_PROTECTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_RM_CONTROL_VALID", SEC_DESC_RM_CONTROL_VALID, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SELF_RELATIVE", SEC_DESC_SELF_RELATIVE, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_security_descriptor_revision(ndr, NDR_SCALARS, r->revision)); - NDR_CHECK(ndr_push_security_descriptor_type(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->owner_sid)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->group_sid)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sacl)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dacl)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->owner_sid) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->owner_sid)); - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->owner_sid)); - } - if (r->group_sid) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->group_sid)); - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->group_sid)); - } - if (r->sacl) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->sacl)); - NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); - } - if (r->dacl) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->dacl)); - NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r) -{ - uint32_t _ptr_owner_sid; - TALLOC_CTX *_mem_save_owner_sid_0; - uint32_t _ptr_group_sid; - TALLOC_CTX *_mem_save_group_sid_0; - uint32_t _ptr_sacl; - TALLOC_CTX *_mem_save_sacl_0; - uint32_t _ptr_dacl; - TALLOC_CTX *_mem_save_dacl_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_security_descriptor_revision(ndr, NDR_SCALARS, &r->revision)); - NDR_CHECK(ndr_pull_security_descriptor_type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_owner_sid)); - if (_ptr_owner_sid) { - NDR_PULL_ALLOC(ndr, r->owner_sid); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->owner_sid, _ptr_owner_sid)); - } else { - r->owner_sid = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_sid)); - if (_ptr_group_sid) { - NDR_PULL_ALLOC(ndr, r->group_sid); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->group_sid, _ptr_group_sid)); - } else { - r->group_sid = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sacl)); - if (_ptr_sacl) { - NDR_PULL_ALLOC(ndr, r->sacl); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sacl, _ptr_sacl)); - } else { - r->sacl = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dacl)); - if (_ptr_dacl) { - NDR_PULL_ALLOC(ndr, r->dacl); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dacl, _ptr_dacl)); - } else { - r->dacl = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->owner_sid) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->owner_sid)); - _mem_save_owner_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->owner_sid, 0); - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->owner_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_owner_sid_0, 0); - ndr->offset = _relative_save_offset; - } - if (r->group_sid) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->group_sid)); - _mem_save_group_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->group_sid, 0); - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->group_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_sid_0, 0); - ndr->offset = _relative_save_offset; - } - if (r->sacl) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sacl)); - _mem_save_sacl_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sacl, 0); - NDR_CHECK(ndr_pull_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sacl_0, 0); - ndr->offset = _relative_save_offset; - } - if (r->dacl) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dacl)); - _mem_save_dacl_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dacl, 0); - NDR_CHECK(ndr_pull_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dacl_0, 0); - ndr->offset = _relative_save_offset; - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r) -{ - ndr_print_struct(ndr, name, "security_descriptor"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); - ndr->depth++; - ndr_print_security_descriptor_revision(ndr, "revision", r->revision); - ndr_print_security_descriptor_type(ndr, "type", r->type); - ndr_print_ptr(ndr, "owner_sid", r->owner_sid); - ndr->depth++; - if (r->owner_sid) { - ndr_print_dom_sid(ndr, "owner_sid", r->owner_sid); - } - ndr->depth--; - ndr_print_ptr(ndr, "group_sid", r->group_sid); - ndr->depth++; - if (r->group_sid) { - ndr_print_dom_sid(ndr, "group_sid", r->group_sid); - } - ndr->depth--; - ndr_print_ptr(ndr, "sacl", r->sacl); - ndr->depth++; - if (r->sacl) { - ndr_print_security_acl(ndr, "sacl", r->sacl); - } - ndr->depth--; - ndr_print_ptr(ndr, "dacl", r->dacl); - ndr->depth++; - if (r->dacl) { - ndr_print_security_acl(ndr, "dacl", r->dacl); - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_sec_desc_buf(struct ndr_push *ndr, int ndr_flags, const struct sec_desc_buf *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_security_descriptor(r->sd, ndr->flags))); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sd) { - { - struct ndr_push *_ndr_sd; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sd, 4, -1)); - NDR_CHECK(ndr_push_security_descriptor(_ndr_sd, NDR_SCALARS|NDR_BUFFERS, r->sd)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sd, 4, -1)); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_sec_desc_buf(struct ndr_pull *ndr, int ndr_flags, struct sec_desc_buf *r) -{ - uint32_t _ptr_sd; - TALLOC_CTX *_mem_save_sd_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sd_size)); - if (r->sd_size < 0 || r->sd_size > 0x40000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd)); - if (_ptr_sd) { - NDR_PULL_ALLOC(ndr, r->sd); - } else { - r->sd = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sd) { - _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0); - { - struct ndr_pull *_ndr_sd; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sd, 4, -1)); - NDR_CHECK(ndr_pull_security_descriptor(_ndr_sd, NDR_SCALARS|NDR_BUFFERS, r->sd)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sd, 4, -1)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_sec_desc_buf(struct ndr_print *ndr, const char *name, const struct sec_desc_buf *r) -{ - ndr_print_struct(ndr, name, "sec_desc_buf"); - ndr->depth++; - ndr_print_uint32(ndr, "sd_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_descriptor(r->sd, ndr->flags):r->sd_size); - ndr_print_ptr(ndr, "sd", r->sd); - ndr->depth++; - if (r->sd) { - ndr_print_security_descriptor(ndr, "sd", r->sd); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_security_token(struct ndr_push *ndr, int ndr_flags, const struct security_token *r) -{ - uint32_t cntr_sids_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_sid)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_sid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); - for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids[cntr_sids_0])); - } - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->privilege_mask)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user_sid) { - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->user_sid)); - } - if (r->group_sid) { - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->group_sid)); - } - for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { - if (r->sids[cntr_sids_0]) { - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->sids[cntr_sids_0])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_security_token(struct ndr_pull *ndr, int ndr_flags, struct security_token *r) -{ - uint32_t _ptr_user_sid; - TALLOC_CTX *_mem_save_user_sid_0; - uint32_t _ptr_group_sid; - TALLOC_CTX *_mem_save_group_sid_0; - uint32_t _ptr_sids; - uint32_t cntr_sids_0; - TALLOC_CTX *_mem_save_sids_0; - TALLOC_CTX *_mem_save_sids_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_sid)); - if (_ptr_user_sid) { - NDR_PULL_ALLOC(ndr, r->user_sid); - } else { - r->user_sid = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_sid)); - if (_ptr_group_sid) { - NDR_PULL_ALLOC(ndr, r->group_sid); - } else { - r->group_sid = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); - NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); - if (_ptr_sids) { - NDR_PULL_ALLOC(ndr, r->sids[cntr_sids_0]); - } else { - r->sids[cntr_sids_0] = NULL; - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->privilege_mask)); - if (r->sids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids)); - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user_sid) { - _mem_save_user_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user_sid, 0); - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->user_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_sid_0, 0); - } - if (r->group_sid) { - _mem_save_group_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->group_sid, 0); - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->group_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_sid_0, 0); - } - _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); - for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { - if (r->sids[cntr_sids_0]) { - _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sids[cntr_sids_0], 0); - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->sids[cntr_sids_0])); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_token(struct ndr_print *ndr, const char *name, const struct security_token *r) -{ - uint32_t cntr_sids_0; - ndr_print_struct(ndr, name, "security_token"); - ndr->depth++; - ndr_print_ptr(ndr, "user_sid", r->user_sid); - ndr->depth++; - if (r->user_sid) { - ndr_print_dom_sid(ndr, "user_sid", r->user_sid); - } - ndr->depth--; - ndr_print_ptr(ndr, "group_sid", r->group_sid); - ndr->depth++; - if (r->group_sid) { - ndr_print_dom_sid(ndr, "group_sid", r->group_sid); - } - ndr->depth--; - ndr_print_uint32(ndr, "num_sids", r->num_sids); - ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids); - ndr->depth++; - for (cntr_sids_0=0;cntr_sids_0num_sids;cntr_sids_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_sids_0) != -1) { - ndr_print_ptr(ndr, "sids", r->sids[cntr_sids_0]); - ndr->depth++; - if (r->sids[cntr_sids_0]) { - ndr_print_dom_sid(ndr, "sids", r->sids[cntr_sids_0]); - } - ndr->depth--; - free(idx_0); - } - } - ndr->depth--; - ndr_print_udlong(ndr, "privilege_mask", r->privilege_mask); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_security_secinfo(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_security_secinfo(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_secinfo(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_OWNER", SECINFO_OWNER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_GROUP", SECINFO_GROUP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_DACL", SECINFO_DACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_SACL", SECINFO_SACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_UNPROTECTED_SACL", SECINFO_UNPROTECTED_SACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_UNPROTECTED_DACL", SECINFO_UNPROTECTED_DACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_PROTECTED_SACL", SECINFO_PROTECTED_SACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_PROTECTED_DACL", SECINFO_PROTECTED_DACL, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_kerb_EncTypes(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_kerb_EncTypes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_kerb_EncTypes(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_DES_CBC_CRC", KERB_ENCTYPE_DES_CBC_CRC, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_DES_CBC_MD5", KERB_ENCTYPE_DES_CBC_MD5, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_RC4_HMAC_MD5", KERB_ENCTYPE_RC4_HMAC_MD5, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96", KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96", KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96, r); - ndr->depth--; -} - diff --git a/source3/librpc/gen_ndr/ndr_security.h b/source3/librpc/gen_ndr/ndr_security.h deleted file mode 100644 index 41c66aa65b..0000000000 --- a/source3/librpc/gen_ndr/ndr_security.h +++ /dev/null @@ -1,54 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/security.h" - -#ifndef _HEADER_NDR_security -#define _HEADER_NDR_security - -#define NDR_SECURITY_CALL_COUNT (0) -enum ndr_err_code ndr_push_dom_sid(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *r); -enum ndr_err_code ndr_pull_dom_sid(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *r); -void ndr_print_dom_sid(struct ndr_print *ndr, const char *name, const struct dom_sid *r); -size_t ndr_size_dom_sid(const struct dom_sid *r, int flags); -enum ndr_err_code ndr_push_security_ace_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r); -enum ndr_err_code ndr_pull_security_ace_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r); -void ndr_print_security_ace_flags(struct ndr_print *ndr, const char *name, uint8_t r); -enum ndr_err_code ndr_push_security_ace_type(struct ndr_push *ndr, int ndr_flags, enum security_ace_type r); -enum ndr_err_code ndr_pull_security_ace_type(struct ndr_pull *ndr, int ndr_flags, enum security_ace_type *r); -void ndr_print_security_ace_type(struct ndr_print *ndr, const char *name, enum security_ace_type r); -void ndr_print_security_ace_object_flags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_security_ace_object_type(struct ndr_print *ndr, const char *name, const union security_ace_object_type *r); -void ndr_print_security_ace_object_inherited_type(struct ndr_print *ndr, const char *name, const union security_ace_object_inherited_type *r); -void ndr_print_security_ace_object(struct ndr_print *ndr, const char *name, const struct security_ace_object *r); -enum ndr_err_code ndr_push_security_ace_object_ctr(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_ctr *r); -enum ndr_err_code ndr_pull_security_ace_object_ctr(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_ctr *r); -void ndr_print_security_ace_object_ctr(struct ndr_print *ndr, const char *name, const union security_ace_object_ctr *r); -enum ndr_err_code ndr_push_security_ace(struct ndr_push *ndr, int ndr_flags, const struct security_ace *r); -enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, struct security_ace *r); -void ndr_print_security_ace(struct ndr_print *ndr, const char *name, const struct security_ace *r); -size_t ndr_size_security_ace(const struct security_ace *r, int flags); -void ndr_print_security_acl_revision(struct ndr_print *ndr, const char *name, enum security_acl_revision r); -enum ndr_err_code ndr_push_security_acl(struct ndr_push *ndr, int ndr_flags, const struct security_acl *r); -enum ndr_err_code ndr_pull_security_acl(struct ndr_pull *ndr, int ndr_flags, struct security_acl *r); -void ndr_print_security_acl(struct ndr_print *ndr, const char *name, const struct security_acl *r); -size_t ndr_size_security_acl(const struct security_acl *r, int flags); -void ndr_print_security_descriptor_revision(struct ndr_print *ndr, const char *name, enum security_descriptor_revision r); -void ndr_print_security_descriptor_type(struct ndr_print *ndr, const char *name, uint16_t r); -enum ndr_err_code ndr_push_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r); -enum ndr_err_code ndr_pull_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r); -void ndr_print_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r); -size_t ndr_size_security_descriptor(const struct security_descriptor *r, int flags); -enum ndr_err_code ndr_push_sec_desc_buf(struct ndr_push *ndr, int ndr_flags, const struct sec_desc_buf *r); -enum ndr_err_code ndr_pull_sec_desc_buf(struct ndr_pull *ndr, int ndr_flags, struct sec_desc_buf *r); -void ndr_print_sec_desc_buf(struct ndr_print *ndr, const char *name, const struct sec_desc_buf *r); -enum ndr_err_code ndr_push_security_token(struct ndr_push *ndr, int ndr_flags, const struct security_token *r); -enum ndr_err_code ndr_pull_security_token(struct ndr_pull *ndr, int ndr_flags, struct security_token *r); -void ndr_print_security_token(struct ndr_print *ndr, const char *name, const struct security_token *r); -enum ndr_err_code ndr_push_security_secinfo(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_security_secinfo(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_security_secinfo(struct ndr_print *ndr, const char *name, uint32_t r); -enum ndr_err_code ndr_push_kerb_EncTypes(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_kerb_EncTypes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_kerb_EncTypes(struct ndr_print *ndr, const char *name, uint32_t r); -#endif /* _HEADER_NDR_security */ diff --git a/source3/librpc/gen_ndr/ndr_srvsvc.c b/source3/librpc/gen_ndr/ndr_srvsvc.c deleted file mode 100644 index 125542d14a..0000000000 --- a/source3/librpc/gen_ndr/ndr_srvsvc.c +++ /dev/null @@ -1,19687 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_srvsvc.h" - -#include "librpc/gen_ndr/ndr_security.h" -#include "librpc/gen_ndr/ndr_svcctl.h" -static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->device)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->device) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevInfo0 *r) -{ - uint32_t _ptr_device; - TALLOC_CTX *_mem_save_device_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device)); - if (_ptr_device) { - NDR_PULL_ALLOC(ndr, r->device); - } else { - r->device = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->device) { - _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->device, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->device)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->device)); - if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo0 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevInfo0"); - ndr->depth++; - ndr_print_ptr(ndr, "device", r->device); - ndr->depth++; - if (r->device) { - ndr_print_string(ndr, "device", r->device); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevCtr0 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevCtr0 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr0 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetCharDevCtr0"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetCharDevInfo0(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->device)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->device) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevInfo1 *r) -{ - uint32_t _ptr_device; - TALLOC_CTX *_mem_save_device_0; - uint32_t _ptr_user; - TALLOC_CTX *_mem_save_user_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device)); - if (_ptr_device) { - NDR_PULL_ALLOC(ndr, r->device); - } else { - r->device = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->user); - } else { - r->user = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->device) { - _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->device, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->device)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->device)); - if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0); - } - if (r->user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); - if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo1 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevInfo1"); - ndr->depth++; - ndr_print_ptr(ndr, "device", r->device); - ndr->depth++; - if (r->device) { - ndr_print_string(ndr, "device", r->device); - } - ndr->depth--; - ndr_print_uint32(ndr, "status", r->status); - ndr_print_ptr(ndr, "user", r->user); - ndr->depth++; - if (r->user) { - ndr_print_string(ndr, "user", r->user); - } - ndr->depth--; - ndr_print_uint32(ndr, "time", r->time); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevCtr1 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevCtr1 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr1 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetCharDevCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetCharDevInfo1(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->info0) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - } - break; - - case 1: - if (r->info1) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info0_0; - TALLOC_CTX *_mem_save_info1_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_info0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); - if (_ptr_info0) { - NDR_PULL_ALLOC(ndr, r->info0); - } else { - r->info0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_info1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); - if (_ptr_info1) { - NDR_PULL_ALLOC(ndr, r->info1); - } else { - r->info1 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->info0) { - _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); - } - break; - - case 1: - if (r->info1) { - _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetCharDevInfo"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "info0", r->info0); - ndr->depth++; - if (r->info0) { - ndr_print_srvsvc_NetCharDevInfo0(ndr, "info0", r->info0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "info1", r->info1); - ndr->depth++; - if (r->info1) { - ndr_print_srvsvc_NetCharDevInfo1(ndr, "info1", r->info1); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->ctr0) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - } - break; - - case 1: - if (r->ctr1) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_ctr0_0; - TALLOC_CTX *_mem_save_ctr1_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_ctr0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); - if (_ptr_ctr0) { - NDR_PULL_ALLOC(ndr, r->ctr0); - } else { - r->ctr0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_ctr1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); - if (_ptr_ctr1) { - NDR_PULL_ALLOC(ndr, r->ctr1); - } else { - r->ctr1 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->ctr0) { - _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); - } - break; - - case 1: - if (r->ctr1) { - _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetCharDevCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "ctr0", r->ctr0); - ndr->depth++; - if (r->ctr0) { - ndr_print_srvsvc_NetCharDevCtr0(ndr, "ctr0", r->ctr0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "ctr1", r->ctr1); - ndr->depth++; - if (r->ctr1) { - ndr_print_srvsvc_NetCharDevCtr1(ndr, "ctr1", r->ctr1); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfoCtr *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevInfoCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_srvsvc_NetCharDevCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->device)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->device) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQInfo0 *r) -{ - uint32_t _ptr_device; - TALLOC_CTX *_mem_save_device_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device)); - if (_ptr_device) { - NDR_PULL_ALLOC(ndr, r->device); - } else { - r->device = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->device) { - _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->device, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->device)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->device)); - if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo0 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQInfo0"); - ndr->depth++; - ndr_print_ptr(ndr, "device", r->device); - ndr->depth++; - if (r->device) { - ndr_print_string(ndr, "device", r->device); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQCtr0 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQCtr0 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr0 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQCtr0"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetCharDevQInfo0(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->device)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->devices)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->users)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_ahead)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->device) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->devices) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->devices, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->devices, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->devices, ndr_charset_length(r->devices, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQInfo1 *r) -{ - uint32_t _ptr_device; - TALLOC_CTX *_mem_save_device_0; - uint32_t _ptr_devices; - TALLOC_CTX *_mem_save_devices_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device)); - if (_ptr_device) { - NDR_PULL_ALLOC(ndr, r->device); - } else { - r->device = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devices)); - if (_ptr_devices) { - NDR_PULL_ALLOC(ndr, r->devices); - } else { - r->devices = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->users)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_ahead)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->device) { - _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->device, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->device)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->device)); - if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0); - } - if (r->devices) { - _mem_save_devices_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->devices, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->devices)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->devices)); - if (ndr_get_array_length(ndr, &r->devices) > ndr_get_array_size(ndr, &r->devices)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->devices), ndr_get_array_length(ndr, &r->devices)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->devices), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->devices, ndr_get_array_length(ndr, &r->devices), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devices_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo1 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQInfo1"); - ndr->depth++; - ndr_print_ptr(ndr, "device", r->device); - ndr->depth++; - if (r->device) { - ndr_print_string(ndr, "device", r->device); - } - ndr->depth--; - ndr_print_uint32(ndr, "priority", r->priority); - ndr_print_ptr(ndr, "devices", r->devices); - ndr->depth++; - if (r->devices) { - ndr_print_string(ndr, "devices", r->devices); - } - ndr->depth--; - ndr_print_uint32(ndr, "users", r->users); - ndr_print_uint32(ndr, "num_ahead", r->num_ahead); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQCtr1 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQCtr1 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr1 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetCharDevQInfo1(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevQInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->info0) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - } - break; - - case 1: - if (r->info1) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevQInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info0_0; - TALLOC_CTX *_mem_save_info1_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_info0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); - if (_ptr_info0) { - NDR_PULL_ALLOC(ndr, r->info0); - } else { - r->info0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_info1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); - if (_ptr_info1) { - NDR_PULL_ALLOC(ndr, r->info1); - } else { - r->info1 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->info0) { - _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); - } - break; - - case 1: - if (r->info1) { - _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetCharDevQInfo"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "info0", r->info0); - ndr->depth++; - if (r->info0) { - ndr_print_srvsvc_NetCharDevQInfo0(ndr, "info0", r->info0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "info1", r->info1); - ndr->depth++; - if (r->info1) { - ndr_print_srvsvc_NetCharDevQInfo1(ndr, "info1", r->info1); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevQCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->ctr0) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - } - break; - - case 1: - if (r->ctr1) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevQCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_ctr0_0; - TALLOC_CTX *_mem_save_ctr1_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_ctr0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); - if (_ptr_ctr0) { - NDR_PULL_ALLOC(ndr, r->ctr0); - } else { - r->ctr0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_ctr1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); - if (_ptr_ctr1) { - NDR_PULL_ALLOC(ndr, r->ctr1); - } else { - r->ctr1 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->ctr0) { - _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); - } - break; - - case 1: - if (r->ctr1) { - _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetCharDevQCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "ctr0", r->ctr0); - ndr->depth++; - if (r->ctr0) { - ndr_print_srvsvc_NetCharDevQCtr0(ndr, "ctr0", r->ctr0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "ctr1", r->ctr1); - ndr->depth++; - if (r->ctr1) { - ndr_print_srvsvc_NetCharDevQCtr1(ndr, "ctr1", r->ctr1); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfoCtr *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQInfoCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_srvsvc_NetCharDevQCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetConnInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_id)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetConnInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_id)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetConnInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo0 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetConnInfo0"); - ndr->depth++; - ndr_print_uint32(ndr, "conn_id", r->conn_id); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetConnCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnCtr0 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetConnInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetConnCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnCtr0 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetConnInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetConnCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr0 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetConnCtr0"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetConnInfo0(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetConnInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_id)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_users)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_time)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->share)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->share) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->share, ndr_charset_length(r->share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetConnInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnInfo1 *r) -{ - uint32_t _ptr_user; - TALLOC_CTX *_mem_save_user_0; - uint32_t _ptr_share; - TALLOC_CTX *_mem_save_share_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_id)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_users)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_time)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->user); - } else { - r->user = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); - if (_ptr_share) { - NDR_PULL_ALLOC(ndr, r->share); - } else { - r->share = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); - if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - if (r->share) { - _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->share, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->share)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->share)); - if (ndr_get_array_length(ndr, &r->share) > ndr_get_array_size(ndr, &r->share)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->share), ndr_get_array_length(ndr, &r->share)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->share, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetConnInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo1 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetConnInfo1"); - ndr->depth++; - ndr_print_uint32(ndr, "conn_id", r->conn_id); - ndr_print_uint32(ndr, "conn_type", r->conn_type); - ndr_print_uint32(ndr, "num_open", r->num_open); - ndr_print_uint32(ndr, "num_users", r->num_users); - ndr_print_uint32(ndr, "conn_time", r->conn_time); - ndr_print_ptr(ndr, "user", r->user); - ndr->depth++; - if (r->user) { - ndr_print_string(ndr, "user", r->user); - } - ndr->depth--; - ndr_print_ptr(ndr, "share", r->share); - ndr->depth++; - if (r->share) { - ndr_print_string(ndr, "share", r->share); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetConnCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnCtr1 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetConnInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetConnInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetConnCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnCtr1 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetConnInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetConnInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetConnCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr1 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetConnCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetConnInfo1(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetConnCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetConnCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->ctr0) { - NDR_CHECK(ndr_push_srvsvc_NetConnCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - } - break; - - case 1: - if (r->ctr1) { - NDR_CHECK(ndr_push_srvsvc_NetConnCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetConnCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetConnCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_ctr0_0; - TALLOC_CTX *_mem_save_ctr1_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_ctr0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); - if (_ptr_ctr0) { - NDR_PULL_ALLOC(ndr, r->ctr0); - } else { - r->ctr0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_ctr1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); - if (_ptr_ctr1) { - NDR_PULL_ALLOC(ndr, r->ctr1); - } else { - r->ctr1 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->ctr0) { - _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); - NDR_CHECK(ndr_pull_srvsvc_NetConnCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); - } - break; - - case 1: - if (r->ctr1) { - _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); - NDR_CHECK(ndr_pull_srvsvc_NetConnCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetConnCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetConnCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetConnCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "ctr0", r->ctr0); - ndr->depth++; - if (r->ctr0) { - ndr_print_srvsvc_NetConnCtr0(ndr, "ctr0", r->ctr0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "ctr1", r->ctr1); - ndr->depth++; - if (r->ctr1) { - ndr_print_srvsvc_NetConnCtr1(ndr, "ctr1", r->ctr1); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetConnInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_srvsvc_NetConnCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_srvsvc_NetConnCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetConnInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_srvsvc_NetConnCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_srvsvc_NetConnCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetConnInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfoCtr *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetConnInfoCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_srvsvc_NetConnCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->fid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->fid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo2 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetFileInfo2"); - ndr->depth++; - ndr_print_uint32(ndr, "fid", r->fid); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileCtr2 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileCtr2 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr2 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetFileCtr2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetFileInfo2(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileInfo3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileInfo3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->fid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->permissions)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_locks)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileInfo3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileInfo3 *r) -{ - uint32_t _ptr_path; - TALLOC_CTX *_mem_save_path_0; - uint32_t _ptr_user; - TALLOC_CTX *_mem_save_user_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->fid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->permissions)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_locks)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->path); - } else { - r->path = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->user); - } else { - r->user = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); - if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - if (r->user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); - if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileInfo3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo3 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetFileInfo3"); - ndr->depth++; - ndr_print_uint32(ndr, "fid", r->fid); - ndr_print_uint32(ndr, "permissions", r->permissions); - ndr_print_uint32(ndr, "num_locks", r->num_locks); - ndr_print_ptr(ndr, "path", r->path); - ndr->depth++; - if (r->path) { - ndr_print_string(ndr, "path", r->path); - } - ndr->depth--; - ndr_print_ptr(ndr, "user", r->user); - ndr->depth++; - if (r->user) { - ndr_print_string(ndr, "user", r->user); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileCtr3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileCtr3 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetFileInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetFileInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileCtr3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileCtr3 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetFileInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetFileInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileCtr3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr3 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetFileCtr3"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetFileInfo3(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetFileInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 2: - if (r->info2) { - NDR_CHECK(ndr_push_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, r->info2)); - } - break; - - case 3: - if (r->info3) { - NDR_CHECK(ndr_push_srvsvc_NetFileInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetFileInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info2_0; - TALLOC_CTX *_mem_save_info3_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 2: { - uint32_t _ptr_info2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); - if (_ptr_info2) { - NDR_PULL_ALLOC(ndr, r->info2); - } else { - r->info2 = NULL; - } - break; } - - case 3: { - uint32_t _ptr_info3; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); - if (_ptr_info3) { - NDR_PULL_ALLOC(ndr, r->info3); - } else { - r->info3 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 2: - if (r->info2) { - _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); - NDR_CHECK(ndr_pull_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, r->info2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); - } - break; - - case 3: - if (r->info3) { - _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); - NDR_CHECK(ndr_pull_srvsvc_NetFileInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetFileInfo"); - switch (level) { - case 2: - ndr_print_ptr(ndr, "info2", r->info2); - ndr->depth++; - if (r->info2) { - ndr_print_srvsvc_NetFileInfo2(ndr, "info2", r->info2); - } - ndr->depth--; - break; - - case 3: - ndr_print_ptr(ndr, "info3", r->info3); - ndr->depth++; - if (r->info3) { - ndr_print_srvsvc_NetFileInfo3(ndr, "info3", r->info3); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetFileCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr3)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 2: - if (r->ctr2) { - NDR_CHECK(ndr_push_srvsvc_NetFileCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - } - break; - - case 3: - if (r->ctr3) { - NDR_CHECK(ndr_push_srvsvc_NetFileCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetFileCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_ctr2_0; - TALLOC_CTX *_mem_save_ctr3_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 2: { - uint32_t _ptr_ctr2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); - if (_ptr_ctr2) { - NDR_PULL_ALLOC(ndr, r->ctr2); - } else { - r->ctr2 = NULL; - } - break; } - - case 3: { - uint32_t _ptr_ctr3; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr3)); - if (_ptr_ctr3) { - NDR_PULL_ALLOC(ndr, r->ctr3); - } else { - r->ctr3 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 2: - if (r->ctr2) { - _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); - NDR_CHECK(ndr_pull_srvsvc_NetFileCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); - } - break; - - case 3: - if (r->ctr3) { - _mem_save_ctr3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr3, 0); - NDR_CHECK(ndr_pull_srvsvc_NetFileCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr3_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetFileCtr"); - switch (level) { - case 2: - ndr_print_ptr(ndr, "ctr2", r->ctr2); - ndr->depth++; - if (r->ctr2) { - ndr_print_srvsvc_NetFileCtr2(ndr, "ctr2", r->ctr2); - } - ndr->depth--; - break; - - case 3: - ndr_print_ptr(ndr, "ctr3", r->ctr3); - ndr->depth++; - if (r->ctr3) { - ndr_print_srvsvc_NetFileCtr3(ndr, "ctr3", r->ctr3); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_srvsvc_NetFileCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_srvsvc_NetFileCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_srvsvc_NetFileCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_srvsvc_NetFileCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfoCtr *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetFileInfoCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_srvsvc_NetFileCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo0 *r) -{ - uint32_t _ptr_client; - TALLOC_CTX *_mem_save_client_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); - if (_ptr_client) { - NDR_PULL_ALLOC(ndr, r->client); - } else { - r->client = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); - if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo0 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSessInfo0"); - ndr->depth++; - ndr_print_ptr(ndr, "client", r->client); - ndr->depth++; - if (r->client) { - ndr_print_string(ndr, "client", r->client); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr0 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr0 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr0 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetSessCtr0"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetSessInfo0(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->user_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo1 *r) -{ - uint32_t _ptr_client; - TALLOC_CTX *_mem_save_client_0; - uint32_t _ptr_user; - TALLOC_CTX *_mem_save_user_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); - if (_ptr_client) { - NDR_PULL_ALLOC(ndr, r->client); - } else { - r->client = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->user); - } else { - r->user = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->user_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); - if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); - } - if (r->user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); - if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo1 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSessInfo1"); - ndr->depth++; - ndr_print_ptr(ndr, "client", r->client); - ndr->depth++; - if (r->client) { - ndr_print_string(ndr, "client", r->client); - } - ndr->depth--; - ndr_print_ptr(ndr, "user", r->user); - ndr->depth++; - if (r->user) { - ndr_print_string(ndr, "user", r->user); - } - ndr->depth--; - ndr_print_uint32(ndr, "num_open", r->num_open); - ndr_print_uint32(ndr, "time", r->time); - ndr_print_uint32(ndr, "idle_time", r->idle_time); - ndr_print_uint32(ndr, "user_flags", r->user_flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr1 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr1 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr1 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetSessCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetSessInfo1(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->user_flags)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_type)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->client_type) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_type, ndr_charset_length(r->client_type, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo2 *r) -{ - uint32_t _ptr_client; - TALLOC_CTX *_mem_save_client_0; - uint32_t _ptr_user; - TALLOC_CTX *_mem_save_user_0; - uint32_t _ptr_client_type; - TALLOC_CTX *_mem_save_client_type_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); - if (_ptr_client) { - NDR_PULL_ALLOC(ndr, r->client); - } else { - r->client = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->user); - } else { - r->user = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->user_flags)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_type)); - if (_ptr_client_type) { - NDR_PULL_ALLOC(ndr, r->client_type); - } else { - r->client_type = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); - if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); - } - if (r->user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); - if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - if (r->client_type) { - _mem_save_client_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->client_type, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->client_type)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->client_type)); - if (ndr_get_array_length(ndr, &r->client_type) > ndr_get_array_size(ndr, &r->client_type)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_type), ndr_get_array_length(ndr, &r->client_type)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_type, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_type_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo2 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSessInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "client", r->client); - ndr->depth++; - if (r->client) { - ndr_print_string(ndr, "client", r->client); - } - ndr->depth--; - ndr_print_ptr(ndr, "user", r->user); - ndr->depth++; - if (r->user) { - ndr_print_string(ndr, "user", r->user); - } - ndr->depth--; - ndr_print_uint32(ndr, "num_open", r->num_open); - ndr_print_uint32(ndr, "time", r->time); - ndr_print_uint32(ndr, "idle_time", r->idle_time); - ndr_print_uint32(ndr, "user_flags", r->user_flags); - ndr_print_ptr(ndr, "client_type", r->client_type); - ndr->depth++; - if (r->client_type) { - ndr_print_string(ndr, "client_type", r->client_type); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr2 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr2 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr2 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetSessCtr2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetSessInfo2(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessInfo10(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo10 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo10(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo10 *r) -{ - uint32_t _ptr_client; - TALLOC_CTX *_mem_save_client_0; - uint32_t _ptr_user; - TALLOC_CTX *_mem_save_user_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); - if (_ptr_client) { - NDR_PULL_ALLOC(ndr, r->client); - } else { - r->client = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->user); - } else { - r->user = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); - if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); - } - if (r->user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); - if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessInfo10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo10 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSessInfo10"); - ndr->depth++; - ndr_print_ptr(ndr, "client", r->client); - ndr->depth++; - if (r->client) { - ndr_print_string(ndr, "client", r->client); - } - ndr->depth--; - ndr_print_ptr(ndr, "user", r->user); - ndr->depth++; - if (r->user) { - ndr_print_string(ndr, "user", r->user); - } - ndr->depth--; - ndr_print_uint32(ndr, "time", r->time); - ndr_print_uint32(ndr, "idle_time", r->idle_time); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessCtr10(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr10 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo10(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo10(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr10(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr10 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo10(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo10(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessCtr10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr10 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetSessCtr10"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetSessInfo10(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessInfo502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo502 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->client)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->user_flags)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->transport)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->client_type) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_type, ndr_charset_length(r->client_type, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->transport) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->transport, ndr_charset_length(r->transport, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo502 *r) -{ - uint32_t _ptr_client; - TALLOC_CTX *_mem_save_client_0; - uint32_t _ptr_user; - TALLOC_CTX *_mem_save_user_0; - uint32_t _ptr_client_type; - TALLOC_CTX *_mem_save_client_type_0; - uint32_t _ptr_transport; - TALLOC_CTX *_mem_save_transport_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); - if (_ptr_client) { - NDR_PULL_ALLOC(ndr, r->client); - } else { - r->client = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->user); - } else { - r->user = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->user_flags)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_type)); - if (_ptr_client_type) { - NDR_PULL_ALLOC(ndr, r->client_type); - } else { - r->client_type = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport)); - if (_ptr_transport) { - NDR_PULL_ALLOC(ndr, r->transport); - } else { - r->transport = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->client) { - _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->client, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->client)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->client)); - if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); - } - if (r->user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); - if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - if (r->client_type) { - _mem_save_client_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->client_type, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->client_type)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->client_type)); - if (ndr_get_array_length(ndr, &r->client_type) > ndr_get_array_size(ndr, &r->client_type)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_type), ndr_get_array_length(ndr, &r->client_type)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_type, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_type_0, 0); - } - if (r->transport) { - _mem_save_transport_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->transport, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->transport)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->transport)); - if (ndr_get_array_length(ndr, &r->transport) > ndr_get_array_size(ndr, &r->transport)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->transport), ndr_get_array_length(ndr, &r->transport)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->transport), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->transport, ndr_get_array_length(ndr, &r->transport), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo502 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSessInfo502"); - ndr->depth++; - ndr_print_ptr(ndr, "client", r->client); - ndr->depth++; - if (r->client) { - ndr_print_string(ndr, "client", r->client); - } - ndr->depth--; - ndr_print_ptr(ndr, "user", r->user); - ndr->depth++; - if (r->user) { - ndr_print_string(ndr, "user", r->user); - } - ndr->depth--; - ndr_print_uint32(ndr, "num_open", r->num_open); - ndr_print_uint32(ndr, "time", r->time); - ndr_print_uint32(ndr, "idle_time", r->idle_time); - ndr_print_uint32(ndr, "user_flags", r->user_flags); - ndr_print_ptr(ndr, "client_type", r->client_type); - ndr->depth++; - if (r->client_type) { - ndr_print_string(ndr, "client_type", r->client_type); - } - ndr->depth--; - ndr_print_ptr(ndr, "transport", r->transport); - ndr->depth++; - if (r->transport) { - ndr_print_string(ndr, "transport", r->transport); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessCtr502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr502 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo502(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetSessInfo502(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr502 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo502(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetSessInfo502(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessCtr502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr502 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetSessCtr502"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetSessInfo502(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetSessCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; } - - case 10: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr10)); - break; } - - case 502: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr502)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->ctr0) { - NDR_CHECK(ndr_push_srvsvc_NetSessCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - } - break; - - case 1: - if (r->ctr1) { - NDR_CHECK(ndr_push_srvsvc_NetSessCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - } - break; - - case 2: - if (r->ctr2) { - NDR_CHECK(ndr_push_srvsvc_NetSessCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - } - break; - - case 10: - if (r->ctr10) { - NDR_CHECK(ndr_push_srvsvc_NetSessCtr10(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr10)); - } - break; - - case 502: - if (r->ctr502) { - NDR_CHECK(ndr_push_srvsvc_NetSessCtr502(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr502)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetSessCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_ctr0_0; - TALLOC_CTX *_mem_save_ctr1_0; - TALLOC_CTX *_mem_save_ctr2_0; - TALLOC_CTX *_mem_save_ctr10_0; - TALLOC_CTX *_mem_save_ctr502_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_ctr0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); - if (_ptr_ctr0) { - NDR_PULL_ALLOC(ndr, r->ctr0); - } else { - r->ctr0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_ctr1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); - if (_ptr_ctr1) { - NDR_PULL_ALLOC(ndr, r->ctr1); - } else { - r->ctr1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_ctr2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); - if (_ptr_ctr2) { - NDR_PULL_ALLOC(ndr, r->ctr2); - } else { - r->ctr2 = NULL; - } - break; } - - case 10: { - uint32_t _ptr_ctr10; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr10)); - if (_ptr_ctr10) { - NDR_PULL_ALLOC(ndr, r->ctr10); - } else { - r->ctr10 = NULL; - } - break; } - - case 502: { - uint32_t _ptr_ctr502; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr502)); - if (_ptr_ctr502) { - NDR_PULL_ALLOC(ndr, r->ctr502); - } else { - r->ctr502 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->ctr0) { - _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSessCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); - } - break; - - case 1: - if (r->ctr1) { - _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSessCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); - } - break; - - case 2: - if (r->ctr2) { - _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSessCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); - } - break; - - case 10: - if (r->ctr10) { - _mem_save_ctr10_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr10, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSessCtr10(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr10)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr10_0, 0); - } - break; - - case 502: - if (r->ctr502) { - _mem_save_ctr502_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr502, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSessCtr502(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr502)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr502_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetSessCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetSessCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "ctr0", r->ctr0); - ndr->depth++; - if (r->ctr0) { - ndr_print_srvsvc_NetSessCtr0(ndr, "ctr0", r->ctr0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "ctr1", r->ctr1); - ndr->depth++; - if (r->ctr1) { - ndr_print_srvsvc_NetSessCtr1(ndr, "ctr1", r->ctr1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "ctr2", r->ctr2); - ndr->depth++; - if (r->ctr2) { - ndr_print_srvsvc_NetSessCtr2(ndr, "ctr2", r->ctr2); - } - ndr->depth--; - break; - - case 10: - ndr_print_ptr(ndr, "ctr10", r->ctr10); - ndr->depth++; - if (r->ctr10) { - ndr_print_srvsvc_NetSessCtr10(ndr, "ctr10", r->ctr10); - } - ndr->depth--; - break; - - case 502: - ndr_print_ptr(ndr, "ctr502", r->ctr502); - ndr->depth++; - if (r->ctr502) { - ndr_print_srvsvc_NetSessCtr502(ndr, "ctr502", r->ctr502); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_srvsvc_NetSessCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_srvsvc_NetSessCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_srvsvc_NetSessCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_srvsvc_NetSessCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfoCtr *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSessInfoCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_srvsvc_NetSessCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_ShareType(struct ndr_push *ndr, int ndr_flags, enum srvsvc_ShareType r) -{ - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_ShareType(struct ndr_pull *ndr, int ndr_flags, enum srvsvc_ShareType *r) -{ - uint32_t v; - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - ndr->flags = _flags_save_ENUM; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_ShareType(struct ndr_print *ndr, const char *name, enum srvsvc_ShareType r) -{ - const char *val = NULL; - - { - uint32_t _flags_save_ENUM = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - switch (r) { - case STYPE_DISKTREE: val = "STYPE_DISKTREE"; break; - case STYPE_DISKTREE_TEMPORARY: val = "STYPE_DISKTREE_TEMPORARY"; break; - case STYPE_DISKTREE_HIDDEN: val = "STYPE_DISKTREE_HIDDEN"; break; - case STYPE_PRINTQ: val = "STYPE_PRINTQ"; break; - case STYPE_PRINTQ_TEMPORARY: val = "STYPE_PRINTQ_TEMPORARY"; break; - case STYPE_PRINTQ_HIDDEN: val = "STYPE_PRINTQ_HIDDEN"; break; - case STYPE_DEVICE: val = "STYPE_DEVICE"; break; - case STYPE_DEVICE_TEMPORARY: val = "STYPE_DEVICE_TEMPORARY"; break; - case STYPE_DEVICE_HIDDEN: val = "STYPE_DEVICE_HIDDEN"; break; - case STYPE_IPC: val = "STYPE_IPC"; break; - case STYPE_IPC_TEMPORARY: val = "STYPE_IPC_TEMPORARY"; break; - case STYPE_IPC_HIDDEN: val = "STYPE_IPC_HIDDEN"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); - ndr->flags = _flags_save_ENUM; - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo0 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo0 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfo0"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr0 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr0 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr0 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr0"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetShareInfo0(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_srvsvc_ShareType(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_srvsvc_ShareType(ndr, "type", r->type); - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetShareInfo1(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_srvsvc_ShareType(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->permissions)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_users)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->current_users)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->password, ndr_charset_length(r->password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo2 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - uint32_t _ptr_path; - TALLOC_CTX *_mem_save_path_0; - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_password_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->permissions)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_users)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->current_users)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->path); - } else { - r->path = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->password); - } else { - r->password = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - if (r->path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); - if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - if (r->password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->password)); - if (ndr_get_array_length(ndr, &r->password) > ndr_get_array_size(ndr, &r->password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->password), ndr_get_array_length(ndr, &r->password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->password, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo2 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_srvsvc_ShareType(ndr, "type", r->type); - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_uint32(ndr, "permissions", r->permissions); - ndr_print_uint32(ndr, "max_users", r->max_users); - ndr_print_uint32(ndr, "current_users", r->current_users); - ndr_print_ptr(ndr, "path", r->path); - ndr->depth++; - if (r->path) { - ndr_print_string(ndr, "path", r->path); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->password); - ndr->depth++; - if (r->password) { - ndr_print_string(ndr, "password", r->password); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr2 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr2 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr2 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetShareInfo2(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo501(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo501 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_srvsvc_ShareType(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->csc_policy)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo501(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo501 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->csc_policy)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo501 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfo501"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_srvsvc_ShareType(ndr, "type", r->type); - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_uint32(ndr, "csc_policy", r->csc_policy); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr501(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr501 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo501(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo501(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr501(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr501 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo501(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo501(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr501 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr501"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetShareInfo501(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo502 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_srvsvc_ShareType(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->permissions)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_users)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->current_users)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->path)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sd_buf)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->password, ndr_charset_length(r->password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sd_buf)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo502 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - uint32_t _ptr_path; - TALLOC_CTX *_mem_save_path_0; - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_password_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->permissions)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_users)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->current_users)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->path); - } else { - r->path = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->password); - } else { - r->password = NULL; - } - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sd_buf)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - if (r->path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->path)); - if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - if (r->password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->password)); - if (ndr_get_array_length(ndr, &r->password) > ndr_get_array_size(ndr, &r->password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->password), ndr_get_array_length(ndr, &r->password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->password, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sd_buf)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo502 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfo502"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_srvsvc_ShareType(ndr, "type", r->type); - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_uint32(ndr, "permissions", r->permissions); - ndr_print_uint32(ndr, "max_users", r->max_users); - ndr_print_uint32(ndr, "current_users", r->current_users); - ndr_print_ptr(ndr, "path", r->path); - ndr->depth++; - if (r->path) { - ndr_print_string(ndr, "path", r->path); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->password); - ndr->depth++; - if (r->password) { - ndr_print_string(ndr, "password", r->password); - } - ndr->depth--; - ndr_print_sec_desc_buf(ndr, "sd_buf", &r->sd_buf); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr502 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo502(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo502(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr502 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo502(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo502(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr502 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr502"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetShareInfo502(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1004(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1004 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1004(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1004 *r) -{ - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1004(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1004 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1004"); - ndr->depth++; - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1004(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1004 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1004(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1004(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1004(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1004 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1004(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1004(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1004(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1004 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1004"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetShareInfo1004(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_NetShareInfo1005Flags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_NetShareInfo1005Flags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_NetShareInfo1005Flags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SHARE_1005_IN_DFS", SHARE_1005_IN_DFS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SHARE_1005_DFS_ROOT", SHARE_1005_DFS_ROOT, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1005(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1005 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NetShareInfo1005Flags(ndr, NDR_SCALARS, r->dfs_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1005(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1005 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NetShareInfo1005Flags(ndr, NDR_SCALARS, &r->dfs_flags)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1005 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1005"); - ndr->depth++; - ndr_print_NetShareInfo1005Flags(ndr, "dfs_flags", r->dfs_flags); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1005(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1005 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1005(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1005(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1005 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1005(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1005 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1005"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetShareInfo1005(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1006(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1006 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_users)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1006(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1006 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_users)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1006(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1006 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1006"); - ndr->depth++; - ndr_print_uint32(ndr, "max_users", r->max_users); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1006(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1006 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1006(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1006(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1006 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1006(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1006(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1006 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1006"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetShareInfo1006(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo1007(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfo1007 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->alternate_directory_name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->alternate_directory_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alternate_directory_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alternate_directory_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->alternate_directory_name, ndr_charset_length(r->alternate_directory_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo1007(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfo1007 *r) -{ - uint32_t _ptr_alternate_directory_name; - TALLOC_CTX *_mem_save_alternate_directory_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alternate_directory_name)); - if (_ptr_alternate_directory_name) { - NDR_PULL_ALLOC(ndr, r->alternate_directory_name); - } else { - r->alternate_directory_name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->alternate_directory_name) { - _mem_save_alternate_directory_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->alternate_directory_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->alternate_directory_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->alternate_directory_name)); - if (ndr_get_array_length(ndr, &r->alternate_directory_name) > ndr_get_array_size(ndr, &r->alternate_directory_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->alternate_directory_name), ndr_get_array_length(ndr, &r->alternate_directory_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->alternate_directory_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->alternate_directory_name, ndr_get_array_length(ndr, &r->alternate_directory_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alternate_directory_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo1007(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1007 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfo1007"); - ndr->depth++; - ndr_print_uint32(ndr, "flags", r->flags); - ndr_print_ptr(ndr, "alternate_directory_name", r->alternate_directory_name); - ndr->depth++; - if (r->alternate_directory_name) { - ndr_print_string(ndr, "alternate_directory_name", r->alternate_directory_name); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1007(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1007 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1007(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1007(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1007(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1007 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1007(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1007(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1007(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1007 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1007"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetShareInfo1007(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr1501(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareCtr1501 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr1501(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1501 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr1501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1501 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1501"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_sec_desc_buf(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetShareInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; } - - case 501: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info501)); - break; } - - case 502: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info502)); - break; } - - case 1004: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1004)); - break; } - - case 1005: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1005)); - break; } - - case 1006: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1006)); - break; } - - case 1007: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1007)); - break; } - - case 1501: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1501)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->info0) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - } - break; - - case 1: - if (r->info1) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - } - break; - - case 2: - if (r->info2) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - } - break; - - case 501: - if (r->info501) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo501(ndr, NDR_SCALARS|NDR_BUFFERS, r->info501)); - } - break; - - case 502: - if (r->info502) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo502(ndr, NDR_SCALARS|NDR_BUFFERS, r->info502)); - } - break; - - case 1004: - if (r->info1004) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1004)); - } - break; - - case 1005: - if (r->info1005) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1005(ndr, NDR_SCALARS, r->info1005)); - } - break; - - case 1006: - if (r->info1006) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1006(ndr, NDR_SCALARS, r->info1006)); - } - break; - - case 1007: - if (r->info1007) { - NDR_CHECK(ndr_push_srvsvc_NetShareInfo1007(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1007)); - } - break; - - case 1501: - if (r->info1501) { - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1501)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetShareInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info0_0; - TALLOC_CTX *_mem_save_info1_0; - TALLOC_CTX *_mem_save_info2_0; - TALLOC_CTX *_mem_save_info501_0; - TALLOC_CTX *_mem_save_info502_0; - TALLOC_CTX *_mem_save_info1004_0; - TALLOC_CTX *_mem_save_info1005_0; - TALLOC_CTX *_mem_save_info1006_0; - TALLOC_CTX *_mem_save_info1007_0; - TALLOC_CTX *_mem_save_info1501_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_info0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); - if (_ptr_info0) { - NDR_PULL_ALLOC(ndr, r->info0); - } else { - r->info0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_info1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); - if (_ptr_info1) { - NDR_PULL_ALLOC(ndr, r->info1); - } else { - r->info1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_info2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); - if (_ptr_info2) { - NDR_PULL_ALLOC(ndr, r->info2); - } else { - r->info2 = NULL; - } - break; } - - case 501: { - uint32_t _ptr_info501; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info501)); - if (_ptr_info501) { - NDR_PULL_ALLOC(ndr, r->info501); - } else { - r->info501 = NULL; - } - break; } - - case 502: { - uint32_t _ptr_info502; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info502)); - if (_ptr_info502) { - NDR_PULL_ALLOC(ndr, r->info502); - } else { - r->info502 = NULL; - } - break; } - - case 1004: { - uint32_t _ptr_info1004; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1004)); - if (_ptr_info1004) { - NDR_PULL_ALLOC(ndr, r->info1004); - } else { - r->info1004 = NULL; - } - break; } - - case 1005: { - uint32_t _ptr_info1005; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1005)); - if (_ptr_info1005) { - NDR_PULL_ALLOC(ndr, r->info1005); - } else { - r->info1005 = NULL; - } - break; } - - case 1006: { - uint32_t _ptr_info1006; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1006)); - if (_ptr_info1006) { - NDR_PULL_ALLOC(ndr, r->info1006); - } else { - r->info1006 = NULL; - } - break; } - - case 1007: { - uint32_t _ptr_info1007; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1007)); - if (_ptr_info1007) { - NDR_PULL_ALLOC(ndr, r->info1007); - } else { - r->info1007 = NULL; - } - break; } - - case 1501: { - uint32_t _ptr_info1501; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1501)); - if (_ptr_info1501) { - NDR_PULL_ALLOC(ndr, r->info1501); - } else { - r->info1501 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->info0) { - _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); - } - break; - - case 1: - if (r->info1) { - _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); - } - break; - - case 2: - if (r->info2) { - _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); - } - break; - - case 501: - if (r->info501) { - _mem_save_info501_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info501, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo501(ndr, NDR_SCALARS|NDR_BUFFERS, r->info501)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info501_0, 0); - } - break; - - case 502: - if (r->info502) { - _mem_save_info502_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info502, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo502(ndr, NDR_SCALARS|NDR_BUFFERS, r->info502)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info502_0, 0); - } - break; - - case 1004: - if (r->info1004) { - _mem_save_info1004_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1004, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1004)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1004_0, 0); - } - break; - - case 1005: - if (r->info1005) { - _mem_save_info1005_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1005, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1005(ndr, NDR_SCALARS, r->info1005)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1005_0, 0); - } - break; - - case 1006: - if (r->info1006) { - _mem_save_info1006_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1006, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1006(ndr, NDR_SCALARS, r->info1006)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1006_0, 0); - } - break; - - case 1007: - if (r->info1007) { - _mem_save_info1007_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1007, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo1007(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1007)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1007_0, 0); - } - break; - - case 1501: - if (r->info1501) { - _mem_save_info1501_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1501, 0); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1501)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1501_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetShareInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetShareInfo"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "info0", r->info0); - ndr->depth++; - if (r->info0) { - ndr_print_srvsvc_NetShareInfo0(ndr, "info0", r->info0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "info1", r->info1); - ndr->depth++; - if (r->info1) { - ndr_print_srvsvc_NetShareInfo1(ndr, "info1", r->info1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "info2", r->info2); - ndr->depth++; - if (r->info2) { - ndr_print_srvsvc_NetShareInfo2(ndr, "info2", r->info2); - } - ndr->depth--; - break; - - case 501: - ndr_print_ptr(ndr, "info501", r->info501); - ndr->depth++; - if (r->info501) { - ndr_print_srvsvc_NetShareInfo501(ndr, "info501", r->info501); - } - ndr->depth--; - break; - - case 502: - ndr_print_ptr(ndr, "info502", r->info502); - ndr->depth++; - if (r->info502) { - ndr_print_srvsvc_NetShareInfo502(ndr, "info502", r->info502); - } - ndr->depth--; - break; - - case 1004: - ndr_print_ptr(ndr, "info1004", r->info1004); - ndr->depth++; - if (r->info1004) { - ndr_print_srvsvc_NetShareInfo1004(ndr, "info1004", r->info1004); - } - ndr->depth--; - break; - - case 1005: - ndr_print_ptr(ndr, "info1005", r->info1005); - ndr->depth++; - if (r->info1005) { - ndr_print_srvsvc_NetShareInfo1005(ndr, "info1005", r->info1005); - } - ndr->depth--; - break; - - case 1006: - ndr_print_ptr(ndr, "info1006", r->info1006); - ndr->depth++; - if (r->info1006) { - ndr_print_srvsvc_NetShareInfo1006(ndr, "info1006", r->info1006); - } - ndr->depth--; - break; - - case 1007: - ndr_print_ptr(ndr, "info1007", r->info1007); - ndr->depth++; - if (r->info1007) { - ndr_print_srvsvc_NetShareInfo1007(ndr, "info1007", r->info1007); - } - ndr->depth--; - break; - - case 1501: - ndr_print_ptr(ndr, "info1501", r->info1501); - ndr->depth++; - if (r->info1501) { - ndr_print_sec_desc_buf(ndr, "info1501", r->info1501); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetShareCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; } - - case 501: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr501)); - break; } - - case 502: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr502)); - break; } - - case 1004: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1004)); - break; } - - case 1005: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1005)); - break; } - - case 1006: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1006)); - break; } - - case 1007: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1007)); - break; } - - case 1501: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1501)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->ctr0) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - } - break; - - case 1: - if (r->ctr1) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - } - break; - - case 2: - if (r->ctr2) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - } - break; - - case 501: - if (r->ctr501) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr501(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr501)); - } - break; - - case 502: - if (r->ctr502) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr502(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr502)); - } - break; - - case 1004: - if (r->ctr1004) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1004)); - } - break; - - case 1005: - if (r->ctr1005) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr1005(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1005)); - } - break; - - case 1006: - if (r->ctr1006) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr1006(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1006)); - } - break; - - case 1007: - if (r->ctr1007) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr1007(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1007)); - } - break; - - case 1501: - if (r->ctr1501) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr1501(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1501)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetShareCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_ctr0_0; - TALLOC_CTX *_mem_save_ctr1_0; - TALLOC_CTX *_mem_save_ctr2_0; - TALLOC_CTX *_mem_save_ctr501_0; - TALLOC_CTX *_mem_save_ctr502_0; - TALLOC_CTX *_mem_save_ctr1004_0; - TALLOC_CTX *_mem_save_ctr1005_0; - TALLOC_CTX *_mem_save_ctr1006_0; - TALLOC_CTX *_mem_save_ctr1007_0; - TALLOC_CTX *_mem_save_ctr1501_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_ctr0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); - if (_ptr_ctr0) { - NDR_PULL_ALLOC(ndr, r->ctr0); - } else { - r->ctr0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_ctr1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); - if (_ptr_ctr1) { - NDR_PULL_ALLOC(ndr, r->ctr1); - } else { - r->ctr1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_ctr2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); - if (_ptr_ctr2) { - NDR_PULL_ALLOC(ndr, r->ctr2); - } else { - r->ctr2 = NULL; - } - break; } - - case 501: { - uint32_t _ptr_ctr501; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr501)); - if (_ptr_ctr501) { - NDR_PULL_ALLOC(ndr, r->ctr501); - } else { - r->ctr501 = NULL; - } - break; } - - case 502: { - uint32_t _ptr_ctr502; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr502)); - if (_ptr_ctr502) { - NDR_PULL_ALLOC(ndr, r->ctr502); - } else { - r->ctr502 = NULL; - } - break; } - - case 1004: { - uint32_t _ptr_ctr1004; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1004)); - if (_ptr_ctr1004) { - NDR_PULL_ALLOC(ndr, r->ctr1004); - } else { - r->ctr1004 = NULL; - } - break; } - - case 1005: { - uint32_t _ptr_ctr1005; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1005)); - if (_ptr_ctr1005) { - NDR_PULL_ALLOC(ndr, r->ctr1005); - } else { - r->ctr1005 = NULL; - } - break; } - - case 1006: { - uint32_t _ptr_ctr1006; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1006)); - if (_ptr_ctr1006) { - NDR_PULL_ALLOC(ndr, r->ctr1006); - } else { - r->ctr1006 = NULL; - } - break; } - - case 1007: { - uint32_t _ptr_ctr1007; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1007)); - if (_ptr_ctr1007) { - NDR_PULL_ALLOC(ndr, r->ctr1007); - } else { - r->ctr1007 = NULL; - } - break; } - - case 1501: { - uint32_t _ptr_ctr1501; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1501)); - if (_ptr_ctr1501) { - NDR_PULL_ALLOC(ndr, r->ctr1501); - } else { - r->ctr1501 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->ctr0) { - _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); - } - break; - - case 1: - if (r->ctr1) { - _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); - } - break; - - case 2: - if (r->ctr2) { - _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); - } - break; - - case 501: - if (r->ctr501) { - _mem_save_ctr501_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr501, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr501(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr501)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr501_0, 0); - } - break; - - case 502: - if (r->ctr502) { - _mem_save_ctr502_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr502, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr502(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr502)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr502_0, 0); - } - break; - - case 1004: - if (r->ctr1004) { - _mem_save_ctr1004_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1004, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1004)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1004_0, 0); - } - break; - - case 1005: - if (r->ctr1005) { - _mem_save_ctr1005_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1005, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1005(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1005)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1005_0, 0); - } - break; - - case 1006: - if (r->ctr1006) { - _mem_save_ctr1006_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1006, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1006(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1006)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1006_0, 0); - } - break; - - case 1007: - if (r->ctr1007) { - _mem_save_ctr1007_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1007, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1007(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1007)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1007_0, 0); - } - break; - - case 1501: - if (r->ctr1501) { - _mem_save_ctr1501_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1501, 0); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1501(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1501)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1501_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetShareCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetShareCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "ctr0", r->ctr0); - ndr->depth++; - if (r->ctr0) { - ndr_print_srvsvc_NetShareCtr0(ndr, "ctr0", r->ctr0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "ctr1", r->ctr1); - ndr->depth++; - if (r->ctr1) { - ndr_print_srvsvc_NetShareCtr1(ndr, "ctr1", r->ctr1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "ctr2", r->ctr2); - ndr->depth++; - if (r->ctr2) { - ndr_print_srvsvc_NetShareCtr2(ndr, "ctr2", r->ctr2); - } - ndr->depth--; - break; - - case 501: - ndr_print_ptr(ndr, "ctr501", r->ctr501); - ndr->depth++; - if (r->ctr501) { - ndr_print_srvsvc_NetShareCtr501(ndr, "ctr501", r->ctr501); - } - ndr->depth--; - break; - - case 502: - ndr_print_ptr(ndr, "ctr502", r->ctr502); - ndr->depth++; - if (r->ctr502) { - ndr_print_srvsvc_NetShareCtr502(ndr, "ctr502", r->ctr502); - } - ndr->depth--; - break; - - case 1004: - ndr_print_ptr(ndr, "ctr1004", r->ctr1004); - ndr->depth++; - if (r->ctr1004) { - ndr_print_srvsvc_NetShareCtr1004(ndr, "ctr1004", r->ctr1004); - } - ndr->depth--; - break; - - case 1005: - ndr_print_ptr(ndr, "ctr1005", r->ctr1005); - ndr->depth++; - if (r->ctr1005) { - ndr_print_srvsvc_NetShareCtr1005(ndr, "ctr1005", r->ctr1005); - } - ndr->depth--; - break; - - case 1006: - ndr_print_ptr(ndr, "ctr1006", r->ctr1006); - ndr->depth++; - if (r->ctr1006) { - ndr_print_srvsvc_NetShareCtr1006(ndr, "ctr1006", r->ctr1006); - } - ndr->depth--; - break; - - case 1007: - ndr_print_ptr(ndr, "ctr1007", r->ctr1007); - ndr->depth++; - if (r->ctr1007) { - ndr_print_srvsvc_NetShareCtr1007(ndr, "ctr1007", r->ctr1007); - } - ndr->depth--; - break; - - case 1501: - ndr_print_ptr(ndr, "ctr1501", r->ctr1501); - ndr->depth++; - if (r->ctr1501) { - ndr_print_srvsvc_NetShareCtr1501(ndr, "ctr1501", r->ctr1501); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetShareInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_srvsvc_NetShareCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_srvsvc_NetShareCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_srvsvc_NetShareCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfoCtr *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareInfoCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_srvsvc_NetShareCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_srvsvc_PlatformId(struct ndr_push *ndr, int ndr_flags, enum srvsvc_PlatformId r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_srvsvc_PlatformId(struct ndr_pull *ndr, int ndr_flags, enum srvsvc_PlatformId *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_PlatformId(struct ndr_print *ndr, const char *name, enum srvsvc_PlatformId r) -{ - const char *val = NULL; - - switch (r) { - case PLATFORM_ID_DOS: val = "PLATFORM_ID_DOS"; break; - case PLATFORM_ID_OS2: val = "PLATFORM_ID_OS2"; break; - case PLATFORM_ID_NT: val = "PLATFORM_ID_NT"; break; - case PLATFORM_ID_OSF: val = "PLATFORM_ID_OSF"; break; - case PLATFORM_ID_VMS: val = "PLATFORM_ID_VMS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_srvsvc_NetSrvInfo100(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo100 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo100(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo100 *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->server_name); - } else { - r->server_name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); - if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo100(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo100 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo100"); - ndr->depth++; - ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); - ndr_print_ptr(ndr, "server_name", r->server_name); - ndr->depth++; - if (r->server_name) { - ndr_print_string(ndr, "server_name", r->server_name); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_srvsvc_NetSrvInfo101(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo101 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); - NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo101(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo101 *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->server_name); - } else { - r->server_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); - NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); - if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo101(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo101 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo101"); - ndr->depth++; - ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); - ndr_print_ptr(ndr, "server_name", r->server_name); - ndr->depth++; - if (r->server_name) { - ndr_print_string(ndr, "server_name", r->server_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "version_major", r->version_major); - ndr_print_uint32(ndr, "version_minor", r->version_minor); - ndr_print_svcctl_ServerType(ndr, "server_type", r->server_type); - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo102(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo102 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); - NDR_CHECK(ndr_push_svcctl_ServerType(ndr, NDR_SCALARS, r->server_type)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->users)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->disc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->hidden)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->announce)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->anndelta)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->licenses)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->userpath)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->userpath) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->userpath, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->userpath, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->userpath, ndr_charset_length(r->userpath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo102(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo102 *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - uint32_t _ptr_userpath; - TALLOC_CTX *_mem_save_userpath_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->server_name); - } else { - r->server_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); - NDR_CHECK(ndr_pull_svcctl_ServerType(ndr, NDR_SCALARS, &r->server_type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->users)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->disc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->hidden)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->announce)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->anndelta)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->licenses)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_userpath)); - if (_ptr_userpath) { - NDR_PULL_ALLOC(ndr, r->userpath); - } else { - r->userpath = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); - if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - if (r->userpath) { - _mem_save_userpath_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->userpath, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->userpath)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->userpath)); - if (ndr_get_array_length(ndr, &r->userpath) > ndr_get_array_size(ndr, &r->userpath)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->userpath), ndr_get_array_length(ndr, &r->userpath)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->userpath), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->userpath, ndr_get_array_length(ndr, &r->userpath), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_userpath_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo102(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo102 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo102"); - ndr->depth++; - ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); - ndr_print_ptr(ndr, "server_name", r->server_name); - ndr->depth++; - if (r->server_name) { - ndr_print_string(ndr, "server_name", r->server_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "version_major", r->version_major); - ndr_print_uint32(ndr, "version_minor", r->version_minor); - ndr_print_svcctl_ServerType(ndr, "server_type", r->server_type); - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr_print_uint32(ndr, "users", r->users); - ndr_print_uint32(ndr, "disc", r->disc); - ndr_print_uint32(ndr, "hidden", r->hidden); - ndr_print_uint32(ndr, "announce", r->announce); - ndr_print_uint32(ndr, "anndelta", r->anndelta); - ndr_print_uint32(ndr, "licenses", r->licenses); - ndr_print_ptr(ndr, "userpath", r->userpath); - ndr->depth++; - if (r->userpath) { - ndr_print_string(ndr, "userpath", r->userpath); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo402(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo402 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ulist_mtime)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->glist_mtime)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alist_mtime)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->alerts)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->security)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numadmin)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lanmask)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->guestaccount)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevqs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevjobs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->connections)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->shares)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->openfiles)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessreqs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->activelocks)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numreqbufs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numbigbufs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numfiletasks)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alertsched)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->erroralert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logonalert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->accessalert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->diskalert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->netioalert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxaudits)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->srvheuristics)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->alerts) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alerts, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alerts, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->alerts, ndr_charset_length(r->alerts, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->guestaccount) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guestaccount, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guestaccount, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->guestaccount, ndr_charset_length(r->guestaccount, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->srvheuristics) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->srvheuristics, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->srvheuristics, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->srvheuristics, ndr_charset_length(r->srvheuristics, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo402(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo402 *r) -{ - uint32_t _ptr_alerts; - TALLOC_CTX *_mem_save_alerts_0; - uint32_t _ptr_guestaccount; - TALLOC_CTX *_mem_save_guestaccount_0; - uint32_t _ptr_srvheuristics; - TALLOC_CTX *_mem_save_srvheuristics_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ulist_mtime)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->glist_mtime)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alist_mtime)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alerts)); - if (_ptr_alerts) { - NDR_PULL_ALLOC(ndr, r->alerts); - } else { - r->alerts = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->security)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numadmin)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lanmask)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_guestaccount)); - if (_ptr_guestaccount) { - NDR_PULL_ALLOC(ndr, r->guestaccount); - } else { - r->guestaccount = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevqs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevjobs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->connections)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->shares)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->openfiles)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessreqs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->activelocks)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numreqbufs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numbigbufs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numfiletasks)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alertsched)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->erroralert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logonalert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->accessalert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->diskalert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->netioalert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxaudits)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_srvheuristics)); - if (_ptr_srvheuristics) { - NDR_PULL_ALLOC(ndr, r->srvheuristics); - } else { - r->srvheuristics = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->alerts) { - _mem_save_alerts_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->alerts, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->alerts)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->alerts)); - if (ndr_get_array_length(ndr, &r->alerts) > ndr_get_array_size(ndr, &r->alerts)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->alerts), ndr_get_array_length(ndr, &r->alerts)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->alerts), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->alerts, ndr_get_array_length(ndr, &r->alerts), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alerts_0, 0); - } - if (r->guestaccount) { - _mem_save_guestaccount_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->guestaccount, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->guestaccount)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->guestaccount)); - if (ndr_get_array_length(ndr, &r->guestaccount) > ndr_get_array_size(ndr, &r->guestaccount)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->guestaccount), ndr_get_array_length(ndr, &r->guestaccount)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->guestaccount), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->guestaccount, ndr_get_array_length(ndr, &r->guestaccount), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_guestaccount_0, 0); - } - if (r->srvheuristics) { - _mem_save_srvheuristics_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->srvheuristics, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->srvheuristics)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->srvheuristics)); - if (ndr_get_array_length(ndr, &r->srvheuristics) > ndr_get_array_size(ndr, &r->srvheuristics)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->srvheuristics), ndr_get_array_length(ndr, &r->srvheuristics)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->srvheuristics), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->srvheuristics, ndr_get_array_length(ndr, &r->srvheuristics), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_srvheuristics_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo402(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo402 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo402"); - ndr->depth++; - ndr_print_uint32(ndr, "ulist_mtime", r->ulist_mtime); - ndr_print_uint32(ndr, "glist_mtime", r->glist_mtime); - ndr_print_uint32(ndr, "alist_mtime", r->alist_mtime); - ndr_print_ptr(ndr, "alerts", r->alerts); - ndr->depth++; - if (r->alerts) { - ndr_print_string(ndr, "alerts", r->alerts); - } - ndr->depth--; - ndr_print_uint32(ndr, "security", r->security); - ndr_print_uint32(ndr, "numadmin", r->numadmin); - ndr_print_uint32(ndr, "lanmask", r->lanmask); - ndr_print_ptr(ndr, "guestaccount", r->guestaccount); - ndr->depth++; - if (r->guestaccount) { - ndr_print_string(ndr, "guestaccount", r->guestaccount); - } - ndr->depth--; - ndr_print_uint32(ndr, "chdevs", r->chdevs); - ndr_print_uint32(ndr, "chdevqs", r->chdevqs); - ndr_print_uint32(ndr, "chdevjobs", r->chdevjobs); - ndr_print_uint32(ndr, "connections", r->connections); - ndr_print_uint32(ndr, "shares", r->shares); - ndr_print_uint32(ndr, "openfiles", r->openfiles); - ndr_print_uint32(ndr, "sessopen", r->sessopen); - ndr_print_uint32(ndr, "sesssvc", r->sesssvc); - ndr_print_uint32(ndr, "sessreqs", r->sessreqs); - ndr_print_uint32(ndr, "opensearch", r->opensearch); - ndr_print_uint32(ndr, "activelocks", r->activelocks); - ndr_print_uint32(ndr, "numreqbufs", r->numreqbufs); - ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); - ndr_print_uint32(ndr, "numbigbufs", r->numbigbufs); - ndr_print_uint32(ndr, "numfiletasks", r->numfiletasks); - ndr_print_uint32(ndr, "alertsched", r->alertsched); - ndr_print_uint32(ndr, "erroralert", r->erroralert); - ndr_print_uint32(ndr, "logonalert", r->logonalert); - ndr_print_uint32(ndr, "accessalert", r->accessalert); - ndr_print_uint32(ndr, "diskalert", r->diskalert); - ndr_print_uint32(ndr, "netioalert", r->netioalert); - ndr_print_uint32(ndr, "maxaudits", r->maxaudits); - ndr_print_ptr(ndr, "srvheuristics", r->srvheuristics); - ndr->depth++; - if (r->srvheuristics) { - ndr_print_string(ndr, "srvheuristics", r->srvheuristics); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo403(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo403 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ulist_mtime)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->glist_mtime)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alist_mtime)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->alerts)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->security)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numadmin)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lanmask)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->guestaccount)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevqs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->chdevjobs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->connections)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->shares)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->openfiles)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessreqs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->activelocks)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numreqbufs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numbigbufs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numfiletasks)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alertsched)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->erroralert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logonalert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->accessalert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->diskalert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->netioalert)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxaudits)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->srvheuristics)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auditedevents)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auditprofile)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->autopath)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->alerts) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alerts, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->alerts, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->alerts, ndr_charset_length(r->alerts, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->guestaccount) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guestaccount, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guestaccount, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->guestaccount, ndr_charset_length(r->guestaccount, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->srvheuristics) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->srvheuristics, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->srvheuristics, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->srvheuristics, ndr_charset_length(r->srvheuristics, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->autopath) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->autopath, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->autopath, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->autopath, ndr_charset_length(r->autopath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo403(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo403 *r) -{ - uint32_t _ptr_alerts; - TALLOC_CTX *_mem_save_alerts_0; - uint32_t _ptr_guestaccount; - TALLOC_CTX *_mem_save_guestaccount_0; - uint32_t _ptr_srvheuristics; - TALLOC_CTX *_mem_save_srvheuristics_0; - uint32_t _ptr_autopath; - TALLOC_CTX *_mem_save_autopath_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ulist_mtime)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->glist_mtime)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alist_mtime)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_alerts)); - if (_ptr_alerts) { - NDR_PULL_ALLOC(ndr, r->alerts); - } else { - r->alerts = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->security)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numadmin)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lanmask)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_guestaccount)); - if (_ptr_guestaccount) { - NDR_PULL_ALLOC(ndr, r->guestaccount); - } else { - r->guestaccount = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevqs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->chdevjobs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->connections)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->shares)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->openfiles)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessreqs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->activelocks)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numreqbufs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numbigbufs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numfiletasks)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alertsched)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->erroralert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logonalert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->accessalert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->diskalert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->netioalert)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxaudits)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_srvheuristics)); - if (_ptr_srvheuristics) { - NDR_PULL_ALLOC(ndr, r->srvheuristics); - } else { - r->srvheuristics = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auditedevents)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auditprofile)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_autopath)); - if (_ptr_autopath) { - NDR_PULL_ALLOC(ndr, r->autopath); - } else { - r->autopath = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->alerts) { - _mem_save_alerts_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->alerts, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->alerts)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->alerts)); - if (ndr_get_array_length(ndr, &r->alerts) > ndr_get_array_size(ndr, &r->alerts)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->alerts), ndr_get_array_length(ndr, &r->alerts)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->alerts), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->alerts, ndr_get_array_length(ndr, &r->alerts), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alerts_0, 0); - } - if (r->guestaccount) { - _mem_save_guestaccount_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->guestaccount, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->guestaccount)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->guestaccount)); - if (ndr_get_array_length(ndr, &r->guestaccount) > ndr_get_array_size(ndr, &r->guestaccount)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->guestaccount), ndr_get_array_length(ndr, &r->guestaccount)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->guestaccount), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->guestaccount, ndr_get_array_length(ndr, &r->guestaccount), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_guestaccount_0, 0); - } - if (r->srvheuristics) { - _mem_save_srvheuristics_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->srvheuristics, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->srvheuristics)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->srvheuristics)); - if (ndr_get_array_length(ndr, &r->srvheuristics) > ndr_get_array_size(ndr, &r->srvheuristics)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->srvheuristics), ndr_get_array_length(ndr, &r->srvheuristics)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->srvheuristics), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->srvheuristics, ndr_get_array_length(ndr, &r->srvheuristics), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_srvheuristics_0, 0); - } - if (r->autopath) { - _mem_save_autopath_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->autopath, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->autopath)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->autopath)); - if (ndr_get_array_length(ndr, &r->autopath) > ndr_get_array_size(ndr, &r->autopath)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->autopath), ndr_get_array_length(ndr, &r->autopath)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->autopath), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->autopath, ndr_get_array_length(ndr, &r->autopath), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_autopath_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo403(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo403 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo403"); - ndr->depth++; - ndr_print_uint32(ndr, "ulist_mtime", r->ulist_mtime); - ndr_print_uint32(ndr, "glist_mtime", r->glist_mtime); - ndr_print_uint32(ndr, "alist_mtime", r->alist_mtime); - ndr_print_ptr(ndr, "alerts", r->alerts); - ndr->depth++; - if (r->alerts) { - ndr_print_string(ndr, "alerts", r->alerts); - } - ndr->depth--; - ndr_print_uint32(ndr, "security", r->security); - ndr_print_uint32(ndr, "numadmin", r->numadmin); - ndr_print_uint32(ndr, "lanmask", r->lanmask); - ndr_print_ptr(ndr, "guestaccount", r->guestaccount); - ndr->depth++; - if (r->guestaccount) { - ndr_print_string(ndr, "guestaccount", r->guestaccount); - } - ndr->depth--; - ndr_print_uint32(ndr, "chdevs", r->chdevs); - ndr_print_uint32(ndr, "chdevqs", r->chdevqs); - ndr_print_uint32(ndr, "chdevjobs", r->chdevjobs); - ndr_print_uint32(ndr, "connections", r->connections); - ndr_print_uint32(ndr, "shares", r->shares); - ndr_print_uint32(ndr, "openfiles", r->openfiles); - ndr_print_uint32(ndr, "sessopen", r->sessopen); - ndr_print_uint32(ndr, "sesssvc", r->sesssvc); - ndr_print_uint32(ndr, "sessreqs", r->sessreqs); - ndr_print_uint32(ndr, "opensearch", r->opensearch); - ndr_print_uint32(ndr, "activelocks", r->activelocks); - ndr_print_uint32(ndr, "numreqbufs", r->numreqbufs); - ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); - ndr_print_uint32(ndr, "numbigbufs", r->numbigbufs); - ndr_print_uint32(ndr, "numfiletasks", r->numfiletasks); - ndr_print_uint32(ndr, "alertsched", r->alertsched); - ndr_print_uint32(ndr, "erroralert", r->erroralert); - ndr_print_uint32(ndr, "logonalert", r->logonalert); - ndr_print_uint32(ndr, "accessalert", r->accessalert); - ndr_print_uint32(ndr, "diskalert", r->diskalert); - ndr_print_uint32(ndr, "netioalert", r->netioalert); - ndr_print_uint32(ndr, "maxaudits", r->maxaudits); - ndr_print_ptr(ndr, "srvheuristics", r->srvheuristics); - ndr->depth++; - if (r->srvheuristics) { - ndr_print_string(ndr, "srvheuristics", r->srvheuristics); - } - ndr->depth--; - ndr_print_uint32(ndr, "auditedevents", r->auditedevents); - ndr_print_uint32(ndr, "auditprofile", r->auditprofile); - ndr_print_ptr(ndr, "autopath", r->autopath); - ndr->depth++; - if (r->autopath) { - ndr_print_string(ndr, "autopath", r->autopath); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo502 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rawworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->irpstacksize)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxrawbuflen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessusers)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessconns)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxpagedmemoryusage)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxnonpagedmemoryusage)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesoftcompat)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableforcedlogoff)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timesource)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->acceptdownlevelapis)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lmannounce)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo502 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rawworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->irpstacksize)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxrawbuflen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessusers)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessconns)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxpagedmemoryusage)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxnonpagedmemoryusage)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesoftcompat)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableforcedlogoff)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timesource)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->acceptdownlevelapis)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lmannounce)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo502 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo502"); - ndr->depth++; - ndr_print_uint32(ndr, "sessopen", r->sessopen); - ndr_print_uint32(ndr, "sesssvc", r->sesssvc); - ndr_print_uint32(ndr, "opensearch", r->opensearch); - ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); - ndr_print_uint32(ndr, "initworkitems", r->initworkitems); - ndr_print_uint32(ndr, "maxworkitems", r->maxworkitems); - ndr_print_uint32(ndr, "rawworkitems", r->rawworkitems); - ndr_print_uint32(ndr, "irpstacksize", r->irpstacksize); - ndr_print_uint32(ndr, "maxrawbuflen", r->maxrawbuflen); - ndr_print_uint32(ndr, "sessusers", r->sessusers); - ndr_print_uint32(ndr, "sessconns", r->sessconns); - ndr_print_uint32(ndr, "maxpagedmemoryusage", r->maxpagedmemoryusage); - ndr_print_uint32(ndr, "maxnonpagedmemoryusage", r->maxnonpagedmemoryusage); - ndr_print_uint32(ndr, "enablesoftcompat", r->enablesoftcompat); - ndr_print_uint32(ndr, "enableforcedlogoff", r->enableforcedlogoff); - ndr_print_uint32(ndr, "timesource", r->timesource); - ndr_print_uint32(ndr, "acceptdownlevelapis", r->acceptdownlevelapis); - ndr_print_uint32(ndr, "lmannounce", r->lmannounce); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo503(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo503 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rawworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->irpstacksize)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxrawbuflen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessusers)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessconns)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxpagedmemoryusage)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxnonpagedmemoryusage)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesoftcompat)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableforcedlogoff)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timesource)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->acceptdownlevelapis)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lmannounce)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopyreadlen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopywritelen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepsearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepsearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepcomplsearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepcomplsearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->threadcountadd)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numlockthreads)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavtimeout)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minrcvqueue)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->xactmemsize)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->threadpriority)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxmpxct)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakwait)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakresponsewait)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplocks)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplockforceclose)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablefcbopens)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableraw)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesharednetdrives)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeconnections)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxfreeconnections)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo503(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo503 *r) -{ - uint32_t _ptr_domain; - TALLOC_CTX *_mem_save_domain_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rawworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->irpstacksize)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxrawbuflen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessusers)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessconns)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxpagedmemoryusage)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxnonpagedmemoryusage)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesoftcompat)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableforcedlogoff)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timesource)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->acceptdownlevelapis)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lmannounce)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopyreadlen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopywritelen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepsearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepsearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepcomplsearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepcomplsearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->threadcountadd)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numlockthreads)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavtimeout)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minrcvqueue)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->xactmemsize)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->threadpriority)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxmpxct)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakwait)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakresponsewait)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplocks)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplockforceclose)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablefcbopens)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableraw)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesharednetdrives)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeconnections)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxfreeconnections)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo503(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo503 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo503"); - ndr->depth++; - ndr_print_uint32(ndr, "sessopen", r->sessopen); - ndr_print_uint32(ndr, "sesssvc", r->sesssvc); - ndr_print_uint32(ndr, "opensearch", r->opensearch); - ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); - ndr_print_uint32(ndr, "initworkitems", r->initworkitems); - ndr_print_uint32(ndr, "maxworkitems", r->maxworkitems); - ndr_print_uint32(ndr, "rawworkitems", r->rawworkitems); - ndr_print_uint32(ndr, "irpstacksize", r->irpstacksize); - ndr_print_uint32(ndr, "maxrawbuflen", r->maxrawbuflen); - ndr_print_uint32(ndr, "sessusers", r->sessusers); - ndr_print_uint32(ndr, "sessconns", r->sessconns); - ndr_print_uint32(ndr, "maxpagedmemoryusage", r->maxpagedmemoryusage); - ndr_print_uint32(ndr, "maxnonpagedmemoryusage", r->maxnonpagedmemoryusage); - ndr_print_uint32(ndr, "enablesoftcompat", r->enablesoftcompat); - ndr_print_uint32(ndr, "enableforcedlogoff", r->enableforcedlogoff); - ndr_print_uint32(ndr, "timesource", r->timesource); - ndr_print_uint32(ndr, "acceptdownlevelapis", r->acceptdownlevelapis); - ndr_print_uint32(ndr, "lmannounce", r->lmannounce); - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - ndr_print_uint32(ndr, "maxcopyreadlen", r->maxcopyreadlen); - ndr_print_uint32(ndr, "maxcopywritelen", r->maxcopywritelen); - ndr_print_uint32(ndr, "minkeepsearch", r->minkeepsearch); - ndr_print_uint32(ndr, "maxkeepsearch", r->maxkeepsearch); - ndr_print_uint32(ndr, "minkeepcomplsearch", r->minkeepcomplsearch); - ndr_print_uint32(ndr, "maxkeepcomplsearch", r->maxkeepcomplsearch); - ndr_print_uint32(ndr, "threadcountadd", r->threadcountadd); - ndr_print_uint32(ndr, "numlockthreads", r->numlockthreads); - ndr_print_uint32(ndr, "scavtimeout", r->scavtimeout); - ndr_print_uint32(ndr, "minrcvqueue", r->minrcvqueue); - ndr_print_uint32(ndr, "minfreeworkitems", r->minfreeworkitems); - ndr_print_uint32(ndr, "xactmemsize", r->xactmemsize); - ndr_print_uint32(ndr, "threadpriority", r->threadpriority); - ndr_print_uint32(ndr, "maxmpxct", r->maxmpxct); - ndr_print_uint32(ndr, "oplockbreakwait", r->oplockbreakwait); - ndr_print_uint32(ndr, "oplockbreakresponsewait", r->oplockbreakresponsewait); - ndr_print_uint32(ndr, "enableoplocks", r->enableoplocks); - ndr_print_uint32(ndr, "enableoplockforceclose", r->enableoplockforceclose); - ndr_print_uint32(ndr, "enablefcbopens", r->enablefcbopens); - ndr_print_uint32(ndr, "enableraw", r->enableraw); - ndr_print_uint32(ndr, "enablesharednetdrives", r->enablesharednetdrives); - ndr_print_uint32(ndr, "minfreeconnections", r->minfreeconnections); - ndr_print_uint32(ndr, "maxfreeconnections", r->maxfreeconnections); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo599(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo599 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesssvc)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sizereqbufs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rawworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->irpstacksize)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxrawbuflen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessusers)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessconns)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxpagedmemoryusage)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxnonpagedmemoryusage)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesoftcompat)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableforcedlogoff)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timesource)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->acceptdownlevelapis)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lmannounce)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopyreadlen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopywritelen)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepsearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepcomplsearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepcomplsearch)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->threadcountadd)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numlockthreads)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavtimeout)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minrcvqueue)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeworkitems)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->xactmemsize)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->threadpriority)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxmpxct)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakwait)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakresponsewait)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplocks)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplockforceclose)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablefcbopens)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableraw)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesharednetdrives)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeconnections)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxfreeconnections)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initsesstable)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initconntable)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initfiletable)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initsearchtable)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alertsched)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->errortreshold)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->networkerrortreshold)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->diskspacetreshold)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlinkdelay)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minlinkthroughput)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linkinfovalidtime)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavqosinfoupdatetime)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitemidletime)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo599(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo599 *r) -{ - uint32_t _ptr_domain; - TALLOC_CTX *_mem_save_domain_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesssvc)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sizereqbufs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rawworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->irpstacksize)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxrawbuflen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessusers)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessconns)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxpagedmemoryusage)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxnonpagedmemoryusage)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesoftcompat)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableforcedlogoff)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timesource)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->acceptdownlevelapis)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lmannounce)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopyreadlen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopywritelen)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepsearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepcomplsearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepcomplsearch)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->threadcountadd)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numlockthreads)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavtimeout)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minrcvqueue)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeworkitems)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->xactmemsize)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->threadpriority)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxmpxct)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakwait)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakresponsewait)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplocks)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplockforceclose)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablefcbopens)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableraw)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesharednetdrives)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeconnections)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxfreeconnections)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initsesstable)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initconntable)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initfiletable)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initsearchtable)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alertsched)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->errortreshold)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->networkerrortreshold)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->diskspacetreshold)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlinkdelay)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minlinkthroughput)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->linkinfovalidtime)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavqosinfoupdatetime)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitemidletime)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo599(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo599 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo599"); - ndr->depth++; - ndr_print_uint32(ndr, "sessopen", r->sessopen); - ndr_print_uint32(ndr, "sesssvc", r->sesssvc); - ndr_print_uint32(ndr, "opensearch", r->opensearch); - ndr_print_uint32(ndr, "sizereqbufs", r->sizereqbufs); - ndr_print_uint32(ndr, "initworkitems", r->initworkitems); - ndr_print_uint32(ndr, "maxworkitems", r->maxworkitems); - ndr_print_uint32(ndr, "rawworkitems", r->rawworkitems); - ndr_print_uint32(ndr, "irpstacksize", r->irpstacksize); - ndr_print_uint32(ndr, "maxrawbuflen", r->maxrawbuflen); - ndr_print_uint32(ndr, "sessusers", r->sessusers); - ndr_print_uint32(ndr, "sessconns", r->sessconns); - ndr_print_uint32(ndr, "maxpagedmemoryusage", r->maxpagedmemoryusage); - ndr_print_uint32(ndr, "maxnonpagedmemoryusage", r->maxnonpagedmemoryusage); - ndr_print_uint32(ndr, "enablesoftcompat", r->enablesoftcompat); - ndr_print_uint32(ndr, "enableforcedlogoff", r->enableforcedlogoff); - ndr_print_uint32(ndr, "timesource", r->timesource); - ndr_print_uint32(ndr, "acceptdownlevelapis", r->acceptdownlevelapis); - ndr_print_uint32(ndr, "lmannounce", r->lmannounce); - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - ndr_print_uint32(ndr, "maxcopyreadlen", r->maxcopyreadlen); - ndr_print_uint32(ndr, "maxcopywritelen", r->maxcopywritelen); - ndr_print_uint32(ndr, "minkeepsearch", r->minkeepsearch); - ndr_print_uint32(ndr, "minkeepcomplsearch", r->minkeepcomplsearch); - ndr_print_uint32(ndr, "maxkeepcomplsearch", r->maxkeepcomplsearch); - ndr_print_uint32(ndr, "threadcountadd", r->threadcountadd); - ndr_print_uint32(ndr, "numlockthreads", r->numlockthreads); - ndr_print_uint32(ndr, "scavtimeout", r->scavtimeout); - ndr_print_uint32(ndr, "minrcvqueue", r->minrcvqueue); - ndr_print_uint32(ndr, "minfreeworkitems", r->minfreeworkitems); - ndr_print_uint32(ndr, "xactmemsize", r->xactmemsize); - ndr_print_uint32(ndr, "threadpriority", r->threadpriority); - ndr_print_uint32(ndr, "maxmpxct", r->maxmpxct); - ndr_print_uint32(ndr, "oplockbreakwait", r->oplockbreakwait); - ndr_print_uint32(ndr, "oplockbreakresponsewait", r->oplockbreakresponsewait); - ndr_print_uint32(ndr, "enableoplocks", r->enableoplocks); - ndr_print_uint32(ndr, "enableoplockforceclose", r->enableoplockforceclose); - ndr_print_uint32(ndr, "enablefcbopens", r->enablefcbopens); - ndr_print_uint32(ndr, "enableraw", r->enableraw); - ndr_print_uint32(ndr, "enablesharednetdrives", r->enablesharednetdrives); - ndr_print_uint32(ndr, "minfreeconnections", r->minfreeconnections); - ndr_print_uint32(ndr, "maxfreeconnections", r->maxfreeconnections); - ndr_print_uint32(ndr, "initsesstable", r->initsesstable); - ndr_print_uint32(ndr, "initconntable", r->initconntable); - ndr_print_uint32(ndr, "initfiletable", r->initfiletable); - ndr_print_uint32(ndr, "initsearchtable", r->initsearchtable); - ndr_print_uint32(ndr, "alertsched", r->alertsched); - ndr_print_uint32(ndr, "errortreshold", r->errortreshold); - ndr_print_uint32(ndr, "networkerrortreshold", r->networkerrortreshold); - ndr_print_uint32(ndr, "diskspacetreshold", r->diskspacetreshold); - ndr_print_uint32(ndr, "reserved", r->reserved); - ndr_print_uint32(ndr, "maxlinkdelay", r->maxlinkdelay); - ndr_print_uint32(ndr, "minlinkthroughput", r->minlinkthroughput); - ndr_print_uint32(ndr, "linkinfovalidtime", r->linkinfovalidtime); - ndr_print_uint32(ndr, "scavqosinfoupdatetime", r->scavqosinfoupdatetime); - ndr_print_uint32(ndr, "maxworkitemidletime", r->maxworkitemidletime); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1005(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1005 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->comment) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1005(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1005 *r) -{ - uint32_t _ptr_comment; - TALLOC_CTX *_mem_save_comment_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment)); - if (_ptr_comment) { - NDR_PULL_ALLOC(ndr, r->comment); - } else { - r->comment = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->comment) { - _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->comment)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->comment)); - if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1005 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1005"); - ndr->depth++; - ndr_print_ptr(ndr, "comment", r->comment); - ndr->depth++; - if (r->comment) { - ndr_print_string(ndr, "comment", r->comment); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1010(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1010 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->disc)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1010(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1010 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->disc)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1010(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1010 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1010"); - ndr->depth++; - ndr_print_uint32(ndr, "disc", r->disc); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1016(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1016 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->hidden)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1016(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1016 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->hidden)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1016(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1016 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1016"); - ndr->depth++; - ndr_print_uint32(ndr, "hidden", r->hidden); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1017(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1017 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->announce)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1017(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1017 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->announce)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1017(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1017 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1017"); - ndr->depth++; - ndr_print_uint32(ndr, "announce", r->announce); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1018(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1018 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->anndelta)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1018(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1018 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->anndelta)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1018(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1018 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1018"); - ndr->depth++; - ndr_print_uint32(ndr, "anndelta", r->anndelta); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1107(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1107 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->users)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1107(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1107 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->users)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1107(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1107 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1107"); - ndr->depth++; - ndr_print_uint32(ndr, "users", r->users); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1501(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1501 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessopens)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1501(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1501 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessopens)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1501 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1501"); - ndr->depth++; - ndr_print_uint32(ndr, "sessopens", r->sessopens); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1502 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessvcs)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1502(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1502 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessvcs)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1502 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1502"); - ndr->depth++; - ndr_print_uint32(ndr, "sessvcs", r->sessvcs); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1503(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1503 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->opensearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1503(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1503 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->opensearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1503(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1503 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1503"); - ndr->depth++; - ndr_print_uint32(ndr, "opensearch", r->opensearch); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1506(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1506 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitems)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1506(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1506 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitems)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1506(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1506 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1506"); - ndr->depth++; - ndr_print_uint32(ndr, "maxworkitems", r->maxworkitems); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1509(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1509 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxrawbuflen)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1509(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1509 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxrawbuflen)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1509(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1509 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1509"); - ndr->depth++; - ndr_print_uint32(ndr, "maxrawbuflen", r->maxrawbuflen); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1510(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1510 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sessusers)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1510(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1510 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sessusers)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1510(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1510 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1510"); - ndr->depth++; - ndr_print_uint32(ndr, "sessusers", r->sessusers); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1511(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1511 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sesscons)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1511(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1511 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sesscons)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1511(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1511 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1511"); - ndr->depth++; - ndr_print_uint32(ndr, "sesscons", r->sesscons); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1512(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1512 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxnonpagedmemoryusage)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1512(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1512 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxnonpagedmemoryusage)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1512(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1512 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1512"); - ndr->depth++; - ndr_print_uint32(ndr, "maxnonpagedmemoryusage", r->maxnonpagedmemoryusage); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1513(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1513 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxpagedmemoryusage)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1513(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1513 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxpagedmemoryusage)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1513(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1513 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1513"); - ndr->depth++; - ndr_print_uint32(ndr, "maxpagedmemoryusage", r->maxpagedmemoryusage); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1514(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1514 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesoftcompat)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1514(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1514 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesoftcompat)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1514(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1514 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1514"); - ndr->depth++; - ndr_print_uint32(ndr, "enablesoftcompat", r->enablesoftcompat); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1515(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1515 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableforcedlogoff)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1515(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1515 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableforcedlogoff)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1515(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1515 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1515"); - ndr->depth++; - ndr_print_uint32(ndr, "enableforcedlogoff", r->enableforcedlogoff); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1516(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1516 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->timesource)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1516(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1516 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->timesource)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1516(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1516 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1516"); - ndr->depth++; - ndr_print_uint32(ndr, "timesource", r->timesource); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1518(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1518 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lmannounce)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1518(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1518 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lmannounce)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1518(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1518 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1518"); - ndr->depth++; - ndr_print_uint32(ndr, "lmannounce", r->lmannounce); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1520(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1520 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopyreadlen)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1520(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1520 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopyreadlen)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1520(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1520 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1520"); - ndr->depth++; - ndr_print_uint32(ndr, "maxcopyreadlen", r->maxcopyreadlen); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1521(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1521 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxcopywritelen)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1521(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1521 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxcopywritelen)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1521(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1521 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1521"); - ndr->depth++; - ndr_print_uint32(ndr, "maxcopywritelen", r->maxcopywritelen); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1522(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1522 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepsearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1522(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1522 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepsearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1522(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1522 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1522"); - ndr->depth++; - ndr_print_uint32(ndr, "minkeepsearch", r->minkeepsearch); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1523(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1523 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepsearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1523(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1523 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepsearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1523(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1523 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1523"); - ndr->depth++; - ndr_print_uint32(ndr, "maxkeepsearch", r->maxkeepsearch); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1524(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1524 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minkeepcomplsearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1524(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1524 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minkeepcomplsearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1524(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1524 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1524"); - ndr->depth++; - ndr_print_uint32(ndr, "minkeepcomplsearch", r->minkeepcomplsearch); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1525(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1525 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxkeepcomplsearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1525(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1525 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxkeepcomplsearch)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1525(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1525 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1525"); - ndr->depth++; - ndr_print_uint32(ndr, "maxkeepcomplsearch", r->maxkeepcomplsearch); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1528(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1528 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavtimeout)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1528(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1528 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavtimeout)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1528(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1528 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1528"); - ndr->depth++; - ndr_print_uint32(ndr, "scavtimeout", r->scavtimeout); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1529(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1529 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minrcvqueue)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1529(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1529 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minrcvqueue)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1529(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1529 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1529"); - ndr->depth++; - ndr_print_uint32(ndr, "minrcvqueue", r->minrcvqueue); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1530(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1530 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeworkitems)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1530(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1530 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeworkitems)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1530(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1530 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1530"); - ndr->depth++; - ndr_print_uint32(ndr, "minfreeworkitems", r->minfreeworkitems); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1533(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1533 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxmpxct)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1533(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1533 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxmpxct)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1533(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1533 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1533"); - ndr->depth++; - ndr_print_uint32(ndr, "maxmpxct", r->maxmpxct); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1534(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1534 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakwait)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1534(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1534 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakwait)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1534(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1534 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1534"); - ndr->depth++; - ndr_print_uint32(ndr, "oplockbreakwait", r->oplockbreakwait); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1535(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1535 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplockbreakresponsewait)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1535(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1535 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplockbreakresponsewait)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1535(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1535 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1535"); - ndr->depth++; - ndr_print_uint32(ndr, "oplockbreakresponsewait", r->oplockbreakresponsewait); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1536(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1536 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplocks)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1536(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1536 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplocks)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1536(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1536 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1536"); - ndr->depth++; - ndr_print_uint32(ndr, "enableoplocks", r->enableoplocks); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1537(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1537 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableoplockforceclose)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1537(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1537 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableoplockforceclose)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1537(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1537 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1537"); - ndr->depth++; - ndr_print_uint32(ndr, "enableoplockforceclose", r->enableoplockforceclose); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1538(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1538 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablefcbopens)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1538(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1538 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablefcbopens)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1538(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1538 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1538"); - ndr->depth++; - ndr_print_uint32(ndr, "enablefcbopens", r->enablefcbopens); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1539(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1539 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enableraw)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1539(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1539 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enableraw)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1539(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1539 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1539"); - ndr->depth++; - ndr_print_uint32(ndr, "enableraw", r->enableraw); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1540(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1540 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enablesharednetdrives)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1540(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1540 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enablesharednetdrives)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1540(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1540 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1540"); - ndr->depth++; - ndr_print_uint32(ndr, "enablesharednetdrives", r->enablesharednetdrives); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1541(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1541 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minfreeconnections)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1541(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1541 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minfreeconnections)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1541(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1541 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1541"); - ndr->depth++; - ndr_print_uint32(ndr, "minfreeconnections", r->minfreeconnections); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1542(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1542 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxfreeconnections)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1542(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1542 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxfreeconnections)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1542(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1542 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1542"); - ndr->depth++; - ndr_print_uint32(ndr, "maxfreeconnections", r->maxfreeconnections); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1543(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1543 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initsesstable)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1543(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1543 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initsesstable)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1543(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1543 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1543"); - ndr->depth++; - ndr_print_uint32(ndr, "initsesstable", r->initsesstable); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1544(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1544 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initconntable)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1544(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1544 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initconntable)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1544(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1544 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1544"); - ndr->depth++; - ndr_print_uint32(ndr, "initconntable", r->initconntable); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1545(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1545 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initfiletable)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1545(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1545 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initfiletable)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1545(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1545 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1545"); - ndr->depth++; - ndr_print_uint32(ndr, "initfiletable", r->initfiletable); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1546(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1546 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->initsearchtable)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1546(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1546 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->initsearchtable)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1546(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1546 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1546"); - ndr->depth++; - ndr_print_uint32(ndr, "initsearchtable", r->initsearchtable); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1547(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1547 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alertsched)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1547(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1547 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alertsched)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1547(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1547 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1547"); - ndr->depth++; - ndr_print_uint32(ndr, "alertsched", r->alertsched); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1548(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1548 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->errortreshold)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1548(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1548 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->errortreshold)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1548(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1548 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1548"); - ndr->depth++; - ndr_print_uint32(ndr, "errortreshold", r->errortreshold); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1549(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1549 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->networkerrortreshold)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1549(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1549 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->networkerrortreshold)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1549(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1549 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1549"); - ndr->depth++; - ndr_print_uint32(ndr, "networkerrortreshold", r->networkerrortreshold); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1550(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1550 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->diskspacetreshold)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1550(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1550 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->diskspacetreshold)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1550(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1550 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1550"); - ndr->depth++; - ndr_print_uint32(ndr, "diskspacetreshold", r->diskspacetreshold); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1552(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1552 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlinkdelay)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1552(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1552 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlinkdelay)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1552(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1552 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1552"); - ndr->depth++; - ndr_print_uint32(ndr, "maxlinkdelay", r->maxlinkdelay); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1553(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1553 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minlinkthroughput)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1553(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1553 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minlinkthroughput)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1553(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1553 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1553"); - ndr->depth++; - ndr_print_uint32(ndr, "minlinkthroughput", r->minlinkthroughput); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1554(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1554 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linkinfovalidtime)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1554(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1554 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->linkinfovalidtime)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1554(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1554 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1554"); - ndr->depth++; - ndr_print_uint32(ndr, "linkinfovalidtime", r->linkinfovalidtime); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1555(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1555 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->scavqosinfoupdatetime)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1555(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1555 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->scavqosinfoupdatetime)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1555(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1555 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1555"); - ndr->depth++; - ndr_print_uint32(ndr, "scavqosinfoupdatetime", r->scavqosinfoupdatetime); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo1556(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo1556 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxworkitemidletime)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo1556(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo1556 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxworkitemidletime)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo1556(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1556 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvInfo1556"); - ndr->depth++; - ndr_print_uint32(ndr, "maxworkitemidletime", r->maxworkitemidletime); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetSrvInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 100: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info100)); - break; } - - case 101: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info101)); - break; } - - case 102: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info102)); - break; } - - case 402: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info402)); - break; } - - case 403: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info403)); - break; } - - case 502: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info502)); - break; } - - case 503: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info503)); - break; } - - case 599: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info599)); - break; } - - case 1005: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1005)); - break; } - - case 1010: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1010)); - break; } - - case 1016: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1016)); - break; } - - case 1017: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1017)); - break; } - - case 1018: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1018)); - break; } - - case 1107: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1107)); - break; } - - case 1501: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1501)); - break; } - - case 1502: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1502)); - break; } - - case 1503: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1503)); - break; } - - case 1506: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1506)); - break; } - - case 1509: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1509)); - break; } - - case 1510: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1510)); - break; } - - case 1511: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1511)); - break; } - - case 1512: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1512)); - break; } - - case 1513: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1513)); - break; } - - case 1514: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1514)); - break; } - - case 1515: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1515)); - break; } - - case 1516: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1516)); - break; } - - case 1518: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1518)); - break; } - - case 1520: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1520)); - break; } - - case 1521: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1521)); - break; } - - case 1522: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1522)); - break; } - - case 1523: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1523)); - break; } - - case 1524: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1524)); - break; } - - case 1525: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1525)); - break; } - - case 1528: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1528)); - break; } - - case 1529: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1529)); - break; } - - case 1530: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1530)); - break; } - - case 1533: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1533)); - break; } - - case 1534: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1534)); - break; } - - case 1535: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1535)); - break; } - - case 1536: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1536)); - break; } - - case 1537: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1537)); - break; } - - case 1538: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1538)); - break; } - - case 1539: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1539)); - break; } - - case 1540: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1540)); - break; } - - case 1541: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1541)); - break; } - - case 1542: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1542)); - break; } - - case 1543: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1543)); - break; } - - case 1544: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1544)); - break; } - - case 1545: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1545)); - break; } - - case 1546: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1546)); - break; } - - case 1547: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1547)); - break; } - - case 1548: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1548)); - break; } - - case 1549: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1549)); - break; } - - case 1550: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1550)); - break; } - - case 1552: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1552)); - break; } - - case 1553: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1553)); - break; } - - case 1554: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1554)); - break; } - - case 1555: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1555)); - break; } - - case 1556: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1556)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 100: - if (r->info100) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); - } - break; - - case 101: - if (r->info101) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info101)); - } - break; - - case 102: - if (r->info102) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo102(ndr, NDR_SCALARS|NDR_BUFFERS, r->info102)); - } - break; - - case 402: - if (r->info402) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo402(ndr, NDR_SCALARS|NDR_BUFFERS, r->info402)); - } - break; - - case 403: - if (r->info403) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo403(ndr, NDR_SCALARS|NDR_BUFFERS, r->info403)); - } - break; - - case 502: - if (r->info502) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo502(ndr, NDR_SCALARS, r->info502)); - } - break; - - case 503: - if (r->info503) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo503(ndr, NDR_SCALARS|NDR_BUFFERS, r->info503)); - } - break; - - case 599: - if (r->info599) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo599(ndr, NDR_SCALARS|NDR_BUFFERS, r->info599)); - } - break; - - case 1005: - if (r->info1005) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1005(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1005)); - } - break; - - case 1010: - if (r->info1010) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1010(ndr, NDR_SCALARS, r->info1010)); - } - break; - - case 1016: - if (r->info1016) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1016(ndr, NDR_SCALARS, r->info1016)); - } - break; - - case 1017: - if (r->info1017) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1017(ndr, NDR_SCALARS, r->info1017)); - } - break; - - case 1018: - if (r->info1018) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1018(ndr, NDR_SCALARS, r->info1018)); - } - break; - - case 1107: - if (r->info1107) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1107(ndr, NDR_SCALARS, r->info1107)); - } - break; - - case 1501: - if (r->info1501) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1501(ndr, NDR_SCALARS, r->info1501)); - } - break; - - case 1502: - if (r->info1502) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1502(ndr, NDR_SCALARS, r->info1502)); - } - break; - - case 1503: - if (r->info1503) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1503(ndr, NDR_SCALARS, r->info1503)); - } - break; - - case 1506: - if (r->info1506) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1506(ndr, NDR_SCALARS, r->info1506)); - } - break; - - case 1509: - if (r->info1509) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1509(ndr, NDR_SCALARS, r->info1509)); - } - break; - - case 1510: - if (r->info1510) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1510(ndr, NDR_SCALARS, r->info1510)); - } - break; - - case 1511: - if (r->info1511) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1511(ndr, NDR_SCALARS, r->info1511)); - } - break; - - case 1512: - if (r->info1512) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1512(ndr, NDR_SCALARS, r->info1512)); - } - break; - - case 1513: - if (r->info1513) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1513(ndr, NDR_SCALARS, r->info1513)); - } - break; - - case 1514: - if (r->info1514) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1514(ndr, NDR_SCALARS, r->info1514)); - } - break; - - case 1515: - if (r->info1515) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1515(ndr, NDR_SCALARS, r->info1515)); - } - break; - - case 1516: - if (r->info1516) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1516(ndr, NDR_SCALARS, r->info1516)); - } - break; - - case 1518: - if (r->info1518) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1518(ndr, NDR_SCALARS, r->info1518)); - } - break; - - case 1520: - if (r->info1520) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1520(ndr, NDR_SCALARS, r->info1520)); - } - break; - - case 1521: - if (r->info1521) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1521(ndr, NDR_SCALARS, r->info1521)); - } - break; - - case 1522: - if (r->info1522) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1522(ndr, NDR_SCALARS, r->info1522)); - } - break; - - case 1523: - if (r->info1523) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1523(ndr, NDR_SCALARS, r->info1523)); - } - break; - - case 1524: - if (r->info1524) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1524(ndr, NDR_SCALARS, r->info1524)); - } - break; - - case 1525: - if (r->info1525) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1525(ndr, NDR_SCALARS, r->info1525)); - } - break; - - case 1528: - if (r->info1528) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1528(ndr, NDR_SCALARS, r->info1528)); - } - break; - - case 1529: - if (r->info1529) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1529(ndr, NDR_SCALARS, r->info1529)); - } - break; - - case 1530: - if (r->info1530) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1530(ndr, NDR_SCALARS, r->info1530)); - } - break; - - case 1533: - if (r->info1533) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1533(ndr, NDR_SCALARS, r->info1533)); - } - break; - - case 1534: - if (r->info1534) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1534(ndr, NDR_SCALARS, r->info1534)); - } - break; - - case 1535: - if (r->info1535) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1535(ndr, NDR_SCALARS, r->info1535)); - } - break; - - case 1536: - if (r->info1536) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1536(ndr, NDR_SCALARS, r->info1536)); - } - break; - - case 1537: - if (r->info1537) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1537(ndr, NDR_SCALARS, r->info1537)); - } - break; - - case 1538: - if (r->info1538) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1538(ndr, NDR_SCALARS, r->info1538)); - } - break; - - case 1539: - if (r->info1539) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1539(ndr, NDR_SCALARS, r->info1539)); - } - break; - - case 1540: - if (r->info1540) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1540(ndr, NDR_SCALARS, r->info1540)); - } - break; - - case 1541: - if (r->info1541) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1541(ndr, NDR_SCALARS, r->info1541)); - } - break; - - case 1542: - if (r->info1542) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1542(ndr, NDR_SCALARS, r->info1542)); - } - break; - - case 1543: - if (r->info1543) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1543(ndr, NDR_SCALARS, r->info1543)); - } - break; - - case 1544: - if (r->info1544) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1544(ndr, NDR_SCALARS, r->info1544)); - } - break; - - case 1545: - if (r->info1545) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1545(ndr, NDR_SCALARS, r->info1545)); - } - break; - - case 1546: - if (r->info1546) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1546(ndr, NDR_SCALARS, r->info1546)); - } - break; - - case 1547: - if (r->info1547) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1547(ndr, NDR_SCALARS, r->info1547)); - } - break; - - case 1548: - if (r->info1548) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1548(ndr, NDR_SCALARS, r->info1548)); - } - break; - - case 1549: - if (r->info1549) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1549(ndr, NDR_SCALARS, r->info1549)); - } - break; - - case 1550: - if (r->info1550) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1550(ndr, NDR_SCALARS, r->info1550)); - } - break; - - case 1552: - if (r->info1552) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1552(ndr, NDR_SCALARS, r->info1552)); - } - break; - - case 1553: - if (r->info1553) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1553(ndr, NDR_SCALARS, r->info1553)); - } - break; - - case 1554: - if (r->info1554) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1554(ndr, NDR_SCALARS, r->info1554)); - } - break; - - case 1555: - if (r->info1555) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1555(ndr, NDR_SCALARS, r->info1555)); - } - break; - - case 1556: - if (r->info1556) { - NDR_CHECK(ndr_push_srvsvc_NetSrvInfo1556(ndr, NDR_SCALARS, r->info1556)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetSrvInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info100_0; - TALLOC_CTX *_mem_save_info101_0; - TALLOC_CTX *_mem_save_info102_0; - TALLOC_CTX *_mem_save_info402_0; - TALLOC_CTX *_mem_save_info403_0; - TALLOC_CTX *_mem_save_info502_0; - TALLOC_CTX *_mem_save_info503_0; - TALLOC_CTX *_mem_save_info599_0; - TALLOC_CTX *_mem_save_info1005_0; - TALLOC_CTX *_mem_save_info1010_0; - TALLOC_CTX *_mem_save_info1016_0; - TALLOC_CTX *_mem_save_info1017_0; - TALLOC_CTX *_mem_save_info1018_0; - TALLOC_CTX *_mem_save_info1107_0; - TALLOC_CTX *_mem_save_info1501_0; - TALLOC_CTX *_mem_save_info1502_0; - TALLOC_CTX *_mem_save_info1503_0; - TALLOC_CTX *_mem_save_info1506_0; - TALLOC_CTX *_mem_save_info1509_0; - TALLOC_CTX *_mem_save_info1510_0; - TALLOC_CTX *_mem_save_info1511_0; - TALLOC_CTX *_mem_save_info1512_0; - TALLOC_CTX *_mem_save_info1513_0; - TALLOC_CTX *_mem_save_info1514_0; - TALLOC_CTX *_mem_save_info1515_0; - TALLOC_CTX *_mem_save_info1516_0; - TALLOC_CTX *_mem_save_info1518_0; - TALLOC_CTX *_mem_save_info1520_0; - TALLOC_CTX *_mem_save_info1521_0; - TALLOC_CTX *_mem_save_info1522_0; - TALLOC_CTX *_mem_save_info1523_0; - TALLOC_CTX *_mem_save_info1524_0; - TALLOC_CTX *_mem_save_info1525_0; - TALLOC_CTX *_mem_save_info1528_0; - TALLOC_CTX *_mem_save_info1529_0; - TALLOC_CTX *_mem_save_info1530_0; - TALLOC_CTX *_mem_save_info1533_0; - TALLOC_CTX *_mem_save_info1534_0; - TALLOC_CTX *_mem_save_info1535_0; - TALLOC_CTX *_mem_save_info1536_0; - TALLOC_CTX *_mem_save_info1537_0; - TALLOC_CTX *_mem_save_info1538_0; - TALLOC_CTX *_mem_save_info1539_0; - TALLOC_CTX *_mem_save_info1540_0; - TALLOC_CTX *_mem_save_info1541_0; - TALLOC_CTX *_mem_save_info1542_0; - TALLOC_CTX *_mem_save_info1543_0; - TALLOC_CTX *_mem_save_info1544_0; - TALLOC_CTX *_mem_save_info1545_0; - TALLOC_CTX *_mem_save_info1546_0; - TALLOC_CTX *_mem_save_info1547_0; - TALLOC_CTX *_mem_save_info1548_0; - TALLOC_CTX *_mem_save_info1549_0; - TALLOC_CTX *_mem_save_info1550_0; - TALLOC_CTX *_mem_save_info1552_0; - TALLOC_CTX *_mem_save_info1553_0; - TALLOC_CTX *_mem_save_info1554_0; - TALLOC_CTX *_mem_save_info1555_0; - TALLOC_CTX *_mem_save_info1556_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 100: { - uint32_t _ptr_info100; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info100)); - if (_ptr_info100) { - NDR_PULL_ALLOC(ndr, r->info100); - } else { - r->info100 = NULL; - } - break; } - - case 101: { - uint32_t _ptr_info101; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info101)); - if (_ptr_info101) { - NDR_PULL_ALLOC(ndr, r->info101); - } else { - r->info101 = NULL; - } - break; } - - case 102: { - uint32_t _ptr_info102; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info102)); - if (_ptr_info102) { - NDR_PULL_ALLOC(ndr, r->info102); - } else { - r->info102 = NULL; - } - break; } - - case 402: { - uint32_t _ptr_info402; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info402)); - if (_ptr_info402) { - NDR_PULL_ALLOC(ndr, r->info402); - } else { - r->info402 = NULL; - } - break; } - - case 403: { - uint32_t _ptr_info403; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info403)); - if (_ptr_info403) { - NDR_PULL_ALLOC(ndr, r->info403); - } else { - r->info403 = NULL; - } - break; } - - case 502: { - uint32_t _ptr_info502; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info502)); - if (_ptr_info502) { - NDR_PULL_ALLOC(ndr, r->info502); - } else { - r->info502 = NULL; - } - break; } - - case 503: { - uint32_t _ptr_info503; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info503)); - if (_ptr_info503) { - NDR_PULL_ALLOC(ndr, r->info503); - } else { - r->info503 = NULL; - } - break; } - - case 599: { - uint32_t _ptr_info599; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info599)); - if (_ptr_info599) { - NDR_PULL_ALLOC(ndr, r->info599); - } else { - r->info599 = NULL; - } - break; } - - case 1005: { - uint32_t _ptr_info1005; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1005)); - if (_ptr_info1005) { - NDR_PULL_ALLOC(ndr, r->info1005); - } else { - r->info1005 = NULL; - } - break; } - - case 1010: { - uint32_t _ptr_info1010; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1010)); - if (_ptr_info1010) { - NDR_PULL_ALLOC(ndr, r->info1010); - } else { - r->info1010 = NULL; - } - break; } - - case 1016: { - uint32_t _ptr_info1016; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1016)); - if (_ptr_info1016) { - NDR_PULL_ALLOC(ndr, r->info1016); - } else { - r->info1016 = NULL; - } - break; } - - case 1017: { - uint32_t _ptr_info1017; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1017)); - if (_ptr_info1017) { - NDR_PULL_ALLOC(ndr, r->info1017); - } else { - r->info1017 = NULL; - } - break; } - - case 1018: { - uint32_t _ptr_info1018; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1018)); - if (_ptr_info1018) { - NDR_PULL_ALLOC(ndr, r->info1018); - } else { - r->info1018 = NULL; - } - break; } - - case 1107: { - uint32_t _ptr_info1107; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1107)); - if (_ptr_info1107) { - NDR_PULL_ALLOC(ndr, r->info1107); - } else { - r->info1107 = NULL; - } - break; } - - case 1501: { - uint32_t _ptr_info1501; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1501)); - if (_ptr_info1501) { - NDR_PULL_ALLOC(ndr, r->info1501); - } else { - r->info1501 = NULL; - } - break; } - - case 1502: { - uint32_t _ptr_info1502; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1502)); - if (_ptr_info1502) { - NDR_PULL_ALLOC(ndr, r->info1502); - } else { - r->info1502 = NULL; - } - break; } - - case 1503: { - uint32_t _ptr_info1503; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1503)); - if (_ptr_info1503) { - NDR_PULL_ALLOC(ndr, r->info1503); - } else { - r->info1503 = NULL; - } - break; } - - case 1506: { - uint32_t _ptr_info1506; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1506)); - if (_ptr_info1506) { - NDR_PULL_ALLOC(ndr, r->info1506); - } else { - r->info1506 = NULL; - } - break; } - - case 1509: { - uint32_t _ptr_info1509; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1509)); - if (_ptr_info1509) { - NDR_PULL_ALLOC(ndr, r->info1509); - } else { - r->info1509 = NULL; - } - break; } - - case 1510: { - uint32_t _ptr_info1510; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1510)); - if (_ptr_info1510) { - NDR_PULL_ALLOC(ndr, r->info1510); - } else { - r->info1510 = NULL; - } - break; } - - case 1511: { - uint32_t _ptr_info1511; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1511)); - if (_ptr_info1511) { - NDR_PULL_ALLOC(ndr, r->info1511); - } else { - r->info1511 = NULL; - } - break; } - - case 1512: { - uint32_t _ptr_info1512; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1512)); - if (_ptr_info1512) { - NDR_PULL_ALLOC(ndr, r->info1512); - } else { - r->info1512 = NULL; - } - break; } - - case 1513: { - uint32_t _ptr_info1513; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1513)); - if (_ptr_info1513) { - NDR_PULL_ALLOC(ndr, r->info1513); - } else { - r->info1513 = NULL; - } - break; } - - case 1514: { - uint32_t _ptr_info1514; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1514)); - if (_ptr_info1514) { - NDR_PULL_ALLOC(ndr, r->info1514); - } else { - r->info1514 = NULL; - } - break; } - - case 1515: { - uint32_t _ptr_info1515; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1515)); - if (_ptr_info1515) { - NDR_PULL_ALLOC(ndr, r->info1515); - } else { - r->info1515 = NULL; - } - break; } - - case 1516: { - uint32_t _ptr_info1516; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1516)); - if (_ptr_info1516) { - NDR_PULL_ALLOC(ndr, r->info1516); - } else { - r->info1516 = NULL; - } - break; } - - case 1518: { - uint32_t _ptr_info1518; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1518)); - if (_ptr_info1518) { - NDR_PULL_ALLOC(ndr, r->info1518); - } else { - r->info1518 = NULL; - } - break; } - - case 1520: { - uint32_t _ptr_info1520; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1520)); - if (_ptr_info1520) { - NDR_PULL_ALLOC(ndr, r->info1520); - } else { - r->info1520 = NULL; - } - break; } - - case 1521: { - uint32_t _ptr_info1521; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1521)); - if (_ptr_info1521) { - NDR_PULL_ALLOC(ndr, r->info1521); - } else { - r->info1521 = NULL; - } - break; } - - case 1522: { - uint32_t _ptr_info1522; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1522)); - if (_ptr_info1522) { - NDR_PULL_ALLOC(ndr, r->info1522); - } else { - r->info1522 = NULL; - } - break; } - - case 1523: { - uint32_t _ptr_info1523; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1523)); - if (_ptr_info1523) { - NDR_PULL_ALLOC(ndr, r->info1523); - } else { - r->info1523 = NULL; - } - break; } - - case 1524: { - uint32_t _ptr_info1524; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1524)); - if (_ptr_info1524) { - NDR_PULL_ALLOC(ndr, r->info1524); - } else { - r->info1524 = NULL; - } - break; } - - case 1525: { - uint32_t _ptr_info1525; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1525)); - if (_ptr_info1525) { - NDR_PULL_ALLOC(ndr, r->info1525); - } else { - r->info1525 = NULL; - } - break; } - - case 1528: { - uint32_t _ptr_info1528; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1528)); - if (_ptr_info1528) { - NDR_PULL_ALLOC(ndr, r->info1528); - } else { - r->info1528 = NULL; - } - break; } - - case 1529: { - uint32_t _ptr_info1529; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1529)); - if (_ptr_info1529) { - NDR_PULL_ALLOC(ndr, r->info1529); - } else { - r->info1529 = NULL; - } - break; } - - case 1530: { - uint32_t _ptr_info1530; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1530)); - if (_ptr_info1530) { - NDR_PULL_ALLOC(ndr, r->info1530); - } else { - r->info1530 = NULL; - } - break; } - - case 1533: { - uint32_t _ptr_info1533; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1533)); - if (_ptr_info1533) { - NDR_PULL_ALLOC(ndr, r->info1533); - } else { - r->info1533 = NULL; - } - break; } - - case 1534: { - uint32_t _ptr_info1534; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1534)); - if (_ptr_info1534) { - NDR_PULL_ALLOC(ndr, r->info1534); - } else { - r->info1534 = NULL; - } - break; } - - case 1535: { - uint32_t _ptr_info1535; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1535)); - if (_ptr_info1535) { - NDR_PULL_ALLOC(ndr, r->info1535); - } else { - r->info1535 = NULL; - } - break; } - - case 1536: { - uint32_t _ptr_info1536; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1536)); - if (_ptr_info1536) { - NDR_PULL_ALLOC(ndr, r->info1536); - } else { - r->info1536 = NULL; - } - break; } - - case 1537: { - uint32_t _ptr_info1537; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1537)); - if (_ptr_info1537) { - NDR_PULL_ALLOC(ndr, r->info1537); - } else { - r->info1537 = NULL; - } - break; } - - case 1538: { - uint32_t _ptr_info1538; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1538)); - if (_ptr_info1538) { - NDR_PULL_ALLOC(ndr, r->info1538); - } else { - r->info1538 = NULL; - } - break; } - - case 1539: { - uint32_t _ptr_info1539; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1539)); - if (_ptr_info1539) { - NDR_PULL_ALLOC(ndr, r->info1539); - } else { - r->info1539 = NULL; - } - break; } - - case 1540: { - uint32_t _ptr_info1540; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1540)); - if (_ptr_info1540) { - NDR_PULL_ALLOC(ndr, r->info1540); - } else { - r->info1540 = NULL; - } - break; } - - case 1541: { - uint32_t _ptr_info1541; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1541)); - if (_ptr_info1541) { - NDR_PULL_ALLOC(ndr, r->info1541); - } else { - r->info1541 = NULL; - } - break; } - - case 1542: { - uint32_t _ptr_info1542; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1542)); - if (_ptr_info1542) { - NDR_PULL_ALLOC(ndr, r->info1542); - } else { - r->info1542 = NULL; - } - break; } - - case 1543: { - uint32_t _ptr_info1543; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1543)); - if (_ptr_info1543) { - NDR_PULL_ALLOC(ndr, r->info1543); - } else { - r->info1543 = NULL; - } - break; } - - case 1544: { - uint32_t _ptr_info1544; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1544)); - if (_ptr_info1544) { - NDR_PULL_ALLOC(ndr, r->info1544); - } else { - r->info1544 = NULL; - } - break; } - - case 1545: { - uint32_t _ptr_info1545; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1545)); - if (_ptr_info1545) { - NDR_PULL_ALLOC(ndr, r->info1545); - } else { - r->info1545 = NULL; - } - break; } - - case 1546: { - uint32_t _ptr_info1546; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1546)); - if (_ptr_info1546) { - NDR_PULL_ALLOC(ndr, r->info1546); - } else { - r->info1546 = NULL; - } - break; } - - case 1547: { - uint32_t _ptr_info1547; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1547)); - if (_ptr_info1547) { - NDR_PULL_ALLOC(ndr, r->info1547); - } else { - r->info1547 = NULL; - } - break; } - - case 1548: { - uint32_t _ptr_info1548; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1548)); - if (_ptr_info1548) { - NDR_PULL_ALLOC(ndr, r->info1548); - } else { - r->info1548 = NULL; - } - break; } - - case 1549: { - uint32_t _ptr_info1549; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1549)); - if (_ptr_info1549) { - NDR_PULL_ALLOC(ndr, r->info1549); - } else { - r->info1549 = NULL; - } - break; } - - case 1550: { - uint32_t _ptr_info1550; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1550)); - if (_ptr_info1550) { - NDR_PULL_ALLOC(ndr, r->info1550); - } else { - r->info1550 = NULL; - } - break; } - - case 1552: { - uint32_t _ptr_info1552; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1552)); - if (_ptr_info1552) { - NDR_PULL_ALLOC(ndr, r->info1552); - } else { - r->info1552 = NULL; - } - break; } - - case 1553: { - uint32_t _ptr_info1553; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1553)); - if (_ptr_info1553) { - NDR_PULL_ALLOC(ndr, r->info1553); - } else { - r->info1553 = NULL; - } - break; } - - case 1554: { - uint32_t _ptr_info1554; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1554)); - if (_ptr_info1554) { - NDR_PULL_ALLOC(ndr, r->info1554); - } else { - r->info1554 = NULL; - } - break; } - - case 1555: { - uint32_t _ptr_info1555; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1555)); - if (_ptr_info1555) { - NDR_PULL_ALLOC(ndr, r->info1555); - } else { - r->info1555 = NULL; - } - break; } - - case 1556: { - uint32_t _ptr_info1556; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1556)); - if (_ptr_info1556) { - NDR_PULL_ALLOC(ndr, r->info1556); - } else { - r->info1556 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 100: - if (r->info100) { - _mem_save_info100_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info100, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info100_0, 0); - } - break; - - case 101: - if (r->info101) { - _mem_save_info101_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info101, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info101)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info101_0, 0); - } - break; - - case 102: - if (r->info102) { - _mem_save_info102_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info102, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo102(ndr, NDR_SCALARS|NDR_BUFFERS, r->info102)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info102_0, 0); - } - break; - - case 402: - if (r->info402) { - _mem_save_info402_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info402, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo402(ndr, NDR_SCALARS|NDR_BUFFERS, r->info402)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info402_0, 0); - } - break; - - case 403: - if (r->info403) { - _mem_save_info403_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info403, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo403(ndr, NDR_SCALARS|NDR_BUFFERS, r->info403)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info403_0, 0); - } - break; - - case 502: - if (r->info502) { - _mem_save_info502_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info502, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo502(ndr, NDR_SCALARS, r->info502)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info502_0, 0); - } - break; - - case 503: - if (r->info503) { - _mem_save_info503_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info503, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo503(ndr, NDR_SCALARS|NDR_BUFFERS, r->info503)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info503_0, 0); - } - break; - - case 599: - if (r->info599) { - _mem_save_info599_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info599, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo599(ndr, NDR_SCALARS|NDR_BUFFERS, r->info599)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info599_0, 0); - } - break; - - case 1005: - if (r->info1005) { - _mem_save_info1005_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1005, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1005(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1005)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1005_0, 0); - } - break; - - case 1010: - if (r->info1010) { - _mem_save_info1010_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1010, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1010(ndr, NDR_SCALARS, r->info1010)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1010_0, 0); - } - break; - - case 1016: - if (r->info1016) { - _mem_save_info1016_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1016, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1016(ndr, NDR_SCALARS, r->info1016)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1016_0, 0); - } - break; - - case 1017: - if (r->info1017) { - _mem_save_info1017_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1017, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1017(ndr, NDR_SCALARS, r->info1017)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1017_0, 0); - } - break; - - case 1018: - if (r->info1018) { - _mem_save_info1018_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1018, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1018(ndr, NDR_SCALARS, r->info1018)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1018_0, 0); - } - break; - - case 1107: - if (r->info1107) { - _mem_save_info1107_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1107, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1107(ndr, NDR_SCALARS, r->info1107)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1107_0, 0); - } - break; - - case 1501: - if (r->info1501) { - _mem_save_info1501_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1501, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1501(ndr, NDR_SCALARS, r->info1501)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1501_0, 0); - } - break; - - case 1502: - if (r->info1502) { - _mem_save_info1502_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1502, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1502(ndr, NDR_SCALARS, r->info1502)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1502_0, 0); - } - break; - - case 1503: - if (r->info1503) { - _mem_save_info1503_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1503, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1503(ndr, NDR_SCALARS, r->info1503)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1503_0, 0); - } - break; - - case 1506: - if (r->info1506) { - _mem_save_info1506_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1506, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1506(ndr, NDR_SCALARS, r->info1506)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1506_0, 0); - } - break; - - case 1509: - if (r->info1509) { - _mem_save_info1509_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1509, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1509(ndr, NDR_SCALARS, r->info1509)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1509_0, 0); - } - break; - - case 1510: - if (r->info1510) { - _mem_save_info1510_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1510, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1510(ndr, NDR_SCALARS, r->info1510)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1510_0, 0); - } - break; - - case 1511: - if (r->info1511) { - _mem_save_info1511_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1511, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1511(ndr, NDR_SCALARS, r->info1511)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1511_0, 0); - } - break; - - case 1512: - if (r->info1512) { - _mem_save_info1512_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1512, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1512(ndr, NDR_SCALARS, r->info1512)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1512_0, 0); - } - break; - - case 1513: - if (r->info1513) { - _mem_save_info1513_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1513, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1513(ndr, NDR_SCALARS, r->info1513)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1513_0, 0); - } - break; - - case 1514: - if (r->info1514) { - _mem_save_info1514_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1514, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1514(ndr, NDR_SCALARS, r->info1514)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1514_0, 0); - } - break; - - case 1515: - if (r->info1515) { - _mem_save_info1515_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1515, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1515(ndr, NDR_SCALARS, r->info1515)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1515_0, 0); - } - break; - - case 1516: - if (r->info1516) { - _mem_save_info1516_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1516, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1516(ndr, NDR_SCALARS, r->info1516)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1516_0, 0); - } - break; - - case 1518: - if (r->info1518) { - _mem_save_info1518_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1518, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1518(ndr, NDR_SCALARS, r->info1518)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1518_0, 0); - } - break; - - case 1520: - if (r->info1520) { - _mem_save_info1520_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1520, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1520(ndr, NDR_SCALARS, r->info1520)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1520_0, 0); - } - break; - - case 1521: - if (r->info1521) { - _mem_save_info1521_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1521, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1521(ndr, NDR_SCALARS, r->info1521)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1521_0, 0); - } - break; - - case 1522: - if (r->info1522) { - _mem_save_info1522_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1522, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1522(ndr, NDR_SCALARS, r->info1522)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1522_0, 0); - } - break; - - case 1523: - if (r->info1523) { - _mem_save_info1523_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1523, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1523(ndr, NDR_SCALARS, r->info1523)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1523_0, 0); - } - break; - - case 1524: - if (r->info1524) { - _mem_save_info1524_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1524, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1524(ndr, NDR_SCALARS, r->info1524)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1524_0, 0); - } - break; - - case 1525: - if (r->info1525) { - _mem_save_info1525_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1525, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1525(ndr, NDR_SCALARS, r->info1525)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1525_0, 0); - } - break; - - case 1528: - if (r->info1528) { - _mem_save_info1528_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1528, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1528(ndr, NDR_SCALARS, r->info1528)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1528_0, 0); - } - break; - - case 1529: - if (r->info1529) { - _mem_save_info1529_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1529, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1529(ndr, NDR_SCALARS, r->info1529)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1529_0, 0); - } - break; - - case 1530: - if (r->info1530) { - _mem_save_info1530_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1530, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1530(ndr, NDR_SCALARS, r->info1530)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1530_0, 0); - } - break; - - case 1533: - if (r->info1533) { - _mem_save_info1533_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1533, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1533(ndr, NDR_SCALARS, r->info1533)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1533_0, 0); - } - break; - - case 1534: - if (r->info1534) { - _mem_save_info1534_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1534, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1534(ndr, NDR_SCALARS, r->info1534)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1534_0, 0); - } - break; - - case 1535: - if (r->info1535) { - _mem_save_info1535_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1535, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1535(ndr, NDR_SCALARS, r->info1535)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1535_0, 0); - } - break; - - case 1536: - if (r->info1536) { - _mem_save_info1536_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1536, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1536(ndr, NDR_SCALARS, r->info1536)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1536_0, 0); - } - break; - - case 1537: - if (r->info1537) { - _mem_save_info1537_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1537, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1537(ndr, NDR_SCALARS, r->info1537)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1537_0, 0); - } - break; - - case 1538: - if (r->info1538) { - _mem_save_info1538_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1538, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1538(ndr, NDR_SCALARS, r->info1538)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1538_0, 0); - } - break; - - case 1539: - if (r->info1539) { - _mem_save_info1539_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1539, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1539(ndr, NDR_SCALARS, r->info1539)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1539_0, 0); - } - break; - - case 1540: - if (r->info1540) { - _mem_save_info1540_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1540, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1540(ndr, NDR_SCALARS, r->info1540)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1540_0, 0); - } - break; - - case 1541: - if (r->info1541) { - _mem_save_info1541_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1541, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1541(ndr, NDR_SCALARS, r->info1541)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1541_0, 0); - } - break; - - case 1542: - if (r->info1542) { - _mem_save_info1542_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1542, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1542(ndr, NDR_SCALARS, r->info1542)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1542_0, 0); - } - break; - - case 1543: - if (r->info1543) { - _mem_save_info1543_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1543, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1543(ndr, NDR_SCALARS, r->info1543)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1543_0, 0); - } - break; - - case 1544: - if (r->info1544) { - _mem_save_info1544_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1544, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1544(ndr, NDR_SCALARS, r->info1544)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1544_0, 0); - } - break; - - case 1545: - if (r->info1545) { - _mem_save_info1545_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1545, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1545(ndr, NDR_SCALARS, r->info1545)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1545_0, 0); - } - break; - - case 1546: - if (r->info1546) { - _mem_save_info1546_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1546, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1546(ndr, NDR_SCALARS, r->info1546)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1546_0, 0); - } - break; - - case 1547: - if (r->info1547) { - _mem_save_info1547_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1547, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1547(ndr, NDR_SCALARS, r->info1547)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1547_0, 0); - } - break; - - case 1548: - if (r->info1548) { - _mem_save_info1548_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1548, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1548(ndr, NDR_SCALARS, r->info1548)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1548_0, 0); - } - break; - - case 1549: - if (r->info1549) { - _mem_save_info1549_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1549, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1549(ndr, NDR_SCALARS, r->info1549)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1549_0, 0); - } - break; - - case 1550: - if (r->info1550) { - _mem_save_info1550_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1550, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1550(ndr, NDR_SCALARS, r->info1550)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1550_0, 0); - } - break; - - case 1552: - if (r->info1552) { - _mem_save_info1552_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1552, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1552(ndr, NDR_SCALARS, r->info1552)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1552_0, 0); - } - break; - - case 1553: - if (r->info1553) { - _mem_save_info1553_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1553, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1553(ndr, NDR_SCALARS, r->info1553)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1553_0, 0); - } - break; - - case 1554: - if (r->info1554) { - _mem_save_info1554_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1554, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1554(ndr, NDR_SCALARS, r->info1554)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1554_0, 0); - } - break; - - case 1555: - if (r->info1555) { - _mem_save_info1555_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1555, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1555(ndr, NDR_SCALARS, r->info1555)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1555_0, 0); - } - break; - - case 1556: - if (r->info1556) { - _mem_save_info1556_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1556, 0); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo1556(ndr, NDR_SCALARS, r->info1556)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1556_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetSrvInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetSrvInfo"); - switch (level) { - case 100: - ndr_print_ptr(ndr, "info100", r->info100); - ndr->depth++; - if (r->info100) { - ndr_print_srvsvc_NetSrvInfo100(ndr, "info100", r->info100); - } - ndr->depth--; - break; - - case 101: - ndr_print_ptr(ndr, "info101", r->info101); - ndr->depth++; - if (r->info101) { - ndr_print_srvsvc_NetSrvInfo101(ndr, "info101", r->info101); - } - ndr->depth--; - break; - - case 102: - ndr_print_ptr(ndr, "info102", r->info102); - ndr->depth++; - if (r->info102) { - ndr_print_srvsvc_NetSrvInfo102(ndr, "info102", r->info102); - } - ndr->depth--; - break; - - case 402: - ndr_print_ptr(ndr, "info402", r->info402); - ndr->depth++; - if (r->info402) { - ndr_print_srvsvc_NetSrvInfo402(ndr, "info402", r->info402); - } - ndr->depth--; - break; - - case 403: - ndr_print_ptr(ndr, "info403", r->info403); - ndr->depth++; - if (r->info403) { - ndr_print_srvsvc_NetSrvInfo403(ndr, "info403", r->info403); - } - ndr->depth--; - break; - - case 502: - ndr_print_ptr(ndr, "info502", r->info502); - ndr->depth++; - if (r->info502) { - ndr_print_srvsvc_NetSrvInfo502(ndr, "info502", r->info502); - } - ndr->depth--; - break; - - case 503: - ndr_print_ptr(ndr, "info503", r->info503); - ndr->depth++; - if (r->info503) { - ndr_print_srvsvc_NetSrvInfo503(ndr, "info503", r->info503); - } - ndr->depth--; - break; - - case 599: - ndr_print_ptr(ndr, "info599", r->info599); - ndr->depth++; - if (r->info599) { - ndr_print_srvsvc_NetSrvInfo599(ndr, "info599", r->info599); - } - ndr->depth--; - break; - - case 1005: - ndr_print_ptr(ndr, "info1005", r->info1005); - ndr->depth++; - if (r->info1005) { - ndr_print_srvsvc_NetSrvInfo1005(ndr, "info1005", r->info1005); - } - ndr->depth--; - break; - - case 1010: - ndr_print_ptr(ndr, "info1010", r->info1010); - ndr->depth++; - if (r->info1010) { - ndr_print_srvsvc_NetSrvInfo1010(ndr, "info1010", r->info1010); - } - ndr->depth--; - break; - - case 1016: - ndr_print_ptr(ndr, "info1016", r->info1016); - ndr->depth++; - if (r->info1016) { - ndr_print_srvsvc_NetSrvInfo1016(ndr, "info1016", r->info1016); - } - ndr->depth--; - break; - - case 1017: - ndr_print_ptr(ndr, "info1017", r->info1017); - ndr->depth++; - if (r->info1017) { - ndr_print_srvsvc_NetSrvInfo1017(ndr, "info1017", r->info1017); - } - ndr->depth--; - break; - - case 1018: - ndr_print_ptr(ndr, "info1018", r->info1018); - ndr->depth++; - if (r->info1018) { - ndr_print_srvsvc_NetSrvInfo1018(ndr, "info1018", r->info1018); - } - ndr->depth--; - break; - - case 1107: - ndr_print_ptr(ndr, "info1107", r->info1107); - ndr->depth++; - if (r->info1107) { - ndr_print_srvsvc_NetSrvInfo1107(ndr, "info1107", r->info1107); - } - ndr->depth--; - break; - - case 1501: - ndr_print_ptr(ndr, "info1501", r->info1501); - ndr->depth++; - if (r->info1501) { - ndr_print_srvsvc_NetSrvInfo1501(ndr, "info1501", r->info1501); - } - ndr->depth--; - break; - - case 1502: - ndr_print_ptr(ndr, "info1502", r->info1502); - ndr->depth++; - if (r->info1502) { - ndr_print_srvsvc_NetSrvInfo1502(ndr, "info1502", r->info1502); - } - ndr->depth--; - break; - - case 1503: - ndr_print_ptr(ndr, "info1503", r->info1503); - ndr->depth++; - if (r->info1503) { - ndr_print_srvsvc_NetSrvInfo1503(ndr, "info1503", r->info1503); - } - ndr->depth--; - break; - - case 1506: - ndr_print_ptr(ndr, "info1506", r->info1506); - ndr->depth++; - if (r->info1506) { - ndr_print_srvsvc_NetSrvInfo1506(ndr, "info1506", r->info1506); - } - ndr->depth--; - break; - - case 1509: - ndr_print_ptr(ndr, "info1509", r->info1509); - ndr->depth++; - if (r->info1509) { - ndr_print_srvsvc_NetSrvInfo1509(ndr, "info1509", r->info1509); - } - ndr->depth--; - break; - - case 1510: - ndr_print_ptr(ndr, "info1510", r->info1510); - ndr->depth++; - if (r->info1510) { - ndr_print_srvsvc_NetSrvInfo1510(ndr, "info1510", r->info1510); - } - ndr->depth--; - break; - - case 1511: - ndr_print_ptr(ndr, "info1511", r->info1511); - ndr->depth++; - if (r->info1511) { - ndr_print_srvsvc_NetSrvInfo1511(ndr, "info1511", r->info1511); - } - ndr->depth--; - break; - - case 1512: - ndr_print_ptr(ndr, "info1512", r->info1512); - ndr->depth++; - if (r->info1512) { - ndr_print_srvsvc_NetSrvInfo1512(ndr, "info1512", r->info1512); - } - ndr->depth--; - break; - - case 1513: - ndr_print_ptr(ndr, "info1513", r->info1513); - ndr->depth++; - if (r->info1513) { - ndr_print_srvsvc_NetSrvInfo1513(ndr, "info1513", r->info1513); - } - ndr->depth--; - break; - - case 1514: - ndr_print_ptr(ndr, "info1514", r->info1514); - ndr->depth++; - if (r->info1514) { - ndr_print_srvsvc_NetSrvInfo1514(ndr, "info1514", r->info1514); - } - ndr->depth--; - break; - - case 1515: - ndr_print_ptr(ndr, "info1515", r->info1515); - ndr->depth++; - if (r->info1515) { - ndr_print_srvsvc_NetSrvInfo1515(ndr, "info1515", r->info1515); - } - ndr->depth--; - break; - - case 1516: - ndr_print_ptr(ndr, "info1516", r->info1516); - ndr->depth++; - if (r->info1516) { - ndr_print_srvsvc_NetSrvInfo1516(ndr, "info1516", r->info1516); - } - ndr->depth--; - break; - - case 1518: - ndr_print_ptr(ndr, "info1518", r->info1518); - ndr->depth++; - if (r->info1518) { - ndr_print_srvsvc_NetSrvInfo1518(ndr, "info1518", r->info1518); - } - ndr->depth--; - break; - - case 1520: - ndr_print_ptr(ndr, "info1520", r->info1520); - ndr->depth++; - if (r->info1520) { - ndr_print_srvsvc_NetSrvInfo1520(ndr, "info1520", r->info1520); - } - ndr->depth--; - break; - - case 1521: - ndr_print_ptr(ndr, "info1521", r->info1521); - ndr->depth++; - if (r->info1521) { - ndr_print_srvsvc_NetSrvInfo1521(ndr, "info1521", r->info1521); - } - ndr->depth--; - break; - - case 1522: - ndr_print_ptr(ndr, "info1522", r->info1522); - ndr->depth++; - if (r->info1522) { - ndr_print_srvsvc_NetSrvInfo1522(ndr, "info1522", r->info1522); - } - ndr->depth--; - break; - - case 1523: - ndr_print_ptr(ndr, "info1523", r->info1523); - ndr->depth++; - if (r->info1523) { - ndr_print_srvsvc_NetSrvInfo1523(ndr, "info1523", r->info1523); - } - ndr->depth--; - break; - - case 1524: - ndr_print_ptr(ndr, "info1524", r->info1524); - ndr->depth++; - if (r->info1524) { - ndr_print_srvsvc_NetSrvInfo1524(ndr, "info1524", r->info1524); - } - ndr->depth--; - break; - - case 1525: - ndr_print_ptr(ndr, "info1525", r->info1525); - ndr->depth++; - if (r->info1525) { - ndr_print_srvsvc_NetSrvInfo1525(ndr, "info1525", r->info1525); - } - ndr->depth--; - break; - - case 1528: - ndr_print_ptr(ndr, "info1528", r->info1528); - ndr->depth++; - if (r->info1528) { - ndr_print_srvsvc_NetSrvInfo1528(ndr, "info1528", r->info1528); - } - ndr->depth--; - break; - - case 1529: - ndr_print_ptr(ndr, "info1529", r->info1529); - ndr->depth++; - if (r->info1529) { - ndr_print_srvsvc_NetSrvInfo1529(ndr, "info1529", r->info1529); - } - ndr->depth--; - break; - - case 1530: - ndr_print_ptr(ndr, "info1530", r->info1530); - ndr->depth++; - if (r->info1530) { - ndr_print_srvsvc_NetSrvInfo1530(ndr, "info1530", r->info1530); - } - ndr->depth--; - break; - - case 1533: - ndr_print_ptr(ndr, "info1533", r->info1533); - ndr->depth++; - if (r->info1533) { - ndr_print_srvsvc_NetSrvInfo1533(ndr, "info1533", r->info1533); - } - ndr->depth--; - break; - - case 1534: - ndr_print_ptr(ndr, "info1534", r->info1534); - ndr->depth++; - if (r->info1534) { - ndr_print_srvsvc_NetSrvInfo1534(ndr, "info1534", r->info1534); - } - ndr->depth--; - break; - - case 1535: - ndr_print_ptr(ndr, "info1535", r->info1535); - ndr->depth++; - if (r->info1535) { - ndr_print_srvsvc_NetSrvInfo1535(ndr, "info1535", r->info1535); - } - ndr->depth--; - break; - - case 1536: - ndr_print_ptr(ndr, "info1536", r->info1536); - ndr->depth++; - if (r->info1536) { - ndr_print_srvsvc_NetSrvInfo1536(ndr, "info1536", r->info1536); - } - ndr->depth--; - break; - - case 1537: - ndr_print_ptr(ndr, "info1537", r->info1537); - ndr->depth++; - if (r->info1537) { - ndr_print_srvsvc_NetSrvInfo1537(ndr, "info1537", r->info1537); - } - ndr->depth--; - break; - - case 1538: - ndr_print_ptr(ndr, "info1538", r->info1538); - ndr->depth++; - if (r->info1538) { - ndr_print_srvsvc_NetSrvInfo1538(ndr, "info1538", r->info1538); - } - ndr->depth--; - break; - - case 1539: - ndr_print_ptr(ndr, "info1539", r->info1539); - ndr->depth++; - if (r->info1539) { - ndr_print_srvsvc_NetSrvInfo1539(ndr, "info1539", r->info1539); - } - ndr->depth--; - break; - - case 1540: - ndr_print_ptr(ndr, "info1540", r->info1540); - ndr->depth++; - if (r->info1540) { - ndr_print_srvsvc_NetSrvInfo1540(ndr, "info1540", r->info1540); - } - ndr->depth--; - break; - - case 1541: - ndr_print_ptr(ndr, "info1541", r->info1541); - ndr->depth++; - if (r->info1541) { - ndr_print_srvsvc_NetSrvInfo1541(ndr, "info1541", r->info1541); - } - ndr->depth--; - break; - - case 1542: - ndr_print_ptr(ndr, "info1542", r->info1542); - ndr->depth++; - if (r->info1542) { - ndr_print_srvsvc_NetSrvInfo1542(ndr, "info1542", r->info1542); - } - ndr->depth--; - break; - - case 1543: - ndr_print_ptr(ndr, "info1543", r->info1543); - ndr->depth++; - if (r->info1543) { - ndr_print_srvsvc_NetSrvInfo1543(ndr, "info1543", r->info1543); - } - ndr->depth--; - break; - - case 1544: - ndr_print_ptr(ndr, "info1544", r->info1544); - ndr->depth++; - if (r->info1544) { - ndr_print_srvsvc_NetSrvInfo1544(ndr, "info1544", r->info1544); - } - ndr->depth--; - break; - - case 1545: - ndr_print_ptr(ndr, "info1545", r->info1545); - ndr->depth++; - if (r->info1545) { - ndr_print_srvsvc_NetSrvInfo1545(ndr, "info1545", r->info1545); - } - ndr->depth--; - break; - - case 1546: - ndr_print_ptr(ndr, "info1546", r->info1546); - ndr->depth++; - if (r->info1546) { - ndr_print_srvsvc_NetSrvInfo1546(ndr, "info1546", r->info1546); - } - ndr->depth--; - break; - - case 1547: - ndr_print_ptr(ndr, "info1547", r->info1547); - ndr->depth++; - if (r->info1547) { - ndr_print_srvsvc_NetSrvInfo1547(ndr, "info1547", r->info1547); - } - ndr->depth--; - break; - - case 1548: - ndr_print_ptr(ndr, "info1548", r->info1548); - ndr->depth++; - if (r->info1548) { - ndr_print_srvsvc_NetSrvInfo1548(ndr, "info1548", r->info1548); - } - ndr->depth--; - break; - - case 1549: - ndr_print_ptr(ndr, "info1549", r->info1549); - ndr->depth++; - if (r->info1549) { - ndr_print_srvsvc_NetSrvInfo1549(ndr, "info1549", r->info1549); - } - ndr->depth--; - break; - - case 1550: - ndr_print_ptr(ndr, "info1550", r->info1550); - ndr->depth++; - if (r->info1550) { - ndr_print_srvsvc_NetSrvInfo1550(ndr, "info1550", r->info1550); - } - ndr->depth--; - break; - - case 1552: - ndr_print_ptr(ndr, "info1552", r->info1552); - ndr->depth++; - if (r->info1552) { - ndr_print_srvsvc_NetSrvInfo1552(ndr, "info1552", r->info1552); - } - ndr->depth--; - break; - - case 1553: - ndr_print_ptr(ndr, "info1553", r->info1553); - ndr->depth++; - if (r->info1553) { - ndr_print_srvsvc_NetSrvInfo1553(ndr, "info1553", r->info1553); - } - ndr->depth--; - break; - - case 1554: - ndr_print_ptr(ndr, "info1554", r->info1554); - ndr->depth++; - if (r->info1554) { - ndr_print_srvsvc_NetSrvInfo1554(ndr, "info1554", r->info1554); - } - ndr->depth--; - break; - - case 1555: - ndr_print_ptr(ndr, "info1555", r->info1555); - ndr->depth++; - if (r->info1555) { - ndr_print_srvsvc_NetSrvInfo1555(ndr, "info1555", r->info1555); - } - ndr->depth--; - break; - - case 1556: - ndr_print_ptr(ndr, "info1556", r->info1556); - ndr->depth++; - if (r->info1556) { - ndr_print_srvsvc_NetSrvInfo1556(ndr, "info1556", r->info1556); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetDiskInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetDiskInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen(r->disk) + 1)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->disk, strlen(r->disk) + 1, sizeof(uint16_t), CH_UTF16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetDiskInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetDiskInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__disk_offset)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__disk_length)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->disk, r->__disk_length, sizeof(uint16_t), CH_UTF16)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetDiskInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetDiskInfo0 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetDiskInfo0"); - ndr->depth++; - ndr_print_uint32(ndr, "__disk_offset", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->__disk_offset); - ndr_print_uint32(ndr, "__disk_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->disk) + 1:r->__disk_length); - ndr_print_string(ndr, "disk", r->disk); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetDiskInfo(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetDiskInfo *r) -{ - uint32_t cntr_disks_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->disks)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->disks) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_disks_1 = 0; cntr_disks_1 < r->count; cntr_disks_1++) { - NDR_CHECK(ndr_push_srvsvc_NetDiskInfo0(ndr, NDR_SCALARS, &r->disks[cntr_disks_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetDiskInfo(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetDiskInfo *r) -{ - uint32_t _ptr_disks; - uint32_t cntr_disks_1; - TALLOC_CTX *_mem_save_disks_0; - TALLOC_CTX *_mem_save_disks_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_disks)); - if (_ptr_disks) { - NDR_PULL_ALLOC(ndr, r->disks); - } else { - r->disks = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->disks) { - _mem_save_disks_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->disks, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->disks)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->disks)); - if (ndr_get_array_length(ndr, &r->disks) > ndr_get_array_size(ndr, &r->disks)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->disks), ndr_get_array_length(ndr, &r->disks)); - } - NDR_PULL_ALLOC_N(ndr, r->disks, ndr_get_array_size(ndr, &r->disks)); - _mem_save_disks_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->disks, 0); - for (cntr_disks_1 = 0; cntr_disks_1 < r->count; cntr_disks_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetDiskInfo0(ndr, NDR_SCALARS, &r->disks[cntr_disks_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disks_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disks_0, 0); - } - if (r->disks) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->disks, r->count)); - } - if (r->disks) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->disks, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetDiskInfo(struct ndr_print *ndr, const char *name, const struct srvsvc_NetDiskInfo *r) -{ - uint32_t cntr_disks_1; - ndr_print_struct(ndr, name, "srvsvc_NetDiskInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "disks", r->disks); - ndr->depth++; - if (r->disks) { - ndr->print(ndr, "%s: ARRAY(%d)", "disks", (int)r->count); - ndr->depth++; - for (cntr_disks_1=0;cntr_disks_1count;cntr_disks_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_disks_1) != -1) { - ndr_print_srvsvc_NetDiskInfo0(ndr, "disks", &r->disks[cntr_disks_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_Statistics(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_Statistics *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->fopens)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->devopens)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->jobsqueued)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sopens)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->stimeouts)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serrorout)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pwerrors)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->permerrors)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->syserrors)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bytessent_low)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bytessent_high)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bytesrcvd_low)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bytesrcvd_high)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->avresponse)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reqbufneed)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bigbufneed)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_Statistics(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_Statistics *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->fopens)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->devopens)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->jobsqueued)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sopens)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->stimeouts)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serrorout)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pwerrors)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->permerrors)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->syserrors)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bytessent_low)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bytessent_high)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bytesrcvd_low)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bytesrcvd_high)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->avresponse)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reqbufneed)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bigbufneed)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_Statistics(struct ndr_print *ndr, const char *name, const struct srvsvc_Statistics *r) -{ - ndr_print_struct(ndr, name, "srvsvc_Statistics"); - ndr->depth++; - ndr_print_uint32(ndr, "start", r->start); - ndr_print_uint32(ndr, "fopens", r->fopens); - ndr_print_uint32(ndr, "devopens", r->devopens); - ndr_print_uint32(ndr, "jobsqueued", r->jobsqueued); - ndr_print_uint32(ndr, "sopens", r->sopens); - ndr_print_uint32(ndr, "stimeouts", r->stimeouts); - ndr_print_uint32(ndr, "serrorout", r->serrorout); - ndr_print_uint32(ndr, "pwerrors", r->pwerrors); - ndr_print_uint32(ndr, "permerrors", r->permerrors); - ndr_print_uint32(ndr, "syserrors", r->syserrors); - ndr_print_uint32(ndr, "bytessent_low", r->bytessent_low); - ndr_print_uint32(ndr, "bytessent_high", r->bytessent_high); - ndr_print_uint32(ndr, "bytesrcvd_low", r->bytesrcvd_low); - ndr_print_uint32(ndr, "bytesrcvd_high", r->bytesrcvd_high); - ndr_print_uint32(ndr, "avresponse", r->avresponse); - ndr_print_uint32(ndr, "reqbufneed", r->reqbufneed); - ndr_print_uint32(ndr, "bigbufneed", r->bigbufneed); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vcs)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->addr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->net_addr)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->addr) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->addr, r->addr_len)); - } - if (r->net_addr) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->net_addr, ndr_charset_length(r->net_addr, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfo0 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - uint32_t _ptr_addr; - TALLOC_CTX *_mem_save_addr_0; - uint32_t _ptr_net_addr; - TALLOC_CTX *_mem_save_net_addr_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vcs)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_addr)); - if (_ptr_addr) { - NDR_PULL_ALLOC(ndr, r->addr); - } else { - r->addr = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->addr_len)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_addr)); - if (_ptr_net_addr) { - NDR_PULL_ALLOC(ndr, r->net_addr); - } else { - r->net_addr = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->addr) { - _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->addr)); - NDR_PULL_ALLOC_N(ndr, r->addr, ndr_get_array_size(ndr, &r->addr)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->addr, ndr_get_array_size(ndr, &r->addr))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0); - } - if (r->net_addr) { - _mem_save_net_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->net_addr, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->net_addr)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->net_addr)); - if (ndr_get_array_length(ndr, &r->net_addr) > ndr_get_array_size(ndr, &r->net_addr)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->net_addr), ndr_get_array_length(ndr, &r->net_addr)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->net_addr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_addr_0, 0); - } - if (r->addr) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->addr, r->addr_len)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo0 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetTransportInfo0"); - ndr->depth++; - ndr_print_uint32(ndr, "vcs", r->vcs); - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_ptr(ndr, "addr", r->addr); - ndr->depth++; - if (r->addr) { - ndr_print_array_uint8(ndr, "addr", r->addr, r->addr_len); - } - ndr->depth--; - ndr_print_uint32(ndr, "addr_len", r->addr_len); - ndr_print_ptr(ndr, "net_addr", r->net_addr); - ndr->depth++; - if (r->net_addr) { - ndr_print_string(ndr, "net_addr", r->net_addr); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportCtr0 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportCtr0 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr0 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetTransportCtr0"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetTransportInfo0(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vcs)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->addr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->net_addr)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->addr) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->addr, r->addr_len)); - } - if (r->net_addr) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->net_addr, ndr_charset_length(r->net_addr, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfo1 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - uint32_t _ptr_addr; - TALLOC_CTX *_mem_save_addr_0; - uint32_t _ptr_net_addr; - TALLOC_CTX *_mem_save_net_addr_0; - uint32_t _ptr_domain; - TALLOC_CTX *_mem_save_domain_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vcs)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_addr)); - if (_ptr_addr) { - NDR_PULL_ALLOC(ndr, r->addr); - } else { - r->addr = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->addr_len)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_addr)); - if (_ptr_net_addr) { - NDR_PULL_ALLOC(ndr, r->net_addr); - } else { - r->net_addr = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->addr) { - _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->addr)); - NDR_PULL_ALLOC_N(ndr, r->addr, ndr_get_array_size(ndr, &r->addr)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->addr, ndr_get_array_size(ndr, &r->addr))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0); - } - if (r->net_addr) { - _mem_save_net_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->net_addr, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->net_addr)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->net_addr)); - if (ndr_get_array_length(ndr, &r->net_addr) > ndr_get_array_size(ndr, &r->net_addr)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->net_addr), ndr_get_array_length(ndr, &r->net_addr)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->net_addr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_addr_0, 0); - } - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - if (r->addr) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->addr, r->addr_len)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo1 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetTransportInfo1"); - ndr->depth++; - ndr_print_uint32(ndr, "vcs", r->vcs); - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_ptr(ndr, "addr", r->addr); - ndr->depth++; - if (r->addr) { - ndr_print_array_uint8(ndr, "addr", r->addr, r->addr_len); - } - ndr->depth--; - ndr_print_uint32(ndr, "addr_len", r->addr_len); - ndr_print_ptr(ndr, "net_addr", r->net_addr); - ndr->depth++; - if (r->net_addr) { - ndr_print_string(ndr, "net_addr", r->net_addr); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportCtr1 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportCtr1 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr1 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetTransportCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetTransportInfo1(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vcs)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->addr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->net_addr)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->addr) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->addr, r->addr_len)); - } - if (r->net_addr) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->net_addr, ndr_charset_length(r->net_addr, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfo2 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - uint32_t _ptr_addr; - TALLOC_CTX *_mem_save_addr_0; - uint32_t _ptr_net_addr; - TALLOC_CTX *_mem_save_net_addr_0; - uint32_t _ptr_domain; - TALLOC_CTX *_mem_save_domain_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vcs)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_addr)); - if (_ptr_addr) { - NDR_PULL_ALLOC(ndr, r->addr); - } else { - r->addr = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->addr_len)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_addr)); - if (_ptr_net_addr) { - NDR_PULL_ALLOC(ndr, r->net_addr); - } else { - r->net_addr = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->addr) { - _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->addr)); - NDR_PULL_ALLOC_N(ndr, r->addr, ndr_get_array_size(ndr, &r->addr)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->addr, ndr_get_array_size(ndr, &r->addr))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0); - } - if (r->net_addr) { - _mem_save_net_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->net_addr, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->net_addr)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->net_addr)); - if (ndr_get_array_length(ndr, &r->net_addr) > ndr_get_array_size(ndr, &r->net_addr)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->net_addr), ndr_get_array_length(ndr, &r->net_addr)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->net_addr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_addr_0, 0); - } - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - if (r->addr) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->addr, r->addr_len)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo2 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetTransportInfo2"); - ndr->depth++; - ndr_print_uint32(ndr, "vcs", r->vcs); - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_ptr(ndr, "addr", r->addr); - ndr->depth++; - if (r->addr) { - ndr_print_array_uint8(ndr, "addr", r->addr, r->addr_len); - } - ndr->depth--; - ndr_print_uint32(ndr, "addr_len", r->addr_len); - ndr_print_ptr(ndr, "net_addr", r->net_addr); - ndr->depth++; - if (r->net_addr) { - ndr_print_string(ndr, "net_addr", r->net_addr); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown", r->unknown); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportCtr2 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportCtr2 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr2 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetTransportCtr2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetTransportInfo2(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfo3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vcs)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->addr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->net_addr)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->unknown3, 256)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->addr) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->addr_len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->addr, r->addr_len)); - } - if (r->net_addr) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->net_addr, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->net_addr, ndr_charset_length(r->net_addr, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfo3 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - uint32_t _ptr_addr; - TALLOC_CTX *_mem_save_addr_0; - uint32_t _ptr_net_addr; - TALLOC_CTX *_mem_save_net_addr_0; - uint32_t _ptr_domain; - TALLOC_CTX *_mem_save_domain_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vcs)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_addr)); - if (_ptr_addr) { - NDR_PULL_ALLOC(ndr, r->addr); - } else { - r->addr = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->addr_len)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_addr)); - if (_ptr_net_addr) { - NDR_PULL_ALLOC(ndr, r->net_addr); - } else { - r->net_addr = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); - if (_ptr_domain) { - NDR_PULL_ALLOC(ndr, r->domain); - } else { - r->domain = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->unknown3, 256)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->addr) { - _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->addr)); - NDR_PULL_ALLOC_N(ndr, r->addr, ndr_get_array_size(ndr, &r->addr)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->addr, ndr_get_array_size(ndr, &r->addr))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0); - } - if (r->net_addr) { - _mem_save_net_addr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->net_addr, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->net_addr)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->net_addr)); - if (ndr_get_array_length(ndr, &r->net_addr) > ndr_get_array_size(ndr, &r->net_addr)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->net_addr), ndr_get_array_length(ndr, &r->net_addr)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->net_addr, ndr_get_array_length(ndr, &r->net_addr), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_addr_0, 0); - } - if (r->domain) { - _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); - if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); - } - if (r->addr) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->addr, r->addr_len)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo3 *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetTransportInfo3"); - ndr->depth++; - ndr_print_uint32(ndr, "vcs", r->vcs); - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_ptr(ndr, "addr", r->addr); - ndr->depth++; - if (r->addr) { - ndr_print_array_uint8(ndr, "addr", r->addr, r->addr_len); - } - ndr->depth--; - ndr_print_uint32(ndr, "addr_len", r->addr_len); - ndr_print_ptr(ndr, "net_addr", r->net_addr); - ndr->depth++; - if (r->net_addr) { - ndr_print_string(ndr, "net_addr", r->net_addr); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain", r->domain); - ndr->depth++; - if (r->domain) { - ndr_print_string(ndr, "domain", r->domain); - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown1", r->unknown1); - ndr_print_uint32(ndr, "unknown2", r->unknown2); - ndr_print_array_uint8(ndr, "unknown3", r->unknown3, 256); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportCtr3 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportCtr3 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr3 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "srvsvc_NetTransportCtr3"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_srvsvc_NetTransportInfo3(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetTransportCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr3)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->ctr0) { - NDR_CHECK(ndr_push_srvsvc_NetTransportCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - } - break; - - case 1: - if (r->ctr1) { - NDR_CHECK(ndr_push_srvsvc_NetTransportCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - } - break; - - case 2: - if (r->ctr2) { - NDR_CHECK(ndr_push_srvsvc_NetTransportCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - } - break; - - case 3: - if (r->ctr3) { - NDR_CHECK(ndr_push_srvsvc_NetTransportCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetTransportCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_ctr0_0; - TALLOC_CTX *_mem_save_ctr1_0; - TALLOC_CTX *_mem_save_ctr2_0; - TALLOC_CTX *_mem_save_ctr3_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_ctr0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); - if (_ptr_ctr0) { - NDR_PULL_ALLOC(ndr, r->ctr0); - } else { - r->ctr0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_ctr1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); - if (_ptr_ctr1) { - NDR_PULL_ALLOC(ndr, r->ctr1); - } else { - r->ctr1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_ctr2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); - if (_ptr_ctr2) { - NDR_PULL_ALLOC(ndr, r->ctr2); - } else { - r->ctr2 = NULL; - } - break; } - - case 3: { - uint32_t _ptr_ctr3; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr3)); - if (_ptr_ctr3) { - NDR_PULL_ALLOC(ndr, r->ctr3); - } else { - r->ctr3 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->ctr0) { - _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); - NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); - } - break; - - case 1: - if (r->ctr1) { - _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); - NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); - } - break; - - case 2: - if (r->ctr2) { - _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); - NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); - } - break; - - case 3: - if (r->ctr3) { - _mem_save_ctr3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr3, 0); - NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr3_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetTransportCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetTransportCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "ctr0", r->ctr0); - ndr->depth++; - if (r->ctr0) { - ndr_print_srvsvc_NetTransportCtr0(ndr, "ctr0", r->ctr0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "ctr1", r->ctr1); - ndr->depth++; - if (r->ctr1) { - ndr_print_srvsvc_NetTransportCtr1(ndr, "ctr1", r->ctr1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "ctr2", r->ctr2); - ndr->depth++; - if (r->ctr2) { - ndr_print_srvsvc_NetTransportCtr2(ndr, "ctr2", r->ctr2); - } - ndr->depth--; - break; - - case 3: - ndr_print_ptr(ndr, "ctr3", r->ctr3); - ndr->depth++; - if (r->ctr3) { - ndr_print_srvsvc_NetTransportCtr3(ndr, "ctr3", r->ctr3); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetTransportInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_srvsvc_NetTransportCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_srvsvc_NetTransportCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetTransportInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_srvsvc_NetTransportCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfoCtr *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetTransportInfoCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_srvsvc_NetTransportCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetRemoteTODInfo(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetRemoteTODInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->elapsed)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->msecs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->hours)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->mins)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->secs)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->hunds)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->timezone)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tinterval)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->day)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->month)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->year)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->weekday)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetRemoteTODInfo(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetRemoteTODInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->elapsed)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->msecs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->hours)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->mins)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->secs)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->hunds)); - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->timezone)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tinterval)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->day)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->month)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->year)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->weekday)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetRemoteTODInfo(struct ndr_print *ndr, const char *name, const struct srvsvc_NetRemoteTODInfo *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetRemoteTODInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "elapsed", r->elapsed); - ndr_print_uint32(ndr, "msecs", r->msecs); - ndr_print_uint32(ndr, "hours", r->hours); - ndr_print_uint32(ndr, "mins", r->mins); - ndr_print_uint32(ndr, "secs", r->secs); - ndr_print_uint32(ndr, "hunds", r->hunds); - ndr_print_int32(ndr, "timezone", r->timezone); - ndr_print_uint32(ndr, "tinterval", r->tinterval); - ndr_print_uint32(ndr, "day", r->day); - ndr_print_uint32(ndr, "month", r->month); - ndr_print_uint32(ndr, "year", r->year); - ndr_print_uint32(ndr, "weekday", r->weekday); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetTransportInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS, &r->info0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo2(ndr, NDR_SCALARS, &r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo3(ndr, NDR_SCALARS, &r->info3)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_BUFFERS, &r->info0)); - break; - - case 1: - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo1(ndr, NDR_BUFFERS, &r->info1)); - break; - - case 2: - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo2(ndr, NDR_BUFFERS, &r->info2)); - break; - - case 3: - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo3(ndr, NDR_BUFFERS, &r->info3)); - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetTransportInfo *r) -{ - int level; - uint32_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS, &r->info0)); - break; } - - case 1: { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo2(ndr, NDR_SCALARS, &r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo3(ndr, NDR_SCALARS, &r->info3)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_BUFFERS, &r->info0)); - break; - - case 1: - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo1(ndr, NDR_BUFFERS, &r->info1)); - break; - - case 2: - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo2(ndr, NDR_BUFFERS, &r->info2)); - break; - - case 3: - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo3(ndr, NDR_BUFFERS, &r->info3)); - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetTransportInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "srvsvc_NetTransportInfo"); - switch (level) { - case 0: - ndr_print_srvsvc_NetTransportInfo0(ndr, "info0", &r->info0); - break; - - case 1: - ndr_print_srvsvc_NetTransportInfo1(ndr, "info1", &r->info1); - break; - - case 2: - ndr_print_srvsvc_NetTransportInfo2(ndr, "info2", &r->info2); - break; - - case 3: - ndr_print_srvsvc_NetTransportInfo3(ndr, "info3", &r->info3); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetCharDevInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetCharDevInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevEnum *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_ctr_0; - TALLOC_CTX *_mem_save_totalentries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - *r->out.info_ctr = *r->in.info_ctr; - NDR_PULL_ALLOC(ndr, r->out.totalentries); - ZERO_STRUCTP(r->out.totalentries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.totalentries); - } - _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevEnum *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetCharDevEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetCharDevInfoCtr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth--; - ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetCharDevEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetCharDevInfoCtr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth--; - ndr_print_ptr(ndr, "totalentries", r->out.totalentries); - ndr->depth++; - ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevGetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.device_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.device_name, CH_UTF16))); - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevGetInfo *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.device_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.device_name)); - if (ndr_get_array_length(ndr, &r->in.device_name) > ndr_get_array_size(ndr, &r->in.device_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.device_name), ndr_get_array_length(ndr, &r->in.device_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.device_name, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevGetInfo *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevGetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetCharDevGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "device_name", r->in.device_name); - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetCharDevGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_srvsvc_NetCharDevInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevControl(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevControl *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.device_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.device_name, CH_UTF16))); - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.opcode)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevControl(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevControl *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.device_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.device_name)); - if (ndr_get_array_length(ndr, &r->in.device_name) > ndr_get_array_size(ndr, &r->in.device_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.device_name), ndr_get_array_length(ndr, &r->in.device_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.device_name, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.opcode)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevControl(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevControl *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevControl"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetCharDevControl"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "device_name", r->in.device_name); - ndr_print_uint32(ndr, "opcode", r->in.opcode); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetCharDevControl"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.user)); - if (r->in.user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQEnum *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_user; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_user_0; - TALLOC_CTX *_mem_save_info_ctr_0; - TALLOC_CTX *_mem_save_totalentries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->in.user); - } else { - r->in.user = NULL; - } - if (r->in.user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); - if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - *r->out.info_ctr = *r->in.info_ctr; - NDR_PULL_ALLOC(ndr, r->out.totalentries); - ZERO_STRUCTP(r->out.totalentries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.totalentries); - } - _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQEnum *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "user", r->in.user); - ndr->depth++; - if (r->in.user) { - ndr_print_string(ndr, "user", r->in.user); - } - ndr->depth--; - ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetCharDevQInfoCtr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth--; - ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetCharDevQInfoCtr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth--; - ndr_print_ptr(ndr, "totalentries", r->out.totalentries); - ndr->depth++; - ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQGetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.queue_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.queue_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.queue_name, ndr_charset_length(r->in.queue_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQGetInfo *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.queue_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.queue_name)); - if (ndr_get_array_length(ndr, &r->in.queue_name) > ndr_get_array_size(ndr, &r->in.queue_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.queue_name), ndr_get_array_length(ndr, &r->in.queue_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.queue_name, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); - if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQGetInfo *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQGetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "queue_name", r->in.queue_name); - ndr_print_string(ndr, "user", r->in.user); - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_srvsvc_NetCharDevQInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQSetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQSetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.queue_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.queue_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.queue_name, ndr_charset_length(r->in.queue_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.info, r->in.level)); - NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_error)); - if (r->in.parm_error) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_error)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_error)); - if (r->out.parm_error) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_error)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQSetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQSetInfo *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_parm_error; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_parm_error_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.queue_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.queue_name)); - if (ndr_get_array_length(ndr, &r->in.queue_name) > ndr_get_array_size(ndr, &r->in.queue_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.queue_name), ndr_get_array_length(ndr, &r->in.queue_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.queue_name, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); - if (_ptr_parm_error) { - NDR_PULL_ALLOC(ndr, r->in.parm_error); - } else { - r->in.parm_error = NULL; - } - if (r->in.parm_error) { - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); - if (_ptr_parm_error) { - NDR_PULL_ALLOC(ndr, r->out.parm_error); - } else { - r->out.parm_error = NULL; - } - if (r->out.parm_error) { - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQSetInfo *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQSetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "queue_name", r->in.queue_name); - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_set_switch_value(ndr, &r->in.info, r->in.level); - ndr_print_srvsvc_NetCharDevQInfo(ndr, "info", &r->in.info); - ndr_print_ptr(ndr, "parm_error", r->in.parm_error); - ndr->depth++; - if (r->in.parm_error) { - ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "parm_error", r->out.parm_error); - ndr->depth++; - if (r->out.parm_error) { - ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQPurge(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQPurge *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.queue_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.queue_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.queue_name, ndr_charset_length(r->in.queue_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQPurge(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQPurge *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.queue_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.queue_name)); - if (ndr_get_array_length(ndr, &r->in.queue_name) > ndr_get_array_size(ndr, &r->in.queue_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.queue_name), ndr_get_array_length(ndr, &r->in.queue_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.queue_name, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQPurge(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQPurge *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQPurge"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQPurge"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "queue_name", r->in.queue_name); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQPurge"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetCharDevQPurgeSelf(struct ndr_push *ndr, int flags, const struct srvsvc_NetCharDevQPurgeSelf *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.queue_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.queue_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.queue_name, ndr_charset_length(r->in.queue_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.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 (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQPurgeSelf(struct ndr_pull *ndr, int flags, struct srvsvc_NetCharDevQPurgeSelf *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.queue_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.queue_name)); - if (ndr_get_array_length(ndr, &r->in.queue_name) > ndr_get_array_size(ndr, &r->in.queue_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.queue_name), ndr_get_array_length(ndr, &r->in.queue_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.queue_name, ndr_get_array_length(ndr, &r->in.queue_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); - if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetCharDevQPurgeSelf(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQPurgeSelf *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetCharDevQPurgeSelf"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetCharDevQPurgeSelf"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "queue_name", r->in.queue_name); - ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetCharDevQPurgeSelf"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetConnEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetConnEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.path)); - if (r->in.path) { - 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.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetConnInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetConnInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetConnEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetConnEnum *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_path; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_path_0; - TALLOC_CTX *_mem_save_info_ctr_0; - TALLOC_CTX *_mem_save_totalentries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->in.path); - } else { - r->in.path = NULL; - } - if (r->in.path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); - if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetConnInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - *r->out.info_ctr = *r->in.info_ctr; - NDR_PULL_ALLOC(ndr, r->out.totalentries); - ZERO_STRUCTP(r->out.totalentries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetConnInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.totalentries); - } - _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetConnEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetConnEnum *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetConnEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetConnEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "path", r->in.path); - ndr->depth++; - if (r->in.path) { - ndr_print_string(ndr, "path", r->in.path); - } - ndr->depth--; - ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetConnInfoCtr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth--; - ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetConnEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetConnInfoCtr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth--; - ndr_print_ptr(ndr, "totalentries", r->out.totalentries); - ndr->depth++; - ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetFileEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.path)); - if (r->in.path) { - 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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.user)); - if (r->in.user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetFileInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetFileInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetFileEnum *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_path; - uint32_t _ptr_user; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_path_0; - TALLOC_CTX *_mem_save_user_0; - TALLOC_CTX *_mem_save_info_ctr_0; - TALLOC_CTX *_mem_save_totalentries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path)); - if (_ptr_path) { - NDR_PULL_ALLOC(ndr, r->in.path); - } else { - r->in.path = NULL; - } - if (r->in.path) { - _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); - if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->in.user); - } else { - r->in.user = NULL; - } - if (r->in.user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); - if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetFileInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - *r->out.info_ctr = *r->in.info_ctr; - NDR_PULL_ALLOC(ndr, r->out.totalentries); - ZERO_STRUCTP(r->out.totalentries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetFileInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.totalentries); - } - _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileEnum *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetFileEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetFileEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "path", r->in.path); - ndr->depth++; - if (r->in.path) { - ndr_print_string(ndr, "path", r->in.path); - } - ndr->depth--; - ndr_print_ptr(ndr, "user", r->in.user); - ndr->depth++; - if (r->in.user) { - ndr_print_string(ndr, "user", r->in.user); - } - ndr->depth--; - ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetFileInfoCtr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth--; - ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetFileEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetFileInfoCtr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth--; - ndr_print_ptr(ndr, "totalentries", r->out.totalentries); - ndr->depth++; - ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetFileGetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.fid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetFileGetInfo *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.fid)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetFileInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileGetInfo *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetFileGetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetFileGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_uint32(ndr, "fid", r->in.fid); - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetFileGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_srvsvc_NetFileInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetFileClose(struct ndr_push *ndr, int flags, const struct srvsvc_NetFileClose *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.fid)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetFileClose(struct ndr_pull *ndr, int flags, struct srvsvc_NetFileClose *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.fid)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetFileClose(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileClose *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetFileClose"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetFileClose"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_uint32(ndr, "fid", r->in.fid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetFileClose"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetSessEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client)); - if (r->in.client) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client, ndr_charset_length(r->in.client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.user)); - if (r->in.user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetSessInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetSessInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetSessEnum *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_client; - uint32_t _ptr_user; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_client_0; - TALLOC_CTX *_mem_save_user_0; - TALLOC_CTX *_mem_save_info_ctr_0; - TALLOC_CTX *_mem_save_totalentries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); - if (_ptr_client) { - NDR_PULL_ALLOC(ndr, r->in.client); - } else { - r->in.client = NULL; - } - if (r->in.client) { - _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.client, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client)); - if (ndr_get_array_length(ndr, &r->in.client) > ndr_get_array_size(ndr, &r->in.client)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.client), ndr_get_array_length(ndr, &r->in.client)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.client), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client, ndr_get_array_length(ndr, &r->in.client), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->in.user); - } else { - r->in.user = NULL; - } - if (r->in.user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); - if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetSessInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - *r->out.info_ctr = *r->in.info_ctr; - NDR_PULL_ALLOC(ndr, r->out.totalentries); - ZERO_STRUCTP(r->out.totalentries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetSessInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.totalentries); - } - _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSessEnum *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSessEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetSessEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "client", r->in.client); - ndr->depth++; - if (r->in.client) { - ndr_print_string(ndr, "client", r->in.client); - } - ndr->depth--; - ndr_print_ptr(ndr, "user", r->in.user); - ndr->depth++; - if (r->in.user) { - ndr_print_string(ndr, "user", r->in.user); - } - ndr->depth--; - ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetSessInfoCtr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth--; - ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetSessEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetSessInfoCtr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth--; - ndr_print_ptr(ndr, "totalentries", r->out.totalentries); - ndr->depth++; - ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSessDel(struct ndr_push *ndr, int flags, const struct srvsvc_NetSessDel *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client)); - if (r->in.client) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client, ndr_charset_length(r->in.client, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.user)); - if (r->in.user) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.user, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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 (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSessDel(struct ndr_pull *ndr, int flags, struct srvsvc_NetSessDel *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_client; - uint32_t _ptr_user; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_client_0; - TALLOC_CTX *_mem_save_user_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client)); - if (_ptr_client) { - NDR_PULL_ALLOC(ndr, r->in.client); - } else { - r->in.client = NULL; - } - if (r->in.client) { - _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.client, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client)); - if (ndr_get_array_length(ndr, &r->in.client) > ndr_get_array_size(ndr, &r->in.client)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.client), ndr_get_array_length(ndr, &r->in.client)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.client), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client, ndr_get_array_length(ndr, &r->in.client), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); - if (_ptr_user) { - NDR_PULL_ALLOC(ndr, r->in.user); - } else { - r->in.user = NULL; - } - if (r->in.user) { - _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.user, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.user)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.user)); - if (ndr_get_array_length(ndr, &r->in.user) > ndr_get_array_size(ndr, &r->in.user)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.user), ndr_get_array_length(ndr, &r->in.user)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.user, ndr_get_array_length(ndr, &r->in.user), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSessDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSessDel *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSessDel"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetSessDel"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "client", r->in.client); - ndr->depth++; - if (r->in.client) { - ndr_print_string(ndr, "client", r->in.client); - } - ndr->depth--; - ndr_print_ptr(ndr, "user", r->in.user); - ndr->depth++; - if (r->in.user) { - ndr_print_string(ndr, "user", r->in.user); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetSessDel"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareAdd(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareAdd *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - 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_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_error)); - if (r->in.parm_error) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_error)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_error)); - if (r->out.parm_error) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_error)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareAdd(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareAdd *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_parm_error; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_parm_error_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); - if (_ptr_parm_error) { - NDR_PULL_ALLOC(ndr, r->in.parm_error); - } else { - r->in.parm_error = NULL; - } - if (r->in.parm_error) { - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); - if (_ptr_parm_error) { - NDR_PULL_ALLOC(ndr, r->out.parm_error); - } else { - r->out.parm_error = NULL; - } - if (r->out.parm_error) { - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareAdd(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareAdd *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareAdd"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareAdd"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_srvsvc_NetShareInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_ptr(ndr, "parm_error", r->in.parm_error); - ndr->depth++; - if (r->in.parm_error) { - ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareAdd"); - ndr->depth++; - ndr_print_ptr(ndr, "parm_error", r->out.parm_error); - ndr->depth++; - if (r->out.parm_error) { - ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareEnumAll(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareEnumAll *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareEnumAll(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareEnumAll *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_ctr_0; - TALLOC_CTX *_mem_save_totalentries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - *r->out.info_ctr = *r->in.info_ctr; - NDR_PULL_ALLOC(ndr, r->out.totalentries); - ZERO_STRUCTP(r->out.totalentries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.totalentries); - } - _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareEnumAll(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareEnumAll *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareEnumAll"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareEnumAll"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetShareInfoCtr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth--; - ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareEnumAll"); - ndr->depth++; - ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetShareInfoCtr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth--; - ndr_print_ptr(ndr, "totalentries", r->out.totalentries); - ndr->depth++; - ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareGetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_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.share_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareGetInfo *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name)); - if (ndr_get_array_length(ndr, &r->in.share_name) > ndr_get_array_size(ndr, &r->in.share_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share_name), ndr_get_array_length(ndr, &r->in.share_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareGetInfo *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareGetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "share_name", r->in.share_name); - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_srvsvc_NetShareInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareSetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareSetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_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.share_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_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 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_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_error)); - if (r->in.parm_error) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_error)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_error)); - if (r->out.parm_error) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_error)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareSetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareSetInfo *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_parm_error; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_parm_error_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name)); - if (ndr_get_array_length(ndr, &r->in.share_name) > ndr_get_array_size(ndr, &r->in.share_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share_name), ndr_get_array_length(ndr, &r->in.share_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); - if (_ptr_parm_error) { - NDR_PULL_ALLOC(ndr, r->in.parm_error); - } else { - r->in.parm_error = NULL; - } - if (r->in.parm_error) { - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); - if (_ptr_parm_error) { - NDR_PULL_ALLOC(ndr, r->out.parm_error); - } else { - r->out.parm_error = NULL; - } - if (r->out.parm_error) { - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareSetInfo *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareSetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "share_name", r->in.share_name); - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_srvsvc_NetShareInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_ptr(ndr, "parm_error", r->in.parm_error); - ndr->depth++; - if (r->in.parm_error) { - ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "parm_error", r->out.parm_error); - ndr->depth++; - if (r->out.parm_error) { - ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareDel(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareDel *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_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.share_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareDel(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareDel *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name)); - if (ndr_get_array_length(ndr, &r->in.share_name) > ndr_get_array_size(ndr, &r->in.share_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share_name), ndr_get_array_length(ndr, &r->in.share_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDel *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareDel"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareDel"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "share_name", r->in.share_name); - ndr_print_uint32(ndr, "reserved", r->in.reserved); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareDel"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareDelSticky(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareDelSticky *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_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.share_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareDelSticky(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareDelSticky *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name)); - if (ndr_get_array_length(ndr, &r->in.share_name) > ndr_get_array_size(ndr, &r->in.share_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share_name), ndr_get_array_length(ndr, &r->in.share_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, ndr_get_array_length(ndr, &r->in.share_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareDelSticky(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelSticky *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareDelSticky"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareDelSticky"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "share_name", r->in.share_name); - ndr_print_uint32(ndr, "reserved", r->in.reserved); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareDelSticky"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareCheck(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareCheck *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.device_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.device_name, CH_UTF16))); - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareCheck(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareCheck *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_type_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.device_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.device_name)); - if (ndr_get_array_length(ndr, &r->in.device_name) > ndr_get_array_size(ndr, &r->in.device_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.device_name), ndr_get_array_length(ndr, &r->in.device_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.device_name, ndr_get_array_length(ndr, &r->in.device_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_ALLOC(ndr, r->out.type); - ZERO_STRUCTP(r->out.type); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.type); - } - _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_ShareType(ndr, NDR_SCALARS, r->out.type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareCheck(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareCheck *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareCheck"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareCheck"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "device_name", r->in.device_name); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareCheck"); - ndr->depth++; - ndr_print_ptr(ndr, "type", r->out.type); - ndr->depth++; - ndr_print_srvsvc_ShareType(ndr, "type", *r->out.type); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvGetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetSrvGetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvGetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetSrvGetInfo *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSrvGetInfo *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvGetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetSrvGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetSrvGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_srvsvc_NetSrvInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSrvSetInfo(struct ndr_push *ndr, int flags, const struct srvsvc_NetSrvSetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - 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_srvsvc_NetSrvInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_error)); - if (r->in.parm_error) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_error)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_error)); - if (r->out.parm_error) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_error)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSrvSetInfo(struct ndr_pull *ndr, int flags, struct srvsvc_NetSrvSetInfo *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_parm_error; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_parm_error_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetSrvInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); - if (_ptr_parm_error) { - NDR_PULL_ALLOC(ndr, r->in.parm_error); - } else { - r->in.parm_error = NULL; - } - if (r->in.parm_error) { - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_error)); - if (_ptr_parm_error) { - NDR_PULL_ALLOC(ndr, r->out.parm_error); - } else { - r->out.parm_error = NULL; - } - if (r->out.parm_error) { - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSrvSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSrvSetInfo *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSrvSetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetSrvSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_srvsvc_NetSrvInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_ptr(ndr, "parm_error", r->in.parm_error); - ndr->depth++; - if (r->in.parm_error) { - ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetSrvSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "parm_error", r->out.parm_error); - ndr->depth++; - if (r->out.parm_error) { - ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetDiskEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetDiskEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - 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)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - 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 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetDiskEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetDiskEnum *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_totalentries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetDiskInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.maxlen)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info); - *r->out.info = *r->in.info; - NDR_PULL_ALLOC(ndr, r->out.totalentries); - ZERO_STRUCTP(r->out.totalentries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetDiskInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.totalentries); - } - _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetDiskEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetDiskEnum *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetDiskEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetDiskEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_srvsvc_NetDiskInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_uint32(ndr, "maxlen", r->in.maxlen); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetDiskEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_srvsvc_NetDiskInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_ptr(ndr, "totalentries", r->out.totalentries); - ndr->depth++; - ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetServerStatisticsGet(struct ndr_push *ndr, int flags, const struct srvsvc_NetServerStatisticsGet *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service)); - if (r->in.service) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service, ndr_charset_length(r->in.service, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.options)); - } - if (flags & NDR_OUT) { - if (r->out.stats == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.stats)); - if (*r->out.stats) { - NDR_CHECK(ndr_push_srvsvc_Statistics(ndr, NDR_SCALARS, *r->out.stats)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetServerStatisticsGet(struct ndr_pull *ndr, int flags, struct srvsvc_NetServerStatisticsGet *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_service; - uint32_t _ptr_stats; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_service_0; - TALLOC_CTX *_mem_save_stats_0; - TALLOC_CTX *_mem_save_stats_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service)); - if (_ptr_service) { - NDR_PULL_ALLOC(ndr, r->in.service); - } else { - r->in.service = NULL; - } - if (r->in.service) { - _mem_save_service_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service)); - if (ndr_get_array_length(ndr, &r->in.service) > ndr_get_array_size(ndr, &r->in.service)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service), ndr_get_array_length(ndr, &r->in.service)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service, ndr_get_array_length(ndr, &r->in.service), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.options)); - NDR_PULL_ALLOC(ndr, r->out.stats); - ZERO_STRUCTP(r->out.stats); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.stats); - } - _mem_save_stats_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.stats, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_stats)); - if (_ptr_stats) { - NDR_PULL_ALLOC(ndr, *r->out.stats); - } else { - *r->out.stats = NULL; - } - if (*r->out.stats) { - _mem_save_stats_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.stats, 0); - NDR_CHECK(ndr_pull_srvsvc_Statistics(ndr, NDR_SCALARS, *r->out.stats)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stats_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stats_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetServerStatisticsGet(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerStatisticsGet *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetServerStatisticsGet"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetServerStatisticsGet"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "service", r->in.service); - ndr->depth++; - if (r->in.service) { - ndr_print_string(ndr, "service", r->in.service); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_uint32(ndr, "options", r->in.options); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetServerStatisticsGet"); - ndr->depth++; - ndr_print_ptr(ndr, "stats", r->out.stats); - ndr->depth++; - ndr_print_ptr(ndr, "stats", *r->out.stats); - ndr->depth++; - if (*r->out.stats) { - ndr_print_srvsvc_Statistics(ndr, "stats", *r->out.stats); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportAdd(struct ndr_push *ndr, int flags, const struct srvsvc_NetTransportAdd *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.info, r->in.level)); - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportAdd(struct ndr_pull *ndr, int flags, struct srvsvc_NetTransportAdd *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportAdd(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportAdd *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetTransportAdd"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetTransportAdd"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_set_switch_value(ndr, &r->in.info, r->in.level); - ndr_print_srvsvc_NetTransportInfo(ndr, "info", &r->in.info); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetTransportAdd"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetTransportEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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.transports == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetTransportInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.transports)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.transports == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetTransportInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.transports)); - 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetTransportEnum *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_transports_0; - TALLOC_CTX *_mem_save_totalentries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.transports); - } - _mem_save_transports_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.transports, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.transports)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transports_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.transports); - *r->out.transports = *r->in.transports; - NDR_PULL_ALLOC(ndr, r->out.totalentries); - ZERO_STRUCTP(r->out.totalentries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.transports); - } - _mem_save_transports_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.transports, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.transports)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transports_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.totalentries); - } - _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportEnum *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetTransportEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetTransportEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "transports", r->in.transports); - ndr->depth++; - ndr_print_srvsvc_NetTransportInfoCtr(ndr, "transports", r->in.transports); - ndr->depth--; - ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetTransportEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "transports", r->out.transports); - ndr->depth++; - ndr_print_srvsvc_NetTransportInfoCtr(ndr, "transports", r->out.transports); - ndr->depth--; - ndr_print_ptr(ndr, "totalentries", r->out.totalentries); - ndr->depth++; - ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetTransportDel(struct ndr_push *ndr, int flags, const struct srvsvc_NetTransportDel *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.info0 == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info0)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetTransportDel(struct ndr_pull *ndr, int flags, struct srvsvc_NetTransportDel *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info0_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info0); - } - _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetTransportDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportDel *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetTransportDel"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetTransportDel"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info0", r->in.info0); - ndr->depth++; - ndr_print_srvsvc_NetTransportInfo0(ndr, "info0", r->in.info0); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetTransportDel"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetRemoteTOD(struct ndr_push *ndr, int flags, const struct srvsvc_NetRemoteTOD *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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 (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_srvsvc_NetRemoteTODInfo(ndr, NDR_SCALARS, *r->out.info)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetRemoteTOD(struct ndr_pull *ndr, int flags, struct srvsvc_NetRemoteTOD *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_srvsvc_NetRemoteTODInfo(ndr, NDR_SCALARS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetRemoteTOD(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetRemoteTOD *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetRemoteTOD"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetRemoteTOD"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetRemoteTOD"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_srvsvc_NetRemoteTODInfo(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSetServiceBits(struct ndr_push *ndr, int flags, const struct srvsvc_NetSetServiceBits *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.transport)); - if (r->in.transport) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.transport, ndr_charset_length(r->in.transport, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.servicebits)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.updateimmediately)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSetServiceBits(struct ndr_pull *ndr, int flags, struct srvsvc_NetSetServiceBits *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_transport; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_transport_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport)); - if (_ptr_transport) { - NDR_PULL_ALLOC(ndr, r->in.transport); - } else { - r->in.transport = NULL; - } - if (r->in.transport) { - _mem_save_transport_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.transport, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.transport)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.transport)); - if (ndr_get_array_length(ndr, &r->in.transport) > ndr_get_array_size(ndr, &r->in.transport)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.transport), ndr_get_array_length(ndr, &r->in.transport)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.transport), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.transport, ndr_get_array_length(ndr, &r->in.transport), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.servicebits)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.updateimmediately)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSetServiceBits(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSetServiceBits *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSetServiceBits"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetSetServiceBits"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "transport", r->in.transport); - ndr->depth++; - if (r->in.transport) { - ndr_print_string(ndr, "transport", r->in.transport); - } - ndr->depth--; - ndr_print_uint32(ndr, "servicebits", r->in.servicebits); - ndr_print_uint32(ndr, "updateimmediately", r->in.updateimmediately); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetSetServiceBits"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetPathType(struct ndr_push *ndr, int flags, const struct srvsvc_NetPathType *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.pathflags)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetPathType(struct ndr_pull *ndr, int flags, struct srvsvc_NetPathType *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_pathtype_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); - if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.pathflags)); - NDR_PULL_ALLOC(ndr, r->out.pathtype); - ZERO_STRUCTP(r->out.pathtype); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.pathtype); - } - _mem_save_pathtype_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.pathtype, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pathtype)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pathtype_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetPathType(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathType *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetPathType"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetPathType"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "path", r->in.path); - ndr_print_uint32(ndr, "pathflags", r->in.pathflags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetPathType"); - ndr->depth++; - ndr_print_ptr(ndr, "pathtype", r->out.pathtype); - ndr->depth++; - ndr_print_uint32(ndr, "pathtype", *r->out.pathtype); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetPathCanonicalize(struct ndr_push *ndr, int flags, const struct srvsvc_NetPathCanonicalize *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.maxbuf)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.prefix, CH_UTF16))); - 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetPathCanonicalize(struct ndr_pull *ndr, int flags, struct srvsvc_NetPathCanonicalize *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_pathtype_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path)); - if (ndr_get_array_length(ndr, &r->in.path) > ndr_get_array_size(ndr, &r->in.path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path), ndr_get_array_length(ndr, &r->in.path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path, ndr_get_array_length(ndr, &r->in.path), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.maxbuf)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.prefix)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.prefix)); - if (ndr_get_array_length(ndr, &r->in.prefix) > ndr_get_array_size(ndr, &r->in.prefix)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.prefix), ndr_get_array_length(ndr, &r->in.prefix)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.prefix), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.prefix, ndr_get_array_length(ndr, &r->in.prefix), sizeof(uint16_t), CH_UTF16)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.pathtype); - } - _mem_save_pathtype_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.pathtype, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.pathtype)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pathtype_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.pathflags)); - NDR_PULL_ALLOC(ndr, r->out.pathtype); - *r->out.pathtype = *r->in.pathtype; - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.can_path)); - NDR_PULL_ALLOC_N(ndr, r->out.can_path, ndr_get_array_size(ndr, &r->out.can_path)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.can_path, ndr_get_array_size(ndr, &r->out.can_path))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.pathtype); - } - _mem_save_pathtype_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.pathtype, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pathtype)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pathtype_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.can_path) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.can_path, r->in.maxbuf)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetPathCanonicalize(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathCanonicalize *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetPathCanonicalize"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetPathCanonicalize"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "path", r->in.path); - ndr_print_uint32(ndr, "maxbuf", r->in.maxbuf); - ndr_print_string(ndr, "prefix", r->in.prefix); - ndr_print_ptr(ndr, "pathtype", r->in.pathtype); - ndr->depth++; - ndr_print_uint32(ndr, "pathtype", *r->in.pathtype); - ndr->depth--; - ndr_print_uint32(ndr, "pathflags", r->in.pathflags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetPathCanonicalize"); - ndr->depth++; - ndr_print_array_uint8(ndr, "can_path", r->out.can_path, r->in.maxbuf); - ndr_print_ptr(ndr, "pathtype", r->out.pathtype); - ndr->depth++; - ndr_print_uint32(ndr, "pathtype", *r->out.pathtype); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetPathCompare(struct ndr_push *ndr, int flags, const struct srvsvc_NetPathCompare *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path1, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path1, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.path1, ndr_charset_length(r->in.path1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path2, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.path2, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.path2, ndr_charset_length(r->in.path2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - 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_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetPathCompare(struct ndr_pull *ndr, int flags, struct srvsvc_NetPathCompare *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path1)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path1)); - if (ndr_get_array_length(ndr, &r->in.path1) > ndr_get_array_size(ndr, &r->in.path1)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path1), ndr_get_array_length(ndr, &r->in.path1)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path1), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path1, ndr_get_array_length(ndr, &r->in.path1), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.path2)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.path2)); - if (ndr_get_array_length(ndr, &r->in.path2) > ndr_get_array_size(ndr, &r->in.path2)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.path2), ndr_get_array_length(ndr, &r->in.path2)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.path2), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.path2, ndr_get_array_length(ndr, &r->in.path2), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.pathtype)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.pathflags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetPathCompare(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathCompare *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetPathCompare"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetPathCompare"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "path1", r->in.path1); - ndr_print_string(ndr, "path2", r->in.path2); - ndr_print_uint32(ndr, "pathtype", r->in.pathtype); - ndr_print_uint32(ndr, "pathflags", r->in.pathflags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetPathCompare"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetNameValidate(struct ndr_push *ndr, int flags, const struct srvsvc_NetNameValidate *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.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.name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.name_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetNameValidate(struct ndr_pull *ndr, int flags, struct srvsvc_NetNameValidate *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name)); - if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name), ndr_get_array_length(ndr, &r->in.name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.name_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetNameValidate(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetNameValidate *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetNameValidate"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetNameValidate"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "name", r->in.name); - ndr_print_uint32(ndr, "name_type", r->in.name_type); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetNameValidate"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRPRNAMECANONICALIZE(struct ndr_push *ndr, int flags, const struct srvsvc_NETRPRNAMECANONICALIZE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRPRNAMECANONICALIZE(struct ndr_pull *ndr, int flags, struct srvsvc_NETRPRNAMECANONICALIZE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRPRNAMECANONICALIZE(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRPRNAMECANONICALIZE *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRPRNAMECANONICALIZE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRPRNAMECANONICALIZE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRPRNAMECANONICALIZE"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetPRNameCompare(struct ndr_push *ndr, int flags, const struct srvsvc_NetPRNameCompare *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name1, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name1, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name1, ndr_charset_length(r->in.name1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name2, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name2, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name2, ndr_charset_length(r->in.name2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.name_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetPRNameCompare(struct ndr_pull *ndr, int flags, struct srvsvc_NetPRNameCompare *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name1)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name1)); - if (ndr_get_array_length(ndr, &r->in.name1) > ndr_get_array_size(ndr, &r->in.name1)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name1), ndr_get_array_length(ndr, &r->in.name1)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name1), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name1, ndr_get_array_length(ndr, &r->in.name1), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name2)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name2)); - if (ndr_get_array_length(ndr, &r->in.name2) > ndr_get_array_size(ndr, &r->in.name2)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name2), ndr_get_array_length(ndr, &r->in.name2)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name2), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name2, ndr_get_array_length(ndr, &r->in.name2), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.name_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetPRNameCompare(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPRNameCompare *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetPRNameCompare"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetPRNameCompare"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "name1", r->in.name1); - ndr_print_string(ndr, "name2", r->in.name2); - ndr_print_uint32(ndr, "name_type", r->in.name_type); - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetPRNameCompare"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareEnum(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info_ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareEnum(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareEnum *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_info_ctr_0; - TALLOC_CTX *_mem_save_totalentries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - *r->out.info_ctr = *r->in.info_ctr; - NDR_PULL_ALLOC(ndr, r->out.totalentries); - ZERO_STRUCTP(r->out.totalentries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info_ctr); - } - _mem_save_info_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info_ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_srvsvc_NetShareInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info_ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_ctr_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.totalentries); - } - _mem_save_totalentries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.totalentries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.totalentries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_totalentries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareEnum *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetShareInfoCtr(ndr, "info_ctr", r->in.info_ctr); - ndr->depth--; - ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth++; - ndr_print_srvsvc_NetShareInfoCtr(ndr, "info_ctr", r->out.info_ctr); - ndr->depth--; - ndr_print_ptr(ndr, "totalentries", r->out.totalentries); - ndr->depth++; - ndr_print_uint32(ndr, "totalentries", *r->out.totalentries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareDelStart(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareDelStart *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share, ndr_charset_length(r->in.share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.hnd)); - if (r->out.hnd) { - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.hnd)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareDelStart(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareDelStart *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_hnd; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_hnd_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share)); - if (ndr_get_array_length(ndr, &r->in.share) > ndr_get_array_size(ndr, &r->in.share)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share), ndr_get_array_length(ndr, &r->in.share)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hnd)); - if (_ptr_hnd) { - NDR_PULL_ALLOC(ndr, r->out.hnd); - } else { - r->out.hnd = NULL; - } - if (r->out.hnd) { - _mem_save_hnd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.hnd, 0); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.hnd)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hnd_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareDelStart(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelStart *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareDelStart"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareDelStart"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_string(ndr, "share", r->in.share); - ndr_print_uint32(ndr, "reserved", r->in.reserved); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareDelStart"); - ndr->depth++; - ndr_print_ptr(ndr, "hnd", r->out.hnd); - ndr->depth++; - if (r->out.hnd) { - ndr_print_policy_handle(ndr, "hnd", r->out.hnd); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetShareDelCommit(struct ndr_push *ndr, int flags, const struct srvsvc_NetShareDelCommit *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hnd)); - if (r->in.hnd) { - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.hnd)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.hnd)); - if (r->out.hnd) { - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.hnd)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetShareDelCommit(struct ndr_pull *ndr, int flags, struct srvsvc_NetShareDelCommit *r) -{ - uint32_t _ptr_hnd; - TALLOC_CTX *_mem_save_hnd_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hnd)); - if (_ptr_hnd) { - NDR_PULL_ALLOC(ndr, r->in.hnd); - } else { - r->in.hnd = NULL; - } - if (r->in.hnd) { - _mem_save_hnd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.hnd, 0); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.hnd)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hnd_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hnd)); - if (_ptr_hnd) { - NDR_PULL_ALLOC(ndr, r->out.hnd); - } else { - r->out.hnd = NULL; - } - if (r->out.hnd) { - _mem_save_hnd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.hnd, 0); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.hnd)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hnd_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetShareDelCommit(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelCommit *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetShareDelCommit"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetShareDelCommit"); - ndr->depth++; - ndr_print_ptr(ndr, "hnd", r->in.hnd); - ndr->depth++; - if (r->in.hnd) { - ndr_print_policy_handle(ndr, "hnd", r->in.hnd); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetShareDelCommit"); - ndr->depth++; - ndr_print_ptr(ndr, "hnd", r->out.hnd); - ndr->depth++; - if (r->out.hnd) { - ndr_print_policy_handle(ndr, "hnd", r->out.hnd); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetGetFileSecurity(struct ndr_push *ndr, int flags, const struct srvsvc_NetGetFileSecurity *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.share)); - if (r->in.share) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share, ndr_charset_length(r->in.share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.file, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.file, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.file, ndr_charset_length(r->in.file, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.securityinformation)); - } - if (flags & NDR_OUT) { - if (r->out.sd_buf == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sd_buf)); - if (*r->out.sd_buf) { - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sd_buf)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetGetFileSecurity(struct ndr_pull *ndr, int flags, struct srvsvc_NetGetFileSecurity *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_share; - uint32_t _ptr_sd_buf; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_share_0; - TALLOC_CTX *_mem_save_sd_buf_0; - TALLOC_CTX *_mem_save_sd_buf_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); - if (_ptr_share) { - NDR_PULL_ALLOC(ndr, r->in.share); - } else { - r->in.share = NULL; - } - if (r->in.share) { - _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.share, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share)); - if (ndr_get_array_length(ndr, &r->in.share) > ndr_get_array_size(ndr, &r->in.share)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share), ndr_get_array_length(ndr, &r->in.share)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.file)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.file)); - if (ndr_get_array_length(ndr, &r->in.file) > ndr_get_array_size(ndr, &r->in.file)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.file), ndr_get_array_length(ndr, &r->in.file)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.file), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.file, ndr_get_array_length(ndr, &r->in.file), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.securityinformation)); - NDR_PULL_ALLOC(ndr, r->out.sd_buf); - ZERO_STRUCTP(r->out.sd_buf); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sd_buf); - } - _mem_save_sd_buf_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sd_buf, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd_buf)); - if (_ptr_sd_buf) { - NDR_PULL_ALLOC(ndr, *r->out.sd_buf); - } else { - *r->out.sd_buf = NULL; - } - if (*r->out.sd_buf) { - _mem_save_sd_buf_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.sd_buf, 0); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sd_buf)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_buf_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_buf_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetGetFileSecurity(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetGetFileSecurity *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetGetFileSecurity"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetGetFileSecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "share", r->in.share); - ndr->depth++; - if (r->in.share) { - ndr_print_string(ndr, "share", r->in.share); - } - ndr->depth--; - ndr_print_string(ndr, "file", r->in.file); - ndr_print_security_secinfo(ndr, "securityinformation", r->in.securityinformation); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetGetFileSecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "sd_buf", r->out.sd_buf); - ndr->depth++; - ndr_print_ptr(ndr, "sd_buf", *r->out.sd_buf); - ndr->depth++; - if (*r->out.sd_buf) { - ndr_print_sec_desc_buf(ndr, "sd_buf", *r->out.sd_buf); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetSetFileSecurity(struct ndr_push *ndr, int flags, const struct srvsvc_NetSetFileSecurity *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.share)); - if (r->in.share) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.share, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share, ndr_charset_length(r->in.share, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.file, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.file, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.file, ndr_charset_length(r->in.file, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.securityinformation)); - if (r->in.sd_buf == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd_buf)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetSetFileSecurity(struct ndr_pull *ndr, int flags, struct srvsvc_NetSetFileSecurity *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_share; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_share_0; - TALLOC_CTX *_mem_save_sd_buf_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share)); - if (_ptr_share) { - NDR_PULL_ALLOC(ndr, r->in.share); - } else { - r->in.share = NULL; - } - if (r->in.share) { - _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.share, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share)); - if (ndr_get_array_length(ndr, &r->in.share) > ndr_get_array_size(ndr, &r->in.share)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.share), ndr_get_array_length(ndr, &r->in.share)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share, ndr_get_array_length(ndr, &r->in.share), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.file)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.file)); - if (ndr_get_array_length(ndr, &r->in.file) > ndr_get_array_size(ndr, &r->in.file)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.file), ndr_get_array_length(ndr, &r->in.file)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.file), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.file, ndr_get_array_length(ndr, &r->in.file), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.securityinformation)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sd_buf); - } - _mem_save_sd_buf_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sd_buf, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd_buf)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_buf_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetSetFileSecurity(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSetFileSecurity *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetSetFileSecurity"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetSetFileSecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "share", r->in.share); - ndr->depth++; - if (r->in.share) { - ndr_print_string(ndr, "share", r->in.share); - } - ndr->depth--; - ndr_print_string(ndr, "file", r->in.file); - ndr_print_security_secinfo(ndr, "securityinformation", r->in.securityinformation); - ndr_print_ptr(ndr, "sd_buf", r->in.sd_buf); - ndr->depth++; - ndr_print_sec_desc_buf(ndr, "sd_buf", r->in.sd_buf); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetSetFileSecurity"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetServerTransportAddEx(struct ndr_push *ndr, int flags, const struct srvsvc_NetServerTransportAddEx *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.info, r->in.level)); - NDR_CHECK(ndr_push_srvsvc_NetTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetServerTransportAddEx(struct ndr_pull *ndr, int flags, struct srvsvc_NetServerTransportAddEx *r) -{ - uint32_t _ptr_server_unc; - TALLOC_CTX *_mem_save_server_unc_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_srvsvc_NetTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.info)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetServerTransportAddEx(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerTransportAddEx *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetServerTransportAddEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetServerTransportAddEx"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_set_switch_value(ndr, &r->in.info, r->in.level); - ndr_print_srvsvc_NetTransportInfo(ndr, "info", &r->in.info); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetServerTransportAddEx"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NetServerSetServiceBitsEx(struct ndr_push *ndr, int flags, const struct srvsvc_NetServerSetServiceBitsEx *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_unc)); - if (r->in.server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_unc, 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_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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.emulated_server_unc)); - if (r->in.emulated_server_unc) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.emulated_server_unc, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.emulated_server_unc, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.emulated_server_unc, ndr_charset_length(r->in.emulated_server_unc, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.transport)); - if (r->in.transport) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.transport, ndr_charset_length(r->in.transport, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.servicebitsofinterest)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.servicebits)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.updateimmediately)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NetServerSetServiceBitsEx(struct ndr_pull *ndr, int flags, struct srvsvc_NetServerSetServiceBitsEx *r) -{ - uint32_t _ptr_server_unc; - uint32_t _ptr_emulated_server_unc; - uint32_t _ptr_transport; - TALLOC_CTX *_mem_save_server_unc_0; - TALLOC_CTX *_mem_save_emulated_server_unc_0; - TALLOC_CTX *_mem_save_transport_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_unc)); - if (_ptr_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.server_unc); - } else { - r->in.server_unc = NULL; - } - if (r->in.server_unc) { - _mem_save_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_unc)); - if (ndr_get_array_length(ndr, &r->in.server_unc) > ndr_get_array_size(ndr, &r->in.server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_unc), ndr_get_array_length(ndr, &r->in.server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_unc, ndr_get_array_length(ndr, &r->in.server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_emulated_server_unc)); - if (_ptr_emulated_server_unc) { - NDR_PULL_ALLOC(ndr, r->in.emulated_server_unc); - } else { - r->in.emulated_server_unc = NULL; - } - if (r->in.emulated_server_unc) { - _mem_save_emulated_server_unc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.emulated_server_unc, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.emulated_server_unc)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.emulated_server_unc)); - if (ndr_get_array_length(ndr, &r->in.emulated_server_unc) > ndr_get_array_size(ndr, &r->in.emulated_server_unc)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.emulated_server_unc), ndr_get_array_length(ndr, &r->in.emulated_server_unc)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.emulated_server_unc), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.emulated_server_unc, ndr_get_array_length(ndr, &r->in.emulated_server_unc), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_emulated_server_unc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport)); - if (_ptr_transport) { - NDR_PULL_ALLOC(ndr, r->in.transport); - } else { - r->in.transport = NULL; - } - if (r->in.transport) { - _mem_save_transport_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.transport, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.transport)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.transport)); - if (ndr_get_array_length(ndr, &r->in.transport) > ndr_get_array_size(ndr, &r->in.transport)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.transport), ndr_get_array_length(ndr, &r->in.transport)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.transport), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.transport, ndr_get_array_length(ndr, &r->in.transport), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.servicebitsofinterest)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.servicebits)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.updateimmediately)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NetServerSetServiceBitsEx(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerSetServiceBitsEx *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NetServerSetServiceBitsEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NetServerSetServiceBitsEx"); - ndr->depth++; - ndr_print_ptr(ndr, "server_unc", r->in.server_unc); - ndr->depth++; - if (r->in.server_unc) { - ndr_print_string(ndr, "server_unc", r->in.server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "emulated_server_unc", r->in.emulated_server_unc); - ndr->depth++; - if (r->in.emulated_server_unc) { - ndr_print_string(ndr, "emulated_server_unc", r->in.emulated_server_unc); - } - ndr->depth--; - ndr_print_ptr(ndr, "transport", r->in.transport); - ndr->depth++; - if (r->in.transport) { - ndr_print_string(ndr, "transport", r->in.transport); - } - ndr->depth--; - ndr_print_uint32(ndr, "servicebitsofinterest", r->in.servicebitsofinterest); - ndr_print_uint32(ndr, "servicebits", r->in.servicebits); - ndr_print_uint32(ndr, "updateimmediately", r->in.updateimmediately); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NetServerSetServiceBitsEx"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSGETVERSION(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSGETVERSION *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSGETVERSION(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSGETVERSION *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSGETVERSION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSGETVERSION *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSGETVERSION"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSGETVERSION"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSGETVERSION"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSCREATELOCALPARTITION(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSCREATELOCALPARTITION *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSCREATELOCALPARTITION(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSCREATELOCALPARTITION *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSCREATELOCALPARTITION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSCREATELOCALPARTITION *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSCREATELOCALPARTITION"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSCREATELOCALPARTITION"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSCREATELOCALPARTITION"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSDELETELOCALPARTITION(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSDELETELOCALPARTITION *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSDELETELOCALPARTITION(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSDELETELOCALPARTITION *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSDELETELOCALPARTITION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSDELETELOCALPARTITION *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSDELETELOCALPARTITION"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSDELETELOCALPARTITION"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSDELETELOCALPARTITION"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSSETLOCALVOLUMESTATE"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSSETLOCALVOLUMESTATE"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSSETLOCALVOLUMESTATE"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSSETSERVERINFO(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSSETSERVERINFO *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSSETSERVERINFO(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSSETSERVERINFO *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSSETSERVERINFO(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSSETSERVERINFO *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSSETSERVERINFO"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSSETSERVERINFO"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSSETSERVERINFO"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSCREATEEXITPOINT(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSCREATEEXITPOINT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSCREATEEXITPOINT(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSCREATEEXITPOINT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSCREATEEXITPOINT(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSCREATEEXITPOINT *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSCREATEEXITPOINT"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSCREATEEXITPOINT"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSCREATEEXITPOINT"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSDELETEEXITPOINT(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSDELETEEXITPOINT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSDELETEEXITPOINT(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSDELETEEXITPOINT *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSDELETEEXITPOINT(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSDELETEEXITPOINT *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSDELETEEXITPOINT"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSDELETEEXITPOINT"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSDELETEEXITPOINT"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSMODIFYPREFIX(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSMODIFYPREFIX *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSMODIFYPREFIX(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSMODIFYPREFIX *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSMODIFYPREFIX(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSMODIFYPREFIX *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSMODIFYPREFIX"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSMODIFYPREFIX"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSMODIFYPREFIX"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSFIXLOCALVOLUME(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSFIXLOCALVOLUME *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSFIXLOCALVOLUME(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSFIXLOCALVOLUME *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSFIXLOCALVOLUME(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSFIXLOCALVOLUME *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSFIXLOCALVOLUME"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSFIXLOCALVOLUME"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSFIXLOCALVOLUME"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct ndr_push *ndr, int flags, const struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct ndr_pull *ndr, int flags, struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRDFSMANAGERREPORTSITEINFO"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRDFSMANAGERREPORTSITEINFO"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRDFSMANAGERREPORTSITEINFO"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_srvsvc_NETRSERVERTRANSPORTDELEX(struct ndr_push *ndr, int flags, const struct srvsvc_NETRSERVERTRANSPORTDELEX *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_srvsvc_NETRSERVERTRANSPORTDELEX(struct ndr_pull *ndr, int flags, struct srvsvc_NETRSERVERTRANSPORTDELEX *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_srvsvc_NETRSERVERTRANSPORTDELEX(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRSERVERTRANSPORTDELEX *r) -{ - ndr_print_struct(ndr, name, "srvsvc_NETRSERVERTRANSPORTDELEX"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "srvsvc_NETRSERVERTRANSPORTDELEX"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "srvsvc_NETRSERVERTRANSPORTDELEX"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call srvsvc_calls[] = { - { - "srvsvc_NetCharDevEnum", - sizeof(struct srvsvc_NetCharDevEnum), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevEnum, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevEnum, - (ndr_print_function_t) ndr_print_srvsvc_NetCharDevEnum, - false, - }, - { - "srvsvc_NetCharDevGetInfo", - sizeof(struct srvsvc_NetCharDevGetInfo), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevGetInfo, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevGetInfo, - (ndr_print_function_t) ndr_print_srvsvc_NetCharDevGetInfo, - false, - }, - { - "srvsvc_NetCharDevControl", - sizeof(struct srvsvc_NetCharDevControl), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevControl, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevControl, - (ndr_print_function_t) ndr_print_srvsvc_NetCharDevControl, - false, - }, - { - "srvsvc_NetCharDevQEnum", - sizeof(struct srvsvc_NetCharDevQEnum), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQEnum, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQEnum, - (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQEnum, - false, - }, - { - "srvsvc_NetCharDevQGetInfo", - sizeof(struct srvsvc_NetCharDevQGetInfo), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQGetInfo, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQGetInfo, - (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQGetInfo, - false, - }, - { - "srvsvc_NetCharDevQSetInfo", - sizeof(struct srvsvc_NetCharDevQSetInfo), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQSetInfo, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQSetInfo, - (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQSetInfo, - false, - }, - { - "srvsvc_NetCharDevQPurge", - sizeof(struct srvsvc_NetCharDevQPurge), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQPurge, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQPurge, - (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQPurge, - false, - }, - { - "srvsvc_NetCharDevQPurgeSelf", - sizeof(struct srvsvc_NetCharDevQPurgeSelf), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetCharDevQPurgeSelf, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetCharDevQPurgeSelf, - (ndr_print_function_t) ndr_print_srvsvc_NetCharDevQPurgeSelf, - false, - }, - { - "srvsvc_NetConnEnum", - sizeof(struct srvsvc_NetConnEnum), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetConnEnum, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetConnEnum, - (ndr_print_function_t) ndr_print_srvsvc_NetConnEnum, - false, - }, - { - "srvsvc_NetFileEnum", - sizeof(struct srvsvc_NetFileEnum), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetFileEnum, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetFileEnum, - (ndr_print_function_t) ndr_print_srvsvc_NetFileEnum, - false, - }, - { - "srvsvc_NetFileGetInfo", - sizeof(struct srvsvc_NetFileGetInfo), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetFileGetInfo, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetFileGetInfo, - (ndr_print_function_t) ndr_print_srvsvc_NetFileGetInfo, - false, - }, - { - "srvsvc_NetFileClose", - sizeof(struct srvsvc_NetFileClose), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetFileClose, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetFileClose, - (ndr_print_function_t) ndr_print_srvsvc_NetFileClose, - false, - }, - { - "srvsvc_NetSessEnum", - sizeof(struct srvsvc_NetSessEnum), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSessEnum, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSessEnum, - (ndr_print_function_t) ndr_print_srvsvc_NetSessEnum, - false, - }, - { - "srvsvc_NetSessDel", - sizeof(struct srvsvc_NetSessDel), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSessDel, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSessDel, - (ndr_print_function_t) ndr_print_srvsvc_NetSessDel, - false, - }, - { - "srvsvc_NetShareAdd", - sizeof(struct srvsvc_NetShareAdd), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareAdd, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareAdd, - (ndr_print_function_t) ndr_print_srvsvc_NetShareAdd, - false, - }, - { - "srvsvc_NetShareEnumAll", - sizeof(struct srvsvc_NetShareEnumAll), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareEnumAll, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareEnumAll, - (ndr_print_function_t) ndr_print_srvsvc_NetShareEnumAll, - false, - }, - { - "srvsvc_NetShareGetInfo", - sizeof(struct srvsvc_NetShareGetInfo), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareGetInfo, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareGetInfo, - (ndr_print_function_t) ndr_print_srvsvc_NetShareGetInfo, - false, - }, - { - "srvsvc_NetShareSetInfo", - sizeof(struct srvsvc_NetShareSetInfo), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareSetInfo, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareSetInfo, - (ndr_print_function_t) ndr_print_srvsvc_NetShareSetInfo, - false, - }, - { - "srvsvc_NetShareDel", - sizeof(struct srvsvc_NetShareDel), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDel, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDel, - (ndr_print_function_t) ndr_print_srvsvc_NetShareDel, - false, - }, - { - "srvsvc_NetShareDelSticky", - sizeof(struct srvsvc_NetShareDelSticky), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDelSticky, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDelSticky, - (ndr_print_function_t) ndr_print_srvsvc_NetShareDelSticky, - false, - }, - { - "srvsvc_NetShareCheck", - sizeof(struct srvsvc_NetShareCheck), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareCheck, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareCheck, - (ndr_print_function_t) ndr_print_srvsvc_NetShareCheck, - false, - }, - { - "srvsvc_NetSrvGetInfo", - sizeof(struct srvsvc_NetSrvGetInfo), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSrvGetInfo, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSrvGetInfo, - (ndr_print_function_t) ndr_print_srvsvc_NetSrvGetInfo, - false, - }, - { - "srvsvc_NetSrvSetInfo", - sizeof(struct srvsvc_NetSrvSetInfo), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSrvSetInfo, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSrvSetInfo, - (ndr_print_function_t) ndr_print_srvsvc_NetSrvSetInfo, - false, - }, - { - "srvsvc_NetDiskEnum", - sizeof(struct srvsvc_NetDiskEnum), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetDiskEnum, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetDiskEnum, - (ndr_print_function_t) ndr_print_srvsvc_NetDiskEnum, - false, - }, - { - "srvsvc_NetServerStatisticsGet", - sizeof(struct srvsvc_NetServerStatisticsGet), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetServerStatisticsGet, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetServerStatisticsGet, - (ndr_print_function_t) ndr_print_srvsvc_NetServerStatisticsGet, - false, - }, - { - "srvsvc_NetTransportAdd", - sizeof(struct srvsvc_NetTransportAdd), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetTransportAdd, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetTransportAdd, - (ndr_print_function_t) ndr_print_srvsvc_NetTransportAdd, - false, - }, - { - "srvsvc_NetTransportEnum", - sizeof(struct srvsvc_NetTransportEnum), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetTransportEnum, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetTransportEnum, - (ndr_print_function_t) ndr_print_srvsvc_NetTransportEnum, - false, - }, - { - "srvsvc_NetTransportDel", - sizeof(struct srvsvc_NetTransportDel), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetTransportDel, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetTransportDel, - (ndr_print_function_t) ndr_print_srvsvc_NetTransportDel, - false, - }, - { - "srvsvc_NetRemoteTOD", - sizeof(struct srvsvc_NetRemoteTOD), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetRemoteTOD, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetRemoteTOD, - (ndr_print_function_t) ndr_print_srvsvc_NetRemoteTOD, - false, - }, - { - "srvsvc_NetSetServiceBits", - sizeof(struct srvsvc_NetSetServiceBits), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSetServiceBits, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSetServiceBits, - (ndr_print_function_t) ndr_print_srvsvc_NetSetServiceBits, - false, - }, - { - "srvsvc_NetPathType", - sizeof(struct srvsvc_NetPathType), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPathType, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPathType, - (ndr_print_function_t) ndr_print_srvsvc_NetPathType, - false, - }, - { - "srvsvc_NetPathCanonicalize", - sizeof(struct srvsvc_NetPathCanonicalize), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPathCanonicalize, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPathCanonicalize, - (ndr_print_function_t) ndr_print_srvsvc_NetPathCanonicalize, - false, - }, - { - "srvsvc_NetPathCompare", - sizeof(struct srvsvc_NetPathCompare), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPathCompare, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPathCompare, - (ndr_print_function_t) ndr_print_srvsvc_NetPathCompare, - false, - }, - { - "srvsvc_NetNameValidate", - sizeof(struct srvsvc_NetNameValidate), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetNameValidate, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetNameValidate, - (ndr_print_function_t) ndr_print_srvsvc_NetNameValidate, - false, - }, - { - "srvsvc_NETRPRNAMECANONICALIZE", - sizeof(struct srvsvc_NETRPRNAMECANONICALIZE), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRPRNAMECANONICALIZE, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRPRNAMECANONICALIZE, - (ndr_print_function_t) ndr_print_srvsvc_NETRPRNAMECANONICALIZE, - false, - }, - { - "srvsvc_NetPRNameCompare", - sizeof(struct srvsvc_NetPRNameCompare), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetPRNameCompare, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetPRNameCompare, - (ndr_print_function_t) ndr_print_srvsvc_NetPRNameCompare, - false, - }, - { - "srvsvc_NetShareEnum", - sizeof(struct srvsvc_NetShareEnum), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareEnum, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareEnum, - (ndr_print_function_t) ndr_print_srvsvc_NetShareEnum, - false, - }, - { - "srvsvc_NetShareDelStart", - sizeof(struct srvsvc_NetShareDelStart), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDelStart, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDelStart, - (ndr_print_function_t) ndr_print_srvsvc_NetShareDelStart, - false, - }, - { - "srvsvc_NetShareDelCommit", - sizeof(struct srvsvc_NetShareDelCommit), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetShareDelCommit, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetShareDelCommit, - (ndr_print_function_t) ndr_print_srvsvc_NetShareDelCommit, - false, - }, - { - "srvsvc_NetGetFileSecurity", - sizeof(struct srvsvc_NetGetFileSecurity), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetGetFileSecurity, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetGetFileSecurity, - (ndr_print_function_t) ndr_print_srvsvc_NetGetFileSecurity, - false, - }, - { - "srvsvc_NetSetFileSecurity", - sizeof(struct srvsvc_NetSetFileSecurity), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetSetFileSecurity, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetSetFileSecurity, - (ndr_print_function_t) ndr_print_srvsvc_NetSetFileSecurity, - false, - }, - { - "srvsvc_NetServerTransportAddEx", - sizeof(struct srvsvc_NetServerTransportAddEx), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetServerTransportAddEx, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetServerTransportAddEx, - (ndr_print_function_t) ndr_print_srvsvc_NetServerTransportAddEx, - false, - }, - { - "srvsvc_NetServerSetServiceBitsEx", - sizeof(struct srvsvc_NetServerSetServiceBitsEx), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NetServerSetServiceBitsEx, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NetServerSetServiceBitsEx, - (ndr_print_function_t) ndr_print_srvsvc_NetServerSetServiceBitsEx, - false, - }, - { - "srvsvc_NETRDFSGETVERSION", - sizeof(struct srvsvc_NETRDFSGETVERSION), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSGETVERSION, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSGETVERSION, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSGETVERSION, - false, - }, - { - "srvsvc_NETRDFSCREATELOCALPARTITION", - sizeof(struct srvsvc_NETRDFSCREATELOCALPARTITION), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSCREATELOCALPARTITION, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSCREATELOCALPARTITION, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSCREATELOCALPARTITION, - false, - }, - { - "srvsvc_NETRDFSDELETELOCALPARTITION", - sizeof(struct srvsvc_NETRDFSDELETELOCALPARTITION), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSDELETELOCALPARTITION, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSDELETELOCALPARTITION, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSDELETELOCALPARTITION, - false, - }, - { - "srvsvc_NETRDFSSETLOCALVOLUMESTATE", - sizeof(struct srvsvc_NETRDFSSETLOCALVOLUMESTATE), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSSETLOCALVOLUMESTATE, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSSETLOCALVOLUMESTATE, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSSETLOCALVOLUMESTATE, - false, - }, - { - "srvsvc_NETRDFSSETSERVERINFO", - sizeof(struct srvsvc_NETRDFSSETSERVERINFO), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSSETSERVERINFO, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSSETSERVERINFO, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSSETSERVERINFO, - false, - }, - { - "srvsvc_NETRDFSCREATEEXITPOINT", - sizeof(struct srvsvc_NETRDFSCREATEEXITPOINT), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSCREATEEXITPOINT, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSCREATEEXITPOINT, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSCREATEEXITPOINT, - false, - }, - { - "srvsvc_NETRDFSDELETEEXITPOINT", - sizeof(struct srvsvc_NETRDFSDELETEEXITPOINT), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSDELETEEXITPOINT, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSDELETEEXITPOINT, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSDELETEEXITPOINT, - false, - }, - { - "srvsvc_NETRDFSMODIFYPREFIX", - sizeof(struct srvsvc_NETRDFSMODIFYPREFIX), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSMODIFYPREFIX, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSMODIFYPREFIX, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSMODIFYPREFIX, - false, - }, - { - "srvsvc_NETRDFSFIXLOCALVOLUME", - sizeof(struct srvsvc_NETRDFSFIXLOCALVOLUME), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSFIXLOCALVOLUME, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSFIXLOCALVOLUME, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSFIXLOCALVOLUME, - false, - }, - { - "srvsvc_NETRDFSMANAGERREPORTSITEINFO", - sizeof(struct srvsvc_NETRDFSMANAGERREPORTSITEINFO), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRDFSMANAGERREPORTSITEINFO, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRDFSMANAGERREPORTSITEINFO, - (ndr_print_function_t) ndr_print_srvsvc_NETRDFSMANAGERREPORTSITEINFO, - false, - }, - { - "srvsvc_NETRSERVERTRANSPORTDELEX", - sizeof(struct srvsvc_NETRSERVERTRANSPORTDELEX), - (ndr_push_flags_fn_t) ndr_push_srvsvc_NETRSERVERTRANSPORTDELEX, - (ndr_pull_flags_fn_t) ndr_pull_srvsvc_NETRSERVERTRANSPORTDELEX, - (ndr_print_function_t) ndr_print_srvsvc_NETRSERVERTRANSPORTDELEX, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const srvsvc_endpoint_strings[] = { - "ncacn_np:[\\pipe\\srvsvc]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array srvsvc_endpoints = { - .count = 3, - .names = srvsvc_endpoint_strings -}; - -static const char * const srvsvc_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array srvsvc_authservices = { - .count = 1, - .names = srvsvc_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_srvsvc = { - .name = "srvsvc", - .syntax_id = { - {0x4b324fc8,0x1670,0x01d3,{0x12,0x78},{0x5a,0x47,0xbf,0x6e,0xe1,0x88}}, - NDR_SRVSVC_VERSION - }, - .helpstring = NDR_SRVSVC_HELPSTRING, - .num_calls = 54, - .calls = srvsvc_calls, - .endpoints = &srvsvc_endpoints, - .authservices = &srvsvc_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_srvsvc.h b/source3/librpc/gen_ndr/ndr_srvsvc.h deleted file mode 100644 index 126680cad0..0000000000 --- a/source3/librpc/gen_ndr/ndr_srvsvc.h +++ /dev/null @@ -1,322 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/srvsvc.h" - -#ifndef _HEADER_NDR_srvsvc -#define _HEADER_NDR_srvsvc - -#define NDR_SRVSVC_UUID "4b324fc8-1670-01d3-1278-5a47bf6ee188" -#define NDR_SRVSVC_VERSION 3.0 -#define NDR_SRVSVC_NAME "srvsvc" -#define NDR_SRVSVC_HELPSTRING "Server Service" -extern const struct ndr_interface_table ndr_table_srvsvc; -#define NDR_SRVSVC_NETCHARDEVENUM (0x00) - -#define NDR_SRVSVC_NETCHARDEVGETINFO (0x01) - -#define NDR_SRVSVC_NETCHARDEVCONTROL (0x02) - -#define NDR_SRVSVC_NETCHARDEVQENUM (0x03) - -#define NDR_SRVSVC_NETCHARDEVQGETINFO (0x04) - -#define NDR_SRVSVC_NETCHARDEVQSETINFO (0x05) - -#define NDR_SRVSVC_NETCHARDEVQPURGE (0x06) - -#define NDR_SRVSVC_NETCHARDEVQPURGESELF (0x07) - -#define NDR_SRVSVC_NETCONNENUM (0x08) - -#define NDR_SRVSVC_NETFILEENUM (0x09) - -#define NDR_SRVSVC_NETFILEGETINFO (0x0a) - -#define NDR_SRVSVC_NETFILECLOSE (0x0b) - -#define NDR_SRVSVC_NETSESSENUM (0x0c) - -#define NDR_SRVSVC_NETSESSDEL (0x0d) - -#define NDR_SRVSVC_NETSHAREADD (0x0e) - -#define NDR_SRVSVC_NETSHAREENUMALL (0x0f) - -#define NDR_SRVSVC_NETSHAREGETINFO (0x10) - -#define NDR_SRVSVC_NETSHARESETINFO (0x11) - -#define NDR_SRVSVC_NETSHAREDEL (0x12) - -#define NDR_SRVSVC_NETSHAREDELSTICKY (0x13) - -#define NDR_SRVSVC_NETSHARECHECK (0x14) - -#define NDR_SRVSVC_NETSRVGETINFO (0x15) - -#define NDR_SRVSVC_NETSRVSETINFO (0x16) - -#define NDR_SRVSVC_NETDISKENUM (0x17) - -#define NDR_SRVSVC_NETSERVERSTATISTICSGET (0x18) - -#define NDR_SRVSVC_NETTRANSPORTADD (0x19) - -#define NDR_SRVSVC_NETTRANSPORTENUM (0x1a) - -#define NDR_SRVSVC_NETTRANSPORTDEL (0x1b) - -#define NDR_SRVSVC_NETREMOTETOD (0x1c) - -#define NDR_SRVSVC_NETSETSERVICEBITS (0x1d) - -#define NDR_SRVSVC_NETPATHTYPE (0x1e) - -#define NDR_SRVSVC_NETPATHCANONICALIZE (0x1f) - -#define NDR_SRVSVC_NETPATHCOMPARE (0x20) - -#define NDR_SRVSVC_NETNAMEVALIDATE (0x21) - -#define NDR_SRVSVC_NETRPRNAMECANONICALIZE (0x22) - -#define NDR_SRVSVC_NETPRNAMECOMPARE (0x23) - -#define NDR_SRVSVC_NETSHAREENUM (0x24) - -#define NDR_SRVSVC_NETSHAREDELSTART (0x25) - -#define NDR_SRVSVC_NETSHAREDELCOMMIT (0x26) - -#define NDR_SRVSVC_NETGETFILESECURITY (0x27) - -#define NDR_SRVSVC_NETSETFILESECURITY (0x28) - -#define NDR_SRVSVC_NETSERVERTRANSPORTADDEX (0x29) - -#define NDR_SRVSVC_NETSERVERSETSERVICEBITSEX (0x2a) - -#define NDR_SRVSVC_NETRDFSGETVERSION (0x2b) - -#define NDR_SRVSVC_NETRDFSCREATELOCALPARTITION (0x2c) - -#define NDR_SRVSVC_NETRDFSDELETELOCALPARTITION (0x2d) - -#define NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE (0x2e) - -#define NDR_SRVSVC_NETRDFSSETSERVERINFO (0x2f) - -#define NDR_SRVSVC_NETRDFSCREATEEXITPOINT (0x30) - -#define NDR_SRVSVC_NETRDFSDELETEEXITPOINT (0x31) - -#define NDR_SRVSVC_NETRDFSMODIFYPREFIX (0x32) - -#define NDR_SRVSVC_NETRDFSFIXLOCALVOLUME (0x33) - -#define NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO (0x34) - -#define NDR_SRVSVC_NETRSERVERTRANSPORTDELEX (0x35) - -#define NDR_SRVSVC_CALL_COUNT (54) -void ndr_print_srvsvc_NetCharDevInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo0 *r); -void ndr_print_srvsvc_NetCharDevCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr0 *r); -void ndr_print_srvsvc_NetCharDevInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo1 *r); -void ndr_print_srvsvc_NetCharDevCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr1 *r); -void ndr_print_srvsvc_NetCharDevInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevInfo *r); -void ndr_print_srvsvc_NetCharDevCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevCtr *r); -void ndr_print_srvsvc_NetCharDevInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfoCtr *r); -void ndr_print_srvsvc_NetCharDevQInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo0 *r); -void ndr_print_srvsvc_NetCharDevQCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr0 *r); -void ndr_print_srvsvc_NetCharDevQInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo1 *r); -void ndr_print_srvsvc_NetCharDevQCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr1 *r); -void ndr_print_srvsvc_NetCharDevQInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQInfo *r); -void ndr_print_srvsvc_NetCharDevQCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQCtr *r); -void ndr_print_srvsvc_NetCharDevQInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfoCtr *r); -void ndr_print_srvsvc_NetConnInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo0 *r); -void ndr_print_srvsvc_NetConnCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr0 *r); -void ndr_print_srvsvc_NetConnInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo1 *r); -void ndr_print_srvsvc_NetConnCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr1 *r); -void ndr_print_srvsvc_NetConnCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetConnCtr *r); -void ndr_print_srvsvc_NetConnInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfoCtr *r); -void ndr_print_srvsvc_NetFileInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo2 *r); -void ndr_print_srvsvc_NetFileCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr2 *r); -void ndr_print_srvsvc_NetFileInfo3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo3 *r); -void ndr_print_srvsvc_NetFileCtr3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr3 *r); -void ndr_print_srvsvc_NetFileInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileInfo *r); -void ndr_print_srvsvc_NetFileCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileCtr *r); -void ndr_print_srvsvc_NetFileInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfoCtr *r); -void ndr_print_srvsvc_NetSessInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo0 *r); -void ndr_print_srvsvc_NetSessCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr0 *r); -void ndr_print_srvsvc_NetSessInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo1 *r); -void ndr_print_srvsvc_NetSessCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr1 *r); -void ndr_print_srvsvc_NetSessInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo2 *r); -void ndr_print_srvsvc_NetSessCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr2 *r); -void ndr_print_srvsvc_NetSessInfo10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo10 *r); -void ndr_print_srvsvc_NetSessCtr10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr10 *r); -void ndr_print_srvsvc_NetSessInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo502 *r); -void ndr_print_srvsvc_NetSessCtr502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr502 *r); -void ndr_print_srvsvc_NetSessCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetSessCtr *r); -void ndr_print_srvsvc_NetSessInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfoCtr *r); -void ndr_print_srvsvc_ShareType(struct ndr_print *ndr, const char *name, enum srvsvc_ShareType r); -void ndr_print_srvsvc_NetShareInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo0 *r); -void ndr_print_srvsvc_NetShareCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr0 *r); -void ndr_print_srvsvc_NetShareInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1 *r); -void ndr_print_srvsvc_NetShareCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1 *r); -void ndr_print_srvsvc_NetShareInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo2 *r); -void ndr_print_srvsvc_NetShareCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr2 *r); -void ndr_print_srvsvc_NetShareInfo501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo501 *r); -void ndr_print_srvsvc_NetShareCtr501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr501 *r); -void ndr_print_srvsvc_NetShareInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo502 *r); -void ndr_print_srvsvc_NetShareCtr502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr502 *r); -void ndr_print_srvsvc_NetShareInfo1004(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1004 *r); -void ndr_print_srvsvc_NetShareCtr1004(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1004 *r); -void ndr_print_NetShareInfo1005Flags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_srvsvc_NetShareInfo1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1005 *r); -void ndr_print_srvsvc_NetShareCtr1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1005 *r); -void ndr_print_srvsvc_NetShareInfo1006(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1006 *r); -void ndr_print_srvsvc_NetShareCtr1006(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1006 *r); -void ndr_print_srvsvc_NetShareInfo1007(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfo1007 *r); -void ndr_print_srvsvc_NetShareCtr1007(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1007 *r); -void ndr_print_srvsvc_NetShareCtr1501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareCtr1501 *r); -void ndr_print_srvsvc_NetShareInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetShareInfo *r); -void ndr_print_srvsvc_NetShareCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetShareCtr *r); -void ndr_print_srvsvc_NetShareInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetShareInfoCtr *r); -enum ndr_err_code ndr_push_srvsvc_PlatformId(struct ndr_push *ndr, int ndr_flags, enum srvsvc_PlatformId r); -enum ndr_err_code ndr_pull_srvsvc_PlatformId(struct ndr_pull *ndr, int ndr_flags, enum srvsvc_PlatformId *r); -void ndr_print_srvsvc_PlatformId(struct ndr_print *ndr, const char *name, enum srvsvc_PlatformId r); -enum ndr_err_code ndr_push_srvsvc_NetSrvInfo100(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo100 *r); -enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo100(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo100 *r); -void ndr_print_srvsvc_NetSrvInfo100(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo100 *r); -enum ndr_err_code ndr_push_srvsvc_NetSrvInfo101(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSrvInfo101 *r); -enum ndr_err_code ndr_pull_srvsvc_NetSrvInfo101(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSrvInfo101 *r); -void ndr_print_srvsvc_NetSrvInfo101(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo101 *r); -void ndr_print_srvsvc_NetSrvInfo102(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo102 *r); -void ndr_print_srvsvc_NetSrvInfo402(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo402 *r); -void ndr_print_srvsvc_NetSrvInfo403(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo403 *r); -void ndr_print_srvsvc_NetSrvInfo502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo502 *r); -void ndr_print_srvsvc_NetSrvInfo503(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo503 *r); -void ndr_print_srvsvc_NetSrvInfo599(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo599 *r); -void ndr_print_srvsvc_NetSrvInfo1005(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1005 *r); -void ndr_print_srvsvc_NetSrvInfo1010(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1010 *r); -void ndr_print_srvsvc_NetSrvInfo1016(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1016 *r); -void ndr_print_srvsvc_NetSrvInfo1017(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1017 *r); -void ndr_print_srvsvc_NetSrvInfo1018(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1018 *r); -void ndr_print_srvsvc_NetSrvInfo1107(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1107 *r); -void ndr_print_srvsvc_NetSrvInfo1501(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1501 *r); -void ndr_print_srvsvc_NetSrvInfo1502(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1502 *r); -void ndr_print_srvsvc_NetSrvInfo1503(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1503 *r); -void ndr_print_srvsvc_NetSrvInfo1506(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1506 *r); -void ndr_print_srvsvc_NetSrvInfo1509(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1509 *r); -void ndr_print_srvsvc_NetSrvInfo1510(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1510 *r); -void ndr_print_srvsvc_NetSrvInfo1511(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1511 *r); -void ndr_print_srvsvc_NetSrvInfo1512(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1512 *r); -void ndr_print_srvsvc_NetSrvInfo1513(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1513 *r); -void ndr_print_srvsvc_NetSrvInfo1514(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1514 *r); -void ndr_print_srvsvc_NetSrvInfo1515(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1515 *r); -void ndr_print_srvsvc_NetSrvInfo1516(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1516 *r); -void ndr_print_srvsvc_NetSrvInfo1518(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1518 *r); -void ndr_print_srvsvc_NetSrvInfo1520(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1520 *r); -void ndr_print_srvsvc_NetSrvInfo1521(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1521 *r); -void ndr_print_srvsvc_NetSrvInfo1522(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1522 *r); -void ndr_print_srvsvc_NetSrvInfo1523(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1523 *r); -void ndr_print_srvsvc_NetSrvInfo1524(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1524 *r); -void ndr_print_srvsvc_NetSrvInfo1525(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1525 *r); -void ndr_print_srvsvc_NetSrvInfo1528(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1528 *r); -void ndr_print_srvsvc_NetSrvInfo1529(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1529 *r); -void ndr_print_srvsvc_NetSrvInfo1530(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1530 *r); -void ndr_print_srvsvc_NetSrvInfo1533(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1533 *r); -void ndr_print_srvsvc_NetSrvInfo1534(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1534 *r); -void ndr_print_srvsvc_NetSrvInfo1535(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1535 *r); -void ndr_print_srvsvc_NetSrvInfo1536(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1536 *r); -void ndr_print_srvsvc_NetSrvInfo1537(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1537 *r); -void ndr_print_srvsvc_NetSrvInfo1538(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1538 *r); -void ndr_print_srvsvc_NetSrvInfo1539(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1539 *r); -void ndr_print_srvsvc_NetSrvInfo1540(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1540 *r); -void ndr_print_srvsvc_NetSrvInfo1541(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1541 *r); -void ndr_print_srvsvc_NetSrvInfo1542(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1542 *r); -void ndr_print_srvsvc_NetSrvInfo1543(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1543 *r); -void ndr_print_srvsvc_NetSrvInfo1544(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1544 *r); -void ndr_print_srvsvc_NetSrvInfo1545(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1545 *r); -void ndr_print_srvsvc_NetSrvInfo1546(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1546 *r); -void ndr_print_srvsvc_NetSrvInfo1547(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1547 *r); -void ndr_print_srvsvc_NetSrvInfo1548(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1548 *r); -void ndr_print_srvsvc_NetSrvInfo1549(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1549 *r); -void ndr_print_srvsvc_NetSrvInfo1550(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1550 *r); -void ndr_print_srvsvc_NetSrvInfo1552(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1552 *r); -void ndr_print_srvsvc_NetSrvInfo1553(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1553 *r); -void ndr_print_srvsvc_NetSrvInfo1554(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1554 *r); -void ndr_print_srvsvc_NetSrvInfo1555(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1555 *r); -void ndr_print_srvsvc_NetSrvInfo1556(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSrvInfo1556 *r); -void ndr_print_srvsvc_NetSrvInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetSrvInfo *r); -void ndr_print_srvsvc_NetDiskInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetDiskInfo0 *r); -void ndr_print_srvsvc_NetDiskInfo(struct ndr_print *ndr, const char *name, const struct srvsvc_NetDiskInfo *r); -void ndr_print_srvsvc_Statistics(struct ndr_print *ndr, const char *name, const struct srvsvc_Statistics *r); -void ndr_print_srvsvc_NetTransportInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo0 *r); -void ndr_print_srvsvc_NetTransportCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr0 *r); -void ndr_print_srvsvc_NetTransportInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo1 *r); -void ndr_print_srvsvc_NetTransportCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr1 *r); -void ndr_print_srvsvc_NetTransportInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo2 *r); -void ndr_print_srvsvc_NetTransportCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr2 *r); -void ndr_print_srvsvc_NetTransportInfo3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfo3 *r); -void ndr_print_srvsvc_NetTransportCtr3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportCtr3 *r); -void ndr_print_srvsvc_NetTransportCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetTransportCtr *r); -void ndr_print_srvsvc_NetTransportInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetTransportInfoCtr *r); -void ndr_print_srvsvc_NetRemoteTODInfo(struct ndr_print *ndr, const char *name, const struct srvsvc_NetRemoteTODInfo *r); -void ndr_print_srvsvc_NetTransportInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetTransportInfo *r); -void ndr_print_srvsvc_NetCharDevEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevEnum *r); -void ndr_print_srvsvc_NetCharDevGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevGetInfo *r); -void ndr_print_srvsvc_NetCharDevControl(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevControl *r); -void ndr_print_srvsvc_NetCharDevQEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQEnum *r); -void ndr_print_srvsvc_NetCharDevQGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQGetInfo *r); -void ndr_print_srvsvc_NetCharDevQSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQSetInfo *r); -void ndr_print_srvsvc_NetCharDevQPurge(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQPurge *r); -void ndr_print_srvsvc_NetCharDevQPurgeSelf(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetCharDevQPurgeSelf *r); -void ndr_print_srvsvc_NetConnEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetConnEnum *r); -void ndr_print_srvsvc_NetFileEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileEnum *r); -void ndr_print_srvsvc_NetFileGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileGetInfo *r); -void ndr_print_srvsvc_NetFileClose(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetFileClose *r); -void ndr_print_srvsvc_NetSessEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSessEnum *r); -void ndr_print_srvsvc_NetSessDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSessDel *r); -void ndr_print_srvsvc_NetShareAdd(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareAdd *r); -void ndr_print_srvsvc_NetShareEnumAll(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareEnumAll *r); -void ndr_print_srvsvc_NetShareGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareGetInfo *r); -void ndr_print_srvsvc_NetShareSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareSetInfo *r); -void ndr_print_srvsvc_NetShareDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDel *r); -void ndr_print_srvsvc_NetShareDelSticky(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelSticky *r); -void ndr_print_srvsvc_NetShareCheck(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareCheck *r); -void ndr_print_srvsvc_NetSrvGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSrvGetInfo *r); -void ndr_print_srvsvc_NetSrvSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSrvSetInfo *r); -void ndr_print_srvsvc_NetDiskEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetDiskEnum *r); -void ndr_print_srvsvc_NetServerStatisticsGet(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerStatisticsGet *r); -void ndr_print_srvsvc_NetTransportAdd(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportAdd *r); -void ndr_print_srvsvc_NetTransportEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportEnum *r); -void ndr_print_srvsvc_NetTransportDel(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetTransportDel *r); -void ndr_print_srvsvc_NetRemoteTOD(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetRemoteTOD *r); -void ndr_print_srvsvc_NetSetServiceBits(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSetServiceBits *r); -void ndr_print_srvsvc_NetPathType(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathType *r); -void ndr_print_srvsvc_NetPathCanonicalize(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathCanonicalize *r); -void ndr_print_srvsvc_NetPathCompare(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPathCompare *r); -void ndr_print_srvsvc_NetNameValidate(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetNameValidate *r); -void ndr_print_srvsvc_NETRPRNAMECANONICALIZE(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRPRNAMECANONICALIZE *r); -void ndr_print_srvsvc_NetPRNameCompare(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetPRNameCompare *r); -void ndr_print_srvsvc_NetShareEnum(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareEnum *r); -void ndr_print_srvsvc_NetShareDelStart(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelStart *r); -void ndr_print_srvsvc_NetShareDelCommit(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetShareDelCommit *r); -void ndr_print_srvsvc_NetGetFileSecurity(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetGetFileSecurity *r); -void ndr_print_srvsvc_NetSetFileSecurity(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetSetFileSecurity *r); -void ndr_print_srvsvc_NetServerTransportAddEx(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerTransportAddEx *r); -void ndr_print_srvsvc_NetServerSetServiceBitsEx(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NetServerSetServiceBitsEx *r); -void ndr_print_srvsvc_NETRDFSGETVERSION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSGETVERSION *r); -void ndr_print_srvsvc_NETRDFSCREATELOCALPARTITION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSCREATELOCALPARTITION *r); -void ndr_print_srvsvc_NETRDFSDELETELOCALPARTITION(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSDELETELOCALPARTITION *r); -void ndr_print_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r); -void ndr_print_srvsvc_NETRDFSSETSERVERINFO(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSSETSERVERINFO *r); -void ndr_print_srvsvc_NETRDFSCREATEEXITPOINT(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSCREATEEXITPOINT *r); -void ndr_print_srvsvc_NETRDFSDELETEEXITPOINT(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSDELETEEXITPOINT *r); -void ndr_print_srvsvc_NETRDFSMODIFYPREFIX(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSMODIFYPREFIX *r); -void ndr_print_srvsvc_NETRDFSFIXLOCALVOLUME(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSFIXLOCALVOLUME *r); -void ndr_print_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r); -void ndr_print_srvsvc_NETRSERVERTRANSPORTDELEX(struct ndr_print *ndr, const char *name, int flags, const struct srvsvc_NETRSERVERTRANSPORTDELEX *r); -#endif /* _HEADER_NDR_srvsvc */ diff --git a/source3/librpc/gen_ndr/ndr_svcctl.c b/source3/librpc/gen_ndr/ndr_svcctl.c deleted file mode 100644 index 2bccde9ba0..0000000000 --- a/source3/librpc/gen_ndr/ndr_svcctl.c +++ /dev/null @@ -1,6414 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_svcctl.h" - -#include "librpc/gen_ndr/ndr_misc.h" -#include "librpc/gen_ndr/ndr_security.h" -static enum ndr_err_code ndr_push_SERVICE_LOCK_STATUS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_LOCK_STATUS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_locked)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->lock_owner)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_duration)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->lock_owner) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lock_owner, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lock_owner, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->lock_owner, ndr_charset_length(r->lock_owner, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_SERVICE_LOCK_STATUS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_LOCK_STATUS *r) -{ - uint32_t _ptr_lock_owner; - TALLOC_CTX *_mem_save_lock_owner_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_locked)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lock_owner)); - if (_ptr_lock_owner) { - NDR_PULL_ALLOC(ndr, r->lock_owner); - } else { - r->lock_owner = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_duration)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->lock_owner) { - _mem_save_lock_owner_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->lock_owner, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->lock_owner)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->lock_owner)); - if (ndr_get_array_length(ndr, &r->lock_owner) > ndr_get_array_size(ndr, &r->lock_owner)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->lock_owner), ndr_get_array_length(ndr, &r->lock_owner)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->lock_owner), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->lock_owner, ndr_get_array_length(ndr, &r->lock_owner), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_owner_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_SERVICE_LOCK_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_LOCK_STATUS *r) -{ - ndr_print_struct(ndr, name, "SERVICE_LOCK_STATUS"); - ndr->depth++; - ndr_print_uint32(ndr, "is_locked", r->is_locked); - ndr_print_ptr(ndr, "lock_owner", r->lock_owner); - ndr->depth++; - if (r->lock_owner) { - ndr_print_string(ndr, "lock_owner", r->lock_owner); - } - ndr->depth--; - ndr_print_uint32(ndr, "lock_duration", r->lock_duration); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_SERVICE_STATUS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_STATUS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->state)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->controls_accepted)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->win32_exit_code)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_exit_code)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->check_point)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->wait_hint)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_SERVICE_STATUS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_STATUS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->controls_accepted)); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->win32_exit_code)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_exit_code)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->check_point)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->wait_hint)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_STATUS *r) -{ - ndr_print_struct(ndr, name, "SERVICE_STATUS"); - ndr->depth++; - ndr_print_uint32(ndr, "type", r->type); - ndr_print_uint32(ndr, "state", r->state); - ndr_print_uint32(ndr, "controls_accepted", r->controls_accepted); - ndr_print_WERROR(ndr, "win32_exit_code", r->win32_exit_code); - ndr_print_uint32(ndr, "service_exit_code", r->service_exit_code); - ndr_print_uint32(ndr, "check_point", r->check_point); - ndr_print_uint32(ndr, "wait_hint", r->wait_hint); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_ENUM_SERVICE_STATUS(struct ndr_push *ndr, int ndr_flags, const struct ENUM_SERVICE_STATUS *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->service_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->display_name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - if (r->service_name) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->service_name)); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->service_name)); - } - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - if (r->display_name) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->display_name)); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->display_name)); - } - ndr->flags = _flags_save_string; - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_ENUM_SERVICE_STATUS(struct ndr_pull *ndr, int ndr_flags, struct ENUM_SERVICE_STATUS *r) -{ - uint32_t _ptr_service_name; - TALLOC_CTX *_mem_save_service_name_0; - uint32_t _ptr_display_name; - TALLOC_CTX *_mem_save_display_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); - if (_ptr_service_name) { - NDR_PULL_ALLOC(ndr, r->service_name); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->service_name, _ptr_service_name)); - } else { - r->service_name = NULL; - } - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); - if (_ptr_display_name) { - NDR_PULL_ALLOC(ndr, r->display_name); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->display_name, _ptr_display_name)); - } else { - r->display_name = NULL; - } - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status)); - } - if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - if (r->service_name) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->service_name)); - _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->service_name, 0); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->service_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); - ndr->offset = _relative_save_offset; - } - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - if (r->display_name) { - uint32_t _relative_save_offset; - _relative_save_offset = ndr->offset; - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->display_name)); - _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->display_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0); - ndr->offset = _relative_save_offset; - } - ndr->flags = _flags_save_string; - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_ENUM_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct ENUM_SERVICE_STATUS *r) -{ - ndr_print_struct(ndr, name, "ENUM_SERVICE_STATUS"); - ndr->depth++; - ndr_print_ptr(ndr, "service_name", r->service_name); - ndr->depth++; - if (r->service_name) { - ndr_print_string(ndr, "service_name", r->service_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "display_name", r->display_name); - ndr->depth++; - if (r->display_name) { - ndr_print_string(ndr, "display_name", r->display_name); - } - ndr->depth--; - ndr_print_SERVICE_STATUS(ndr, "status", &r->status); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_svcctl_ServerType(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_svcctl_ServerType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WORKSTATION", SV_TYPE_WORKSTATION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER", SV_TYPE_SERVER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SQLSERVER", SV_TYPE_SQLSERVER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_CTRL", SV_TYPE_DOMAIN_CTRL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_BAKCTRL", SV_TYPE_DOMAIN_BAKCTRL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_TIME_SOURCE", SV_TYPE_TIME_SOURCE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_AFP", SV_TYPE_AFP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_NOVELL", SV_TYPE_NOVELL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_MEMBER", SV_TYPE_DOMAIN_MEMBER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_PRINTQ_SERVER", SV_TYPE_PRINTQ_SERVER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DIALIN_SERVER", SV_TYPE_DIALIN_SERVER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_UNIX", SV_TYPE_SERVER_UNIX, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_NT", SV_TYPE_NT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WFW", SV_TYPE_WFW, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_MFPN", SV_TYPE_SERVER_MFPN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_NT", SV_TYPE_SERVER_NT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_POTENTIAL_BROWSER", SV_TYPE_POTENTIAL_BROWSER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_BACKUP_BROWSER", SV_TYPE_BACKUP_BROWSER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_MASTER_BROWSER", SV_TYPE_MASTER_BROWSER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_MASTER", SV_TYPE_DOMAIN_MASTER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_OSF", SV_TYPE_SERVER_OSF, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_VMS", SV_TYPE_SERVER_VMS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WIN95_PLUS", SV_TYPE_WIN95_PLUS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DFS_SERVER", SV_TYPE_DFS_SERVER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_ALTERNATE_XPORT", SV_TYPE_ALTERNATE_XPORT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_LOCAL_LIST_ONLY", SV_TYPE_LOCAL_LIST_ONLY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_ENUM", SV_TYPE_DOMAIN_ENUM, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_SERVICE_CONTROL(struct ndr_push *ndr, int ndr_flags, enum SERVICE_CONTROL r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_SERVICE_CONTROL(struct ndr_pull *ndr, int ndr_flags, enum SERVICE_CONTROL *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_SERVICE_CONTROL(struct ndr_print *ndr, const char *name, enum SERVICE_CONTROL r) -{ - const char *val = NULL; - - switch (r) { - case SVCCTL_CONTROL_STOP: val = "SVCCTL_CONTROL_STOP"; break; - case SVCCTL_CONTROL_PAUSE: val = "SVCCTL_CONTROL_PAUSE"; break; - case SVCCTL_CONTROL_CONTINUE: val = "SVCCTL_CONTROL_CONTINUE"; break; - case SVCCTL_CONTROL_INTERROGATE: val = "SVCCTL_CONTROL_INTERROGATE"; break; - case SVCCTL_CONTROL_SHUTDOWN: val = "SVCCTL_CONTROL_SHUTDOWN"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_svcctl_MgrAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_MgrAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_MgrAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_CONNECT", SC_RIGHT_MGR_CONNECT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_CREATE_SERVICE", SC_RIGHT_MGR_CREATE_SERVICE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_ENUMERATE_SERVICE", SC_RIGHT_MGR_ENUMERATE_SERVICE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_LOCK", SC_RIGHT_MGR_LOCK, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_QUERY_LOCK_STATUS", SC_RIGHT_MGR_QUERY_LOCK_STATUS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_MODIFY_BOOT_CONFIG", SC_RIGHT_MGR_MODIFY_BOOT_CONFIG, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_ServiceAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_ServiceAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_QUERY_CONFIG", SC_RIGHT_SVC_QUERY_CONFIG, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_CHANGE_CONFIG", SC_RIGHT_SVC_CHANGE_CONFIG, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_QUERY_STATUS", SC_RIGHT_SVC_QUERY_STATUS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_ENUMERATE_DEPENDENTS", SC_RIGHT_SVC_ENUMERATE_DEPENDENTS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_START", SC_RIGHT_SVC_START, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_STOP", SC_RIGHT_SVC_STOP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_PAUSE_CONTINUE", SC_RIGHT_SVC_PAUSE_CONTINUE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_INTERROGATE", SC_RIGHT_SVC_INTERROGATE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_USER_DEFINED_CONTROL", SC_RIGHT_SVC_USER_DEFINED_CONTROL, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_flags, const struct QUERY_SERVICE_CONFIG *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->error_control)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->executablepath)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->loadordergroup)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tag_id)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependencies)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->startname)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->displayname)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->executablepath) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->executablepath, ndr_charset_length(r->executablepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->loadordergroup) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->loadordergroup, ndr_charset_length(r->loadordergroup, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->dependencies) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dependencies, ndr_charset_length(r->dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->startname) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->startname, ndr_charset_length(r->startname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->displayname) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->displayname, ndr_charset_length(r->displayname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_QUERY_SERVICE_CONFIG(struct ndr_pull *ndr, int ndr_flags, struct QUERY_SERVICE_CONFIG *r) -{ - uint32_t _ptr_executablepath; - TALLOC_CTX *_mem_save_executablepath_0; - uint32_t _ptr_loadordergroup; - TALLOC_CTX *_mem_save_loadordergroup_0; - uint32_t _ptr_dependencies; - TALLOC_CTX *_mem_save_dependencies_0; - uint32_t _ptr_startname; - TALLOC_CTX *_mem_save_startname_0; - uint32_t _ptr_displayname; - TALLOC_CTX *_mem_save_displayname_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->error_control)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_executablepath)); - if (_ptr_executablepath) { - NDR_PULL_ALLOC(ndr, r->executablepath); - } else { - r->executablepath = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_loadordergroup)); - if (_ptr_loadordergroup) { - NDR_PULL_ALLOC(ndr, r->loadordergroup); - } else { - r->loadordergroup = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tag_id)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); - if (_ptr_dependencies) { - NDR_PULL_ALLOC(ndr, r->dependencies); - } else { - r->dependencies = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_startname)); - if (_ptr_startname) { - NDR_PULL_ALLOC(ndr, r->startname); - } else { - r->startname = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_displayname)); - if (_ptr_displayname) { - NDR_PULL_ALLOC(ndr, r->displayname); - } else { - r->displayname = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->executablepath) { - _mem_save_executablepath_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->executablepath, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->executablepath)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->executablepath)); - if (ndr_get_array_length(ndr, &r->executablepath) > ndr_get_array_size(ndr, &r->executablepath)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->executablepath), ndr_get_array_length(ndr, &r->executablepath)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->executablepath, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_executablepath_0, 0); - } - if (r->loadordergroup) { - _mem_save_loadordergroup_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->loadordergroup, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->loadordergroup)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->loadordergroup)); - if (ndr_get_array_length(ndr, &r->loadordergroup) > ndr_get_array_size(ndr, &r->loadordergroup)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->loadordergroup), ndr_get_array_length(ndr, &r->loadordergroup)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->loadordergroup, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_loadordergroup_0, 0); - } - if (r->dependencies) { - _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dependencies, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->dependencies)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->dependencies)); - if (ndr_get_array_length(ndr, &r->dependencies) > ndr_get_array_size(ndr, &r->dependencies)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dependencies), ndr_get_array_length(ndr, &r->dependencies)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dependencies, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); - } - if (r->startname) { - _mem_save_startname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->startname, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->startname)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->startname)); - if (ndr_get_array_length(ndr, &r->startname) > ndr_get_array_size(ndr, &r->startname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->startname), ndr_get_array_length(ndr, &r->startname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->startname, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_startname_0, 0); - } - if (r->displayname) { - _mem_save_displayname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->displayname, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->displayname)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->displayname)); - if (ndr_get_array_length(ndr, &r->displayname) > ndr_get_array_size(ndr, &r->displayname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->displayname), ndr_get_array_length(ndr, &r->displayname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->displayname, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_displayname_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_QUERY_SERVICE_CONFIG(struct ndr_print *ndr, const char *name, const struct QUERY_SERVICE_CONFIG *r) -{ - ndr_print_struct(ndr, name, "QUERY_SERVICE_CONFIG"); - ndr->depth++; - ndr_print_uint32(ndr, "service_type", r->service_type); - ndr_print_uint32(ndr, "start_type", r->start_type); - ndr_print_uint32(ndr, "error_control", r->error_control); - ndr_print_ptr(ndr, "executablepath", r->executablepath); - ndr->depth++; - if (r->executablepath) { - ndr_print_string(ndr, "executablepath", r->executablepath); - } - ndr->depth--; - ndr_print_ptr(ndr, "loadordergroup", r->loadordergroup); - ndr->depth++; - if (r->loadordergroup) { - ndr_print_string(ndr, "loadordergroup", r->loadordergroup); - } - ndr->depth--; - ndr_print_uint32(ndr, "tag_id", r->tag_id); - ndr_print_ptr(ndr, "dependencies", r->dependencies); - ndr->depth++; - if (r->dependencies) { - ndr_print_string(ndr, "dependencies", r->dependencies); - } - ndr->depth--; - ndr_print_ptr(ndr, "startname", r->startname); - ndr->depth++; - if (r->startname) { - ndr_print_string(ndr, "startname", r->startname); - } - ndr->depth--; - ndr_print_ptr(ndr, "displayname", r->displayname); - ndr->depth++; - if (r->displayname) { - ndr_print_string(ndr, "displayname", r->displayname); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_QUERY_SERVICE_CONFIG); -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_CloseServiceHandle(struct ndr_pull *ndr, int flags, struct svcctl_CloseServiceHandle *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.handle); - *r->out.handle = *r->in.handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CloseServiceHandle *r) -{ - ndr_print_struct(ndr, name, "svcctl_CloseServiceHandle"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_CloseServiceHandle"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_CloseServiceHandle"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_SERVICE_CONTROL(ndr, NDR_SCALARS, r->in.control)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_ControlService(struct ndr_pull *ndr, int flags, struct svcctl_ControlService *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_service_status_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_SERVICE_CONTROL(ndr, NDR_SCALARS, &r->in.control)); - NDR_PULL_ALLOC(ndr, r->out.service_status); - ZERO_STRUCTP(r->out.service_status); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.service_status); - } - _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ControlService *r) -{ - ndr_print_struct(ndr, name, "svcctl_ControlService"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_ControlService"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_SERVICE_CONTROL(ndr, "control", r->in.control); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_ControlService"); - ndr->depth++; - ndr_print_ptr(ndr, "service_status", r->out.service_status); - ndr->depth++; - ndr_print_SERVICE_STATUS(ndr, "service_status", r->out.service_status); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_DeleteService(struct ndr_pull *ndr, int flags, struct svcctl_DeleteService *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_DeleteService *r) -{ - ndr_print_struct(ndr, name, "svcctl_DeleteService"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_DeleteService"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_DeleteService"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - 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, r->out.lock)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_LockServiceDatabase(struct ndr_pull *ndr, int flags, struct svcctl_LockServiceDatabase *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_lock_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.lock); - ZERO_STRUCTP(r->out.lock); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.lock); - } - _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.lock, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.lock)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_LockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_LockServiceDatabase *r) -{ - ndr_print_struct(ndr, name, "svcctl_LockServiceDatabase"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_LockServiceDatabase"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_LockServiceDatabase"); - ndr->depth++; - ndr_print_ptr(ndr, "lock", r->out.lock); - ndr->depth++; - ndr_print_policy_handle(ndr, "lock", r->out.lock); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_QueryServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceObjectSecurity *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); - } - if (flags & NDR_OUT) { - if (r->out.buffer == 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)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buffer_size)); - if (r->out.needed == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_QueryServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceObjectSecurity *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_needed_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size)); - if (r->in.buffer_size < 0 || r->in.buffer_size > 0x40000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buffer_size); - memset(r->out.buffer, 0, (r->in.buffer_size) * sizeof(*r->out.buffer)); - NDR_PULL_ALLOC(ndr, r->out.needed); - ZERO_STRUCTP(r->out.needed); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.needed); - } - _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); - if (*r->out.needed < 0 || *r->out.needed > 0x40000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.buffer_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceObjectSecurity *r) -{ - ndr_print_struct(ndr, name, "svcctl_QueryServiceObjectSecurity"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_QueryServiceObjectSecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "security_flags", r->in.security_flags); - ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_QueryServiceObjectSecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "buffer", r->out.buffer); - ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buffer_size); - ndr->depth--; - ndr_print_ptr(ndr, "needed", r->out.needed); - ndr->depth++; - ndr_print_uint32(ndr, "needed", *r->out.needed); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_SetServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_SetServiceObjectSecurity *r) -{ - if (flags & NDR_IN) { - 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, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags)); - if (r->in.buffer == 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)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.buffer_size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_SetServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_SetServiceObjectSecurity *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer))); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size)); - if (r->in.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.buffer_size)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_SetServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceObjectSecurity *r) -{ - ndr_print_struct(ndr, name, "svcctl_SetServiceObjectSecurity"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_SetServiceObjectSecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "security_flags", r->in.security_flags); - ndr_print_ptr(ndr, "buffer", r->in.buffer); - ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.buffer_size); - ndr->depth--; - ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_SetServiceObjectSecurity"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_QueryServiceStatus(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceStatus *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_service_status_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.service_status); - ZERO_STRUCTP(r->out.service_status); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.service_status); - } - _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_QueryServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatus *r) -{ - ndr_print_struct(ndr, name, "svcctl_QueryServiceStatus"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_QueryServiceStatus"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_QueryServiceStatus"); - ndr->depth++; - ndr_print_ptr(ndr, "service_status", r->out.service_status); - ndr->depth++; - ndr_print_SERVICE_STATUS(ndr, "service_status", r->out.service_status); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_SetServiceStatus(struct ndr_push *ndr, int flags, const struct svcctl_SetServiceStatus *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_SetServiceStatus(struct ndr_pull *ndr, int flags, struct svcctl_SetServiceStatus *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_SetServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceStatus *r) -{ - ndr_print_struct(ndr, name, "svcctl_SetServiceStatus"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_SetServiceStatus"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_SetServiceStatus"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.lock)); - } - if (flags & NDR_OUT) { - 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, r->out.lock)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_UnlockServiceDatabase(struct ndr_pull *ndr, int flags, struct svcctl_UnlockServiceDatabase *r) -{ - TALLOC_CTX *_mem_save_lock_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.lock); - } - _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.lock, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.lock)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.lock); - *r->out.lock = *r->in.lock; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.lock); - } - _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.lock, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.lock)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_UnlockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_UnlockServiceDatabase *r) -{ - ndr_print_struct(ndr, name, "svcctl_UnlockServiceDatabase"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_UnlockServiceDatabase"); - ndr->depth++; - ndr_print_ptr(ndr, "lock", r->in.lock); - ndr->depth++; - ndr_print_policy_handle(ndr, "lock", r->in.lock); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_UnlockServiceDatabase"); - ndr->depth++; - ndr_print_ptr(ndr, "lock", r->out.lock); - ndr->depth++; - ndr_print_policy_handle(ndr, "lock", r->out.lock); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_NotifyBootConfigStatus(struct ndr_push *ndr, int flags, const struct svcctl_NotifyBootConfigStatus *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_NotifyBootConfigStatus(struct ndr_pull *ndr, int flags, struct svcctl_NotifyBootConfigStatus *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_NotifyBootConfigStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_NotifyBootConfigStatus *r) -{ - ndr_print_struct(ndr, name, "svcctl_NotifyBootConfigStatus"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_NotifyBootConfigStatus"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_NotifyBootConfigStatus"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.immediate)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_SCSetServiceBitsW(struct ndr_pull *ndr, int flags, struct svcctl_SCSetServiceBitsW *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bits)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bitson)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.immediate)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_SCSetServiceBitsW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsW *r) -{ - ndr_print_struct(ndr, name, "svcctl_SCSetServiceBitsW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_SCSetServiceBitsW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "bits", r->in.bits); - ndr_print_uint32(ndr, "bitson", r->in.bitson); - ndr_print_uint32(ndr, "immediate", r->in.immediate); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_SCSetServiceBitsW"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.error)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path)); - if (r->in.binary_path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_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.binary_path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.load_order_group)); - if (r->in.load_order_group) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.load_order_group, ndr_charset_length(r->in.load_order_group, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies)); - if (r->in.dependencies) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name)); - if (r->in.service_start_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_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.service_start_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); - if (r->in.password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name)); - if (r->in.display_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_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.display_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.display_name, ndr_charset_length(r->in.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfigW(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfigW *r) -{ - uint32_t _ptr_binary_path; - uint32_t _ptr_load_order_group; - uint32_t _ptr_dependencies; - uint32_t _ptr_service_start_name; - uint32_t _ptr_password; - uint32_t _ptr_display_name; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_binary_path_0; - TALLOC_CTX *_mem_save_load_order_group_0; - TALLOC_CTX *_mem_save_tag_id_0; - TALLOC_CTX *_mem_save_dependencies_0; - TALLOC_CTX *_mem_save_service_start_name_0; - TALLOC_CTX *_mem_save_password_0; - TALLOC_CTX *_mem_save_display_name_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.error)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path)); - if (_ptr_binary_path) { - NDR_PULL_ALLOC(ndr, r->in.binary_path); - } else { - r->in.binary_path = NULL; - } - if (r->in.binary_path) { - _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path)); - if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_load_order_group)); - if (_ptr_load_order_group) { - NDR_PULL_ALLOC(ndr, r->in.load_order_group); - } else { - r->in.load_order_group = NULL; - } - if (r->in.load_order_group) { - _mem_save_load_order_group_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.load_order_group, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.load_order_group)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.load_order_group)); - if (ndr_get_array_length(ndr, &r->in.load_order_group) > ndr_get_array_size(ndr, &r->in.load_order_group)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.load_order_group), ndr_get_array_length(ndr, &r->in.load_order_group)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.load_order_group, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_load_order_group_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); - if (_ptr_dependencies) { - NDR_PULL_ALLOC(ndr, r->in.dependencies); - } else { - r->in.dependencies = NULL; - } - if (r->in.dependencies) { - _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies)); - if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name)); - if (_ptr_service_start_name) { - NDR_PULL_ALLOC(ndr, r->in.service_start_name); - } else { - r->in.service_start_name = NULL; - } - if (r->in.service_start_name) { - _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name)); - if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->in.password); - } else { - r->in.password = NULL; - } - if (r->in.password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); - if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); - if (_ptr_display_name) { - NDR_PULL_ALLOC(ndr, r->in.display_name); - } else { - r->in.display_name = NULL; - } - if (r->in.display_name) { - _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.display_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.display_name)); - if (ndr_get_array_length(ndr, &r->in.display_name) > ndr_get_array_size(ndr, &r->in.display_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.display_name), ndr_get_array_length(ndr, &r->in.display_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.display_name, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.tag_id); - ZERO_STRUCTP(r->out.tag_id); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.tag_id); - } - _mem_save_tag_id_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.tag_id, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.tag_id)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tag_id_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_ChangeServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigW *r) -{ - ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfigW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfigW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "type", r->in.type); - ndr_print_uint32(ndr, "start", r->in.start); - ndr_print_uint32(ndr, "error", r->in.error); - ndr_print_ptr(ndr, "binary_path", r->in.binary_path); - ndr->depth++; - if (r->in.binary_path) { - ndr_print_string(ndr, "binary_path", r->in.binary_path); - } - ndr->depth--; - ndr_print_ptr(ndr, "load_order_group", r->in.load_order_group); - ndr->depth++; - if (r->in.load_order_group) { - ndr_print_string(ndr, "load_order_group", r->in.load_order_group); - } - ndr->depth--; - ndr_print_ptr(ndr, "dependencies", r->in.dependencies); - ndr->depth++; - if (r->in.dependencies) { - ndr_print_string(ndr, "dependencies", r->in.dependencies); - } - ndr->depth--; - ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name); - ndr->depth++; - if (r->in.service_start_name) { - ndr_print_string(ndr, "service_start_name", r->in.service_start_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->in.password); - ndr->depth++; - if (r->in.password) { - ndr_print_string(ndr, "password", r->in.password); - } - ndr->depth--; - ndr_print_ptr(ndr, "display_name", r->in.display_name); - ndr->depth++; - if (r->in.display_name) { - ndr_print_string(ndr, "display_name", r->in.display_name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfigW"); - ndr->depth++; - ndr_print_ptr(ndr, "tag_id", r->out.tag_id); - ndr->depth++; - ndr_print_uint32(ndr, "tag_id", *r->out.tag_id); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DisplayName)); - if (r->in.DisplayName) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DisplayName, ndr_charset_length(r->in.DisplayName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.desired_access)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.error_control)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_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.binary_path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.LoadOrderGroupKey)); - if (r->in.LoadOrderGroupKey) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.LoadOrderGroupKey, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.TagId)); - if (r->in.TagId) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.TagId)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies)); - if (r->in.dependencies) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dependencies_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.dependencies, r->in.dependencies_size)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dependencies_size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name)); - if (r->in.service_start_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_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.service_start_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); - if (r->in.password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.password_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.password, r->in.password_size)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.password_size)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.TagId)); - if (r->out.TagId) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.TagId)); - } - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_CreateServiceW(struct ndr_pull *ndr, int flags, struct svcctl_CreateServiceW *r) -{ - uint32_t _ptr_DisplayName; - uint32_t _ptr_LoadOrderGroupKey; - uint32_t _ptr_TagId; - uint32_t _ptr_dependencies; - uint32_t _ptr_service_start_name; - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_scmanager_handle_0; - TALLOC_CTX *_mem_save_DisplayName_0; - TALLOC_CTX *_mem_save_LoadOrderGroupKey_0; - TALLOC_CTX *_mem_save_TagId_0; - TALLOC_CTX *_mem_save_dependencies_0; - TALLOC_CTX *_mem_save_service_start_name_0; - TALLOC_CTX *_mem_save_password_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.scmanager_handle); - } - _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName)); - if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DisplayName)); - if (_ptr_DisplayName) { - NDR_PULL_ALLOC(ndr, r->in.DisplayName); - } else { - r->in.DisplayName = NULL; - } - if (r->in.DisplayName) { - _mem_save_DisplayName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.DisplayName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DisplayName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DisplayName)); - if (ndr_get_array_length(ndr, &r->in.DisplayName) > ndr_get_array_size(ndr, &r->in.DisplayName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DisplayName), ndr_get_array_length(ndr, &r->in.DisplayName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DisplayName, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DisplayName_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.desired_access)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.error_control)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path)); - if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_LoadOrderGroupKey)); - if (_ptr_LoadOrderGroupKey) { - NDR_PULL_ALLOC(ndr, r->in.LoadOrderGroupKey); - } else { - r->in.LoadOrderGroupKey = NULL; - } - if (r->in.LoadOrderGroupKey) { - _mem_save_LoadOrderGroupKey_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.LoadOrderGroupKey, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.LoadOrderGroupKey)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.LoadOrderGroupKey)); - if (ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey) > ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey), ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.LoadOrderGroupKey, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_LoadOrderGroupKey_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId)); - if (_ptr_TagId) { - NDR_PULL_ALLOC(ndr, r->in.TagId); - } else { - r->in.TagId = NULL; - } - if (r->in.TagId) { - _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.TagId, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.TagId)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); - if (_ptr_dependencies) { - NDR_PULL_ALLOC(ndr, r->in.dependencies); - } else { - r->in.dependencies = NULL; - } - if (r->in.dependencies) { - _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies)); - NDR_PULL_ALLOC_N(ndr, r->in.dependencies, ndr_get_array_size(ndr, &r->in.dependencies)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.dependencies, ndr_get_array_size(ndr, &r->in.dependencies))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dependencies_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name)); - if (_ptr_service_start_name) { - NDR_PULL_ALLOC(ndr, r->in.service_start_name); - } else { - r->in.service_start_name = NULL; - } - if (r->in.service_start_name) { - _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name)); - if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->in.password); - } else { - r->in.password = NULL; - } - if (r->in.password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); - NDR_PULL_ALLOC_N(ndr, r->in.password, ndr_get_array_size(ndr, &r->in.password)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.password, ndr_get_array_size(ndr, &r->in.password))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.password_size)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - if (r->in.dependencies) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.dependencies, r->in.dependencies_size)); - } - if (r->in.password) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.password, r->in.password_size)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId)); - if (_ptr_TagId) { - NDR_PULL_ALLOC(ndr, r->out.TagId); - } else { - r->out.TagId = NULL; - } - if (r->out.TagId) { - _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.TagId, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.TagId)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_CreateServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceW *r) -{ - ndr_print_struct(ndr, name, "svcctl_CreateServiceW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_CreateServiceW"); - ndr->depth++; - ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle); - ndr->depth--; - ndr_print_string(ndr, "ServiceName", r->in.ServiceName); - ndr_print_ptr(ndr, "DisplayName", r->in.DisplayName); - ndr->depth++; - if (r->in.DisplayName) { - ndr_print_string(ndr, "DisplayName", r->in.DisplayName); - } - ndr->depth--; - ndr_print_uint32(ndr, "desired_access", r->in.desired_access); - ndr_print_uint32(ndr, "type", r->in.type); - ndr_print_uint32(ndr, "start_type", r->in.start_type); - ndr_print_uint32(ndr, "error_control", r->in.error_control); - ndr_print_string(ndr, "binary_path", r->in.binary_path); - ndr_print_ptr(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey); - ndr->depth++; - if (r->in.LoadOrderGroupKey) { - ndr_print_string(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey); - } - ndr->depth--; - ndr_print_ptr(ndr, "TagId", r->in.TagId); - ndr->depth++; - if (r->in.TagId) { - ndr_print_uint32(ndr, "TagId", *r->in.TagId); - } - ndr->depth--; - ndr_print_ptr(ndr, "dependencies", r->in.dependencies); - ndr->depth++; - if (r->in.dependencies) { - ndr_print_array_uint8(ndr, "dependencies", r->in.dependencies, r->in.dependencies_size); - } - ndr->depth--; - ndr_print_uint32(ndr, "dependencies_size", r->in.dependencies_size); - ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name); - ndr->depth++; - if (r->in.service_start_name) { - ndr_print_string(ndr, "service_start_name", r->in.service_start_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->in.password); - ndr->depth++; - if (r->in.password) { - ndr_print_array_uint8(ndr, "password", r->in.password, r->in.password_size); - } - ndr->depth--; - ndr_print_uint32(ndr, "password_size", r->in.password_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_CreateServiceW"); - ndr->depth++; - ndr_print_ptr(ndr, "TagId", r->out.TagId); - ndr->depth++; - if (r->out.TagId) { - ndr_print_uint32(ndr, "TagId", *r->out.TagId); - } - ndr->depth--; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - } - if (flags & NDR_OUT) { - if (r->out.service_status == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.service_status, r->in.buf_size)); - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_EnumDependentServicesW(struct ndr_pull *ndr, int flags, struct svcctl_EnumDependentServicesW *r) -{ - TALLOC_CTX *_mem_save_service_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - TALLOC_CTX *_mem_save_services_returned_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.service); - } - _mem_save_service_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.service)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - if (r->in.buf_size < 0 || r->in.buf_size > 0x40000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC_N(ndr, r->out.service_status, r->in.buf_size); - memset(r->out.service_status, 0, (r->in.buf_size) * sizeof(*r->out.service_status)); - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - NDR_PULL_ALLOC(ndr, r->out.services_returned); - ZERO_STRUCTP(r->out.services_returned); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service_status)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.service_status, ndr_get_array_size(ndr, &r->out.service_status)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service_status, ndr_get_array_size(ndr, &r->out.service_status))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 0x40000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.services_returned); - } - _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned)); - if (*r->out.services_returned < 0 || *r->out.services_returned > 0x40000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.service_status) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service_status, r->in.buf_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_EnumDependentServicesW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesW *r) -{ - ndr_print_struct(ndr, name, "svcctl_EnumDependentServicesW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_EnumDependentServicesW"); - ndr->depth++; - ndr_print_ptr(ndr, "service", r->in.service); - ndr->depth++; - ndr_print_policy_handle(ndr, "service", r->in.service); - ndr->depth--; - ndr_print_uint32(ndr, "state", r->in.state); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_EnumDependentServicesW"); - ndr->depth++; - ndr_print_ptr(ndr, "service_status", r->out.service_status); - ndr->depth++; - ndr_print_array_uint8(ndr, "service_status", r->out.service_status, r->in.buf_size); - ndr->depth--; - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_ptr(ndr, "services_returned", r->out.services_returned); - ndr->depth++; - ndr_print_uint32(ndr, "services_returned", *r->out.services_returned); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.service == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - 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 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 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_EnumServicesStatusW(struct ndr_pull *ndr, int flags, struct svcctl_EnumServicesStatusW *r) -{ - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - TALLOC_CTX *_mem_save_services_returned_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - if (r->in.buf_size < 0 || r->in.buf_size > 262144) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC_N(ndr, r->out.service, r->in.buf_size); - memset(r->out.service, 0, (r->in.buf_size) * sizeof(*r->out.service)); - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - NDR_PULL_ALLOC(ndr, r->out.services_returned); - ZERO_STRUCTP(r->out.services_returned); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.service, ndr_get_array_size(ndr, &r->out.service)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service, ndr_get_array_size(ndr, &r->out.service))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 262144) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.services_returned); - } - _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned)); - if (*r->out.services_returned < 0 || *r->out.services_returned > 262144) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.service) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service, r->in.buf_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_EnumServicesStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusW *r) -{ - ndr_print_struct(ndr, name, "svcctl_EnumServicesStatusW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_EnumServicesStatusW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "type", r->in.type); - ndr_print_uint32(ndr, "state", r->in.state); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_EnumServicesStatusW"); - ndr->depth++; - ndr_print_ptr(ndr, "service", r->out.service); - ndr->depth++; - ndr_print_array_uint8(ndr, "service", r->out.service, r->in.buf_size); - ndr->depth--; - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_ptr(ndr, "services_returned", r->out.services_returned); - ndr->depth++; - ndr_print_uint32(ndr, "services_returned", *r->out.services_returned); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_OpenSCManagerW(struct ndr_push *ndr, int flags, const struct svcctl_OpenSCManagerW *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.MachineName)); - if (r->in.MachineName) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.MachineName, ndr_charset_length(r->in.MachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DatabaseName)); - if (r->in.DatabaseName) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DatabaseName, ndr_charset_length(r->in.DatabaseName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_svcctl_MgrAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_OpenSCManagerW(struct ndr_pull *ndr, int flags, struct svcctl_OpenSCManagerW *r) -{ - uint32_t _ptr_MachineName; - uint32_t _ptr_DatabaseName; - TALLOC_CTX *_mem_save_MachineName_0; - TALLOC_CTX *_mem_save_DatabaseName_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_MachineName)); - if (_ptr_MachineName) { - NDR_PULL_ALLOC(ndr, r->in.MachineName); - } else { - r->in.MachineName = NULL; - } - if (r->in.MachineName) { - _mem_save_MachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.MachineName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.MachineName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.MachineName)); - if (ndr_get_array_length(ndr, &r->in.MachineName) > ndr_get_array_size(ndr, &r->in.MachineName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.MachineName), ndr_get_array_length(ndr, &r->in.MachineName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.MachineName, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_MachineName_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DatabaseName)); - if (_ptr_DatabaseName) { - NDR_PULL_ALLOC(ndr, r->in.DatabaseName); - } else { - r->in.DatabaseName = NULL; - } - if (r->in.DatabaseName) { - _mem_save_DatabaseName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.DatabaseName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DatabaseName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DatabaseName)); - if (ndr_get_array_length(ndr, &r->in.DatabaseName) > ndr_get_array_size(ndr, &r->in.DatabaseName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DatabaseName), ndr_get_array_length(ndr, &r->in.DatabaseName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DatabaseName, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DatabaseName_0, 0); - } - NDR_CHECK(ndr_pull_svcctl_MgrAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_OpenSCManagerW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerW *r) -{ - ndr_print_struct(ndr, name, "svcctl_OpenSCManagerW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_OpenSCManagerW"); - ndr->depth++; - ndr_print_ptr(ndr, "MachineName", r->in.MachineName); - ndr->depth++; - if (r->in.MachineName) { - ndr_print_string(ndr, "MachineName", r->in.MachineName); - } - ndr->depth--; - ndr_print_ptr(ndr, "DatabaseName", r->in.DatabaseName); - ndr->depth++; - if (r->in.DatabaseName) { - ndr_print_string(ndr, "DatabaseName", r->in.DatabaseName); - } - ndr->depth--; - ndr_print_svcctl_MgrAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_OpenSCManagerW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_svcctl_ServiceAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_OpenServiceW(struct ndr_pull *ndr, int flags, struct svcctl_OpenServiceW *r) -{ - TALLOC_CTX *_mem_save_scmanager_handle_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.scmanager_handle); - } - _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName)); - if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_svcctl_ServiceAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_OpenServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceW *r) -{ - ndr_print_struct(ndr, name, "svcctl_OpenServiceW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_OpenServiceW"); - ndr->depth++; - ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle); - ndr->depth--; - ndr_print_string(ndr, "ServiceName", r->in.ServiceName); - ndr_print_svcctl_ServiceAccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_OpenServiceW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - } - if (flags & NDR_OUT) { - if (r->out.query == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_QUERY_SERVICE_CONFIG(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfigW(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfigW *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_query_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - if (r->in.buf_size < 0 || r->in.buf_size > 8192) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC(ndr, r->out.query); - ZERO_STRUCTP(r->out.query); - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.query); - } - _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_QUERY_SERVICE_CONFIG(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 8192) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_QueryServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigW *r) -{ - ndr_print_struct(ndr, name, "svcctl_QueryServiceConfigW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfigW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfigW"); - ndr->depth++; - ndr_print_ptr(ndr, "query", r->out.query); - ndr->depth++; - ndr_print_QUERY_SERVICE_CONFIG(ndr, "query", r->out.query); - ndr->depth--; - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_QueryServiceLockStatusW(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceLockStatusW *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_lock_status_0; - TALLOC_CTX *_mem_save_required_buf_size_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_PULL_ALLOC(ndr, r->out.lock_status); - ZERO_STRUCTP(r->out.lock_status); - NDR_PULL_ALLOC(ndr, r->out.required_buf_size); - ZERO_STRUCTP(r->out.required_buf_size); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.lock_status); - } - _mem_save_lock_status_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.lock_status, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_status_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.required_buf_size); - } - _mem_save_required_buf_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.required_buf_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.required_buf_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_required_buf_size_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_QueryServiceLockStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusW *r) -{ - ndr_print_struct(ndr, name, "svcctl_QueryServiceLockStatusW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_QueryServiceLockStatusW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_QueryServiceLockStatusW"); - ndr->depth++; - ndr_print_ptr(ndr, "lock_status", r->out.lock_status); - ndr->depth++; - ndr_print_SERVICE_LOCK_STATUS(ndr, "lock_status", r->out.lock_status); - ndr->depth--; - ndr_print_ptr(ndr, "required_buf_size", r->out.required_buf_size); - ndr->depth++; - ndr_print_uint32(ndr, "required_buf_size", *r->out.required_buf_size); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.NumArgs)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Arguments)); - if (r->in.Arguments) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Arguments, ndr_charset_length(r->in.Arguments, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_StartServiceW(struct ndr_pull *ndr, int flags, struct svcctl_StartServiceW *r) -{ - uint32_t _ptr_Arguments; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_Arguments_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.NumArgs)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Arguments)); - if (_ptr_Arguments) { - NDR_PULL_ALLOC(ndr, r->in.Arguments); - } else { - r->in.Arguments = NULL; - } - if (r->in.Arguments) { - _mem_save_Arguments_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Arguments, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Arguments)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Arguments)); - if (ndr_get_array_length(ndr, &r->in.Arguments) > ndr_get_array_size(ndr, &r->in.Arguments)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Arguments), ndr_get_array_length(ndr, &r->in.Arguments)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Arguments, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Arguments_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_StartServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceW *r) -{ - ndr_print_struct(ndr, name, "svcctl_StartServiceW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_StartServiceW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "NumArgs", r->in.NumArgs); - ndr_print_ptr(ndr, "Arguments", r->in.Arguments); - ndr->depth++; - if (r->in.Arguments) { - ndr_print_string(ndr, "Arguments", r->in.Arguments); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_StartServiceW"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); - if (r->in.service_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_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.service_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length)); - if (r->in.display_name_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length)); - } - } - if (flags & NDR_OUT) { - if (r->out.display_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.display_name)); - if (*r->out.display_name) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); - if (r->out.display_name_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameW(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceDisplayNameW *r) -{ - uint32_t _ptr_service_name; - uint32_t _ptr_display_name; - uint32_t _ptr_display_name_length; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_service_name_0; - TALLOC_CTX *_mem_save_display_name_0; - TALLOC_CTX *_mem_save_display_name_1; - TALLOC_CTX *_mem_save_display_name_length_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); - if (_ptr_service_name) { - NDR_PULL_ALLOC(ndr, r->in.service_name); - } else { - r->in.service_name = NULL; - } - if (r->in.service_name) { - _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name)); - if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); - if (_ptr_display_name_length) { - NDR_PULL_ALLOC(ndr, r->in.display_name_length); - } else { - r->in.display_name_length = NULL; - } - if (r->in.display_name_length) { - _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.display_name); - ZERO_STRUCTP(r->out.display_name); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.display_name); - } - _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); - if (_ptr_display_name) { - NDR_PULL_ALLOC(ndr, *r->out.display_name); - } else { - *r->out.display_name = NULL; - } - if (*r->out.display_name) { - _mem_save_display_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.display_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name)); - if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.display_name), ndr_get_array_length(ndr, r->out.display_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); - if (_ptr_display_name_length) { - NDR_PULL_ALLOC(ndr, r->out.display_name_length); - } else { - r->out.display_name_length = NULL; - } - if (r->out.display_name_length) { - _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameW *r) -{ - ndr_print_struct(ndr, name, "svcctl_GetServiceDisplayNameW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_GetServiceDisplayNameW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "service_name", r->in.service_name); - ndr->depth++; - if (r->in.service_name) { - ndr_print_string(ndr, "service_name", r->in.service_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length); - ndr->depth++; - if (r->in.display_name_length) { - ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_GetServiceDisplayNameW"); - ndr->depth++; - ndr_print_ptr(ndr, "display_name", r->out.display_name); - ndr->depth++; - ndr_print_ptr(ndr, "display_name", *r->out.display_name); - ndr->depth++; - if (*r->out.display_name) { - ndr_print_string(ndr, "display_name", *r->out.display_name); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); - ndr->depth++; - if (r->out.display_name_length) { - ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); - if (r->in.service_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_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.service_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length)); - if (r->in.display_name_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length)); - } - } - if (flags & NDR_OUT) { - if (r->out.key_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_name)); - if (*r->out.key_name) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); - if (r->out.display_name_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameW(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceKeyNameW *r) -{ - uint32_t _ptr_service_name; - uint32_t _ptr_key_name; - uint32_t _ptr_display_name_length; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_service_name_0; - TALLOC_CTX *_mem_save_key_name_0; - TALLOC_CTX *_mem_save_key_name_1; - TALLOC_CTX *_mem_save_display_name_length_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); - if (_ptr_service_name) { - NDR_PULL_ALLOC(ndr, r->in.service_name); - } else { - r->in.service_name = NULL; - } - if (r->in.service_name) { - _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name)); - if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); - if (_ptr_display_name_length) { - NDR_PULL_ALLOC(ndr, r->in.display_name_length); - } else { - r->in.display_name_length = NULL; - } - if (r->in.display_name_length) { - _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.key_name); - ZERO_STRUCTP(r->out.key_name); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.key_name); - } - _mem_save_key_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.key_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_name)); - if (_ptr_key_name) { - NDR_PULL_ALLOC(ndr, *r->out.key_name); - } else { - *r->out.key_name = NULL; - } - if (*r->out.key_name) { - _mem_save_key_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name)); - if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.key_name), ndr_get_array_length(ndr, r->out.key_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); - if (_ptr_display_name_length) { - NDR_PULL_ALLOC(ndr, r->out.display_name_length); - } else { - r->out.display_name_length = NULL; - } - if (r->out.display_name_length) { - _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_GetServiceKeyNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameW *r) -{ - ndr_print_struct(ndr, name, "svcctl_GetServiceKeyNameW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_GetServiceKeyNameW"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "service_name", r->in.service_name); - ndr->depth++; - if (r->in.service_name) { - ndr_print_string(ndr, "service_name", r->in.service_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length); - ndr->depth++; - if (r->in.display_name_length) { - ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_GetServiceKeyNameW"); - ndr->depth++; - ndr_print_ptr(ndr, "key_name", r->out.key_name); - ndr->depth++; - ndr_print_ptr(ndr, "key_name", *r->out.key_name); - ndr->depth++; - if (*r->out.key_name) { - ndr_print_string(ndr, "key_name", *r->out.key_name); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); - ndr->depth++; - if (r->out.display_name_length) { - ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.immediate)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_SCSetServiceBitsA(struct ndr_pull *ndr, int flags, struct svcctl_SCSetServiceBitsA *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bits)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bitson)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.immediate)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_SCSetServiceBitsA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsA *r) -{ - ndr_print_struct(ndr, name, "svcctl_SCSetServiceBitsA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_SCSetServiceBitsA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "bits", r->in.bits); - ndr_print_uint32(ndr, "bitson", r->in.bitson); - ndr_print_uint32(ndr, "immediate", r->in.immediate); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_SCSetServiceBitsA"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.error)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path)); - if (r->in.binary_path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_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.binary_path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.load_order_group)); - if (r->in.load_order_group) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.load_order_group, ndr_charset_length(r->in.load_order_group, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies)); - if (r->in.dependencies) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name)); - if (r->in.service_start_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_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.service_start_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); - if (r->in.password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name)); - if (r->in.display_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_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.display_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.display_name, ndr_charset_length(r->in.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfigA(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfigA *r) -{ - uint32_t _ptr_binary_path; - uint32_t _ptr_load_order_group; - uint32_t _ptr_dependencies; - uint32_t _ptr_service_start_name; - uint32_t _ptr_password; - uint32_t _ptr_display_name; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_binary_path_0; - TALLOC_CTX *_mem_save_load_order_group_0; - TALLOC_CTX *_mem_save_tag_id_0; - TALLOC_CTX *_mem_save_dependencies_0; - TALLOC_CTX *_mem_save_service_start_name_0; - TALLOC_CTX *_mem_save_password_0; - TALLOC_CTX *_mem_save_display_name_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.error)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path)); - if (_ptr_binary_path) { - NDR_PULL_ALLOC(ndr, r->in.binary_path); - } else { - r->in.binary_path = NULL; - } - if (r->in.binary_path) { - _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path)); - if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_load_order_group)); - if (_ptr_load_order_group) { - NDR_PULL_ALLOC(ndr, r->in.load_order_group); - } else { - r->in.load_order_group = NULL; - } - if (r->in.load_order_group) { - _mem_save_load_order_group_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.load_order_group, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.load_order_group)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.load_order_group)); - if (ndr_get_array_length(ndr, &r->in.load_order_group) > ndr_get_array_size(ndr, &r->in.load_order_group)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.load_order_group), ndr_get_array_length(ndr, &r->in.load_order_group)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.load_order_group, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_load_order_group_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); - if (_ptr_dependencies) { - NDR_PULL_ALLOC(ndr, r->in.dependencies); - } else { - r->in.dependencies = NULL; - } - if (r->in.dependencies) { - _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies)); - if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name)); - if (_ptr_service_start_name) { - NDR_PULL_ALLOC(ndr, r->in.service_start_name); - } else { - r->in.service_start_name = NULL; - } - if (r->in.service_start_name) { - _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name)); - if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->in.password); - } else { - r->in.password = NULL; - } - if (r->in.password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); - if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); - if (_ptr_display_name) { - NDR_PULL_ALLOC(ndr, r->in.display_name); - } else { - r->in.display_name = NULL; - } - if (r->in.display_name) { - _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.display_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.display_name)); - if (ndr_get_array_length(ndr, &r->in.display_name) > ndr_get_array_size(ndr, &r->in.display_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.display_name), ndr_get_array_length(ndr, &r->in.display_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.display_name, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.tag_id); - ZERO_STRUCTP(r->out.tag_id); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.tag_id); - } - _mem_save_tag_id_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.tag_id, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.tag_id)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tag_id_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_ChangeServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigA *r) -{ - ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfigA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfigA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "type", r->in.type); - ndr_print_uint32(ndr, "start", r->in.start); - ndr_print_uint32(ndr, "error", r->in.error); - ndr_print_ptr(ndr, "binary_path", r->in.binary_path); - ndr->depth++; - if (r->in.binary_path) { - ndr_print_string(ndr, "binary_path", r->in.binary_path); - } - ndr->depth--; - ndr_print_ptr(ndr, "load_order_group", r->in.load_order_group); - ndr->depth++; - if (r->in.load_order_group) { - ndr_print_string(ndr, "load_order_group", r->in.load_order_group); - } - ndr->depth--; - ndr_print_ptr(ndr, "dependencies", r->in.dependencies); - ndr->depth++; - if (r->in.dependencies) { - ndr_print_string(ndr, "dependencies", r->in.dependencies); - } - ndr->depth--; - ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name); - ndr->depth++; - if (r->in.service_start_name) { - ndr_print_string(ndr, "service_start_name", r->in.service_start_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->in.password); - ndr->depth++; - if (r->in.password) { - ndr_print_string(ndr, "password", r->in.password); - } - ndr->depth--; - ndr_print_ptr(ndr, "display_name", r->in.display_name); - ndr->depth++; - if (r->in.display_name) { - ndr_print_string(ndr, "display_name", r->in.display_name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfigA"); - ndr->depth++; - ndr_print_ptr(ndr, "tag_id", r->out.tag_id); - ndr->depth++; - ndr_print_uint32(ndr, "tag_id", *r->out.tag_id); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ServiceName)); - if (r->in.ServiceName) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DisplayName)); - if (r->in.DisplayName) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DisplayName, ndr_charset_length(r->in.DisplayName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.desired_access)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.error_control)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path)); - if (r->in.binary_path) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_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.binary_path, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.LoadOrderGroupKey)); - if (r->in.LoadOrderGroupKey) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.LoadOrderGroupKey, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies)); - if (r->in.dependencies) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name)); - if (r->in.service_start_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_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.service_start_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); - if (r->in.password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.TagId)); - if (r->out.TagId) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.TagId)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_CreateServiceA(struct ndr_pull *ndr, int flags, struct svcctl_CreateServiceA *r) -{ - uint32_t _ptr_ServiceName; - uint32_t _ptr_DisplayName; - uint32_t _ptr_binary_path; - uint32_t _ptr_LoadOrderGroupKey; - uint32_t _ptr_TagId; - uint32_t _ptr_dependencies; - uint32_t _ptr_service_start_name; - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_ServiceName_0; - TALLOC_CTX *_mem_save_DisplayName_0; - TALLOC_CTX *_mem_save_binary_path_0; - TALLOC_CTX *_mem_save_LoadOrderGroupKey_0; - TALLOC_CTX *_mem_save_TagId_0; - TALLOC_CTX *_mem_save_dependencies_0; - TALLOC_CTX *_mem_save_service_start_name_0; - TALLOC_CTX *_mem_save_password_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ServiceName)); - if (_ptr_ServiceName) { - NDR_PULL_ALLOC(ndr, r->in.ServiceName); - } else { - r->in.ServiceName = NULL; - } - if (r->in.ServiceName) { - _mem_save_ServiceName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.ServiceName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName)); - if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ServiceName_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DisplayName)); - if (_ptr_DisplayName) { - NDR_PULL_ALLOC(ndr, r->in.DisplayName); - } else { - r->in.DisplayName = NULL; - } - if (r->in.DisplayName) { - _mem_save_DisplayName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.DisplayName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DisplayName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DisplayName)); - if (ndr_get_array_length(ndr, &r->in.DisplayName) > ndr_get_array_size(ndr, &r->in.DisplayName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DisplayName), ndr_get_array_length(ndr, &r->in.DisplayName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DisplayName, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DisplayName_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.desired_access)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.error_control)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path)); - if (_ptr_binary_path) { - NDR_PULL_ALLOC(ndr, r->in.binary_path); - } else { - r->in.binary_path = NULL; - } - if (r->in.binary_path) { - _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path)); - if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_LoadOrderGroupKey)); - if (_ptr_LoadOrderGroupKey) { - NDR_PULL_ALLOC(ndr, r->in.LoadOrderGroupKey); - } else { - r->in.LoadOrderGroupKey = NULL; - } - if (r->in.LoadOrderGroupKey) { - _mem_save_LoadOrderGroupKey_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.LoadOrderGroupKey, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.LoadOrderGroupKey)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.LoadOrderGroupKey)); - if (ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey) > ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey), ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.LoadOrderGroupKey, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_LoadOrderGroupKey_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies)); - if (_ptr_dependencies) { - NDR_PULL_ALLOC(ndr, r->in.dependencies); - } else { - r->in.dependencies = NULL; - } - if (r->in.dependencies) { - _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies)); - if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name)); - if (_ptr_service_start_name) { - NDR_PULL_ALLOC(ndr, r->in.service_start_name); - } else { - r->in.service_start_name = NULL; - } - if (r->in.service_start_name) { - _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name)); - if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->in.password); - } else { - r->in.password = NULL; - } - if (r->in.password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); - if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId)); - if (_ptr_TagId) { - NDR_PULL_ALLOC(ndr, r->out.TagId); - } else { - r->out.TagId = NULL; - } - if (r->out.TagId) { - _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.TagId, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.TagId)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_CreateServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceA *r) -{ - ndr_print_struct(ndr, name, "svcctl_CreateServiceA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_CreateServiceA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "ServiceName", r->in.ServiceName); - ndr->depth++; - if (r->in.ServiceName) { - ndr_print_string(ndr, "ServiceName", r->in.ServiceName); - } - ndr->depth--; - ndr_print_ptr(ndr, "DisplayName", r->in.DisplayName); - ndr->depth++; - if (r->in.DisplayName) { - ndr_print_string(ndr, "DisplayName", r->in.DisplayName); - } - ndr->depth--; - ndr_print_uint32(ndr, "desired_access", r->in.desired_access); - ndr_print_uint32(ndr, "type", r->in.type); - ndr_print_uint32(ndr, "start_type", r->in.start_type); - ndr_print_uint32(ndr, "error_control", r->in.error_control); - ndr_print_ptr(ndr, "binary_path", r->in.binary_path); - ndr->depth++; - if (r->in.binary_path) { - ndr_print_string(ndr, "binary_path", r->in.binary_path); - } - ndr->depth--; - ndr_print_ptr(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey); - ndr->depth++; - if (r->in.LoadOrderGroupKey) { - ndr_print_string(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey); - } - ndr->depth--; - ndr_print_ptr(ndr, "dependencies", r->in.dependencies); - ndr->depth++; - if (r->in.dependencies) { - ndr_print_string(ndr, "dependencies", r->in.dependencies); - } - ndr->depth--; - ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name); - ndr->depth++; - if (r->in.service_start_name) { - ndr_print_string(ndr, "service_start_name", r->in.service_start_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->in.password); - ndr->depth++; - if (r->in.password) { - ndr_print_string(ndr, "password", r->in.password); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_CreateServiceA"); - ndr->depth++; - ndr_print_ptr(ndr, "TagId", r->out.TagId); - ndr->depth++; - if (r->out.TagId) { - ndr_print_uint32(ndr, "TagId", *r->out.TagId); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.service_status)); - 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_EnumDependentServicesA(struct ndr_pull *ndr, int flags, struct svcctl_EnumDependentServicesA *r) -{ - uint32_t _ptr_service_status; - TALLOC_CTX *_mem_save_service_0; - TALLOC_CTX *_mem_save_service_status_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - TALLOC_CTX *_mem_save_services_returned_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.service); - } - _mem_save_service_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.service)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - NDR_PULL_ALLOC(ndr, r->out.services_returned); - ZERO_STRUCTP(r->out.services_returned); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_status)); - if (_ptr_service_status) { - NDR_PULL_ALLOC(ndr, r->out.service_status); - } else { - r->out.service_status = NULL; - } - if (r->out.service_status) { - _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, 0); - NDR_CHECK(ndr_pull_ENUM_SERVICE_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.service_status)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.services_returned); - } - _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_EnumDependentServicesA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesA *r) -{ - ndr_print_struct(ndr, name, "svcctl_EnumDependentServicesA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_EnumDependentServicesA"); - ndr->depth++; - ndr_print_ptr(ndr, "service", r->in.service); - ndr->depth++; - ndr_print_policy_handle(ndr, "service", r->in.service); - ndr->depth--; - ndr_print_uint32(ndr, "state", r->in.state); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_EnumDependentServicesA"); - ndr->depth++; - ndr_print_ptr(ndr, "service_status", r->out.service_status); - ndr->depth++; - if (r->out.service_status) { - ndr_print_ENUM_SERVICE_STATUS(ndr, "service_status", r->out.service_status); - } - ndr->depth--; - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_ptr(ndr, "services_returned", r->out.services_returned); - ndr->depth++; - ndr_print_uint32(ndr, "services_returned", *r->out.services_returned); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - 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 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 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) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_EnumServicesStatusA(struct ndr_pull *ndr, int flags, struct svcctl_EnumServicesStatusA *r) -{ - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - TALLOC_CTX *_mem_save_services_returned_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - NDR_PULL_ALLOC(ndr, r->out.services_returned); - ZERO_STRUCTP(r->out.services_returned); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service)); - NDR_PULL_ALLOC_N(ndr, r->out.service, ndr_get_array_size(ndr, &r->out.service)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service, ndr_get_array_size(ndr, &r->out.service))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.services_returned); - } - _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.service) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service, r->in.buf_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_EnumServicesStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusA *r) -{ - ndr_print_struct(ndr, name, "svcctl_EnumServicesStatusA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_EnumServicesStatusA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "type", r->in.type); - ndr_print_uint32(ndr, "state", r->in.state); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_EnumServicesStatusA"); - ndr->depth++; - ndr_print_array_uint8(ndr, "service", r->out.service, r->in.buf_size); - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_ptr(ndr, "services_returned", r->out.services_returned); - ndr->depth++; - ndr_print_uint32(ndr, "services_returned", *r->out.services_returned); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_OpenSCManagerA(struct ndr_push *ndr, int flags, const struct svcctl_OpenSCManagerA *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.MachineName)); - if (r->in.MachineName) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.MachineName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.MachineName, ndr_charset_length(r->in.MachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DatabaseName)); - if (r->in.DatabaseName) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DatabaseName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DatabaseName, ndr_charset_length(r->in.DatabaseName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_OpenSCManagerA(struct ndr_pull *ndr, int flags, struct svcctl_OpenSCManagerA *r) -{ - uint32_t _ptr_MachineName; - uint32_t _ptr_DatabaseName; - TALLOC_CTX *_mem_save_MachineName_0; - TALLOC_CTX *_mem_save_DatabaseName_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_MachineName)); - if (_ptr_MachineName) { - NDR_PULL_ALLOC(ndr, r->in.MachineName); - } else { - r->in.MachineName = NULL; - } - if (r->in.MachineName) { - _mem_save_MachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.MachineName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.MachineName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.MachineName)); - if (ndr_get_array_length(ndr, &r->in.MachineName) > ndr_get_array_size(ndr, &r->in.MachineName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.MachineName), ndr_get_array_length(ndr, &r->in.MachineName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.MachineName, ndr_get_array_length(ndr, &r->in.MachineName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_MachineName_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DatabaseName)); - if (_ptr_DatabaseName) { - NDR_PULL_ALLOC(ndr, r->in.DatabaseName); - } else { - r->in.DatabaseName = NULL; - } - if (r->in.DatabaseName) { - _mem_save_DatabaseName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.DatabaseName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DatabaseName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DatabaseName)); - if (ndr_get_array_length(ndr, &r->in.DatabaseName) > ndr_get_array_size(ndr, &r->in.DatabaseName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DatabaseName), ndr_get_array_length(ndr, &r->in.DatabaseName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DatabaseName, ndr_get_array_length(ndr, &r->in.DatabaseName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DatabaseName_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_OpenSCManagerA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerA *r) -{ - ndr_print_struct(ndr, name, "svcctl_OpenSCManagerA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_OpenSCManagerA"); - ndr->depth++; - ndr_print_ptr(ndr, "MachineName", r->in.MachineName); - ndr->depth++; - if (r->in.MachineName) { - ndr_print_string(ndr, "MachineName", r->in.MachineName); - } - ndr->depth--; - ndr_print_ptr(ndr, "DatabaseName", r->in.DatabaseName); - ndr->depth++; - if (r->in.DatabaseName) { - ndr_print_string(ndr, "DatabaseName", r->in.DatabaseName); - } - ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_OpenSCManagerA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ServiceName)); - if (r->in.ServiceName) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_OpenServiceA(struct ndr_pull *ndr, int flags, struct svcctl_OpenServiceA *r) -{ - uint32_t _ptr_ServiceName; - TALLOC_CTX *_mem_save_scmanager_handle_0; - TALLOC_CTX *_mem_save_ServiceName_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.scmanager_handle); - } - _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ServiceName)); - if (_ptr_ServiceName) { - NDR_PULL_ALLOC(ndr, r->in.ServiceName); - } else { - r->in.ServiceName = NULL; - } - if (r->in.ServiceName) { - _mem_save_ServiceName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.ServiceName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName)); - if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ServiceName_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_OpenServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceA *r) -{ - ndr_print_struct(ndr, name, "svcctl_OpenServiceA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_OpenServiceA"); - ndr->depth++; - ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle); - ndr->depth--; - ndr_print_ptr(ndr, "ServiceName", r->in.ServiceName); - ndr->depth++; - if (r->in.ServiceName) { - ndr_print_string(ndr, "ServiceName", r->in.ServiceName); - } - ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_OpenServiceA"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfigA(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfigA *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - } - if (flags & NDR_OUT) { - NDR_PULL_ALLOC_N(ndr, r->out.query, r->in.buf_size); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.query, r->in.buf_size)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_QueryServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigA *r) -{ - ndr_print_struct(ndr, name, "svcctl_QueryServiceConfigA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfigA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfigA"); - ndr->depth++; - ndr_print_array_uint8(ndr, "query", r->out.query, r->in.buf_size); - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_QueryServiceLockStatusA(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceLockStatusA *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_lock_status_0; - TALLOC_CTX *_mem_save_required_buf_size_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_PULL_ALLOC(ndr, r->out.lock_status); - ZERO_STRUCTP(r->out.lock_status); - NDR_PULL_ALLOC(ndr, r->out.required_buf_size); - ZERO_STRUCTP(r->out.required_buf_size); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.lock_status); - } - _mem_save_lock_status_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.lock_status, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_SERVICE_LOCK_STATUS(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.lock_status)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_status_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.required_buf_size); - } - _mem_save_required_buf_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.required_buf_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.required_buf_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_required_buf_size_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_QueryServiceLockStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusA *r) -{ - ndr_print_struct(ndr, name, "svcctl_QueryServiceLockStatusA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_QueryServiceLockStatusA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_QueryServiceLockStatusA"); - ndr->depth++; - ndr_print_ptr(ndr, "lock_status", r->out.lock_status); - ndr->depth++; - ndr_print_SERVICE_LOCK_STATUS(ndr, "lock_status", r->out.lock_status); - ndr->depth--; - ndr_print_ptr(ndr, "required_buf_size", r->out.required_buf_size); - ndr->depth++; - ndr_print_uint32(ndr, "required_buf_size", *r->out.required_buf_size); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.NumArgs)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Arguments)); - if (r->in.Arguments) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Arguments, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Arguments, ndr_charset_length(r->in.Arguments, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_StartServiceA(struct ndr_pull *ndr, int flags, struct svcctl_StartServiceA *r) -{ - uint32_t _ptr_Arguments; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_Arguments_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.NumArgs)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Arguments)); - if (_ptr_Arguments) { - NDR_PULL_ALLOC(ndr, r->in.Arguments); - } else { - r->in.Arguments = NULL; - } - if (r->in.Arguments) { - _mem_save_Arguments_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Arguments, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Arguments)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Arguments)); - if (ndr_get_array_length(ndr, &r->in.Arguments) > ndr_get_array_size(ndr, &r->in.Arguments)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Arguments), ndr_get_array_length(ndr, &r->in.Arguments)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Arguments, ndr_get_array_length(ndr, &r->in.Arguments), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Arguments_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_StartServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceA *r) -{ - ndr_print_struct(ndr, name, "svcctl_StartServiceA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_StartServiceA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "NumArgs", r->in.NumArgs); - ndr_print_ptr(ndr, "Arguments", r->in.Arguments); - ndr->depth++; - if (r->in.Arguments) { - ndr_print_string(ndr, "Arguments", r->in.Arguments); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_StartServiceA"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); - if (r->in.service_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_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.service_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length)); - if (r->in.display_name_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length)); - } - } - if (flags & NDR_OUT) { - if (r->out.display_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.display_name)); - if (*r->out.display_name) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); - if (r->out.display_name_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameA(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceDisplayNameA *r) -{ - uint32_t _ptr_service_name; - uint32_t _ptr_display_name; - uint32_t _ptr_display_name_length; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_service_name_0; - TALLOC_CTX *_mem_save_display_name_0; - TALLOC_CTX *_mem_save_display_name_1; - TALLOC_CTX *_mem_save_display_name_length_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); - if (_ptr_service_name) { - NDR_PULL_ALLOC(ndr, r->in.service_name); - } else { - r->in.service_name = NULL; - } - if (r->in.service_name) { - _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name)); - if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); - if (_ptr_display_name_length) { - NDR_PULL_ALLOC(ndr, r->in.display_name_length); - } else { - r->in.display_name_length = NULL; - } - if (r->in.display_name_length) { - _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.display_name); - ZERO_STRUCTP(r->out.display_name); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.display_name); - } - _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); - if (_ptr_display_name) { - NDR_PULL_ALLOC(ndr, *r->out.display_name); - } else { - *r->out.display_name = NULL; - } - if (*r->out.display_name) { - _mem_save_display_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.display_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name)); - if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.display_name), ndr_get_array_length(ndr, r->out.display_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); - if (_ptr_display_name_length) { - NDR_PULL_ALLOC(ndr, r->out.display_name_length); - } else { - r->out.display_name_length = NULL; - } - if (r->out.display_name_length) { - _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameA *r) -{ - ndr_print_struct(ndr, name, "svcctl_GetServiceDisplayNameA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_GetServiceDisplayNameA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "service_name", r->in.service_name); - ndr->depth++; - if (r->in.service_name) { - ndr_print_string(ndr, "service_name", r->in.service_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length); - ndr->depth++; - if (r->in.display_name_length) { - ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_GetServiceDisplayNameA"); - ndr->depth++; - ndr_print_ptr(ndr, "display_name", r->out.display_name); - ndr->depth++; - ndr_print_ptr(ndr, "display_name", *r->out.display_name); - ndr->depth++; - if (*r->out.display_name) { - ndr_print_string(ndr, "display_name", *r->out.display_name); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); - ndr->depth++; - if (r->out.display_name_length) { - ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_name)); - if (r->in.service_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_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.service_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_name, ndr_charset_length(r->in.service_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name_length)); - if (r->in.display_name_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.display_name_length)); - } - } - if (flags & NDR_OUT) { - if (r->out.key_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_name)); - if (*r->out.key_name) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); - if (r->out.display_name_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameA(struct ndr_pull *ndr, int flags, struct svcctl_GetServiceKeyNameA *r) -{ - uint32_t _ptr_service_name; - uint32_t _ptr_key_name; - uint32_t _ptr_display_name_length; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_service_name_0; - TALLOC_CTX *_mem_save_key_name_0; - TALLOC_CTX *_mem_save_key_name_1; - TALLOC_CTX *_mem_save_display_name_length_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name)); - if (_ptr_service_name) { - NDR_PULL_ALLOC(ndr, r->in.service_name); - } else { - r->in.service_name = NULL; - } - if (r->in.service_name) { - _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.service_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_name)); - if (ndr_get_array_length(ndr, &r->in.service_name) > ndr_get_array_size(ndr, &r->in.service_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_name), ndr_get_array_length(ndr, &r->in.service_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_name, ndr_get_array_length(ndr, &r->in.service_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); - if (_ptr_display_name_length) { - NDR_PULL_ALLOC(ndr, r->in.display_name_length); - } else { - r->in.display_name_length = NULL; - } - if (r->in.display_name_length) { - _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.display_name_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.key_name); - ZERO_STRUCTP(r->out.key_name); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.key_name); - } - _mem_save_key_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.key_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_name)); - if (_ptr_key_name) { - NDR_PULL_ALLOC(ndr, *r->out.key_name); - } else { - *r->out.key_name = NULL; - } - if (*r->out.key_name) { - _mem_save_key_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name)); - if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.key_name), ndr_get_array_length(ndr, r->out.key_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); - if (_ptr_display_name_length) { - NDR_PULL_ALLOC(ndr, r->out.display_name_length); - } else { - r->out.display_name_length = NULL; - } - if (r->out.display_name_length) { - _mem_save_display_name_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.display_name_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_length_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_GetServiceKeyNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameA *r) -{ - ndr_print_struct(ndr, name, "svcctl_GetServiceKeyNameA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_GetServiceKeyNameA"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "service_name", r->in.service_name); - ndr->depth++; - if (r->in.service_name) { - ndr_print_string(ndr, "service_name", r->in.service_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "display_name_length", r->in.display_name_length); - ndr->depth++; - if (r->in.display_name_length) { - ndr_print_uint32(ndr, "display_name_length", *r->in.display_name_length); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_GetServiceKeyNameA"); - ndr->depth++; - ndr_print_ptr(ndr, "key_name", r->out.key_name); - ndr->depth++; - ndr_print_ptr(ndr, "key_name", *r->out.key_name); - ndr->depth++; - if (*r->out.key_name) { - ndr_print_string(ndr, "key_name", *r->out.key_name); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); - ndr->depth++; - if (r->out.display_name_length) { - ndr_print_uint32(ndr, "display_name_length", *r->out.display_name_length); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_GetCurrentGroupeStateW(struct ndr_push *ndr, int flags, const struct svcctl_GetCurrentGroupeStateW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_GetCurrentGroupeStateW(struct ndr_pull *ndr, int flags, struct svcctl_GetCurrentGroupeStateW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_GetCurrentGroupeStateW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetCurrentGroupeStateW *r) -{ - ndr_print_struct(ndr, name, "svcctl_GetCurrentGroupeStateW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_GetCurrentGroupeStateW"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_GetCurrentGroupeStateW"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_EnumServiceGroupW(struct ndr_push *ndr, int flags, const struct svcctl_EnumServiceGroupW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_EnumServiceGroupW(struct ndr_pull *ndr, int flags, struct svcctl_EnumServiceGroupW *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_EnumServiceGroupW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServiceGroupW *r) -{ - ndr_print_struct(ndr, name, "svcctl_EnumServiceGroupW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_EnumServiceGroupW"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_EnumServiceGroupW"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - if (r->in.info) { - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.info)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfig2A(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfig2A *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->in.info); - } else { - r->in.info = NULL; - } - if (r->in.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_ChangeServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2A *r) -{ - ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfig2A"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfig2A"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "info_level", r->in.info_level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - if (r->in.info) { - ndr_print_uint8(ndr, "info", *r->in.info); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfig2A"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - if (r->in.info) { - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.info)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfig2W(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfig2W *r) -{ - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->in.info); - } else { - r->in.info = NULL; - } - if (r->in.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_ChangeServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2W *r) -{ - ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfig2W"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfig2W"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "info_level", r->in.info_level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - if (r->in.info) { - ndr_print_uint8(ndr, "info", *r->in.info); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfig2W"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfig2A(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfig2A *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - } - if (flags & NDR_OUT) { - NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buf_size); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buf_size)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2A *r) -{ - ndr_print_struct(ndr, name, "svcctl_QueryServiceConfig2A"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfig2A"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "info_level", r->in.info_level); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfig2A"); - ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buf_size); - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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) { - if (r->out.buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buf_size)); - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfig2W(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfig2W *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - if (r->in.buf_size < 0 || r->in.buf_size > 8192) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buf_size); - memset(r->out.buffer, 0, (r->in.buf_size) * sizeof(*r->out.buffer)); - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 8192) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.buf_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_QueryServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2W *r) -{ - ndr_print_struct(ndr, name, "svcctl_QueryServiceConfig2W"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_QueryServiceConfig2W"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "info_level", r->in.info_level); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfig2W"); - ndr->depth++; - ndr_print_ptr(ndr, "buffer", r->out.buffer); - ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buf_size); - ndr->depth--; - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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) { - if (r->out.buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buf_size)); - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_QueryServiceStatusEx(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceStatusEx *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - if (r->in.buf_size < 0 || r->in.buf_size > 8192) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buf_size); - memset(r->out.buffer, 0, (r->in.buf_size) * sizeof(*r->out.buffer)); - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 8192) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.buf_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_QueryServiceStatusEx(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatusEx *r) -{ - ndr_print_struct(ndr, name, "svcctl_QueryServiceStatusEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_QueryServiceStatusEx"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "info_level", r->in.info_level); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_QueryServiceStatusEx"); - ndr->depth++; - ndr_print_ptr(ndr, "buffer", r->out.buffer); - ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buf_size); - ndr->depth--; - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_EnumServicesStatusExA(struct ndr_push *ndr, int flags, const struct EnumServicesStatusExA *r) -{ - if (flags & NDR_IN) { - 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, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.state)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - 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 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 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.group_name)); - if (*r->out.group_name) { - 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.group_name, ndr_charset_length(*r->out.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_EnumServicesStatusExA(struct ndr_pull *ndr, int flags, struct EnumServicesStatusExA *r) -{ - uint32_t _ptr_resume_handle; - uint32_t _ptr_group_name; - TALLOC_CTX *_mem_save_scmanager_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - TALLOC_CTX *_mem_save_service_returned_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_group_name_0; - TALLOC_CTX *_mem_save_group_name_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.scmanager); - } - _mem_save_scmanager_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - NDR_PULL_ALLOC(ndr, r->out.service_returned); - ZERO_STRUCTP(r->out.service_returned); - NDR_PULL_ALLOC(ndr, r->out.group_name); - ZERO_STRUCTP(r->out.group_name); - } - if (flags & NDR_OUT) { - NDR_PULL_ALLOC_N(ndr, r->out.services, r->in.buf_size); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.services, r->in.buf_size)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.service_returned); - } - _mem_save_service_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.service_returned, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.service_returned)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_returned_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.group_name); - } - _mem_save_group_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.group_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_name)); - if (_ptr_group_name) { - NDR_PULL_ALLOC(ndr, *r->out.group_name); - } else { - *r->out.group_name = NULL; - } - if (*r->out.group_name) { - _mem_save_group_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.group_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.group_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.group_name)); - if (ndr_get_array_length(ndr, r->out.group_name) > ndr_get_array_size(ndr, r->out.group_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.group_name), ndr_get_array_length(ndr, r->out.group_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.group_name, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_EnumServicesStatusExA(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExA *r) -{ - ndr_print_struct(ndr, name, "EnumServicesStatusExA"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "EnumServicesStatusExA"); - ndr->depth++; - ndr_print_ptr(ndr, "scmanager", r->in.scmanager); - ndr->depth++; - ndr_print_policy_handle(ndr, "scmanager", r->in.scmanager); - ndr->depth--; - ndr_print_uint32(ndr, "info_level", r->in.info_level); - ndr_print_uint32(ndr, "type", r->in.type); - ndr_print_uint32(ndr, "state", r->in.state); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "EnumServicesStatusExA"); - ndr->depth++; - ndr_print_array_uint8(ndr, "services", r->out.services, r->in.buf_size); - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_ptr(ndr, "service_returned", r->out.service_returned); - ndr->depth++; - ndr_print_uint32(ndr, "service_returned", *r->out.service_returned); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_ptr(ndr, "group_name", r->out.group_name); - ndr->depth++; - ndr_print_ptr(ndr, "group_name", *r->out.group_name); - ndr->depth++; - if (*r->out.group_name) { - ndr_print_string(ndr, "group_name", *r->out.group_name); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_EnumServicesStatusExW(struct ndr_push *ndr, int flags, const struct EnumServicesStatusExW *r) -{ - if (flags & NDR_IN) { - 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, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.state)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.group_name)); - if (r->in.group_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.group_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.group_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.group_name, ndr_charset_length(r->in.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - if (r->out.services == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.services, r->in.buf_size)); - 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 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)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_EnumServicesStatusExW(struct ndr_pull *ndr, int flags, struct EnumServicesStatusExW *r) -{ - uint32_t _ptr_resume_handle; - uint32_t _ptr_group_name; - TALLOC_CTX *_mem_save_scmanager_0; - TALLOC_CTX *_mem_save_bytes_needed_0; - TALLOC_CTX *_mem_save_service_returned_0; - TALLOC_CTX *_mem_save_resume_handle_0; - TALLOC_CTX *_mem_save_group_name_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.scmanager); - } - _mem_save_scmanager_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.info_level)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); - if (r->in.buf_size < 0 || r->in.buf_size > 262144) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - if (*r->in.resume_handle < 0 || *r->in.resume_handle > 262144) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_name)); - if (_ptr_group_name) { - NDR_PULL_ALLOC(ndr, r->in.group_name); - } else { - r->in.group_name = NULL; - } - if (r->in.group_name) { - _mem_save_group_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.group_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.group_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.group_name)); - if (ndr_get_array_length(ndr, &r->in.group_name) > ndr_get_array_size(ndr, &r->in.group_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.group_name), ndr_get_array_length(ndr, &r->in.group_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.group_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.group_name, ndr_get_array_length(ndr, &r->in.group_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_0, 0); - } - NDR_PULL_ALLOC_N(ndr, r->out.services, r->in.buf_size); - memset(r->out.services, 0, (r->in.buf_size) * sizeof(*r->out.services)); - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - ZERO_STRUCTP(r->out.bytes_needed); - NDR_PULL_ALLOC(ndr, r->out.service_returned); - ZERO_STRUCTP(r->out.service_returned); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.services)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.services, ndr_get_array_size(ndr, &r->out.services)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.services, ndr_get_array_size(ndr, &r->out.services))); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.bytes_needed); - } - _mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed)); - if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 262144) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.service_returned); - } - _mem_save_service_returned_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.service_returned, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.service_returned)); - if (*r->out.service_returned < 0 || *r->out.service_returned > 262144) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_returned_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - if (*r->out.resume_handle < 0 || *r->out.resume_handle > 262144) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.services) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.services, r->in.buf_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_EnumServicesStatusExW(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExW *r) -{ - ndr_print_struct(ndr, name, "EnumServicesStatusExW"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "EnumServicesStatusExW"); - ndr->depth++; - ndr_print_ptr(ndr, "scmanager", r->in.scmanager); - ndr->depth++; - ndr_print_policy_handle(ndr, "scmanager", r->in.scmanager); - ndr->depth--; - ndr_print_uint32(ndr, "info_level", r->in.info_level); - ndr_print_uint32(ndr, "type", r->in.type); - ndr_print_uint32(ndr, "state", r->in.state); - ndr_print_uint32(ndr, "buf_size", r->in.buf_size); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr_print_ptr(ndr, "group_name", r->in.group_name); - ndr->depth++; - if (r->in.group_name) { - ndr_print_string(ndr, "group_name", r->in.group_name); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "EnumServicesStatusExW"); - ndr->depth++; - ndr_print_ptr(ndr, "services", r->out.services); - ndr->depth++; - ndr_print_array_uint8(ndr, "services", r->out.services, r->in.buf_size); - ndr->depth--; - ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed); - ndr->depth++; - ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed); - ndr->depth--; - ndr_print_ptr(ndr, "service_returned", r->out.service_returned); - ndr->depth++; - ndr_print_uint32(ndr, "service_returned", *r->out.service_returned); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_svcctl_SCSendTSMessage(struct ndr_push *ndr, int flags, const struct svcctl_SCSendTSMessage *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_svcctl_SCSendTSMessage(struct ndr_pull *ndr, int flags, struct svcctl_SCSendTSMessage *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_svcctl_SCSendTSMessage(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSendTSMessage *r) -{ - ndr_print_struct(ndr, name, "svcctl_SCSendTSMessage"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "svcctl_SCSendTSMessage"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "svcctl_SCSendTSMessage"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call svcctl_calls[] = { - { - "svcctl_CloseServiceHandle", - sizeof(struct svcctl_CloseServiceHandle), - (ndr_push_flags_fn_t) ndr_push_svcctl_CloseServiceHandle, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_CloseServiceHandle, - (ndr_print_function_t) ndr_print_svcctl_CloseServiceHandle, - false, - }, - { - "svcctl_ControlService", - sizeof(struct svcctl_ControlService), - (ndr_push_flags_fn_t) ndr_push_svcctl_ControlService, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_ControlService, - (ndr_print_function_t) ndr_print_svcctl_ControlService, - false, - }, - { - "svcctl_DeleteService", - sizeof(struct svcctl_DeleteService), - (ndr_push_flags_fn_t) ndr_push_svcctl_DeleteService, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_DeleteService, - (ndr_print_function_t) ndr_print_svcctl_DeleteService, - false, - }, - { - "svcctl_LockServiceDatabase", - sizeof(struct svcctl_LockServiceDatabase), - (ndr_push_flags_fn_t) ndr_push_svcctl_LockServiceDatabase, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_LockServiceDatabase, - (ndr_print_function_t) ndr_print_svcctl_LockServiceDatabase, - false, - }, - { - "svcctl_QueryServiceObjectSecurity", - sizeof(struct svcctl_QueryServiceObjectSecurity), - (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceObjectSecurity, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceObjectSecurity, - (ndr_print_function_t) ndr_print_svcctl_QueryServiceObjectSecurity, - false, - }, - { - "svcctl_SetServiceObjectSecurity", - sizeof(struct svcctl_SetServiceObjectSecurity), - (ndr_push_flags_fn_t) ndr_push_svcctl_SetServiceObjectSecurity, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_SetServiceObjectSecurity, - (ndr_print_function_t) ndr_print_svcctl_SetServiceObjectSecurity, - false, - }, - { - "svcctl_QueryServiceStatus", - sizeof(struct svcctl_QueryServiceStatus), - (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceStatus, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceStatus, - (ndr_print_function_t) ndr_print_svcctl_QueryServiceStatus, - false, - }, - { - "svcctl_SetServiceStatus", - sizeof(struct svcctl_SetServiceStatus), - (ndr_push_flags_fn_t) ndr_push_svcctl_SetServiceStatus, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_SetServiceStatus, - (ndr_print_function_t) ndr_print_svcctl_SetServiceStatus, - false, - }, - { - "svcctl_UnlockServiceDatabase", - sizeof(struct svcctl_UnlockServiceDatabase), - (ndr_push_flags_fn_t) ndr_push_svcctl_UnlockServiceDatabase, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_UnlockServiceDatabase, - (ndr_print_function_t) ndr_print_svcctl_UnlockServiceDatabase, - false, - }, - { - "svcctl_NotifyBootConfigStatus", - sizeof(struct svcctl_NotifyBootConfigStatus), - (ndr_push_flags_fn_t) ndr_push_svcctl_NotifyBootConfigStatus, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_NotifyBootConfigStatus, - (ndr_print_function_t) ndr_print_svcctl_NotifyBootConfigStatus, - false, - }, - { - "svcctl_SCSetServiceBitsW", - sizeof(struct svcctl_SCSetServiceBitsW), - (ndr_push_flags_fn_t) ndr_push_svcctl_SCSetServiceBitsW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSetServiceBitsW, - (ndr_print_function_t) ndr_print_svcctl_SCSetServiceBitsW, - false, - }, - { - "svcctl_ChangeServiceConfigW", - sizeof(struct svcctl_ChangeServiceConfigW), - (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfigW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfigW, - (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfigW, - false, - }, - { - "svcctl_CreateServiceW", - sizeof(struct svcctl_CreateServiceW), - (ndr_push_flags_fn_t) ndr_push_svcctl_CreateServiceW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_CreateServiceW, - (ndr_print_function_t) ndr_print_svcctl_CreateServiceW, - false, - }, - { - "svcctl_EnumDependentServicesW", - sizeof(struct svcctl_EnumDependentServicesW), - (ndr_push_flags_fn_t) ndr_push_svcctl_EnumDependentServicesW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumDependentServicesW, - (ndr_print_function_t) ndr_print_svcctl_EnumDependentServicesW, - false, - }, - { - "svcctl_EnumServicesStatusW", - sizeof(struct svcctl_EnumServicesStatusW), - (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServicesStatusW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServicesStatusW, - (ndr_print_function_t) ndr_print_svcctl_EnumServicesStatusW, - false, - }, - { - "svcctl_OpenSCManagerW", - sizeof(struct svcctl_OpenSCManagerW), - (ndr_push_flags_fn_t) ndr_push_svcctl_OpenSCManagerW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenSCManagerW, - (ndr_print_function_t) ndr_print_svcctl_OpenSCManagerW, - false, - }, - { - "svcctl_OpenServiceW", - sizeof(struct svcctl_OpenServiceW), - (ndr_push_flags_fn_t) ndr_push_svcctl_OpenServiceW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenServiceW, - (ndr_print_function_t) ndr_print_svcctl_OpenServiceW, - false, - }, - { - "svcctl_QueryServiceConfigW", - sizeof(struct svcctl_QueryServiceConfigW), - (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfigW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfigW, - (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfigW, - false, - }, - { - "svcctl_QueryServiceLockStatusW", - sizeof(struct svcctl_QueryServiceLockStatusW), - (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceLockStatusW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceLockStatusW, - (ndr_print_function_t) ndr_print_svcctl_QueryServiceLockStatusW, - false, - }, - { - "svcctl_StartServiceW", - sizeof(struct svcctl_StartServiceW), - (ndr_push_flags_fn_t) ndr_push_svcctl_StartServiceW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_StartServiceW, - (ndr_print_function_t) ndr_print_svcctl_StartServiceW, - false, - }, - { - "svcctl_GetServiceDisplayNameW", - sizeof(struct svcctl_GetServiceDisplayNameW), - (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceDisplayNameW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceDisplayNameW, - (ndr_print_function_t) ndr_print_svcctl_GetServiceDisplayNameW, - false, - }, - { - "svcctl_GetServiceKeyNameW", - sizeof(struct svcctl_GetServiceKeyNameW), - (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceKeyNameW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceKeyNameW, - (ndr_print_function_t) ndr_print_svcctl_GetServiceKeyNameW, - false, - }, - { - "svcctl_SCSetServiceBitsA", - sizeof(struct svcctl_SCSetServiceBitsA), - (ndr_push_flags_fn_t) ndr_push_svcctl_SCSetServiceBitsA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSetServiceBitsA, - (ndr_print_function_t) ndr_print_svcctl_SCSetServiceBitsA, - false, - }, - { - "svcctl_ChangeServiceConfigA", - sizeof(struct svcctl_ChangeServiceConfigA), - (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfigA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfigA, - (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfigA, - false, - }, - { - "svcctl_CreateServiceA", - sizeof(struct svcctl_CreateServiceA), - (ndr_push_flags_fn_t) ndr_push_svcctl_CreateServiceA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_CreateServiceA, - (ndr_print_function_t) ndr_print_svcctl_CreateServiceA, - false, - }, - { - "svcctl_EnumDependentServicesA", - sizeof(struct svcctl_EnumDependentServicesA), - (ndr_push_flags_fn_t) ndr_push_svcctl_EnumDependentServicesA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumDependentServicesA, - (ndr_print_function_t) ndr_print_svcctl_EnumDependentServicesA, - false, - }, - { - "svcctl_EnumServicesStatusA", - sizeof(struct svcctl_EnumServicesStatusA), - (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServicesStatusA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServicesStatusA, - (ndr_print_function_t) ndr_print_svcctl_EnumServicesStatusA, - false, - }, - { - "svcctl_OpenSCManagerA", - sizeof(struct svcctl_OpenSCManagerA), - (ndr_push_flags_fn_t) ndr_push_svcctl_OpenSCManagerA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenSCManagerA, - (ndr_print_function_t) ndr_print_svcctl_OpenSCManagerA, - false, - }, - { - "svcctl_OpenServiceA", - sizeof(struct svcctl_OpenServiceA), - (ndr_push_flags_fn_t) ndr_push_svcctl_OpenServiceA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_OpenServiceA, - (ndr_print_function_t) ndr_print_svcctl_OpenServiceA, - false, - }, - { - "svcctl_QueryServiceConfigA", - sizeof(struct svcctl_QueryServiceConfigA), - (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfigA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfigA, - (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfigA, - false, - }, - { - "svcctl_QueryServiceLockStatusA", - sizeof(struct svcctl_QueryServiceLockStatusA), - (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceLockStatusA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceLockStatusA, - (ndr_print_function_t) ndr_print_svcctl_QueryServiceLockStatusA, - false, - }, - { - "svcctl_StartServiceA", - sizeof(struct svcctl_StartServiceA), - (ndr_push_flags_fn_t) ndr_push_svcctl_StartServiceA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_StartServiceA, - (ndr_print_function_t) ndr_print_svcctl_StartServiceA, - false, - }, - { - "svcctl_GetServiceDisplayNameA", - sizeof(struct svcctl_GetServiceDisplayNameA), - (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceDisplayNameA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceDisplayNameA, - (ndr_print_function_t) ndr_print_svcctl_GetServiceDisplayNameA, - false, - }, - { - "svcctl_GetServiceKeyNameA", - sizeof(struct svcctl_GetServiceKeyNameA), - (ndr_push_flags_fn_t) ndr_push_svcctl_GetServiceKeyNameA, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetServiceKeyNameA, - (ndr_print_function_t) ndr_print_svcctl_GetServiceKeyNameA, - false, - }, - { - "svcctl_GetCurrentGroupeStateW", - sizeof(struct svcctl_GetCurrentGroupeStateW), - (ndr_push_flags_fn_t) ndr_push_svcctl_GetCurrentGroupeStateW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_GetCurrentGroupeStateW, - (ndr_print_function_t) ndr_print_svcctl_GetCurrentGroupeStateW, - false, - }, - { - "svcctl_EnumServiceGroupW", - sizeof(struct svcctl_EnumServiceGroupW), - (ndr_push_flags_fn_t) ndr_push_svcctl_EnumServiceGroupW, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_EnumServiceGroupW, - (ndr_print_function_t) ndr_print_svcctl_EnumServiceGroupW, - false, - }, - { - "svcctl_ChangeServiceConfig2A", - sizeof(struct svcctl_ChangeServiceConfig2A), - (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfig2A, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfig2A, - (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfig2A, - false, - }, - { - "svcctl_ChangeServiceConfig2W", - sizeof(struct svcctl_ChangeServiceConfig2W), - (ndr_push_flags_fn_t) ndr_push_svcctl_ChangeServiceConfig2W, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_ChangeServiceConfig2W, - (ndr_print_function_t) ndr_print_svcctl_ChangeServiceConfig2W, - false, - }, - { - "svcctl_QueryServiceConfig2A", - sizeof(struct svcctl_QueryServiceConfig2A), - (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfig2A, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfig2A, - (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfig2A, - false, - }, - { - "svcctl_QueryServiceConfig2W", - sizeof(struct svcctl_QueryServiceConfig2W), - (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceConfig2W, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceConfig2W, - (ndr_print_function_t) ndr_print_svcctl_QueryServiceConfig2W, - false, - }, - { - "svcctl_QueryServiceStatusEx", - sizeof(struct svcctl_QueryServiceStatusEx), - (ndr_push_flags_fn_t) ndr_push_svcctl_QueryServiceStatusEx, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_QueryServiceStatusEx, - (ndr_print_function_t) ndr_print_svcctl_QueryServiceStatusEx, - false, - }, - { - "EnumServicesStatusExA", - sizeof(struct EnumServicesStatusExA), - (ndr_push_flags_fn_t) ndr_push_EnumServicesStatusExA, - (ndr_pull_flags_fn_t) ndr_pull_EnumServicesStatusExA, - (ndr_print_function_t) ndr_print_EnumServicesStatusExA, - false, - }, - { - "EnumServicesStatusExW", - sizeof(struct EnumServicesStatusExW), - (ndr_push_flags_fn_t) ndr_push_EnumServicesStatusExW, - (ndr_pull_flags_fn_t) ndr_pull_EnumServicesStatusExW, - (ndr_print_function_t) ndr_print_EnumServicesStatusExW, - false, - }, - { - "svcctl_SCSendTSMessage", - sizeof(struct svcctl_SCSendTSMessage), - (ndr_push_flags_fn_t) ndr_push_svcctl_SCSendTSMessage, - (ndr_pull_flags_fn_t) ndr_pull_svcctl_SCSendTSMessage, - (ndr_print_function_t) ndr_print_svcctl_SCSendTSMessage, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const svcctl_endpoint_strings[] = { - "ncacn_np:[\\pipe\\svcctl]", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array svcctl_endpoints = { - .count = 2, - .names = svcctl_endpoint_strings -}; - -static const char * const svcctl_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array svcctl_authservices = { - .count = 1, - .names = svcctl_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_svcctl = { - .name = "svcctl", - .syntax_id = { - {0x367abb81,0x9844,0x35f1,{0xad,0x32},{0x98,0xf0,0x38,0x00,0x10,0x03}}, - NDR_SVCCTL_VERSION - }, - .helpstring = NDR_SVCCTL_HELPSTRING, - .num_calls = 44, - .calls = svcctl_calls, - .endpoints = &svcctl_endpoints, - .authservices = &svcctl_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_svcctl.h b/source3/librpc/gen_ndr/ndr_svcctl.h deleted file mode 100644 index 8d7739a7db..0000000000 --- a/source3/librpc/gen_ndr/ndr_svcctl.h +++ /dev/null @@ -1,160 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/svcctl.h" - -#ifndef _HEADER_NDR_svcctl -#define _HEADER_NDR_svcctl - -#define NDR_SVCCTL_UUID "367abb81-9844-35f1-ad32-98f038001003" -#define NDR_SVCCTL_VERSION 2.0 -#define NDR_SVCCTL_NAME "svcctl" -#define NDR_SVCCTL_HELPSTRING "Service Control" -extern const struct ndr_interface_table ndr_table_svcctl; -#define NDR_SVCCTL_CLOSESERVICEHANDLE (0x00) - -#define NDR_SVCCTL_CONTROLSERVICE (0x01) - -#define NDR_SVCCTL_DELETESERVICE (0x02) - -#define NDR_SVCCTL_LOCKSERVICEDATABASE (0x03) - -#define NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY (0x04) - -#define NDR_SVCCTL_SETSERVICEOBJECTSECURITY (0x05) - -#define NDR_SVCCTL_QUERYSERVICESTATUS (0x06) - -#define NDR_SVCCTL_SETSERVICESTATUS (0x07) - -#define NDR_SVCCTL_UNLOCKSERVICEDATABASE (0x08) - -#define NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS (0x09) - -#define NDR_SVCCTL_SCSETSERVICEBITSW (0x0a) - -#define NDR_SVCCTL_CHANGESERVICECONFIGW (0x0b) - -#define NDR_SVCCTL_CREATESERVICEW (0x0c) - -#define NDR_SVCCTL_ENUMDEPENDENTSERVICESW (0x0d) - -#define NDR_SVCCTL_ENUMSERVICESSTATUSW (0x0e) - -#define NDR_SVCCTL_OPENSCMANAGERW (0x0f) - -#define NDR_SVCCTL_OPENSERVICEW (0x10) - -#define NDR_SVCCTL_QUERYSERVICECONFIGW (0x11) - -#define NDR_SVCCTL_QUERYSERVICELOCKSTATUSW (0x12) - -#define NDR_SVCCTL_STARTSERVICEW (0x13) - -#define NDR_SVCCTL_GETSERVICEDISPLAYNAMEW (0x14) - -#define NDR_SVCCTL_GETSERVICEKEYNAMEW (0x15) - -#define NDR_SVCCTL_SCSETSERVICEBITSA (0x16) - -#define NDR_SVCCTL_CHANGESERVICECONFIGA (0x17) - -#define NDR_SVCCTL_CREATESERVICEA (0x18) - -#define NDR_SVCCTL_ENUMDEPENDENTSERVICESA (0x19) - -#define NDR_SVCCTL_ENUMSERVICESSTATUSA (0x1a) - -#define NDR_SVCCTL_OPENSCMANAGERA (0x1b) - -#define NDR_SVCCTL_OPENSERVICEA (0x1c) - -#define NDR_SVCCTL_QUERYSERVICECONFIGA (0x1d) - -#define NDR_SVCCTL_QUERYSERVICELOCKSTATUSA (0x1e) - -#define NDR_SVCCTL_STARTSERVICEA (0x1f) - -#define NDR_SVCCTL_GETSERVICEDISPLAYNAMEA (0x20) - -#define NDR_SVCCTL_GETSERVICEKEYNAMEA (0x21) - -#define NDR_SVCCTL_GETCURRENTGROUPESTATEW (0x22) - -#define NDR_SVCCTL_ENUMSERVICEGROUPW (0x23) - -#define NDR_SVCCTL_CHANGESERVICECONFIG2A (0x24) - -#define NDR_SVCCTL_CHANGESERVICECONFIG2W (0x25) - -#define NDR_SVCCTL_QUERYSERVICECONFIG2A (0x26) - -#define NDR_SVCCTL_QUERYSERVICECONFIG2W (0x27) - -#define NDR_SVCCTL_QUERYSERVICESTATUSEX (0x28) - -#define NDR_ENUMSERVICESSTATUSEXA (0x29) - -#define NDR_ENUMSERVICESSTATUSEXW (0x2a) - -#define NDR_SVCCTL_SCSENDTSMESSAGE (0x2b) - -#define NDR_SVCCTL_CALL_COUNT (44) -void ndr_print_SERVICE_LOCK_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_LOCK_STATUS *r); -void ndr_print_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_STATUS *r); -void ndr_print_ENUM_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct ENUM_SERVICE_STATUS *r); -enum ndr_err_code ndr_push_svcctl_ServerType(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_svcctl_ServerType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_SERVICE_CONTROL(struct ndr_print *ndr, const char *name, enum SERVICE_CONTROL r); -void ndr_print_svcctl_MgrAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_flags, const struct QUERY_SERVICE_CONFIG *r); -enum ndr_err_code ndr_pull_QUERY_SERVICE_CONFIG(struct ndr_pull *ndr, int ndr_flags, struct QUERY_SERVICE_CONFIG *r); -void ndr_print_QUERY_SERVICE_CONFIG(struct ndr_print *ndr, const char *name, const struct QUERY_SERVICE_CONFIG *r); -size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG *r, int flags); -void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CloseServiceHandle *r); -void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ControlService *r); -void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_DeleteService *r); -void ndr_print_svcctl_LockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_LockServiceDatabase *r); -void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceObjectSecurity *r); -void ndr_print_svcctl_SetServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceObjectSecurity *r); -void ndr_print_svcctl_QueryServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatus *r); -void ndr_print_svcctl_SetServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceStatus *r); -void ndr_print_svcctl_UnlockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_UnlockServiceDatabase *r); -void ndr_print_svcctl_NotifyBootConfigStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_NotifyBootConfigStatus *r); -void ndr_print_svcctl_SCSetServiceBitsW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsW *r); -void ndr_print_svcctl_ChangeServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigW *r); -void ndr_print_svcctl_CreateServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceW *r); -void ndr_print_svcctl_EnumDependentServicesW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesW *r); -void ndr_print_svcctl_EnumServicesStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusW *r); -void ndr_print_svcctl_OpenSCManagerW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerW *r); -void ndr_print_svcctl_OpenServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceW *r); -void ndr_print_svcctl_QueryServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigW *r); -void ndr_print_svcctl_QueryServiceLockStatusW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusW *r); -void ndr_print_svcctl_StartServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceW *r); -void ndr_print_svcctl_GetServiceDisplayNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameW *r); -void ndr_print_svcctl_GetServiceKeyNameW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameW *r); -void ndr_print_svcctl_SCSetServiceBitsA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsA *r); -void ndr_print_svcctl_ChangeServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigA *r); -void ndr_print_svcctl_CreateServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceA *r); -void ndr_print_svcctl_EnumDependentServicesA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesA *r); -void ndr_print_svcctl_EnumServicesStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServicesStatusA *r); -void ndr_print_svcctl_OpenSCManagerA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenSCManagerA *r); -void ndr_print_svcctl_OpenServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_OpenServiceA *r); -void ndr_print_svcctl_QueryServiceConfigA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfigA *r); -void ndr_print_svcctl_QueryServiceLockStatusA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceLockStatusA *r); -void ndr_print_svcctl_StartServiceA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_StartServiceA *r); -void ndr_print_svcctl_GetServiceDisplayNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceDisplayNameA *r); -void ndr_print_svcctl_GetServiceKeyNameA(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetServiceKeyNameA *r); -void ndr_print_svcctl_GetCurrentGroupeStateW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_GetCurrentGroupeStateW *r); -void ndr_print_svcctl_EnumServiceGroupW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumServiceGroupW *r); -void ndr_print_svcctl_ChangeServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2A *r); -void ndr_print_svcctl_ChangeServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfig2W *r); -void ndr_print_svcctl_QueryServiceConfig2A(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2A *r); -void ndr_print_svcctl_QueryServiceConfig2W(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceConfig2W *r); -void ndr_print_svcctl_QueryServiceStatusEx(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatusEx *r); -void ndr_print_EnumServicesStatusExA(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExA *r); -void ndr_print_EnumServicesStatusExW(struct ndr_print *ndr, const char *name, int flags, const struct EnumServicesStatusExW *r); -void ndr_print_svcctl_SCSendTSMessage(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSendTSMessage *r); -#endif /* _HEADER_NDR_svcctl */ diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c deleted file mode 100644 index 791d11103d..0000000000 --- a/source3/librpc/gen_ndr/ndr_winreg.c +++ /dev/null @@ -1,4495 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_winreg.h" - -#include "librpc/gen_ndr/ndr_lsa.h" -#include "librpc/gen_ndr/ndr_security.h" -static enum ndr_err_code ndr_push_winreg_AccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_AccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_AccessMask(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_QUERY_VALUE", KEY_QUERY_VALUE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_SET_VALUE", KEY_SET_VALUE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_CREATE_SUB_KEY", KEY_CREATE_SUB_KEY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_ENUMERATE_SUB_KEYS", KEY_ENUMERATE_SUB_KEYS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_NOTIFY", KEY_NOTIFY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_CREATE_LINK", KEY_CREATE_LINK, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_WOW64_64KEY", KEY_WOW64_64KEY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KEY_WOW64_32KEY", KEY_WOW64_32KEY, r); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r) -{ - const char *val = NULL; - - switch (r) { - case REG_NONE: val = "REG_NONE"; break; - case REG_SZ: val = "REG_SZ"; break; - case REG_EXPAND_SZ: val = "REG_EXPAND_SZ"; break; - case REG_BINARY: val = "REG_BINARY"; break; - case REG_DWORD: val = "REG_DWORD"; break; - case REG_DWORD_BIG_ENDIAN: val = "REG_DWORD_BIG_ENDIAN"; break; - case REG_LINK: val = "REG_LINK"; break; - case REG_MULTI_SZ: val = "REG_MULTI_SZ"; break; - case REG_RESOURCE_LIST: val = "REG_RESOURCE_LIST"; break; - case REG_FULL_RESOURCE_DESCRIPTOR: val = "REG_FULL_RESOURCE_DESCRIPTOR"; break; - case REG_RESOURCE_REQUIREMENTS_LIST: val = "REG_RESOURCE_REQUIREMENTS_LIST"; break; - case REG_QWORD: val = "REG_QWORD"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -_PUBLIC_ enum ndr_err_code ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, const struct winreg_String *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, struct winreg_String *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_len)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_String(struct ndr_print *ndr, const char *name, const struct winreg_String *r) -{ - ndr_print_struct(ndr, name, "winreg_String"); - ndr->depth++; - ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->name_len); - ndr_print_uint16(ndr, "name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->name_size); - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_KeySecurityData(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityData *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->len)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_KeySecurityData(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityData *r) -{ - uint32_t _ptr_data; - TALLOC_CTX *_mem_save_data_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->data)); - if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data)); - } - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size)); - } - if (r->data) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->len)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_KeySecurityData(struct ndr_print *ndr, const char *name, const struct KeySecurityData *r) -{ - ndr_print_struct(ndr, name, "KeySecurityData"); - ndr->depth++; - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr_print_array_uint8(ndr, "data", r->data, r->len); - } - ndr->depth--; - ndr_print_uint32(ndr, "size", r->size); - ndr_print_uint32(ndr, "len", r->len); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_SecBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_SecBuf *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS, &r->sd)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->inherit)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sd)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_SecBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_SecBuf *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS, &r->sd)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->inherit)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sd)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, const struct winreg_SecBuf *r) -{ - ndr_print_struct(ndr, name, "winreg_SecBuf"); - ndr->depth++; - ndr_print_uint32(ndr, "length", r->length); - ndr_print_KeySecurityData(ndr, "sd", &r->sd); - ndr_print_uint8(ndr, "inherit", r->inherit); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_CreateAction(struct ndr_push *ndr, int ndr_flags, enum winreg_CreateAction r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_CreateAction(struct ndr_pull *ndr, int ndr_flags, enum winreg_CreateAction *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_CreateAction(struct ndr_print *ndr, const char *name, enum winreg_CreateAction r) -{ - const char *val = NULL; - - switch (r) { - case REG_ACTION_NONE: val = "REG_ACTION_NONE"; break; - case REG_CREATED_NEW_KEY: val = "REG_CREATED_NEW_KEY"; break; - case REG_OPENED_EXISTING_KEY: val = "REG_OPENED_EXISTING_KEY"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_winreg_StringBuf(struct ndr_push *ndr, int ndr_flags, const struct winreg_StringBuf *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->name) * 2 / 2)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, strlen_m_term(r->name) * 2 / 2, sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_StringBuf(struct ndr_pull *ndr, int ndr_flags, struct winreg_StringBuf *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->name) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->name, r->size / 2)); - } - if (r->name) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->name, r->length / 2)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name, const struct winreg_StringBuf *r) -{ - ndr_print_struct(ndr, name, "winreg_StringBuf"); - ndr->depth++; - ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name) * 2:r->length); - ndr_print_uint16(ndr, "size", r->size); - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_winreg_NotifyChangeType(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_NotifyChangeType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_NotifyChangeType(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_NAME", REG_NOTIFY_CHANGE_NAME, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_ATTRIBUTES", REG_NOTIFY_CHANGE_ATTRIBUTES, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_LAST_SET", REG_NOTIFY_CHANGE_LAST_SET, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_SECURITY", REG_NOTIFY_CHANGE_SECURITY, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_KeySecurityAttribute(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_size)); - NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS, &r->sec_data)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->inherit)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_KeySecurityAttribute(struct ndr_pull *ndr, int ndr_flags, struct KeySecurityAttribute *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_size)); - NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS, &r->sec_data)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->inherit)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_BUFFERS, &r->sec_data)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_KeySecurityAttribute(struct ndr_print *ndr, const char *name, const struct KeySecurityAttribute *r) -{ - ndr_print_struct(ndr, name, "KeySecurityAttribute"); - ndr->depth++; - ndr_print_uint32(ndr, "data_size", r->data_size); - ndr_print_KeySecurityData(ndr, "sec_data", &r->sec_data); - ndr_print_uint8(ndr, "inherit", r->inherit); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_QueryMultipleValue(struct ndr_push *ndr, int ndr_flags, const struct QueryMultipleValue *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->offset)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->name)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_QueryMultipleValue(struct ndr_pull *ndr, int ndr_flags, struct QueryMultipleValue *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->offset)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_QueryMultipleValue(struct ndr_print *ndr, const char *name, const struct QueryMultipleValue *r) -{ - ndr_print_struct(ndr, name, "QueryMultipleValue"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_winreg_String(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_winreg_Type(ndr, "type", r->type); - ndr_print_uint32(ndr, "offset", r->offset); - ndr_print_uint32(ndr, "length", r->length); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_OpenHKCR(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCR *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_OpenHKCR(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCR *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenHKCR(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCR *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenHKCR"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenHKCR"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenHKCR"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_OpenHKCU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCU *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_OpenHKCU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCU *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenHKCU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCU *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenHKCU"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenHKCU"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenHKCU"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenHKLM(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKLM *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenHKLM"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenHKLM"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenHKLM"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_OpenHKPD(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPD *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_OpenHKPD(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPD *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenHKPD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPD *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenHKPD"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenHKPD"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenHKPD"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_OpenHKU(struct ndr_push *ndr, int flags, const struct winreg_OpenHKU *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_OpenHKU(struct ndr_pull *ndr, int flags, struct winreg_OpenHKU *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenHKU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKU *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenHKU"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenHKU"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenHKU"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.handle); - *r->out.handle = *r->in.handle; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_CloseKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CloseKey *r) -{ - ndr_print_struct(ndr, name, "winreg_CloseKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_CloseKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_CloseKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.options)); - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.secdesc)); - if (r->in.secdesc) { - NDR_CHECK(ndr_push_winreg_SecBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.secdesc)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.action_taken)); - if (r->in.action_taken) { - NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, *r->in.action_taken)); - } - } - if (flags & NDR_OUT) { - 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, r->out.new_handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.action_taken)); - if (r->out.action_taken) { - NDR_CHECK(ndr_push_winreg_CreateAction(ndr, NDR_SCALARS, *r->out.action_taken)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r) -{ - uint32_t _ptr_secdesc; - uint32_t _ptr_action_taken; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_secdesc_0; - TALLOC_CTX *_mem_save_new_handle_0; - TALLOC_CTX *_mem_save_action_taken_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyclass)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.options)); - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); - if (_ptr_secdesc) { - NDR_PULL_ALLOC(ndr, r->in.secdesc); - } else { - r->in.secdesc = NULL; - } - if (r->in.secdesc) { - _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.secdesc, 0); - NDR_CHECK(ndr_pull_winreg_SecBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.secdesc)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_action_taken)); - if (_ptr_action_taken) { - NDR_PULL_ALLOC(ndr, r->in.action_taken); - } else { - r->in.action_taken = NULL; - } - if (r->in.action_taken) { - _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.action_taken, 0); - NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, r->in.action_taken)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.new_handle); - ZERO_STRUCTP(r->out.new_handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.new_handle); - } - _mem_save_new_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.new_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.new_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_action_taken)); - if (_ptr_action_taken) { - NDR_PULL_ALLOC(ndr, r->out.action_taken); - } else { - r->out.action_taken = NULL; - } - if (r->out.action_taken) { - _mem_save_action_taken_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.action_taken, 0); - NDR_CHECK(ndr_pull_winreg_CreateAction(ndr, NDR_SCALARS, r->out.action_taken)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_action_taken_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CreateKey *r) -{ - ndr_print_struct(ndr, name, "winreg_CreateKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_CreateKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_winreg_String(ndr, "name", &r->in.name); - ndr_print_winreg_String(ndr, "keyclass", &r->in.keyclass); - ndr_print_uint32(ndr, "options", r->in.options); - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr_print_ptr(ndr, "secdesc", r->in.secdesc); - ndr->depth++; - if (r->in.secdesc) { - ndr_print_winreg_SecBuf(ndr, "secdesc", r->in.secdesc); - } - ndr->depth--; - ndr_print_ptr(ndr, "action_taken", r->in.action_taken); - ndr->depth++; - if (r->in.action_taken) { - ndr_print_winreg_CreateAction(ndr, "action_taken", *r->in.action_taken); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_CreateKey"); - ndr->depth++; - ndr_print_ptr(ndr, "new_handle", r->out.new_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "new_handle", r->out.new_handle); - ndr->depth--; - ndr_print_ptr(ndr, "action_taken", r->out.action_taken); - ndr->depth++; - if (r->out.action_taken) { - ndr_print_winreg_CreateAction(ndr, "action_taken", *r->out.action_taken); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.key)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.key)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_DeleteKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteKey *r) -{ - ndr_print_struct(ndr, name, "winreg_DeleteKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_DeleteKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_winreg_String(ndr, "key", &r->in.key); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_DeleteKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_DeleteValue(struct ndr_pull *ndr, int flags, struct winreg_DeleteValue *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.value)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_DeleteValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteValue *r) -{ - ndr_print_struct(ndr, name, "winreg_DeleteValue"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_DeleteValue"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_winreg_String(ndr, "value", &r->in.value); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_DeleteValue"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index)); - 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) { - NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyclass)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.last_changed_time)); - if (r->in.last_changed_time) { - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->in.last_changed_time)); - } - } - if (flags & NDR_OUT) { - 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) { - NDR_CHECK(ndr_push_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.keyclass)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.last_changed_time)); - if (r->out.last_changed_time) { - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, *r->out.last_changed_time)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r) -{ - uint32_t _ptr_keyclass; - uint32_t _ptr_last_changed_time; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_keyclass_0; - TALLOC_CTX *_mem_save_last_changed_time_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.enum_index)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyclass)); - if (_ptr_keyclass) { - NDR_PULL_ALLOC(ndr, r->in.keyclass); - } else { - r->in.keyclass = NULL; - } - if (r->in.keyclass) { - _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.keyclass, 0); - NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyclass)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_last_changed_time)); - if (_ptr_last_changed_time) { - NDR_PULL_ALLOC(ndr, r->in.last_changed_time); - } else { - r->in.last_changed_time = NULL; - } - if (r->in.last_changed_time) { - _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.last_changed_time, 0); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->in.last_changed_time)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.name); - *r->out.name = *r->in.name; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyclass)); - if (_ptr_keyclass) { - NDR_PULL_ALLOC(ndr, r->out.keyclass); - } else { - r->out.keyclass = NULL; - } - if (r->out.keyclass) { - _mem_save_keyclass_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.keyclass, 0); - NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.keyclass)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyclass_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_last_changed_time)); - if (_ptr_last_changed_time) { - NDR_PULL_ALLOC(ndr, r->out.last_changed_time); - } else { - r->out.last_changed_time = NULL; - } - if (r->out.last_changed_time) { - _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, 0); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->out.last_changed_time)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumKey *r) -{ - ndr_print_struct(ndr, name, "winreg_EnumKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_EnumKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "enum_index", r->in.enum_index); - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - ndr_print_winreg_StringBuf(ndr, "name", r->in.name); - ndr->depth--; - ndr_print_ptr(ndr, "keyclass", r->in.keyclass); - ndr->depth++; - if (r->in.keyclass) { - ndr_print_winreg_StringBuf(ndr, "keyclass", r->in.keyclass); - } - ndr->depth--; - ndr_print_ptr(ndr, "last_changed_time", r->in.last_changed_time); - ndr->depth++; - if (r->in.last_changed_time) { - ndr_print_NTTIME(ndr, "last_changed_time", *r->in.last_changed_time); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_EnumKey"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->out.name); - ndr->depth++; - ndr_print_winreg_StringBuf(ndr, "name", r->out.name); - ndr->depth--; - ndr_print_ptr(ndr, "keyclass", r->out.keyclass); - ndr->depth++; - if (r->out.keyclass) { - ndr_print_winreg_StringBuf(ndr, "keyclass", r->out.keyclass); - } - ndr->depth--; - ndr_print_ptr(ndr, "last_changed_time", r->out.last_changed_time); - ndr->depth++; - if (r->out.last_changed_time) { - ndr_print_NTTIME(ndr, "last_changed_time", *r->out.last_changed_time); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.enum_index)); - 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.type)); - if (r->in.type) { - NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.type)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.value)); - if (r->in.value) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.value, *r->in.length)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.size)); - if (r->in.size) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.size)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.length)); - if (r->in.length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length)); - } - } - if (flags & NDR_OUT) { - 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.type)); - if (r->out.type) { - NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.value)); - if (r->out.value) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.value, *r->out.length)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.size)); - if (r->out.size) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.length)); - if (r->out.length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r) -{ - uint32_t _ptr_type; - uint32_t _ptr_value; - uint32_t _ptr_size; - uint32_t _ptr_length; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_name_0; - TALLOC_CTX *_mem_save_type_0; - TALLOC_CTX *_mem_save_value_0; - TALLOC_CTX *_mem_save_size_0; - TALLOC_CTX *_mem_save_length_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.enum_index)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type)); - if (_ptr_type) { - NDR_PULL_ALLOC(ndr, r->in.type); - } else { - r->in.type = NULL; - } - if (r->in.type) { - _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.type, 0); - NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->in.type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value)); - if (_ptr_value) { - NDR_PULL_ALLOC(ndr, r->in.value); - } else { - r->in.value = NULL; - } - if (r->in.value) { - _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.value, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.value)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.value)); - if (ndr_get_array_length(ndr, &r->in.value) > ndr_get_array_size(ndr, &r->in.value)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.value), ndr_get_array_length(ndr, &r->in.value)); - } - NDR_PULL_ALLOC_N(ndr, r->in.value, ndr_get_array_size(ndr, &r->in.value)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.value, ndr_get_array_length(ndr, &r->in.value))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size)); - if (_ptr_size) { - NDR_PULL_ALLOC(ndr, r->in.size); - } else { - r->in.size = NULL; - } - if (r->in.size) { - _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.size, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_length)); - if (_ptr_length) { - NDR_PULL_ALLOC(ndr, r->in.length); - } else { - r->in.length = NULL; - } - if (r->in.length) { - _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.name); - *r->out.name = *r->in.name; - if (r->in.value) { - 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 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)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.name); - } - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_StringBuf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type)); - if (_ptr_type) { - NDR_PULL_ALLOC(ndr, r->out.type); - } else { - r->out.type = NULL; - } - if (r->out.type) { - _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.type, 0); - NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value)); - if (_ptr_value) { - NDR_PULL_ALLOC(ndr, r->out.value); - } else { - r->out.value = NULL; - } - if (r->out.value) { - _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.value, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.value)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->out.value)); - if (ndr_get_array_length(ndr, &r->out.value) > ndr_get_array_size(ndr, &r->out.value)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.value), ndr_get_array_length(ndr, &r->out.value)); - } - NDR_PULL_ALLOC_N(ndr, r->out.value, ndr_get_array_size(ndr, &r->out.value)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.value, ndr_get_array_length(ndr, &r->out.value))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size)); - if (_ptr_size) { - NDR_PULL_ALLOC(ndr, r->out.size); - } else { - r->out.size = NULL; - } - if (r->out.size) { - _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.size, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_length)); - if (_ptr_length) { - NDR_PULL_ALLOC(ndr, r->out.length); - } else { - r->out.length = NULL; - } - if (r->out.length) { - _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.value) { - 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 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)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumValue *r) -{ - ndr_print_struct(ndr, name, "winreg_EnumValue"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_EnumValue"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint32(ndr, "enum_index", r->in.enum_index); - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - ndr_print_winreg_StringBuf(ndr, "name", r->in.name); - ndr->depth--; - ndr_print_ptr(ndr, "type", r->in.type); - ndr->depth++; - if (r->in.type) { - ndr_print_winreg_Type(ndr, "type", *r->in.type); - } - ndr->depth--; - ndr_print_ptr(ndr, "value", r->in.value); - ndr->depth++; - if (r->in.value) { - if (r->in.length == NULL) return; - ndr_print_array_uint8(ndr, "value", r->in.value, *r->in.length); - } - ndr->depth--; - ndr_print_ptr(ndr, "size", r->in.size); - ndr->depth++; - if (r->in.size) { - ndr_print_uint32(ndr, "size", *r->in.size); - } - ndr->depth--; - ndr_print_ptr(ndr, "length", r->in.length); - ndr->depth++; - if (r->in.length) { - ndr_print_uint32(ndr, "length", *r->in.length); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_EnumValue"); - ndr->depth++; - ndr_print_ptr(ndr, "name", r->out.name); - ndr->depth++; - ndr_print_winreg_StringBuf(ndr, "name", r->out.name); - ndr->depth--; - ndr_print_ptr(ndr, "type", r->out.type); - ndr->depth++; - if (r->out.type) { - ndr_print_winreg_Type(ndr, "type", *r->out.type); - } - ndr->depth--; - ndr_print_ptr(ndr, "value", r->out.value); - ndr->depth++; - if (r->out.value) { - if (r->out.length == NULL) return; - ndr_print_array_uint8(ndr, "value", r->out.value, *r->out.length); - } - ndr->depth--; - ndr_print_ptr(ndr, "size", r->out.size); - ndr->depth++; - if (r->out.size) { - ndr_print_uint32(ndr, "size", *r->out.size); - } - ndr->depth--; - ndr_print_ptr(ndr, "length", r->out.length); - ndr->depth++; - if (r->out.length) { - ndr_print_uint32(ndr, "length", *r->out.length); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_FlushKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_FlushKey *r) -{ - ndr_print_struct(ndr, name, "winreg_FlushKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_FlushKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_FlushKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sd_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sd); - } - _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sd, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.sd); - *r->out.sd = *r->in.sd; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.sd); - } - _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sd, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_GetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetKeySecurity *r) -{ - ndr_print_struct(ndr, name, "winreg_GetKeySecurity"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_GetKeySecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); - ndr_print_ptr(ndr, "sd", r->in.sd); - ndr->depth++; - ndr_print_KeySecurityData(ndr, "sd", r->in.sd); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_GetKeySecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "sd", r->out.sd); - ndr->depth++; - ndr_print_KeySecurityData(ndr, "sd", r->out.sd); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.keyname)); - if (r->in.keyname) { - NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyname)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.filename)); - if (r->in.filename) { - NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_LoadKey(struct ndr_pull *ndr, int flags, struct winreg_LoadKey *r) -{ - uint32_t _ptr_keyname; - uint32_t _ptr_filename; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_keyname_0; - TALLOC_CTX *_mem_save_filename_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyname)); - if (_ptr_keyname) { - NDR_PULL_ALLOC(ndr, r->in.keyname); - } else { - r->in.keyname = NULL; - } - if (r->in.keyname) { - _mem_save_keyname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.keyname, 0); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.keyname)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyname_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_filename)); - if (_ptr_filename) { - NDR_PULL_ALLOC(ndr, r->in.filename); - } else { - r->in.filename = NULL; - } - if (r->in.filename) { - _mem_save_filename_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.filename, 0); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filename_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_LoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_LoadKey *r) -{ - ndr_print_struct(ndr, name, "winreg_LoadKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_LoadKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "keyname", r->in.keyname); - ndr->depth++; - if (r->in.keyname) { - ndr_print_winreg_String(ndr, "keyname", r->in.keyname); - } - ndr->depth--; - ndr_print_ptr(ndr, "filename", r->in.filename); - ndr->depth++; - if (r->in.filename) { - ndr_print_winreg_String(ndr, "filename", r->in.filename); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_LoadKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.watch_subtree)); - NDR_CHECK(ndr_push_winreg_NotifyChangeType(ndr, NDR_SCALARS, r->in.notify_filter)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); - NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string1)); - NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.watch_subtree)); - NDR_CHECK(ndr_pull_winreg_NotifyChangeType(ndr, NDR_SCALARS, &r->in.notify_filter)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string1)); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string2)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_NotifyChangeKeyValue *r) -{ - ndr_print_struct(ndr, name, "winreg_NotifyChangeKeyValue"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_NotifyChangeKeyValue"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_uint8(ndr, "watch_subtree", r->in.watch_subtree); - ndr_print_winreg_NotifyChangeType(ndr, "notify_filter", r->in.notify_filter); - ndr_print_uint32(ndr, "unknown", r->in.unknown); - ndr_print_winreg_String(ndr, "string1", &r->in.string1); - ndr_print_winreg_String(ndr, "string2", &r->in.string2); - ndr_print_uint32(ndr, "unknown2", r->in.unknown2); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_NotifyChangeKeyValue"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r) -{ - TALLOC_CTX *_mem_save_parent_handle_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.parent_handle); - } - _mem_save_parent_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.parent_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.parent_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyname)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenKey *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenKey"); - ndr->depth++; - ndr_print_ptr(ndr, "parent_handle", r->in.parent_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "parent_handle", r->in.parent_handle); - ndr->depth--; - ndr_print_winreg_String(ndr, "keyname", &r->in.keyname); - ndr_print_uint32(ndr, "unknown", r->in.unknown); - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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 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 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 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 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 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 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 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_classname_0; - TALLOC_CTX *_mem_save_num_subkeys_0; - TALLOC_CTX *_mem_save_max_subkeylen_0; - TALLOC_CTX *_mem_save_max_classlen_0; - TALLOC_CTX *_mem_save_num_values_0; - TALLOC_CTX *_mem_save_max_valnamelen_0; - TALLOC_CTX *_mem_save_max_valbufsize_0; - TALLOC_CTX *_mem_save_secdescsize_0; - TALLOC_CTX *_mem_save_last_changed_time_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.classname); - } - _mem_save_classname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.classname, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.classname)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_classname_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.classname); - *r->out.classname = *r->in.classname; - NDR_PULL_ALLOC(ndr, r->out.num_subkeys); - ZERO_STRUCTP(r->out.num_subkeys); - NDR_PULL_ALLOC(ndr, r->out.max_subkeylen); - ZERO_STRUCTP(r->out.max_subkeylen); - NDR_PULL_ALLOC(ndr, r->out.max_classlen); - ZERO_STRUCTP(r->out.max_classlen); - NDR_PULL_ALLOC(ndr, r->out.num_values); - ZERO_STRUCTP(r->out.num_values); - NDR_PULL_ALLOC(ndr, r->out.max_valnamelen); - ZERO_STRUCTP(r->out.max_valnamelen); - NDR_PULL_ALLOC(ndr, r->out.max_valbufsize); - ZERO_STRUCTP(r->out.max_valbufsize); - NDR_PULL_ALLOC(ndr, r->out.secdescsize); - ZERO_STRUCTP(r->out.secdescsize); - NDR_PULL_ALLOC(ndr, r->out.last_changed_time); - ZERO_STRUCTP(r->out.last_changed_time); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.classname); - } - _mem_save_classname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.classname, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.classname)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_classname_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_subkeys); - } - _mem_save_num_subkeys_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_subkeys, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_subkeys)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_subkeys_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.max_subkeylen); - } - _mem_save_max_subkeylen_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.max_subkeylen, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_subkeylen)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_subkeylen_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.max_classlen); - } - _mem_save_max_classlen_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.max_classlen, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_classlen)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_classlen_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_values); - } - _mem_save_num_values_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_values, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_values)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_values_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.max_valnamelen); - } - _mem_save_max_valnamelen_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valnamelen, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valnamelen)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valnamelen_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.max_valbufsize); - } - _mem_save_max_valbufsize_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.max_valbufsize, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.max_valbufsize)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_max_valbufsize_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.secdescsize); - } - _mem_save_secdescsize_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.secdescsize, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.secdescsize)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdescsize_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.last_changed_time); - } - _mem_save_last_changed_time_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.last_changed_time, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, r->out.last_changed_time)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_last_changed_time_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryInfoKey *r) -{ - ndr_print_struct(ndr, name, "winreg_QueryInfoKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_QueryInfoKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "classname", r->in.classname); - ndr->depth++; - ndr_print_winreg_String(ndr, "classname", r->in.classname); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_QueryInfoKey"); - ndr->depth++; - ndr_print_ptr(ndr, "classname", r->out.classname); - ndr->depth++; - ndr_print_winreg_String(ndr, "classname", r->out.classname); - ndr->depth--; - ndr_print_ptr(ndr, "num_subkeys", r->out.num_subkeys); - ndr->depth++; - ndr_print_uint32(ndr, "num_subkeys", *r->out.num_subkeys); - ndr->depth--; - ndr_print_ptr(ndr, "max_subkeylen", r->out.max_subkeylen); - ndr->depth++; - ndr_print_uint32(ndr, "max_subkeylen", *r->out.max_subkeylen); - ndr->depth--; - ndr_print_ptr(ndr, "max_classlen", r->out.max_classlen); - ndr->depth++; - ndr_print_uint32(ndr, "max_classlen", *r->out.max_classlen); - ndr->depth--; - ndr_print_ptr(ndr, "num_values", r->out.num_values); - ndr->depth++; - ndr_print_uint32(ndr, "num_values", *r->out.num_values); - ndr->depth--; - ndr_print_ptr(ndr, "max_valnamelen", r->out.max_valnamelen); - ndr->depth++; - ndr_print_uint32(ndr, "max_valnamelen", *r->out.max_valnamelen); - ndr->depth--; - ndr_print_ptr(ndr, "max_valbufsize", r->out.max_valbufsize); - ndr->depth++; - ndr_print_uint32(ndr, "max_valbufsize", *r->out.max_valbufsize); - ndr->depth--; - ndr_print_ptr(ndr, "secdescsize", r->out.secdescsize); - ndr->depth++; - ndr_print_uint32(ndr, "secdescsize", *r->out.secdescsize); - ndr->depth--; - ndr_print_ptr(ndr, "last_changed_time", r->out.last_changed_time); - ndr->depth++; - ndr_print_NTTIME(ndr, "last_changed_time", *r->out.last_changed_time); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - if (r->in.value_name == 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.value_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.type)); - if (r->in.type) { - NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->in.type)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data)); - if (r->in.data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, *r->in.data_length)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data_size)); - if (r->in.data_size) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data_length)); - if (r->in.data_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_length)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.type)); - if (r->out.type) { - NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data)); - if (r->out.data) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_length)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, *r->out.data_length)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data_size)); - if (r->out.data_size) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data_length)); - if (r->out.data_length) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_length)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r) -{ - uint32_t _ptr_type; - uint32_t _ptr_data; - uint32_t _ptr_data_size; - uint32_t _ptr_data_length; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_value_name_0; - TALLOC_CTX *_mem_save_type_0; - TALLOC_CTX *_mem_save_data_0; - TALLOC_CTX *_mem_save_data_size_0; - TALLOC_CTX *_mem_save_data_length_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.value_name); - } - _mem_save_value_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.value_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.value_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_name_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type)); - if (_ptr_type) { - NDR_PULL_ALLOC(ndr, r->in.type); - } else { - r->in.type = NULL; - } - if (r->in.type) { - _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.type, 0); - NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->in.type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->in.data); - } else { - r->in.data = NULL; - } - if (r->in.data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.data)); - if (ndr_get_array_length(ndr, &r->in.data) > ndr_get_array_size(ndr, &r->in.data)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.data), ndr_get_array_length(ndr, &r->in.data)); - } - NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_length(ndr, &r->in.data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_size)); - if (_ptr_data_size) { - NDR_PULL_ALLOC(ndr, r->in.data_size); - } else { - r->in.data_size = NULL; - } - if (r->in.data_size) { - _mem_save_data_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.data_size, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.data_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_length)); - if (_ptr_data_length) { - NDR_PULL_ALLOC(ndr, r->in.data_length); - } else { - r->in.data_length = NULL; - } - if (r->in.data_length) { - _mem_save_data_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.data_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.data_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_length_0, 0); - } - if (r->in.data) { - 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.data_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.data_length)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_type)); - if (_ptr_type) { - NDR_PULL_ALLOC(ndr, r->out.type); - } else { - r->out.type = NULL; - } - if (r->out.type) { - _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.type, 0); - NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->out.data); - } else { - r->out.data = NULL; - } - if (r->out.data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->out.data)); - if (ndr_get_array_length(ndr, &r->out.data) > ndr_get_array_size(ndr, &r->out.data)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.data), ndr_get_array_length(ndr, &r->out.data)); - } - NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_length(ndr, &r->out.data))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_size)); - if (_ptr_data_size) { - NDR_PULL_ALLOC(ndr, r->out.data_size); - } else { - r->out.data_size = NULL; - } - if (r->out.data_size) { - _mem_save_data_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.data_size, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.data_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_length)); - if (_ptr_data_length) { - NDR_PULL_ALLOC(ndr, r->out.data_length); - } else { - r->out.data_length = NULL; - } - if (r->out.data_length) { - _mem_save_data_length_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.data_length, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.data_length)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_length_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.data) { - 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.data_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.data_length)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryValue *r) -{ - ndr_print_struct(ndr, name, "winreg_QueryValue"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_QueryValue"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "value_name", r->in.value_name); - ndr->depth++; - ndr_print_winreg_String(ndr, "value_name", r->in.value_name); - ndr->depth--; - ndr_print_ptr(ndr, "type", r->in.type); - ndr->depth++; - if (r->in.type) { - ndr_print_winreg_Type(ndr, "type", *r->in.type); - } - ndr->depth--; - ndr_print_ptr(ndr, "data", r->in.data); - ndr->depth++; - if (r->in.data) { - if (r->in.data_length == NULL) return; - ndr_print_array_uint8(ndr, "data", r->in.data, *r->in.data_length); - } - ndr->depth--; - ndr_print_ptr(ndr, "data_size", r->in.data_size); - ndr->depth++; - if (r->in.data_size) { - ndr_print_uint32(ndr, "data_size", *r->in.data_size); - } - ndr->depth--; - ndr_print_ptr(ndr, "data_length", r->in.data_length); - ndr->depth++; - if (r->in.data_length) { - ndr_print_uint32(ndr, "data_length", *r->in.data_length); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_QueryValue"); - ndr->depth++; - ndr_print_ptr(ndr, "type", r->out.type); - ndr->depth++; - if (r->out.type) { - ndr_print_winreg_Type(ndr, "type", *r->out.type); - } - ndr->depth--; - ndr_print_ptr(ndr, "data", r->out.data); - ndr->depth++; - if (r->out.data) { - if (r->out.data_length == NULL) return; - ndr_print_array_uint8(ndr, "data", r->out.data, *r->out.data_length); - } - ndr->depth--; - ndr_print_ptr(ndr, "data_size", r->out.data_size); - ndr->depth++; - if (r->out.data_size) { - ndr_print_uint32(ndr, "data_size", *r->out.data_size); - } - ndr->depth--; - ndr_print_ptr(ndr, "data_length", r->out.data_length); - ndr->depth++; - if (r->out.data_length) { - ndr_print_uint32(ndr, "data_length", *r->out.data_length); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_ReplaceKey(struct ndr_push *ndr, int flags, const struct winreg_ReplaceKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_ReplaceKey(struct ndr_pull *ndr, int flags, struct winreg_ReplaceKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_ReplaceKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_ReplaceKey *r) -{ - ndr_print_struct(ndr, name, "winreg_ReplaceKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_ReplaceKey"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_ReplaceKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_RestoreKey(struct ndr_pull *ndr, int flags, struct winreg_RestoreKey *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_filename_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.filename); - } - _mem_save_filename_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.filename, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filename_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_RestoreKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_RestoreKey *r) -{ - ndr_print_struct(ndr, name, "winreg_RestoreKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_RestoreKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "filename", r->in.filename); - ndr->depth++; - ndr_print_winreg_String(ndr, "filename", r->in.filename); - ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_RestoreKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - 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) { - NDR_CHECK(ndr_push_KeySecurityAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sec_attrib)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_SaveKey(struct ndr_pull *ndr, int flags, struct winreg_SaveKey *r) -{ - uint32_t _ptr_sec_attrib; - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_filename_0; - TALLOC_CTX *_mem_save_sec_attrib_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.filename); - } - _mem_save_filename_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.filename, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.filename)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filename_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sec_attrib)); - if (_ptr_sec_attrib) { - NDR_PULL_ALLOC(ndr, r->in.sec_attrib); - } else { - r->in.sec_attrib = NULL; - } - if (r->in.sec_attrib) { - _mem_save_sec_attrib_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sec_attrib, 0); - NDR_CHECK(ndr_pull_KeySecurityAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sec_attrib)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_attrib_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_SaveKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKey *r) -{ - ndr_print_struct(ndr, name, "winreg_SaveKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_SaveKey"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_ptr(ndr, "filename", r->in.filename); - ndr->depth++; - ndr_print_winreg_String(ndr, "filename", r->in.filename); - ndr->depth--; - ndr_print_ptr(ndr, "sec_attrib", r->in.sec_attrib); - ndr->depth++; - if (r->in.sec_attrib) { - ndr_print_KeySecurityAttribute(ndr, "sec_attrib", r->in.sec_attrib); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_SaveKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); - 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) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_SetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_SetKeySecurity *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_sd_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.sd); - } - _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.sd, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_SetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetKeySecurity *r) -{ - ndr_print_struct(ndr, name, "winreg_SetKeySecurity"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_SetKeySecurity"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); - ndr_print_ptr(ndr, "sd", r->in.sd); - ndr->depth++; - ndr_print_KeySecurityData(ndr, "sd", r->in.sd); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_SetKeySecurity"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 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 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)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_SetValue(struct ndr_pull *ndr, int flags, struct winreg_SetValue *r) -{ - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); - NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->in.type)); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_size(ndr, &r->in.data))); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.size)); - if (r->in.data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, r->in.size)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_SetValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetValue *r) -{ - ndr_print_struct(ndr, name, "winreg_SetValue"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_SetValue"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr_print_winreg_String(ndr, "name", &r->in.name); - ndr_print_winreg_Type(ndr, "type", r->in.type); - ndr_print_ptr(ndr, "data", r->in.data); - ndr->depth++; - ndr_print_array_uint8(ndr, "data", r->in.data, r->in.size); - ndr->depth--; - ndr_print_uint32(ndr, "size", r->in.size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_SetValue"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_UnLoadKey(struct ndr_push *ndr, int flags, const struct winreg_UnLoadKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_UnLoadKey(struct ndr_pull *ndr, int flags, struct winreg_UnLoadKey *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_UnLoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_UnLoadKey *r) -{ - ndr_print_struct(ndr, name, "winreg_UnLoadKey"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_UnLoadKey"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_UnLoadKey"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_InitiateSystemShutdown(struct ndr_push *ndr, int flags, const struct winreg_InitiateSystemShutdown *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname)); - if (r->in.hostname) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message)); - if (r->in.message) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_InitiateSystemShutdown(struct ndr_pull *ndr, int flags, struct winreg_InitiateSystemShutdown *r) -{ - uint32_t _ptr_hostname; - uint32_t _ptr_message; - TALLOC_CTX *_mem_save_hostname_0; - TALLOC_CTX *_mem_save_message_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname)); - if (_ptr_hostname) { - NDR_PULL_ALLOC(ndr, r->in.hostname); - } else { - r->in.hostname = NULL; - } - if (r->in.hostname) { - _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message)); - if (_ptr_message) { - NDR_PULL_ALLOC(ndr, r->in.message); - } else { - r->in.message = NULL; - } - if (r->in.message) { - _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_InitiateSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdown *r) -{ - ndr_print_struct(ndr, name, "winreg_InitiateSystemShutdown"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_InitiateSystemShutdown"); - ndr->depth++; - ndr_print_ptr(ndr, "hostname", r->in.hostname); - ndr->depth++; - if (r->in.hostname) { - ndr_print_uint16(ndr, "hostname", *r->in.hostname); - } - ndr->depth--; - ndr_print_ptr(ndr, "message", r->in.message); - ndr->depth++; - if (r->in.message) { - ndr_print_lsa_StringLarge(ndr, "message", r->in.message); - } - ndr->depth--; - ndr_print_uint32(ndr, "timeout", r->in.timeout); - ndr_print_uint8(ndr, "force_apps", r->in.force_apps); - ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_InitiateSystemShutdown"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_AbortSystemShutdown(struct ndr_push *ndr, int flags, const struct winreg_AbortSystemShutdown *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); - if (r->in.server) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.server)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_AbortSystemShutdown(struct ndr_pull *ndr, int flags, struct winreg_AbortSystemShutdown *r) -{ - uint32_t _ptr_server; - TALLOC_CTX *_mem_save_server_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); - if (_ptr_server) { - NDR_PULL_ALLOC(ndr, r->in.server); - } else { - r->in.server = NULL; - } - if (r->in.server) { - _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.server)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_AbortSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_AbortSystemShutdown *r) -{ - ndr_print_struct(ndr, name, "winreg_AbortSystemShutdown"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_AbortSystemShutdown"); - ndr->depth++; - ndr_print_ptr(ndr, "server", r->in.server); - ndr->depth++; - if (r->in.server) { - ndr_print_uint16(ndr, "server", *r->in.server); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_AbortSystemShutdown"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code 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 ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r) -{ - TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_version_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.version); - ZERO_STRUCTP(r->out.version); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.version); - } - _mem_save_version_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.version, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.version)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetVersion *r) -{ - ndr_print_struct(ndr, name, "winreg_GetVersion"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_GetVersion"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->in.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->in.handle); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_GetVersion"); - ndr->depth++; - ndr_print_ptr(ndr, "version", r->out.version); - ndr->depth++; - ndr_print_uint32(ndr, "version", *r->out.version); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_OpenHKCC(struct ndr_push *ndr, int flags, const struct winreg_OpenHKCC *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_OpenHKCC(struct ndr_pull *ndr, int flags, struct winreg_OpenHKCC *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenHKCC(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCC *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenHKCC"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenHKCC"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenHKCC"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_OpenHKDD(struct ndr_push *ndr, int flags, const struct winreg_OpenHKDD *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_OpenHKDD(struct ndr_pull *ndr, int flags, struct winreg_OpenHKDD *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenHKDD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKDD *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenHKDD"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenHKDD"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenHKDD"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues *r) -{ - uint32_t cntr_values_1; - if (flags & NDR_IN) { - 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, r->in.key_handle)); - 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)); - for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { - NDR_CHECK(ndr_push_QueryMultipleValue(ndr, NDR_SCALARS, &r->in.values[cntr_values_1])); - } - for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { - NDR_CHECK(ndr_push_QueryMultipleValue(ndr, NDR_BUFFERS, &r->in.values[cntr_values_1])); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_values)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.buffer)); - if (r->in.buffer) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.buffer_size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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 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 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)); - for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { - NDR_CHECK(ndr_push_QueryMultipleValue(ndr, NDR_SCALARS, &r->out.values[cntr_values_1])); - } - for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { - NDR_CHECK(ndr_push_QueryMultipleValue(ndr, NDR_BUFFERS, &r->out.values[cntr_values_1])); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.buffer)); - if (r->out.buffer) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.buffer_size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - 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 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)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues *r) -{ - uint32_t cntr_values_1; - uint32_t _ptr_buffer; - TALLOC_CTX *_mem_save_key_handle_0; - TALLOC_CTX *_mem_save_values_1; - TALLOC_CTX *_mem_save_buffer_0; - TALLOC_CTX *_mem_save_buffer_size_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.key_handle); - } - _mem_save_key_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.key_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.key_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.values)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.values)); - if (ndr_get_array_length(ndr, &r->in.values) > ndr_get_array_size(ndr, &r->in.values)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.values), ndr_get_array_length(ndr, &r->in.values)); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->in.values, ndr_get_array_size(ndr, &r->in.values)); - } - memcpy(r->out.values, r->in.values, ndr_get_array_size(ndr, &r->in.values) * sizeof(*r->in.values)); - _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.values, 0); - for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { - NDR_CHECK(ndr_pull_QueryMultipleValue(ndr, NDR_SCALARS, &r->in.values[cntr_values_1])); - } - for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { - NDR_CHECK(ndr_pull_QueryMultipleValue(ndr, NDR_BUFFERS, &r->in.values[cntr_values_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_values)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); - if (_ptr_buffer) { - NDR_PULL_ALLOC(ndr, r->in.buffer); - } else { - r->in.buffer = NULL; - } - if (r->in.buffer) { - _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.buffer)); - if (ndr_get_array_length(ndr, &r->in.buffer) > ndr_get_array_size(ndr, &r->in.buffer)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.buffer), ndr_get_array_length(ndr, &r->in.buffer)); - } - NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_length(ndr, &r->in.buffer))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.buffer_size); - } - _mem_save_buffer_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC_N(ndr, r->out.values, r->in.num_values); - memcpy(r->out.values, r->in.values, (r->in.num_values) * sizeof(*r->in.values)); - NDR_PULL_ALLOC(ndr, r->out.buffer_size); - *r->out.buffer_size = *r->in.buffer_size; - if (r->in.values) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.values, r->in.num_values)); - } - if (r->in.values) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.values, r->in.num_values)); - } - if (r->in.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, *r->in.buffer_size)); - } - if (r->in.buffer) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.buffer, *r->in.buffer_size)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.values)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->out.values)); - if (ndr_get_array_length(ndr, &r->out.values) > ndr_get_array_size(ndr, &r->out.values)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.values), ndr_get_array_length(ndr, &r->out.values)); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.values, ndr_get_array_size(ndr, &r->out.values)); - } - memcpy(r->out.values, r->in.values, ndr_get_array_size(ndr, &r->out.values) * sizeof(*r->in.values)); - _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.values, 0); - for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { - NDR_CHECK(ndr_pull_QueryMultipleValue(ndr, NDR_SCALARS, &r->out.values[cntr_values_1])); - } - for (cntr_values_1 = 0; cntr_values_1 < r->in.num_values; cntr_values_1++) { - NDR_CHECK(ndr_pull_QueryMultipleValue(ndr, NDR_BUFFERS, &r->out.values[cntr_values_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); - if (_ptr_buffer) { - NDR_PULL_ALLOC(ndr, r->out.buffer); - } else { - r->out.buffer = NULL; - } - if (r->out.buffer) { - _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->out.buffer)); - if (ndr_get_array_length(ndr, &r->out.buffer) > ndr_get_array_size(ndr, &r->out.buffer)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.buffer), ndr_get_array_length(ndr, &r->out.buffer)); - } - NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_length(ndr, &r->out.buffer))); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.buffer_size); - } - _mem_save_buffer_size_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer_size, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.buffer_size)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.values) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.values, r->in.num_values)); - } - if (r->out.values) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.values, r->in.num_values)); - } - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, *r->out.buffer_size)); - } - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.buffer, *r->out.buffer_size)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues *r) -{ - uint32_t cntr_values_1; - ndr_print_struct(ndr, name, "winreg_QueryMultipleValues"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_QueryMultipleValues"); - ndr->depth++; - ndr_print_ptr(ndr, "key_handle", r->in.key_handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "key_handle", r->in.key_handle); - ndr->depth--; - ndr_print_ptr(ndr, "values", r->in.values); - ndr->depth++; - ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->in.num_values); - ndr->depth++; - for (cntr_values_1=0;cntr_values_1in.num_values;cntr_values_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) { - ndr_print_QueryMultipleValue(ndr, "values", &r->in.values[cntr_values_1]); - free(idx_1); - } - } - ndr->depth--; - ndr->depth--; - ndr_print_uint32(ndr, "num_values", r->in.num_values); - ndr_print_ptr(ndr, "buffer", r->in.buffer); - ndr->depth++; - if (r->in.buffer) { - ndr_print_array_uint8(ndr, "buffer", r->in.buffer, *r->in.buffer_size); - } - ndr->depth--; - ndr_print_ptr(ndr, "buffer_size", r->in.buffer_size); - ndr->depth++; - ndr_print_uint32(ndr, "buffer_size", *r->in.buffer_size); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_QueryMultipleValues"); - ndr->depth++; - ndr_print_ptr(ndr, "values", r->out.values); - ndr->depth++; - ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->in.num_values); - ndr->depth++; - for (cntr_values_1=0;cntr_values_1in.num_values;cntr_values_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) { - ndr_print_QueryMultipleValue(ndr, "values", &r->out.values[cntr_values_1]); - free(idx_1); - } - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "buffer", r->out.buffer); - ndr->depth++; - if (r->out.buffer) { - ndr_print_array_uint8(ndr, "buffer", r->out.buffer, *r->out.buffer_size); - } - ndr->depth--; - ndr_print_ptr(ndr, "buffer_size", r->out.buffer_size); - ndr->depth++; - ndr_print_uint32(ndr, "buffer_size", *r->out.buffer_size); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_InitiateSystemShutdownEx(struct ndr_push *ndr, int flags, const struct winreg_InitiateSystemShutdownEx *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname)); - if (r->in.hostname) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message)); - if (r->in.message) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps)); - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reason)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_InitiateSystemShutdownEx(struct ndr_pull *ndr, int flags, struct winreg_InitiateSystemShutdownEx *r) -{ - uint32_t _ptr_hostname; - uint32_t _ptr_message; - TALLOC_CTX *_mem_save_hostname_0; - TALLOC_CTX *_mem_save_message_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname)); - if (_ptr_hostname) { - NDR_PULL_ALLOC(ndr, r->in.hostname); - } else { - r->in.hostname = NULL; - } - if (r->in.hostname) { - _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message)); - if (_ptr_message) { - NDR_PULL_ALLOC(ndr, r->in.message); - } else { - r->in.message = NULL; - } - if (r->in.message) { - _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps)); - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reason)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_InitiateSystemShutdownEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdownEx *r) -{ - ndr_print_struct(ndr, name, "winreg_InitiateSystemShutdownEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_InitiateSystemShutdownEx"); - ndr->depth++; - ndr_print_ptr(ndr, "hostname", r->in.hostname); - ndr->depth++; - if (r->in.hostname) { - ndr_print_uint16(ndr, "hostname", *r->in.hostname); - } - ndr->depth--; - ndr_print_ptr(ndr, "message", r->in.message); - ndr->depth++; - if (r->in.message) { - ndr_print_lsa_StringLarge(ndr, "message", r->in.message); - } - ndr->depth--; - ndr_print_uint32(ndr, "timeout", r->in.timeout); - ndr_print_uint8(ndr, "force_apps", r->in.force_apps); - ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot); - ndr_print_uint32(ndr, "reason", r->in.reason); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_InitiateSystemShutdownEx"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_SaveKeyEx(struct ndr_push *ndr, int flags, const struct winreg_SaveKeyEx *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_SaveKeyEx(struct ndr_pull *ndr, int flags, struct winreg_SaveKeyEx *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_SaveKeyEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKeyEx *r) -{ - ndr_print_struct(ndr, name, "winreg_SaveKeyEx"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_SaveKeyEx"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_SaveKeyEx"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_OpenHKPT(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPT *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_OpenHKPT(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPT *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenHKPT(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPT *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenHKPT"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenHKPT"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenHKPT"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_OpenHKPN(struct ndr_push *ndr, int flags, const struct winreg_OpenHKPN *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); - if (r->in.system_name) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); - } - NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); - } - if (flags & NDR_OUT) { - 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, r->out.handle)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_OpenHKPN(struct ndr_pull *ndr, int flags, struct winreg_OpenHKPN *r) -{ - uint32_t _ptr_system_name; - TALLOC_CTX *_mem_save_system_name_0; - TALLOC_CTX *_mem_save_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); - if (_ptr_system_name) { - NDR_PULL_ALLOC(ndr, r->in.system_name); - } else { - r->in.system_name = NULL; - } - if (r->in.system_name) { - _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); - } - NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); - NDR_PULL_ALLOC(ndr, r->out.handle); - ZERO_STRUCTP(r->out.handle); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.handle); - } - _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_OpenHKPN(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPN *r) -{ - ndr_print_struct(ndr, name, "winreg_OpenHKPN"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_OpenHKPN"); - ndr->depth++; - ndr_print_ptr(ndr, "system_name", r->in.system_name); - ndr->depth++; - if (r->in.system_name) { - ndr_print_uint16(ndr, "system_name", *r->in.system_name); - } - ndr->depth--; - ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_OpenHKPN"); - ndr->depth++; - ndr_print_ptr(ndr, "handle", r->out.handle); - ndr->depth++; - ndr_print_policy_handle(ndr, "handle", r->out.handle); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_winreg_QueryMultipleValues2(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues2 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_winreg_QueryMultipleValues2(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues2 *r) -{ - if (flags & NDR_IN) { - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_winreg_QueryMultipleValues2(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues2 *r) -{ - ndr_print_struct(ndr, name, "winreg_QueryMultipleValues2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "winreg_QueryMultipleValues2"); - ndr->depth++; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "winreg_QueryMultipleValues2"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call winreg_calls[] = { - { - "winreg_OpenHKCR", - sizeof(struct winreg_OpenHKCR), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCR, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCR, - (ndr_print_function_t) ndr_print_winreg_OpenHKCR, - false, - }, - { - "winreg_OpenHKCU", - sizeof(struct winreg_OpenHKCU), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCU, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCU, - (ndr_print_function_t) ndr_print_winreg_OpenHKCU, - false, - }, - { - "winreg_OpenHKLM", - sizeof(struct winreg_OpenHKLM), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKLM, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKLM, - (ndr_print_function_t) ndr_print_winreg_OpenHKLM, - false, - }, - { - "winreg_OpenHKPD", - sizeof(struct winreg_OpenHKPD), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPD, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPD, - (ndr_print_function_t) ndr_print_winreg_OpenHKPD, - false, - }, - { - "winreg_OpenHKU", - sizeof(struct winreg_OpenHKU), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKU, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKU, - (ndr_print_function_t) ndr_print_winreg_OpenHKU, - false, - }, - { - "winreg_CloseKey", - sizeof(struct winreg_CloseKey), - (ndr_push_flags_fn_t) ndr_push_winreg_CloseKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_CloseKey, - (ndr_print_function_t) ndr_print_winreg_CloseKey, - false, - }, - { - "winreg_CreateKey", - sizeof(struct winreg_CreateKey), - (ndr_push_flags_fn_t) ndr_push_winreg_CreateKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_CreateKey, - (ndr_print_function_t) ndr_print_winreg_CreateKey, - false, - }, - { - "winreg_DeleteKey", - sizeof(struct winreg_DeleteKey), - (ndr_push_flags_fn_t) ndr_push_winreg_DeleteKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteKey, - (ndr_print_function_t) ndr_print_winreg_DeleteKey, - false, - }, - { - "winreg_DeleteValue", - sizeof(struct winreg_DeleteValue), - (ndr_push_flags_fn_t) ndr_push_winreg_DeleteValue, - (ndr_pull_flags_fn_t) ndr_pull_winreg_DeleteValue, - (ndr_print_function_t) ndr_print_winreg_DeleteValue, - false, - }, - { - "winreg_EnumKey", - sizeof(struct winreg_EnumKey), - (ndr_push_flags_fn_t) ndr_push_winreg_EnumKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_EnumKey, - (ndr_print_function_t) ndr_print_winreg_EnumKey, - false, - }, - { - "winreg_EnumValue", - sizeof(struct winreg_EnumValue), - (ndr_push_flags_fn_t) ndr_push_winreg_EnumValue, - (ndr_pull_flags_fn_t) ndr_pull_winreg_EnumValue, - (ndr_print_function_t) ndr_print_winreg_EnumValue, - false, - }, - { - "winreg_FlushKey", - sizeof(struct winreg_FlushKey), - (ndr_push_flags_fn_t) ndr_push_winreg_FlushKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_FlushKey, - (ndr_print_function_t) ndr_print_winreg_FlushKey, - false, - }, - { - "winreg_GetKeySecurity", - sizeof(struct winreg_GetKeySecurity), - (ndr_push_flags_fn_t) ndr_push_winreg_GetKeySecurity, - (ndr_pull_flags_fn_t) ndr_pull_winreg_GetKeySecurity, - (ndr_print_function_t) ndr_print_winreg_GetKeySecurity, - false, - }, - { - "winreg_LoadKey", - sizeof(struct winreg_LoadKey), - (ndr_push_flags_fn_t) ndr_push_winreg_LoadKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_LoadKey, - (ndr_print_function_t) ndr_print_winreg_LoadKey, - false, - }, - { - "winreg_NotifyChangeKeyValue", - sizeof(struct winreg_NotifyChangeKeyValue), - (ndr_push_flags_fn_t) ndr_push_winreg_NotifyChangeKeyValue, - (ndr_pull_flags_fn_t) ndr_pull_winreg_NotifyChangeKeyValue, - (ndr_print_function_t) ndr_print_winreg_NotifyChangeKeyValue, - false, - }, - { - "winreg_OpenKey", - sizeof(struct winreg_OpenKey), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenKey, - (ndr_print_function_t) ndr_print_winreg_OpenKey, - false, - }, - { - "winreg_QueryInfoKey", - sizeof(struct winreg_QueryInfoKey), - (ndr_push_flags_fn_t) ndr_push_winreg_QueryInfoKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryInfoKey, - (ndr_print_function_t) ndr_print_winreg_QueryInfoKey, - false, - }, - { - "winreg_QueryValue", - sizeof(struct winreg_QueryValue), - (ndr_push_flags_fn_t) ndr_push_winreg_QueryValue, - (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryValue, - (ndr_print_function_t) ndr_print_winreg_QueryValue, - false, - }, - { - "winreg_ReplaceKey", - sizeof(struct winreg_ReplaceKey), - (ndr_push_flags_fn_t) ndr_push_winreg_ReplaceKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_ReplaceKey, - (ndr_print_function_t) ndr_print_winreg_ReplaceKey, - false, - }, - { - "winreg_RestoreKey", - sizeof(struct winreg_RestoreKey), - (ndr_push_flags_fn_t) ndr_push_winreg_RestoreKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_RestoreKey, - (ndr_print_function_t) ndr_print_winreg_RestoreKey, - false, - }, - { - "winreg_SaveKey", - sizeof(struct winreg_SaveKey), - (ndr_push_flags_fn_t) ndr_push_winreg_SaveKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_SaveKey, - (ndr_print_function_t) ndr_print_winreg_SaveKey, - false, - }, - { - "winreg_SetKeySecurity", - sizeof(struct winreg_SetKeySecurity), - (ndr_push_flags_fn_t) ndr_push_winreg_SetKeySecurity, - (ndr_pull_flags_fn_t) ndr_pull_winreg_SetKeySecurity, - (ndr_print_function_t) ndr_print_winreg_SetKeySecurity, - false, - }, - { - "winreg_SetValue", - sizeof(struct winreg_SetValue), - (ndr_push_flags_fn_t) ndr_push_winreg_SetValue, - (ndr_pull_flags_fn_t) ndr_pull_winreg_SetValue, - (ndr_print_function_t) ndr_print_winreg_SetValue, - false, - }, - { - "winreg_UnLoadKey", - sizeof(struct winreg_UnLoadKey), - (ndr_push_flags_fn_t) ndr_push_winreg_UnLoadKey, - (ndr_pull_flags_fn_t) ndr_pull_winreg_UnLoadKey, - (ndr_print_function_t) ndr_print_winreg_UnLoadKey, - false, - }, - { - "winreg_InitiateSystemShutdown", - sizeof(struct winreg_InitiateSystemShutdown), - (ndr_push_flags_fn_t) ndr_push_winreg_InitiateSystemShutdown, - (ndr_pull_flags_fn_t) ndr_pull_winreg_InitiateSystemShutdown, - (ndr_print_function_t) ndr_print_winreg_InitiateSystemShutdown, - false, - }, - { - "winreg_AbortSystemShutdown", - sizeof(struct winreg_AbortSystemShutdown), - (ndr_push_flags_fn_t) ndr_push_winreg_AbortSystemShutdown, - (ndr_pull_flags_fn_t) ndr_pull_winreg_AbortSystemShutdown, - (ndr_print_function_t) ndr_print_winreg_AbortSystemShutdown, - false, - }, - { - "winreg_GetVersion", - sizeof(struct winreg_GetVersion), - (ndr_push_flags_fn_t) ndr_push_winreg_GetVersion, - (ndr_pull_flags_fn_t) ndr_pull_winreg_GetVersion, - (ndr_print_function_t) ndr_print_winreg_GetVersion, - false, - }, - { - "winreg_OpenHKCC", - sizeof(struct winreg_OpenHKCC), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKCC, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKCC, - (ndr_print_function_t) ndr_print_winreg_OpenHKCC, - false, - }, - { - "winreg_OpenHKDD", - sizeof(struct winreg_OpenHKDD), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKDD, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKDD, - (ndr_print_function_t) ndr_print_winreg_OpenHKDD, - false, - }, - { - "winreg_QueryMultipleValues", - sizeof(struct winreg_QueryMultipleValues), - (ndr_push_flags_fn_t) ndr_push_winreg_QueryMultipleValues, - (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryMultipleValues, - (ndr_print_function_t) ndr_print_winreg_QueryMultipleValues, - false, - }, - { - "winreg_InitiateSystemShutdownEx", - sizeof(struct winreg_InitiateSystemShutdownEx), - (ndr_push_flags_fn_t) ndr_push_winreg_InitiateSystemShutdownEx, - (ndr_pull_flags_fn_t) ndr_pull_winreg_InitiateSystemShutdownEx, - (ndr_print_function_t) ndr_print_winreg_InitiateSystemShutdownEx, - false, - }, - { - "winreg_SaveKeyEx", - sizeof(struct winreg_SaveKeyEx), - (ndr_push_flags_fn_t) ndr_push_winreg_SaveKeyEx, - (ndr_pull_flags_fn_t) ndr_pull_winreg_SaveKeyEx, - (ndr_print_function_t) ndr_print_winreg_SaveKeyEx, - false, - }, - { - "winreg_OpenHKPT", - sizeof(struct winreg_OpenHKPT), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPT, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPT, - (ndr_print_function_t) ndr_print_winreg_OpenHKPT, - false, - }, - { - "winreg_OpenHKPN", - sizeof(struct winreg_OpenHKPN), - (ndr_push_flags_fn_t) ndr_push_winreg_OpenHKPN, - (ndr_pull_flags_fn_t) ndr_pull_winreg_OpenHKPN, - (ndr_print_function_t) ndr_print_winreg_OpenHKPN, - false, - }, - { - "winreg_QueryMultipleValues2", - sizeof(struct winreg_QueryMultipleValues2), - (ndr_push_flags_fn_t) ndr_push_winreg_QueryMultipleValues2, - (ndr_pull_flags_fn_t) ndr_pull_winreg_QueryMultipleValues2, - (ndr_print_function_t) ndr_print_winreg_QueryMultipleValues2, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const winreg_endpoint_strings[] = { - "ncacn_np:[\\pipe\\winreg]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array winreg_endpoints = { - .count = 3, - .names = winreg_endpoint_strings -}; - -static const char * const winreg_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array winreg_authservices = { - .count = 1, - .names = winreg_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_winreg = { - .name = "winreg", - .syntax_id = { - {0x338cd001,0x2244,0x31f1,{0xaa,0xaa},{0x90,0x00,0x38,0x00,0x10,0x03}}, - NDR_WINREG_VERSION - }, - .helpstring = NDR_WINREG_HELPSTRING, - .num_calls = 35, - .calls = winreg_calls, - .endpoints = &winreg_endpoints, - .authservices = &winreg_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_winreg.h b/source3/librpc/gen_ndr/ndr_winreg.h deleted file mode 100644 index 8dea3ae273..0000000000 --- a/source3/librpc/gen_ndr/ndr_winreg.h +++ /dev/null @@ -1,164 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/winreg.h" - -#ifndef _HEADER_NDR_winreg -#define _HEADER_NDR_winreg - -#define NDR_WINREG_UUID "338cd001-2244-31f1-aaaa-900038001003" -#define NDR_WINREG_VERSION 1.0 -#define NDR_WINREG_NAME "winreg" -#define NDR_WINREG_HELPSTRING "Remote Registry Service" -extern const struct ndr_interface_table ndr_table_winreg; -#define NDR_WINREG_OPENHKCR (0x00) - -#define NDR_WINREG_OPENHKCU (0x01) - -#define NDR_WINREG_OPENHKLM (0x02) - -#define NDR_WINREG_OPENHKPD (0x03) - -#define NDR_WINREG_OPENHKU (0x04) - -#define NDR_WINREG_CLOSEKEY (0x05) - -#define NDR_WINREG_CREATEKEY (0x06) - -#define NDR_WINREG_DELETEKEY (0x07) - -#define NDR_WINREG_DELETEVALUE (0x08) - -#define NDR_WINREG_ENUMKEY (0x09) - -#define NDR_WINREG_ENUMVALUE (0x0a) - -#define NDR_WINREG_FLUSHKEY (0x0b) - -#define NDR_WINREG_GETKEYSECURITY (0x0c) - -#define NDR_WINREG_LOADKEY (0x0d) - -#define NDR_WINREG_NOTIFYCHANGEKEYVALUE (0x0e) - -#define NDR_WINREG_OPENKEY (0x0f) - -#define NDR_WINREG_QUERYINFOKEY (0x10) - -#define NDR_WINREG_QUERYVALUE (0x11) - -#define NDR_WINREG_REPLACEKEY (0x12) - -#define NDR_WINREG_RESTOREKEY (0x13) - -#define NDR_WINREG_SAVEKEY (0x14) - -#define NDR_WINREG_SETKEYSECURITY (0x15) - -#define NDR_WINREG_SETVALUE (0x16) - -#define NDR_WINREG_UNLOADKEY (0x17) - -#define NDR_WINREG_INITIATESYSTEMSHUTDOWN (0x18) - -#define NDR_WINREG_ABORTSYSTEMSHUTDOWN (0x19) - -#define NDR_WINREG_GETVERSION (0x1a) - -#define NDR_WINREG_OPENHKCC (0x1b) - -#define NDR_WINREG_OPENHKDD (0x1c) - -#define NDR_WINREG_QUERYMULTIPLEVALUES (0x1d) - -#define NDR_WINREG_INITIATESYSTEMSHUTDOWNEX (0x1e) - -#define NDR_WINREG_SAVEKEYEX (0x1f) - -#define NDR_WINREG_OPENHKPT (0x20) - -#define NDR_WINREG_OPENHKPN (0x21) - -#define NDR_WINREG_QUERYMULTIPLEVALUES2 (0x22) - -#define NDR_WINREG_CALL_COUNT (35) -void ndr_print_winreg_AccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r); -enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r); -void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r); -enum ndr_err_code ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, const struct winreg_String *r); -enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, struct winreg_String *r); -void ndr_print_winreg_String(struct ndr_print *ndr, const char *name, const struct winreg_String *r); -void ndr_print_KeySecurityData(struct ndr_print *ndr, const char *name, const struct KeySecurityData *r); -void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, const struct winreg_SecBuf *r); -void ndr_print_winreg_CreateAction(struct ndr_print *ndr, const char *name, enum winreg_CreateAction r); -void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name, const struct winreg_StringBuf *r); -enum ndr_err_code ndr_push_winreg_NotifyChangeType(struct ndr_push *ndr, int ndr_flags, uint32_t r); -enum ndr_err_code ndr_pull_winreg_NotifyChangeType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); -void ndr_print_winreg_NotifyChangeType(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_KeySecurityAttribute(struct ndr_print *ndr, const char *name, const struct KeySecurityAttribute *r); -void ndr_print_QueryMultipleValue(struct ndr_print *ndr, const char *name, const struct QueryMultipleValue *r); -void ndr_print_winreg_OpenHKCR(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCR *r); -void ndr_print_winreg_OpenHKCU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCU *r); -enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r); -enum ndr_err_code ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r); -void ndr_print_winreg_OpenHKLM(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKLM *r); -void ndr_print_winreg_OpenHKPD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPD *r); -void ndr_print_winreg_OpenHKU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKU *r); -enum ndr_err_code ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flags, const struct winreg_CloseKey *r); -enum ndr_err_code ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r); -void ndr_print_winreg_CloseKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CloseKey *r); -enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct winreg_CreateKey *r); -enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r); -void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CreateKey *r); -enum ndr_err_code ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int flags, const struct winreg_DeleteKey *r); -enum ndr_err_code ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r); -void ndr_print_winreg_DeleteKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteKey *r); -void ndr_print_winreg_DeleteValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteValue *r); -enum ndr_err_code ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct winreg_EnumKey *r); -enum ndr_err_code ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r); -void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumKey *r); -enum ndr_err_code ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const struct winreg_EnumValue *r); -enum ndr_err_code ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r); -void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumValue *r); -enum ndr_err_code ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flags, const struct winreg_FlushKey *r); -enum ndr_err_code ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r); -void ndr_print_winreg_FlushKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_FlushKey *r); -enum ndr_err_code ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_GetKeySecurity *r); -enum ndr_err_code ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r); -void ndr_print_winreg_GetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetKeySecurity *r); -void ndr_print_winreg_LoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_LoadKey *r); -enum ndr_err_code ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, const struct winreg_NotifyChangeKeyValue *r); -enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r); -void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_NotifyChangeKeyValue *r); -enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags, const struct winreg_OpenKey *r); -enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r); -void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenKey *r); -enum ndr_err_code ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const struct winreg_QueryInfoKey *r); -enum ndr_err_code ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r); -void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryInfoKey *r); -enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r); -enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r); -void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryValue *r); -void ndr_print_winreg_ReplaceKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_ReplaceKey *r); -void ndr_print_winreg_RestoreKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_RestoreKey *r); -void ndr_print_winreg_SaveKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKey *r); -void ndr_print_winreg_SetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetKeySecurity *r); -void ndr_print_winreg_SetValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SetValue *r); -void ndr_print_winreg_UnLoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_UnLoadKey *r); -void ndr_print_winreg_InitiateSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdown *r); -void ndr_print_winreg_AbortSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_AbortSystemShutdown *r); -enum ndr_err_code ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struct winreg_GetVersion *r); -enum ndr_err_code ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r); -void ndr_print_winreg_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetVersion *r); -void ndr_print_winreg_OpenHKCC(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCC *r); -void ndr_print_winreg_OpenHKDD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKDD *r); -enum ndr_err_code ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues *r); -enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues *r); -void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues *r); -void ndr_print_winreg_InitiateSystemShutdownEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdownEx *r); -void ndr_print_winreg_SaveKeyEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKeyEx *r); -void ndr_print_winreg_OpenHKPT(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPT *r); -void ndr_print_winreg_OpenHKPN(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPN *r); -void ndr_print_winreg_QueryMultipleValues2(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues2 *r); -#endif /* _HEADER_NDR_winreg */ diff --git a/source3/librpc/gen_ndr/ndr_wkssvc.c b/source3/librpc/gen_ndr/ndr_wkssvc.c deleted file mode 100644 index e494f08be0..0000000000 --- a/source3/librpc/gen_ndr/ndr_wkssvc.c +++ /dev/null @@ -1,10679 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_wkssvc.h" - -#include "librpc/gen_ndr/ndr_srvsvc.h" -#include "librpc/gen_ndr/ndr_lsa.h" -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo100(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo100 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo100(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo100 *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - uint32_t _ptr_domain_name; - TALLOC_CTX *_mem_save_domain_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->server_name); - } else { - r->server_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->domain_name); - } else { - r->domain_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); - if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - if (r->domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); - if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo100(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo100 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo100"); - ndr->depth++; - ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); - ndr_print_ptr(ndr, "server_name", r->server_name); - ndr->depth++; - if (r->server_name) { - ndr_print_string(ndr, "server_name", r->server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->domain_name); - ndr->depth++; - if (r->domain_name) { - ndr_print_string(ndr, "domain_name", r->domain_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "version_major", r->version_major); - ndr_print_uint32(ndr, "version_minor", r->version_minor); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo101(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo101 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->lan_root)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->lan_root) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lan_root, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lan_root, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->lan_root, ndr_charset_length(r->lan_root, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo101(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo101 *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - uint32_t _ptr_domain_name; - TALLOC_CTX *_mem_save_domain_name_0; - uint32_t _ptr_lan_root; - TALLOC_CTX *_mem_save_lan_root_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->server_name); - } else { - r->server_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->domain_name); - } else { - r->domain_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lan_root)); - if (_ptr_lan_root) { - NDR_PULL_ALLOC(ndr, r->lan_root); - } else { - r->lan_root = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); - if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - if (r->domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); - if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - if (r->lan_root) { - _mem_save_lan_root_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->lan_root, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->lan_root)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->lan_root)); - if (ndr_get_array_length(ndr, &r->lan_root) > ndr_get_array_size(ndr, &r->lan_root)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->lan_root), ndr_get_array_length(ndr, &r->lan_root)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->lan_root), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->lan_root, ndr_get_array_length(ndr, &r->lan_root), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lan_root_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo101(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo101 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo101"); - ndr->depth++; - ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); - ndr_print_ptr(ndr, "server_name", r->server_name); - ndr->depth++; - if (r->server_name) { - ndr_print_string(ndr, "server_name", r->server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->domain_name); - ndr->depth++; - if (r->domain_name) { - ndr_print_string(ndr, "domain_name", r->domain_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "version_major", r->version_major); - ndr_print_uint32(ndr, "version_minor", r->version_minor); - ndr_print_ptr(ndr, "lan_root", r->lan_root); - ndr->depth++; - if (r->lan_root) { - ndr_print_string(ndr, "lan_root", r->lan_root); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo102(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo102 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_srvsvc_PlatformId(ndr, NDR_SCALARS, r->platform_id)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_major)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version_minor)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->lan_root)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logged_on_users)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->lan_root) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lan_root, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lan_root, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->lan_root, ndr_charset_length(r->lan_root, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo102(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo102 *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - uint32_t _ptr_domain_name; - TALLOC_CTX *_mem_save_domain_name_0; - uint32_t _ptr_lan_root; - TALLOC_CTX *_mem_save_lan_root_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_srvsvc_PlatformId(ndr, NDR_SCALARS, &r->platform_id)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->server_name); - } else { - r->server_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->domain_name); - } else { - r->domain_name = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_major)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version_minor)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lan_root)); - if (_ptr_lan_root) { - NDR_PULL_ALLOC(ndr, r->lan_root); - } else { - r->lan_root = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logged_on_users)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); - if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - if (r->domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); - if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - if (r->lan_root) { - _mem_save_lan_root_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->lan_root, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->lan_root)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->lan_root)); - if (ndr_get_array_length(ndr, &r->lan_root) > ndr_get_array_size(ndr, &r->lan_root)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->lan_root), ndr_get_array_length(ndr, &r->lan_root)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->lan_root), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->lan_root, ndr_get_array_length(ndr, &r->lan_root), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lan_root_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo102(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo102 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo102"); - ndr->depth++; - ndr_print_srvsvc_PlatformId(ndr, "platform_id", r->platform_id); - ndr_print_ptr(ndr, "server_name", r->server_name); - ndr->depth++; - if (r->server_name) { - ndr_print_string(ndr, "server_name", r->server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->domain_name); - ndr->depth++; - if (r->domain_name) { - ndr_print_string(ndr, "domain_name", r->domain_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "version_major", r->version_major); - ndr_print_uint32(ndr, "version_minor", r->version_minor); - ndr_print_ptr(ndr, "lan_root", r->lan_root); - ndr->depth++; - if (r->lan_root) { - ndr_print_string(ndr, "lan_root", r->lan_root); - } - ndr->depth--; - ndr_print_uint32(ndr, "logged_on_users", r->logged_on_users); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo502(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo502 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->char_wait)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->collection_time)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximum_collection_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keep_connection)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_commands)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_timeout)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size_char_buf)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_threads)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_quota)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_increment)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_maximum)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pipe_increment)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pipe_maximum)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->cache_file_timeout)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dormant_file_limit)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->read_ahead_throughput)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mailslot_buffers)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_srv_announce_buffers)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_illegal_dgram_events)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dgram_event_reset_freq)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->log_election_packets)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_opportunistic_locking)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_unlock_behind)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_close_behind)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_named_pipes)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_lock_read_unlock)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->utilize_nt_caching)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_raw_read)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_raw_write)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_write_raw_data)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_encryption)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_files_deny_write)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_read_only_files)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->force_core_create_mode)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_512_byte_max_transfer)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo502(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo502 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->char_wait)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->collection_time)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximum_collection_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keep_connection)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_commands)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_timeout)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size_char_buf)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_threads)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_quota)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_increment)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_maximum)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pipe_increment)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pipe_maximum)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->cache_file_timeout)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dormant_file_limit)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->read_ahead_throughput)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_mailslot_buffers)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_srv_announce_buffers)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_illegal_dgram_events)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dgram_event_reset_freq)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->log_election_packets)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_opportunistic_locking)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_unlock_behind)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_close_behind)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_named_pipes)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_lock_read_unlock)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->utilize_nt_caching)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_raw_read)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_raw_write)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_write_raw_data)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_encryption)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_files_deny_write)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_read_only_files)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->force_core_create_mode)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_512_byte_max_transfer)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo502(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo502 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo502"); - ndr->depth++; - ndr_print_uint32(ndr, "char_wait", r->char_wait); - ndr_print_uint32(ndr, "collection_time", r->collection_time); - ndr_print_uint32(ndr, "maximum_collection_count", r->maximum_collection_count); - ndr_print_uint32(ndr, "keep_connection", r->keep_connection); - ndr_print_uint32(ndr, "max_commands", r->max_commands); - ndr_print_uint32(ndr, "session_timeout", r->session_timeout); - ndr_print_uint32(ndr, "size_char_buf", r->size_char_buf); - ndr_print_uint32(ndr, "max_threads", r->max_threads); - ndr_print_uint32(ndr, "lock_quota", r->lock_quota); - ndr_print_uint32(ndr, "lock_increment", r->lock_increment); - ndr_print_uint32(ndr, "lock_maximum", r->lock_maximum); - ndr_print_uint32(ndr, "pipe_increment", r->pipe_increment); - ndr_print_uint32(ndr, "pipe_maximum", r->pipe_maximum); - ndr_print_uint32(ndr, "cache_file_timeout", r->cache_file_timeout); - ndr_print_uint32(ndr, "dormant_file_limit", r->dormant_file_limit); - ndr_print_uint32(ndr, "read_ahead_throughput", r->read_ahead_throughput); - ndr_print_uint32(ndr, "num_mailslot_buffers", r->num_mailslot_buffers); - ndr_print_uint32(ndr, "num_srv_announce_buffers", r->num_srv_announce_buffers); - ndr_print_uint32(ndr, "max_illegal_dgram_events", r->max_illegal_dgram_events); - ndr_print_uint32(ndr, "dgram_event_reset_freq", r->dgram_event_reset_freq); - ndr_print_uint32(ndr, "log_election_packets", r->log_election_packets); - ndr_print_uint32(ndr, "use_opportunistic_locking", r->use_opportunistic_locking); - ndr_print_uint32(ndr, "use_unlock_behind", r->use_unlock_behind); - ndr_print_uint32(ndr, "use_close_behind", r->use_close_behind); - ndr_print_uint32(ndr, "buf_named_pipes", r->buf_named_pipes); - ndr_print_uint32(ndr, "use_lock_read_unlock", r->use_lock_read_unlock); - ndr_print_uint32(ndr, "utilize_nt_caching", r->utilize_nt_caching); - ndr_print_uint32(ndr, "use_raw_read", r->use_raw_read); - ndr_print_uint32(ndr, "use_raw_write", r->use_raw_write); - ndr_print_uint32(ndr, "use_write_raw_data", r->use_write_raw_data); - ndr_print_uint32(ndr, "use_encryption", r->use_encryption); - ndr_print_uint32(ndr, "buf_files_deny_write", r->buf_files_deny_write); - ndr_print_uint32(ndr, "buf_read_only_files", r->buf_read_only_files); - ndr_print_uint32(ndr, "force_core_create_mode", r->force_core_create_mode); - ndr_print_uint32(ndr, "use_512_byte_max_transfer", r->use_512_byte_max_transfer); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1010(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1010 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->char_wait)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1010(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1010 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->char_wait)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1010(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1010 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1010"); - ndr->depth++; - ndr_print_uint32(ndr, "char_wait", r->char_wait); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1011(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1011 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->collection_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1011(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1011 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->collection_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1011(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1011 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1011"); - ndr->depth++; - ndr_print_uint32(ndr, "collection_time", r->collection_time); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1012(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1012 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximum_collection_count)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1012(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1012 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximum_collection_count)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1012(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1012 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1012"); - ndr->depth++; - ndr_print_uint32(ndr, "maximum_collection_count", r->maximum_collection_count); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1013(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1013 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keep_connection)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1013(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1013 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keep_connection)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1013(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1013 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1013"); - ndr->depth++; - ndr_print_uint32(ndr, "keep_connection", r->keep_connection); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1018(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1018 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_timeout)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1018(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1018 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_timeout)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1018(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1018 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1018"); - ndr->depth++; - ndr_print_uint32(ndr, "session_timeout", r->session_timeout); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1023(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1023 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size_char_buf)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1023(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1023 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size_char_buf)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1023(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1023 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1023"); - ndr->depth++; - ndr_print_uint32(ndr, "size_char_buf", r->size_char_buf); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1027(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1027 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->errorlog_sz)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1027(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1027 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->errorlog_sz)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1027(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1027 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1027"); - ndr->depth++; - ndr_print_uint32(ndr, "errorlog_sz", r->errorlog_sz); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1028(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1028 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->print_buf_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1028(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1028 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->print_buf_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1028(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1028 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1028"); - ndr->depth++; - ndr_print_uint32(ndr, "print_buf_time", r->print_buf_time); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1032(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1032 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->wrk_heuristics)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1032(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1032 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->wrk_heuristics)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1032(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1032 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1032"); - ndr->depth++; - ndr_print_uint32(ndr, "wrk_heuristics", r->wrk_heuristics); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1033(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1033 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_threads)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1033(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1033 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_threads)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1033(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1033 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1033"); - ndr->depth++; - ndr_print_uint32(ndr, "max_threads", r->max_threads); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1041(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1041 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_quota)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1041(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1041 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_quota)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1041(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1041 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1041"); - ndr->depth++; - ndr_print_uint32(ndr, "lock_quota", r->lock_quota); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1042(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1042 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_increment)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1042(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1042 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_increment)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1042(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1042 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1042"); - ndr->depth++; - ndr_print_uint32(ndr, "lock_increment", r->lock_increment); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1043(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1043 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_maximum)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1043(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1043 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_maximum)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1043(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1043 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1043"); - ndr->depth++; - ndr_print_uint32(ndr, "lock_maximum", r->lock_maximum); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1044(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1044 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pipe_increment)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1044(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1044 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pipe_increment)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1044(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1044 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1044"); - ndr->depth++; - ndr_print_uint32(ndr, "pipe_increment", r->pipe_increment); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1045(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1045 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pipe_maximum)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1045(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1045 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pipe_maximum)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1045(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1045 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1045"); - ndr->depth++; - ndr_print_uint32(ndr, "pipe_maximum", r->pipe_maximum); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1046(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1046 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dormant_file_limit)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1046(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1046 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dormant_file_limit)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1046(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1046 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1046"); - ndr->depth++; - ndr_print_uint32(ndr, "dormant_file_limit", r->dormant_file_limit); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1047(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1047 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->cache_file_timeout)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1047(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1047 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->cache_file_timeout)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1047(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1047 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1047"); - ndr->depth++; - ndr_print_uint32(ndr, "cache_file_timeout", r->cache_file_timeout); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1048(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1048 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_opportunistic_locking)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1048(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1048 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_opportunistic_locking)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1048(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1048 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1048"); - ndr->depth++; - ndr_print_uint32(ndr, "use_opportunistic_locking", r->use_opportunistic_locking); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1049(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1049 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_unlock_behind)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1049(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1049 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_unlock_behind)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1049(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1049 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1049"); - ndr->depth++; - ndr_print_uint32(ndr, "use_unlock_behind", r->use_unlock_behind); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1050(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1050 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_close_behind)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1050(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1050 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_close_behind)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1050(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1050 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1050"); - ndr->depth++; - ndr_print_uint32(ndr, "use_close_behind", r->use_close_behind); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1051(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1051 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_named_pipes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1051(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1051 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_named_pipes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1051(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1051 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1051"); - ndr->depth++; - ndr_print_uint32(ndr, "buf_named_pipes", r->buf_named_pipes); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1052(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1052 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_lock_read_unlock)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1052(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1052 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_lock_read_unlock)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1052(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1052 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1052"); - ndr->depth++; - ndr_print_uint32(ndr, "use_lock_read_unlock", r->use_lock_read_unlock); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1053(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1053 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->utilize_nt_caching)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1053(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1053 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->utilize_nt_caching)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1053(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1053 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1053"); - ndr->depth++; - ndr_print_uint32(ndr, "utilize_nt_caching", r->utilize_nt_caching); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1054(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1054 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_raw_read)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1054(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1054 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_raw_read)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1054(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1054 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1054"); - ndr->depth++; - ndr_print_uint32(ndr, "use_raw_read", r->use_raw_read); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1055(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1055 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_raw_write)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1055(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1055 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_raw_write)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1055(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1055 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1055"); - ndr->depth++; - ndr_print_uint32(ndr, "use_raw_write", r->use_raw_write); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1056(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1056 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_write_raw_data)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1056(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1056 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_write_raw_data)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1056(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1056 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1056"); - ndr->depth++; - ndr_print_uint32(ndr, "use_write_raw_data", r->use_write_raw_data); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1057(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1057 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_encryption)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1057(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1057 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_encryption)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1057(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1057 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1057"); - ndr->depth++; - ndr_print_uint32(ndr, "use_encryption", r->use_encryption); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1058(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1058 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_files_deny_write)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1058(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1058 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_files_deny_write)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1058(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1058 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1058"); - ndr->depth++; - ndr_print_uint32(ndr, "buf_files_deny_write", r->buf_files_deny_write); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1059(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1059 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_read_only_files)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1059(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1059 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_read_only_files)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1059(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1059 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1059"); - ndr->depth++; - ndr_print_uint32(ndr, "buf_read_only_files", r->buf_read_only_files); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1060(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1060 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->force_core_create_mode)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1060(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1060 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->force_core_create_mode)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1060(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1060 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1060"); - ndr->depth++; - ndr_print_uint32(ndr, "force_core_create_mode", r->force_core_create_mode); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1061(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1061 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_512_byte_max_transfer)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1061(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1061 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_512_byte_max_transfer)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1061(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1061 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1061"); - ndr->depth++; - ndr_print_uint32(ndr, "use_512_byte_max_transfer", r->use_512_byte_max_transfer); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo1062(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaInfo1062 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->read_ahead_throughput)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo1062(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaInfo1062 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->read_ahead_throughput)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo1062(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1062 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaInfo1062"); - ndr->depth++; - ndr_print_uint32(ndr, "read_ahead_throughput", r->read_ahead_throughput); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetWkstaInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 100: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info100)); - break; } - - case 101: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info101)); - break; } - - case 102: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info102)); - break; } - - case 502: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info502)); - break; } - - case 1010: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1010)); - break; } - - case 1011: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1011)); - break; } - - case 1012: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1012)); - break; } - - case 1013: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1013)); - break; } - - case 1018: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1018)); - break; } - - case 1023: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1023)); - break; } - - case 1027: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1027)); - break; } - - case 1028: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1028)); - break; } - - case 1032: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1032)); - break; } - - case 1033: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1033)); - break; } - - case 1041: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1041)); - break; } - - case 1042: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1042)); - break; } - - case 1043: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1043)); - break; } - - case 1044: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1044)); - break; } - - case 1045: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1045)); - break; } - - case 1046: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1046)); - break; } - - case 1047: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1047)); - break; } - - case 1048: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1048)); - break; } - - case 1049: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1049)); - break; } - - case 1050: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1050)); - break; } - - case 1051: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1051)); - break; } - - case 1052: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1052)); - break; } - - case 1053: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1053)); - break; } - - case 1054: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1054)); - break; } - - case 1055: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1055)); - break; } - - case 1056: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1056)); - break; } - - case 1057: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1057)); - break; } - - case 1058: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1058)); - break; } - - case 1059: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1059)); - break; } - - case 1060: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1060)); - break; } - - case 1061: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1061)); - break; } - - case 1062: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1062)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 100: - if (r->info100) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); - } - break; - - case 101: - if (r->info101) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info101)); - } - break; - - case 102: - if (r->info102) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo102(ndr, NDR_SCALARS|NDR_BUFFERS, r->info102)); - } - break; - - case 502: - if (r->info502) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo502(ndr, NDR_SCALARS, r->info502)); - } - break; - - case 1010: - if (r->info1010) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1010(ndr, NDR_SCALARS, r->info1010)); - } - break; - - case 1011: - if (r->info1011) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1011(ndr, NDR_SCALARS, r->info1011)); - } - break; - - case 1012: - if (r->info1012) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1012(ndr, NDR_SCALARS, r->info1012)); - } - break; - - case 1013: - if (r->info1013) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1013(ndr, NDR_SCALARS, r->info1013)); - } - break; - - case 1018: - if (r->info1018) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1018(ndr, NDR_SCALARS, r->info1018)); - } - break; - - case 1023: - if (r->info1023) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1023(ndr, NDR_SCALARS, r->info1023)); - } - break; - - case 1027: - if (r->info1027) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1027(ndr, NDR_SCALARS, r->info1027)); - } - break; - - case 1028: - if (r->info1028) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1028(ndr, NDR_SCALARS, r->info1028)); - } - break; - - case 1032: - if (r->info1032) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1032(ndr, NDR_SCALARS, r->info1032)); - } - break; - - case 1033: - if (r->info1033) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1033(ndr, NDR_SCALARS, r->info1033)); - } - break; - - case 1041: - if (r->info1041) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1041(ndr, NDR_SCALARS, r->info1041)); - } - break; - - case 1042: - if (r->info1042) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1042(ndr, NDR_SCALARS, r->info1042)); - } - break; - - case 1043: - if (r->info1043) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1043(ndr, NDR_SCALARS, r->info1043)); - } - break; - - case 1044: - if (r->info1044) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1044(ndr, NDR_SCALARS, r->info1044)); - } - break; - - case 1045: - if (r->info1045) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1045(ndr, NDR_SCALARS, r->info1045)); - } - break; - - case 1046: - if (r->info1046) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1046(ndr, NDR_SCALARS, r->info1046)); - } - break; - - case 1047: - if (r->info1047) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1047(ndr, NDR_SCALARS, r->info1047)); - } - break; - - case 1048: - if (r->info1048) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1048(ndr, NDR_SCALARS, r->info1048)); - } - break; - - case 1049: - if (r->info1049) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1049(ndr, NDR_SCALARS, r->info1049)); - } - break; - - case 1050: - if (r->info1050) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1050(ndr, NDR_SCALARS, r->info1050)); - } - break; - - case 1051: - if (r->info1051) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1051(ndr, NDR_SCALARS, r->info1051)); - } - break; - - case 1052: - if (r->info1052) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1052(ndr, NDR_SCALARS, r->info1052)); - } - break; - - case 1053: - if (r->info1053) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1053(ndr, NDR_SCALARS, r->info1053)); - } - break; - - case 1054: - if (r->info1054) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1054(ndr, NDR_SCALARS, r->info1054)); - } - break; - - case 1055: - if (r->info1055) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1055(ndr, NDR_SCALARS, r->info1055)); - } - break; - - case 1056: - if (r->info1056) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1056(ndr, NDR_SCALARS, r->info1056)); - } - break; - - case 1057: - if (r->info1057) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1057(ndr, NDR_SCALARS, r->info1057)); - } - break; - - case 1058: - if (r->info1058) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1058(ndr, NDR_SCALARS, r->info1058)); - } - break; - - case 1059: - if (r->info1059) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1059(ndr, NDR_SCALARS, r->info1059)); - } - break; - - case 1060: - if (r->info1060) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1060(ndr, NDR_SCALARS, r->info1060)); - } - break; - - case 1061: - if (r->info1061) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1061(ndr, NDR_SCALARS, r->info1061)); - } - break; - - case 1062: - if (r->info1062) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaInfo1062(ndr, NDR_SCALARS, r->info1062)); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaInfo(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetWkstaInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info100_0; - TALLOC_CTX *_mem_save_info101_0; - TALLOC_CTX *_mem_save_info102_0; - TALLOC_CTX *_mem_save_info502_0; - TALLOC_CTX *_mem_save_info1010_0; - TALLOC_CTX *_mem_save_info1011_0; - TALLOC_CTX *_mem_save_info1012_0; - TALLOC_CTX *_mem_save_info1013_0; - TALLOC_CTX *_mem_save_info1018_0; - TALLOC_CTX *_mem_save_info1023_0; - TALLOC_CTX *_mem_save_info1027_0; - TALLOC_CTX *_mem_save_info1028_0; - TALLOC_CTX *_mem_save_info1032_0; - TALLOC_CTX *_mem_save_info1033_0; - TALLOC_CTX *_mem_save_info1041_0; - TALLOC_CTX *_mem_save_info1042_0; - TALLOC_CTX *_mem_save_info1043_0; - TALLOC_CTX *_mem_save_info1044_0; - TALLOC_CTX *_mem_save_info1045_0; - TALLOC_CTX *_mem_save_info1046_0; - TALLOC_CTX *_mem_save_info1047_0; - TALLOC_CTX *_mem_save_info1048_0; - TALLOC_CTX *_mem_save_info1049_0; - TALLOC_CTX *_mem_save_info1050_0; - TALLOC_CTX *_mem_save_info1051_0; - TALLOC_CTX *_mem_save_info1052_0; - TALLOC_CTX *_mem_save_info1053_0; - TALLOC_CTX *_mem_save_info1054_0; - TALLOC_CTX *_mem_save_info1055_0; - TALLOC_CTX *_mem_save_info1056_0; - TALLOC_CTX *_mem_save_info1057_0; - TALLOC_CTX *_mem_save_info1058_0; - TALLOC_CTX *_mem_save_info1059_0; - TALLOC_CTX *_mem_save_info1060_0; - TALLOC_CTX *_mem_save_info1061_0; - TALLOC_CTX *_mem_save_info1062_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 100: { - uint32_t _ptr_info100; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info100)); - if (_ptr_info100) { - NDR_PULL_ALLOC(ndr, r->info100); - } else { - r->info100 = NULL; - } - break; } - - case 101: { - uint32_t _ptr_info101; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info101)); - if (_ptr_info101) { - NDR_PULL_ALLOC(ndr, r->info101); - } else { - r->info101 = NULL; - } - break; } - - case 102: { - uint32_t _ptr_info102; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info102)); - if (_ptr_info102) { - NDR_PULL_ALLOC(ndr, r->info102); - } else { - r->info102 = NULL; - } - break; } - - case 502: { - uint32_t _ptr_info502; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info502)); - if (_ptr_info502) { - NDR_PULL_ALLOC(ndr, r->info502); - } else { - r->info502 = NULL; - } - break; } - - case 1010: { - uint32_t _ptr_info1010; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1010)); - if (_ptr_info1010) { - NDR_PULL_ALLOC(ndr, r->info1010); - } else { - r->info1010 = NULL; - } - break; } - - case 1011: { - uint32_t _ptr_info1011; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1011)); - if (_ptr_info1011) { - NDR_PULL_ALLOC(ndr, r->info1011); - } else { - r->info1011 = NULL; - } - break; } - - case 1012: { - uint32_t _ptr_info1012; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1012)); - if (_ptr_info1012) { - NDR_PULL_ALLOC(ndr, r->info1012); - } else { - r->info1012 = NULL; - } - break; } - - case 1013: { - uint32_t _ptr_info1013; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1013)); - if (_ptr_info1013) { - NDR_PULL_ALLOC(ndr, r->info1013); - } else { - r->info1013 = NULL; - } - break; } - - case 1018: { - uint32_t _ptr_info1018; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1018)); - if (_ptr_info1018) { - NDR_PULL_ALLOC(ndr, r->info1018); - } else { - r->info1018 = NULL; - } - break; } - - case 1023: { - uint32_t _ptr_info1023; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1023)); - if (_ptr_info1023) { - NDR_PULL_ALLOC(ndr, r->info1023); - } else { - r->info1023 = NULL; - } - break; } - - case 1027: { - uint32_t _ptr_info1027; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1027)); - if (_ptr_info1027) { - NDR_PULL_ALLOC(ndr, r->info1027); - } else { - r->info1027 = NULL; - } - break; } - - case 1028: { - uint32_t _ptr_info1028; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1028)); - if (_ptr_info1028) { - NDR_PULL_ALLOC(ndr, r->info1028); - } else { - r->info1028 = NULL; - } - break; } - - case 1032: { - uint32_t _ptr_info1032; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1032)); - if (_ptr_info1032) { - NDR_PULL_ALLOC(ndr, r->info1032); - } else { - r->info1032 = NULL; - } - break; } - - case 1033: { - uint32_t _ptr_info1033; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1033)); - if (_ptr_info1033) { - NDR_PULL_ALLOC(ndr, r->info1033); - } else { - r->info1033 = NULL; - } - break; } - - case 1041: { - uint32_t _ptr_info1041; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1041)); - if (_ptr_info1041) { - NDR_PULL_ALLOC(ndr, r->info1041); - } else { - r->info1041 = NULL; - } - break; } - - case 1042: { - uint32_t _ptr_info1042; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1042)); - if (_ptr_info1042) { - NDR_PULL_ALLOC(ndr, r->info1042); - } else { - r->info1042 = NULL; - } - break; } - - case 1043: { - uint32_t _ptr_info1043; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1043)); - if (_ptr_info1043) { - NDR_PULL_ALLOC(ndr, r->info1043); - } else { - r->info1043 = NULL; - } - break; } - - case 1044: { - uint32_t _ptr_info1044; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1044)); - if (_ptr_info1044) { - NDR_PULL_ALLOC(ndr, r->info1044); - } else { - r->info1044 = NULL; - } - break; } - - case 1045: { - uint32_t _ptr_info1045; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1045)); - if (_ptr_info1045) { - NDR_PULL_ALLOC(ndr, r->info1045); - } else { - r->info1045 = NULL; - } - break; } - - case 1046: { - uint32_t _ptr_info1046; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1046)); - if (_ptr_info1046) { - NDR_PULL_ALLOC(ndr, r->info1046); - } else { - r->info1046 = NULL; - } - break; } - - case 1047: { - uint32_t _ptr_info1047; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1047)); - if (_ptr_info1047) { - NDR_PULL_ALLOC(ndr, r->info1047); - } else { - r->info1047 = NULL; - } - break; } - - case 1048: { - uint32_t _ptr_info1048; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1048)); - if (_ptr_info1048) { - NDR_PULL_ALLOC(ndr, r->info1048); - } else { - r->info1048 = NULL; - } - break; } - - case 1049: { - uint32_t _ptr_info1049; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1049)); - if (_ptr_info1049) { - NDR_PULL_ALLOC(ndr, r->info1049); - } else { - r->info1049 = NULL; - } - break; } - - case 1050: { - uint32_t _ptr_info1050; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1050)); - if (_ptr_info1050) { - NDR_PULL_ALLOC(ndr, r->info1050); - } else { - r->info1050 = NULL; - } - break; } - - case 1051: { - uint32_t _ptr_info1051; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1051)); - if (_ptr_info1051) { - NDR_PULL_ALLOC(ndr, r->info1051); - } else { - r->info1051 = NULL; - } - break; } - - case 1052: { - uint32_t _ptr_info1052; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1052)); - if (_ptr_info1052) { - NDR_PULL_ALLOC(ndr, r->info1052); - } else { - r->info1052 = NULL; - } - break; } - - case 1053: { - uint32_t _ptr_info1053; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1053)); - if (_ptr_info1053) { - NDR_PULL_ALLOC(ndr, r->info1053); - } else { - r->info1053 = NULL; - } - break; } - - case 1054: { - uint32_t _ptr_info1054; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1054)); - if (_ptr_info1054) { - NDR_PULL_ALLOC(ndr, r->info1054); - } else { - r->info1054 = NULL; - } - break; } - - case 1055: { - uint32_t _ptr_info1055; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1055)); - if (_ptr_info1055) { - NDR_PULL_ALLOC(ndr, r->info1055); - } else { - r->info1055 = NULL; - } - break; } - - case 1056: { - uint32_t _ptr_info1056; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1056)); - if (_ptr_info1056) { - NDR_PULL_ALLOC(ndr, r->info1056); - } else { - r->info1056 = NULL; - } - break; } - - case 1057: { - uint32_t _ptr_info1057; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1057)); - if (_ptr_info1057) { - NDR_PULL_ALLOC(ndr, r->info1057); - } else { - r->info1057 = NULL; - } - break; } - - case 1058: { - uint32_t _ptr_info1058; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1058)); - if (_ptr_info1058) { - NDR_PULL_ALLOC(ndr, r->info1058); - } else { - r->info1058 = NULL; - } - break; } - - case 1059: { - uint32_t _ptr_info1059; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1059)); - if (_ptr_info1059) { - NDR_PULL_ALLOC(ndr, r->info1059); - } else { - r->info1059 = NULL; - } - break; } - - case 1060: { - uint32_t _ptr_info1060; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1060)); - if (_ptr_info1060) { - NDR_PULL_ALLOC(ndr, r->info1060); - } else { - r->info1060 = NULL; - } - break; } - - case 1061: { - uint32_t _ptr_info1061; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1061)); - if (_ptr_info1061) { - NDR_PULL_ALLOC(ndr, r->info1061); - } else { - r->info1061 = NULL; - } - break; } - - case 1062: { - uint32_t _ptr_info1062; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1062)); - if (_ptr_info1062) { - NDR_PULL_ALLOC(ndr, r->info1062); - } else { - r->info1062 = NULL; - } - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 100: - if (r->info100) { - _mem_save_info100_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info100, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info100_0, 0); - } - break; - - case 101: - if (r->info101) { - _mem_save_info101_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info101, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info101)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info101_0, 0); - } - break; - - case 102: - if (r->info102) { - _mem_save_info102_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info102, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo102(ndr, NDR_SCALARS|NDR_BUFFERS, r->info102)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info102_0, 0); - } - break; - - case 502: - if (r->info502) { - _mem_save_info502_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info502, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo502(ndr, NDR_SCALARS, r->info502)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info502_0, 0); - } - break; - - case 1010: - if (r->info1010) { - _mem_save_info1010_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1010, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1010(ndr, NDR_SCALARS, r->info1010)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1010_0, 0); - } - break; - - case 1011: - if (r->info1011) { - _mem_save_info1011_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1011, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1011(ndr, NDR_SCALARS, r->info1011)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1011_0, 0); - } - break; - - case 1012: - if (r->info1012) { - _mem_save_info1012_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1012, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1012(ndr, NDR_SCALARS, r->info1012)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1012_0, 0); - } - break; - - case 1013: - if (r->info1013) { - _mem_save_info1013_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1013, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1013(ndr, NDR_SCALARS, r->info1013)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1013_0, 0); - } - break; - - case 1018: - if (r->info1018) { - _mem_save_info1018_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1018, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1018(ndr, NDR_SCALARS, r->info1018)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1018_0, 0); - } - break; - - case 1023: - if (r->info1023) { - _mem_save_info1023_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1023, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1023(ndr, NDR_SCALARS, r->info1023)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1023_0, 0); - } - break; - - case 1027: - if (r->info1027) { - _mem_save_info1027_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1027, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1027(ndr, NDR_SCALARS, r->info1027)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1027_0, 0); - } - break; - - case 1028: - if (r->info1028) { - _mem_save_info1028_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1028, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1028(ndr, NDR_SCALARS, r->info1028)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1028_0, 0); - } - break; - - case 1032: - if (r->info1032) { - _mem_save_info1032_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1032, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1032(ndr, NDR_SCALARS, r->info1032)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1032_0, 0); - } - break; - - case 1033: - if (r->info1033) { - _mem_save_info1033_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1033, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1033(ndr, NDR_SCALARS, r->info1033)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1033_0, 0); - } - break; - - case 1041: - if (r->info1041) { - _mem_save_info1041_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1041, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1041(ndr, NDR_SCALARS, r->info1041)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1041_0, 0); - } - break; - - case 1042: - if (r->info1042) { - _mem_save_info1042_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1042, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1042(ndr, NDR_SCALARS, r->info1042)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1042_0, 0); - } - break; - - case 1043: - if (r->info1043) { - _mem_save_info1043_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1043, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1043(ndr, NDR_SCALARS, r->info1043)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1043_0, 0); - } - break; - - case 1044: - if (r->info1044) { - _mem_save_info1044_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1044, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1044(ndr, NDR_SCALARS, r->info1044)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1044_0, 0); - } - break; - - case 1045: - if (r->info1045) { - _mem_save_info1045_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1045, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1045(ndr, NDR_SCALARS, r->info1045)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1045_0, 0); - } - break; - - case 1046: - if (r->info1046) { - _mem_save_info1046_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1046, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1046(ndr, NDR_SCALARS, r->info1046)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1046_0, 0); - } - break; - - case 1047: - if (r->info1047) { - _mem_save_info1047_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1047, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1047(ndr, NDR_SCALARS, r->info1047)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1047_0, 0); - } - break; - - case 1048: - if (r->info1048) { - _mem_save_info1048_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1048, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1048(ndr, NDR_SCALARS, r->info1048)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1048_0, 0); - } - break; - - case 1049: - if (r->info1049) { - _mem_save_info1049_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1049, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1049(ndr, NDR_SCALARS, r->info1049)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1049_0, 0); - } - break; - - case 1050: - if (r->info1050) { - _mem_save_info1050_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1050, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1050(ndr, NDR_SCALARS, r->info1050)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1050_0, 0); - } - break; - - case 1051: - if (r->info1051) { - _mem_save_info1051_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1051, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1051(ndr, NDR_SCALARS, r->info1051)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1051_0, 0); - } - break; - - case 1052: - if (r->info1052) { - _mem_save_info1052_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1052, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1052(ndr, NDR_SCALARS, r->info1052)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1052_0, 0); - } - break; - - case 1053: - if (r->info1053) { - _mem_save_info1053_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1053, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1053(ndr, NDR_SCALARS, r->info1053)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1053_0, 0); - } - break; - - case 1054: - if (r->info1054) { - _mem_save_info1054_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1054, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1054(ndr, NDR_SCALARS, r->info1054)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1054_0, 0); - } - break; - - case 1055: - if (r->info1055) { - _mem_save_info1055_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1055, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1055(ndr, NDR_SCALARS, r->info1055)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1055_0, 0); - } - break; - - case 1056: - if (r->info1056) { - _mem_save_info1056_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1056, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1056(ndr, NDR_SCALARS, r->info1056)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1056_0, 0); - } - break; - - case 1057: - if (r->info1057) { - _mem_save_info1057_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1057, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1057(ndr, NDR_SCALARS, r->info1057)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1057_0, 0); - } - break; - - case 1058: - if (r->info1058) { - _mem_save_info1058_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1058, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1058(ndr, NDR_SCALARS, r->info1058)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1058_0, 0); - } - break; - - case 1059: - if (r->info1059) { - _mem_save_info1059_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1059, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1059(ndr, NDR_SCALARS, r->info1059)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1059_0, 0); - } - break; - - case 1060: - if (r->info1060) { - _mem_save_info1060_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1060, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1060(ndr, NDR_SCALARS, r->info1060)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1060_0, 0); - } - break; - - case 1061: - if (r->info1061) { - _mem_save_info1061_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1061, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1061(ndr, NDR_SCALARS, r->info1061)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1061_0, 0); - } - break; - - case 1062: - if (r->info1062) { - _mem_save_info1062_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1062, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo1062(ndr, NDR_SCALARS, r->info1062)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1062_0, 0); - } - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaInfo(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "wkssvc_NetWkstaInfo"); - switch (level) { - case 100: - ndr_print_ptr(ndr, "info100", r->info100); - ndr->depth++; - if (r->info100) { - ndr_print_wkssvc_NetWkstaInfo100(ndr, "info100", r->info100); - } - ndr->depth--; - break; - - case 101: - ndr_print_ptr(ndr, "info101", r->info101); - ndr->depth++; - if (r->info101) { - ndr_print_wkssvc_NetWkstaInfo101(ndr, "info101", r->info101); - } - ndr->depth--; - break; - - case 102: - ndr_print_ptr(ndr, "info102", r->info102); - ndr->depth++; - if (r->info102) { - ndr_print_wkssvc_NetWkstaInfo102(ndr, "info102", r->info102); - } - ndr->depth--; - break; - - case 502: - ndr_print_ptr(ndr, "info502", r->info502); - ndr->depth++; - if (r->info502) { - ndr_print_wkssvc_NetWkstaInfo502(ndr, "info502", r->info502); - } - ndr->depth--; - break; - - case 1010: - ndr_print_ptr(ndr, "info1010", r->info1010); - ndr->depth++; - if (r->info1010) { - ndr_print_wkssvc_NetWkstaInfo1010(ndr, "info1010", r->info1010); - } - ndr->depth--; - break; - - case 1011: - ndr_print_ptr(ndr, "info1011", r->info1011); - ndr->depth++; - if (r->info1011) { - ndr_print_wkssvc_NetWkstaInfo1011(ndr, "info1011", r->info1011); - } - ndr->depth--; - break; - - case 1012: - ndr_print_ptr(ndr, "info1012", r->info1012); - ndr->depth++; - if (r->info1012) { - ndr_print_wkssvc_NetWkstaInfo1012(ndr, "info1012", r->info1012); - } - ndr->depth--; - break; - - case 1013: - ndr_print_ptr(ndr, "info1013", r->info1013); - ndr->depth++; - if (r->info1013) { - ndr_print_wkssvc_NetWkstaInfo1013(ndr, "info1013", r->info1013); - } - ndr->depth--; - break; - - case 1018: - ndr_print_ptr(ndr, "info1018", r->info1018); - ndr->depth++; - if (r->info1018) { - ndr_print_wkssvc_NetWkstaInfo1018(ndr, "info1018", r->info1018); - } - ndr->depth--; - break; - - case 1023: - ndr_print_ptr(ndr, "info1023", r->info1023); - ndr->depth++; - if (r->info1023) { - ndr_print_wkssvc_NetWkstaInfo1023(ndr, "info1023", r->info1023); - } - ndr->depth--; - break; - - case 1027: - ndr_print_ptr(ndr, "info1027", r->info1027); - ndr->depth++; - if (r->info1027) { - ndr_print_wkssvc_NetWkstaInfo1027(ndr, "info1027", r->info1027); - } - ndr->depth--; - break; - - case 1028: - ndr_print_ptr(ndr, "info1028", r->info1028); - ndr->depth++; - if (r->info1028) { - ndr_print_wkssvc_NetWkstaInfo1028(ndr, "info1028", r->info1028); - } - ndr->depth--; - break; - - case 1032: - ndr_print_ptr(ndr, "info1032", r->info1032); - ndr->depth++; - if (r->info1032) { - ndr_print_wkssvc_NetWkstaInfo1032(ndr, "info1032", r->info1032); - } - ndr->depth--; - break; - - case 1033: - ndr_print_ptr(ndr, "info1033", r->info1033); - ndr->depth++; - if (r->info1033) { - ndr_print_wkssvc_NetWkstaInfo1033(ndr, "info1033", r->info1033); - } - ndr->depth--; - break; - - case 1041: - ndr_print_ptr(ndr, "info1041", r->info1041); - ndr->depth++; - if (r->info1041) { - ndr_print_wkssvc_NetWkstaInfo1041(ndr, "info1041", r->info1041); - } - ndr->depth--; - break; - - case 1042: - ndr_print_ptr(ndr, "info1042", r->info1042); - ndr->depth++; - if (r->info1042) { - ndr_print_wkssvc_NetWkstaInfo1042(ndr, "info1042", r->info1042); - } - ndr->depth--; - break; - - case 1043: - ndr_print_ptr(ndr, "info1043", r->info1043); - ndr->depth++; - if (r->info1043) { - ndr_print_wkssvc_NetWkstaInfo1043(ndr, "info1043", r->info1043); - } - ndr->depth--; - break; - - case 1044: - ndr_print_ptr(ndr, "info1044", r->info1044); - ndr->depth++; - if (r->info1044) { - ndr_print_wkssvc_NetWkstaInfo1044(ndr, "info1044", r->info1044); - } - ndr->depth--; - break; - - case 1045: - ndr_print_ptr(ndr, "info1045", r->info1045); - ndr->depth++; - if (r->info1045) { - ndr_print_wkssvc_NetWkstaInfo1045(ndr, "info1045", r->info1045); - } - ndr->depth--; - break; - - case 1046: - ndr_print_ptr(ndr, "info1046", r->info1046); - ndr->depth++; - if (r->info1046) { - ndr_print_wkssvc_NetWkstaInfo1046(ndr, "info1046", r->info1046); - } - ndr->depth--; - break; - - case 1047: - ndr_print_ptr(ndr, "info1047", r->info1047); - ndr->depth++; - if (r->info1047) { - ndr_print_wkssvc_NetWkstaInfo1047(ndr, "info1047", r->info1047); - } - ndr->depth--; - break; - - case 1048: - ndr_print_ptr(ndr, "info1048", r->info1048); - ndr->depth++; - if (r->info1048) { - ndr_print_wkssvc_NetWkstaInfo1048(ndr, "info1048", r->info1048); - } - ndr->depth--; - break; - - case 1049: - ndr_print_ptr(ndr, "info1049", r->info1049); - ndr->depth++; - if (r->info1049) { - ndr_print_wkssvc_NetWkstaInfo1049(ndr, "info1049", r->info1049); - } - ndr->depth--; - break; - - case 1050: - ndr_print_ptr(ndr, "info1050", r->info1050); - ndr->depth++; - if (r->info1050) { - ndr_print_wkssvc_NetWkstaInfo1050(ndr, "info1050", r->info1050); - } - ndr->depth--; - break; - - case 1051: - ndr_print_ptr(ndr, "info1051", r->info1051); - ndr->depth++; - if (r->info1051) { - ndr_print_wkssvc_NetWkstaInfo1051(ndr, "info1051", r->info1051); - } - ndr->depth--; - break; - - case 1052: - ndr_print_ptr(ndr, "info1052", r->info1052); - ndr->depth++; - if (r->info1052) { - ndr_print_wkssvc_NetWkstaInfo1052(ndr, "info1052", r->info1052); - } - ndr->depth--; - break; - - case 1053: - ndr_print_ptr(ndr, "info1053", r->info1053); - ndr->depth++; - if (r->info1053) { - ndr_print_wkssvc_NetWkstaInfo1053(ndr, "info1053", r->info1053); - } - ndr->depth--; - break; - - case 1054: - ndr_print_ptr(ndr, "info1054", r->info1054); - ndr->depth++; - if (r->info1054) { - ndr_print_wkssvc_NetWkstaInfo1054(ndr, "info1054", r->info1054); - } - ndr->depth--; - break; - - case 1055: - ndr_print_ptr(ndr, "info1055", r->info1055); - ndr->depth++; - if (r->info1055) { - ndr_print_wkssvc_NetWkstaInfo1055(ndr, "info1055", r->info1055); - } - ndr->depth--; - break; - - case 1056: - ndr_print_ptr(ndr, "info1056", r->info1056); - ndr->depth++; - if (r->info1056) { - ndr_print_wkssvc_NetWkstaInfo1056(ndr, "info1056", r->info1056); - } - ndr->depth--; - break; - - case 1057: - ndr_print_ptr(ndr, "info1057", r->info1057); - ndr->depth++; - if (r->info1057) { - ndr_print_wkssvc_NetWkstaInfo1057(ndr, "info1057", r->info1057); - } - ndr->depth--; - break; - - case 1058: - ndr_print_ptr(ndr, "info1058", r->info1058); - ndr->depth++; - if (r->info1058) { - ndr_print_wkssvc_NetWkstaInfo1058(ndr, "info1058", r->info1058); - } - ndr->depth--; - break; - - case 1059: - ndr_print_ptr(ndr, "info1059", r->info1059); - ndr->depth++; - if (r->info1059) { - ndr_print_wkssvc_NetWkstaInfo1059(ndr, "info1059", r->info1059); - } - ndr->depth--; - break; - - case 1060: - ndr_print_ptr(ndr, "info1060", r->info1060); - ndr->depth++; - if (r->info1060) { - ndr_print_wkssvc_NetWkstaInfo1060(ndr, "info1060", r->info1060); - } - ndr->depth--; - break; - - case 1061: - ndr_print_ptr(ndr, "info1061", r->info1061); - ndr->depth++; - if (r->info1061) { - ndr_print_wkssvc_NetWkstaInfo1061(ndr, "info1061", r->info1061); - } - ndr->depth--; - break; - - case 1062: - ndr_print_ptr(ndr, "info1062", r->info1062); - ndr->depth++; - if (r->info1062) { - ndr_print_wkssvc_NetWkstaInfo1062(ndr, "info1062", r->info1062); - } - ndr->depth--; - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserInfo0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrWkstaUserInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserInfo0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrWkstaUserInfo0 *r) -{ - uint32_t _ptr_user_name; - TALLOC_CTX *_mem_save_user_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); - if (_ptr_user_name) { - NDR_PULL_ALLOC(ndr, r->user_name); - } else { - r->user_name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user_name) { - _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name)); - if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo0 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserInfo0"); - ndr->depth++; - ndr_print_ptr(ndr, "user_name", r->user_name); - ndr->depth++; - if (r->user_name) { - ndr_print_string(ndr, "user_name", r->user_name); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsersCtr0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaEnumUsersCtr0 *r) -{ - uint32_t cntr_user0_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries_read)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user0)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user0) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries_read)); - for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo0(ndr, NDR_SCALARS, &r->user0[cntr_user0_1])); - } - for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo0(ndr, NDR_BUFFERS, &r->user0[cntr_user0_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsersCtr0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaEnumUsersCtr0 *r) -{ - uint32_t _ptr_user0; - uint32_t cntr_user0_1; - TALLOC_CTX *_mem_save_user0_0; - TALLOC_CTX *_mem_save_user0_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entries_read)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user0)); - if (_ptr_user0) { - NDR_PULL_ALLOC(ndr, r->user0); - } else { - r->user0 = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user0) { - _mem_save_user0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user0)); - NDR_PULL_ALLOC_N(ndr, r->user0, ndr_get_array_size(ndr, &r->user0)); - _mem_save_user0_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0); - for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo0(ndr, NDR_SCALARS, &r->user0[cntr_user0_1])); - } - for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo0(ndr, NDR_BUFFERS, &r->user0[cntr_user0_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_0, 0); - } - if (r->user0) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->user0, r->entries_read)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersCtr0 *r) -{ - uint32_t cntr_user0_1; - ndr_print_struct(ndr, name, "wkssvc_NetWkstaEnumUsersCtr0"); - ndr->depth++; - ndr_print_uint32(ndr, "entries_read", r->entries_read); - ndr_print_ptr(ndr, "user0", r->user0); - ndr->depth++; - if (r->user0) { - ndr->print(ndr, "%s: ARRAY(%d)", "user0", (int)r->entries_read); - ndr->depth++; - for (cntr_user0_1=0;cntr_user0_1entries_read;cntr_user0_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_user0_1) != -1) { - ndr_print_wkssvc_NetrWkstaUserInfo0(ndr, "user0", &r->user0[cntr_user0_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserInfo1(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrWkstaUserInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->logon_domain)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->other_domains)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->logon_server)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->logon_domain) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->logon_domain, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->logon_domain, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->logon_domain, ndr_charset_length(r->logon_domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->other_domains) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->other_domains, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->other_domains, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->other_domains, ndr_charset_length(r->other_domains, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->logon_server) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->logon_server, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->logon_server, ndr_charset_length(r->logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserInfo1(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrWkstaUserInfo1 *r) -{ - uint32_t _ptr_user_name; - TALLOC_CTX *_mem_save_user_name_0; - uint32_t _ptr_logon_domain; - TALLOC_CTX *_mem_save_logon_domain_0; - uint32_t _ptr_other_domains; - TALLOC_CTX *_mem_save_other_domains_0; - uint32_t _ptr_logon_server; - TALLOC_CTX *_mem_save_logon_server_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); - if (_ptr_user_name) { - NDR_PULL_ALLOC(ndr, r->user_name); - } else { - r->user_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_domain)); - if (_ptr_logon_domain) { - NDR_PULL_ALLOC(ndr, r->logon_domain); - } else { - r->logon_domain = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_domains)); - if (_ptr_other_domains) { - NDR_PULL_ALLOC(ndr, r->other_domains); - } else { - r->other_domains = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_logon_server)); - if (_ptr_logon_server) { - NDR_PULL_ALLOC(ndr, r->logon_server); - } else { - r->logon_server = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user_name) { - _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name)); - if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); - } - if (r->logon_domain) { - _mem_save_logon_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->logon_domain, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->logon_domain)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->logon_domain)); - if (ndr_get_array_length(ndr, &r->logon_domain) > ndr_get_array_size(ndr, &r->logon_domain)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->logon_domain), ndr_get_array_length(ndr, &r->logon_domain)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->logon_domain), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->logon_domain, ndr_get_array_length(ndr, &r->logon_domain), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_domain_0, 0); - } - if (r->other_domains) { - _mem_save_other_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->other_domains, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->other_domains)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->other_domains)); - if (ndr_get_array_length(ndr, &r->other_domains) > ndr_get_array_size(ndr, &r->other_domains)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->other_domains), ndr_get_array_length(ndr, &r->other_domains)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->other_domains), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->other_domains, ndr_get_array_length(ndr, &r->other_domains), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_domains_0, 0); - } - if (r->logon_server) { - _mem_save_logon_server_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->logon_server, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->logon_server)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->logon_server)); - if (ndr_get_array_length(ndr, &r->logon_server) > ndr_get_array_size(ndr, &r->logon_server)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->logon_server), ndr_get_array_length(ndr, &r->logon_server)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->logon_server), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->logon_server, ndr_get_array_length(ndr, &r->logon_server), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserInfo1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo1 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserInfo1"); - ndr->depth++; - ndr_print_ptr(ndr, "user_name", r->user_name); - ndr->depth++; - if (r->user_name) { - ndr_print_string(ndr, "user_name", r->user_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "logon_domain", r->logon_domain); - ndr->depth++; - if (r->logon_domain) { - ndr_print_string(ndr, "logon_domain", r->logon_domain); - } - ndr->depth--; - ndr_print_ptr(ndr, "other_domains", r->other_domains); - ndr->depth++; - if (r->other_domains) { - ndr_print_string(ndr, "other_domains", r->other_domains); - } - ndr->depth--; - ndr_print_ptr(ndr, "logon_server", r->logon_server); - ndr->depth++; - if (r->logon_server) { - ndr_print_string(ndr, "logon_server", r->logon_server); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsersCtr1(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaEnumUsersCtr1 *r) -{ - uint32_t cntr_user1_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries_read)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user1)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user1) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries_read)); - for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo1(ndr, NDR_SCALARS, &r->user1[cntr_user1_1])); - } - for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo1(ndr, NDR_BUFFERS, &r->user1[cntr_user1_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsersCtr1(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaEnumUsersCtr1 *r) -{ - uint32_t _ptr_user1; - uint32_t cntr_user1_1; - TALLOC_CTX *_mem_save_user1_0; - TALLOC_CTX *_mem_save_user1_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entries_read)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user1)); - if (_ptr_user1) { - NDR_PULL_ALLOC(ndr, r->user1); - } else { - r->user1 = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->user1) { - _mem_save_user1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user1)); - NDR_PULL_ALLOC_N(ndr, r->user1, ndr_get_array_size(ndr, &r->user1)); - _mem_save_user1_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0); - for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo1(ndr, NDR_SCALARS, &r->user1[cntr_user1_1])); - } - for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo1(ndr, NDR_BUFFERS, &r->user1[cntr_user1_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_0, 0); - } - if (r->user1) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->user1, r->entries_read)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersCtr1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersCtr1 *r) -{ - uint32_t cntr_user1_1; - ndr_print_struct(ndr, name, "wkssvc_NetWkstaEnumUsersCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "entries_read", r->entries_read); - ndr_print_ptr(ndr, "user1", r->user1); - ndr->depth++; - if (r->user1) { - ndr->print(ndr, "%s: ARRAY(%d)", "user1", (int)r->entries_read); - ndr->depth++; - for (cntr_user1_1=0;cntr_user1_1entries_read;cntr_user1_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_user1_1) != -1) { - ndr_print_wkssvc_NetrWkstaUserInfo1(ndr, "user1", &r->user1[cntr_user1_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsersCtr(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetWkstaEnumUsersCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user1)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->user0) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->user0)); - } - break; - - case 1: - if (r->user1) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->user1)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsersCtr(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetWkstaEnumUsersCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_user0_0; - TALLOC_CTX *_mem_save_user1_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_user0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user0)); - if (_ptr_user0) { - NDR_PULL_ALLOC(ndr, r->user0); - } else { - r->user0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_user1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user1)); - if (_ptr_user1) { - NDR_PULL_ALLOC(ndr, r->user1); - } else { - r->user1 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->user0) { - _mem_save_user0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->user0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_0, 0); - } - break; - - case 1: - if (r->user1) { - _mem_save_user1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->user1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaEnumUsersCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "wkssvc_NetWkstaEnumUsersCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "user0", r->user0); - ndr->depth++; - if (r->user0) { - ndr_print_wkssvc_NetWkstaEnumUsersCtr0(ndr, "user0", r->user0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "user1", r->user1); - ndr->depth++; - if (r->user1) { - ndr_print_wkssvc_NetWkstaEnumUsersCtr1(ndr, "user1", r->user1); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsersInfo(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaEnumUsersInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsersInfo(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaEnumUsersInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersInfo *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaEnumUsersInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_wkssvc_NetWkstaEnumUsersCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserInfo1101(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrWkstaUserInfo1101 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->other_domains)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->other_domains) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->other_domains, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->other_domains, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->other_domains, ndr_charset_length(r->other_domains, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserInfo1101(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrWkstaUserInfo1101 *r) -{ - uint32_t _ptr_other_domains; - TALLOC_CTX *_mem_save_other_domains_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_domains)); - if (_ptr_other_domains) { - NDR_PULL_ALLOC(ndr, r->other_domains); - } else { - r->other_domains = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->other_domains) { - _mem_save_other_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->other_domains, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->other_domains)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->other_domains)); - if (ndr_get_array_length(ndr, &r->other_domains) > ndr_get_array_size(ndr, &r->other_domains)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->other_domains), ndr_get_array_length(ndr, &r->other_domains)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->other_domains), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->other_domains, ndr_get_array_length(ndr, &r->other_domains), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_domains_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserInfo1101(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo1101 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserInfo1101"); - ndr->depth++; - ndr_print_ptr(ndr, "other_domains", r->other_domains); - ndr->depth++; - if (r->other_domains) { - ndr_print_string(ndr, "other_domains", r->other_domains); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserInfo(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetrWkstaUserInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; } - - case 1101: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1101)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->info0) { - NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - } - break; - - case 1: - if (r->info1) { - NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - } - break; - - case 1101: - if (r->info1101) { - NDR_CHECK(ndr_push_wkssvc_NetrWkstaUserInfo1101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1101)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserInfo(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetrWkstaUserInfo *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info0_0; - TALLOC_CTX *_mem_save_info1_0; - TALLOC_CTX *_mem_save_info1101_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_info0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); - if (_ptr_info0) { - NDR_PULL_ALLOC(ndr, r->info0); - } else { - r->info0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_info1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); - if (_ptr_info1) { - NDR_PULL_ALLOC(ndr, r->info1); - } else { - r->info1 = NULL; - } - break; } - - case 1101: { - uint32_t _ptr_info1101; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1101)); - if (_ptr_info1101) { - NDR_PULL_ALLOC(ndr, r->info1101); - } else { - r->info1101 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->info0) { - _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); - } - break; - - case 1: - if (r->info1) { - _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); - } - break; - - case 1101: - if (r->info1101) { - _mem_save_info1101_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1101, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo1101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1101)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1101_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserInfo(struct ndr_print *ndr, const char *name, const union wkssvc_NetrWkstaUserInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "wkssvc_NetrWkstaUserInfo"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "info0", r->info0); - ndr->depth++; - if (r->info0) { - ndr_print_wkssvc_NetrWkstaUserInfo0(ndr, "info0", r->info0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "info1", r->info1); - ndr->depth++; - if (r->info1) { - ndr_print_wkssvc_NetrWkstaUserInfo1(ndr, "info1", r->info1); - } - ndr->depth--; - break; - - case 1101: - ndr_print_ptr(ndr, "info1101", r->info1101); - ndr->depth++; - if (r->info1101) { - ndr_print_wkssvc_NetrWkstaUserInfo1101(ndr, "info1101", r->info1101); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportInfo0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaTransportInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->quality_of_service)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->vc_count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->address)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->wan_link)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->address) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->address, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->address, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->address, ndr_charset_length(r->address, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportInfo0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaTransportInfo0 *r) -{ - uint32_t _ptr_name; - TALLOC_CTX *_mem_save_name_0; - uint32_t _ptr_address; - TALLOC_CTX *_mem_save_address_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->quality_of_service)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vc_count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); - if (_ptr_name) { - NDR_PULL_ALLOC(ndr, r->name); - } else { - r->name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_address)); - if (_ptr_address) { - NDR_PULL_ALLOC(ndr, r->address); - } else { - r->address = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->wan_link)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->name) { - _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->name)); - if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); - } - if (r->address) { - _mem_save_address_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->address, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->address)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->address)); - if (ndr_get_array_length(ndr, &r->address) > ndr_get_array_size(ndr, &r->address)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->address), ndr_get_array_length(ndr, &r->address)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->address), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->address, ndr_get_array_length(ndr, &r->address), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_address_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportInfo0 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaTransportInfo0"); - ndr->depth++; - ndr_print_uint32(ndr, "quality_of_service", r->quality_of_service); - ndr_print_uint32(ndr, "vc_count", r->vc_count); - ndr_print_ptr(ndr, "name", r->name); - ndr->depth++; - if (r->name) { - ndr_print_string(ndr, "name", r->name); - } - ndr->depth--; - ndr_print_ptr(ndr, "address", r->address); - ndr->depth++; - if (r->address) { - ndr_print_string(ndr, "address", r->address); - } - ndr->depth--; - ndr_print_uint32(ndr, "wan_link", r->wan_link); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportCtr0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaTransportCtr0 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportCtr0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaTransportCtr0 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportCtr0 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "wkssvc_NetWkstaTransportCtr0"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_wkssvc_NetWkstaTransportInfo0(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportCtr(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetWkstaTransportCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->ctr0) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportCtr(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetWkstaTransportCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_ctr0_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_ctr0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); - if (_ptr_ctr0) { - NDR_PULL_ALLOC(ndr, r->ctr0); - } else { - r->ctr0 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->ctr0) { - _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaTransportCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "wkssvc_NetWkstaTransportCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "ctr0", r->ctr0); - ndr->depth++; - if (r->ctr0) { - ndr_print_wkssvc_NetWkstaTransportCtr0(ndr, "ctr0", r->ctr0); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportInfo(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetWkstaTransportInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportInfo(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetWkstaTransportInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportInfo *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaTransportInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_wkssvc_NetWkstaTransportCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseInfo3(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseInfo3 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown1)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown2)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->unknown1) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown1, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown1, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown1, ndr_charset_length(r->unknown1, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->unknown2) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown2, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown2, ndr_charset_length(r->unknown2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseInfo3(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseInfo3 *r) -{ - uint32_t _ptr_unknown1; - TALLOC_CTX *_mem_save_unknown1_0; - uint32_t _ptr_unknown2; - TALLOC_CTX *_mem_save_unknown2_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown1)); - if (_ptr_unknown1) { - NDR_PULL_ALLOC(ndr, r->unknown1); - } else { - r->unknown1 = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); - if (_ptr_unknown2) { - NDR_PULL_ALLOC(ndr, r->unknown2); - } else { - r->unknown2 = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->unknown1) { - _mem_save_unknown1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->unknown1, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown1)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown1)); - if (ndr_get_array_length(ndr, &r->unknown1) > ndr_get_array_size(ndr, &r->unknown1)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown1), ndr_get_array_length(ndr, &r->unknown1)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown1), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown1, ndr_get_array_length(ndr, &r->unknown1), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown1_0, 0); - } - if (r->unknown2) { - _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->unknown2, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->unknown2)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->unknown2)); - if (ndr_get_array_length(ndr, &r->unknown2) > ndr_get_array_size(ndr, &r->unknown2)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unknown2), ndr_get_array_length(ndr, &r->unknown2)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown2, ndr_get_array_length(ndr, &r->unknown2), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseInfo3(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo3 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUseInfo3"); - ndr->depth++; - ndr_print_ptr(ndr, "unknown1", r->unknown1); - ndr->depth++; - if (r->unknown1) { - ndr_print_string(ndr, "unknown1", r->unknown1); - } - ndr->depth--; - ndr_print_ptr(ndr, "unknown2", r->unknown2); - ndr->depth++; - if (r->unknown2) { - ndr_print_string(ndr, "unknown2", r->unknown2); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseInfo2(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseInfo2 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->local)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->asg_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ref_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->local) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->local, ndr_charset_length(r->local, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->remote) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote, ndr_charset_length(r->remote, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->password, ndr_charset_length(r->password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->user_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->domain_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->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->domain_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseInfo2(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseInfo2 *r) -{ - uint32_t _ptr_local; - TALLOC_CTX *_mem_save_local_0; - uint32_t _ptr_remote; - TALLOC_CTX *_mem_save_remote_0; - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_password_0; - uint32_t _ptr_user_name; - TALLOC_CTX *_mem_save_user_name_0; - uint32_t _ptr_domain_name; - TALLOC_CTX *_mem_save_domain_name_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local)); - if (_ptr_local) { - NDR_PULL_ALLOC(ndr, r->local); - } else { - r->local = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote)); - if (_ptr_remote) { - NDR_PULL_ALLOC(ndr, r->remote); - } else { - r->remote = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->password); - } else { - r->password = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->asg_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ref_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); - if (_ptr_user_name) { - NDR_PULL_ALLOC(ndr, r->user_name); - } else { - r->user_name = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); - if (_ptr_domain_name) { - NDR_PULL_ALLOC(ndr, r->domain_name); - } else { - r->domain_name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->local) { - _mem_save_local_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->local, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->local)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->local)); - if (ndr_get_array_length(ndr, &r->local) > ndr_get_array_size(ndr, &r->local)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->local), ndr_get_array_length(ndr, &r->local)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_0, 0); - } - if (r->remote) { - _mem_save_remote_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->remote, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->remote)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->remote)); - if (ndr_get_array_length(ndr, &r->remote) > ndr_get_array_size(ndr, &r->remote)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote), ndr_get_array_length(ndr, &r->remote)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_0, 0); - } - if (r->password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->password)); - if (ndr_get_array_length(ndr, &r->password) > ndr_get_array_size(ndr, &r->password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->password), ndr_get_array_length(ndr, &r->password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->password, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - if (r->user_name) { - _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name)); - if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); - } - if (r->domain_name) { - _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name)); - if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain_name), ndr_get_array_length(ndr, &r->domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseInfo2(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo2 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUseInfo2"); - ndr->depth++; - ndr_print_ptr(ndr, "local", r->local); - ndr->depth++; - if (r->local) { - ndr_print_string(ndr, "local", r->local); - } - ndr->depth--; - ndr_print_ptr(ndr, "remote", r->remote); - ndr->depth++; - if (r->remote) { - ndr_print_string(ndr, "remote", r->remote); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->password); - ndr->depth++; - if (r->password) { - ndr_print_string(ndr, "password", r->password); - } - ndr->depth--; - ndr_print_uint32(ndr, "status", r->status); - ndr_print_uint32(ndr, "asg_type", r->asg_type); - ndr_print_uint32(ndr, "ref_count", r->ref_count); - ndr_print_uint32(ndr, "use_count", r->use_count); - ndr_print_ptr(ndr, "user_name", r->user_name); - ndr->depth++; - if (r->user_name) { - ndr_print_string(ndr, "user_name", r->user_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->domain_name); - ndr->depth++; - if (r->domain_name) { - ndr_print_string(ndr, "domain_name", r->domain_name); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseInfo1(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->local)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->asg_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ref_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->use_count)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->local) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->local, ndr_charset_length(r->local, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->remote) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote, ndr_charset_length(r->remote, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->password, ndr_charset_length(r->password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseInfo1(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseInfo1 *r) -{ - uint32_t _ptr_local; - TALLOC_CTX *_mem_save_local_0; - uint32_t _ptr_remote; - TALLOC_CTX *_mem_save_remote_0; - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_password_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local)); - if (_ptr_local) { - NDR_PULL_ALLOC(ndr, r->local); - } else { - r->local = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote)); - if (_ptr_remote) { - NDR_PULL_ALLOC(ndr, r->remote); - } else { - r->remote = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->password); - } else { - r->password = NULL; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->asg_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ref_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->use_count)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->local) { - _mem_save_local_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->local, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->local)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->local)); - if (ndr_get_array_length(ndr, &r->local) > ndr_get_array_size(ndr, &r->local)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->local), ndr_get_array_length(ndr, &r->local)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_0, 0); - } - if (r->remote) { - _mem_save_remote_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->remote, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->remote)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->remote)); - if (ndr_get_array_length(ndr, &r->remote) > ndr_get_array_size(ndr, &r->remote)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote), ndr_get_array_length(ndr, &r->remote)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_0, 0); - } - if (r->password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->password)); - if (ndr_get_array_length(ndr, &r->password) > ndr_get_array_size(ndr, &r->password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->password), ndr_get_array_length(ndr, &r->password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->password, ndr_get_array_length(ndr, &r->password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseInfo1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo1 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUseInfo1"); - ndr->depth++; - ndr_print_ptr(ndr, "local", r->local); - ndr->depth++; - if (r->local) { - ndr_print_string(ndr, "local", r->local); - } - ndr->depth--; - ndr_print_ptr(ndr, "remote", r->remote); - ndr->depth++; - if (r->remote) { - ndr_print_string(ndr, "remote", r->remote); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->password); - ndr->depth++; - if (r->password) { - ndr_print_string(ndr, "password", r->password); - } - ndr->depth--; - ndr_print_uint32(ndr, "status", r->status); - ndr_print_uint32(ndr, "asg_type", r->asg_type); - ndr_print_uint32(ndr, "ref_count", r->ref_count); - ndr_print_uint32(ndr, "use_count", r->use_count); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseInfo0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseInfo0 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->local)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->local) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->local, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->local, ndr_charset_length(r->local, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->remote) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote, ndr_charset_length(r->remote, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseInfo0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseInfo0 *r) -{ - uint32_t _ptr_local; - TALLOC_CTX *_mem_save_local_0; - uint32_t _ptr_remote; - TALLOC_CTX *_mem_save_remote_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local)); - if (_ptr_local) { - NDR_PULL_ALLOC(ndr, r->local); - } else { - r->local = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote)); - if (_ptr_remote) { - NDR_PULL_ALLOC(ndr, r->remote); - } else { - r->remote = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->local) { - _mem_save_local_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->local, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->local)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->local)); - if (ndr_get_array_length(ndr, &r->local) > ndr_get_array_size(ndr, &r->local)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->local), ndr_get_array_length(ndr, &r->local)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local, ndr_get_array_length(ndr, &r->local), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_0, 0); - } - if (r->remote) { - _mem_save_remote_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->remote, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->remote)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->remote)); - if (ndr_get_array_length(ndr, &r->remote) > ndr_get_array_size(ndr, &r->remote)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->remote), ndr_get_array_length(ndr, &r->remote)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote, ndr_get_array_length(ndr, &r->remote), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo0 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUseInfo0"); - ndr->depth++; - ndr_print_ptr(ndr, "local", r->local); - ndr->depth++; - if (r->local) { - ndr_print_string(ndr, "local", r->local); - } - ndr->depth--; - ndr_print_ptr(ndr, "remote", r->remote); - ndr->depth++; - if (r->remote) { - ndr_print_string(ndr, "remote", r->remote); - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseGetInfoCtr(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetrUseGetInfoCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; } - - case 3: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->info0) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - } - break; - - case 1: - if (r->info1) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - } - break; - - case 2: - if (r->info2) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - } - break; - - case 3: - if (r->info3) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseGetInfoCtr(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetrUseGetInfoCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_info0_0; - TALLOC_CTX *_mem_save_info1_0; - TALLOC_CTX *_mem_save_info2_0; - TALLOC_CTX *_mem_save_info3_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_info0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0)); - if (_ptr_info0) { - NDR_PULL_ALLOC(ndr, r->info0); - } else { - r->info0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_info1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); - if (_ptr_info1) { - NDR_PULL_ALLOC(ndr, r->info1); - } else { - r->info1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_info2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); - if (_ptr_info2) { - NDR_PULL_ALLOC(ndr, r->info2); - } else { - r->info2 = NULL; - } - break; } - - case 3: { - uint32_t _ptr_info3; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); - if (_ptr_info3) { - NDR_PULL_ALLOC(ndr, r->info3); - } else { - r->info3 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->info0) { - _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0); - } - break; - - case 1: - if (r->info1) { - _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); - } - break; - - case 2: - if (r->info2) { - _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); - } - break; - - case 3: - if (r->info3) { - _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseGetInfoCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetrUseGetInfoCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "wkssvc_NetrUseGetInfoCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "info0", r->info0); - ndr->depth++; - if (r->info0) { - ndr_print_wkssvc_NetrUseInfo0(ndr, "info0", r->info0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "info1", r->info1); - ndr->depth++; - if (r->info1) { - ndr_print_wkssvc_NetrUseInfo1(ndr, "info1", r->info1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "info2", r->info2); - ndr->depth++; - if (r->info2) { - ndr_print_wkssvc_NetrUseInfo2(ndr, "info2", r->info2); - } - ndr->depth--; - break; - - case 3: - ndr_print_ptr(ndr, "info3", r->info3); - ndr->depth++; - if (r->info3) { - ndr_print_wkssvc_NetrUseInfo3(ndr, "info3", r->info3); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumCtr2(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseEnumCtr2 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumCtr2(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseEnumCtr2 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr2(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr2 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "wkssvc_NetrUseEnumCtr2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_wkssvc_NetrUseInfo2(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumCtr1(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseEnumCtr1 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumCtr1(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseEnumCtr1 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr1 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "wkssvc_NetrUseEnumCtr1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_wkssvc_NetrUseInfo1(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumCtr0(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseEnumCtr0 *r) -{ - uint32_t cntr_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->array)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_push_wkssvc_NetrUseInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumCtr0(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseEnumCtr0 *r) -{ - uint32_t _ptr_array; - uint32_t cntr_array_1; - TALLOC_CTX *_mem_save_array_0; - TALLOC_CTX *_mem_save_array_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array)); - if (_ptr_array) { - NDR_PULL_ALLOC(ndr, r->array); - } else { - r->array = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->array) { - _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); - NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); - _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1])); - } - for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { - NDR_CHECK(ndr_pull_wkssvc_NetrUseInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); - } - if (r->array) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr0 *r) -{ - uint32_t cntr_array_1; - ndr_print_struct(ndr, name, "wkssvc_NetrUseEnumCtr0"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "array", r->array); - ndr->depth++; - if (r->array) { - ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count); - ndr->depth++; - for (cntr_array_1=0;cntr_array_1count;cntr_array_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { - ndr_print_wkssvc_NetrUseInfo0(ndr, "array", &r->array[cntr_array_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumCtr(struct ndr_push *ndr, int ndr_flags, const union wkssvc_NetrUseEnumCtr *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); - switch (level) { - case 0: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; } - - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 0: - if (r->ctr0) { - NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - } - break; - - case 1: - if (r->ctr1) { - NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - } - break; - - case 2: - if (r->ctr2) { - NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumCtr(struct ndr_pull *ndr, int ndr_flags, union wkssvc_NetrUseEnumCtr *r) -{ - int level; - uint32_t _level; - TALLOC_CTX *_mem_save_ctr0_0; - TALLOC_CTX *_mem_save_ctr1_0; - TALLOC_CTX *_mem_save_ctr2_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 0: { - uint32_t _ptr_ctr0; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0)); - if (_ptr_ctr0) { - NDR_PULL_ALLOC(ndr, r->ctr0); - } else { - r->ctr0 = NULL; - } - break; } - - case 1: { - uint32_t _ptr_ctr1; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1)); - if (_ptr_ctr1) { - NDR_PULL_ALLOC(ndr, r->ctr1); - } else { - r->ctr1 = NULL; - } - break; } - - case 2: { - uint32_t _ptr_ctr2; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2)); - if (_ptr_ctr2) { - NDR_PULL_ALLOC(ndr, r->ctr2); - } else { - r->ctr2 = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 0: - if (r->ctr0) { - _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0); - } - break; - - case 1: - if (r->ctr1) { - _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0); - } - break; - - case 2: - if (r->ctr2) { - _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetrUseEnumCtr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "wkssvc_NetrUseEnumCtr"); - switch (level) { - case 0: - ndr_print_ptr(ndr, "ctr0", r->ctr0); - ndr->depth++; - if (r->ctr0) { - ndr_print_wkssvc_NetrUseEnumCtr0(ndr, "ctr0", r->ctr0); - } - ndr->depth--; - break; - - case 1: - ndr_print_ptr(ndr, "ctr1", r->ctr1); - ndr->depth++; - if (r->ctr1) { - ndr_print_wkssvc_NetrUseEnumCtr1(ndr, "ctr1", r->ctr1); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "ctr2", r->ctr2); - ndr->depth++; - if (r->ctr2) { - ndr_print_wkssvc_NetrUseEnumCtr2(ndr, "ctr2", r->ctr2); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumInfo(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrUseEnumInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_wkssvc_NetrUseEnumCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnumInfo(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrUseEnumInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level)); - NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr(ndr, NDR_SCALARS, &r->ctr)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumCtr(ndr, NDR_BUFFERS, &r->ctr)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseEnumInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumInfo *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUseEnumInfo"); - ndr->depth++; - ndr_print_uint32(ndr, "level", r->level); - ndr_print_set_switch_value(ndr, &r->ctr, r->level); - ndr_print_wkssvc_NetrUseEnumCtr(ndr, "ctr", &r->ctr); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWorkstationStatistics(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_NetrWorkstationStatistics *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 8)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown1)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown2)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown3)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown4)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown5)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown6)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown7)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown8)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown9)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown10)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown11)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown12)); - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown13)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown14)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown15)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown17)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown18)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown19)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown20)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown21)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown22)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown23)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown24)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown25)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown26)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown27)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown28)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown29)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown30)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown31)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown32)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown33)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown34)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown35)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown36)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown37)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown38)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown39)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown40)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWorkstationStatistics(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_NetrWorkstationStatistics *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 8)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown2)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown3)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown4)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown5)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown6)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown7)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown8)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown9)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown10)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown11)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown12)); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown13)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown14)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown15)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown17)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown18)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown19)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown20)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown21)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown22)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown23)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown24)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown25)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown26)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown27)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown28)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown29)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown30)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown31)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown32)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown33)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown34)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown35)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown36)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown37)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown38)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown39)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown40)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWorkstationStatistics(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWorkstationStatistics *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrWorkstationStatistics"); - ndr->depth++; - ndr_print_hyper(ndr, "unknown1", r->unknown1); - ndr_print_hyper(ndr, "unknown2", r->unknown2); - ndr_print_hyper(ndr, "unknown3", r->unknown3); - ndr_print_hyper(ndr, "unknown4", r->unknown4); - ndr_print_hyper(ndr, "unknown5", r->unknown5); - ndr_print_hyper(ndr, "unknown6", r->unknown6); - ndr_print_hyper(ndr, "unknown7", r->unknown7); - ndr_print_hyper(ndr, "unknown8", r->unknown8); - ndr_print_hyper(ndr, "unknown9", r->unknown9); - ndr_print_hyper(ndr, "unknown10", r->unknown10); - ndr_print_hyper(ndr, "unknown11", r->unknown11); - ndr_print_hyper(ndr, "unknown12", r->unknown12); - ndr_print_hyper(ndr, "unknown13", r->unknown13); - ndr_print_uint32(ndr, "unknown14", r->unknown14); - ndr_print_uint32(ndr, "unknown15", r->unknown15); - ndr_print_uint32(ndr, "unknown16", r->unknown16); - ndr_print_uint32(ndr, "unknown17", r->unknown17); - ndr_print_uint32(ndr, "unknown18", r->unknown18); - ndr_print_uint32(ndr, "unknown19", r->unknown19); - ndr_print_uint32(ndr, "unknown20", r->unknown20); - ndr_print_uint32(ndr, "unknown21", r->unknown21); - ndr_print_uint32(ndr, "unknown22", r->unknown22); - ndr_print_uint32(ndr, "unknown23", r->unknown23); - ndr_print_uint32(ndr, "unknown24", r->unknown24); - ndr_print_uint32(ndr, "unknown25", r->unknown25); - ndr_print_uint32(ndr, "unknown26", r->unknown26); - ndr_print_uint32(ndr, "unknown27", r->unknown27); - ndr_print_uint32(ndr, "unknown28", r->unknown28); - ndr_print_uint32(ndr, "unknown29", r->unknown29); - ndr_print_uint32(ndr, "unknown30", r->unknown30); - ndr_print_uint32(ndr, "unknown31", r->unknown31); - ndr_print_uint32(ndr, "unknown32", r->unknown32); - ndr_print_uint32(ndr, "unknown33", r->unknown33); - ndr_print_uint32(ndr, "unknown34", r->unknown34); - ndr_print_uint32(ndr, "unknown35", r->unknown35); - ndr_print_uint32(ndr, "unknown36", r->unknown36); - ndr_print_uint32(ndr, "unknown37", r->unknown37); - ndr_print_uint32(ndr, "unknown38", r->unknown38); - ndr_print_uint32(ndr, "unknown39", r->unknown39); - ndr_print_uint32(ndr, "unknown40", r->unknown40); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_renameflags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_renameflags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_renameflags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE", WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetValidateNameType(struct ndr_push *ndr, int ndr_flags, enum wkssvc_NetValidateNameType r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetValidateNameType(struct ndr_pull *ndr, int ndr_flags, enum wkssvc_NetValidateNameType *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetValidateNameType(struct ndr_print *ndr, const char *name, enum wkssvc_NetValidateNameType r) -{ - const char *val = NULL; - - switch (r) { - case NetSetupUnknown: val = "NetSetupUnknown"; break; - case NetSetupMachine: val = "NetSetupMachine"; break; - case NetSetupWorkgroup: val = "NetSetupWorkgroup"; break; - case NetSetupDomain: val = "NetSetupDomain"; break; - case NetSetupNonExistentDomain: val = "NetSetupNonExistentDomain"; break; - case NetSetupDnsMachine: val = "NetSetupDnsMachine"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_wkssvc_NetJoinStatus(struct ndr_push *ndr, int ndr_flags, enum wkssvc_NetJoinStatus r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetJoinStatus(struct ndr_pull *ndr, int ndr_flags, enum wkssvc_NetJoinStatus *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetJoinStatus(struct ndr_print *ndr, const char *name, enum wkssvc_NetJoinStatus r) -{ - const char *val = NULL; - - switch (r) { - case NET_SETUP_UNKNOWN_STATUS: val = "NET_SETUP_UNKNOWN_STATUS"; break; - case NET_SETUP_UNJOINED: val = "NET_SETUP_UNJOINED"; break; - case NET_SETUP_WORKGROUP_NAME: val = "NET_SETUP_WORKGROUP_NAME"; break; - case NET_SETUP_DOMAIN_NAME: val = "NET_SETUP_DOMAIN_NAME"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_wkssvc_PasswordBuffer(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_PasswordBuffer *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 1)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 524)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_PasswordBuffer(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_PasswordBuffer *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 1)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 524)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_PasswordBuffer(struct ndr_print *ndr, const char *name, const struct wkssvc_PasswordBuffer *r) -{ - ndr_print_struct(ndr, name, "wkssvc_PasswordBuffer"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_array_uint8(ndr, "data", r->data, 524); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -static enum ndr_err_code ndr_push_wkssvc_joinflags(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_joinflags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_joinflags(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME", WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT", WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_DEFER_SPN", WKSSVC_JOIN_FLAGS_DEFER_SPN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED", WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_UNSECURE", WKSSVC_JOIN_FLAGS_JOIN_UNSECURE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED", WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_WIN9X_UPGRADE", WKSSVC_JOIN_FLAGS_WIN9X_UPGRADE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE", WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE", WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WKSSVC_JOIN_FLAGS_JOIN_TYPE", WKSSVC_JOIN_FLAGS_JOIN_TYPE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_ComputerNameType(struct ndr_push *ndr, int ndr_flags, enum wkssvc_ComputerNameType r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_ComputerNameType(struct ndr_pull *ndr, int ndr_flags, enum wkssvc_ComputerNameType *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_ComputerNameType(struct ndr_print *ndr, const char *name, enum wkssvc_ComputerNameType r) -{ - const char *val = NULL; - - switch (r) { - case NetPrimaryComputerName: val = "NetPrimaryComputerName"; break; - case NetAlternateComputerNames: val = "NetAlternateComputerNames"; break; - case NetAllComputerNames: val = "NetAllComputerNames"; break; - case NetComputerNameTypeMax: val = "NetComputerNameTypeMax"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_wkssvc_ComputerNamesCtr(struct ndr_push *ndr, int ndr_flags, const struct wkssvc_ComputerNamesCtr *r) -{ - uint32_t cntr_computer_name_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_name)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->computer_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); - for (cntr_computer_name_1 = 0; cntr_computer_name_1 < r->count; cntr_computer_name_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->computer_name[cntr_computer_name_1])); - } - for (cntr_computer_name_1 = 0; cntr_computer_name_1 < r->count; cntr_computer_name_1++) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->computer_name[cntr_computer_name_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_ComputerNamesCtr(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_ComputerNamesCtr *r) -{ - uint32_t _ptr_computer_name; - uint32_t cntr_computer_name_1; - TALLOC_CTX *_mem_save_computer_name_0; - TALLOC_CTX *_mem_save_computer_name_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); - if (_ptr_computer_name) { - NDR_PULL_ALLOC(ndr, r->computer_name); - } else { - r->computer_name = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->computer_name) { - _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->computer_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_name)); - NDR_PULL_ALLOC_N(ndr, r->computer_name, ndr_get_array_size(ndr, &r->computer_name)); - _mem_save_computer_name_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->computer_name, 0); - for (cntr_computer_name_1 = 0; cntr_computer_name_1 < r->count; cntr_computer_name_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->computer_name[cntr_computer_name_1])); - } - for (cntr_computer_name_1 = 0; cntr_computer_name_1 < r->count; cntr_computer_name_1++) { - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->computer_name[cntr_computer_name_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); - } - if (r->computer_name) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->computer_name, r->count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_ComputerNamesCtr(struct ndr_print *ndr, const char *name, const struct wkssvc_ComputerNamesCtr *r) -{ - uint32_t cntr_computer_name_1; - ndr_print_struct(ndr, name, "wkssvc_ComputerNamesCtr"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "computer_name", r->computer_name); - ndr->depth++; - if (r->computer_name) { - ndr->print(ndr, "%s: ARRAY(%d)", "computer_name", (int)r->count); - ndr->depth++; - for (cntr_computer_name_1=0;cntr_computer_name_1count;cntr_computer_name_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_computer_name_1) != -1) { - ndr_print_lsa_String(ndr, "computer_name", &r->computer_name[cntr_computer_name_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaGetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetWkstaGetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaGetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetWkstaGetInfo *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaGetInfo *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaGetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetWkstaGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetWkstaGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_wkssvc_NetWkstaInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaSetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetWkstaSetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - 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 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 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)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaSetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetWkstaSetInfo *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_parm_error_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.parm_error); - } - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_error, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.parm_error); - *r->out.parm_error = *r->in.parm_error; - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.parm_error); - } - _mem_save_parm_error_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_error, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_error)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_error_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaSetInfo *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaSetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetWkstaSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_wkssvc_NetWkstaInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_ptr(ndr, "parm_error", r->in.parm_error); - ndr->depth++; - ndr_print_uint32(ndr, "parm_error", *r->in.parm_error); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetWkstaSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "parm_error", r->out.parm_error); - ndr->depth++; - ndr_print_uint32(ndr, "parm_error", *r->out.parm_error); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsers(struct ndr_push *ndr, int flags, const struct wkssvc_NetWkstaEnumUsers *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.prefmaxlen)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_wkssvc_NetWkstaEnumUsersInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - if (r->out.entries_read == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.entries_read)); - 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)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaEnumUsers(struct ndr_pull *ndr, int flags, struct wkssvc_NetWkstaEnumUsers *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_entries_read_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.prefmaxlen)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info); - *r->out.info = *r->in.info; - NDR_PULL_ALLOC(ndr, r->out.entries_read); - ZERO_STRUCTP(r->out.entries_read); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaEnumUsersInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.entries_read); - } - _mem_save_entries_read_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.entries_read, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.entries_read)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_read_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsers(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaEnumUsers *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaEnumUsers"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetWkstaEnumUsers"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_wkssvc_NetWkstaEnumUsersInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_uint32(ndr, "prefmaxlen", r->in.prefmaxlen); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetWkstaEnumUsers"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_wkssvc_NetWkstaEnumUsersInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_ptr(ndr, "entries_read", r->out.entries_read); - ndr->depth++; - ndr_print_uint32(ndr, "entries_read", *r->out.entries_read); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserGetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWkstaUserGetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); - if (r->in.unknown) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown, ndr_charset_length(r->in.unknown, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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_NetrWkstaUserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserGetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWkstaUserGetInfo *r) -{ - uint32_t _ptr_unknown; - TALLOC_CTX *_mem_save_unknown_0; - TALLOC_CTX *_mem_save_info_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); - if (_ptr_unknown) { - NDR_PULL_ALLOC(ndr, r->in.unknown); - } else { - r->in.unknown = NULL; - } - if (r->in.unknown) { - _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown)); - if (ndr_get_array_length(ndr, &r->in.unknown) > ndr_get_array_size(ndr, &r->in.unknown)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown), ndr_get_array_length(ndr, &r->in.unknown)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaUserGetInfo *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserGetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrWkstaUserGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "unknown", r->in.unknown); - ndr->depth++; - if (r->in.unknown) { - ndr_print_string(ndr, "unknown", r->in.unknown); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrWkstaUserGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_wkssvc_NetrWkstaUserInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserSetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWkstaUserSetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); - if (r->in.unknown) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown, ndr_charset_length(r->in.unknown, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - 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_NetrWkstaUserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_err)); - if (r->in.parm_err) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_err)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_err)); - if (r->out.parm_err) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_err)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaUserSetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWkstaUserSetInfo *r) -{ - uint32_t _ptr_unknown; - uint32_t _ptr_parm_err; - TALLOC_CTX *_mem_save_unknown_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_parm_err_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); - if (_ptr_unknown) { - NDR_PULL_ALLOC(ndr, r->in.unknown); - } else { - r->in.unknown = NULL; - } - if (r->in.unknown) { - _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown)); - if (ndr_get_array_length(ndr, &r->in.unknown) > ndr_get_array_size(ndr, &r->in.unknown)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown), ndr_get_array_length(ndr, &r->in.unknown)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); - NDR_CHECK(ndr_pull_wkssvc_NetrWkstaUserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); - if (_ptr_parm_err) { - NDR_PULL_ALLOC(ndr, r->in.parm_err); - } else { - r->in.parm_err = NULL; - } - if (r->in.parm_err) { - _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_err, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_err)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); - if (_ptr_parm_err) { - NDR_PULL_ALLOC(ndr, r->out.parm_err); - } else { - r->out.parm_err = NULL; - } - if (r->out.parm_err) { - _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_err, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_err)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWkstaUserSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaUserSetInfo *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrWkstaUserSetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrWkstaUserSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "unknown", r->in.unknown); - ndr->depth++; - if (r->in.unknown) { - ndr_print_string(ndr, "unknown", r->in.unknown); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.info, r->in.level); - ndr_print_wkssvc_NetrWkstaUserInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_ptr(ndr, "parm_err", r->in.parm_err); - ndr->depth++; - if (r->in.parm_err) { - ndr_print_uint32(ndr, "parm_err", *r->in.parm_err); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrWkstaUserSetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "parm_err", r->out.parm_err); - ndr->depth++; - if (r->out.parm_err) { - ndr_print_uint32(ndr, "parm_err", *r->out.parm_err); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportEnum(struct ndr_push *ndr, int flags, const struct wkssvc_NetWkstaTransportEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_buffer)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - 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)); - 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)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetWkstaTransportEnum(struct ndr_pull *ndr, int flags, struct wkssvc_NetWkstaTransportEnum *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_total_entries_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_buffer)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info); - *r->out.info = *r->in.info; - NDR_PULL_ALLOC(ndr, r->out.total_entries); - ZERO_STRUCTP(r->out.total_entries); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.total_entries); - } - _mem_save_total_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.total_entries, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_entries)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_entries_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaTransportEnum *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetWkstaTransportEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetWkstaTransportEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_wkssvc_NetWkstaTransportInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetWkstaTransportEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_wkssvc_NetWkstaTransportInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_ptr(ndr, "total_entries", r->out.total_entries); - ndr->depth++; - ndr_print_uint32(ndr, "total_entries", *r->out.total_entries); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWkstaTransportAdd(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWkstaTransportAdd *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - if (r->in.info0 == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info0)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_err)); - if (r->in.parm_err) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_err)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_err)); - if (r->out.parm_err) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_err)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaTransportAdd(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWkstaTransportAdd *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_parm_err; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_info0_0; - TALLOC_CTX *_mem_save_parm_err_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info0); - } - _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info0)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); - if (_ptr_parm_err) { - NDR_PULL_ALLOC(ndr, r->in.parm_err); - } else { - r->in.parm_err = NULL; - } - if (r->in.parm_err) { - _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_err, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_err)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); - if (_ptr_parm_err) { - NDR_PULL_ALLOC(ndr, r->out.parm_err); - } else { - r->out.parm_err = NULL; - } - if (r->out.parm_err) { - _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_err, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_err)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWkstaTransportAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaTransportAdd *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrWkstaTransportAdd"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrWkstaTransportAdd"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "info0", r->in.info0); - ndr->depth++; - ndr_print_wkssvc_NetWkstaTransportInfo0(ndr, "info0", r->in.info0); - ndr->depth--; - ndr_print_ptr(ndr, "parm_err", r->in.parm_err); - ndr->depth++; - if (r->in.parm_err) { - ndr_print_uint32(ndr, "parm_err", *r->in.parm_err); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrWkstaTransportAdd"); - ndr->depth++; - ndr_print_ptr(ndr, "parm_err", r->out.parm_err); - ndr->depth++; - if (r->out.parm_err) { - ndr_print_uint32(ndr, "parm_err", *r->out.parm_err); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWkstaTransportDel(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWkstaTransportDel *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.transport_name)); - if (r->in.transport_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.transport_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.transport_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.transport_name, ndr_charset_length(r->in.transport_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWkstaTransportDel(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWkstaTransportDel *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_transport_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_transport_name_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport_name)); - if (_ptr_transport_name) { - NDR_PULL_ALLOC(ndr, r->in.transport_name); - } else { - r->in.transport_name = NULL; - } - if (r->in.transport_name) { - _mem_save_transport_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.transport_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.transport_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.transport_name)); - if (ndr_get_array_length(ndr, &r->in.transport_name) > ndr_get_array_size(ndr, &r->in.transport_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.transport_name), ndr_get_array_length(ndr, &r->in.transport_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.transport_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.transport_name, ndr_get_array_length(ndr, &r->in.transport_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown3)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWkstaTransportDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaTransportDel *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrWkstaTransportDel"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrWkstaTransportDel"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "transport_name", r->in.transport_name); - ndr->depth++; - if (r->in.transport_name) { - ndr_print_string(ndr, "transport_name", r->in.transport_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown3", r->in.unknown3); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrWkstaTransportDel"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseAdd(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUseAdd *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - 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_NetrUseGetInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.parm_err)); - if (r->in.parm_err) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.parm_err)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.parm_err)); - if (r->out.parm_err) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.parm_err)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseAdd(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUseAdd *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_parm_err; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_ctr_0; - TALLOC_CTX *_mem_save_parm_err_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.ctr, r->in.level)); - NDR_CHECK(ndr_pull_wkssvc_NetrUseGetInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); - if (_ptr_parm_err) { - NDR_PULL_ALLOC(ndr, r->in.parm_err); - } else { - r->in.parm_err = NULL; - } - if (r->in.parm_err) { - _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.parm_err, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.parm_err)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parm_err)); - if (_ptr_parm_err) { - NDR_PULL_ALLOC(ndr, r->out.parm_err); - } else { - r->out.parm_err = NULL; - } - if (r->out.parm_err) { - _mem_save_parm_err_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.parm_err, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.parm_err)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parm_err_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseAdd *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUseAdd"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrUseAdd"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_ptr(ndr, "ctr", r->in.ctr); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->in.ctr, r->in.level); - ndr_print_wkssvc_NetrUseGetInfoCtr(ndr, "ctr", r->in.ctr); - ndr->depth--; - ndr_print_ptr(ndr, "parm_err", r->in.parm_err); - ndr->depth++; - if (r->in.parm_err) { - ndr_print_uint32(ndr, "parm_err", *r->in.parm_err); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrUseAdd"); - ndr->depth++; - ndr_print_ptr(ndr, "parm_err", r->out.parm_err); - ndr->depth++; - if (r->out.parm_err) { - ndr_print_uint32(ndr, "parm_err", *r->out.parm_err); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseGetInfo(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUseGetInfo *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.use_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.use_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.use_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.use_name, ndr_charset_length(r->in.use_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - } - if (flags & NDR_OUT) { - 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->in.level)); - NDR_CHECK(ndr_push_wkssvc_NetrUseGetInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseGetInfo(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUseGetInfo *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_ctr_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.use_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.use_name)); - if (ndr_get_array_length(ndr, &r->in.use_name) > ndr_get_array_size(ndr, &r->in.use_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.use_name), ndr_get_array_length(ndr, &r->in.use_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.use_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.use_name, ndr_get_array_length(ndr, &r->in.use_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, r->in.level)); - NDR_CHECK(ndr_pull_wkssvc_NetrUseGetInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseGetInfo *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUseGetInfo"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrUseGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "use_name", r->in.use_name); - ndr->depth++; - ndr_print_string(ndr, "use_name", r->in.use_name); - ndr->depth--; - ndr_print_uint32(ndr, "level", r->in.level); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrUseGetInfo"); - ndr->depth++; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_set_switch_value(ndr, r->out.ctr, r->in.level); - ndr_print_wkssvc_NetrUseGetInfoCtr(ndr, "ctr", r->out.ctr); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseDel(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUseDel *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.use_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.use_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.use_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.use_name, ndr_charset_length(r->in.use_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.force_cond)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseDel(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUseDel *r) -{ - uint32_t _ptr_server_name; - TALLOC_CTX *_mem_save_server_name_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.use_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.use_name)); - if (ndr_get_array_length(ndr, &r->in.use_name) > ndr_get_array_size(ndr, &r->in.use_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.use_name), ndr_get_array_length(ndr, &r->in.use_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.use_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.use_name, ndr_get_array_length(ndr, &r->in.use_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.force_cond)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseDel *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUseDel"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrUseDel"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "use_name", r->in.use_name); - ndr->depth++; - ndr_print_string(ndr, "use_name", r->in.use_name); - ndr->depth--; - ndr_print_uint32(ndr, "force_cond", r->in.force_cond); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrUseDel"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUseEnum(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUseEnum *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_wkssvc_NetrUseEnumInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.prefmaxlen)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle)); - if (r->in.resume_handle) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); - } - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_wkssvc_NetrUseEnumInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - if (r->out.entries_read == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.entries_read)); - 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)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUseEnum(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUseEnum *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_resume_handle; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_entries_read_0; - TALLOC_CTX *_mem_save_resume_handle_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.prefmaxlen)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->in.resume_handle); - } else { - r->in.resume_handle = NULL; - } - if (r->in.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_PULL_ALLOC(ndr, r->out.info); - *r->out.info = *r->in.info; - NDR_PULL_ALLOC(ndr, r->out.entries_read); - ZERO_STRUCTP(r->out.entries_read); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_NetrUseEnumInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.entries_read); - } - _mem_save_entries_read_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.entries_read, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.entries_read)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_read_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle)); - if (_ptr_resume_handle) { - NDR_PULL_ALLOC(ndr, r->out.resume_handle); - } else { - r->out.resume_handle = NULL; - } - if (r->out.resume_handle) { - _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0); - } - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUseEnum(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseEnum *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUseEnum"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrUseEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "info", r->in.info); - ndr->depth++; - ndr_print_wkssvc_NetrUseEnumInfo(ndr, "info", r->in.info); - ndr->depth--; - ndr_print_uint32(ndr, "prefmaxlen", r->in.prefmaxlen); - ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); - ndr->depth++; - if (r->in.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrUseEnum"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_wkssvc_NetrUseEnumInfo(ndr, "info", r->out.info); - ndr->depth--; - ndr_print_ptr(ndr, "entries_read", r->out.entries_read); - ndr->depth++; - ndr_print_uint32(ndr, "entries_read", *r->out.entries_read); - ndr->depth--; - ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); - ndr->depth++; - if (r->out.resume_handle) { - ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); - } - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrMessageBufferSend(struct ndr_push *ndr, int flags, const struct wkssvc_NetrMessageBufferSend *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.message_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.message_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.message_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.message_name, ndr_charset_length(r->in.message_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message_sender_name)); - if (r->in.message_sender_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.message_sender_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.message_sender_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.message_sender_name, ndr_charset_length(r->in.message_sender_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->in.message_buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.message_size)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.message_buffer, r->in.message_size)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.message_size)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrMessageBufferSend(struct ndr_pull *ndr, int flags, struct wkssvc_NetrMessageBufferSend *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_message_sender_name; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_message_sender_name_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.message_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.message_name)); - if (ndr_get_array_length(ndr, &r->in.message_name) > ndr_get_array_size(ndr, &r->in.message_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.message_name), ndr_get_array_length(ndr, &r->in.message_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.message_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.message_name, ndr_get_array_length(ndr, &r->in.message_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message_sender_name)); - if (_ptr_message_sender_name) { - NDR_PULL_ALLOC(ndr, r->in.message_sender_name); - } else { - r->in.message_sender_name = NULL; - } - if (r->in.message_sender_name) { - _mem_save_message_sender_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.message_sender_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.message_sender_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.message_sender_name)); - if (ndr_get_array_length(ndr, &r->in.message_sender_name) > ndr_get_array_size(ndr, &r->in.message_sender_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.message_sender_name), ndr_get_array_length(ndr, &r->in.message_sender_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.message_sender_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.message_sender_name, ndr_get_array_length(ndr, &r->in.message_sender_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_sender_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.message_buffer)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->in.message_buffer, ndr_get_array_size(ndr, &r->in.message_buffer)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.message_buffer, ndr_get_array_size(ndr, &r->in.message_buffer))); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.message_size)); - if (r->in.message_buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.message_buffer, r->in.message_size)); - } - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrMessageBufferSend(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrMessageBufferSend *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrMessageBufferSend"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrMessageBufferSend"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "message_name", r->in.message_name); - ndr->depth++; - ndr_print_string(ndr, "message_name", r->in.message_name); - ndr->depth--; - ndr_print_ptr(ndr, "message_sender_name", r->in.message_sender_name); - ndr->depth++; - if (r->in.message_sender_name) { - ndr_print_string(ndr, "message_sender_name", r->in.message_sender_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "message_buffer", r->in.message_buffer); - ndr->depth++; - ndr_print_array_uint8(ndr, "message_buffer", r->in.message_buffer, r->in.message_size); - ndr->depth--; - ndr_print_uint32(ndr, "message_size", r->in.message_size); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrMessageBufferSend"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrWorkstationStatisticsGet(struct ndr_push *ndr, int flags, const struct wkssvc_NetrWorkstationStatisticsGet *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown2)); - if (r->in.unknown2) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown2, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown2, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown2, ndr_charset_length(r->in.unknown2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown4)); - } - if (flags & NDR_OUT) { - if (r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); - if (*r->out.info) { - NDR_CHECK(ndr_push_wkssvc_NetrWorkstationStatistics(ndr, NDR_SCALARS, *r->out.info)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrWorkstationStatisticsGet(struct ndr_pull *ndr, int flags, struct wkssvc_NetrWorkstationStatisticsGet *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_unknown2; - uint32_t _ptr_info; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_unknown2_0; - TALLOC_CTX *_mem_save_info_0; - TALLOC_CTX *_mem_save_info_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown2)); - if (_ptr_unknown2) { - NDR_PULL_ALLOC(ndr, r->in.unknown2); - } else { - r->in.unknown2 = NULL; - } - if (r->in.unknown2) { - _mem_save_unknown2_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown2, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown2)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown2)); - if (ndr_get_array_length(ndr, &r->in.unknown2) > ndr_get_array_size(ndr, &r->in.unknown2)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown2), ndr_get_array_length(ndr, &r->in.unknown2)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown2), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown2, ndr_get_array_length(ndr, &r->in.unknown2), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown2_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown3)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown4)); - NDR_PULL_ALLOC(ndr, r->out.info); - ZERO_STRUCTP(r->out.info); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.info); - } - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { - NDR_PULL_ALLOC(ndr, *r->out.info); - } else { - *r->out.info = NULL; - } - if (*r->out.info) { - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); - NDR_CHECK(ndr_pull_wkssvc_NetrWorkstationStatistics(ndr, NDR_SCALARS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrWorkstationStatisticsGet(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWorkstationStatisticsGet *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrWorkstationStatisticsGet"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrWorkstationStatisticsGet"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "unknown2", r->in.unknown2); - ndr->depth++; - if (r->in.unknown2) { - ndr_print_string(ndr, "unknown2", r->in.unknown2); - } - ndr->depth--; - ndr_print_uint32(ndr, "unknown3", r->in.unknown3); - ndr_print_uint32(ndr, "unknown4", r->in.unknown4); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrWorkstationStatisticsGet"); - ndr->depth++; - ndr_print_ptr(ndr, "info", r->out.info); - ndr->depth++; - ndr_print_ptr(ndr, "info", *r->out.info); - ndr->depth++; - if (*r->out.info) { - ndr_print_wkssvc_NetrWorkstationStatistics(ndr, "info", *r->out.info); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrLogonDomainNameAdd(struct ndr_push *ndr, int flags, const struct wkssvc_NetrLogonDomainNameAdd *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrLogonDomainNameAdd(struct ndr_pull *ndr, int flags, struct wkssvc_NetrLogonDomainNameAdd *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrLogonDomainNameAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrLogonDomainNameAdd *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrLogonDomainNameAdd"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrLogonDomainNameAdd"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - ndr_print_string(ndr, "domain_name", r->in.domain_name); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrLogonDomainNameAdd"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrLogonDomainNameDel(struct ndr_push *ndr, int flags, const struct wkssvc_NetrLogonDomainNameDel *r) -{ - if (flags & NDR_IN) { - 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrLogonDomainNameDel(struct ndr_pull *ndr, int flags, struct wkssvc_NetrLogonDomainNameDel *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrLogonDomainNameDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrLogonDomainNameDel *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrLogonDomainNameDel"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrLogonDomainNameDel"); - ndr->depth++; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - ndr_print_string(ndr, "domain_name", r->in.domain_name); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrLogonDomainNameDel"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrJoinDomain(struct ndr_push *ndr, int flags, const struct wkssvc_NetrJoinDomain *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.account_ou)); - if (r->in.account_ou) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_ou, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_ou, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_ou, ndr_charset_length(r->in.account_ou, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); - if (r->in.password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_wkssvc_joinflags(ndr, NDR_SCALARS, r->in.join_flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrJoinDomain(struct ndr_pull *ndr, int flags, struct wkssvc_NetrJoinDomain *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_account_ou; - uint32_t _ptr_Account; - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_account_ou_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_password_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_ou)); - if (_ptr_account_ou) { - NDR_PULL_ALLOC(ndr, r->in.account_ou); - } else { - r->in.account_ou = NULL; - } - if (r->in.account_ou) { - _mem_save_account_ou_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.account_ou, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_ou)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_ou)); - if (ndr_get_array_length(ndr, &r->in.account_ou) > ndr_get_array_size(ndr, &r->in.account_ou)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_ou), ndr_get_array_length(ndr, &r->in.account_ou)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_ou), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_ou, ndr_get_array_length(ndr, &r->in.account_ou), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_ou_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->in.password); - } else { - r->in.password = NULL; - } - if (r->in.password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); - if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - NDR_CHECK(ndr_pull_wkssvc_joinflags(ndr, NDR_SCALARS, &r->in.join_flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrJoinDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrJoinDomain *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrJoinDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrJoinDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - ndr_print_string(ndr, "domain_name", r->in.domain_name); - ndr->depth--; - ndr_print_ptr(ndr, "account_ou", r->in.account_ou); - ndr->depth++; - if (r->in.account_ou) { - ndr_print_string(ndr, "account_ou", r->in.account_ou); - } - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->in.password); - ndr->depth++; - if (r->in.password) { - ndr_print_string(ndr, "password", r->in.password); - } - ndr->depth--; - ndr_print_wkssvc_joinflags(ndr, "join_flags", r->in.join_flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrJoinDomain"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUnjoinDomain(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUnjoinDomain *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); - if (r->in.password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_wkssvc_joinflags(ndr, NDR_SCALARS, r->in.unjoin_flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUnjoinDomain(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUnjoinDomain *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_Account; - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_password_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->in.password); - } else { - r->in.password = NULL; - } - if (r->in.password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); - if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - NDR_CHECK(ndr_pull_wkssvc_joinflags(ndr, NDR_SCALARS, &r->in.unjoin_flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUnjoinDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUnjoinDomain *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUnjoinDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrUnjoinDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->in.password); - ndr->depth++; - if (r->in.password) { - ndr_print_string(ndr, "password", r->in.password); - } - ndr->depth--; - ndr_print_wkssvc_joinflags(ndr, "unjoin_flags", r->in.unjoin_flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrUnjoinDomain"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrRenameMachineInDomain(struct ndr_push *ndr, int flags, const struct wkssvc_NetrRenameMachineInDomain *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.NewMachineName)); - if (r->in.NewMachineName) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewMachineName, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewMachineName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.NewMachineName, ndr_charset_length(r->in.NewMachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); - if (r->in.password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_wkssvc_renameflags(ndr, NDR_SCALARS, r->in.RenameOptions)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrRenameMachineInDomain(struct ndr_pull *ndr, int flags, struct wkssvc_NetrRenameMachineInDomain *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_NewMachineName; - uint32_t _ptr_Account; - uint32_t _ptr_password; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_NewMachineName_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_password_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_NewMachineName)); - if (_ptr_NewMachineName) { - NDR_PULL_ALLOC(ndr, r->in.NewMachineName); - } else { - r->in.NewMachineName = NULL; - } - if (r->in.NewMachineName) { - _mem_save_NewMachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.NewMachineName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.NewMachineName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.NewMachineName)); - if (ndr_get_array_length(ndr, &r->in.NewMachineName) > ndr_get_array_size(ndr, &r->in.NewMachineName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.NewMachineName), ndr_get_array_length(ndr, &r->in.NewMachineName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.NewMachineName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.NewMachineName, ndr_get_array_length(ndr, &r->in.NewMachineName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_NewMachineName_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); - if (_ptr_password) { - NDR_PULL_ALLOC(ndr, r->in.password); - } else { - r->in.password = NULL; - } - if (r->in.password) { - _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password)); - if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); - } - NDR_CHECK(ndr_pull_wkssvc_renameflags(ndr, NDR_SCALARS, &r->in.RenameOptions)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrRenameMachineInDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRenameMachineInDomain *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrRenameMachineInDomain"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrRenameMachineInDomain"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "NewMachineName", r->in.NewMachineName); - ndr->depth++; - if (r->in.NewMachineName) { - ndr_print_string(ndr, "NewMachineName", r->in.NewMachineName); - } - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "password", r->in.password); - ndr->depth++; - if (r->in.password) { - ndr_print_string(ndr, "password", r->in.password); - } - ndr->depth--; - ndr_print_wkssvc_renameflags(ndr, "RenameOptions", r->in.RenameOptions); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrRenameMachineInDomain"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrValidateName(struct ndr_push *ndr, int flags, const struct wkssvc_NetrValidateName *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.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.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.name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Password)); - if (r->in.Password) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Password, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Password, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Password, ndr_charset_length(r->in.Password, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_wkssvc_NetValidateNameType(ndr, NDR_SCALARS, r->in.name_type)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrValidateName(struct ndr_pull *ndr, int flags, struct wkssvc_NetrValidateName *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_Account; - uint32_t _ptr_Password; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_Password_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name)); - if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name), ndr_get_array_length(ndr, &r->in.name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Password)); - if (_ptr_Password) { - NDR_PULL_ALLOC(ndr, r->in.Password); - } else { - r->in.Password = NULL; - } - if (r->in.Password) { - _mem_save_Password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Password, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Password)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Password)); - if (ndr_get_array_length(ndr, &r->in.Password) > ndr_get_array_size(ndr, &r->in.Password)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Password), ndr_get_array_length(ndr, &r->in.Password)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Password), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Password, ndr_get_array_length(ndr, &r->in.Password), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Password_0, 0); - } - NDR_CHECK(ndr_pull_wkssvc_NetValidateNameType(ndr, NDR_SCALARS, &r->in.name_type)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrValidateName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrValidateName *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrValidateName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrValidateName"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - ndr_print_string(ndr, "name", r->in.name); - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "Password", r->in.Password); - ndr->depth++; - if (r->in.Password) { - ndr_print_string(ndr, "Password", r->in.Password); - } - ndr->depth--; - ndr_print_wkssvc_NetValidateNameType(ndr, "name_type", r->in.name_type); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrValidateName"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinInformation(struct ndr_push *ndr, int flags, const struct wkssvc_NetrGetJoinInformation *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.name_buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.name_buffer)); - if (*r->in.name_buffer) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.name_buffer, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.name_buffer, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->in.name_buffer, ndr_charset_length(*r->in.name_buffer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - if (flags & NDR_OUT) { - if (r->out.name_buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name_buffer)); - if (*r->out.name_buffer) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name_buffer, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name_buffer, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.name_buffer, ndr_charset_length(*r->out.name_buffer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->out.name_type == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_wkssvc_NetJoinStatus(ndr, NDR_SCALARS, *r->out.name_type)); - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinInformation(struct ndr_pull *ndr, int flags, struct wkssvc_NetrGetJoinInformation *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_name_buffer; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_name_buffer_0; - TALLOC_CTX *_mem_save_name_buffer_1; - TALLOC_CTX *_mem_save_name_type_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.name_buffer); - } - _mem_save_name_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.name_buffer, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name_buffer)); - if (_ptr_name_buffer) { - NDR_PULL_ALLOC(ndr, *r->in.name_buffer); - } else { - *r->in.name_buffer = NULL; - } - if (*r->in.name_buffer) { - _mem_save_name_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->in.name_buffer, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->in.name_buffer)); - NDR_CHECK(ndr_pull_array_length(ndr, r->in.name_buffer)); - if (ndr_get_array_length(ndr, r->in.name_buffer) > ndr_get_array_size(ndr, r->in.name_buffer)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->in.name_buffer), ndr_get_array_length(ndr, r->in.name_buffer)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->in.name_buffer), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->in.name_buffer, ndr_get_array_length(ndr, r->in.name_buffer), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.name_buffer); - *r->out.name_buffer = *r->in.name_buffer; - NDR_PULL_ALLOC(ndr, r->out.name_type); - ZERO_STRUCTP(r->out.name_type); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.name_buffer); - } - _mem_save_name_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.name_buffer, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name_buffer)); - if (_ptr_name_buffer) { - NDR_PULL_ALLOC(ndr, *r->out.name_buffer); - } else { - *r->out.name_buffer = NULL; - } - if (*r->out.name_buffer) { - _mem_save_name_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.name_buffer, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.name_buffer)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.name_buffer)); - if (ndr_get_array_length(ndr, r->out.name_buffer) > ndr_get_array_size(ndr, r->out.name_buffer)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.name_buffer), ndr_get_array_length(ndr, r->out.name_buffer)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.name_buffer), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.name_buffer, ndr_get_array_length(ndr, r->out.name_buffer), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.name_type); - } - _mem_save_name_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.name_type, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_NetJoinStatus(ndr, NDR_SCALARS, r->out.name_type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_type_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrGetJoinInformation(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinInformation *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrGetJoinInformation"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrGetJoinInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "name_buffer", r->in.name_buffer); - ndr->depth++; - ndr_print_ptr(ndr, "name_buffer", *r->in.name_buffer); - ndr->depth++; - if (*r->in.name_buffer) { - ndr_print_string(ndr, "name_buffer", *r->in.name_buffer); - } - ndr->depth--; - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrGetJoinInformation"); - ndr->depth++; - ndr_print_ptr(ndr, "name_buffer", r->out.name_buffer); - ndr->depth++; - ndr_print_ptr(ndr, "name_buffer", *r->out.name_buffer); - ndr->depth++; - if (*r->out.name_buffer) { - ndr_print_string(ndr, "name_buffer", *r->out.name_buffer); - } - ndr->depth--; - ndr->depth--; - ndr_print_ptr(ndr, "name_type", r->out.name_type); - ndr->depth++; - ndr_print_wkssvc_NetJoinStatus(ndr, "name_type", *r->out.name_type); - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinableOus(struct ndr_push *ndr, int flags, const struct wkssvc_NetrGetJoinableOus *r) -{ - uint32_t cntr_ous_2; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); - if (r->in.unknown) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown, ndr_charset_length(r->in.unknown, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - if (r->in.num_ous == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.num_ous)); - } - if (flags & NDR_OUT) { - if (r->out.num_ous == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); - if (r->out.ous == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ous)); - if (*r->out.ous) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); - for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, (*r->out.ous)[cntr_ous_2])); - } - for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { - if ((*r->out.ous)[cntr_ous_2]) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, (*r->out.ous)[cntr_ous_2], ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus(struct ndr_pull *ndr, int flags, struct wkssvc_NetrGetJoinableOus *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_Account; - uint32_t _ptr_unknown; - uint32_t _ptr_ous; - uint32_t cntr_ous_2; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_unknown_0; - TALLOC_CTX *_mem_save_num_ous_0; - TALLOC_CTX *_mem_save_ous_0; - TALLOC_CTX *_mem_save_ous_1; - TALLOC_CTX *_mem_save_ous_2; - TALLOC_CTX *_mem_save_ous_3; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); - if (_ptr_unknown) { - NDR_PULL_ALLOC(ndr, r->in.unknown); - } else { - r->in.unknown = NULL; - } - if (r->in.unknown) { - _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown)); - if (ndr_get_array_length(ndr, &r->in.unknown) > ndr_get_array_size(ndr, &r->in.unknown)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.unknown), ndr_get_array_length(ndr, &r->in.unknown)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown, ndr_get_array_length(ndr, &r->in.unknown), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.num_ous); - } - _mem_save_num_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.num_ous, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.num_ous)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.num_ous); - *r->out.num_ous = *r->in.num_ous; - NDR_PULL_ALLOC(ndr, r->out.ous); - ZERO_STRUCTP(r->out.ous); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_ous); - } - _mem_save_num_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_ous, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_ous)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ous); - } - _mem_save_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ous, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); - if (_ptr_ous) { - NDR_PULL_ALLOC(ndr, *r->out.ous); - } else { - *r->out.ous = NULL; - } - if (*r->out.ous) { - _mem_save_ous_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.ous)); - NDR_PULL_ALLOC_N(ndr, *r->out.ous, ndr_get_array_size(ndr, r->out.ous)); - _mem_save_ous_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); - for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); - if (_ptr_ous) { - NDR_PULL_ALLOC(ndr, (*r->out.ous)[cntr_ous_2]); - } else { - (*r->out.ous)[cntr_ous_2] = NULL; - } - } - for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { - if ((*r->out.ous)[cntr_ous_2]) { - _mem_save_ous_3 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, (*r->out.ous)[cntr_ous_2], 0); - NDR_CHECK(ndr_pull_array_size(ndr, &(*r->out.ous)[cntr_ous_2])); - NDR_CHECK(ndr_pull_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); - if (ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]) > ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2])) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2]), ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &(*r->out.ous)[cntr_ous_2], ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_3, 0); - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_2, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (*r->out.ous) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)r->out.ous, *r->out.num_ous)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrGetJoinableOus(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus *r) -{ - uint32_t cntr_ous_2; - ndr_print_struct(ndr, name, "wkssvc_NetrGetJoinableOus"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrGetJoinableOus"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - ndr_print_string(ndr, "domain_name", r->in.domain_name); - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "unknown", r->in.unknown); - ndr->depth++; - if (r->in.unknown) { - ndr_print_string(ndr, "unknown", r->in.unknown); - } - ndr->depth--; - ndr_print_ptr(ndr, "num_ous", r->in.num_ous); - ndr->depth++; - ndr_print_uint32(ndr, "num_ous", *r->in.num_ous); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrGetJoinableOus"); - ndr->depth++; - ndr_print_ptr(ndr, "num_ous", r->out.num_ous); - ndr->depth++; - ndr_print_uint32(ndr, "num_ous", *r->out.num_ous); - ndr->depth--; - ndr_print_ptr(ndr, "ous", r->out.ous); - ndr->depth++; - ndr_print_ptr(ndr, "ous", *r->out.ous); - ndr->depth++; - if (*r->out.ous) { - ndr->print(ndr, "%s: ARRAY(%d)", "ous", (int)*r->out.num_ous); - ndr->depth++; - for (cntr_ous_2=0;cntr_ous_2<*r->out.num_ous;cntr_ous_2++) { - char *idx_2=NULL; - if (asprintf(&idx_2, "[%d]", cntr_ous_2) != -1) { - ndr_print_ptr(ndr, "ous", (*r->out.ous)[cntr_ous_2]); - ndr->depth++; - if ((*r->out.ous)[cntr_ous_2]) { - ndr_print_string(ndr, "ous", (*r->out.ous)[cntr_ous_2]); - } - ndr->depth--; - free(idx_2); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrJoinDomain2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrJoinDomain2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.account_ou)); - if (r->in.account_ou) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_ou, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_ou, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_ou, ndr_charset_length(r->in.account_ou, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.admin_account)); - if (r->in.admin_account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.admin_account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.admin_account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.admin_account, ndr_charset_length(r->in.admin_account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.encrypted_password)); - if (r->in.encrypted_password) { - NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.encrypted_password)); - } - NDR_CHECK(ndr_push_wkssvc_joinflags(ndr, NDR_SCALARS, r->in.join_flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrJoinDomain2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrJoinDomain2 *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_account_ou; - uint32_t _ptr_admin_account; - uint32_t _ptr_encrypted_password; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_account_ou_0; - TALLOC_CTX *_mem_save_admin_account_0; - TALLOC_CTX *_mem_save_encrypted_password_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_ou)); - if (_ptr_account_ou) { - NDR_PULL_ALLOC(ndr, r->in.account_ou); - } else { - r->in.account_ou = NULL; - } - if (r->in.account_ou) { - _mem_save_account_ou_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.account_ou, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_ou)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_ou)); - if (ndr_get_array_length(ndr, &r->in.account_ou) > ndr_get_array_size(ndr, &r->in.account_ou)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_ou), ndr_get_array_length(ndr, &r->in.account_ou)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_ou), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_ou, ndr_get_array_length(ndr, &r->in.account_ou), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_ou_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_admin_account)); - if (_ptr_admin_account) { - NDR_PULL_ALLOC(ndr, r->in.admin_account); - } else { - r->in.admin_account = NULL; - } - if (r->in.admin_account) { - _mem_save_admin_account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.admin_account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.admin_account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.admin_account)); - if (ndr_get_array_length(ndr, &r->in.admin_account) > ndr_get_array_size(ndr, &r->in.admin_account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.admin_account), ndr_get_array_length(ndr, &r->in.admin_account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.admin_account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.admin_account, ndr_get_array_length(ndr, &r->in.admin_account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_admin_account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_encrypted_password)); - if (_ptr_encrypted_password) { - NDR_PULL_ALLOC(ndr, r->in.encrypted_password); - } else { - r->in.encrypted_password = NULL; - } - if (r->in.encrypted_password) { - _mem_save_encrypted_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.encrypted_password, 0); - NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.encrypted_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_encrypted_password_0, 0); - } - NDR_CHECK(ndr_pull_wkssvc_joinflags(ndr, NDR_SCALARS, &r->in.join_flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrJoinDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrJoinDomain2 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrJoinDomain2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrJoinDomain2"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - ndr_print_string(ndr, "domain_name", r->in.domain_name); - ndr->depth--; - ndr_print_ptr(ndr, "account_ou", r->in.account_ou); - ndr->depth++; - if (r->in.account_ou) { - ndr_print_string(ndr, "account_ou", r->in.account_ou); - } - ndr->depth--; - ndr_print_ptr(ndr, "admin_account", r->in.admin_account); - ndr->depth++; - if (r->in.admin_account) { - ndr_print_string(ndr, "admin_account", r->in.admin_account); - } - ndr->depth--; - ndr_print_ptr(ndr, "encrypted_password", r->in.encrypted_password); - ndr->depth++; - if (r->in.encrypted_password) { - ndr_print_wkssvc_PasswordBuffer(ndr, "encrypted_password", r->in.encrypted_password); - } - ndr->depth--; - ndr_print_wkssvc_joinflags(ndr, "join_flags", r->in.join_flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrJoinDomain2"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrUnjoinDomain2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrUnjoinDomain2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.account)); - if (r->in.account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account, ndr_charset_length(r->in.account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.encrypted_password)); - if (r->in.encrypted_password) { - NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.encrypted_password)); - } - NDR_CHECK(ndr_push_wkssvc_joinflags(ndr, NDR_SCALARS, r->in.unjoin_flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrUnjoinDomain2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrUnjoinDomain2 *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_account; - uint32_t _ptr_encrypted_password; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_account_0; - TALLOC_CTX *_mem_save_encrypted_password_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account)); - if (_ptr_account) { - NDR_PULL_ALLOC(ndr, r->in.account); - } else { - r->in.account = NULL; - } - if (r->in.account) { - _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account)); - if (ndr_get_array_length(ndr, &r->in.account) > ndr_get_array_size(ndr, &r->in.account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account), ndr_get_array_length(ndr, &r->in.account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account, ndr_get_array_length(ndr, &r->in.account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_encrypted_password)); - if (_ptr_encrypted_password) { - NDR_PULL_ALLOC(ndr, r->in.encrypted_password); - } else { - r->in.encrypted_password = NULL; - } - if (r->in.encrypted_password) { - _mem_save_encrypted_password_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.encrypted_password, 0); - NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.encrypted_password)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_encrypted_password_0, 0); - } - NDR_CHECK(ndr_pull_wkssvc_joinflags(ndr, NDR_SCALARS, &r->in.unjoin_flags)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrUnjoinDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUnjoinDomain2 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrUnjoinDomain2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrUnjoinDomain2"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "account", r->in.account); - ndr->depth++; - if (r->in.account) { - ndr_print_string(ndr, "account", r->in.account); - } - ndr->depth--; - ndr_print_ptr(ndr, "encrypted_password", r->in.encrypted_password); - ndr->depth++; - if (r->in.encrypted_password) { - ndr_print_wkssvc_PasswordBuffer(ndr, "encrypted_password", r->in.encrypted_password); - } - ndr->depth--; - ndr_print_wkssvc_joinflags(ndr, "unjoin_flags", r->in.unjoin_flags); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrUnjoinDomain2"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrRenameMachineInDomain2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrRenameMachineInDomain2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.NewMachineName)); - if (r->in.NewMachineName) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewMachineName, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewMachineName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.NewMachineName, ndr_charset_length(r->in.NewMachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); - if (r->in.EncryptedPassword) { - NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - } - NDR_CHECK(ndr_push_wkssvc_renameflags(ndr, NDR_SCALARS, r->in.RenameOptions)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrRenameMachineInDomain2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrRenameMachineInDomain2 *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_NewMachineName; - uint32_t _ptr_Account; - uint32_t _ptr_EncryptedPassword; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_NewMachineName_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_EncryptedPassword_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_NewMachineName)); - if (_ptr_NewMachineName) { - NDR_PULL_ALLOC(ndr, r->in.NewMachineName); - } else { - r->in.NewMachineName = NULL; - } - if (r->in.NewMachineName) { - _mem_save_NewMachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.NewMachineName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.NewMachineName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.NewMachineName)); - if (ndr_get_array_length(ndr, &r->in.NewMachineName) > ndr_get_array_size(ndr, &r->in.NewMachineName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.NewMachineName), ndr_get_array_length(ndr, &r->in.NewMachineName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.NewMachineName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.NewMachineName, ndr_get_array_length(ndr, &r->in.NewMachineName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_NewMachineName_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); - if (_ptr_EncryptedPassword) { - NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); - } else { - r->in.EncryptedPassword = NULL; - } - if (r->in.EncryptedPassword) { - _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); - NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); - } - NDR_CHECK(ndr_pull_wkssvc_renameflags(ndr, NDR_SCALARS, &r->in.RenameOptions)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrRenameMachineInDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRenameMachineInDomain2 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrRenameMachineInDomain2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrRenameMachineInDomain2"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "NewMachineName", r->in.NewMachineName); - ndr->depth++; - if (r->in.NewMachineName) { - ndr_print_string(ndr, "NewMachineName", r->in.NewMachineName); - } - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); - ndr->depth++; - if (r->in.EncryptedPassword) { - ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); - } - ndr->depth--; - ndr_print_wkssvc_renameflags(ndr, "RenameOptions", r->in.RenameOptions); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrRenameMachineInDomain2"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrValidateName2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrValidateName2 *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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.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.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.name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); - if (r->in.EncryptedPassword) { - NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - } - NDR_CHECK(ndr_push_wkssvc_NetValidateNameType(ndr, NDR_SCALARS, r->in.name_type)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrValidateName2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrValidateName2 *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_Account; - uint32_t _ptr_EncryptedPassword; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_EncryptedPassword_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name)); - if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name), ndr_get_array_length(ndr, &r->in.name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); - if (_ptr_EncryptedPassword) { - NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); - } else { - r->in.EncryptedPassword = NULL; - } - if (r->in.EncryptedPassword) { - _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); - NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); - } - NDR_CHECK(ndr_pull_wkssvc_NetValidateNameType(ndr, NDR_SCALARS, &r->in.name_type)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrValidateName2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrValidateName2 *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrValidateName2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrValidateName2"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "name", r->in.name); - ndr->depth++; - ndr_print_string(ndr, "name", r->in.name); - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); - ndr->depth++; - if (r->in.EncryptedPassword) { - ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); - } - ndr->depth--; - ndr_print_wkssvc_NetValidateNameType(ndr, "name_type", r->in.name_type); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrValidateName2"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinableOus2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrGetJoinableOus2 *r) -{ - uint32_t cntr_ous_2; - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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 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))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); - if (r->in.EncryptedPassword) { - NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - } - if (r->in.num_ous == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.num_ous)); - } - if (flags & NDR_OUT) { - if (r->out.num_ous == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); - if (r->out.ous == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ous)); - if (*r->out.ous) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); - for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, (*r->out.ous)[cntr_ous_2])); - } - for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { - if ((*r->out.ous)[cntr_ous_2]) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, (*r->out.ous)[cntr_ous_2], ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - } - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus2(struct ndr_pull *ndr, int flags, struct wkssvc_NetrGetJoinableOus2 *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_Account; - uint32_t _ptr_EncryptedPassword; - uint32_t _ptr_ous; - uint32_t cntr_ous_2; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_EncryptedPassword_0; - TALLOC_CTX *_mem_save_num_ous_0; - TALLOC_CTX *_mem_save_ous_0; - TALLOC_CTX *_mem_save_ous_1; - TALLOC_CTX *_mem_save_ous_2; - TALLOC_CTX *_mem_save_ous_3; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); - if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); - if (_ptr_EncryptedPassword) { - NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); - } else { - r->in.EncryptedPassword = NULL; - } - if (r->in.EncryptedPassword) { - _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); - NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); - } - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.num_ous); - } - _mem_save_num_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.num_ous, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.num_ous)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.num_ous); - *r->out.num_ous = *r->in.num_ous; - NDR_PULL_ALLOC(ndr, r->out.ous); - ZERO_STRUCTP(r->out.ous); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.num_ous); - } - _mem_save_num_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.num_ous, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_ous)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ous); - } - _mem_save_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ous, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); - if (_ptr_ous) { - NDR_PULL_ALLOC(ndr, *r->out.ous); - } else { - *r->out.ous = NULL; - } - if (*r->out.ous) { - _mem_save_ous_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.ous)); - NDR_PULL_ALLOC_N(ndr, *r->out.ous, ndr_get_array_size(ndr, r->out.ous)); - _mem_save_ous_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); - for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); - if (_ptr_ous) { - NDR_PULL_ALLOC(ndr, (*r->out.ous)[cntr_ous_2]); - } else { - (*r->out.ous)[cntr_ous_2] = NULL; - } - } - for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { - if ((*r->out.ous)[cntr_ous_2]) { - _mem_save_ous_3 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, (*r->out.ous)[cntr_ous_2], 0); - NDR_CHECK(ndr_pull_array_size(ndr, &(*r->out.ous)[cntr_ous_2])); - NDR_CHECK(ndr_pull_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); - if (ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]) > ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2])) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2]), ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &(*r->out.ous)[cntr_ous_2], ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_3, 0); - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_2, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (*r->out.ous) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)r->out.ous, *r->out.num_ous)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrGetJoinableOus2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus2 *r) -{ - uint32_t cntr_ous_2; - ndr_print_struct(ndr, name, "wkssvc_NetrGetJoinableOus2"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrGetJoinableOus2"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "domain_name", r->in.domain_name); - ndr->depth++; - ndr_print_string(ndr, "domain_name", r->in.domain_name); - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); - ndr->depth++; - if (r->in.EncryptedPassword) { - ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); - } - ndr->depth--; - ndr_print_ptr(ndr, "num_ous", r->in.num_ous); - ndr->depth++; - ndr_print_uint32(ndr, "num_ous", *r->in.num_ous); - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrGetJoinableOus2"); - ndr->depth++; - ndr_print_ptr(ndr, "num_ous", r->out.num_ous); - ndr->depth++; - ndr_print_uint32(ndr, "num_ous", *r->out.num_ous); - ndr->depth--; - ndr_print_ptr(ndr, "ous", r->out.ous); - ndr->depth++; - ndr_print_ptr(ndr, "ous", *r->out.ous); - ndr->depth++; - if (*r->out.ous) { - ndr->print(ndr, "%s: ARRAY(%d)", "ous", (int)*r->out.num_ous); - ndr->depth++; - for (cntr_ous_2=0;cntr_ous_2<*r->out.num_ous;cntr_ous_2++) { - char *idx_2=NULL; - if (asprintf(&idx_2, "[%d]", cntr_ous_2) != -1) { - ndr_print_ptr(ndr, "ous", (*r->out.ous)[cntr_ous_2]); - ndr->depth++; - if ((*r->out.ous)[cntr_ous_2]) { - ndr_print_string(ndr, "ous", (*r->out.ous)[cntr_ous_2]); - } - ndr->depth--; - free(idx_2); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrAddAlternateComputerName(struct ndr_push *ndr, int flags, const struct wkssvc_NetrAddAlternateComputerName *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.NewAlternateMachineName)); - if (r->in.NewAlternateMachineName) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewAlternateMachineName, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.NewAlternateMachineName, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.NewAlternateMachineName, ndr_charset_length(r->in.NewAlternateMachineName, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); - if (r->in.EncryptedPassword) { - NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrAddAlternateComputerName(struct ndr_pull *ndr, int flags, struct wkssvc_NetrAddAlternateComputerName *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_NewAlternateMachineName; - uint32_t _ptr_Account; - uint32_t _ptr_EncryptedPassword; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_NewAlternateMachineName_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_EncryptedPassword_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_NewAlternateMachineName)); - if (_ptr_NewAlternateMachineName) { - NDR_PULL_ALLOC(ndr, r->in.NewAlternateMachineName); - } else { - r->in.NewAlternateMachineName = NULL; - } - if (r->in.NewAlternateMachineName) { - _mem_save_NewAlternateMachineName_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.NewAlternateMachineName, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.NewAlternateMachineName)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.NewAlternateMachineName)); - if (ndr_get_array_length(ndr, &r->in.NewAlternateMachineName) > ndr_get_array_size(ndr, &r->in.NewAlternateMachineName)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.NewAlternateMachineName), ndr_get_array_length(ndr, &r->in.NewAlternateMachineName)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.NewAlternateMachineName), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.NewAlternateMachineName, ndr_get_array_length(ndr, &r->in.NewAlternateMachineName), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_NewAlternateMachineName_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); - if (_ptr_EncryptedPassword) { - NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); - } else { - r->in.EncryptedPassword = NULL; - } - if (r->in.EncryptedPassword) { - _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); - NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrAddAlternateComputerName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrAddAlternateComputerName *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrAddAlternateComputerName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrAddAlternateComputerName"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "NewAlternateMachineName", r->in.NewAlternateMachineName); - ndr->depth++; - if (r->in.NewAlternateMachineName) { - ndr_print_string(ndr, "NewAlternateMachineName", r->in.NewAlternateMachineName); - } - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); - ndr->depth++; - if (r->in.EncryptedPassword) { - ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); - } - ndr->depth--; - ndr_print_uint32(ndr, "Reserved", r->in.Reserved); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrAddAlternateComputerName"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrRemoveAlternateComputerName(struct ndr_push *ndr, int flags, const struct wkssvc_NetrRemoveAlternateComputerName *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.AlternateMachineNameToRemove)); - if (r->in.AlternateMachineNameToRemove) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.AlternateMachineNameToRemove, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.AlternateMachineNameToRemove, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.AlternateMachineNameToRemove, ndr_charset_length(r->in.AlternateMachineNameToRemove, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); - if (r->in.EncryptedPassword) { - NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrRemoveAlternateComputerName(struct ndr_pull *ndr, int flags, struct wkssvc_NetrRemoveAlternateComputerName *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_AlternateMachineNameToRemove; - uint32_t _ptr_Account; - uint32_t _ptr_EncryptedPassword; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_AlternateMachineNameToRemove_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_EncryptedPassword_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_AlternateMachineNameToRemove)); - if (_ptr_AlternateMachineNameToRemove) { - NDR_PULL_ALLOC(ndr, r->in.AlternateMachineNameToRemove); - } else { - r->in.AlternateMachineNameToRemove = NULL; - } - if (r->in.AlternateMachineNameToRemove) { - _mem_save_AlternateMachineNameToRemove_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.AlternateMachineNameToRemove, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.AlternateMachineNameToRemove)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.AlternateMachineNameToRemove)); - if (ndr_get_array_length(ndr, &r->in.AlternateMachineNameToRemove) > ndr_get_array_size(ndr, &r->in.AlternateMachineNameToRemove)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.AlternateMachineNameToRemove), ndr_get_array_length(ndr, &r->in.AlternateMachineNameToRemove)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.AlternateMachineNameToRemove), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.AlternateMachineNameToRemove, ndr_get_array_length(ndr, &r->in.AlternateMachineNameToRemove), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_AlternateMachineNameToRemove_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); - if (_ptr_EncryptedPassword) { - NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); - } else { - r->in.EncryptedPassword = NULL; - } - if (r->in.EncryptedPassword) { - _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); - NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrRemoveAlternateComputerName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRemoveAlternateComputerName *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrRemoveAlternateComputerName"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrRemoveAlternateComputerName"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "AlternateMachineNameToRemove", r->in.AlternateMachineNameToRemove); - ndr->depth++; - if (r->in.AlternateMachineNameToRemove) { - ndr_print_string(ndr, "AlternateMachineNameToRemove", r->in.AlternateMachineNameToRemove); - } - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); - ndr->depth++; - if (r->in.EncryptedPassword) { - ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); - } - ndr->depth--; - ndr_print_uint32(ndr, "Reserved", r->in.Reserved); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrRemoveAlternateComputerName"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrSetPrimaryComputername(struct ndr_push *ndr, int flags, const struct wkssvc_NetrSetPrimaryComputername *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.primary_name)); - if (r->in.primary_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.primary_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.primary_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.primary_name, ndr_charset_length(r->in.primary_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Account)); - if (r->in.Account) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.Account, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Account, ndr_charset_length(r->in.Account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.EncryptedPassword)); - if (r->in.EncryptedPassword) { - NDR_CHECK(ndr_push_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrSetPrimaryComputername(struct ndr_pull *ndr, int flags, struct wkssvc_NetrSetPrimaryComputername *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_primary_name; - uint32_t _ptr_Account; - uint32_t _ptr_EncryptedPassword; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_primary_name_0; - TALLOC_CTX *_mem_save_Account_0; - TALLOC_CTX *_mem_save_EncryptedPassword_0; - if (flags & NDR_IN) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_primary_name)); - if (_ptr_primary_name) { - NDR_PULL_ALLOC(ndr, r->in.primary_name); - } else { - r->in.primary_name = NULL; - } - if (r->in.primary_name) { - _mem_save_primary_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.primary_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.primary_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.primary_name)); - if (ndr_get_array_length(ndr, &r->in.primary_name) > ndr_get_array_size(ndr, &r->in.primary_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.primary_name), ndr_get_array_length(ndr, &r->in.primary_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.primary_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.primary_name, ndr_get_array_length(ndr, &r->in.primary_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_primary_name_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Account)); - if (_ptr_Account) { - NDR_PULL_ALLOC(ndr, r->in.Account); - } else { - r->in.Account = NULL; - } - if (r->in.Account) { - _mem_save_Account_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.Account, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Account)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Account)); - if (ndr_get_array_length(ndr, &r->in.Account) > ndr_get_array_size(ndr, &r->in.Account)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.Account), ndr_get_array_length(ndr, &r->in.Account)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Account, ndr_get_array_length(ndr, &r->in.Account), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Account_0, 0); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedPassword)); - if (_ptr_EncryptedPassword) { - NDR_PULL_ALLOC(ndr, r->in.EncryptedPassword); - } else { - r->in.EncryptedPassword = NULL; - } - if (r->in.EncryptedPassword) { - _mem_save_EncryptedPassword_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.EncryptedPassword, 0); - NDR_CHECK(ndr_pull_wkssvc_PasswordBuffer(ndr, NDR_SCALARS, r->in.EncryptedPassword)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedPassword_0, 0); - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Reserved)); - } - if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrSetPrimaryComputername(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrSetPrimaryComputername *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrSetPrimaryComputername"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrSetPrimaryComputername"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "primary_name", r->in.primary_name); - ndr->depth++; - if (r->in.primary_name) { - ndr_print_string(ndr, "primary_name", r->in.primary_name); - } - ndr->depth--; - ndr_print_ptr(ndr, "Account", r->in.Account); - ndr->depth++; - if (r->in.Account) { - ndr_print_string(ndr, "Account", r->in.Account); - } - ndr->depth--; - ndr_print_ptr(ndr, "EncryptedPassword", r->in.EncryptedPassword); - ndr->depth++; - if (r->in.EncryptedPassword) { - ndr_print_wkssvc_PasswordBuffer(ndr, "EncryptedPassword", r->in.EncryptedPassword); - } - ndr->depth--; - ndr_print_uint32(ndr, "Reserved", r->in.Reserved); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrSetPrimaryComputername"); - ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_wkssvc_NetrEnumerateComputerNames(struct ndr_push *ndr, int flags, const struct wkssvc_NetrEnumerateComputerNames *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); - if (r->in.server_name) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.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)); - } - NDR_CHECK(ndr_push_wkssvc_ComputerNameType(ndr, NDR_SCALARS, r->in.name_type)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Reserved)); - } - if (flags & NDR_OUT) { - if (r->out.ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); - if (*r->out.ctr) { - NDR_CHECK(ndr_push_wkssvc_ComputerNamesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); - } - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_wkssvc_NetrEnumerateComputerNames(struct ndr_pull *ndr, int flags, struct wkssvc_NetrEnumerateComputerNames *r) -{ - uint32_t _ptr_server_name; - uint32_t _ptr_ctr; - TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_ctr_0; - TALLOC_CTX *_mem_save_ctr_1; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); - if (_ptr_server_name) { - NDR_PULL_ALLOC(ndr, r->in.server_name); - } else { - r->in.server_name = NULL; - } - if (r->in.server_name) { - _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); - if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); - } - NDR_CHECK(ndr_pull_wkssvc_ComputerNameType(ndr, NDR_SCALARS, &r->in.name_type)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Reserved)); - NDR_PULL_ALLOC(ndr, r->out.ctr); - ZERO_STRUCTP(r->out.ctr); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ctr); - } - _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); - if (_ptr_ctr) { - NDR_PULL_ALLOC(ndr, *r->out.ctr); - } else { - *r->out.ctr = NULL; - } - if (*r->out.ctr) { - _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); - NDR_CHECK(ndr_pull_wkssvc_ComputerNamesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_wkssvc_NetrEnumerateComputerNames(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrEnumerateComputerNames *r) -{ - ndr_print_struct(ndr, name, "wkssvc_NetrEnumerateComputerNames"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "wkssvc_NetrEnumerateComputerNames"); - ndr->depth++; - ndr_print_ptr(ndr, "server_name", r->in.server_name); - ndr->depth++; - if (r->in.server_name) { - ndr_print_string(ndr, "server_name", r->in.server_name); - } - ndr->depth--; - ndr_print_wkssvc_ComputerNameType(ndr, "name_type", r->in.name_type); - ndr_print_uint32(ndr, "Reserved", r->in.Reserved); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "wkssvc_NetrEnumerateComputerNames"); - ndr->depth++; - ndr_print_ptr(ndr, "ctr", r->out.ctr); - ndr->depth++; - ndr_print_ptr(ndr, "ctr", *r->out.ctr); - ndr->depth++; - if (*r->out.ctr) { - ndr_print_wkssvc_ComputerNamesCtr(ndr, "ctr", *r->out.ctr); - } - ndr->depth--; - ndr->depth--; - ndr_print_WERROR(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call wkssvc_calls[] = { - { - "wkssvc_NetWkstaGetInfo", - sizeof(struct wkssvc_NetWkstaGetInfo), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaGetInfo, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaGetInfo, - (ndr_print_function_t) ndr_print_wkssvc_NetWkstaGetInfo, - false, - }, - { - "wkssvc_NetWkstaSetInfo", - sizeof(struct wkssvc_NetWkstaSetInfo), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaSetInfo, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaSetInfo, - (ndr_print_function_t) ndr_print_wkssvc_NetWkstaSetInfo, - false, - }, - { - "wkssvc_NetWkstaEnumUsers", - sizeof(struct wkssvc_NetWkstaEnumUsers), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaEnumUsers, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaEnumUsers, - (ndr_print_function_t) ndr_print_wkssvc_NetWkstaEnumUsers, - false, - }, - { - "wkssvc_NetrWkstaUserGetInfo", - sizeof(struct wkssvc_NetrWkstaUserGetInfo), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaUserGetInfo, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaUserGetInfo, - (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaUserGetInfo, - false, - }, - { - "wkssvc_NetrWkstaUserSetInfo", - sizeof(struct wkssvc_NetrWkstaUserSetInfo), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaUserSetInfo, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaUserSetInfo, - (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaUserSetInfo, - false, - }, - { - "wkssvc_NetWkstaTransportEnum", - sizeof(struct wkssvc_NetWkstaTransportEnum), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetWkstaTransportEnum, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetWkstaTransportEnum, - (ndr_print_function_t) ndr_print_wkssvc_NetWkstaTransportEnum, - false, - }, - { - "wkssvc_NetrWkstaTransportAdd", - sizeof(struct wkssvc_NetrWkstaTransportAdd), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaTransportAdd, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaTransportAdd, - (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaTransportAdd, - false, - }, - { - "wkssvc_NetrWkstaTransportDel", - sizeof(struct wkssvc_NetrWkstaTransportDel), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWkstaTransportDel, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWkstaTransportDel, - (ndr_print_function_t) ndr_print_wkssvc_NetrWkstaTransportDel, - false, - }, - { - "wkssvc_NetrUseAdd", - sizeof(struct wkssvc_NetrUseAdd), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseAdd, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseAdd, - (ndr_print_function_t) ndr_print_wkssvc_NetrUseAdd, - false, - }, - { - "wkssvc_NetrUseGetInfo", - sizeof(struct wkssvc_NetrUseGetInfo), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseGetInfo, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseGetInfo, - (ndr_print_function_t) ndr_print_wkssvc_NetrUseGetInfo, - false, - }, - { - "wkssvc_NetrUseDel", - sizeof(struct wkssvc_NetrUseDel), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseDel, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseDel, - (ndr_print_function_t) ndr_print_wkssvc_NetrUseDel, - false, - }, - { - "wkssvc_NetrUseEnum", - sizeof(struct wkssvc_NetrUseEnum), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUseEnum, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUseEnum, - (ndr_print_function_t) ndr_print_wkssvc_NetrUseEnum, - false, - }, - { - "wkssvc_NetrMessageBufferSend", - sizeof(struct wkssvc_NetrMessageBufferSend), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrMessageBufferSend, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrMessageBufferSend, - (ndr_print_function_t) ndr_print_wkssvc_NetrMessageBufferSend, - false, - }, - { - "wkssvc_NetrWorkstationStatisticsGet", - sizeof(struct wkssvc_NetrWorkstationStatisticsGet), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrWorkstationStatisticsGet, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrWorkstationStatisticsGet, - (ndr_print_function_t) ndr_print_wkssvc_NetrWorkstationStatisticsGet, - false, - }, - { - "wkssvc_NetrLogonDomainNameAdd", - sizeof(struct wkssvc_NetrLogonDomainNameAdd), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrLogonDomainNameAdd, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrLogonDomainNameAdd, - (ndr_print_function_t) ndr_print_wkssvc_NetrLogonDomainNameAdd, - false, - }, - { - "wkssvc_NetrLogonDomainNameDel", - sizeof(struct wkssvc_NetrLogonDomainNameDel), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrLogonDomainNameDel, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrLogonDomainNameDel, - (ndr_print_function_t) ndr_print_wkssvc_NetrLogonDomainNameDel, - false, - }, - { - "wkssvc_NetrJoinDomain", - sizeof(struct wkssvc_NetrJoinDomain), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrJoinDomain, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrJoinDomain, - (ndr_print_function_t) ndr_print_wkssvc_NetrJoinDomain, - false, - }, - { - "wkssvc_NetrUnjoinDomain", - sizeof(struct wkssvc_NetrUnjoinDomain), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUnjoinDomain, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUnjoinDomain, - (ndr_print_function_t) ndr_print_wkssvc_NetrUnjoinDomain, - false, - }, - { - "wkssvc_NetrRenameMachineInDomain", - sizeof(struct wkssvc_NetrRenameMachineInDomain), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrRenameMachineInDomain, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrRenameMachineInDomain, - (ndr_print_function_t) ndr_print_wkssvc_NetrRenameMachineInDomain, - false, - }, - { - "wkssvc_NetrValidateName", - sizeof(struct wkssvc_NetrValidateName), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrValidateName, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrValidateName, - (ndr_print_function_t) ndr_print_wkssvc_NetrValidateName, - false, - }, - { - "wkssvc_NetrGetJoinInformation", - sizeof(struct wkssvc_NetrGetJoinInformation), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrGetJoinInformation, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrGetJoinInformation, - (ndr_print_function_t) ndr_print_wkssvc_NetrGetJoinInformation, - false, - }, - { - "wkssvc_NetrGetJoinableOus", - sizeof(struct wkssvc_NetrGetJoinableOus), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrGetJoinableOus, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrGetJoinableOus, - (ndr_print_function_t) ndr_print_wkssvc_NetrGetJoinableOus, - false, - }, - { - "wkssvc_NetrJoinDomain2", - sizeof(struct wkssvc_NetrJoinDomain2), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrJoinDomain2, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrJoinDomain2, - (ndr_print_function_t) ndr_print_wkssvc_NetrJoinDomain2, - false, - }, - { - "wkssvc_NetrUnjoinDomain2", - sizeof(struct wkssvc_NetrUnjoinDomain2), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrUnjoinDomain2, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrUnjoinDomain2, - (ndr_print_function_t) ndr_print_wkssvc_NetrUnjoinDomain2, - false, - }, - { - "wkssvc_NetrRenameMachineInDomain2", - sizeof(struct wkssvc_NetrRenameMachineInDomain2), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrRenameMachineInDomain2, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrRenameMachineInDomain2, - (ndr_print_function_t) ndr_print_wkssvc_NetrRenameMachineInDomain2, - false, - }, - { - "wkssvc_NetrValidateName2", - sizeof(struct wkssvc_NetrValidateName2), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrValidateName2, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrValidateName2, - (ndr_print_function_t) ndr_print_wkssvc_NetrValidateName2, - false, - }, - { - "wkssvc_NetrGetJoinableOus2", - sizeof(struct wkssvc_NetrGetJoinableOus2), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrGetJoinableOus2, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrGetJoinableOus2, - (ndr_print_function_t) ndr_print_wkssvc_NetrGetJoinableOus2, - false, - }, - { - "wkssvc_NetrAddAlternateComputerName", - sizeof(struct wkssvc_NetrAddAlternateComputerName), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrAddAlternateComputerName, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrAddAlternateComputerName, - (ndr_print_function_t) ndr_print_wkssvc_NetrAddAlternateComputerName, - false, - }, - { - "wkssvc_NetrRemoveAlternateComputerName", - sizeof(struct wkssvc_NetrRemoveAlternateComputerName), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrRemoveAlternateComputerName, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrRemoveAlternateComputerName, - (ndr_print_function_t) ndr_print_wkssvc_NetrRemoveAlternateComputerName, - false, - }, - { - "wkssvc_NetrSetPrimaryComputername", - sizeof(struct wkssvc_NetrSetPrimaryComputername), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrSetPrimaryComputername, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrSetPrimaryComputername, - (ndr_print_function_t) ndr_print_wkssvc_NetrSetPrimaryComputername, - false, - }, - { - "wkssvc_NetrEnumerateComputerNames", - sizeof(struct wkssvc_NetrEnumerateComputerNames), - (ndr_push_flags_fn_t) ndr_push_wkssvc_NetrEnumerateComputerNames, - (ndr_pull_flags_fn_t) ndr_pull_wkssvc_NetrEnumerateComputerNames, - (ndr_print_function_t) ndr_print_wkssvc_NetrEnumerateComputerNames, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const wkssvc_endpoint_strings[] = { - "ncacn_np:[\\pipe\\wkssvc]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array wkssvc_endpoints = { - .count = 3, - .names = wkssvc_endpoint_strings -}; - -static const char * const wkssvc_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array wkssvc_authservices = { - .count = 1, - .names = wkssvc_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_wkssvc = { - .name = "wkssvc", - .syntax_id = { - {0x6bffd098,0xa112,0x3610,{0x98,0x33},{0x46,0xc3,0xf8,0x7e,0x34,0x5a}}, - NDR_WKSSVC_VERSION - }, - .helpstring = NDR_WKSSVC_HELPSTRING, - .num_calls = 31, - .calls = wkssvc_calls, - .endpoints = &wkssvc_endpoints, - .authservices = &wkssvc_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_wkssvc.h b/source3/librpc/gen_ndr/ndr_wkssvc.h deleted file mode 100644 index 0fa4d3f8d4..0000000000 --- a/source3/librpc/gen_ndr/ndr_wkssvc.h +++ /dev/null @@ -1,175 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/wkssvc.h" - -#ifndef _HEADER_NDR_wkssvc -#define _HEADER_NDR_wkssvc - -#define NDR_WKSSVC_UUID "6bffd098-a112-3610-9833-46c3f87e345a" -#define NDR_WKSSVC_VERSION 1.0 -#define NDR_WKSSVC_NAME "wkssvc" -#define NDR_WKSSVC_HELPSTRING "Workstation Service" -extern const struct ndr_interface_table ndr_table_wkssvc; -#define NDR_WKSSVC_NETWKSTAGETINFO (0x00) - -#define NDR_WKSSVC_NETWKSTASETINFO (0x01) - -#define NDR_WKSSVC_NETWKSTAENUMUSERS (0x02) - -#define NDR_WKSSVC_NETRWKSTAUSERGETINFO (0x03) - -#define NDR_WKSSVC_NETRWKSTAUSERSETINFO (0x04) - -#define NDR_WKSSVC_NETWKSTATRANSPORTENUM (0x05) - -#define NDR_WKSSVC_NETRWKSTATRANSPORTADD (0x06) - -#define NDR_WKSSVC_NETRWKSTATRANSPORTDEL (0x07) - -#define NDR_WKSSVC_NETRUSEADD (0x08) - -#define NDR_WKSSVC_NETRUSEGETINFO (0x09) - -#define NDR_WKSSVC_NETRUSEDEL (0x0a) - -#define NDR_WKSSVC_NETRUSEENUM (0x0b) - -#define NDR_WKSSVC_NETRMESSAGEBUFFERSEND (0x0c) - -#define NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET (0x0d) - -#define NDR_WKSSVC_NETRLOGONDOMAINNAMEADD (0x0e) - -#define NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL (0x0f) - -#define NDR_WKSSVC_NETRJOINDOMAIN (0x10) - -#define NDR_WKSSVC_NETRUNJOINDOMAIN (0x11) - -#define NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN (0x12) - -#define NDR_WKSSVC_NETRVALIDATENAME (0x13) - -#define NDR_WKSSVC_NETRGETJOININFORMATION (0x14) - -#define NDR_WKSSVC_NETRGETJOINABLEOUS (0x15) - -#define NDR_WKSSVC_NETRJOINDOMAIN2 (0x16) - -#define NDR_WKSSVC_NETRUNJOINDOMAIN2 (0x17) - -#define NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2 (0x18) - -#define NDR_WKSSVC_NETRVALIDATENAME2 (0x19) - -#define NDR_WKSSVC_NETRGETJOINABLEOUS2 (0x1a) - -#define NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME (0x1b) - -#define NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME (0x1c) - -#define NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME (0x1d) - -#define NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES (0x1e) - -#define NDR_WKSSVC_CALL_COUNT (31) -void ndr_print_wkssvc_NetWkstaInfo100(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo100 *r); -void ndr_print_wkssvc_NetWkstaInfo101(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo101 *r); -void ndr_print_wkssvc_NetWkstaInfo102(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo102 *r); -void ndr_print_wkssvc_NetWkstaInfo502(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo502 *r); -void ndr_print_wkssvc_NetWkstaInfo1010(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1010 *r); -void ndr_print_wkssvc_NetWkstaInfo1011(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1011 *r); -void ndr_print_wkssvc_NetWkstaInfo1012(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1012 *r); -void ndr_print_wkssvc_NetWkstaInfo1013(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1013 *r); -void ndr_print_wkssvc_NetWkstaInfo1018(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1018 *r); -void ndr_print_wkssvc_NetWkstaInfo1023(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1023 *r); -void ndr_print_wkssvc_NetWkstaInfo1027(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1027 *r); -void ndr_print_wkssvc_NetWkstaInfo1028(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1028 *r); -void ndr_print_wkssvc_NetWkstaInfo1032(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1032 *r); -void ndr_print_wkssvc_NetWkstaInfo1033(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1033 *r); -void ndr_print_wkssvc_NetWkstaInfo1041(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1041 *r); -void ndr_print_wkssvc_NetWkstaInfo1042(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1042 *r); -void ndr_print_wkssvc_NetWkstaInfo1043(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1043 *r); -void ndr_print_wkssvc_NetWkstaInfo1044(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1044 *r); -void ndr_print_wkssvc_NetWkstaInfo1045(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1045 *r); -void ndr_print_wkssvc_NetWkstaInfo1046(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1046 *r); -void ndr_print_wkssvc_NetWkstaInfo1047(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1047 *r); -void ndr_print_wkssvc_NetWkstaInfo1048(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1048 *r); -void ndr_print_wkssvc_NetWkstaInfo1049(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1049 *r); -void ndr_print_wkssvc_NetWkstaInfo1050(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1050 *r); -void ndr_print_wkssvc_NetWkstaInfo1051(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1051 *r); -void ndr_print_wkssvc_NetWkstaInfo1052(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1052 *r); -void ndr_print_wkssvc_NetWkstaInfo1053(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1053 *r); -void ndr_print_wkssvc_NetWkstaInfo1054(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1054 *r); -void ndr_print_wkssvc_NetWkstaInfo1055(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1055 *r); -void ndr_print_wkssvc_NetWkstaInfo1056(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1056 *r); -void ndr_print_wkssvc_NetWkstaInfo1057(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1057 *r); -void ndr_print_wkssvc_NetWkstaInfo1058(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1058 *r); -void ndr_print_wkssvc_NetWkstaInfo1059(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1059 *r); -void ndr_print_wkssvc_NetWkstaInfo1060(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1060 *r); -void ndr_print_wkssvc_NetWkstaInfo1061(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1061 *r); -void ndr_print_wkssvc_NetWkstaInfo1062(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaInfo1062 *r); -void ndr_print_wkssvc_NetWkstaInfo(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaInfo *r); -void ndr_print_wkssvc_NetrWkstaUserInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo0 *r); -void ndr_print_wkssvc_NetWkstaEnumUsersCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersCtr0 *r); -void ndr_print_wkssvc_NetrWkstaUserInfo1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo1 *r); -void ndr_print_wkssvc_NetWkstaEnumUsersCtr1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersCtr1 *r); -void ndr_print_wkssvc_NetWkstaEnumUsersCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaEnumUsersCtr *r); -void ndr_print_wkssvc_NetWkstaEnumUsersInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaEnumUsersInfo *r); -void ndr_print_wkssvc_NetrWkstaUserInfo1101(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWkstaUserInfo1101 *r); -void ndr_print_wkssvc_NetrWkstaUserInfo(struct ndr_print *ndr, const char *name, const union wkssvc_NetrWkstaUserInfo *r); -void ndr_print_wkssvc_NetWkstaTransportInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportInfo0 *r); -void ndr_print_wkssvc_NetWkstaTransportCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportCtr0 *r); -void ndr_print_wkssvc_NetWkstaTransportCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetWkstaTransportCtr *r); -void ndr_print_wkssvc_NetWkstaTransportInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetWkstaTransportInfo *r); -void ndr_print_wkssvc_NetrUseInfo3(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo3 *r); -void ndr_print_wkssvc_NetrUseInfo2(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo2 *r); -void ndr_print_wkssvc_NetrUseInfo1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo1 *r); -void ndr_print_wkssvc_NetrUseInfo0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseInfo0 *r); -void ndr_print_wkssvc_NetrUseGetInfoCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetrUseGetInfoCtr *r); -void ndr_print_wkssvc_NetrUseEnumCtr2(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr2 *r); -void ndr_print_wkssvc_NetrUseEnumCtr1(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr1 *r); -void ndr_print_wkssvc_NetrUseEnumCtr0(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumCtr0 *r); -void ndr_print_wkssvc_NetrUseEnumCtr(struct ndr_print *ndr, const char *name, const union wkssvc_NetrUseEnumCtr *r); -void ndr_print_wkssvc_NetrUseEnumInfo(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrUseEnumInfo *r); -void ndr_print_wkssvc_NetrWorkstationStatistics(struct ndr_print *ndr, const char *name, const struct wkssvc_NetrWorkstationStatistics *r); -void ndr_print_wkssvc_renameflags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_wkssvc_NetValidateNameType(struct ndr_print *ndr, const char *name, enum wkssvc_NetValidateNameType r); -void ndr_print_wkssvc_NetJoinStatus(struct ndr_print *ndr, const char *name, enum wkssvc_NetJoinStatus r); -void ndr_print_wkssvc_PasswordBuffer(struct ndr_print *ndr, const char *name, const struct wkssvc_PasswordBuffer *r); -void ndr_print_wkssvc_joinflags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_wkssvc_ComputerNameType(struct ndr_print *ndr, const char *name, enum wkssvc_ComputerNameType r); -void ndr_print_wkssvc_ComputerNamesCtr(struct ndr_print *ndr, const char *name, const struct wkssvc_ComputerNamesCtr *r); -void ndr_print_wkssvc_NetWkstaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaGetInfo *r); -void ndr_print_wkssvc_NetWkstaSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaSetInfo *r); -void ndr_print_wkssvc_NetWkstaEnumUsers(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaEnumUsers *r); -void ndr_print_wkssvc_NetrWkstaUserGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaUserGetInfo *r); -void ndr_print_wkssvc_NetrWkstaUserSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaUserSetInfo *r); -void ndr_print_wkssvc_NetWkstaTransportEnum(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetWkstaTransportEnum *r); -void ndr_print_wkssvc_NetrWkstaTransportAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaTransportAdd *r); -void ndr_print_wkssvc_NetrWkstaTransportDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWkstaTransportDel *r); -void ndr_print_wkssvc_NetrUseAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseAdd *r); -void ndr_print_wkssvc_NetrUseGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseGetInfo *r); -void ndr_print_wkssvc_NetrUseDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseDel *r); -void ndr_print_wkssvc_NetrUseEnum(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUseEnum *r); -void ndr_print_wkssvc_NetrMessageBufferSend(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrMessageBufferSend *r); -void ndr_print_wkssvc_NetrWorkstationStatisticsGet(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrWorkstationStatisticsGet *r); -void ndr_print_wkssvc_NetrLogonDomainNameAdd(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrLogonDomainNameAdd *r); -void ndr_print_wkssvc_NetrLogonDomainNameDel(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrLogonDomainNameDel *r); -void ndr_print_wkssvc_NetrJoinDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrJoinDomain *r); -void ndr_print_wkssvc_NetrUnjoinDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUnjoinDomain *r); -void ndr_print_wkssvc_NetrRenameMachineInDomain(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRenameMachineInDomain *r); -void ndr_print_wkssvc_NetrValidateName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrValidateName *r); -void ndr_print_wkssvc_NetrGetJoinInformation(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinInformation *r); -void ndr_print_wkssvc_NetrGetJoinableOus(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus *r); -void ndr_print_wkssvc_NetrJoinDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrJoinDomain2 *r); -void ndr_print_wkssvc_NetrUnjoinDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrUnjoinDomain2 *r); -void ndr_print_wkssvc_NetrRenameMachineInDomain2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRenameMachineInDomain2 *r); -void ndr_print_wkssvc_NetrValidateName2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrValidateName2 *r); -void ndr_print_wkssvc_NetrGetJoinableOus2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus2 *r); -void ndr_print_wkssvc_NetrAddAlternateComputerName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrAddAlternateComputerName *r); -void ndr_print_wkssvc_NetrRemoveAlternateComputerName(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrRemoveAlternateComputerName *r); -void ndr_print_wkssvc_NetrSetPrimaryComputername(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrSetPrimaryComputername *r); -void ndr_print_wkssvc_NetrEnumerateComputerNames(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrEnumerateComputerNames *r); -#endif /* _HEADER_NDR_wkssvc */ diff --git a/source3/librpc/gen_ndr/ndr_xattr.c b/source3/librpc/gen_ndr/ndr_xattr.c deleted file mode 100644 index 75781d763d..0000000000 --- a/source3/librpc/gen_ndr/ndr_xattr.c +++ /dev/null @@ -1,773 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_xattr.h" - -#include "librpc/gen_ndr/ndr_security.h" -static enum ndr_err_code ndr_push_xattr_DosInfo1(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_xattr_DosInfo1(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfo1 *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ea_size)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->create_time)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->change_time)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_DosInfo1(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo1 *r) -{ - ndr_print_struct(ndr, name, "xattr_DosInfo1"); - ndr->depth++; - ndr_print_uint32(ndr, "attrib", r->attrib); - ndr_print_uint32(ndr, "ea_size", r->ea_size); - ndr_print_udlong(ndr, "size", r->size); - ndr_print_udlong(ndr, "alloc_size", r->alloc_size); - ndr_print_NTTIME(ndr, "create_time", r->create_time); - ndr_print_NTTIME(ndr, "change_time", r->change_time); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_xattr_DosInfo2Old(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo2Old *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->write_time)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_xattr_DosInfo2Old(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfo2Old *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ea_size)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->create_time)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->change_time)); - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->write_time)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_DosInfo2Old(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo2Old *r) -{ - ndr_print_struct(ndr, name, "xattr_DosInfo2Old"); - ndr->depth++; - ndr_print_uint32(ndr, "flags", r->flags); - ndr_print_uint32(ndr, "attrib", r->attrib); - ndr_print_uint32(ndr, "ea_size", r->ea_size); - ndr_print_udlong(ndr, "size", r->size); - ndr_print_udlong(ndr, "alloc_size", r->alloc_size); - ndr_print_NTTIME(ndr, "create_time", r->create_time); - ndr_print_NTTIME(ndr, "change_time", r->change_time); - ndr_print_NTTIME(ndr, "write_time", r->write_time); - ndr_print_string(ndr, "name", r->name); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_xattr_DosInfo(struct ndr_push *ndr, int ndr_flags, const union xattr_DosInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_xattr_DosInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_push_xattr_DosInfo2Old(ndr, NDR_SCALARS, &r->oldinfo2)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - break; - - case 2: - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_xattr_DosInfo(struct ndr_pull *ndr, int ndr_flags, union xattr_DosInfo *r) -{ - int level; - uint16_t _level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - NDR_CHECK(ndr_pull_xattr_DosInfo1(ndr, NDR_SCALARS, &r->info1)); - break; } - - case 2: { - NDR_CHECK(ndr_pull_xattr_DosInfo2Old(ndr, NDR_SCALARS, &r->oldinfo2)); - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - break; - - case 2: - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_DosInfo(struct ndr_print *ndr, const char *name, const union xattr_DosInfo *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "xattr_DosInfo"); - switch (level) { - case 1: - ndr_print_xattr_DosInfo1(ndr, "info1", &r->info1); - break; - - case 2: - ndr_print_xattr_DosInfo2Old(ndr, "oldinfo2", &r->oldinfo2); - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_xattr_DosAttrib(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosAttrib *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->version)); - NDR_CHECK(ndr_push_xattr_DosInfo(ndr, NDR_SCALARS, &r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosAttrib(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosAttrib *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->version)); - NDR_CHECK(ndr_pull_xattr_DosInfo(ndr, NDR_SCALARS, &r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_DosAttrib(struct ndr_print *ndr, const char *name, const struct xattr_DosAttrib *r) -{ - ndr_print_struct(ndr, name, "xattr_DosAttrib"); - ndr->depth++; - ndr_print_uint16(ndr, "version", r->version); - ndr_print_set_switch_value(ndr, &r->info, r->version); - ndr_print_xattr_DosInfo(ndr, "info", &r->info); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_xattr_EA(struct ndr_push *ndr, int ndr_flags, const struct xattr_EA *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->value)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_xattr_EA(struct ndr_pull *ndr, int ndr_flags, struct xattr_EA *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); - ndr->flags = _flags_save_string; - } - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->value)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_EA(struct ndr_print *ndr, const char *name, const struct xattr_EA *r) -{ - ndr_print_struct(ndr, name, "xattr_EA"); - ndr->depth++; - ndr_print_string(ndr, "name", r->name); - ndr_print_DATA_BLOB(ndr, "value", r->value); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_xattr_DosEAs(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosEAs *r) -{ - uint32_t cntr_eas_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_eas)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->eas)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->eas) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_eas)); - for (cntr_eas_1 = 0; cntr_eas_1 < r->num_eas; cntr_eas_1++) { - NDR_CHECK(ndr_push_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosEAs(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosEAs *r) -{ - uint32_t _ptr_eas; - uint32_t cntr_eas_1; - TALLOC_CTX *_mem_save_eas_0; - TALLOC_CTX *_mem_save_eas_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_eas)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_eas)); - if (_ptr_eas) { - NDR_PULL_ALLOC(ndr, r->eas); - } else { - r->eas = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->eas) { - _mem_save_eas_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->eas)); - NDR_PULL_ALLOC_N(ndr, r->eas, ndr_get_array_size(ndr, &r->eas)); - _mem_save_eas_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0); - for (cntr_eas_1 = 0; cntr_eas_1 < r->num_eas; cntr_eas_1++) { - NDR_CHECK(ndr_pull_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_0, 0); - } - if (r->eas) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->eas, r->num_eas)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_DosEAs(struct ndr_print *ndr, const char *name, const struct xattr_DosEAs *r) -{ - uint32_t cntr_eas_1; - ndr_print_struct(ndr, name, "xattr_DosEAs"); - ndr->depth++; - ndr_print_uint16(ndr, "num_eas", r->num_eas); - ndr_print_ptr(ndr, "eas", r->eas); - ndr->depth++; - if (r->eas) { - ndr->print(ndr, "%s: ARRAY(%d)", "eas", (int)r->num_eas); - ndr->depth++; - for (cntr_eas_1=0;cntr_eas_1num_eas;cntr_eas_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_eas_1) != -1) { - ndr_print_xattr_EA(ndr, "eas", &r->eas[cntr_eas_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_tdb_xattrs(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattrs *r) -{ - uint32_t cntr_eas_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_eas)); - for (cntr_eas_0 = 0; cntr_eas_0 < r->num_eas; cntr_eas_0++) { - NDR_CHECK(ndr_push_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_tdb_xattrs(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattrs *r) -{ - uint32_t cntr_eas_0; - TALLOC_CTX *_mem_save_eas_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_eas)); - NDR_PULL_ALLOC_N(ndr, r->eas, r->num_eas); - _mem_save_eas_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0); - for (cntr_eas_0 = 0; cntr_eas_0 < r->num_eas; cntr_eas_0++) { - NDR_CHECK(ndr_pull_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, const struct tdb_xattrs *r) -{ - uint32_t cntr_eas_0; - ndr_print_struct(ndr, name, "tdb_xattrs"); - ndr->depth++; - ndr_print_uint32(ndr, "num_eas", r->num_eas); - ndr->print(ndr, "%s: ARRAY(%d)", "eas", (int)r->num_eas); - ndr->depth++; - for (cntr_eas_0=0;cntr_eas_0num_eas;cntr_eas_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_eas_0) != -1) { - ndr_print_xattr_EA(ndr, "eas", &r->eas[cntr_eas_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_xattr_DosStream(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStream *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_xattr_DosStream(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStream *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_DosStream(struct ndr_print *ndr, const char *name, const struct xattr_DosStream *r) -{ - ndr_print_struct(ndr, name, "xattr_DosStream"); - ndr->depth++; - ndr_print_uint32(ndr, "flags", r->flags); - ndr_print_udlong(ndr, "size", r->size); - ndr_print_udlong(ndr, "alloc_size", r->alloc_size); - ndr_print_string(ndr, "name", r->name); - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_xattr_DosStreams(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStreams *r) -{ - uint32_t cntr_streams_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_streams)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->streams)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->streams) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_streams)); - for (cntr_streams_1 = 0; cntr_streams_1 < r->num_streams; cntr_streams_1++) { - NDR_CHECK(ndr_push_xattr_DosStream(ndr, NDR_SCALARS, &r->streams[cntr_streams_1])); - } - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosStreams(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStreams *r) -{ - uint32_t _ptr_streams; - uint32_t cntr_streams_1; - TALLOC_CTX *_mem_save_streams_0; - TALLOC_CTX *_mem_save_streams_1; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_streams)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_streams)); - if (_ptr_streams) { - NDR_PULL_ALLOC(ndr, r->streams); - } else { - r->streams = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->streams) { - _mem_save_streams_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->streams, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->streams)); - NDR_PULL_ALLOC_N(ndr, r->streams, ndr_get_array_size(ndr, &r->streams)); - _mem_save_streams_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->streams, 0); - for (cntr_streams_1 = 0; cntr_streams_1 < r->num_streams; cntr_streams_1++) { - NDR_CHECK(ndr_pull_xattr_DosStream(ndr, NDR_SCALARS, &r->streams[cntr_streams_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_streams_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_streams_0, 0); - } - if (r->streams) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->streams, r->num_streams)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_DosStreams(struct ndr_print *ndr, const char *name, const struct xattr_DosStreams *r) -{ - uint32_t cntr_streams_1; - ndr_print_struct(ndr, name, "xattr_DosStreams"); - ndr->depth++; - ndr_print_uint32(ndr, "num_streams", r->num_streams); - ndr_print_ptr(ndr, "streams", r->streams); - ndr->depth++; - if (r->streams) { - ndr->print(ndr, "%s: ARRAY(%d)", "streams", (int)r->num_streams); - ndr->depth++; - for (cntr_streams_1=0;cntr_streams_1num_streams;cntr_streams_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_streams_1) != -1) { - ndr_print_xattr_DosStream(ndr, "streams", &r->streams[cntr_streams_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; -} - -_PUBLIC_ enum ndr_err_code ndr_push_security_descriptor_hash(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor_hash *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sd) { - NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_security_descriptor_hash(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor_hash *r) -{ - uint32_t _ptr_sd; - TALLOC_CTX *_mem_save_sd_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd)); - if (_ptr_sd) { - NDR_PULL_ALLOC(ndr, r->sd); - } else { - r->sd = NULL; - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sd) { - _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0); - NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_security_descriptor_hash(struct ndr_print *ndr, const char *name, const struct security_descriptor_hash *r) -{ - ndr_print_struct(ndr, name, "security_descriptor_hash"); - ndr->depth++; - ndr_print_ptr(ndr, "sd", r->sd); - ndr->depth++; - if (r->sd) { - ndr_print_security_descriptor(ndr, "sd", r->sd); - } - ndr->depth--; - ndr_print_array_uint8(ndr, "hash", r->hash, 16); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_xattr_NTACL_Info(struct ndr_push *ndr, int ndr_flags, const union xattr_NTACL_Info *r) -{ - if (ndr_flags & NDR_SCALARS) { - int level = ndr_push_get_switch_value(ndr, r); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); - switch (level) { - case 1: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd)); - break; } - - case 2: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd_hs)); - break; } - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - int level = ndr_push_get_switch_value(ndr, r); - switch (level) { - case 1: - if (r->sd) { - NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd)); - } - break; - - case 2: - if (r->sd_hs) { - NDR_CHECK(ndr_push_security_descriptor_hash(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd_hs)); - } - break; - - default: - return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_xattr_NTACL_Info(struct ndr_pull *ndr, int ndr_flags, union xattr_NTACL_Info *r) -{ - int level; - uint16_t _level; - TALLOC_CTX *_mem_save_sd_0; - TALLOC_CTX *_mem_save_sd_hs_0; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); - if (_level != level) { - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); - } - switch (level) { - case 1: { - uint32_t _ptr_sd; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd)); - if (_ptr_sd) { - NDR_PULL_ALLOC(ndr, r->sd); - } else { - r->sd = NULL; - } - break; } - - case 2: { - uint32_t _ptr_sd_hs; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd_hs)); - if (_ptr_sd_hs) { - NDR_PULL_ALLOC(ndr, r->sd_hs); - } else { - r->sd_hs = NULL; - } - break; } - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case 1: - if (r->sd) { - _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0); - NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0); - } - break; - - case 2: - if (r->sd_hs) { - _mem_save_sd_hs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sd_hs, 0); - NDR_CHECK(ndr_pull_security_descriptor_hash(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd_hs)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_hs_0, 0); - } - break; - - default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_NTACL_Info(struct ndr_print *ndr, const char *name, const union xattr_NTACL_Info *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "xattr_NTACL_Info"); - switch (level) { - case 1: - ndr_print_ptr(ndr, "sd", r->sd); - ndr->depth++; - if (r->sd) { - ndr_print_security_descriptor(ndr, "sd", r->sd); - } - ndr->depth--; - break; - - case 2: - ndr_print_ptr(ndr, "sd_hs", r->sd_hs); - ndr->depth++; - if (r->sd_hs) { - ndr_print_security_descriptor_hash(ndr, "sd_hs", r->sd_hs); - } - ndr->depth--; - break; - - default: - ndr_print_bad_level(ndr, name, level); - } -} - -_PUBLIC_ enum ndr_err_code ndr_push_xattr_NTACL(struct ndr_push *ndr, int ndr_flags, const struct xattr_NTACL *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->version)); - NDR_CHECK(ndr_push_xattr_NTACL_Info(ndr, NDR_SCALARS, &r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_xattr_NTACL_Info(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_xattr_NTACL(struct ndr_pull *ndr, int ndr_flags, struct xattr_NTACL *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->version)); - NDR_CHECK(ndr_pull_xattr_NTACL_Info(ndr, NDR_SCALARS, &r->info)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_xattr_NTACL_Info(ndr, NDR_BUFFERS, &r->info)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_xattr_NTACL(struct ndr_print *ndr, const char *name, const struct xattr_NTACL *r) -{ - ndr_print_struct(ndr, name, "xattr_NTACL"); - ndr->depth++; - ndr_print_uint16(ndr, "version", r->version); - ndr_print_set_switch_value(ndr, &r->info, r->version); - ndr_print_xattr_NTACL_Info(ndr, "info", &r->info); - ndr->depth--; -} - diff --git a/source3/librpc/gen_ndr/ndr_xattr.h b/source3/librpc/gen_ndr/ndr_xattr.h deleted file mode 100644 index c565e8513a..0000000000 --- a/source3/librpc/gen_ndr/ndr_xattr.h +++ /dev/null @@ -1,34 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/xattr.h" - -#ifndef _HEADER_NDR_xattr -#define _HEADER_NDR_xattr - -#define NDR_XATTR_CALL_COUNT (0) -void ndr_print_xattr_DosInfo1(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo1 *r); -void ndr_print_xattr_DosInfo2Old(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo2Old *r); -void ndr_print_xattr_DosInfo(struct ndr_print *ndr, const char *name, const union xattr_DosInfo *r); -enum ndr_err_code ndr_push_xattr_DosAttrib(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosAttrib *r); -enum ndr_err_code ndr_pull_xattr_DosAttrib(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosAttrib *r); -void ndr_print_xattr_DosAttrib(struct ndr_print *ndr, const char *name, const struct xattr_DosAttrib *r); -void ndr_print_xattr_EA(struct ndr_print *ndr, const char *name, const struct xattr_EA *r); -enum ndr_err_code ndr_push_xattr_DosEAs(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosEAs *r); -enum ndr_err_code ndr_pull_xattr_DosEAs(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosEAs *r); -void ndr_print_xattr_DosEAs(struct ndr_print *ndr, const char *name, const struct xattr_DosEAs *r); -enum ndr_err_code ndr_push_tdb_xattrs(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattrs *r); -enum ndr_err_code ndr_pull_tdb_xattrs(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattrs *r); -void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, const struct tdb_xattrs *r); -void ndr_print_xattr_DosStream(struct ndr_print *ndr, const char *name, const struct xattr_DosStream *r); -enum ndr_err_code ndr_push_xattr_DosStreams(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStreams *r); -enum ndr_err_code ndr_pull_xattr_DosStreams(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStreams *r); -void ndr_print_xattr_DosStreams(struct ndr_print *ndr, const char *name, const struct xattr_DosStreams *r); -enum ndr_err_code ndr_push_security_descriptor_hash(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor_hash *r); -enum ndr_err_code ndr_pull_security_descriptor_hash(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor_hash *r); -void ndr_print_security_descriptor_hash(struct ndr_print *ndr, const char *name, const struct security_descriptor_hash *r); -void ndr_print_xattr_NTACL_Info(struct ndr_print *ndr, const char *name, const union xattr_NTACL_Info *r); -enum ndr_err_code ndr_push_xattr_NTACL(struct ndr_push *ndr, int ndr_flags, const struct xattr_NTACL *r); -enum ndr_err_code ndr_pull_xattr_NTACL(struct ndr_pull *ndr, int ndr_flags, struct xattr_NTACL *r); -void ndr_print_xattr_NTACL(struct ndr_print *ndr, const char *name, const struct xattr_NTACL *r); -#endif /* _HEADER_NDR_xattr */ diff --git a/source3/librpc/gen_ndr/netlogon.h b/source3/librpc/gen_ndr/netlogon.h deleted file mode 100644 index 7fb253446a..0000000000 --- a/source3/librpc/gen_ndr/netlogon.h +++ /dev/null @@ -1,1735 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/misc.h" -#include "librpc/gen_ndr/lsa.h" -#include "librpc/gen_ndr/samr.h" -#include "librpc/gen_ndr/security.h" -#include "librpc/gen_ndr/nbt.h" -#define netr_DeltaEnum8Bit netr_DeltaEnum -#define netr_SamDatabaseID8Bit netr_SamDatabaseID -#ifndef _HEADER_netlogon -#define _HEADER_netlogon - -#define DSGETDC_VALID_FLAGS ( (DS_FORCE_REDISCOVERY|DS_DIRECTORY_SERVICE_REQUIRED|DS_DIRECTORY_SERVICE_PREFERRED|DS_GC_SERVER_REQUIRED|DS_PDC_REQUIRED|DS_BACKGROUND_ONLY|DS_IP_REQUIRED|DS_KDC_REQUIRED|DS_TIMESERV_REQUIRED|DS_WRITABLE_REQUIRED|DS_GOOD_TIMESERV_PREFERRED|DS_AVOID_SELF|DS_ONLY_LDAP_NEEDED|DS_IS_FLAT_NAME|DS_IS_DNS_NAME|DS_RETURN_FLAT_NAME|DS_RETURN_DNS_NAME) ) -#define DS_GFTI_UPDATE_TDO ( 0x1 ) -enum netr_DeltaEnum8Bit; - -enum netr_SamDatabaseID8Bit; - -struct netr_UasInfo { - const char *account_name;/* [unique,charset(UTF16)] */ - uint32_t priv; - uint32_t auth_flags; - uint32_t logon_count; - uint32_t bad_pw_count; - time_t last_logon; - time_t last_logoff; - time_t logoff_time; - time_t kickoff_time; - uint32_t password_age; - time_t pw_can_change; - time_t pw_must_change; - const char *computer;/* [unique,charset(UTF16)] */ - const char *domain;/* [unique,charset(UTF16)] */ - const char *script_path;/* [unique,charset(UTF16)] */ - uint32_t unknown; -}; - -struct netr_UasLogoffInfo { - uint32_t duration; - uint16_t logon_count; -}; - -struct netr_AcctLockStr { - int64_t lockout_duration; - uint64_t reset_count; - uint32_t bad_attempt_lockout; - uint32_t dummy; -}/* [public] */; - -/* bitmap netr_LogonParameterControl */ -#define MSV1_0_CLEARTEXT_PASSWORD_ALLOWED ( 0x00000002 ) -#define MSV1_0_UPDATE_LOGON_STATISTICS ( 0x00000004 ) -#define MSV1_0_RETURN_USER_PARAMETERS ( 0x00000008 ) -#define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT ( 0x00000020 ) -#define MSV1_0_RETURN_PROFILE_PATH ( 0x00000200 ) -#define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT ( 0x00000800 ) - -struct netr_IdentityInfo { - struct lsa_String domain_name; - uint32_t parameter_control; - uint32_t logon_id_low; - uint32_t logon_id_high; - struct lsa_String account_name; - struct lsa_String workstation; -}; - -struct netr_PasswordInfo { - struct netr_IdentityInfo identity_info; - struct samr_Password lmpassword; - struct samr_Password ntpassword; -}; - -struct netr_ChallengeResponse { - uint16_t length; - uint16_t size;/* [value(length)] */ - uint8_t *data;/* [unique,length_is(length),size_is(length)] */ -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct netr_NetworkInfo { - struct netr_IdentityInfo identity_info; - uint8_t challenge[8]; - struct netr_ChallengeResponse nt; - struct netr_ChallengeResponse lm; -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct netr_GenericInfo { - struct netr_IdentityInfo identity_info; - struct lsa_String package_name; - uint32_t length; - uint8_t *data;/* [unique,size_is(length)] */ -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -enum netr_LogonInfoClass -#ifndef USE_UINT_ENUMS - { - NetlogonInteractiveInformation=1, - NetlogonNetworkInformation=2, - NetlogonServiceInformation=3, - NetlogonGenericInformation=4, - NetlogonInteractiveTransitiveInformation=5, - NetlogonNetworkTransitiveInformation=6, - NetlogonServiceTransitiveInformation=7 -} -#else - { __donnot_use_enum_netr_LogonInfoClass=0x7FFFFFFF} -#define NetlogonInteractiveInformation ( 1 ) -#define NetlogonNetworkInformation ( 2 ) -#define NetlogonServiceInformation ( 3 ) -#define NetlogonGenericInformation ( 4 ) -#define NetlogonInteractiveTransitiveInformation ( 5 ) -#define NetlogonNetworkTransitiveInformation ( 6 ) -#define NetlogonServiceTransitiveInformation ( 7 ) -#endif -; - -union netr_LogonLevel { - struct netr_PasswordInfo *password;/* [unique,case(NetlogonInteractiveInformation)] */ - struct netr_NetworkInfo *network;/* [unique,case(NetlogonNetworkInformation)] */ - struct netr_GenericInfo *generic;/* [unique,case(NetlogonGenericInformation)] */ -}/* [public,switch_type(netr_LogonInfoClass)] */; - -struct netr_UserSessionKey { - uint8_t key[16]; -}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct netr_LMSessionKey { - uint8_t key[8]; -}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -/* bitmap netr_UserFlags */ -#define NETLOGON_GUEST ( 0x00000001 ) -#define NETLOGON_NOENCRYPTION ( 0x00000002 ) -#define NETLOGON_CACHED_ACCOUNT ( 0x00000004 ) -#define NETLOGON_USED_LM_PASSWORD ( 0x00000008 ) -#define NETLOGON_EXTRA_SIDS ( 0x00000020 ) -#define NETLOGON_SUBAUTH_SESSION_KEY ( 0x00000040 ) -#define NETLOGON_SERVER_TRUST_ACCOUNT ( 0x00000080 ) -#define NETLOGON_NTLMV2_ENABLED ( 0x00000100 ) -#define NETLOGON_RESOURCE_GROUPS ( 0x00000200 ) -#define NETLOGON_PROFILE_PATH_RETURNED ( 0x00000400 ) -#define NETLOGON_GRACE_LOGON ( 0x01000000 ) - -struct netr_SamBaseInfo { - NTTIME last_logon; - NTTIME last_logoff; - NTTIME acct_expiry; - NTTIME last_password_change; - NTTIME allow_password_change; - NTTIME force_password_change; - struct lsa_String account_name; - struct lsa_String full_name; - struct lsa_String logon_script; - struct lsa_String profile_path; - struct lsa_String home_directory; - struct lsa_String home_drive; - uint16_t logon_count; - uint16_t bad_password_count; - uint32_t rid; - uint32_t primary_gid; - struct samr_RidWithAttributeArray groups; - uint32_t user_flags; - struct netr_UserSessionKey key; - struct lsa_StringLarge logon_server; - struct lsa_StringLarge domain; - struct dom_sid2 *domain_sid;/* [unique] */ - struct netr_LMSessionKey LMSessKey; - uint32_t acct_flags; - uint32_t unknown[7]; -}; - -struct netr_SamInfo2 { - struct netr_SamBaseInfo base; -}; - -struct netr_SidAttr { - struct dom_sid2 *sid;/* [unique] */ - uint32_t attributes; -}; - -struct netr_SamInfo3 { - struct netr_SamBaseInfo base; - uint32_t sidcount; - struct netr_SidAttr *sids;/* [unique,size_is(sidcount)] */ -}/* [public] */; - -struct netr_SamInfo6 { - struct netr_SamBaseInfo base; - uint32_t sidcount; - struct netr_SidAttr *sids;/* [unique,size_is(sidcount)] */ - struct lsa_String forest; - struct lsa_String principle; - uint32_t unknown4[20]; -}; - -struct netr_PacInfo { - uint32_t pac_size; - uint8_t *pac;/* [unique,size_is(pac_size)] */ - struct lsa_String logon_domain; - struct lsa_String logon_server; - struct lsa_String principal_name; - uint32_t auth_size; - uint8_t *auth;/* [unique,size_is(auth_size)] */ - struct netr_UserSessionKey user_session_key; - uint32_t expansionroom[10]; - struct lsa_String unknown1; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; -}; - -struct netr_GenericInfo2 { - uint32_t length; - uint8_t *data;/* [unique,size_is(length)] */ -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -enum netr_ValidationInfoClass -#ifndef USE_UINT_ENUMS - { - NetlogonValidationUasInfo=1, - NetlogonValidationSamInfo=2, - NetlogonValidationSamInfo2=3, - NetlogonValidationGenericInfo2=5, - NetlogonValidationSamInfo4=6 -} -#else - { __donnot_use_enum_netr_ValidationInfoClass=0x7FFFFFFF} -#define NetlogonValidationUasInfo ( 1 ) -#define NetlogonValidationSamInfo ( 2 ) -#define NetlogonValidationSamInfo2 ( 3 ) -#define NetlogonValidationGenericInfo2 ( 5 ) -#define NetlogonValidationSamInfo4 ( 6 ) -#endif -; - -union netr_Validation { - struct netr_SamInfo2 *sam2;/* [unique,case(NetlogonValidationSamInfo)] */ - struct netr_SamInfo3 *sam3;/* [unique,case(NetlogonValidationSamInfo2)] */ - struct netr_PacInfo *pac;/* [unique,case(4)] */ - struct netr_GenericInfo2 *generic;/* [unique,case(NetlogonValidationGenericInfo2)] */ - struct netr_SamInfo6 *sam6;/* [unique,case(NetlogonValidationSamInfo4)] */ -}/* [public,switch_type(uint16)] */; - -struct netr_Credential { - uint8_t data[8]; -}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct netr_Authenticator { - struct netr_Credential cred; - time_t timestamp; -}/* [public] */; - -enum netr_SchannelType; - -enum netr_SamDatabaseID; - -struct netr_DELTA_DELETE_USER { - const char *account_name;/* [unique,charset(UTF16)] */ - struct lsa_String unknown1; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t unknown5; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -struct netr_USER_KEY16 { - uint16_t length; - uint16_t size;/* [value(length)] */ - uint32_t flags; - struct samr_Password pwd; -}; - -struct netr_PasswordHistory { - uint16_t nt_length; - uint16_t nt_size;/* [value(nt_length)] */ - uint32_t nt_flags; - uint16_t lm_length; - uint16_t lm_size;/* [value(lm_length)] */ - uint32_t lm_flags; - uint8_t *nt_history; - uint8_t *lm_history; -}; - -struct netr_USER_KEYS2 { - struct netr_USER_KEY16 lmpassword; - struct netr_USER_KEY16 ntpassword; - struct netr_PasswordHistory history; -}; - -struct netr_USER_KEY_UNION { - struct netr_USER_KEYS2 keys2; -}; - -struct netr_USER_KEYS { - uint32_t version; - struct netr_USER_KEY_UNION keys; -}/* [public] */; - -struct netr_USER_PRIVATE_INFO { - uint8_t SensitiveDataFlag; - uint32_t DataLength; - uint8_t *SensitiveData;/* [unique,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(DataLength)] */ -}; - -struct netr_DELTA_USER { - struct lsa_String account_name; - struct lsa_String full_name; - uint32_t rid; - uint32_t primary_gid; - struct lsa_String home_directory; - struct lsa_String home_drive; - struct lsa_String logon_script; - struct lsa_String description; - struct lsa_String workstations; - NTTIME last_logon; - NTTIME last_logoff; - struct samr_LogonHours logon_hours; - uint16_t bad_password_count; - uint16_t logon_count; - NTTIME last_password_change; - NTTIME acct_expiry; - uint32_t acct_flags; - struct samr_Password lmpassword; - struct samr_Password ntpassword; - uint8_t nt_password_present; - uint8_t lm_password_present; - uint8_t password_expired; - struct lsa_String comment; - struct lsa_BinaryString parameters; - uint16_t country_code; - uint16_t code_page; - struct netr_USER_PRIVATE_INFO user_private_info; - uint32_t SecurityInformation; - struct sec_desc_buf sdbuf; - struct lsa_String profile_path; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t unknown5; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -struct netr_DELTA_DOMAIN { - struct lsa_String domain_name; - struct lsa_String oem_information; - int64_t force_logoff_time; - uint16_t min_password_length; - uint16_t password_history_length; - int64_t max_password_age; - int64_t min_password_age; - uint64_t sequence_num; - NTTIME domain_create_time; - uint32_t SecurityInformation; - struct sec_desc_buf sdbuf; - struct lsa_BinaryString account_lockout; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t logon_to_chgpass; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -struct netr_DELTA_GROUP { - struct lsa_String group_name; - uint32_t rid; - uint32_t attributes; - struct lsa_String description; - uint32_t SecurityInformation; - struct sec_desc_buf sdbuf; - struct lsa_String unknown1; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t unknown5; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -struct netr_DELTA_RENAME { - struct lsa_String OldName; - struct lsa_String NewName; - struct lsa_String unknown1; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t unknown5; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -struct netr_DELTA_GROUP_MEMBER { - uint32_t *rids;/* [unique,size_is(num_rids)] */ - uint32_t *attribs;/* [unique,size_is(num_rids)] */ - uint32_t num_rids; - uint32_t unknown1; - uint32_t unknown2; - uint32_t unknown3; - uint32_t unknown4; -}; - -struct netr_DELTA_ALIAS { - struct lsa_String alias_name; - uint32_t rid; - uint32_t SecurityInformation; - struct sec_desc_buf sdbuf; - struct lsa_String description; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t unknown5; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -struct netr_DELTA_ALIAS_MEMBER { - struct lsa_SidArray sids; - uint32_t unknown1; - uint32_t unknown2; - uint32_t unknown3; - uint32_t unknown4; -}; - -struct netr_QUOTA_LIMITS { - uint32_t pagedpoollimit; - uint32_t nonpagedpoollimit; - uint32_t minimumworkingsetsize; - uint32_t maximumworkingsetsize; - uint32_t pagefilelimit; - NTTIME timelimit; -}; - -struct netr_DELTA_POLICY { - uint32_t maxlogsize; - NTTIME auditretentionperiod; - uint8_t auditingmode; - uint32_t maxauditeventcount; - uint32_t *eventauditoptions;/* [unique,size_is(maxauditeventcount+1)] */ - struct lsa_String primary_domain_name; - struct dom_sid2 *sid;/* [unique] */ - struct netr_QUOTA_LIMITS quota_limits; - uint64_t sequence_num; - NTTIME db_create_time; - uint32_t SecurityInformation; - struct sec_desc_buf sdbuf; - struct lsa_String unknown1; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t unknown5; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -struct netr_DELTA_TRUSTED_DOMAIN { - struct lsa_String domain_name; - uint32_t num_controllers; - struct lsa_String *controller_names;/* [unique,size_is(num_controllers)] */ - uint32_t SecurityInformation; - struct sec_desc_buf sdbuf; - struct lsa_String unknown1; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t posix_offset; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -struct netr_DELTA_DELETE_TRUST { - uint16_t unknown; -}; - -struct netr_DELTA_ACCOUNT { - uint32_t privilege_entries; - uint32_t privilege_control; - uint32_t *privilege_attrib;/* [unique,size_is(privilege_entries)] */ - struct lsa_String *privilege_name;/* [unique,size_is(privilege_entries)] */ - struct netr_QUOTA_LIMITS quotalimits; - uint32_t system_flags; - uint32_t SecurityInformation; - struct sec_desc_buf sdbuf; - struct lsa_String unknown1; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t unknown5; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -struct netr_DELTA_DELETE_ACCOUNT { - uint16_t unknown; -}; - -struct netr_DELTA_DELETE_SECRET { - uint16_t unknown; -}; - -struct netr_CIPHER_VALUE { - uint32_t len; - uint32_t maxlen; - uint8_t *cipher_data;/* [unique,length_is(len),size_is(maxlen)] */ -}; - -struct netr_DELTA_SECRET { - struct netr_CIPHER_VALUE current_cipher; - NTTIME current_cipher_set_time; - struct netr_CIPHER_VALUE old_cipher; - NTTIME old_cipher_set_time; - uint32_t SecurityInformation; - struct sec_desc_buf sdbuf; - struct lsa_String unknown1; - struct lsa_String unknown2; - struct lsa_String unknown3; - struct lsa_String unknown4; - uint32_t unknown5; - uint32_t unknown6; - uint32_t unknown7; - uint32_t unknown8; -}; - -enum netr_DeltaEnum -#ifndef USE_UINT_ENUMS - { - NETR_DELTA_DOMAIN=1, - NETR_DELTA_GROUP=2, - NETR_DELTA_DELETE_GROUP=3, - NETR_DELTA_RENAME_GROUP=4, - NETR_DELTA_USER=5, - NETR_DELTA_DELETE_USER=6, - NETR_DELTA_RENAME_USER=7, - NETR_DELTA_GROUP_MEMBER=8, - NETR_DELTA_ALIAS=9, - NETR_DELTA_DELETE_ALIAS=10, - NETR_DELTA_RENAME_ALIAS=11, - NETR_DELTA_ALIAS_MEMBER=12, - NETR_DELTA_POLICY=13, - NETR_DELTA_TRUSTED_DOMAIN=14, - NETR_DELTA_DELETE_TRUST=15, - NETR_DELTA_ACCOUNT=16, - NETR_DELTA_DELETE_ACCOUNT=17, - NETR_DELTA_SECRET=18, - NETR_DELTA_DELETE_SECRET=19, - NETR_DELTA_DELETE_GROUP2=20, - NETR_DELTA_DELETE_USER2=21, - NETR_DELTA_MODIFY_COUNT=22 -} -#else - { __donnot_use_enum_netr_DeltaEnum=0x7FFFFFFF} -#define NETR_DELTA_DOMAIN ( 1 ) -#define NETR_DELTA_GROUP ( 2 ) -#define NETR_DELTA_DELETE_GROUP ( 3 ) -#define NETR_DELTA_RENAME_GROUP ( 4 ) -#define NETR_DELTA_USER ( 5 ) -#define NETR_DELTA_DELETE_USER ( 6 ) -#define NETR_DELTA_RENAME_USER ( 7 ) -#define NETR_DELTA_GROUP_MEMBER ( 8 ) -#define NETR_DELTA_ALIAS ( 9 ) -#define NETR_DELTA_DELETE_ALIAS ( 10 ) -#define NETR_DELTA_RENAME_ALIAS ( 11 ) -#define NETR_DELTA_ALIAS_MEMBER ( 12 ) -#define NETR_DELTA_POLICY ( 13 ) -#define NETR_DELTA_TRUSTED_DOMAIN ( 14 ) -#define NETR_DELTA_DELETE_TRUST ( 15 ) -#define NETR_DELTA_ACCOUNT ( 16 ) -#define NETR_DELTA_DELETE_ACCOUNT ( 17 ) -#define NETR_DELTA_SECRET ( 18 ) -#define NETR_DELTA_DELETE_SECRET ( 19 ) -#define NETR_DELTA_DELETE_GROUP2 ( 20 ) -#define NETR_DELTA_DELETE_USER2 ( 21 ) -#define NETR_DELTA_MODIFY_COUNT ( 22 ) -#endif -; - -union netr_DELTA_UNION { - struct netr_DELTA_DOMAIN *domain;/* [unique,case(NETR_DELTA_DOMAIN)] */ - struct netr_DELTA_GROUP *group;/* [unique,case(NETR_DELTA_GROUP)] */ - struct netr_DELTA_RENAME *rename_group;/* [unique,case(NETR_DELTA_RENAME_GROUP)] */ - struct netr_DELTA_USER *user;/* [unique,case(NETR_DELTA_USER)] */ - struct netr_DELTA_RENAME *rename_user;/* [unique,case(NETR_DELTA_RENAME_USER)] */ - struct netr_DELTA_GROUP_MEMBER *group_member;/* [unique,case(NETR_DELTA_GROUP_MEMBER)] */ - struct netr_DELTA_ALIAS *alias;/* [unique,case(NETR_DELTA_ALIAS)] */ - struct netr_DELTA_RENAME *rename_alias;/* [unique,case(NETR_DELTA_RENAME_ALIAS)] */ - struct netr_DELTA_ALIAS_MEMBER *alias_member;/* [unique,case(NETR_DELTA_ALIAS_MEMBER)] */ - struct netr_DELTA_POLICY *policy;/* [unique,case(NETR_DELTA_POLICY)] */ - struct netr_DELTA_TRUSTED_DOMAIN *trusted_domain;/* [unique,case(NETR_DELTA_TRUSTED_DOMAIN)] */ - struct netr_DELTA_DELETE_TRUST delete_trust;/* [case(NETR_DELTA_DELETE_TRUST)] */ - struct netr_DELTA_ACCOUNT *account;/* [unique,case(NETR_DELTA_ACCOUNT)] */ - struct netr_DELTA_DELETE_ACCOUNT delete_account;/* [case(NETR_DELTA_DELETE_ACCOUNT)] */ - struct netr_DELTA_SECRET *secret;/* [unique,case(NETR_DELTA_SECRET)] */ - struct netr_DELTA_DELETE_SECRET delete_secret;/* [case(NETR_DELTA_DELETE_SECRET)] */ - struct netr_DELTA_DELETE_USER *delete_group;/* [unique,case(NETR_DELTA_DELETE_GROUP2)] */ - struct netr_DELTA_DELETE_USER *delete_user;/* [unique,case(NETR_DELTA_DELETE_USER2)] */ - uint64_t *modified_count;/* [unique,case(NETR_DELTA_MODIFY_COUNT)] */ -}/* [switch_type(netr_DeltaEnum)] */; - -union netr_DELTA_ID_UNION { - uint32_t rid;/* [case(NETR_DELTA_DOMAIN)] */ - struct dom_sid2 *sid;/* [unique,case(NETR_DELTA_POLICY)] */ - const char *name;/* [unique,charset(UTF16),case(NETR_DELTA_SECRET)] */ -}/* [switch_type(netr_DeltaEnum)] */; - -struct netr_DELTA_ENUM { - enum netr_DeltaEnum delta_type; - union netr_DELTA_ID_UNION delta_id_union;/* [switch_is(delta_type)] */ - union netr_DELTA_UNION delta_union;/* [switch_is(delta_type)] */ -}; - -struct netr_DELTA_ENUM_ARRAY { - uint32_t num_deltas; - struct netr_DELTA_ENUM *delta_enum;/* [unique,size_is(num_deltas)] */ -}; - -struct netr_UAS_INFO_0 { - uint8_t computer_name[16]; - uint32_t timecreated; - uint32_t serial_number; -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct netr_AccountBuffer { - DATA_BLOB blob;/* [flag(LIBNDR_FLAG_REMAINING)] */ -}; - -/* bitmap netr_InfoFlags */ -#define NETLOGON_CTRL_REPL_NEEDED ( 0x0001 ) -#define NETLOGON_CTRL_REPL_IN_PROGRESS ( 0x0002 ) -#define NETLOGON_CTRL_REPL_FULL_SYNC ( 0x0004 ) - -struct netr_NETLOGON_INFO_1 { - uint32_t flags; - uint32_t pdc_connection_status; -}; - -struct netr_NETLOGON_INFO_2 { - uint32_t flags; - uint32_t pdc_connection_status; - const char *trusted_dc_name;/* [unique,charset(UTF16)] */ - uint32_t tc_connection_status; -}; - -struct netr_NETLOGON_INFO_3 { - uint32_t flags; - uint32_t logon_attempts; - uint32_t unknown1; - uint32_t unknown2; - uint32_t unknown3; - uint32_t unknown4; - uint32_t unknown5; -}; - -union netr_CONTROL_QUERY_INFORMATION { - struct netr_NETLOGON_INFO_1 *info1;/* [unique,case] */ - struct netr_NETLOGON_INFO_2 *info2;/* [unique,case(2)] */ - struct netr_NETLOGON_INFO_3 *info3;/* [unique,case(3)] */ -}; - -enum netr_LogonControlCode -#ifndef USE_UINT_ENUMS - { - NETLOGON_CONTROL_SYNC=2, - NETLOGON_CONTROL_REDISCOVER=5, - NETLOGON_CONTROL_TC_QUERY=6, - NETLOGON_CONTROL_TRANSPORT_NOTIFY=7, - NETLOGON_CONTROL_SET_DBFLAG=65534 -} -#else - { __donnot_use_enum_netr_LogonControlCode=0x7FFFFFFF} -#define NETLOGON_CONTROL_SYNC ( 2 ) -#define NETLOGON_CONTROL_REDISCOVER ( 5 ) -#define NETLOGON_CONTROL_TC_QUERY ( 6 ) -#define NETLOGON_CONTROL_TRANSPORT_NOTIFY ( 7 ) -#define NETLOGON_CONTROL_SET_DBFLAG ( 65534 ) -#endif -; - -union netr_CONTROL_DATA_INFORMATION { - const char *domain;/* [unique,charset(UTF16),case(NETLOGON_CONTROL_REDISCOVER)] */ - uint32_t debug_level;/* [case(NETLOGON_CONTROL_SET_DBFLAG)] */ -}; - -/* bitmap netr_NegotiateFlags */ -#define NETLOGON_NEG_ACCOUNT_LOCKOUT ( 0x00000001 ) -#define NETLOGON_NEG_PERSISTENT_SAMREPL ( 0x00000002 ) -#define NETLOGON_NEG_ARCFOUR ( 0x00000004 ) -#define NETLOGON_NEG_PROMOTION_COUNT ( 0x00000008 ) -#define NETLOGON_NEG_CHANGELOG_BDC ( 0x00000010 ) -#define NETLOGON_NEG_FULL_SYNC_REPL ( 0x00000020 ) -#define NETLOGON_NEG_MULTIPLE_SIDS ( 0x00000040 ) -#define NETLOGON_NEG_REDO ( 0x00000080 ) -#define NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL ( 0x00000100 ) -#define NETLOGON_NEG_SEND_PASSWORD_INFO_PDC ( 0x00000200 ) -#define NETLOGON_NEG_GENERIC_PASSTHROUGH ( 0x00000400 ) -#define NETLOGON_NEG_CONCURRENT_RPC ( 0x00000800 ) -#define NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL ( 0x00001000 ) -#define NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL ( 0x00002000 ) -#define NETLOGON_NEG_128BIT ( 0x00004000 ) -#define NETLOGON_NEG_TRANSITIVE_TRUSTS ( 0x00008000 ) -#define NETLOGON_NEG_DNS_DOMAIN_TRUSTS ( 0x00010000 ) -#define NETLOGON_NEG_PASSWORD_SET2 ( 0x00020000 ) -#define NETLOGON_NEG_GETDOMAININFO ( 0x00040000 ) -#define NETLOGON_NEG_CROSS_FOREST_TRUSTS ( 0x00080000 ) -#define NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION ( 0x00100000 ) -#define NETLOGON_NEG_RODC_PASSTHROUGH ( 0x00200000 ) -#define NETLOGON_NEG_AUTHENTICATED_RPC_LSASS ( 0x20000000 ) -#define NETLOGON_NEG_SCHANNEL ( 0x40000000 ) - -/* bitmap netr_ChangeLogFlags */ -#define NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED ( 0x0001 ) -#define NETR_CHANGELOG_CHANGED_PASSWORD ( 0x0002 ) -#define NETR_CHANGELOG_SID_INCLUDED ( 0x0004 ) -#define NETR_CHANGELOG_NAME_INCLUDED ( 0x0008 ) -#define NETR_CHANGELOG_FIRST_PROMOTION_OBJ ( 0x0010 ) - -union netr_ChangeLogObject { - struct dom_sid object_sid;/* [case(NETR_CHANGELOG_SID_INCLUDED)] */ - const char * object_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM),case(NETR_CHANGELOG_NAME_INCLUDED)] */ -}/* [nodiscriminant] */; - -struct netr_ChangeLogEntry { - uint32_t serial_number1; - uint32_t serial_number2; - uint32_t object_rid; - uint16_t flags; - enum netr_SamDatabaseID8Bit db_index; - enum netr_DeltaEnum8Bit delta_type; - union netr_ChangeLogObject object;/* [switch_is(flags&(NETR_CHANGELOG_SID_INCLUDED|NETR_CHANGELOG_NAME_INCLUDED))] */ -}/* [gensize,public] */; - -struct netr_Blob { - uint32_t length; - uint8_t *data;/* [unique,size_is(length)] */ -}; - -/* bitmap netr_DsRGetDCName_flags */ -#define DS_FORCE_REDISCOVERY ( 0x00000001 ) -#define DS_DIRECTORY_SERVICE_REQUIRED ( 0x00000010 ) -#define DS_DIRECTORY_SERVICE_PREFERRED ( 0x00000020 ) -#define DS_GC_SERVER_REQUIRED ( 0x00000040 ) -#define DS_PDC_REQUIRED ( 0x00000080 ) -#define DS_BACKGROUND_ONLY ( 0x00000100 ) -#define DS_IP_REQUIRED ( 0x00000200 ) -#define DS_KDC_REQUIRED ( 0x00000400 ) -#define DS_TIMESERV_REQUIRED ( 0x00000800 ) -#define DS_WRITABLE_REQUIRED ( 0x00001000 ) -#define DS_GOOD_TIMESERV_PREFERRED ( 0x00002000 ) -#define DS_AVOID_SELF ( 0x00004000 ) -#define DS_ONLY_LDAP_NEEDED ( 0x00008000 ) -#define DS_IS_FLAT_NAME ( 0x00010000 ) -#define DS_IS_DNS_NAME ( 0x00020000 ) -#define DS_TRY_NEXTCLOSEST_SITE ( 0x00040000 ) -#define DS_DIRECTORY_SERVICE_6_REQUIRED ( 0x00080000 ) -#define DS_RETURN_DNS_NAME ( 0x40000000 ) -#define DS_RETURN_FLAT_NAME ( 0x80000000 ) - -enum netr_DsRGetDCNameInfo_AddressType -#ifndef USE_UINT_ENUMS - { - DS_ADDRESS_TYPE_INET=1, - DS_ADDRESS_TYPE_NETBIOS=2 -} -#else - { __donnot_use_enum_netr_DsRGetDCNameInfo_AddressType=0x7FFFFFFF} -#define DS_ADDRESS_TYPE_INET ( 1 ) -#define DS_ADDRESS_TYPE_NETBIOS ( 2 ) -#endif -; - -/* bitmap netr_DsR_DcFlags */ -#define DS_SERVER_PDC ( NBT_SERVER_PDC ) -#define DS_SERVER_GC ( NBT_SERVER_GC ) -#define DS_SERVER_LDAP ( NBT_SERVER_LDAP ) -#define DS_SERVER_DS ( NBT_SERVER_DS ) -#define DS_SERVER_KDC ( NBT_SERVER_KDC ) -#define DS_SERVER_TIMESERV ( NBT_SERVER_TIMESERV ) -#define DS_SERVER_CLOSEST ( NBT_SERVER_CLOSEST ) -#define DS_SERVER_WRITABLE ( NBT_SERVER_WRITABLE ) -#define DS_SERVER_GOOD_TIMESERV ( NBT_SERVER_GOOD_TIMESERV ) -#define DS_SERVER_NDNC ( NBT_SERVER_NDNC ) -#define DS_SERVER_SELECT_SECRET_DOMAIN_6 ( NBT_SERVER_SELECT_SECRET_DOMAIN_6 ) -#define DS_SERVER_FULL_SECRET_DOMAIN_6 ( NBT_SERVER_FULL_SECRET_DOMAIN_6 ) -#define DS_DNS_CONTROLLER ( 0x20000000 ) -#define DS_DNS_DOMAIN ( 0x40000000 ) -#define DS_DNS_FOREST ( 0x80000000 ) - -struct netr_DsRGetDCNameInfo { - const char *dc_unc;/* [unique,charset(UTF16)] */ - const char *dc_address;/* [unique,charset(UTF16)] */ - enum netr_DsRGetDCNameInfo_AddressType dc_address_type; - struct GUID domain_guid; - const char *domain_name;/* [unique,charset(UTF16)] */ - const char *forest_name;/* [unique,charset(UTF16)] */ - uint32_t dc_flags; - const char *dc_site_name;/* [unique,charset(UTF16)] */ - const char *client_site_name;/* [unique,charset(UTF16)] */ -}/* [public] */; - -/* bitmap netr_TrustFlags */ -#define NETR_TRUST_FLAG_IN_FOREST ( 0x00000001 ) -#define NETR_TRUST_FLAG_OUTBOUND ( 0x00000002 ) -#define NETR_TRUST_FLAG_TREEROOT ( 0x00000004 ) -#define NETR_TRUST_FLAG_PRIMARY ( 0x00000008 ) -#define NETR_TRUST_FLAG_NATIVE ( 0x00000010 ) -#define NETR_TRUST_FLAG_INBOUND ( 0x00000020 ) -#define NETR_TRUST_FLAG_MIT_KRB5 ( 0x00000080 ) -#define NETR_TRUST_FLAG_AES ( 0x00000100 ) - -struct netr_BinaryString { - uint16_t length; - uint16_t size; - uint16_t *data;/* [unique,length_is(length/2),size_is(size/2)] */ -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct netr_DomainQuery1 { - struct netr_Blob blob; - const char *workstation_domain;/* [unique,charset(UTF16)] */ - const char *workstation_site;/* [unique,charset(UTF16)] */ - const char *unknown1;/* [unique,charset(UTF16)] */ - const char *unknown2;/* [unique,charset(UTF16)] */ - const char *unknown3;/* [unique,charset(UTF16)] */ - const char *unknown4;/* [unique,charset(UTF16)] */ - struct netr_BinaryString blob2; - struct lsa_String product; - struct lsa_String unknown5; - struct lsa_String unknown6; - uint32_t unknown7[4]; -}; - -union netr_DomainQuery { - struct netr_DomainQuery1 *query1;/* [unique,case] */ -}; - -struct netr_trust_extension { - uint32_t length;/* [value(8)] */ - uint32_t dummy;/* [value(0)] */ - uint32_t size;/* [value(8)] */ - uint32_t flags; - uint32_t parent_index; - uint32_t trust_type; - uint32_t trust_attributes; -}; - -struct netr_trust_extension_container { - uint16_t length; - uint16_t size;/* [value(length)] */ - struct netr_trust_extension *info;/* [unique] */ -}; - -struct netr_DomainTrustInfo { - struct lsa_String domainname; - struct lsa_String fulldomainname; - struct lsa_String forest; - struct GUID guid; - struct dom_sid2 *sid;/* [unique] */ - struct netr_trust_extension_container trust_extension; - struct lsa_String dummystring[3]; - uint32_t dummy[4]; -}; - -struct netr_LsaPolicyInfo { - uint32_t policy_size; - uint8_t *policy;/* [unique,size_is(policy_size)] */ -}; - -/* bitmap netr_WorkstationFlags */ -#define NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS ( 0x00000001 ) -#define NETR_WS_FLAG_HANDLES_SPN_UPDATE ( 0x00000002 ) - -struct netr_DomainInfo1 { - struct netr_DomainTrustInfo domaininfo; - uint32_t num_trusts; - struct netr_DomainTrustInfo *trusts;/* [unique,size_is(num_trusts)] */ - struct netr_LsaPolicyInfo lsa_policy; - struct lsa_String dns_hostname; - struct lsa_String dummystring[3]; - uint32_t workstation_flags; - uint32_t supported_enc_types; - uint32_t dummy[2]; -}; - -union netr_DomainInfo { - struct netr_DomainInfo1 *info1;/* [unique,case] */ - struct netr_DomainInfo1 *info2;/* [unique,case(2)] */ -}; - -struct netr_CryptPassword { - uint8_t data[512]; - uint32_t length; -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct netr_DsRAddressToSitenamesWCtr { - uint32_t count; - struct lsa_String *sitename;/* [unique,size_is(count)] */ -}; - -struct netr_DsRAddress { - uint8_t *buffer;/* [unique,size_is(size)] */ - uint32_t size; -}; - -enum netr_TrustType -#ifndef USE_UINT_ENUMS - { - NETR_TRUST_TYPE_DOWNLEVEL=1, - NETR_TRUST_TYPE_UPLEVEL=2, - NETR_TRUST_TYPE_MIT=3, - NETR_TRUST_TYPE_DCE=4 -} -#else - { __donnot_use_enum_netr_TrustType=0x7FFFFFFF} -#define NETR_TRUST_TYPE_DOWNLEVEL ( 1 ) -#define NETR_TRUST_TYPE_UPLEVEL ( 2 ) -#define NETR_TRUST_TYPE_MIT ( 3 ) -#define NETR_TRUST_TYPE_DCE ( 4 ) -#endif -; - -/* bitmap netr_TrustAttributes */ -#define NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE ( 0x00000001 ) -#define NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY ( 0x00000002 ) -#define NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN ( 0x00000004 ) -#define NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE ( 0x00000008 ) -#define NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION ( 0x00000010 ) -#define NETR_TRUST_ATTRIBUTE_WITHIN_FOREST ( 0x00000020 ) -#define NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL ( 0x00000040 ) - -struct netr_DomainTrust { - const char *netbios_name;/* [unique,charset(UTF16)] */ - const char *dns_name;/* [unique,charset(UTF16)] */ - uint32_t trust_flags; - uint32_t parent_index; - enum netr_TrustType trust_type; - uint32_t trust_attributes; - struct dom_sid2 *sid;/* [unique] */ - struct GUID guid; -}; - -struct netr_DomainTrustList { - uint32_t count; - struct netr_DomainTrust *array;/* [unique,size_is(count)] */ -}; - -struct netr_DsRAddressToSitenamesExWCtr { - uint32_t count; - struct lsa_String *sitename;/* [unique,size_is(count)] */ - struct lsa_String *subnetname;/* [unique,size_is(count)] */ -}; - -struct DcSitesCtr { - uint32_t num_sites; - struct lsa_String *sites;/* [unique,size_is(num_sites)] */ -}; - -struct netr_TrustInfo { - uint32_t count; - uint32_t *data;/* [unique,size_is(count)] */ - uint32_t entry_count; - struct lsa_String *entries;/* [unique,size_is(count)] */ -}; - - -struct netr_LogonUasLogon { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [charset(UTF16)] */ - const char *workstation;/* [charset(UTF16)] */ - } in; - - struct { - struct netr_UasInfo **info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_LogonUasLogoff { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [charset(UTF16)] */ - const char *workstation;/* [charset(UTF16)] */ - } in; - - struct { - struct netr_UasLogoffInfo *info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_LogonSamLogon { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *computer_name;/* [unique,charset(UTF16)] */ - struct netr_Authenticator *credential;/* [unique] */ - enum netr_LogonInfoClass logon_level; - union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */ - uint16_t validation_level; - struct netr_Authenticator *return_authenticator;/* [unique] */ - } in; - - struct { - union netr_Validation *validation;/* [ref,switch_is(validation_level)] */ - uint8_t *authoritative;/* [ref] */ - struct netr_Authenticator *return_authenticator;/* [unique] */ - NTSTATUS result; - } out; - -}; - - -struct netr_LogonSamLogoff { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *computer_name;/* [unique,charset(UTF16)] */ - struct netr_Authenticator *credential;/* [unique] */ - enum netr_LogonInfoClass logon_level; - union netr_LogonLevel logon;/* [switch_is(logon_level)] */ - struct netr_Authenticator *return_authenticator;/* [unique] */ - } in; - - struct { - struct netr_Authenticator *return_authenticator;/* [unique] */ - NTSTATUS result; - } out; - -}; - - -struct netr_ServerReqChallenge { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *computer_name;/* [charset(UTF16)] */ - struct netr_Credential *credentials;/* [ref] */ - } in; - - struct { - struct netr_Credential *return_credentials;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_ServerAuthenticate { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [charset(UTF16)] */ - enum netr_SchannelType secure_channel_type; - const char *computer_name;/* [charset(UTF16)] */ - struct netr_Credential *credentials;/* [ref] */ - } in; - - struct { - struct netr_Credential *return_credentials;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_ServerPasswordSet { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [charset(UTF16)] */ - enum netr_SchannelType secure_channel_type; - const char *computer_name;/* [charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - struct samr_Password *new_password;/* [ref] */ - } in; - - struct { - struct netr_Authenticator *return_authenticator;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_DatabaseDeltas { - struct { - const char *logon_server;/* [charset(UTF16)] */ - const char *computername;/* [charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - enum netr_SamDatabaseID database_id; - uint32_t preferredmaximumlength; - struct netr_Authenticator *return_authenticator;/* [ref] */ - uint64_t *sequence_num;/* [ref] */ - } in; - - struct { - struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ - struct netr_Authenticator *return_authenticator;/* [ref] */ - uint64_t *sequence_num;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_DatabaseSync { - struct { - const char *logon_server;/* [charset(UTF16)] */ - const char *computername;/* [charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - enum netr_SamDatabaseID database_id; - uint32_t preferredmaximumlength; - struct netr_Authenticator *return_authenticator;/* [ref] */ - uint32_t *sync_context;/* [ref] */ - } in; - - struct { - struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ - struct netr_Authenticator *return_authenticator;/* [ref] */ - uint32_t *sync_context;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_AccountDeltas { - struct { - const char *logon_server;/* [unique,charset(UTF16)] */ - const char *computername;/* [charset(UTF16)] */ - struct netr_Authenticator credential; - struct netr_UAS_INFO_0 uas; - uint32_t count; - uint32_t level; - uint32_t buffersize; - struct netr_Authenticator *return_authenticator;/* [ref] */ - } in; - - struct { - struct netr_AccountBuffer *buffer;/* [ref,subcontext(4)] */ - uint32_t *count_returned;/* [ref] */ - uint32_t *total_entries;/* [ref] */ - struct netr_UAS_INFO_0 *recordid;/* [ref] */ - struct netr_Authenticator *return_authenticator;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_AccountSync { - struct { - const char *logon_server;/* [unique,charset(UTF16)] */ - const char *computername;/* [charset(UTF16)] */ - struct netr_Authenticator credential; - uint32_t reference; - uint32_t level; - uint32_t buffersize; - struct netr_Authenticator *return_authenticator;/* [ref] */ - struct netr_UAS_INFO_0 *recordid;/* [ref] */ - } in; - - struct { - struct netr_AccountBuffer *buffer;/* [ref,subcontext(4)] */ - uint32_t *count_returned;/* [ref] */ - uint32_t *total_entries;/* [ref] */ - uint32_t *next_reference;/* [ref] */ - struct netr_Authenticator *return_authenticator;/* [ref] */ - struct netr_UAS_INFO_0 *recordid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_GetDcName { - struct { - const char *logon_server;/* [charset(UTF16)] */ - const char *domainname;/* [unique,charset(UTF16)] */ - } in; - - struct { - const char **dcname;/* [ref,charset(UTF16)] */ - WERROR result; - } out; - -}; - - -struct netr_LogonControl { - struct { - const char *logon_server;/* [unique,charset(UTF16)] */ - enum netr_LogonControlCode function_code; - uint32_t level; - } in; - - struct { - union netr_CONTROL_QUERY_INFORMATION *info;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct netr_GetAnyDCName { - struct { - const char *logon_server;/* [unique,charset(UTF16)] */ - const char *domainname;/* [unique,charset(UTF16)] */ - } in; - - struct { - const char **dcname;/* [ref,charset(UTF16)] */ - WERROR result; - } out; - -}; - - -struct netr_LogonControl2 { - struct { - const char *logon_server;/* [unique,charset(UTF16)] */ - enum netr_LogonControlCode function_code; - uint32_t level; - union netr_CONTROL_DATA_INFORMATION *data;/* [ref,switch_is(function_code)] */ - } in; - - struct { - union netr_CONTROL_QUERY_INFORMATION *query;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct netr_ServerAuthenticate2 { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [charset(UTF16)] */ - enum netr_SchannelType secure_channel_type; - const char *computer_name;/* [charset(UTF16)] */ - struct netr_Credential *credentials;/* [ref] */ - uint32_t *negotiate_flags;/* [ref] */ - } in; - - struct { - struct netr_Credential *return_credentials;/* [ref] */ - uint32_t *negotiate_flags;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_DatabaseSync2 { - struct { - const char *logon_server;/* [charset(UTF16)] */ - const char *computername;/* [charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - enum netr_SamDatabaseID database_id; - uint16_t restart_state; - uint32_t preferredmaximumlength; - struct netr_Authenticator *return_authenticator;/* [ref] */ - uint32_t *sync_context;/* [ref] */ - } in; - - struct { - struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ - struct netr_Authenticator *return_authenticator;/* [ref] */ - uint32_t *sync_context;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_DatabaseRedo { - struct { - const char *logon_server;/* [charset(UTF16)] */ - const char *computername;/* [charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - struct netr_ChangeLogEntry change_log_entry;/* [subcontext_size(change_log_entry_size),subcontext(4)] */ - uint32_t change_log_entry_size;/* [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->flags))] */ - struct netr_Authenticator *return_authenticator;/* [ref] */ - } in; - - struct { - struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ - struct netr_Authenticator *return_authenticator;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_LogonControl2Ex { - struct { - const char *logon_server;/* [unique,charset(UTF16)] */ - uint32_t function_code; - uint32_t level; - union netr_CONTROL_DATA_INFORMATION data;/* [switch_is(function_code)] */ - } in; - - struct { - union netr_CONTROL_QUERY_INFORMATION *query;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct netr_NetrEnumerateTrustedDomains { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - } in; - - struct { - struct netr_Blob *trusted_domains_blob;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_DsRGetDCName { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [unique,charset(UTF16)] */ - struct GUID *domain_guid;/* [unique] */ - struct GUID *site_guid;/* [unique] */ - uint32_t flags; - } in; - - struct { - struct netr_DsRGetDCNameInfo **info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_NETRLOGONDUMMYROUTINE1 { - struct { - WERROR result; - } out; - -}; - - -struct netr_NETRLOGONSETSERVICEBITS { - struct { - WERROR result; - } out; - -}; - - -struct netr_LogonGetTrustRid { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [unique,charset(UTF16)] */ - } in; - - struct { - uint32_t *rid;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_NETRLOGONCOMPUTESERVERDIGEST { - struct { - WERROR result; - } out; - -}; - - -struct netr_NETRLOGONCOMPUTECLIENTDIGEST { - struct { - WERROR result; - } out; - -}; - - -struct netr_ServerAuthenticate3 { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [charset(UTF16)] */ - enum netr_SchannelType secure_channel_type; - const char *computer_name;/* [charset(UTF16)] */ - struct netr_Credential *credentials;/* [ref] */ - uint32_t *negotiate_flags;/* [ref] */ - } in; - - struct { - struct netr_Credential *return_credentials;/* [ref] */ - uint32_t *rid;/* [ref] */ - uint32_t *negotiate_flags;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_DsRGetDCNameEx { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [unique,charset(UTF16)] */ - struct GUID *domain_guid;/* [unique] */ - const char *site_name;/* [unique,charset(UTF16)] */ - uint32_t flags; - } in; - - struct { - struct netr_DsRGetDCNameInfo **info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_DsRGetSiteName { - struct { - const char *computer_name;/* [unique,charset(UTF16)] */ - } in; - - struct { - const char **site;/* [ref,charset(UTF16)] */ - WERROR result; - } out; - -}; - - -struct netr_LogonGetDomainInfo { - struct { - const char *server_name;/* [charset(UTF16)] */ - const char *computer_name;/* [unique,charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - uint32_t level; - union netr_DomainQuery query;/* [switch_is(level)] */ - struct netr_Authenticator *return_authenticator;/* [ref] */ - } in; - - struct { - union netr_DomainInfo *info;/* [ref,switch_is(level)] */ - struct netr_Authenticator *return_authenticator;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_ServerPasswordSet2 { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [charset(UTF16)] */ - enum netr_SchannelType secure_channel_type; - const char *computer_name;/* [charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - struct netr_CryptPassword *new_password;/* [ref] */ - } in; - - struct { - struct netr_Authenticator *return_authenticator;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_ServerPasswordGet { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [charset(UTF16)] */ - enum netr_SchannelType secure_channel_type; - const char *computer_name;/* [charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - } in; - - struct { - struct netr_Authenticator *return_authenticator;/* [ref] */ - struct samr_Password *password;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_NETRLOGONSENDTOSAM { - struct { - WERROR result; - } out; - -}; - - -struct netr_DsRAddressToSitenamesW { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t count;/* [range(0,32000)] */ - struct netr_DsRAddress *addresses;/* [ref,size_is(count)] */ - } in; - - struct { - struct netr_DsRAddressToSitenamesWCtr **ctr;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_DsRGetDCNameEx2 { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *client_account;/* [unique,charset(UTF16)] */ - uint32_t mask; - const char *domain_name;/* [unique,charset(UTF16)] */ - struct GUID *domain_guid;/* [unique] */ - const char *site_name;/* [unique,charset(UTF16)] */ - uint32_t flags; - } in; - - struct { - struct netr_DsRGetDCNameInfo **info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN { - struct { - WERROR result; - } out; - -}; - - -struct netr_NetrEnumerateTrustedDomainsEx { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - } in; - - struct { - struct netr_DomainTrustList *dom_trust_list;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_DsRAddressToSitenamesExW { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t count;/* [range(0,32000)] */ - struct netr_DsRAddress *addresses;/* [ref,size_is(count)] */ - } in; - - struct { - struct netr_DsRAddressToSitenamesExWCtr **ctr;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_DsrGetDcSiteCoverageW { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - } in; - - struct { - struct DcSitesCtr **ctr;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_LogonSamLogonEx { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *computer_name;/* [unique,charset(UTF16)] */ - enum netr_LogonInfoClass logon_level; - union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */ - uint16_t validation_level; - uint32_t *flags;/* [ref] */ - } in; - - struct { - union netr_Validation *validation;/* [ref,switch_is(validation_level)] */ - uint8_t *authoritative;/* [ref] */ - uint32_t *flags;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_DsrEnumerateDomainTrusts { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t trust_flags; - } in; - - struct { - struct netr_DomainTrustList *trusts;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_DsrDeregisterDNSHostRecords { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *domain;/* [unique,charset(UTF16)] */ - struct GUID *domain_guid;/* [unique] */ - struct GUID *dsa_guid;/* [unique] */ - const char *dns_host;/* [ref,charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct netr_ServerTrustPasswordsGet { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [charset(UTF16)] */ - enum netr_SchannelType secure_channel_type; - const char *computer_name;/* [charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - } in; - - struct { - struct netr_Authenticator *return_authenticator;/* [ref] */ - struct samr_Password *password;/* [ref] */ - struct samr_Password *password2;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_DsRGetForestTrustInformation { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *trusted_domain_name;/* [unique,charset(UTF16)] */ - uint32_t flags; - } in; - - struct { - struct lsa_ForestTrustInformation **forest_trust_info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_GetForestTrustInformation { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *trusted_domain_name;/* [ref,charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - uint32_t flags; - } in; - - struct { - struct netr_Authenticator *return_authenticator;/* [ref] */ - struct lsa_ForestTrustInformation **forest_trust_info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct netr_LogonSamLogonWithFlags { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *computer_name;/* [unique,charset(UTF16)] */ - struct netr_Authenticator *credential;/* [unique] */ - enum netr_LogonInfoClass logon_level; - union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */ - uint16_t validation_level; - struct netr_Authenticator *return_authenticator;/* [unique] */ - uint32_t *flags;/* [ref] */ - } in; - - struct { - union netr_Validation *validation;/* [ref,switch_is(validation_level)] */ - uint8_t *authoritative;/* [ref] */ - struct netr_Authenticator *return_authenticator;/* [unique] */ - uint32_t *flags;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct netr_ServerGetTrustInfo { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account_name;/* [ref,charset(UTF16)] */ - enum netr_SchannelType secure_channel_type; - const char *computer_name;/* [ref,charset(UTF16)] */ - struct netr_Authenticator *credential;/* [ref] */ - } in; - - struct { - struct netr_Authenticator *return_authenticator;/* [ref] */ - struct samr_Password *new_owf_password;/* [ref] */ - struct samr_Password *old_owf_password;/* [ref] */ - struct netr_TrustInfo **trust_info;/* [ref] */ - NTSTATUS result; - } out; - -}; - -#endif /* _HEADER_netlogon */ diff --git a/source3/librpc/gen_ndr/ntsvcs.h b/source3/librpc/gen_ndr/ntsvcs.h deleted file mode 100644 index 5021aa2252..0000000000 --- a/source3/librpc/gen_ndr/ntsvcs.h +++ /dev/null @@ -1,591 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/winreg.h" -#ifndef _HEADER_ntsvcs -#define _HEADER_ntsvcs - -#define DEV_REGPROP_DESC ( 1 ) -struct PNP_HwProfInfo { - uint32_t profile_handle; - uint16_t friendly_name[80]; - uint32_t flags; -}; - - -struct PNP_Disconnect { - struct { - WERROR result; - } out; - -}; - - -struct PNP_Connect { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetVersion { - struct { - uint16_t *version;/* [ref] */ - WERROR result; - } out; - -}; - - -struct PNP_GetGlobalState { - struct { - WERROR result; - } out; - -}; - - -struct PNP_InitDetection { - struct { - WERROR result; - } out; - -}; - - -struct PNP_ReportLogOn { - struct { - WERROR result; - } out; - -}; - - -struct PNP_ValidateDeviceInstance { - struct { - const char *devicepath;/* [ref,charset(UTF16)] */ - uint32_t flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetRootDeviceInstance { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetRelatedDeviceInstance { - struct { - WERROR result; - } out; - -}; - - -struct PNP_EnumerateSubKeys { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetDeviceList { - struct { - const char *filter;/* [unique,charset(UTF16)] */ - uint32_t flags; - uint32_t *length;/* [ref] */ - } in; - - struct { - uint16_t *buffer;/* [ref,length_is(*length),size_is(*length)] */ - uint32_t *length;/* [ref] */ - WERROR result; - } out; - -}; - - -struct PNP_GetDeviceListSize { - struct { - const char *devicename;/* [unique,charset(UTF16)] */ - uint32_t flags; - } in; - - struct { - uint32_t *size;/* [ref] */ - WERROR result; - } out; - -}; - - -struct PNP_GetDepth { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetDeviceRegProp { - struct { - const char *devicepath;/* [ref,charset(UTF16)] */ - uint32_t property; - uint32_t flags; - enum winreg_Type *reg_data_type;/* [ref] */ - uint32_t *buffer_size;/* [ref] */ - uint32_t *needed;/* [ref] */ - } in; - - struct { - uint8_t *buffer;/* [ref,length_is(*buffer_size),size_is(*buffer_size)] */ - enum winreg_Type *reg_data_type;/* [ref] */ - uint32_t *buffer_size;/* [ref] */ - uint32_t *needed;/* [ref] */ - WERROR result; - } out; - -}; - - -struct PNP_SetDeviceRegProp { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetClassInstance { - struct { - WERROR result; - } out; - -}; - - -struct PNP_CreateKey { - struct { - WERROR result; - } out; - -}; - - -struct PNP_DeleteRegistryKey { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetClassCount { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetClassName { - struct { - WERROR result; - } out; - -}; - - -struct PNP_DeleteClassKey { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetInterfaceDeviceAlias { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetInterfaceDeviceList { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetInterfaceDeviceListSize { - struct { - WERROR result; - } out; - -}; - - -struct PNP_RegisterDeviceClassAssociation { - struct { - WERROR result; - } out; - -}; - - -struct PNP_UnregisterDeviceClassAssociation { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetClassRegProp { - struct { - WERROR result; - } out; - -}; - - -struct PNP_SetClassRegProp { - struct { - WERROR result; - } out; - -}; - - -struct PNP_CreateDevInst { - struct { - WERROR result; - } out; - -}; - - -struct PNP_DeviceInstanceAction { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetDeviceStatus { - struct { - WERROR result; - } out; - -}; - - -struct PNP_SetDeviceProblem { - struct { - WERROR result; - } out; - -}; - - -struct PNP_DisableDevInst { - struct { - WERROR result; - } out; - -}; - - -struct PNP_UninstallDevInst { - struct { - WERROR result; - } out; - -}; - - -struct PNP_AddID { - struct { - WERROR result; - } out; - -}; - - -struct PNP_RegisterDriver { - struct { - WERROR result; - } out; - -}; - - -struct PNP_QueryRemove { - struct { - WERROR result; - } out; - -}; - - -struct PNP_RequestDeviceEject { - struct { - WERROR result; - } out; - -}; - - -struct PNP_IsDockStationPresent { - struct { - WERROR result; - } out; - -}; - - -struct PNP_RequestEjectPC { - struct { - WERROR result; - } out; - -}; - - -struct PNP_HwProfFlags { - struct { - uint32_t action; - const char *devicepath;/* [ref,charset(UTF16)] */ - uint32_t config; - const char *unknown5;/* [unique,charset(UTF16)] */ - uint32_t name_length; - uint32_t flags; - uint32_t *profile_flags;/* [ref] */ - uint16_t *veto_type;/* [unique] */ - } in; - - struct { - const char **unknown5a;/* [unique,charset(UTF16)] */ - uint32_t *profile_flags;/* [ref] */ - uint16_t *veto_type;/* [unique] */ - WERROR result; - } out; - -}; - - -struct PNP_GetHwProfInfo { - struct { - uint32_t idx; - uint32_t size; - uint32_t flags; - struct PNP_HwProfInfo *info;/* [ref] */ - } in; - - struct { - struct PNP_HwProfInfo *info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct PNP_AddEmptyLogConf { - struct { - WERROR result; - } out; - -}; - - -struct PNP_FreeLogConf { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetFirstLogConf { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetNextLogConf { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetLogConfPriority { - struct { - WERROR result; - } out; - -}; - - -struct PNP_AddResDes { - struct { - WERROR result; - } out; - -}; - - -struct PNP_FreeResDes { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetNextResDes { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetResDesData { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetResDesDataSize { - struct { - WERROR result; - } out; - -}; - - -struct PNP_ModifyResDes { - struct { - WERROR result; - } out; - -}; - - -struct PNP_DetectResourceLimit { - struct { - WERROR result; - } out; - -}; - - -struct PNP_QueryResConfList { - struct { - WERROR result; - } out; - -}; - - -struct PNP_SetHwProf { - struct { - WERROR result; - } out; - -}; - - -struct PNP_QueryArbitratorFreeData { - struct { - WERROR result; - } out; - -}; - - -struct PNP_QueryArbitratorFreeSize { - struct { - WERROR result; - } out; - -}; - - -struct PNP_RunDetection { - struct { - WERROR result; - } out; - -}; - - -struct PNP_RegisterNotification { - struct { - WERROR result; - } out; - -}; - - -struct PNP_UnregisterNotification { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetCustomDevProp { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetVersionInternal { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetBlockedDriverInfo { - struct { - WERROR result; - } out; - -}; - - -struct PNP_GetServerSideDeviceInstallFlags { - struct { - WERROR result; - } out; - -}; - -#endif /* _HEADER_ntsvcs */ diff --git a/source3/librpc/gen_ndr/samr.h b/source3/librpc/gen_ndr/samr.h deleted file mode 100644 index 3116f26d8c..0000000000 --- a/source3/librpc/gen_ndr/samr.h +++ /dev/null @@ -1,1827 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/misc.h" -#include "librpc/gen_ndr/lsa.h" -#include "librpc/gen_ndr/security.h" -#ifndef _HEADER_samr -#define _HEADER_samr - -#define SAMR_ACCESS_ALL_ACCESS ( 0x0000003F ) -#define GENERIC_RIGHTS_SAM_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ACCESS_ALL_ACCESS) ) -#define GENERIC_RIGHTS_SAM_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_ACCESS_ENUM_DOMAINS) ) -#define GENERIC_RIGHTS_SAM_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ACCESS_CREATE_DOMAIN|SAMR_ACCESS_INITIALIZE_SERVER|SAMR_ACCESS_SHUTDOWN_SERVER) ) -#define GENERIC_RIGHTS_SAM_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ACCESS_OPEN_DOMAIN|SAMR_ACCESS_CONNECT_TO_SERVER) ) -#define SAMR_USER_ACCESS_ALL_ACCESS ( 0x000007FF ) -#define GENERIC_RIGHTS_USER_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_USER_ACCESS_ALL_ACCESS) ) -#define GENERIC_RIGHTS_USER_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP|SAMR_USER_ACCESS_GET_GROUPS|SAMR_USER_ACCESS_GET_ATTRIBUTES|SAMR_USER_ACCESS_GET_LOGONINFO|SAMR_USER_ACCESS_GET_LOCALE) ) -#define GENERIC_RIGHTS_USER_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_USER_ACCESS_CHANGE_PASSWORD|SAMR_USER_ACCESS_SET_LOC_COM|SAMR_USER_ACCESS_SET_ATTRIBUTES|SAMR_USER_ACCESS_SET_PASSWORD|SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP) ) -#define GENERIC_RIGHTS_USER_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_USER_ACCESS_CHANGE_PASSWORD|SAMR_USER_ACCESS_GET_NAME_ETC) ) -#define SAMR_DOMAIN_ACCESS_ALL_ACCESS ( 0x000007FF ) -#define GENERIC_RIGHTS_DOMAIN_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_DOMAIN_ACCESS_ALL_ACCESS) ) -#define GENERIC_RIGHTS_DOMAIN_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2) ) -#define GENERIC_RIGHTS_DOMAIN_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_DOMAIN_ACCESS_SET_INFO_3|SAMR_DOMAIN_ACCESS_CREATE_ALIAS|SAMR_DOMAIN_ACCESS_CREATE_GROUP|SAMR_DOMAIN_ACCESS_CREATE_USER|SAMR_DOMAIN_ACCESS_SET_INFO_2|SAMR_DOMAIN_ACCESS_SET_INFO_1) ) -#define GENERIC_RIGHTS_DOMAIN_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT|SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1) ) -#define SAMR_GROUP_ACCESS_ALL_ACCESS ( 0x0000001F ) -#define GENERIC_RIGHTS_GROUP_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_GROUP_ACCESS_ALL_ACCESS) ) -#define GENERIC_RIGHTS_GROUP_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_GROUP_ACCESS_GET_MEMBERS) ) -#define GENERIC_RIGHTS_GROUP_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_GROUP_ACCESS_REMOVE_MEMBER|SAMR_GROUP_ACCESS_ADD_MEMBER|SAMR_GROUP_ACCESS_SET_INFO) ) -#define GENERIC_RIGHTS_GROUP_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_GROUP_ACCESS_LOOKUP_INFO) ) -#define SAMR_ALIAS_ACCESS_ALL_ACCESS ( 0x0000001F ) -#define GENERIC_RIGHTS_ALIAS_ALL_ACCESS ( (STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ALIAS_ACCESS_ALL_ACCESS) ) -#define GENERIC_RIGHTS_ALIAS_READ ( (STANDARD_RIGHTS_READ_ACCESS|SAMR_ALIAS_ACCESS_GET_MEMBERS) ) -#define GENERIC_RIGHTS_ALIAS_WRITE ( (STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ALIAS_ACCESS_REMOVE_MEMBER|SAMR_ALIAS_ACCESS_ADD_MEMBER|SAMR_ALIAS_ACCESS_SET_INFO) ) -#define GENERIC_RIGHTS_ALIAS_EXECUTE ( (STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ALIAS_ACCESS_LOOKUP_INFO) ) -#define SAMR_ENUM_USERS_MULTIPLIER ( 54 ) -#define PASS_MUST_CHANGE_AT_NEXT_LOGON ( 0x01 ) -#define PASS_DONT_CHANGE_AT_NEXT_LOGON ( 0x00 ) -enum netr_SamDatabaseID -#ifndef USE_UINT_ENUMS - { - SAM_DATABASE_DOMAIN=0, - SAM_DATABASE_BUILTIN=1, - SAM_DATABASE_PRIVS=2 -} -#else - { __donnot_use_enum_netr_SamDatabaseID=0x7FFFFFFF} -#define SAM_DATABASE_DOMAIN ( 0 ) -#define SAM_DATABASE_BUILTIN ( 1 ) -#define SAM_DATABASE_PRIVS ( 2 ) -#endif -; - -enum samr_RejectReason -#ifndef USE_UINT_ENUMS - { - SAMR_REJECT_OTHER=0, - SAMR_REJECT_TOO_SHORT=1, - SAMR_REJECT_IN_HISTORY=2, - SAMR_REJECT_COMPLEXITY=5 -} -#else - { __donnot_use_enum_samr_RejectReason=0x7FFFFFFF} -#define SAMR_REJECT_OTHER ( 0 ) -#define SAMR_REJECT_TOO_SHORT ( 1 ) -#define SAMR_REJECT_IN_HISTORY ( 2 ) -#define SAMR_REJECT_COMPLEXITY ( 5 ) -#endif -; - -/* bitmap samr_AcctFlags */ -#define ACB_DISABLED ( 0x00000001 ) -#define ACB_HOMDIRREQ ( 0x00000002 ) -#define ACB_PWNOTREQ ( 0x00000004 ) -#define ACB_TEMPDUP ( 0x00000008 ) -#define ACB_NORMAL ( 0x00000010 ) -#define ACB_MNS ( 0x00000020 ) -#define ACB_DOMTRUST ( 0x00000040 ) -#define ACB_WSTRUST ( 0x00000080 ) -#define ACB_SVRTRUST ( 0x00000100 ) -#define ACB_PWNOEXP ( 0x00000200 ) -#define ACB_AUTOLOCK ( 0x00000400 ) -#define ACB_ENC_TXT_PWD_ALLOWED ( 0x00000800 ) -#define ACB_SMARTCARD_REQUIRED ( 0x00001000 ) -#define ACB_TRUSTED_FOR_DELEGATION ( 0x00002000 ) -#define ACB_NOT_DELEGATED ( 0x00004000 ) -#define ACB_USE_DES_KEY_ONLY ( 0x00008000 ) -#define ACB_DONT_REQUIRE_PREAUTH ( 0x00010000 ) -#define ACB_PW_EXPIRED ( 0x00020000 ) -#define ACB_NO_AUTH_DATA_REQD ( 0x00080000 ) - -/* bitmap samr_ConnectAccessMask */ -#define SAMR_ACCESS_CONNECT_TO_SERVER ( 0x00000001 ) -#define SAMR_ACCESS_SHUTDOWN_SERVER ( 0x00000002 ) -#define SAMR_ACCESS_INITIALIZE_SERVER ( 0x00000004 ) -#define SAMR_ACCESS_CREATE_DOMAIN ( 0x00000008 ) -#define SAMR_ACCESS_ENUM_DOMAINS ( 0x00000010 ) -#define SAMR_ACCESS_OPEN_DOMAIN ( 0x00000020 ) - -/* bitmap samr_UserAccessMask */ -#define SAMR_USER_ACCESS_GET_NAME_ETC ( 0x00000001 ) -#define SAMR_USER_ACCESS_GET_LOCALE ( 0x00000002 ) -#define SAMR_USER_ACCESS_SET_LOC_COM ( 0x00000004 ) -#define SAMR_USER_ACCESS_GET_LOGONINFO ( 0x00000008 ) -#define SAMR_USER_ACCESS_GET_ATTRIBUTES ( 0x00000010 ) -#define SAMR_USER_ACCESS_SET_ATTRIBUTES ( 0x00000020 ) -#define SAMR_USER_ACCESS_CHANGE_PASSWORD ( 0x00000040 ) -#define SAMR_USER_ACCESS_SET_PASSWORD ( 0x00000080 ) -#define SAMR_USER_ACCESS_GET_GROUPS ( 0x00000100 ) -#define SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP ( 0x00000200 ) -#define SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP ( 0x00000400 ) - -/* bitmap samr_DomainAccessMask */ -#define SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1 ( 0x00000001 ) -#define SAMR_DOMAIN_ACCESS_SET_INFO_1 ( 0x00000002 ) -#define SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2 ( 0x00000004 ) -#define SAMR_DOMAIN_ACCESS_SET_INFO_2 ( 0x00000008 ) -#define SAMR_DOMAIN_ACCESS_CREATE_USER ( 0x00000010 ) -#define SAMR_DOMAIN_ACCESS_CREATE_GROUP ( 0x00000020 ) -#define SAMR_DOMAIN_ACCESS_CREATE_ALIAS ( 0x00000040 ) -#define SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS ( 0x00000080 ) -#define SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS ( 0x00000100 ) -#define SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT ( 0x00000200 ) -#define SAMR_DOMAIN_ACCESS_SET_INFO_3 ( 0x00000400 ) - -/* bitmap samr_GroupAccessMask */ -#define SAMR_GROUP_ACCESS_LOOKUP_INFO ( 0x00000001 ) -#define SAMR_GROUP_ACCESS_SET_INFO ( 0x00000002 ) -#define SAMR_GROUP_ACCESS_ADD_MEMBER ( 0x00000004 ) -#define SAMR_GROUP_ACCESS_REMOVE_MEMBER ( 0x00000008 ) -#define SAMR_GROUP_ACCESS_GET_MEMBERS ( 0x00000010 ) - -/* bitmap samr_AliasAccessMask */ -#define SAMR_ALIAS_ACCESS_ADD_MEMBER ( 0x00000001 ) -#define SAMR_ALIAS_ACCESS_REMOVE_MEMBER ( 0x00000002 ) -#define SAMR_ALIAS_ACCESS_GET_MEMBERS ( 0x00000004 ) -#define SAMR_ALIAS_ACCESS_LOOKUP_INFO ( 0x00000008 ) -#define SAMR_ALIAS_ACCESS_SET_INFO ( 0x00000010 ) - -struct samr_SamEntry { - uint32_t idx; - struct lsa_String name; -}; - -struct samr_SamArray { - uint32_t count; - struct samr_SamEntry *entries;/* [unique,size_is(count)] */ -}; - -enum samr_Role -#ifndef USE_UINT_ENUMS - { - SAMR_ROLE_STANDALONE=0, - SAMR_ROLE_DOMAIN_MEMBER=1, - SAMR_ROLE_DOMAIN_BDC=2, - SAMR_ROLE_DOMAIN_PDC=3 -} -#else - { __donnot_use_enum_samr_Role=0x7FFFFFFF} -#define SAMR_ROLE_STANDALONE ( 0 ) -#define SAMR_ROLE_DOMAIN_MEMBER ( 1 ) -#define SAMR_ROLE_DOMAIN_BDC ( 2 ) -#define SAMR_ROLE_DOMAIN_PDC ( 3 ) -#endif -; - -/* bitmap samr_PasswordProperties */ -#define DOMAIN_PASSWORD_COMPLEX ( 0x00000001 ) -#define DOMAIN_PASSWORD_NO_ANON_CHANGE ( 0x00000002 ) -#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE ( 0x00000004 ) -#define DOMAIN_PASSWORD_LOCKOUT_ADMINS ( 0x00000008 ) -#define DOMAIN_PASSWORD_STORE_CLEARTEXT ( 0x00000010 ) -#define DOMAIN_REFUSE_PASSWORD_CHANGE ( 0x00000020 ) - -enum samr_DomainServerState -#ifndef USE_UINT_ENUMS - { - DOMAIN_SERVER_ENABLED=1, - DOMAIN_SERVER_DISABLED=2 -} -#else - { __donnot_use_enum_samr_DomainServerState=0x7FFFFFFF} -#define DOMAIN_SERVER_ENABLED ( 1 ) -#define DOMAIN_SERVER_DISABLED ( 2 ) -#endif -; - -struct samr_DomInfo1 { - uint16_t min_password_length; - uint16_t password_history_length; - uint32_t password_properties; - int64_t max_password_age; - int64_t min_password_age; -}; - -struct samr_DomGeneralInformation { - NTTIME force_logoff_time; - struct lsa_String oem_information; - struct lsa_String domain_name; - struct lsa_String primary; - uint64_t sequence_num; - enum samr_DomainServerState domain_server_state; - enum samr_Role role; - uint32_t unknown3; - uint32_t num_users; - uint32_t num_groups; - uint32_t num_aliases; -}; - -struct samr_DomInfo3 { - NTTIME force_logoff_time; -}; - -struct samr_DomOEMInformation { - struct lsa_String oem_information; -}; - -struct samr_DomInfo5 { - struct lsa_String domain_name; -}; - -struct samr_DomInfo6 { - struct lsa_String primary; -}; - -struct samr_DomInfo7 { - enum samr_Role role; -}; - -struct samr_DomInfo8 { - uint64_t sequence_num; - NTTIME domain_create_time; -}; - -struct samr_DomInfo9 { - enum samr_DomainServerState domain_server_state; -}; - -struct samr_DomGeneralInformation2 { - struct samr_DomGeneralInformation general; - uint64_t lockout_duration; - uint64_t lockout_window; - uint16_t lockout_threshold; -}; - -struct samr_DomInfo12 { - uint64_t lockout_duration; - uint64_t lockout_window; - uint16_t lockout_threshold; -}; - -struct samr_DomInfo13 { - uint64_t sequence_num; - NTTIME domain_create_time; - uint64_t modified_count_at_last_promotion; -}; - -union samr_DomainInfo { - struct samr_DomInfo1 info1;/* [case] */ - struct samr_DomGeneralInformation general;/* [case(2)] */ - struct samr_DomInfo3 info3;/* [case(3)] */ - struct samr_DomOEMInformation oem;/* [case(4)] */ - struct samr_DomInfo5 info5;/* [case(5)] */ - struct samr_DomInfo6 info6;/* [case(6)] */ - struct samr_DomInfo7 info7;/* [case(7)] */ - struct samr_DomInfo8 info8;/* [case(8)] */ - struct samr_DomInfo9 info9;/* [case(9)] */ - struct samr_DomGeneralInformation2 general2;/* [case(11)] */ - struct samr_DomInfo12 info12;/* [case(12)] */ - struct samr_DomInfo13 info13;/* [case(13)] */ -}/* [switch_type(uint16)] */; - -struct samr_Ids { - uint32_t count;/* [range(0,1024)] */ - uint32_t *ids;/* [unique,size_is(count)] */ -}; - -/* bitmap samr_GroupAttrs */ -#define SE_GROUP_MANDATORY ( 0x00000001 ) -#define SE_GROUP_ENABLED_BY_DEFAULT ( 0x00000002 ) -#define SE_GROUP_ENABLED ( 0x00000004 ) -#define SE_GROUP_OWNER ( 0x00000008 ) -#define SE_GROUP_USE_FOR_DENY_ONLY ( 0x00000010 ) -#define SE_GROUP_RESOURCE ( 0x20000000 ) -#define SE_GROUP_LOGON_ID ( 0xC0000000 ) - -struct samr_GroupInfoAll { - struct lsa_String name; - uint32_t attributes; - uint32_t num_members; - struct lsa_String description; -}; - -struct samr_GroupInfoAttributes { - uint32_t attributes; -}; - -struct samr_GroupInfoDescription { - struct lsa_String description; -}; - -enum samr_GroupInfoEnum -#ifndef USE_UINT_ENUMS - { - GROUPINFOALL=1, - GROUPINFONAME=2, - GROUPINFOATTRIBUTES=3, - GROUPINFODESCRIPTION=4, - GROUPINFOALL2=5 -} -#else - { __donnot_use_enum_samr_GroupInfoEnum=0x7FFFFFFF} -#define GROUPINFOALL ( 1 ) -#define GROUPINFONAME ( 2 ) -#define GROUPINFOATTRIBUTES ( 3 ) -#define GROUPINFODESCRIPTION ( 4 ) -#define GROUPINFOALL2 ( 5 ) -#endif -; - -union samr_GroupInfo { - struct samr_GroupInfoAll all;/* [case(GROUPINFOALL)] */ - struct lsa_String name;/* [case(GROUPINFONAME)] */ - struct samr_GroupInfoAttributes attributes;/* [case(GROUPINFOATTRIBUTES)] */ - struct lsa_String description;/* [case(GROUPINFODESCRIPTION)] */ - struct samr_GroupInfoAll all2;/* [case(GROUPINFOALL2)] */ -}/* [switch_type(samr_GroupInfoEnum)] */; - -struct samr_RidTypeArray { - uint32_t count; - uint32_t *rids;/* [unique,size_is(count)] */ - uint32_t *types;/* [unique,size_is(count)] */ -}; - -struct samr_AliasInfoAll { - struct lsa_String name; - uint32_t num_members; - struct lsa_String description; -}; - -enum samr_AliasInfoEnum -#ifndef USE_UINT_ENUMS - { - ALIASINFOALL=1, - ALIASINFONAME=2, - ALIASINFODESCRIPTION=3 -} -#else - { __donnot_use_enum_samr_AliasInfoEnum=0x7FFFFFFF} -#define ALIASINFOALL ( 1 ) -#define ALIASINFONAME ( 2 ) -#define ALIASINFODESCRIPTION ( 3 ) -#endif -; - -union samr_AliasInfo { - struct samr_AliasInfoAll all;/* [case(ALIASINFOALL)] */ - struct lsa_String name;/* [case(ALIASINFONAME)] */ - struct lsa_String description;/* [case(ALIASINFODESCRIPTION)] */ -}/* [switch_type(samr_AliasInfoEnum)] */; - -struct samr_UserInfo1 { - struct lsa_String account_name; - struct lsa_String full_name; - uint32_t primary_gid; - struct lsa_String description; - struct lsa_String comment; -}; - -struct samr_UserInfo2 { - struct lsa_String comment; - struct lsa_String unknown; - uint16_t country_code; - uint16_t code_page; -}; - -struct samr_LogonHours { - uint16_t units_per_week; - uint8_t *bits;/* [unique,length_is(units_per_week/8),size_is(1260)] */ -}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct samr_UserInfo3 { - struct lsa_String account_name; - struct lsa_String full_name; - uint32_t rid; - uint32_t primary_gid; - struct lsa_String home_directory; - struct lsa_String home_drive; - struct lsa_String logon_script; - struct lsa_String profile_path; - struct lsa_String workstations; - NTTIME last_logon; - NTTIME last_logoff; - NTTIME last_password_change; - NTTIME allow_password_change; - NTTIME force_password_change; - struct samr_LogonHours logon_hours; - uint16_t bad_password_count; - uint16_t logon_count; - uint32_t acct_flags; -}; - -struct samr_UserInfo4 { - struct samr_LogonHours logon_hours; -}; - -struct samr_UserInfo5 { - struct lsa_String account_name; - struct lsa_String full_name; - uint32_t rid; - uint32_t primary_gid; - struct lsa_String home_directory; - struct lsa_String home_drive; - struct lsa_String logon_script; - struct lsa_String profile_path; - struct lsa_String description; - struct lsa_String workstations; - NTTIME last_logon; - NTTIME last_logoff; - struct samr_LogonHours logon_hours; - uint16_t bad_password_count; - uint16_t logon_count; - NTTIME last_password_change; - NTTIME acct_expiry; - uint32_t acct_flags; -}; - -struct samr_UserInfo6 { - struct lsa_String account_name; - struct lsa_String full_name; -}; - -struct samr_UserInfo7 { - struct lsa_String account_name; -}; - -struct samr_UserInfo8 { - struct lsa_String full_name; -}; - -struct samr_UserInfo9 { - uint32_t primary_gid; -}; - -struct samr_UserInfo10 { - struct lsa_String home_directory; - struct lsa_String home_drive; -}; - -struct samr_UserInfo11 { - struct lsa_String logon_script; -}; - -struct samr_UserInfo12 { - struct lsa_String profile_path; -}; - -struct samr_UserInfo13 { - struct lsa_String description; -}; - -struct samr_UserInfo14 { - struct lsa_String workstations; -}; - -struct samr_UserInfo16 { - uint32_t acct_flags; -}; - -struct samr_UserInfo17 { - NTTIME acct_expiry; -}; - -struct samr_Password { - uint8_t hash[16]; -}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct samr_UserInfo18 { - struct samr_Password nt_pwd; - struct samr_Password lm_pwd; - uint8_t nt_pwd_active; - uint8_t lm_pwd_active; - uint8_t password_expired; -}; - -struct samr_UserInfo20 { - struct lsa_BinaryString parameters; -}; - -/* bitmap samr_FieldsPresent */ -#define SAMR_FIELD_ACCOUNT_NAME ( 0x00000001 ) -#define SAMR_FIELD_FULL_NAME ( 0x00000002 ) -#define SAMR_FIELD_RID ( 0x00000004 ) -#define SAMR_FIELD_PRIMARY_GID ( 0x00000008 ) -#define SAMR_FIELD_DESCRIPTION ( 0x00000010 ) -#define SAMR_FIELD_COMMENT ( 0x00000020 ) -#define SAMR_FIELD_HOME_DIRECTORY ( 0x00000040 ) -#define SAMR_FIELD_HOME_DRIVE ( 0x00000080 ) -#define SAMR_FIELD_LOGON_SCRIPT ( 0x00000100 ) -#define SAMR_FIELD_PROFILE_PATH ( 0x00000200 ) -#define SAMR_FIELD_WORKSTATIONS ( 0x00000400 ) -#define SAMR_FIELD_LAST_LOGON ( 0x00000800 ) -#define SAMR_FIELD_LAST_LOGOFF ( 0x00001000 ) -#define SAMR_FIELD_LOGON_HOURS ( 0x00002000 ) -#define SAMR_FIELD_BAD_PWD_COUNT ( 0x00004000 ) -#define SAMR_FIELD_NUM_LOGONS ( 0x00008000 ) -#define SAMR_FIELD_ALLOW_PWD_CHANGE ( 0x00010000 ) -#define SAMR_FIELD_FORCE_PWD_CHANGE ( 0x00020000 ) -#define SAMR_FIELD_LAST_PWD_CHANGE ( 0x00040000 ) -#define SAMR_FIELD_ACCT_EXPIRY ( 0x00080000 ) -#define SAMR_FIELD_ACCT_FLAGS ( 0x00100000 ) -#define SAMR_FIELD_PARAMETERS ( 0x00200000 ) -#define SAMR_FIELD_COUNTRY_CODE ( 0x00400000 ) -#define SAMR_FIELD_CODE_PAGE ( 0x00800000 ) -#define SAMR_FIELD_NT_PASSWORD_PRESENT ( 0x01000000 ) -#define SAMR_FIELD_LM_PASSWORD_PRESENT ( 0x02000000 ) -#define SAMR_FIELD_PRIVATE_DATA ( 0x04000000 ) -#define SAMR_FIELD_EXPIRED_FLAG ( 0x08000000 ) -#define SAMR_FIELD_SEC_DESC ( 0x10000000 ) -#define SAMR_FIELD_OWF_PWD ( 0x20000000 ) - -struct samr_UserInfo21 { - NTTIME last_logon; - NTTIME last_logoff; - NTTIME last_password_change; - NTTIME acct_expiry; - NTTIME allow_password_change; - NTTIME force_password_change; - struct lsa_String account_name; - struct lsa_String full_name; - struct lsa_String home_directory; - struct lsa_String home_drive; - struct lsa_String logon_script; - struct lsa_String profile_path; - struct lsa_String description; - struct lsa_String workstations; - struct lsa_String comment; - struct lsa_BinaryString parameters; - struct lsa_BinaryString lm_owf_password; - struct lsa_BinaryString nt_owf_password; - struct lsa_String unknown3; - uint32_t buf_count; - uint8_t *buffer;/* [unique,size_is(buf_count)] */ - uint32_t rid; - uint32_t primary_gid; - uint32_t acct_flags; - uint32_t fields_present; - struct samr_LogonHours logon_hours; - uint16_t bad_password_count; - uint16_t logon_count; - uint16_t country_code; - uint16_t code_page; - uint8_t lm_password_set; - uint8_t nt_password_set; - uint8_t password_expired; - uint8_t unknown4; -}; - -struct samr_CryptPassword { - uint8_t data[516]; -}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct samr_UserInfo23 { - struct samr_UserInfo21 info; - struct samr_CryptPassword password; -}; - -struct samr_UserInfo24 { - struct samr_CryptPassword password; - uint8_t password_expired; -}; - -struct samr_CryptPasswordEx { - uint8_t data[532]; -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -struct samr_UserInfo25 { - struct samr_UserInfo21 info; - struct samr_CryptPasswordEx password; -}; - -struct samr_UserInfo26 { - struct samr_CryptPasswordEx password; - uint8_t password_expired; -}; - -union samr_UserInfo { - struct samr_UserInfo1 info1;/* [case] */ - struct samr_UserInfo2 info2;/* [case(2)] */ - struct samr_UserInfo3 info3;/* [case(3)] */ - struct samr_UserInfo4 info4;/* [case(4)] */ - struct samr_UserInfo5 info5;/* [case(5)] */ - struct samr_UserInfo6 info6;/* [case(6)] */ - struct samr_UserInfo7 info7;/* [case(7)] */ - struct samr_UserInfo8 info8;/* [case(8)] */ - struct samr_UserInfo9 info9;/* [case(9)] */ - struct samr_UserInfo10 info10;/* [case(10)] */ - struct samr_UserInfo11 info11;/* [case(11)] */ - struct samr_UserInfo12 info12;/* [case(12)] */ - struct samr_UserInfo13 info13;/* [case(13)] */ - struct samr_UserInfo14 info14;/* [case(14)] */ - struct samr_UserInfo16 info16;/* [case(16)] */ - struct samr_UserInfo17 info17;/* [case(17)] */ - struct samr_UserInfo18 info18;/* [case(18)] */ - struct samr_UserInfo20 info20;/* [case(20)] */ - struct samr_UserInfo21 info21;/* [case(21)] */ - struct samr_UserInfo23 info23;/* [case(23)] */ - struct samr_UserInfo24 info24;/* [case(24)] */ - struct samr_UserInfo25 info25;/* [case(25)] */ - struct samr_UserInfo26 info26;/* [case(26)] */ -}/* [switch_type(uint16)] */; - -struct samr_RidWithAttribute { - uint32_t rid; - uint32_t attributes; -}/* [public] */; - -struct samr_RidWithAttributeArray { - uint32_t count; - struct samr_RidWithAttribute *rids;/* [unique,size_is(count)] */ -}/* [public] */; - -struct samr_DispEntryGeneral { - uint32_t idx; - uint32_t rid; - uint32_t acct_flags; - struct lsa_String account_name; - struct lsa_String description; - struct lsa_String full_name; -}; - -struct samr_DispInfoGeneral { - uint32_t count; - struct samr_DispEntryGeneral *entries;/* [unique,size_is(count)] */ -}; - -struct samr_DispEntryFull { - uint32_t idx; - uint32_t rid; - uint32_t acct_flags; - struct lsa_String account_name; - struct lsa_String description; -}; - -struct samr_DispInfoFull { - uint32_t count; - struct samr_DispEntryFull *entries;/* [unique,size_is(count)] */ -}; - -struct samr_DispEntryFullGroup { - uint32_t idx; - uint32_t rid; - uint32_t acct_flags; - struct lsa_String account_name; - struct lsa_String description; -}; - -struct samr_DispInfoFullGroups { - uint32_t count; - struct samr_DispEntryFullGroup *entries;/* [unique,size_is(count)] */ -}; - -struct samr_DispEntryAscii { - uint32_t idx; - struct lsa_AsciiStringLarge account_name; -}; - -struct samr_DispInfoAscii { - uint32_t count; - struct samr_DispEntryAscii *entries;/* [unique,size_is(count)] */ -}; - -union samr_DispInfo { - struct samr_DispInfoGeneral info1;/* [case] */ - struct samr_DispInfoFull info2;/* [case(2)] */ - struct samr_DispInfoFullGroups info3;/* [case(3)] */ - struct samr_DispInfoAscii info4;/* [case(4)] */ - struct samr_DispInfoAscii info5;/* [case(5)] */ -}/* [switch_type(uint16)] */; - -struct samr_PwInfo { - uint16_t min_password_length; - uint32_t password_properties; -}; - -enum samr_ConnectVersion -#ifndef USE_UINT_ENUMS - { - SAMR_CONNECT_PRE_W2K=1, - SAMR_CONNECT_W2K=2, - SAMR_CONNECT_AFTER_W2K=3 -} -#else - { __donnot_use_enum_samr_ConnectVersion=0x7FFFFFFF} -#define SAMR_CONNECT_PRE_W2K ( 1 ) -#define SAMR_CONNECT_W2K ( 2 ) -#define SAMR_CONNECT_AFTER_W2K ( 3 ) -#endif -; - -enum samr_RejectReason; - -struct samr_ChangeReject { - enum samr_RejectReason reason; - uint32_t unknown1; - uint32_t unknown2; -}; - -struct samr_ConnectInfo1 { - enum samr_ConnectVersion client_version; - uint32_t unknown2; -}; - -union samr_ConnectInfo { - struct samr_ConnectInfo1 info1;/* [case] */ -}; - -/* bitmap samr_ValidateFieldsPresent */ -#define SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET ( 0x00000001 ) -#define SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME ( 0x00000002 ) -#define SAMR_VALIDATE_FIELD_LOCKOUT_TIME ( 0x00000004 ) -#define SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT ( 0x00000008 ) -#define SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH ( 0x00000010 ) -#define SAMR_VALIDATE_FIELD_PASSWORD_HISTORY ( 0x00000020 ) - -enum samr_ValidatePasswordLevel -#ifndef USE_UINT_ENUMS - { - NetValidateAuthentication=1, - NetValidatePasswordChange=2, - NetValidatePasswordReset=3 -} -#else - { __donnot_use_enum_samr_ValidatePasswordLevel=0x7FFFFFFF} -#define NetValidateAuthentication ( 1 ) -#define NetValidatePasswordChange ( 2 ) -#define NetValidatePasswordReset ( 3 ) -#endif -; - -enum samr_ValidationStatus -#ifndef USE_UINT_ENUMS - { - SAMR_VALIDATION_STATUS_SUCCESS=0, - SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE=1, - SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT=2, - SAMR_VALIDATION_STATUS_BAD_PASSWORD=4, - SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT=5, - SAMR_VALIDATION_STATUS_PWD_TOO_SHORT=6, - SAMR_VALIDATION_STATUS_PWD_TOO_LONG=7, - SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH=8, - SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT=9 -} -#else - { __donnot_use_enum_samr_ValidationStatus=0x7FFFFFFF} -#define SAMR_VALIDATION_STATUS_SUCCESS ( 0 ) -#define SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE ( 1 ) -#define SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT ( 2 ) -#define SAMR_VALIDATION_STATUS_BAD_PASSWORD ( 4 ) -#define SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT ( 5 ) -#define SAMR_VALIDATION_STATUS_PWD_TOO_SHORT ( 6 ) -#define SAMR_VALIDATION_STATUS_PWD_TOO_LONG ( 7 ) -#define SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH ( 8 ) -#define SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT ( 9 ) -#endif -; - -struct samr_ValidationBlob { - uint32_t length; - uint8_t *data;/* [unique,size_is(length)] */ -}; - -struct samr_ValidatePasswordInfo { - uint32_t fields_present; - NTTIME last_password_change; - NTTIME bad_password_time; - NTTIME lockout_time; - uint32_t bad_pwd_count; - uint32_t pwd_history_len; - struct samr_ValidationBlob *pwd_history;/* [unique,size_is(pwd_history_len)] */ -}; - -struct samr_ValidatePasswordRepCtr { - struct samr_ValidatePasswordInfo info; - enum samr_ValidationStatus status; -}; - -union samr_ValidatePasswordRep { - struct samr_ValidatePasswordRepCtr ctr1;/* [case] */ - struct samr_ValidatePasswordRepCtr ctr2;/* [case(2)] */ - struct samr_ValidatePasswordRepCtr ctr3;/* [case(3)] */ -}/* [switch_type(uint16)] */; - -struct samr_ValidatePasswordReq3 { - struct samr_ValidatePasswordInfo info; - struct lsa_StringLarge password; - struct lsa_StringLarge account; - struct samr_ValidationBlob hash; - uint8_t pwd_must_change_at_next_logon; - uint8_t clear_lockout; -}; - -struct samr_ValidatePasswordReq2 { - struct samr_ValidatePasswordInfo info; - struct lsa_StringLarge password; - struct lsa_StringLarge account; - struct samr_ValidationBlob hash; - uint8_t password_matched; -}; - -struct samr_ValidatePasswordReq1 { - struct samr_ValidatePasswordInfo info; - uint8_t password_matched; -}; - -union samr_ValidatePasswordReq { - struct samr_ValidatePasswordReq1 req1;/* [case] */ - struct samr_ValidatePasswordReq2 req2;/* [case(2)] */ - struct samr_ValidatePasswordReq3 req3;/* [case(3)] */ -}/* [switch_type(uint16)] */; - - -struct samr_Connect { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *connect_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_Close { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_SetSecurity { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t sec_info; - struct sec_desc_buf *sdbuf;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_QuerySecurity { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t sec_info; - } in; - - struct { - struct sec_desc_buf **sdbuf;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_Shutdown { - struct { - struct policy_handle *connect_handle;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_LookupDomain { - struct { - struct policy_handle *connect_handle;/* [ref] */ - struct lsa_String *domain_name;/* [ref] */ - } in; - - struct { - struct dom_sid2 **sid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_EnumDomains { - struct { - struct policy_handle *connect_handle;/* [ref] */ - uint32_t buf_size; - uint32_t *resume_handle;/* [ref] */ - } in; - - struct { - struct samr_SamArray **sam;/* [ref] */ - uint32_t *num_entries;/* [ref] */ - uint32_t *resume_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_OpenDomain { - struct { - struct policy_handle *connect_handle;/* [ref] */ - uint32_t access_mask; - struct dom_sid2 *sid;/* [ref] */ - } in; - - struct { - struct policy_handle *domain_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_QueryDomainInfo { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint16_t level; - } in; - - struct { - union samr_DomainInfo **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct samr_SetDomainInfo { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint16_t level; - union samr_DomainInfo *info;/* [ref,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_CreateDomainGroup { - struct { - struct policy_handle *domain_handle;/* [ref] */ - struct lsa_String *name;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *group_handle;/* [ref] */ - uint32_t *rid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_EnumDomainGroups { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint32_t max_size; - uint32_t *resume_handle;/* [ref] */ - } in; - - struct { - struct samr_SamArray **sam;/* [ref] */ - uint32_t *num_entries;/* [ref] */ - uint32_t *resume_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_CreateUser { - struct { - struct policy_handle *domain_handle;/* [ref] */ - struct lsa_String *account_name;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *user_handle;/* [ref] */ - uint32_t *rid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_EnumDomainUsers { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint32_t acct_flags; - uint32_t max_size; - uint32_t *resume_handle;/* [ref] */ - } in; - - struct { - struct samr_SamArray **sam;/* [ref] */ - uint32_t *num_entries;/* [ref] */ - uint32_t *resume_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_CreateDomAlias { - struct { - struct policy_handle *domain_handle;/* [ref] */ - struct lsa_String *alias_name;/* [ref] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *alias_handle;/* [ref] */ - uint32_t *rid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_EnumDomainAliases { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint32_t max_size; - uint32_t *resume_handle;/* [ref] */ - } in; - - struct { - struct samr_SamArray **sam;/* [ref] */ - uint32_t *num_entries;/* [ref] */ - uint32_t *resume_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_GetAliasMembership { - struct { - struct policy_handle *domain_handle;/* [ref] */ - struct lsa_SidArray *sids;/* [ref] */ - } in; - - struct { - struct samr_Ids *rids;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_LookupNames { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint32_t num_names;/* [range(0,1000)] */ - struct lsa_String *names;/* [length_is(num_names),size_is(1000)] */ - } in; - - struct { - struct samr_Ids *rids;/* [ref] */ - struct samr_Ids *types;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_LookupRids { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint32_t num_rids;/* [range(0,1000)] */ - uint32_t *rids;/* [length_is(num_rids),size_is(1000)] */ - } in; - - struct { - struct lsa_Strings *names;/* [ref] */ - struct samr_Ids *types;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_OpenGroup { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint32_t access_mask; - uint32_t rid; - } in; - - struct { - struct policy_handle *group_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_QueryGroupInfo { - struct { - struct policy_handle *group_handle;/* [ref] */ - enum samr_GroupInfoEnum level; - } in; - - struct { - union samr_GroupInfo **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct samr_SetGroupInfo { - struct { - struct policy_handle *group_handle;/* [ref] */ - enum samr_GroupInfoEnum level; - union samr_GroupInfo *info;/* [ref,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_AddGroupMember { - struct { - struct policy_handle *group_handle;/* [ref] */ - uint32_t rid; - uint32_t flags; - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_DeleteDomainGroup { - struct { - struct policy_handle *group_handle;/* [ref] */ - } in; - - struct { - struct policy_handle *group_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_DeleteGroupMember { - struct { - struct policy_handle *group_handle;/* [ref] */ - uint32_t rid; - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_QueryGroupMember { - struct { - struct policy_handle *group_handle;/* [ref] */ - } in; - - struct { - struct samr_RidTypeArray **rids;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_SetMemberAttributesOfGroup { - struct { - struct policy_handle *group_handle;/* [ref] */ - uint32_t unknown1; - uint32_t unknown2; - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_OpenAlias { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint32_t access_mask; - uint32_t rid; - } in; - - struct { - struct policy_handle *alias_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_QueryAliasInfo { - struct { - struct policy_handle *alias_handle;/* [ref] */ - enum samr_AliasInfoEnum level; - } in; - - struct { - union samr_AliasInfo **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct samr_SetAliasInfo { - struct { - struct policy_handle *alias_handle;/* [ref] */ - enum samr_AliasInfoEnum level; - union samr_AliasInfo *info;/* [ref,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_DeleteDomAlias { - struct { - struct policy_handle *alias_handle;/* [ref] */ - } in; - - struct { - struct policy_handle *alias_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_AddAliasMember { - struct { - struct policy_handle *alias_handle;/* [ref] */ - struct dom_sid2 *sid;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_DeleteAliasMember { - struct { - struct policy_handle *alias_handle;/* [ref] */ - struct dom_sid2 *sid;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_GetMembersInAlias { - struct { - struct policy_handle *alias_handle;/* [ref] */ - } in; - - struct { - struct lsa_SidArray *sids;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_OpenUser { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint32_t access_mask; - uint32_t rid; - } in; - - struct { - struct policy_handle *user_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_DeleteUser { - struct { - struct policy_handle *user_handle;/* [ref] */ - } in; - - struct { - struct policy_handle *user_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_QueryUserInfo { - struct { - struct policy_handle *user_handle;/* [ref] */ - uint16_t level; - } in; - - struct { - union samr_UserInfo **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct samr_SetUserInfo { - struct { - struct policy_handle *user_handle;/* [ref] */ - uint16_t level; - union samr_UserInfo *info;/* [ref,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_ChangePasswordUser { - struct { - struct policy_handle *user_handle;/* [ref] */ - uint8_t lm_present; - struct samr_Password *old_lm_crypted;/* [unique] */ - struct samr_Password *new_lm_crypted;/* [unique] */ - uint8_t nt_present; - struct samr_Password *old_nt_crypted;/* [unique] */ - struct samr_Password *new_nt_crypted;/* [unique] */ - uint8_t cross1_present; - struct samr_Password *nt_cross;/* [unique] */ - uint8_t cross2_present; - struct samr_Password *lm_cross;/* [unique] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_GetGroupsForUser { - struct { - struct policy_handle *user_handle;/* [ref] */ - } in; - - struct { - struct samr_RidWithAttributeArray **rids;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_QueryDisplayInfo { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint16_t level; - uint32_t start_idx; - uint32_t max_entries; - uint32_t buf_size; - } in; - - struct { - uint32_t *total_size;/* [ref] */ - uint32_t *returned_size;/* [ref] */ - union samr_DispInfo *info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct samr_GetDisplayEnumerationIndex { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint16_t level; - struct lsa_String *name;/* [ref] */ - } in; - - struct { - uint32_t *idx;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_TestPrivateFunctionsDomain { - struct { - struct policy_handle *domain_handle;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_TestPrivateFunctionsUser { - struct { - struct policy_handle *user_handle;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_GetUserPwInfo { - struct { - struct policy_handle *user_handle;/* [ref] */ - } in; - - struct { - struct samr_PwInfo *info;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_RemoveMemberFromForeignDomain { - struct { - struct policy_handle *domain_handle;/* [ref] */ - struct dom_sid2 *sid;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_QueryDomainInfo2 { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint16_t level; - } in; - - struct { - union samr_DomainInfo **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct samr_QueryUserInfo2 { - struct { - struct policy_handle *user_handle;/* [ref] */ - uint16_t level; - } in; - - struct { - union samr_UserInfo **info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct samr_QueryDisplayInfo2 { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint16_t level; - uint32_t start_idx; - uint32_t max_entries; - uint32_t buf_size; - } in; - - struct { - uint32_t *total_size;/* [ref] */ - uint32_t *returned_size;/* [ref] */ - union samr_DispInfo *info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct samr_GetDisplayEnumerationIndex2 { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint16_t level; - struct lsa_String *name;/* [ref] */ - } in; - - struct { - uint32_t *idx;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_CreateUser2 { - struct { - struct policy_handle *domain_handle;/* [ref] */ - struct lsa_String *account_name;/* [ref] */ - uint32_t acct_flags; - uint32_t access_mask; - } in; - - struct { - struct policy_handle *user_handle;/* [ref] */ - uint32_t *access_granted;/* [ref] */ - uint32_t *rid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_QueryDisplayInfo3 { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint16_t level; - uint32_t start_idx; - uint32_t max_entries; - uint32_t buf_size; - } in; - - struct { - uint32_t *total_size;/* [ref] */ - uint32_t *returned_size;/* [ref] */ - union samr_DispInfo *info;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - - -struct samr_AddMultipleMembersToAlias { - struct { - struct policy_handle *alias_handle;/* [ref] */ - struct lsa_SidArray *sids;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_RemoveMultipleMembersFromAlias { - struct { - struct policy_handle *alias_handle;/* [ref] */ - struct lsa_SidArray *sids;/* [ref] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_OemChangePasswordUser2 { - struct { - struct lsa_AsciiString *server;/* [unique] */ - struct lsa_AsciiString *account;/* [ref] */ - struct samr_CryptPassword *password;/* [unique] */ - struct samr_Password *hash;/* [unique] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_ChangePasswordUser2 { - struct { - struct lsa_String *server;/* [unique] */ - struct lsa_String *account;/* [ref] */ - struct samr_CryptPassword *nt_password;/* [unique] */ - struct samr_Password *nt_verifier;/* [unique] */ - uint8_t lm_change; - struct samr_CryptPassword *lm_password;/* [unique] */ - struct samr_Password *lm_verifier;/* [unique] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_GetDomPwInfo { - struct { - struct lsa_String *domain_name;/* [unique] */ - } in; - - struct { - struct samr_PwInfo *info;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_Connect2 { - struct { - const char *system_name;/* [unique,charset(UTF16)] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *connect_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_SetUserInfo2 { - struct { - struct policy_handle *user_handle;/* [ref] */ - uint16_t level; - union samr_UserInfo *info;/* [ref,switch_is(level)] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_SetBootKeyInformation { - struct { - struct policy_handle *connect_handle;/* [ref] */ - uint32_t unknown1; - uint32_t unknown2; - uint32_t unknown3; - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_GetBootKeyInformation { - struct { - struct policy_handle *domain_handle;/* [ref] */ - } in; - - struct { - uint32_t *unknown;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_Connect3 { - struct { - const char *system_name;/* [unique,charset(UTF16)] */ - uint32_t unknown; - uint32_t access_mask; - } in; - - struct { - struct policy_handle *connect_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_Connect4 { - struct { - const char *system_name;/* [unique,charset(UTF16)] */ - enum samr_ConnectVersion client_version; - uint32_t access_mask; - } in; - - struct { - struct policy_handle *connect_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_ChangePasswordUser3 { - struct { - struct lsa_String *server;/* [unique] */ - struct lsa_String *account;/* [ref] */ - struct samr_CryptPassword *nt_password;/* [unique] */ - struct samr_Password *nt_verifier;/* [unique] */ - uint8_t lm_change; - struct samr_CryptPassword *lm_password;/* [unique] */ - struct samr_Password *lm_verifier;/* [unique] */ - struct samr_CryptPassword *password3;/* [unique] */ - } in; - - struct { - struct samr_DomInfo1 **dominfo;/* [ref] */ - struct samr_ChangeReject **reject;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_Connect5 { - struct { - const char *system_name;/* [unique,charset(UTF16)] */ - uint32_t access_mask; - uint32_t level_in; - union samr_ConnectInfo *info_in;/* [ref,switch_is(level_in)] */ - } in; - - struct { - uint32_t *level_out;/* [ref] */ - union samr_ConnectInfo *info_out;/* [ref,switch_is(*level_out)] */ - struct policy_handle *connect_handle;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_RidToSid { - struct { - struct policy_handle *domain_handle;/* [ref] */ - uint32_t rid; - } in; - - struct { - struct dom_sid2 **sid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct samr_SetDsrmPassword { - struct { - struct lsa_String *name;/* [unique] */ - uint32_t unknown; - struct samr_Password *hash;/* [unique] */ - } in; - - struct { - NTSTATUS result; - } out; - -}; - - -struct samr_ValidatePassword { - struct { - enum samr_ValidatePasswordLevel level; - union samr_ValidatePasswordReq *req;/* [ref,switch_is(level)] */ - } in; - - struct { - union samr_ValidatePasswordRep **rep;/* [ref,switch_is(level)] */ - NTSTATUS result; - } out; - -}; - -#endif /* _HEADER_samr */ diff --git a/source3/librpc/gen_ndr/security.h b/source3/librpc/gen_ndr/security.h deleted file mode 100644 index 2b422608ea..0000000000 --- a/source3/librpc/gen_ndr/security.h +++ /dev/null @@ -1,354 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/misc.h" -#define dom_sid2 dom_sid -#define dom_sid28 dom_sid -#define dom_sid0 dom_sid -#ifndef _HEADER_security -#define _HEADER_security - -#define SEC_MASK_GENERIC ( 0xF0000000 ) -#define SEC_MASK_FLAGS ( 0x0F000000 ) -#define SEC_MASK_STANDARD ( 0x00FF0000 ) -#define SEC_MASK_SPECIFIC ( 0x0000FFFF ) -#define SEC_GENERIC_ALL ( 0x10000000 ) -#define SEC_GENERIC_EXECUTE ( 0x20000000 ) -#define SEC_GENERIC_WRITE ( 0x40000000 ) -#define SEC_GENERIC_READ ( 0x80000000 ) -#define SEC_FLAG_SYSTEM_SECURITY ( 0x01000000 ) -#define SEC_FLAG_MAXIMUM_ALLOWED ( 0x02000000 ) -#define SEC_STD_DELETE ( 0x00010000 ) -#define SEC_STD_READ_CONTROL ( 0x00020000 ) -#define SEC_STD_WRITE_DAC ( 0x00040000 ) -#define SEC_STD_WRITE_OWNER ( 0x00080000 ) -#define SEC_STD_SYNCHRONIZE ( 0x00100000 ) -#define SEC_STD_REQUIRED ( 0x000F0000 ) -#define SEC_STD_ALL ( 0x001F0000 ) -#define SEC_FILE_READ_DATA ( 0x00000001 ) -#define SEC_FILE_WRITE_DATA ( 0x00000002 ) -#define SEC_FILE_APPEND_DATA ( 0x00000004 ) -#define SEC_FILE_READ_EA ( 0x00000008 ) -#define SEC_FILE_WRITE_EA ( 0x00000010 ) -#define SEC_FILE_EXECUTE ( 0x00000020 ) -#define SEC_FILE_READ_ATTRIBUTE ( 0x00000080 ) -#define SEC_FILE_WRITE_ATTRIBUTE ( 0x00000100 ) -#define SEC_FILE_ALL ( 0x000001ff ) -#define SEC_DIR_LIST ( 0x00000001 ) -#define SEC_DIR_ADD_FILE ( 0x00000002 ) -#define SEC_DIR_ADD_SUBDIR ( 0x00000004 ) -#define SEC_DIR_READ_EA ( 0x00000008 ) -#define SEC_DIR_WRITE_EA ( 0x00000010 ) -#define SEC_DIR_TRAVERSE ( 0x00000020 ) -#define SEC_DIR_DELETE_CHILD ( 0x00000040 ) -#define SEC_DIR_READ_ATTRIBUTE ( 0x00000080 ) -#define SEC_DIR_WRITE_ATTRIBUTE ( 0x00000100 ) -#define SEC_REG_QUERY_VALUE ( 0x00000001 ) -#define SEC_REG_SET_VALUE ( 0x00000002 ) -#define SEC_REG_CREATE_SUBKEY ( 0x00000004 ) -#define SEC_REG_ENUM_SUBKEYS ( 0x00000008 ) -#define SEC_REG_NOTIFY ( 0x00000010 ) -#define SEC_REG_CREATE_LINK ( 0x00000020 ) -#define SEC_ADS_CREATE_CHILD ( 0x00000001 ) -#define SEC_ADS_DELETE_CHILD ( 0x00000002 ) -#define SEC_ADS_LIST ( 0x00000004 ) -#define SEC_ADS_SELF_WRITE ( 0x00000008 ) -#define SEC_ADS_READ_PROP ( 0x00000010 ) -#define SEC_ADS_WRITE_PROP ( 0x00000020 ) -#define SEC_ADS_DELETE_TREE ( 0x00000040 ) -#define SEC_ADS_LIST_OBJECT ( 0x00000080 ) -#define SEC_ADS_CONTROL_ACCESS ( 0x00000100 ) -#define SEC_MASK_INVALID ( 0x0ce0fe00 ) -#define SEC_RIGHTS_FILE_READ ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_READ_EA ) -#define SEC_RIGHTS_FILE_WRITE ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_WRITE_DATA|SEC_FILE_WRITE_ATTRIBUTE|SEC_FILE_WRITE_EA|SEC_FILE_APPEND_DATA ) -#define SEC_RIGHTS_FILE_EXECUTE ( SEC_STD_SYNCHRONIZE|SEC_STD_READ_CONTROL|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_EXECUTE ) -#define SEC_RIGHTS_FILE_ALL ( SEC_STD_ALL|SEC_FILE_ALL ) -#define SEC_RIGHTS_DIR_READ ( SEC_RIGHTS_FILE_READ ) -#define SEC_RIGHTS_DIR_WRITE ( SEC_RIGHTS_FILE_WRITE ) -#define SEC_RIGHTS_DIR_EXECUTE ( SEC_RIGHTS_FILE_EXECUTE ) -#define SEC_RIGHTS_DIR_ALL ( SEC_RIGHTS_FILE_ALL ) -#define STANDARD_RIGHTS_ALL_ACCESS ( SEC_STD_ALL ) -#define STANDARD_RIGHTS_MODIFY_ACCESS ( SEC_STD_READ_CONTROL ) -#define STANDARD_RIGHTS_EXECUTE_ACCESS ( SEC_STD_READ_CONTROL ) -#define STANDARD_RIGHTS_READ_ACCESS ( SEC_STD_READ_CONTROL ) -#define STANDARD_RIGHTS_WRITE_ACCESS ( (SEC_STD_WRITE_OWNER|SEC_STD_WRITE_DAC|SEC_STD_DELETE) ) -#define STANDARD_RIGHTS_REQUIRED_ACCESS ( (SEC_STD_DELETE|SEC_STD_READ_CONTROL|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER) ) -#define SID_NULL ( "S-1-0-0" ) -#define NAME_WORLD ( "WORLD" ) -#define SID_WORLD_DOMAIN ( "S-1-1" ) -#define SID_WORLD ( "S-1-1-0" ) -#define SID_CREATOR_OWNER_DOMAIN ( "S-1-3" ) -#define SID_CREATOR_OWNER ( "S-1-3-0" ) -#define SID_CREATOR_GROUP ( "S-1-3-1" ) -#define SID_OWNER_RIGHTS ( "S-1-3-4" ) -#define NAME_NT_AUTHORITY ( "NT AUTHORITY" ) -#define SID_NT_AUTHORITY ( "S-1-5" ) -#define SID_NT_DIALUP ( "S-1-5-1" ) -#define SID_NT_NETWORK ( "S-1-5-2" ) -#define SID_NT_BATCH ( "S-1-5-3" ) -#define SID_NT_INTERACTIVE ( "S-1-5-4" ) -#define SID_NT_SERVICE ( "S-1-5-6" ) -#define SID_NT_ANONYMOUS ( "S-1-5-7" ) -#define SID_NT_PROXY ( "S-1-5-8" ) -#define SID_NT_ENTERPRISE_DCS ( "S-1-5-9" ) -#define SID_NT_SELF ( "S-1-5-10" ) -#define SID_NT_AUTHENTICATED_USERS ( "S-1-5-11" ) -#define SID_NT_RESTRICTED ( "S-1-5-12" ) -#define SID_NT_TERMINAL_SERVER_USERS ( "S-1-5-13" ) -#define SID_NT_REMOTE_INTERACTIVE ( "S-1-5-14" ) -#define SID_NT_THIS_ORGANISATION ( "S-1-5-15" ) -#define SID_NT_IUSR ( "S-1-5-17" ) -#define SID_NT_SYSTEM ( "S-1-5-18" ) -#define SID_NT_LOCAL_SERVICE ( "S-1-5-19" ) -#define SID_NT_NETWORK_SERVICE ( "S-1-5-20" ) -#define SID_NT_DIGEST_AUTHENTICATION ( "S-1-5-64-21" ) -#define SID_NT_NTLM_AUTHENTICATION ( "S-1-5-64-10" ) -#define SID_NT_SCHANNEL_AUTHENTICATION ( "S-1-5-64-14" ) -#define SID_NT_OTHER_ORGANISATION ( "S-1-5-1000" ) -#define NAME_BUILTIN ( "BUILTIN" ) -#define SID_BUILTIN ( "S-1-5-32" ) -#define SID_BUILTIN_ADMINISTRATORS ( "S-1-5-32-544" ) -#define SID_BUILTIN_USERS ( "S-1-5-32-545" ) -#define SID_BUILTIN_GUESTS ( "S-1-5-32-546" ) -#define SID_BUILTIN_POWER_USERS ( "S-1-5-32-547" ) -#define SID_BUILTIN_ACCOUNT_OPERATORS ( "S-1-5-32-548" ) -#define SID_BUILTIN_SERVER_OPERATORS ( "S-1-5-32-549" ) -#define SID_BUILTIN_PRINT_OPERATORS ( "S-1-5-32-550" ) -#define SID_BUILTIN_BACKUP_OPERATORS ( "S-1-5-32-551" ) -#define SID_BUILTIN_REPLICATOR ( "S-1-5-32-552" ) -#define SID_BUILTIN_RAS_SERVERS ( "S-1-5-32-553" ) -#define SID_BUILTIN_PREW2K ( "S-1-5-32-554" ) -#define DOMAIN_RID_LOGON ( 9 ) -#define DOMAIN_RID_ADMINISTRATOR ( 500 ) -#define DOMAIN_RID_GUEST ( 501 ) -#define DOMAIN_RID_ADMINS ( 512 ) -#define DOMAIN_RID_USERS ( 513 ) -#define DOMAIN_RID_DOMAIN_MEMBERS ( 515 ) -#define DOMAIN_RID_DCS ( 516 ) -#define DOMAIN_RID_CERT_ADMINS ( 517 ) -#define DOMAIN_RID_SCHEMA_ADMINS ( 518 ) -#define DOMAIN_RID_ENTERPRISE_ADMINS ( 519 ) -#define NT4_ACL_REVISION ( SECURITY_ACL_REVISION_NT4 ) -#define SD_REVISION ( SECURITY_DESCRIPTOR_REVISION_1 ) -struct dom_sid { - uint8_t sid_rev_num; - int8_t num_auths;/* [range(0,15)] */ - uint8_t id_auth[6]; - uint32_t sub_auths[15]; -}/* [noprint,gensize,nopull,public,nopush,nosize] */; - -enum sec_privilege -#ifndef USE_UINT_ENUMS - { - SEC_PRIV_SECURITY=1, - SEC_PRIV_BACKUP=2, - SEC_PRIV_RESTORE=3, - SEC_PRIV_SYSTEMTIME=4, - SEC_PRIV_SHUTDOWN=5, - SEC_PRIV_REMOTE_SHUTDOWN=6, - SEC_PRIV_TAKE_OWNERSHIP=7, - SEC_PRIV_DEBUG=8, - SEC_PRIV_SYSTEM_ENVIRONMENT=9, - SEC_PRIV_SYSTEM_PROFILE=10, - SEC_PRIV_PROFILE_SINGLE_PROCESS=11, - SEC_PRIV_INCREASE_BASE_PRIORITY=12, - SEC_PRIV_LOAD_DRIVER=13, - SEC_PRIV_CREATE_PAGEFILE=14, - SEC_PRIV_INCREASE_QUOTA=15, - SEC_PRIV_CHANGE_NOTIFY=16, - SEC_PRIV_UNDOCK=17, - SEC_PRIV_MANAGE_VOLUME=18, - SEC_PRIV_IMPERSONATE=19, - SEC_PRIV_CREATE_GLOBAL=20, - SEC_PRIV_ENABLE_DELEGATION=21, - SEC_PRIV_INTERACTIVE_LOGON=22, - SEC_PRIV_NETWORK_LOGON=23, - SEC_PRIV_REMOTE_INTERACTIVE_LOGON=24 -} -#else - { __donnot_use_enum_sec_privilege=0x7FFFFFFF} -#define SEC_PRIV_SECURITY ( 1 ) -#define SEC_PRIV_BACKUP ( 2 ) -#define SEC_PRIV_RESTORE ( 3 ) -#define SEC_PRIV_SYSTEMTIME ( 4 ) -#define SEC_PRIV_SHUTDOWN ( 5 ) -#define SEC_PRIV_REMOTE_SHUTDOWN ( 6 ) -#define SEC_PRIV_TAKE_OWNERSHIP ( 7 ) -#define SEC_PRIV_DEBUG ( 8 ) -#define SEC_PRIV_SYSTEM_ENVIRONMENT ( 9 ) -#define SEC_PRIV_SYSTEM_PROFILE ( 10 ) -#define SEC_PRIV_PROFILE_SINGLE_PROCESS ( 11 ) -#define SEC_PRIV_INCREASE_BASE_PRIORITY ( 12 ) -#define SEC_PRIV_LOAD_DRIVER ( 13 ) -#define SEC_PRIV_CREATE_PAGEFILE ( 14 ) -#define SEC_PRIV_INCREASE_QUOTA ( 15 ) -#define SEC_PRIV_CHANGE_NOTIFY ( 16 ) -#define SEC_PRIV_UNDOCK ( 17 ) -#define SEC_PRIV_MANAGE_VOLUME ( 18 ) -#define SEC_PRIV_IMPERSONATE ( 19 ) -#define SEC_PRIV_CREATE_GLOBAL ( 20 ) -#define SEC_PRIV_ENABLE_DELEGATION ( 21 ) -#define SEC_PRIV_INTERACTIVE_LOGON ( 22 ) -#define SEC_PRIV_NETWORK_LOGON ( 23 ) -#define SEC_PRIV_REMOTE_INTERACTIVE_LOGON ( 24 ) -#endif -; - -/* bitmap security_ace_flags */ -#define SEC_ACE_FLAG_OBJECT_INHERIT ( 0x01 ) -#define SEC_ACE_FLAG_CONTAINER_INHERIT ( 0x02 ) -#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT ( 0x04 ) -#define SEC_ACE_FLAG_INHERIT_ONLY ( 0x08 ) -#define SEC_ACE_FLAG_INHERITED_ACE ( 0x10 ) -#define SEC_ACE_FLAG_VALID_INHERIT ( 0x0f ) -#define SEC_ACE_FLAG_SUCCESSFUL_ACCESS ( 0x40 ) -#define SEC_ACE_FLAG_FAILED_ACCESS ( 0x80 ) - -enum security_ace_type -#ifndef USE_UINT_ENUMS - { - SEC_ACE_TYPE_ACCESS_ALLOWED=0, - SEC_ACE_TYPE_ACCESS_DENIED=1, - SEC_ACE_TYPE_SYSTEM_AUDIT=2, - SEC_ACE_TYPE_SYSTEM_ALARM=3, - SEC_ACE_TYPE_ALLOWED_COMPOUND=4, - SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT=5, - SEC_ACE_TYPE_ACCESS_DENIED_OBJECT=6, - SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT=7, - SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT=8 -} -#else - { __donnot_use_enum_security_ace_type=0x7FFFFFFF} -#define SEC_ACE_TYPE_ACCESS_ALLOWED ( 0 ) -#define SEC_ACE_TYPE_ACCESS_DENIED ( 1 ) -#define SEC_ACE_TYPE_SYSTEM_AUDIT ( 2 ) -#define SEC_ACE_TYPE_SYSTEM_ALARM ( 3 ) -#define SEC_ACE_TYPE_ALLOWED_COMPOUND ( 4 ) -#define SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT ( 5 ) -#define SEC_ACE_TYPE_ACCESS_DENIED_OBJECT ( 6 ) -#define SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT ( 7 ) -#define SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT ( 8 ) -#endif -; - -/* bitmap security_ace_object_flags */ -#define SEC_ACE_OBJECT_TYPE_PRESENT ( 0x00000001 ) -#define SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT ( 0x00000002 ) - -union security_ace_object_type { - struct GUID type;/* [case(SEC_ACE_OBJECT_TYPE_PRESENT)] */ -}/* [nodiscriminant] */; - -union security_ace_object_inherited_type { - struct GUID inherited_type;/* [case(SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] */ -}/* [nodiscriminant] */; - -struct security_ace_object { - uint32_t flags; - union security_ace_object_type type;/* [switch_is(flags&SEC_ACE_OBJECT_TYPE_PRESENT)] */ - union security_ace_object_inherited_type inherited_type;/* [switch_is(flags&SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] */ -}; - -union security_ace_object_ctr { - struct security_ace_object object;/* [case(SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT)] */ -}/* [public,nodiscriminant] */; - -struct security_ace { - enum security_ace_type type; - uint8_t flags; - uint16_t size;/* [value(ndr_size_security_ace(r,ndr->flags))] */ - uint32_t access_mask; - union security_ace_object_ctr object;/* [switch_is(type)] */ - struct dom_sid trustee; -}/* [gensize,public,nopull,nosize] */; - -enum security_acl_revision -#ifndef USE_UINT_ENUMS - { - SECURITY_ACL_REVISION_NT4=2, - SECURITY_ACL_REVISION_ADS=4 -} -#else - { __donnot_use_enum_security_acl_revision=0x7FFFFFFF} -#define SECURITY_ACL_REVISION_NT4 ( 2 ) -#define SECURITY_ACL_REVISION_ADS ( 4 ) -#endif -; - -struct security_acl { - enum security_acl_revision revision; - uint16_t size;/* [value(ndr_size_security_acl(r,ndr->flags))] */ - uint32_t num_aces;/* [range(0,1000)] */ - struct security_ace *aces; -}/* [gensize,public,nosize] */; - -enum security_descriptor_revision -#ifndef USE_UINT_ENUMS - { - SECURITY_DESCRIPTOR_REVISION_1=1 -} -#else - { __donnot_use_enum_security_descriptor_revision=0x7FFFFFFF} -#define SECURITY_DESCRIPTOR_REVISION_1 ( 1 ) -#endif -; - -/* bitmap security_descriptor_type */ -#define SEC_DESC_OWNER_DEFAULTED ( 0x0001 ) -#define SEC_DESC_GROUP_DEFAULTED ( 0x0002 ) -#define SEC_DESC_DACL_PRESENT ( 0x0004 ) -#define SEC_DESC_DACL_DEFAULTED ( 0x0008 ) -#define SEC_DESC_SACL_PRESENT ( 0x0010 ) -#define SEC_DESC_SACL_DEFAULTED ( 0x0020 ) -#define SEC_DESC_DACL_TRUSTED ( 0x0040 ) -#define SEC_DESC_SERVER_SECURITY ( 0x0080 ) -#define SEC_DESC_DACL_AUTO_INHERIT_REQ ( 0x0100 ) -#define SEC_DESC_SACL_AUTO_INHERIT_REQ ( 0x0200 ) -#define SEC_DESC_DACL_AUTO_INHERITED ( 0x0400 ) -#define SEC_DESC_SACL_AUTO_INHERITED ( 0x0800 ) -#define SEC_DESC_DACL_PROTECTED ( 0x1000 ) -#define SEC_DESC_SACL_PROTECTED ( 0x2000 ) -#define SEC_DESC_RM_CONTROL_VALID ( 0x4000 ) -#define SEC_DESC_SELF_RELATIVE ( 0x8000 ) - -struct security_descriptor { - enum security_descriptor_revision revision; - uint16_t type; - struct dom_sid *owner_sid;/* [relative] */ - struct dom_sid *group_sid;/* [relative] */ - struct security_acl *sacl;/* [relative] */ - struct security_acl *dacl;/* [relative] */ -}/* [gensize,public,flag(LIBNDR_FLAG_LITTLE_ENDIAN),nosize] */; - -struct sec_desc_buf { - uint32_t sd_size;/* [value(ndr_size_security_descriptor(sd,ndr->flags)),range(0,0x40000)] */ - struct security_descriptor *sd;/* [unique,subcontext(4)] */ -}/* [public] */; - -struct security_token { - struct dom_sid *user_sid;/* [unique] */ - struct dom_sid *group_sid;/* [unique] */ - uint32_t num_sids; - struct dom_sid **sids;/* [unique,size_is(num_sids)] */ - uint64_t privilege_mask; -}/* [public] */; - -/* bitmap security_secinfo */ -#define SECINFO_OWNER ( 0x00000001 ) -#define SECINFO_GROUP ( 0x00000002 ) -#define SECINFO_DACL ( 0x00000004 ) -#define SECINFO_SACL ( 0x00000008 ) -#define SECINFO_UNPROTECTED_SACL ( 0x10000000 ) -#define SECINFO_UNPROTECTED_DACL ( 0x20000000 ) -#define SECINFO_PROTECTED_SACL ( 0x40000000 ) -#define SECINFO_PROTECTED_DACL ( 0x80000000 ) - -/* bitmap kerb_EncTypes */ -#define KERB_ENCTYPE_DES_CBC_CRC ( 0x00000001 ) -#define KERB_ENCTYPE_DES_CBC_MD5 ( 0x00000002 ) -#define KERB_ENCTYPE_RC4_HMAC_MD5 ( 0x00000004 ) -#define KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96 ( 0x00000008 ) -#define KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96 ( 0x00000010 ) - -#endif /* _HEADER_security */ diff --git a/source3/librpc/gen_ndr/srv_dfs.c b/source3/librpc/gen_ndr/srv_dfs.c deleted file mode 100644 index d58272084a..0000000000 --- a/source3/librpc/gen_ndr/srv_dfs.c +++ /dev/null @@ -1,1754 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_dfs.h" - -static bool api_dfs_GetManagerVersion(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_GetManagerVersion *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_GETMANAGERVERSION]; - - r = talloc(talloc_tos(), struct dfs_GetManagerVersion); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_GetManagerVersion, r); - } - - ZERO_STRUCT(r->out); - r->out.version = talloc_zero(r, enum dfs_ManagerVersion); - if (r->out.version == NULL) { - talloc_free(r); - return false; - } - - _dfs_GetManagerVersion(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_GetManagerVersion, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_Add(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_Add *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_ADD]; - - r = talloc(talloc_tos(), struct dfs_Add); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Add, r); - } - - r->out.result = _dfs_Add(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Add, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_Remove(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_Remove *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_REMOVE]; - - r = talloc(talloc_tos(), struct dfs_Remove); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Remove, r); - } - - r->out.result = _dfs_Remove(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Remove, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_SetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_SetInfo *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_SETINFO]; - - r = talloc(talloc_tos(), struct dfs_SetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_SetInfo, r); - } - - r->out.result = _dfs_SetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_SetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_GetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_GetInfo *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_GETINFO]; - - r = talloc(talloc_tos(), struct dfs_GetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_GetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union dfs_Info); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _dfs_GetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_GetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_Enum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_Enum *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_ENUM]; - - r = talloc(talloc_tos(), struct dfs_Enum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Enum, r); - } - - ZERO_STRUCT(r->out); - r->out.info = r->in.info; - r->out.total = r->in.total; - r->out.result = _dfs_Enum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Enum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_Rename(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_Rename *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_RENAME]; - - r = talloc(talloc_tos(), struct dfs_Rename); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Rename, r); - } - - r->out.result = _dfs_Rename(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Rename, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_Move(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_Move *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_MOVE]; - - r = talloc(talloc_tos(), struct dfs_Move); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Move, r); - } - - r->out.result = _dfs_Move(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Move, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_ManagerGetConfigInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_ManagerGetConfigInfo *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERGETCONFIGINFO]; - - r = talloc(talloc_tos(), struct dfs_ManagerGetConfigInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_ManagerGetConfigInfo, r); - } - - r->out.result = _dfs_ManagerGetConfigInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_ManagerGetConfigInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_ManagerSendSiteInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_ManagerSendSiteInfo *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERSENDSITEINFO]; - - r = talloc(talloc_tos(), struct dfs_ManagerSendSiteInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_ManagerSendSiteInfo, r); - } - - r->out.result = _dfs_ManagerSendSiteInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_ManagerSendSiteInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_AddFtRoot(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_AddFtRoot *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_ADDFTROOT]; - - r = talloc(talloc_tos(), struct dfs_AddFtRoot); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_AddFtRoot, r); - } - - ZERO_STRUCT(r->out); - r->out.unknown2 = r->in.unknown2; - r->out.result = _dfs_AddFtRoot(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_AddFtRoot, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_RemoveFtRoot(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_RemoveFtRoot *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_REMOVEFTROOT]; - - r = talloc(talloc_tos(), struct dfs_RemoveFtRoot); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_RemoveFtRoot, r); - } - - ZERO_STRUCT(r->out); - r->out.unknown = r->in.unknown; - r->out.result = _dfs_RemoveFtRoot(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_AddStdRoot(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_AddStdRoot *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_ADDSTDROOT]; - - r = talloc(talloc_tos(), struct dfs_AddStdRoot); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_AddStdRoot, r); - } - - r->out.result = _dfs_AddStdRoot(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_AddStdRoot, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_RemoveStdRoot(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_RemoveStdRoot *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_REMOVESTDROOT]; - - r = talloc(talloc_tos(), struct dfs_RemoveStdRoot); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_RemoveStdRoot, r); - } - - r->out.result = _dfs_RemoveStdRoot(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_RemoveStdRoot, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_ManagerInitialize(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_ManagerInitialize *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERINITIALIZE]; - - r = talloc(talloc_tos(), struct dfs_ManagerInitialize); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_ManagerInitialize, r); - } - - r->out.result = _dfs_ManagerInitialize(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_ManagerInitialize, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_AddStdRootForced(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_AddStdRootForced *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_ADDSTDROOTFORCED]; - - r = talloc(talloc_tos(), struct dfs_AddStdRootForced); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_AddStdRootForced, r); - } - - r->out.result = _dfs_AddStdRootForced(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_AddStdRootForced, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_GetDcAddress(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_GetDcAddress *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_GETDCADDRESS]; - - r = talloc(talloc_tos(), struct dfs_GetDcAddress); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, r); - } - - ZERO_STRUCT(r->out); - r->out.server_fullname = r->in.server_fullname; - r->out.is_root = r->in.is_root; - r->out.ttl = r->in.ttl; - r->out.result = _dfs_GetDcAddress(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_SetDcAddress(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_SetDcAddress *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_SETDCADDRESS]; - - r = talloc(talloc_tos(), struct dfs_SetDcAddress); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_SetDcAddress, r); - } - - r->out.result = _dfs_SetDcAddress(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_SetDcAddress, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_FlushFtTable(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_FlushFtTable *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_FLUSHFTTABLE]; - - r = talloc(talloc_tos(), struct dfs_FlushFtTable); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_FlushFtTable, r); - } - - r->out.result = _dfs_FlushFtTable(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_FlushFtTable, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_Add2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_Add2 *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_ADD2]; - - r = talloc(talloc_tos(), struct dfs_Add2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Add2, r); - } - - r->out.result = _dfs_Add2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Add2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_Remove2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_Remove2 *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_REMOVE2]; - - r = talloc(talloc_tos(), struct dfs_Remove2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_Remove2, r); - } - - r->out.result = _dfs_Remove2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_Remove2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_EnumEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_EnumEx *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_ENUMEX]; - - r = talloc(talloc_tos(), struct dfs_EnumEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_EnumEx, r); - } - - ZERO_STRUCT(r->out); - r->out.info = r->in.info; - r->out.total = r->in.total; - r->out.result = _dfs_EnumEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_EnumEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dfs_SetInfo2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dfs_SetInfo2 *r; - - call = &ndr_table_netdfs.calls[NDR_DFS_SETINFO2]; - - r = talloc(talloc_tos(), struct dfs_SetInfo2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dfs_SetInfo2, r); - } - - r->out.result = _dfs_SetInfo2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dfs_SetInfo2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_netdfs_cmds[] = -{ - {"DFS_GETMANAGERVERSION", NDR_DFS_GETMANAGERVERSION, api_dfs_GetManagerVersion}, - {"DFS_ADD", NDR_DFS_ADD, api_dfs_Add}, - {"DFS_REMOVE", NDR_DFS_REMOVE, api_dfs_Remove}, - {"DFS_SETINFO", NDR_DFS_SETINFO, api_dfs_SetInfo}, - {"DFS_GETINFO", NDR_DFS_GETINFO, api_dfs_GetInfo}, - {"DFS_ENUM", NDR_DFS_ENUM, api_dfs_Enum}, - {"DFS_RENAME", NDR_DFS_RENAME, api_dfs_Rename}, - {"DFS_MOVE", NDR_DFS_MOVE, api_dfs_Move}, - {"DFS_MANAGERGETCONFIGINFO", NDR_DFS_MANAGERGETCONFIGINFO, api_dfs_ManagerGetConfigInfo}, - {"DFS_MANAGERSENDSITEINFO", NDR_DFS_MANAGERSENDSITEINFO, api_dfs_ManagerSendSiteInfo}, - {"DFS_ADDFTROOT", NDR_DFS_ADDFTROOT, api_dfs_AddFtRoot}, - {"DFS_REMOVEFTROOT", NDR_DFS_REMOVEFTROOT, api_dfs_RemoveFtRoot}, - {"DFS_ADDSTDROOT", NDR_DFS_ADDSTDROOT, api_dfs_AddStdRoot}, - {"DFS_REMOVESTDROOT", NDR_DFS_REMOVESTDROOT, api_dfs_RemoveStdRoot}, - {"DFS_MANAGERINITIALIZE", NDR_DFS_MANAGERINITIALIZE, api_dfs_ManagerInitialize}, - {"DFS_ADDSTDROOTFORCED", NDR_DFS_ADDSTDROOTFORCED, api_dfs_AddStdRootForced}, - {"DFS_GETDCADDRESS", NDR_DFS_GETDCADDRESS, api_dfs_GetDcAddress}, - {"DFS_SETDCADDRESS", NDR_DFS_SETDCADDRESS, api_dfs_SetDcAddress}, - {"DFS_FLUSHFTTABLE", NDR_DFS_FLUSHFTTABLE, api_dfs_FlushFtTable}, - {"DFS_ADD2", NDR_DFS_ADD2, api_dfs_Add2}, - {"DFS_REMOVE2", NDR_DFS_REMOVE2, api_dfs_Remove2}, - {"DFS_ENUMEX", NDR_DFS_ENUMEX, api_dfs_EnumEx}, - {"DFS_SETINFO2", NDR_DFS_SETINFO2, api_dfs_SetInfo2}, -}; - -void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_netdfs_cmds; - *n_fns = sizeof(api_netdfs_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_netdfs_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "netdfs", "netdfs", &ndr_table_netdfs.syntax_id, api_netdfs_cmds, sizeof(api_netdfs_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_dfs.h b/source3/librpc/gen_ndr/srv_dfs.h deleted file mode 100644 index e4d7a99c73..0000000000 --- a/source3/librpc/gen_ndr/srv_dfs.h +++ /dev/null @@ -1,29 +0,0 @@ -#include "librpc/gen_ndr/ndr_dfs.h" -#ifndef __SRV_NETDFS__ -#define __SRV_NETDFS__ -void _dfs_GetManagerVersion(pipes_struct *p, struct dfs_GetManagerVersion *r); -WERROR _dfs_Add(pipes_struct *p, struct dfs_Add *r); -WERROR _dfs_Remove(pipes_struct *p, struct dfs_Remove *r); -WERROR _dfs_SetInfo(pipes_struct *p, struct dfs_SetInfo *r); -WERROR _dfs_GetInfo(pipes_struct *p, struct dfs_GetInfo *r); -WERROR _dfs_Enum(pipes_struct *p, struct dfs_Enum *r); -WERROR _dfs_Rename(pipes_struct *p, struct dfs_Rename *r); -WERROR _dfs_Move(pipes_struct *p, struct dfs_Move *r); -WERROR _dfs_ManagerGetConfigInfo(pipes_struct *p, struct dfs_ManagerGetConfigInfo *r); -WERROR _dfs_ManagerSendSiteInfo(pipes_struct *p, struct dfs_ManagerSendSiteInfo *r); -WERROR _dfs_AddFtRoot(pipes_struct *p, struct dfs_AddFtRoot *r); -WERROR _dfs_RemoveFtRoot(pipes_struct *p, struct dfs_RemoveFtRoot *r); -WERROR _dfs_AddStdRoot(pipes_struct *p, struct dfs_AddStdRoot *r); -WERROR _dfs_RemoveStdRoot(pipes_struct *p, struct dfs_RemoveStdRoot *r); -WERROR _dfs_ManagerInitialize(pipes_struct *p, struct dfs_ManagerInitialize *r); -WERROR _dfs_AddStdRootForced(pipes_struct *p, struct dfs_AddStdRootForced *r); -WERROR _dfs_GetDcAddress(pipes_struct *p, struct dfs_GetDcAddress *r); -WERROR _dfs_SetDcAddress(pipes_struct *p, struct dfs_SetDcAddress *r); -WERROR _dfs_FlushFtTable(pipes_struct *p, struct dfs_FlushFtTable *r); -WERROR _dfs_Add2(pipes_struct *p, struct dfs_Add2 *r); -WERROR _dfs_Remove2(pipes_struct *p, struct dfs_Remove2 *r); -WERROR _dfs_EnumEx(pipes_struct *p, struct dfs_EnumEx *r); -WERROR _dfs_SetInfo2(pipes_struct *p, struct dfs_SetInfo2 *r); -void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_netdfs_init(void); -#endif /* __SRV_NETDFS__ */ diff --git a/source3/librpc/gen_ndr/srv_dssetup.c b/source3/librpc/gen_ndr/srv_dssetup.c deleted file mode 100644 index 62123b826c..0000000000 --- a/source3/librpc/gen_ndr/srv_dssetup.c +++ /dev/null @@ -1,845 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_dssetup.h" - -static bool api_dssetup_DsRoleGetPrimaryDomainInformation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleGetPrimaryDomainInformation *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleGetPrimaryDomainInformation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union dssetup_DsRoleInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _dssetup_DsRoleGetPrimaryDomainInformation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleDnsNameToFlatName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleDnsNameToFlatName *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleDnsNameToFlatName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleDnsNameToFlatName, r); - } - - r->out.result = _dssetup_DsRoleDnsNameToFlatName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDnsNameToFlatName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleDcAsDc(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleDcAsDc *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASDC]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsDc); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsDc, r); - } - - r->out.result = _dssetup_DsRoleDcAsDc(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsDc, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleDcAsReplica(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleDcAsReplica *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASREPLICA]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsReplica); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsReplica, r); - } - - r->out.result = _dssetup_DsRoleDcAsReplica(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsReplica, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleDemoteDc(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleDemoteDc *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDEMOTEDC]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleDemoteDc); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleDemoteDc, r); - } - - r->out.result = _dssetup_DsRoleDemoteDc(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDemoteDc, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleGetDcOperationProgress(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleGetDcOperationProgress *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationProgress); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationProgress, r); - } - - r->out.result = _dssetup_DsRoleGetDcOperationProgress(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationProgress, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleGetDcOperationResults(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleGetDcOperationResults *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationResults); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationResults, r); - } - - r->out.result = _dssetup_DsRoleGetDcOperationResults(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationResults, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleCancel(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleCancel *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLECANCEL]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleCancel); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleCancel, r); - } - - r->out.result = _dssetup_DsRoleCancel(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleCancel, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleServerSaveStateForUpgrade(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleServerSaveStateForUpgrade *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleServerSaveStateForUpgrade); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, r); - } - - r->out.result = _dssetup_DsRoleServerSaveStateForUpgrade(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleUpgradeDownlevelServer(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleUpgradeDownlevelServer *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleUpgradeDownlevelServer); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, r); - } - - r->out.result = _dssetup_DsRoleUpgradeDownlevelServer(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_dssetup_DsRoleAbortDownlevelServerUpgrade(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct dssetup_DsRoleAbortDownlevelServerUpgrade *r; - - call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE]; - - r = talloc(talloc_tos(), struct dssetup_DsRoleAbortDownlevelServerUpgrade); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, r); - } - - r->out.result = _dssetup_DsRoleAbortDownlevelServerUpgrade(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_dssetup_cmds[] = -{ - {"DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION", NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION, api_dssetup_DsRoleGetPrimaryDomainInformation}, - {"DSSETUP_DSROLEDNSNAMETOFLATNAME", NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME, api_dssetup_DsRoleDnsNameToFlatName}, - {"DSSETUP_DSROLEDCASDC", NDR_DSSETUP_DSROLEDCASDC, api_dssetup_DsRoleDcAsDc}, - {"DSSETUP_DSROLEDCASREPLICA", NDR_DSSETUP_DSROLEDCASREPLICA, api_dssetup_DsRoleDcAsReplica}, - {"DSSETUP_DSROLEDEMOTEDC", NDR_DSSETUP_DSROLEDEMOTEDC, api_dssetup_DsRoleDemoteDc}, - {"DSSETUP_DSROLEGETDCOPERATIONPROGRESS", NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS, api_dssetup_DsRoleGetDcOperationProgress}, - {"DSSETUP_DSROLEGETDCOPERATIONRESULTS", NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS, api_dssetup_DsRoleGetDcOperationResults}, - {"DSSETUP_DSROLECANCEL", NDR_DSSETUP_DSROLECANCEL, api_dssetup_DsRoleCancel}, - {"DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE", NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE, api_dssetup_DsRoleServerSaveStateForUpgrade}, - {"DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER", NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER, api_dssetup_DsRoleUpgradeDownlevelServer}, - {"DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE", NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE, api_dssetup_DsRoleAbortDownlevelServerUpgrade}, -}; - -void dssetup_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_dssetup_cmds; - *n_fns = sizeof(api_dssetup_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_dssetup_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "dssetup", "dssetup", &ndr_table_dssetup.syntax_id, api_dssetup_cmds, sizeof(api_dssetup_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_dssetup.h b/source3/librpc/gen_ndr/srv_dssetup.h deleted file mode 100644 index 3233899eac..0000000000 --- a/source3/librpc/gen_ndr/srv_dssetup.h +++ /dev/null @@ -1,17 +0,0 @@ -#include "librpc/gen_ndr/ndr_dssetup.h" -#ifndef __SRV_DSSETUP__ -#define __SRV_DSSETUP__ -WERROR _dssetup_DsRoleGetPrimaryDomainInformation(pipes_struct *p, struct dssetup_DsRoleGetPrimaryDomainInformation *r); -WERROR _dssetup_DsRoleDnsNameToFlatName(pipes_struct *p, struct dssetup_DsRoleDnsNameToFlatName *r); -WERROR _dssetup_DsRoleDcAsDc(pipes_struct *p, struct dssetup_DsRoleDcAsDc *r); -WERROR _dssetup_DsRoleDcAsReplica(pipes_struct *p, struct dssetup_DsRoleDcAsReplica *r); -WERROR _dssetup_DsRoleDemoteDc(pipes_struct *p, struct dssetup_DsRoleDemoteDc *r); -WERROR _dssetup_DsRoleGetDcOperationProgress(pipes_struct *p, struct dssetup_DsRoleGetDcOperationProgress *r); -WERROR _dssetup_DsRoleGetDcOperationResults(pipes_struct *p, struct dssetup_DsRoleGetDcOperationResults *r); -WERROR _dssetup_DsRoleCancel(pipes_struct *p, struct dssetup_DsRoleCancel *r); -WERROR _dssetup_DsRoleServerSaveStateForUpgrade(pipes_struct *p, struct dssetup_DsRoleServerSaveStateForUpgrade *r); -WERROR _dssetup_DsRoleUpgradeDownlevelServer(pipes_struct *p, struct dssetup_DsRoleUpgradeDownlevelServer *r); -WERROR _dssetup_DsRoleAbortDownlevelServerUpgrade(pipes_struct *p, struct dssetup_DsRoleAbortDownlevelServerUpgrade *r); -void dssetup_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_dssetup_init(void); -#endif /* __SRV_DSSETUP__ */ diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c deleted file mode 100644 index 970398dc71..0000000000 --- a/source3/librpc/gen_ndr/srv_echo.c +++ /dev/null @@ -1,805 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_echo.h" - -static bool api_echo_AddOne(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_AddOne *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_ADDONE]; - - r = talloc(talloc_tos(), struct echo_AddOne); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_AddOne, r); - } - - ZERO_STRUCT(r->out); - r->out.out_data = talloc_zero(r, uint32_t); - if (r->out.out_data == NULL) { - talloc_free(r); - return false; - } - - _echo_AddOne(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_AddOne, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_echo_EchoData(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_EchoData *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_ECHODATA]; - - r = talloc(talloc_tos(), struct echo_EchoData); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_EchoData, r); - } - - ZERO_STRUCT(r->out); - r->out.out_data = talloc_zero_array(r, uint8_t, r->in.len); - if (r->out.out_data == NULL) { - talloc_free(r); - return false; - } - - _echo_EchoData(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_EchoData, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_echo_SinkData(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_SinkData *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_SINKDATA]; - - r = talloc(talloc_tos(), struct echo_SinkData); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_SinkData, r); - } - - _echo_SinkData(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_SinkData, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_echo_SourceData(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_SourceData *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_SOURCEDATA]; - - r = talloc(talloc_tos(), struct echo_SourceData); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_SourceData, r); - } - - ZERO_STRUCT(r->out); - r->out.data = talloc_zero_array(r, uint8_t, r->in.len); - if (r->out.data == NULL) { - talloc_free(r); - return false; - } - - _echo_SourceData(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_SourceData, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_echo_TestCall(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_TestCall *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL]; - - r = talloc(talloc_tos(), struct echo_TestCall); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestCall, r); - } - - ZERO_STRUCT(r->out); - r->out.s2 = talloc_zero(r, const char *); - if (r->out.s2 == NULL) { - talloc_free(r); - return false; - } - - _echo_TestCall(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestCall, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_echo_TestCall2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_TestCall2 *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL2]; - - r = talloc(talloc_tos(), struct echo_TestCall2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestCall2, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union echo_Info); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _echo_TestCall2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestCall2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_echo_TestSleep(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_TestSleep *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSLEEP]; - - r = talloc(talloc_tos(), struct echo_TestSleep); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestSleep, r); - } - - r->out.result = _echo_TestSleep(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestSleep, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_echo_TestEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_TestEnum *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTENUM]; - - r = talloc(talloc_tos(), struct echo_TestEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.foo1 = r->in.foo1; - r->out.foo2 = r->in.foo2; - r->out.foo3 = r->in.foo3; - _echo_TestEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_echo_TestSurrounding(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_TestSurrounding *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSURROUNDING]; - - r = talloc(talloc_tos(), struct echo_TestSurrounding); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestSurrounding, r); - } - - ZERO_STRUCT(r->out); - r->out.data = r->in.data; - _echo_TestSurrounding(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_echo_TestDoublePointer(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct echo_TestDoublePointer *r; - - call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTDOUBLEPOINTER]; - - r = talloc(talloc_tos(), struct echo_TestDoublePointer); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, r); - } - - r->out.result = _echo_TestDoublePointer(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_rpcecho_cmds[] = -{ - {"ECHO_ADDONE", NDR_ECHO_ADDONE, api_echo_AddOne}, - {"ECHO_ECHODATA", NDR_ECHO_ECHODATA, api_echo_EchoData}, - {"ECHO_SINKDATA", NDR_ECHO_SINKDATA, api_echo_SinkData}, - {"ECHO_SOURCEDATA", NDR_ECHO_SOURCEDATA, api_echo_SourceData}, - {"ECHO_TESTCALL", NDR_ECHO_TESTCALL, api_echo_TestCall}, - {"ECHO_TESTCALL2", NDR_ECHO_TESTCALL2, api_echo_TestCall2}, - {"ECHO_TESTSLEEP", NDR_ECHO_TESTSLEEP, api_echo_TestSleep}, - {"ECHO_TESTENUM", NDR_ECHO_TESTENUM, api_echo_TestEnum}, - {"ECHO_TESTSURROUNDING", NDR_ECHO_TESTSURROUNDING, api_echo_TestSurrounding}, - {"ECHO_TESTDOUBLEPOINTER", NDR_ECHO_TESTDOUBLEPOINTER, api_echo_TestDoublePointer}, -}; - -void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_rpcecho_cmds; - *n_fns = sizeof(api_rpcecho_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_rpcecho_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "rpcecho", "rpcecho", &ndr_table_rpcecho.syntax_id, api_rpcecho_cmds, sizeof(api_rpcecho_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_echo.h b/source3/librpc/gen_ndr/srv_echo.h deleted file mode 100644 index c3b0336652..0000000000 --- a/source3/librpc/gen_ndr/srv_echo.h +++ /dev/null @@ -1,16 +0,0 @@ -#include "librpc/gen_ndr/ndr_echo.h" -#ifndef __SRV_RPCECHO__ -#define __SRV_RPCECHO__ -void _echo_AddOne(pipes_struct *p, struct echo_AddOne *r); -void _echo_EchoData(pipes_struct *p, struct echo_EchoData *r); -void _echo_SinkData(pipes_struct *p, struct echo_SinkData *r); -void _echo_SourceData(pipes_struct *p, struct echo_SourceData *r); -void _echo_TestCall(pipes_struct *p, struct echo_TestCall *r); -NTSTATUS _echo_TestCall2(pipes_struct *p, struct echo_TestCall2 *r); -uint32 _echo_TestSleep(pipes_struct *p, struct echo_TestSleep *r); -void _echo_TestEnum(pipes_struct *p, struct echo_TestEnum *r); -void _echo_TestSurrounding(pipes_struct *p, struct echo_TestSurrounding *r); -uint16 _echo_TestDoublePointer(pipes_struct *p, struct echo_TestDoublePointer *r); -void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_rpcecho_init(void); -#endif /* __SRV_RPCECHO__ */ diff --git a/source3/librpc/gen_ndr/srv_epmapper.c b/source3/librpc/gen_ndr/srv_epmapper.c deleted file mode 100644 index a31d89b8e8..0000000000 --- a/source3/librpc/gen_ndr/srv_epmapper.c +++ /dev/null @@ -1,646 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_epmapper.h" - -static bool api_epm_Insert(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct epm_Insert *r; - - call = &ndr_table_epmapper.calls[NDR_EPM_INSERT]; - - r = talloc(talloc_tos(), struct epm_Insert); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_Insert, r); - } - - r->out.result = _epm_Insert(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_Insert, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_epm_Delete(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct epm_Delete *r; - - call = &ndr_table_epmapper.calls[NDR_EPM_DELETE]; - - r = talloc(talloc_tos(), struct epm_Delete); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_Delete, r); - } - - r->out.result = _epm_Delete(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_Delete, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_epm_Lookup(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct epm_Lookup *r; - - call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUP]; - - r = talloc(talloc_tos(), struct epm_Lookup); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_Lookup, r); - } - - ZERO_STRUCT(r->out); - r->out.entry_handle = r->in.entry_handle; - r->out.num_ents = talloc_zero(r, uint32_t); - if (r->out.num_ents == NULL) { - talloc_free(r); - return false; - } - - r->out.entries = talloc_zero_array(r, struct epm_entry_t, r->in.max_ents); - if (r->out.entries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _epm_Lookup(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_Lookup, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_epm_Map(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct epm_Map *r; - - call = &ndr_table_epmapper.calls[NDR_EPM_MAP]; - - r = talloc(talloc_tos(), struct epm_Map); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_Map, r); - } - - ZERO_STRUCT(r->out); - r->out.entry_handle = r->in.entry_handle; - r->out.num_towers = talloc_zero(r, uint32_t); - if (r->out.num_towers == NULL) { - talloc_free(r); - return false; - } - - r->out.towers = talloc_zero_array(r, struct epm_twr_p_t, r->in.max_towers); - if (r->out.towers == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _epm_Map(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_Map, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_epm_LookupHandleFree(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct epm_LookupHandleFree *r; - - call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUPHANDLEFREE]; - - r = talloc(talloc_tos(), struct epm_LookupHandleFree); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, r); - } - - ZERO_STRUCT(r->out); - r->out.entry_handle = r->in.entry_handle; - r->out.result = _epm_LookupHandleFree(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_epm_InqObject(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct epm_InqObject *r; - - call = &ndr_table_epmapper.calls[NDR_EPM_INQOBJECT]; - - r = talloc(talloc_tos(), struct epm_InqObject); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_InqObject, r); - } - - r->out.result = _epm_InqObject(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_InqObject, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_epm_MgmtDelete(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct epm_MgmtDelete *r; - - call = &ndr_table_epmapper.calls[NDR_EPM_MGMTDELETE]; - - r = talloc(talloc_tos(), struct epm_MgmtDelete); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_MgmtDelete, r); - } - - r->out.result = _epm_MgmtDelete(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_epm_MapAuth(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct epm_MapAuth *r; - - call = &ndr_table_epmapper.calls[NDR_EPM_MAPAUTH]; - - r = talloc(talloc_tos(), struct epm_MapAuth); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(epm_MapAuth, r); - } - - r->out.result = _epm_MapAuth(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(epm_MapAuth, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_epmapper_cmds[] = -{ - {"EPM_INSERT", NDR_EPM_INSERT, api_epm_Insert}, - {"EPM_DELETE", NDR_EPM_DELETE, api_epm_Delete}, - {"EPM_LOOKUP", NDR_EPM_LOOKUP, api_epm_Lookup}, - {"EPM_MAP", NDR_EPM_MAP, api_epm_Map}, - {"EPM_LOOKUPHANDLEFREE", NDR_EPM_LOOKUPHANDLEFREE, api_epm_LookupHandleFree}, - {"EPM_INQOBJECT", NDR_EPM_INQOBJECT, api_epm_InqObject}, - {"EPM_MGMTDELETE", NDR_EPM_MGMTDELETE, api_epm_MgmtDelete}, - {"EPM_MAPAUTH", NDR_EPM_MAPAUTH, api_epm_MapAuth}, -}; - -void epmapper_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_epmapper_cmds; - *n_fns = sizeof(api_epmapper_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_epmapper_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "epmapper", "epmapper", &ndr_table_epmapper.syntax_id, api_epmapper_cmds, sizeof(api_epmapper_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_epmapper.h b/source3/librpc/gen_ndr/srv_epmapper.h deleted file mode 100644 index e0d0105b78..0000000000 --- a/source3/librpc/gen_ndr/srv_epmapper.h +++ /dev/null @@ -1,14 +0,0 @@ -#include "librpc/gen_ndr/ndr_epmapper.h" -#ifndef __SRV_EPMAPPER__ -#define __SRV_EPMAPPER__ -uint32 _epm_Insert(pipes_struct *p, struct epm_Insert *r); -uint32 _epm_Delete(pipes_struct *p, struct epm_Delete *r); -uint32 _epm_Lookup(pipes_struct *p, struct epm_Lookup *r); -uint32 _epm_Map(pipes_struct *p, struct epm_Map *r); -uint32 _epm_LookupHandleFree(pipes_struct *p, struct epm_LookupHandleFree *r); -uint32 _epm_InqObject(pipes_struct *p, struct epm_InqObject *r); -uint32 _epm_MgmtDelete(pipes_struct *p, struct epm_MgmtDelete *r); -uint32 _epm_MapAuth(pipes_struct *p, struct epm_MapAuth *r); -void epmapper_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_epmapper_init(void); -#endif /* __SRV_EPMAPPER__ */ diff --git a/source3/librpc/gen_ndr/srv_eventlog.c b/source3/librpc/gen_ndr/srv_eventlog.c deleted file mode 100644 index b9a4a2e9ed..0000000000 --- a/source3/librpc/gen_ndr/srv_eventlog.c +++ /dev/null @@ -1,1842 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_eventlog.h" - -static bool api_eventlog_ClearEventLogW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_ClearEventLogW *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGW]; - - r = talloc(talloc_tos(), struct eventlog_ClearEventLogW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, r); - } - - r->out.result = _eventlog_ClearEventLogW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_BackupEventLogW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_BackupEventLogW *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGW]; - - r = talloc(talloc_tos(), struct eventlog_BackupEventLogW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, r); - } - - r->out.result = _eventlog_BackupEventLogW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_CloseEventLog(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_CloseEventLog *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLOSEEVENTLOG]; - - r = talloc(talloc_tos(), struct eventlog_CloseEventLog); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = r->in.handle; - r->out.result = _eventlog_CloseEventLog(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_DeregisterEventSource(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_DeregisterEventSource *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTEREVENTSOURCE]; - - r = talloc(talloc_tos(), struct eventlog_DeregisterEventSource); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, r); - } - - r->out.result = _eventlog_DeregisterEventSource(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_GetNumRecords(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_GetNumRecords *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETNUMRECORDS]; - - r = talloc(talloc_tos(), struct eventlog_GetNumRecords); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, r); - } - - ZERO_STRUCT(r->out); - r->out.number = talloc_zero(r, uint32_t); - if (r->out.number == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _eventlog_GetNumRecords(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_GetOldestRecord(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_GetOldestRecord *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETOLDESTRECORD]; - - r = talloc(talloc_tos(), struct eventlog_GetOldestRecord); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, r); - } - - ZERO_STRUCT(r->out); - r->out.oldest_entry = talloc_zero(r, uint32_t); - if (r->out.oldest_entry == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _eventlog_GetOldestRecord(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_ChangeNotify(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_ChangeNotify *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CHANGENOTIFY]; - - r = talloc(talloc_tos(), struct eventlog_ChangeNotify); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, r); - } - - r->out.result = _eventlog_ChangeNotify(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_OpenEventLogW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_OpenEventLogW *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGW]; - - r = talloc(talloc_tos(), struct eventlog_OpenEventLogW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _eventlog_OpenEventLogW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_RegisterEventSourceW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_RegisterEventSourceW *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEW]; - - r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, r); - } - - r->out.result = _eventlog_RegisterEventSourceW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_OpenBackupEventLogW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_OpenBackupEventLogW *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGW]; - - r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, r); - } - - r->out.result = _eventlog_OpenBackupEventLogW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_ReadEventLogW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_ReadEventLogW *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGW]; - - r = talloc(talloc_tos(), struct eventlog_ReadEventLogW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, r); - } - - ZERO_STRUCT(r->out); - r->out.data = talloc_zero_array(r, uint8_t, r->in.number_of_bytes); - if (r->out.data == NULL) { - talloc_free(r); - return false; - } - - r->out.sent_size = talloc_zero(r, uint32_t); - if (r->out.sent_size == NULL) { - talloc_free(r); - return false; - } - - r->out.real_size = talloc_zero(r, uint32_t); - if (r->out.real_size == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _eventlog_ReadEventLogW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_ReportEventW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_ReportEventW *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTW]; - - r = talloc(talloc_tos(), struct eventlog_ReportEventW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, r); - } - - r->out.result = _eventlog_ReportEventW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_ClearEventLogA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_ClearEventLogA *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGA]; - - r = talloc(talloc_tos(), struct eventlog_ClearEventLogA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, r); - } - - r->out.result = _eventlog_ClearEventLogA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_BackupEventLogA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_BackupEventLogA *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGA]; - - r = talloc(talloc_tos(), struct eventlog_BackupEventLogA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, r); - } - - r->out.result = _eventlog_BackupEventLogA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_OpenEventLogA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_OpenEventLogA *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGA]; - - r = talloc(talloc_tos(), struct eventlog_OpenEventLogA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, r); - } - - r->out.result = _eventlog_OpenEventLogA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_RegisterEventSourceA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_RegisterEventSourceA *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEA]; - - r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, r); - } - - r->out.result = _eventlog_RegisterEventSourceA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_OpenBackupEventLogA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_OpenBackupEventLogA *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGA]; - - r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, r); - } - - r->out.result = _eventlog_OpenBackupEventLogA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_ReadEventLogA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_ReadEventLogA *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGA]; - - r = talloc(talloc_tos(), struct eventlog_ReadEventLogA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, r); - } - - r->out.result = _eventlog_ReadEventLogA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_ReportEventA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_ReportEventA *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTA]; - - r = talloc(talloc_tos(), struct eventlog_ReportEventA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, r); - } - - r->out.result = _eventlog_ReportEventA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_RegisterClusterSvc(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_RegisterClusterSvc *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTERCLUSTERSVC]; - - r = talloc(talloc_tos(), struct eventlog_RegisterClusterSvc); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, r); - } - - r->out.result = _eventlog_RegisterClusterSvc(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_DeregisterClusterSvc(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_DeregisterClusterSvc *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTERCLUSTERSVC]; - - r = talloc(talloc_tos(), struct eventlog_DeregisterClusterSvc); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, r); - } - - r->out.result = _eventlog_DeregisterClusterSvc(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_WriteClusterEvents(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_WriteClusterEvents *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_WRITECLUSTEREVENTS]; - - r = talloc(talloc_tos(), struct eventlog_WriteClusterEvents); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, r); - } - - r->out.result = _eventlog_WriteClusterEvents(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_GetLogIntormation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_GetLogIntormation *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETLOGINTORMATION]; - - r = talloc(talloc_tos(), struct eventlog_GetLogIntormation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_GetLogIntormation, r); - } - - r->out.result = _eventlog_GetLogIntormation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_eventlog_FlushEventLog(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct eventlog_FlushEventLog *r; - - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_FLUSHEVENTLOG]; - - r = talloc(talloc_tos(), struct eventlog_FlushEventLog); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, r); - } - - r->out.result = _eventlog_FlushEventLog(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_eventlog_cmds[] = -{ - {"EVENTLOG_CLEAREVENTLOGW", NDR_EVENTLOG_CLEAREVENTLOGW, api_eventlog_ClearEventLogW}, - {"EVENTLOG_BACKUPEVENTLOGW", NDR_EVENTLOG_BACKUPEVENTLOGW, api_eventlog_BackupEventLogW}, - {"EVENTLOG_CLOSEEVENTLOG", NDR_EVENTLOG_CLOSEEVENTLOG, api_eventlog_CloseEventLog}, - {"EVENTLOG_DEREGISTEREVENTSOURCE", NDR_EVENTLOG_DEREGISTEREVENTSOURCE, api_eventlog_DeregisterEventSource}, - {"EVENTLOG_GETNUMRECORDS", NDR_EVENTLOG_GETNUMRECORDS, api_eventlog_GetNumRecords}, - {"EVENTLOG_GETOLDESTRECORD", NDR_EVENTLOG_GETOLDESTRECORD, api_eventlog_GetOldestRecord}, - {"EVENTLOG_CHANGENOTIFY", NDR_EVENTLOG_CHANGENOTIFY, api_eventlog_ChangeNotify}, - {"EVENTLOG_OPENEVENTLOGW", NDR_EVENTLOG_OPENEVENTLOGW, api_eventlog_OpenEventLogW}, - {"EVENTLOG_REGISTEREVENTSOURCEW", NDR_EVENTLOG_REGISTEREVENTSOURCEW, api_eventlog_RegisterEventSourceW}, - {"EVENTLOG_OPENBACKUPEVENTLOGW", NDR_EVENTLOG_OPENBACKUPEVENTLOGW, api_eventlog_OpenBackupEventLogW}, - {"EVENTLOG_READEVENTLOGW", NDR_EVENTLOG_READEVENTLOGW, api_eventlog_ReadEventLogW}, - {"EVENTLOG_REPORTEVENTW", NDR_EVENTLOG_REPORTEVENTW, api_eventlog_ReportEventW}, - {"EVENTLOG_CLEAREVENTLOGA", NDR_EVENTLOG_CLEAREVENTLOGA, api_eventlog_ClearEventLogA}, - {"EVENTLOG_BACKUPEVENTLOGA", NDR_EVENTLOG_BACKUPEVENTLOGA, api_eventlog_BackupEventLogA}, - {"EVENTLOG_OPENEVENTLOGA", NDR_EVENTLOG_OPENEVENTLOGA, api_eventlog_OpenEventLogA}, - {"EVENTLOG_REGISTEREVENTSOURCEA", NDR_EVENTLOG_REGISTEREVENTSOURCEA, api_eventlog_RegisterEventSourceA}, - {"EVENTLOG_OPENBACKUPEVENTLOGA", NDR_EVENTLOG_OPENBACKUPEVENTLOGA, api_eventlog_OpenBackupEventLogA}, - {"EVENTLOG_READEVENTLOGA", NDR_EVENTLOG_READEVENTLOGA, api_eventlog_ReadEventLogA}, - {"EVENTLOG_REPORTEVENTA", NDR_EVENTLOG_REPORTEVENTA, api_eventlog_ReportEventA}, - {"EVENTLOG_REGISTERCLUSTERSVC", NDR_EVENTLOG_REGISTERCLUSTERSVC, api_eventlog_RegisterClusterSvc}, - {"EVENTLOG_DEREGISTERCLUSTERSVC", NDR_EVENTLOG_DEREGISTERCLUSTERSVC, api_eventlog_DeregisterClusterSvc}, - {"EVENTLOG_WRITECLUSTEREVENTS", NDR_EVENTLOG_WRITECLUSTEREVENTS, api_eventlog_WriteClusterEvents}, - {"EVENTLOG_GETLOGINTORMATION", NDR_EVENTLOG_GETLOGINTORMATION, api_eventlog_GetLogIntormation}, - {"EVENTLOG_FLUSHEVENTLOG", NDR_EVENTLOG_FLUSHEVENTLOG, api_eventlog_FlushEventLog}, -}; - -void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_eventlog_cmds; - *n_fns = sizeof(api_eventlog_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_eventlog_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "eventlog", "eventlog", &ndr_table_eventlog.syntax_id, api_eventlog_cmds, sizeof(api_eventlog_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_eventlog.h b/source3/librpc/gen_ndr/srv_eventlog.h deleted file mode 100644 index 6957c66beb..0000000000 --- a/source3/librpc/gen_ndr/srv_eventlog.h +++ /dev/null @@ -1,30 +0,0 @@ -#include "librpc/gen_ndr/ndr_eventlog.h" -#ifndef __SRV_EVENTLOG__ -#define __SRV_EVENTLOG__ -NTSTATUS _eventlog_ClearEventLogW(pipes_struct *p, struct eventlog_ClearEventLogW *r); -NTSTATUS _eventlog_BackupEventLogW(pipes_struct *p, struct eventlog_BackupEventLogW *r); -NTSTATUS _eventlog_CloseEventLog(pipes_struct *p, struct eventlog_CloseEventLog *r); -NTSTATUS _eventlog_DeregisterEventSource(pipes_struct *p, struct eventlog_DeregisterEventSource *r); -NTSTATUS _eventlog_GetNumRecords(pipes_struct *p, struct eventlog_GetNumRecords *r); -NTSTATUS _eventlog_GetOldestRecord(pipes_struct *p, struct eventlog_GetOldestRecord *r); -NTSTATUS _eventlog_ChangeNotify(pipes_struct *p, struct eventlog_ChangeNotify *r); -NTSTATUS _eventlog_OpenEventLogW(pipes_struct *p, struct eventlog_OpenEventLogW *r); -NTSTATUS _eventlog_RegisterEventSourceW(pipes_struct *p, struct eventlog_RegisterEventSourceW *r); -NTSTATUS _eventlog_OpenBackupEventLogW(pipes_struct *p, struct eventlog_OpenBackupEventLogW *r); -NTSTATUS _eventlog_ReadEventLogW(pipes_struct *p, struct eventlog_ReadEventLogW *r); -NTSTATUS _eventlog_ReportEventW(pipes_struct *p, struct eventlog_ReportEventW *r); -NTSTATUS _eventlog_ClearEventLogA(pipes_struct *p, struct eventlog_ClearEventLogA *r); -NTSTATUS _eventlog_BackupEventLogA(pipes_struct *p, struct eventlog_BackupEventLogA *r); -NTSTATUS _eventlog_OpenEventLogA(pipes_struct *p, struct eventlog_OpenEventLogA *r); -NTSTATUS _eventlog_RegisterEventSourceA(pipes_struct *p, struct eventlog_RegisterEventSourceA *r); -NTSTATUS _eventlog_OpenBackupEventLogA(pipes_struct *p, struct eventlog_OpenBackupEventLogA *r); -NTSTATUS _eventlog_ReadEventLogA(pipes_struct *p, struct eventlog_ReadEventLogA *r); -NTSTATUS _eventlog_ReportEventA(pipes_struct *p, struct eventlog_ReportEventA *r); -NTSTATUS _eventlog_RegisterClusterSvc(pipes_struct *p, struct eventlog_RegisterClusterSvc *r); -NTSTATUS _eventlog_DeregisterClusterSvc(pipes_struct *p, struct eventlog_DeregisterClusterSvc *r); -NTSTATUS _eventlog_WriteClusterEvents(pipes_struct *p, struct eventlog_WriteClusterEvents *r); -NTSTATUS _eventlog_GetLogIntormation(pipes_struct *p, struct eventlog_GetLogIntormation *r); -NTSTATUS _eventlog_FlushEventLog(pipes_struct *p, struct eventlog_FlushEventLog *r); -void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_eventlog_init(void); -#endif /* __SRV_EVENTLOG__ */ diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c deleted file mode 100644 index 51098074ac..0000000000 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_initshutdown.h" - -static bool api_initshutdown_Init(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct initshutdown_Init *r; - - call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INIT]; - - r = talloc(talloc_tos(), struct initshutdown_Init); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(initshutdown_Init, r); - } - - r->out.result = _initshutdown_Init(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(initshutdown_Init, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_initshutdown_Abort(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct initshutdown_Abort *r; - - call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_ABORT]; - - r = talloc(talloc_tos(), struct initshutdown_Abort); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(initshutdown_Abort, r); - } - - r->out.result = _initshutdown_Abort(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(initshutdown_Abort, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_initshutdown_InitEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct initshutdown_InitEx *r; - - call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INITEX]; - - r = talloc(talloc_tos(), struct initshutdown_InitEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(initshutdown_InitEx, r); - } - - r->out.result = _initshutdown_InitEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_initshutdown_cmds[] = -{ - {"INITSHUTDOWN_INIT", NDR_INITSHUTDOWN_INIT, api_initshutdown_Init}, - {"INITSHUTDOWN_ABORT", NDR_INITSHUTDOWN_ABORT, api_initshutdown_Abort}, - {"INITSHUTDOWN_INITEX", NDR_INITSHUTDOWN_INITEX, api_initshutdown_InitEx}, -}; - -void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_initshutdown_cmds; - *n_fns = sizeof(api_initshutdown_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_initshutdown_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", &ndr_table_initshutdown.syntax_id, api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_initshutdown.h b/source3/librpc/gen_ndr/srv_initshutdown.h deleted file mode 100644 index be3ea25271..0000000000 --- a/source3/librpc/gen_ndr/srv_initshutdown.h +++ /dev/null @@ -1,9 +0,0 @@ -#include "librpc/gen_ndr/ndr_initshutdown.h" -#ifndef __SRV_INITSHUTDOWN__ -#define __SRV_INITSHUTDOWN__ -WERROR _initshutdown_Init(pipes_struct *p, struct initshutdown_Init *r); -WERROR _initshutdown_Abort(pipes_struct *p, struct initshutdown_Abort *r); -WERROR _initshutdown_InitEx(pipes_struct *p, struct initshutdown_InitEx *r); -void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_initshutdown_init(void); -#endif /* __SRV_INITSHUTDOWN__ */ diff --git a/source3/librpc/gen_ndr/srv_lsa.c b/source3/librpc/gen_ndr/srv_lsa.c deleted file mode 100644 index c30f276800..0000000000 --- a/source3/librpc/gen_ndr/srv_lsa.c +++ /dev/null @@ -1,6389 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_lsa.h" - -static bool api_lsa_Close(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_Close *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSE]; - - r = talloc(talloc_tos(), struct lsa_Close); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_Close, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = r->in.handle; - r->out.result = _lsa_Close(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_Close, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_Delete(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_Delete *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_DELETE]; - - r = talloc(talloc_tos(), struct lsa_Delete); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_Delete, r); - } - - r->out.result = _lsa_Delete(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_Delete, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_EnumPrivs(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_EnumPrivs *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVS]; - - r = talloc(talloc_tos(), struct lsa_EnumPrivs); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumPrivs, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.privs = talloc_zero(r, struct lsa_PrivArray); - if (r->out.privs == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_EnumPrivs(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_QuerySecurity(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_QuerySecurity *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECURITY]; - - r = talloc(talloc_tos(), struct lsa_QuerySecurity); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QuerySecurity, r); - } - - ZERO_STRUCT(r->out); - r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *); - if (r->out.sdbuf == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_QuerySecurity(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetSecObj(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetSecObj *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECOBJ]; - - r = talloc(talloc_tos(), struct lsa_SetSecObj); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetSecObj, r); - } - - r->out.result = _lsa_SetSecObj(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_ChangePassword(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_ChangePassword *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CHANGEPASSWORD]; - - r = talloc(talloc_tos(), struct lsa_ChangePassword); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_ChangePassword, r); - } - - r->out.result = _lsa_ChangePassword(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_OpenPolicy(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_OpenPolicy *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY]; - - r = talloc(talloc_tos(), struct lsa_OpenPolicy); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_OpenPolicy(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_QueryInfoPolicy(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_QueryInfoPolicy *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY]; - - r = talloc(talloc_tos(), struct lsa_QueryInfoPolicy); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union lsa_PolicyInformation *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_QueryInfoPolicy(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetInfoPolicy(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetInfoPolicy *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY]; - - r = talloc(talloc_tos(), struct lsa_SetInfoPolicy); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, r); - } - - r->out.result = _lsa_SetInfoPolicy(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_ClearAuditLog(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_ClearAuditLog *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CLEARAUDITLOG]; - - r = talloc(talloc_tos(), struct lsa_ClearAuditLog); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, r); - } - - r->out.result = _lsa_ClearAuditLog(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CreateAccount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CreateAccount *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREATEACCOUNT]; - - r = talloc(talloc_tos(), struct lsa_CreateAccount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateAccount, r); - } - - ZERO_STRUCT(r->out); - r->out.acct_handle = talloc_zero(r, struct policy_handle); - if (r->out.acct_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_CreateAccount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_EnumAccounts(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_EnumAccounts *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTS]; - - r = talloc(talloc_tos(), struct lsa_EnumAccounts); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.sids = talloc_zero(r, struct lsa_SidArray); - if (r->out.sids == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_EnumAccounts(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CreateTrustedDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CreateTrustedDomain *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAIN]; - - r = talloc(talloc_tos(), struct lsa_CreateTrustedDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, r); - } - - ZERO_STRUCT(r->out); - r->out.trustdom_handle = talloc_zero(r, struct policy_handle); - if (r->out.trustdom_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_CreateTrustedDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_EnumTrustDom(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_EnumTrustDom *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTDOM]; - - r = talloc(talloc_tos(), struct lsa_EnumTrustDom); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.domains = talloc_zero(r, struct lsa_DomainList); - if (r->out.domains == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_EnumTrustDom(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupNames(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupNames *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES]; - - r = talloc(talloc_tos(), struct lsa_LookupNames); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupNames, r); - } - - ZERO_STRUCT(r->out); - r->out.sids = r->in.sids; - r->out.count = r->in.count; - r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); - if (r->out.domains == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupNames(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupNames, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupSids(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupSids *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS]; - - r = talloc(talloc_tos(), struct lsa_LookupSids); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupSids, r); - } - - ZERO_STRUCT(r->out); - r->out.names = r->in.names; - r->out.count = r->in.count; - r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); - if (r->out.domains == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupSids(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupSids, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CreateSecret(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CreateSecret *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREATESECRET]; - - r = talloc(talloc_tos(), struct lsa_CreateSecret); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateSecret, r); - } - - ZERO_STRUCT(r->out); - r->out.sec_handle = talloc_zero(r, struct policy_handle); - if (r->out.sec_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_CreateSecret(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_OpenAccount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_OpenAccount *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_OPENACCOUNT]; - - r = talloc(talloc_tos(), struct lsa_OpenAccount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenAccount, r); - } - - ZERO_STRUCT(r->out); - r->out.acct_handle = talloc_zero(r, struct policy_handle); - if (r->out.acct_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_OpenAccount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_EnumPrivsAccount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_EnumPrivsAccount *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVSACCOUNT]; - - r = talloc(talloc_tos(), struct lsa_EnumPrivsAccount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, r); - } - - ZERO_STRUCT(r->out); - r->out.privs = talloc_zero(r, struct lsa_PrivilegeSet *); - if (r->out.privs == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_EnumPrivsAccount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_AddPrivilegesToAccount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_AddPrivilegesToAccount *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_ADDPRIVILEGESTOACCOUNT]; - - r = talloc(talloc_tos(), struct lsa_AddPrivilegesToAccount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, r); - } - - r->out.result = _lsa_AddPrivilegesToAccount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_RemovePrivilegesFromAccount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_RemovePrivilegesFromAccount *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT]; - - r = talloc(talloc_tos(), struct lsa_RemovePrivilegesFromAccount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, r); - } - - r->out.result = _lsa_RemovePrivilegesFromAccount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_GetQuotasForAccount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_GetQuotasForAccount *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_GETQUOTASFORACCOUNT]; - - r = talloc(talloc_tos(), struct lsa_GetQuotasForAccount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, r); - } - - r->out.result = _lsa_GetQuotasForAccount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetQuotasForAccount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetQuotasForAccount *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETQUOTASFORACCOUNT]; - - r = talloc(talloc_tos(), struct lsa_SetQuotasForAccount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, r); - } - - r->out.result = _lsa_SetQuotasForAccount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_GetSystemAccessAccount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_GetSystemAccessAccount *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_GETSYSTEMACCESSACCOUNT]; - - r = talloc(talloc_tos(), struct lsa_GetSystemAccessAccount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, r); - } - - ZERO_STRUCT(r->out); - r->out.access_mask = talloc_zero(r, uint32_t); - if (r->out.access_mask == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_GetSystemAccessAccount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetSystemAccessAccount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetSystemAccessAccount *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETSYSTEMACCESSACCOUNT]; - - r = talloc(talloc_tos(), struct lsa_SetSystemAccessAccount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, r); - } - - r->out.result = _lsa_SetSystemAccessAccount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_OpenTrustedDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_OpenTrustedDomain *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAIN]; - - r = talloc(talloc_tos(), struct lsa_OpenTrustedDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, r); - } - - ZERO_STRUCT(r->out); - r->out.trustdom_handle = talloc_zero(r, struct policy_handle); - if (r->out.trustdom_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_OpenTrustedDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_QueryTrustedDomainInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_QueryTrustedDomainInfo *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFO]; - - r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_QueryTrustedDomainInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetInformationTrustedDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetInformationTrustedDomain *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN]; - - r = talloc(talloc_tos(), struct lsa_SetInformationTrustedDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, r); - } - - r->out.result = _lsa_SetInformationTrustedDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_OpenSecret(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_OpenSecret *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_OPENSECRET]; - - r = talloc(talloc_tos(), struct lsa_OpenSecret); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenSecret, r); - } - - ZERO_STRUCT(r->out); - r->out.sec_handle = talloc_zero(r, struct policy_handle); - if (r->out.sec_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_OpenSecret(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetSecret(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetSecret *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECRET]; - - r = talloc(talloc_tos(), struct lsa_SetSecret); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetSecret, r); - } - - r->out.result = _lsa_SetSecret(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetSecret, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_QuerySecret(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_QuerySecret *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECRET]; - - r = talloc(talloc_tos(), struct lsa_QuerySecret); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QuerySecret, r); - } - - ZERO_STRUCT(r->out); - r->out.new_val = r->in.new_val; - r->out.new_mtime = r->in.new_mtime; - r->out.old_val = r->in.old_val; - r->out.old_mtime = r->in.old_mtime; - r->out.result = _lsa_QuerySecret(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupPrivValue(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupPrivValue *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVVALUE]; - - r = talloc(talloc_tos(), struct lsa_LookupPrivValue); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, r); - } - - ZERO_STRUCT(r->out); - r->out.luid = talloc_zero(r, struct lsa_LUID); - if (r->out.luid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupPrivValue(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupPrivName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupPrivName *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVNAME]; - - r = talloc(talloc_tos(), struct lsa_LookupPrivName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, r); - } - - ZERO_STRUCT(r->out); - r->out.name = talloc_zero(r, struct lsa_StringLarge *); - if (r->out.name == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupPrivName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupPrivDisplayName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupPrivDisplayName *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVDISPLAYNAME]; - - r = talloc(talloc_tos(), struct lsa_LookupPrivDisplayName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, r); - } - - ZERO_STRUCT(r->out); - r->out.disp_name = talloc_zero(r, struct lsa_StringLarge *); - if (r->out.disp_name == NULL) { - talloc_free(r); - return false; - } - - r->out.returned_language_id = talloc_zero(r, uint16_t); - if (r->out.returned_language_id == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupPrivDisplayName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_DeleteObject(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_DeleteObject *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_DELETEOBJECT]; - - r = talloc(talloc_tos(), struct lsa_DeleteObject); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_DeleteObject, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = r->in.handle; - r->out.result = _lsa_DeleteObject(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_EnumAccountsWithUserRight(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_EnumAccountsWithUserRight *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT]; - - r = talloc(talloc_tos(), struct lsa_EnumAccountsWithUserRight); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, r); - } - - ZERO_STRUCT(r->out); - r->out.sids = talloc_zero(r, struct lsa_SidArray); - if (r->out.sids == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_EnumAccountsWithUserRight(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_EnumAccountRights(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_EnumAccountRights *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTRIGHTS]; - - r = talloc(talloc_tos(), struct lsa_EnumAccountRights); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, r); - } - - ZERO_STRUCT(r->out); - r->out.rights = talloc_zero(r, struct lsa_RightSet); - if (r->out.rights == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_EnumAccountRights(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_AddAccountRights(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_AddAccountRights *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_ADDACCOUNTRIGHTS]; - - r = talloc(talloc_tos(), struct lsa_AddAccountRights); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, r); - } - - r->out.result = _lsa_AddAccountRights(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_RemoveAccountRights(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_RemoveAccountRights *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEACCOUNTRIGHTS]; - - r = talloc(talloc_tos(), struct lsa_RemoveAccountRights); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, r); - } - - r->out.result = _lsa_RemoveAccountRights(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_QueryTrustedDomainInfoBySid *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID]; - - r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfoBySid); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_QueryTrustedDomainInfoBySid(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetTrustedDomainInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetTrustedDomainInfo *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFO]; - - r = talloc(talloc_tos(), struct lsa_SetTrustedDomainInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, r); - } - - r->out.result = _lsa_SetTrustedDomainInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_DeleteTrustedDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_DeleteTrustedDomain *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_DELETETRUSTEDDOMAIN]; - - r = talloc(talloc_tos(), struct lsa_DeleteTrustedDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, r); - } - - r->out.result = _lsa_DeleteTrustedDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_StorePrivateData(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_StorePrivateData *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_STOREPRIVATEDATA]; - - r = talloc(talloc_tos(), struct lsa_StorePrivateData); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, r); - } - - r->out.result = _lsa_StorePrivateData(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_RetrievePrivateData(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_RetrievePrivateData *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_RETRIEVEPRIVATEDATA]; - - r = talloc(talloc_tos(), struct lsa_RetrievePrivateData); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, r); - } - - r->out.result = _lsa_RetrievePrivateData(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_OpenPolicy2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_OpenPolicy2 *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY2]; - - r = talloc(talloc_tos(), struct lsa_OpenPolicy2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_OpenPolicy2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_GetUserName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_GetUserName *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_GETUSERNAME]; - - r = talloc(talloc_tos(), struct lsa_GetUserName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_GetUserName, r); - } - - ZERO_STRUCT(r->out); - r->out.account_name = r->in.account_name; - r->out.authority_name = r->in.authority_name; - r->out.result = _lsa_GetUserName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_GetUserName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_QueryInfoPolicy2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_QueryInfoPolicy2 *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY2]; - - r = talloc(talloc_tos(), struct lsa_QueryInfoPolicy2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union lsa_PolicyInformation *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_QueryInfoPolicy2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetInfoPolicy2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetInfoPolicy2 *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY2]; - - r = talloc(talloc_tos(), struct lsa_SetInfoPolicy2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, r); - } - - r->out.result = _lsa_SetInfoPolicy2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_QueryTrustedDomainInfoByName *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME]; - - r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfoByName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_QueryTrustedDomainInfoByName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetTrustedDomainInfoByName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetTrustedDomainInfoByName *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFOBYNAME]; - - r = talloc(talloc_tos(), struct lsa_SetTrustedDomainInfoByName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, r); - } - - r->out.result = _lsa_SetTrustedDomainInfoByName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_EnumTrustedDomainsEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_EnumTrustedDomainsEx *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTEDDOMAINSEX]; - - r = talloc(talloc_tos(), struct lsa_EnumTrustedDomainsEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.domains = talloc_zero(r, struct lsa_DomainListEx); - if (r->out.domains == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_EnumTrustedDomainsEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CreateTrustedDomainEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CreateTrustedDomainEx *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX]; - - r = talloc(talloc_tos(), struct lsa_CreateTrustedDomainEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, r); - } - - ZERO_STRUCT(r->out); - r->out.trustdom_handle = talloc_zero(r, struct policy_handle); - if (r->out.trustdom_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_CreateTrustedDomainEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CloseTrustedDomainEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CloseTrustedDomainEx *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSETRUSTEDDOMAINEX]; - - r = talloc(talloc_tos(), struct lsa_CloseTrustedDomainEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = r->in.handle; - r->out.result = _lsa_CloseTrustedDomainEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_QueryDomainInformationPolicy(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_QueryDomainInformationPolicy *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYDOMAININFORMATIONPOLICY]; - - r = talloc(talloc_tos(), struct lsa_QueryDomainInformationPolicy); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union lsa_DomainInformationPolicy *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_QueryDomainInformationPolicy(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_SetDomainInformationPolicy(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_SetDomainInformationPolicy *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_SETDOMAININFORMATIONPOLICY]; - - r = talloc(talloc_tos(), struct lsa_SetDomainInformationPolicy); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, r); - } - - r->out.result = _lsa_SetDomainInformationPolicy(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_OpenTrustedDomainByName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_OpenTrustedDomainByName *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAINBYNAME]; - - r = talloc(talloc_tos(), struct lsa_OpenTrustedDomainByName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, r); - } - - ZERO_STRUCT(r->out); - r->out.trustdom_handle = talloc_zero(r, struct policy_handle); - if (r->out.trustdom_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_OpenTrustedDomainByName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_TestCall(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_TestCall *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_TESTCALL]; - - r = talloc(talloc_tos(), struct lsa_TestCall); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_TestCall, r); - } - - r->out.result = _lsa_TestCall(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_TestCall, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupSids2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupSids2 *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS2]; - - r = talloc(talloc_tos(), struct lsa_LookupSids2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupSids2, r); - } - - ZERO_STRUCT(r->out); - r->out.names = r->in.names; - r->out.count = r->in.count; - r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); - if (r->out.domains == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupSids2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupNames2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupNames2 *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES2]; - - r = talloc(talloc_tos(), struct lsa_LookupNames2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupNames2, r); - } - - ZERO_STRUCT(r->out); - r->out.sids = r->in.sids; - r->out.count = r->in.count; - r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); - if (r->out.domains == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupNames2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CreateTrustedDomainEx2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CreateTrustedDomainEx2 *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX2]; - - r = talloc(talloc_tos(), struct lsa_CreateTrustedDomainEx2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, r); - } - - ZERO_STRUCT(r->out); - r->out.trustdom_handle = talloc_zero(r, struct policy_handle); - if (r->out.trustdom_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_CreateTrustedDomainEx2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRWRITE(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRWRITE *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITE]; - - r = talloc(talloc_tos(), struct lsa_CREDRWRITE); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, r); - } - - r->out.result = _lsa_CREDRWRITE(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRREAD(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRREAD *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREAD]; - - r = talloc(talloc_tos(), struct lsa_CREDRREAD); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, r); - } - - r->out.result = _lsa_CREDRREAD(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRENUMERATE(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRENUMERATE *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRENUMERATE]; - - r = talloc(talloc_tos(), struct lsa_CREDRENUMERATE); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, r); - } - - r->out.result = _lsa_CREDRENUMERATE(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRWRITEDOMAINCREDENTIALS *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITEDOMAINCREDENTIALS]; - - r = talloc(talloc_tos(), struct lsa_CREDRWRITEDOMAINCREDENTIALS); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, r); - } - - r->out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRREADDOMAINCREDENTIALS *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREADDOMAINCREDENTIALS]; - - r = talloc(talloc_tos(), struct lsa_CREDRREADDOMAINCREDENTIALS); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, r); - } - - r->out.result = _lsa_CREDRREADDOMAINCREDENTIALS(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRDELETE(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRDELETE *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRDELETE]; - - r = talloc(talloc_tos(), struct lsa_CREDRDELETE); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, r); - } - - r->out.result = _lsa_CREDRDELETE(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRGETTARGETINFO(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRGETTARGETINFO *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETTARGETINFO]; - - r = talloc(talloc_tos(), struct lsa_CREDRGETTARGETINFO); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, r); - } - - r->out.result = _lsa_CREDRGETTARGETINFO(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRPROFILELOADED(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRPROFILELOADED *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRPROFILELOADED]; - - r = talloc(talloc_tos(), struct lsa_CREDRPROFILELOADED); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, r); - } - - r->out.result = _lsa_CREDRPROFILELOADED(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupNames3(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupNames3 *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES3]; - - r = talloc(talloc_tos(), struct lsa_LookupNames3); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupNames3, r); - } - - ZERO_STRUCT(r->out); - r->out.sids = r->in.sids; - r->out.count = r->in.count; - r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); - if (r->out.domains == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupNames3(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRGETSESSIONTYPES *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETSESSIONTYPES]; - - r = talloc(talloc_tos(), struct lsa_CREDRGETSESSIONTYPES); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, r); - } - - r->out.result = _lsa_CREDRGETSESSIONTYPES(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LSARREGISTERAUDITEVENT *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LSARREGISTERAUDITEVENT]; - - r = talloc(talloc_tos(), struct lsa_LSARREGISTERAUDITEVENT); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, r); - } - - r->out.result = _lsa_LSARREGISTERAUDITEVENT(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LSARGENAUDITEVENT(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LSARGENAUDITEVENT *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LSARGENAUDITEVENT]; - - r = talloc(talloc_tos(), struct lsa_LSARGENAUDITEVENT); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, r); - } - - r->out.result = _lsa_LSARGENAUDITEVENT(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LSARUNREGISTERAUDITEVENT *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LSARUNREGISTERAUDITEVENT]; - - r = talloc(talloc_tos(), struct lsa_LSARUNREGISTERAUDITEVENT); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, r); - } - - r->out.result = _lsa_LSARUNREGISTERAUDITEVENT(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_lsaRQueryForestTrustInformation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_lsaRQueryForestTrustInformation *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION]; - - r = talloc(talloc_tos(), struct lsa_lsaRQueryForestTrustInformation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, r); - } - - ZERO_STRUCT(r->out); - r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *); - if (r->out.forest_trust_info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_lsaRQueryForestTrustInformation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LSARSETFORESTTRUSTINFORMATION *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LSARSETFORESTTRUSTINFORMATION]; - - r = talloc(talloc_tos(), struct lsa_LSARSETFORESTTRUSTINFORMATION); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, r); - } - - r->out.result = _lsa_LSARSETFORESTTRUSTINFORMATION(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_CREDRRENAME(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_CREDRRENAME *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRRENAME]; - - r = talloc(talloc_tos(), struct lsa_CREDRRENAME); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, r); - } - - r->out.result = _lsa_CREDRRENAME(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupSids3(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupSids3 *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS3]; - - r = talloc(talloc_tos(), struct lsa_LookupSids3); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupSids3, r); - } - - ZERO_STRUCT(r->out); - r->out.names = r->in.names; - r->out.count = r->in.count; - r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); - if (r->out.domains == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupSids3(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LookupNames4(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LookupNames4 *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES4]; - - r = talloc(talloc_tos(), struct lsa_LookupNames4); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LookupNames4, r); - } - - ZERO_STRUCT(r->out); - r->out.sids = r->in.sids; - r->out.count = r->in.count; - r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); - if (r->out.domains == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _lsa_LookupNames4(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LSAROPENPOLICYSCE(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LSAROPENPOLICYSCE *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LSAROPENPOLICYSCE]; - - r = talloc(talloc_tos(), struct lsa_LSAROPENPOLICYSCE); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSAROPENPOLICYSCE, r); - } - - r->out.result = _lsa_LSAROPENPOLICYSCE(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE]; - - r = talloc(talloc_tos(), struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, r); - } - - r->out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE]; - - r = talloc(talloc_tos(), struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, r); - } - - r->out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct lsa_LSARADTREPORTSECURITYEVENT *r; - - call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREPORTSECURITYEVENT]; - - r = talloc(talloc_tos(), struct lsa_LSARADTREPORTSECURITYEVENT); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, r); - } - - r->out.result = _lsa_LSARADTREPORTSECURITYEVENT(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_lsarpc_cmds[] = -{ - {"LSA_CLOSE", NDR_LSA_CLOSE, api_lsa_Close}, - {"LSA_DELETE", NDR_LSA_DELETE, api_lsa_Delete}, - {"LSA_ENUMPRIVS", NDR_LSA_ENUMPRIVS, api_lsa_EnumPrivs}, - {"LSA_QUERYSECURITY", NDR_LSA_QUERYSECURITY, api_lsa_QuerySecurity}, - {"LSA_SETSECOBJ", NDR_LSA_SETSECOBJ, api_lsa_SetSecObj}, - {"LSA_CHANGEPASSWORD", NDR_LSA_CHANGEPASSWORD, api_lsa_ChangePassword}, - {"LSA_OPENPOLICY", NDR_LSA_OPENPOLICY, api_lsa_OpenPolicy}, - {"LSA_QUERYINFOPOLICY", NDR_LSA_QUERYINFOPOLICY, api_lsa_QueryInfoPolicy}, - {"LSA_SETINFOPOLICY", NDR_LSA_SETINFOPOLICY, api_lsa_SetInfoPolicy}, - {"LSA_CLEARAUDITLOG", NDR_LSA_CLEARAUDITLOG, api_lsa_ClearAuditLog}, - {"LSA_CREATEACCOUNT", NDR_LSA_CREATEACCOUNT, api_lsa_CreateAccount}, - {"LSA_ENUMACCOUNTS", NDR_LSA_ENUMACCOUNTS, api_lsa_EnumAccounts}, - {"LSA_CREATETRUSTEDDOMAIN", NDR_LSA_CREATETRUSTEDDOMAIN, api_lsa_CreateTrustedDomain}, - {"LSA_ENUMTRUSTDOM", NDR_LSA_ENUMTRUSTDOM, api_lsa_EnumTrustDom}, - {"LSA_LOOKUPNAMES", NDR_LSA_LOOKUPNAMES, api_lsa_LookupNames}, - {"LSA_LOOKUPSIDS", NDR_LSA_LOOKUPSIDS, api_lsa_LookupSids}, - {"LSA_CREATESECRET", NDR_LSA_CREATESECRET, api_lsa_CreateSecret}, - {"LSA_OPENACCOUNT", NDR_LSA_OPENACCOUNT, api_lsa_OpenAccount}, - {"LSA_ENUMPRIVSACCOUNT", NDR_LSA_ENUMPRIVSACCOUNT, api_lsa_EnumPrivsAccount}, - {"LSA_ADDPRIVILEGESTOACCOUNT", NDR_LSA_ADDPRIVILEGESTOACCOUNT, api_lsa_AddPrivilegesToAccount}, - {"LSA_REMOVEPRIVILEGESFROMACCOUNT", NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT, api_lsa_RemovePrivilegesFromAccount}, - {"LSA_GETQUOTASFORACCOUNT", NDR_LSA_GETQUOTASFORACCOUNT, api_lsa_GetQuotasForAccount}, - {"LSA_SETQUOTASFORACCOUNT", NDR_LSA_SETQUOTASFORACCOUNT, api_lsa_SetQuotasForAccount}, - {"LSA_GETSYSTEMACCESSACCOUNT", NDR_LSA_GETSYSTEMACCESSACCOUNT, api_lsa_GetSystemAccessAccount}, - {"LSA_SETSYSTEMACCESSACCOUNT", NDR_LSA_SETSYSTEMACCESSACCOUNT, api_lsa_SetSystemAccessAccount}, - {"LSA_OPENTRUSTEDDOMAIN", NDR_LSA_OPENTRUSTEDDOMAIN, api_lsa_OpenTrustedDomain}, - {"LSA_QUERYTRUSTEDDOMAININFO", NDR_LSA_QUERYTRUSTEDDOMAININFO, api_lsa_QueryTrustedDomainInfo}, - {"LSA_SETINFORMATIONTRUSTEDDOMAIN", NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN, api_lsa_SetInformationTrustedDomain}, - {"LSA_OPENSECRET", NDR_LSA_OPENSECRET, api_lsa_OpenSecret}, - {"LSA_SETSECRET", NDR_LSA_SETSECRET, api_lsa_SetSecret}, - {"LSA_QUERYSECRET", NDR_LSA_QUERYSECRET, api_lsa_QuerySecret}, - {"LSA_LOOKUPPRIVVALUE", NDR_LSA_LOOKUPPRIVVALUE, api_lsa_LookupPrivValue}, - {"LSA_LOOKUPPRIVNAME", NDR_LSA_LOOKUPPRIVNAME, api_lsa_LookupPrivName}, - {"LSA_LOOKUPPRIVDISPLAYNAME", NDR_LSA_LOOKUPPRIVDISPLAYNAME, api_lsa_LookupPrivDisplayName}, - {"LSA_DELETEOBJECT", NDR_LSA_DELETEOBJECT, api_lsa_DeleteObject}, - {"LSA_ENUMACCOUNTSWITHUSERRIGHT", NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT, api_lsa_EnumAccountsWithUserRight}, - {"LSA_ENUMACCOUNTRIGHTS", NDR_LSA_ENUMACCOUNTRIGHTS, api_lsa_EnumAccountRights}, - {"LSA_ADDACCOUNTRIGHTS", NDR_LSA_ADDACCOUNTRIGHTS, api_lsa_AddAccountRights}, - {"LSA_REMOVEACCOUNTRIGHTS", NDR_LSA_REMOVEACCOUNTRIGHTS, api_lsa_RemoveAccountRights}, - {"LSA_QUERYTRUSTEDDOMAININFOBYSID", NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID, api_lsa_QueryTrustedDomainInfoBySid}, - {"LSA_SETTRUSTEDDOMAININFO", NDR_LSA_SETTRUSTEDDOMAININFO, api_lsa_SetTrustedDomainInfo}, - {"LSA_DELETETRUSTEDDOMAIN", NDR_LSA_DELETETRUSTEDDOMAIN, api_lsa_DeleteTrustedDomain}, - {"LSA_STOREPRIVATEDATA", NDR_LSA_STOREPRIVATEDATA, api_lsa_StorePrivateData}, - {"LSA_RETRIEVEPRIVATEDATA", NDR_LSA_RETRIEVEPRIVATEDATA, api_lsa_RetrievePrivateData}, - {"LSA_OPENPOLICY2", NDR_LSA_OPENPOLICY2, api_lsa_OpenPolicy2}, - {"LSA_GETUSERNAME", NDR_LSA_GETUSERNAME, api_lsa_GetUserName}, - {"LSA_QUERYINFOPOLICY2", NDR_LSA_QUERYINFOPOLICY2, api_lsa_QueryInfoPolicy2}, - {"LSA_SETINFOPOLICY2", NDR_LSA_SETINFOPOLICY2, api_lsa_SetInfoPolicy2}, - {"LSA_QUERYTRUSTEDDOMAININFOBYNAME", NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME, api_lsa_QueryTrustedDomainInfoByName}, - {"LSA_SETTRUSTEDDOMAININFOBYNAME", NDR_LSA_SETTRUSTEDDOMAININFOBYNAME, api_lsa_SetTrustedDomainInfoByName}, - {"LSA_ENUMTRUSTEDDOMAINSEX", NDR_LSA_ENUMTRUSTEDDOMAINSEX, api_lsa_EnumTrustedDomainsEx}, - {"LSA_CREATETRUSTEDDOMAINEX", NDR_LSA_CREATETRUSTEDDOMAINEX, api_lsa_CreateTrustedDomainEx}, - {"LSA_CLOSETRUSTEDDOMAINEX", NDR_LSA_CLOSETRUSTEDDOMAINEX, api_lsa_CloseTrustedDomainEx}, - {"LSA_QUERYDOMAININFORMATIONPOLICY", NDR_LSA_QUERYDOMAININFORMATIONPOLICY, api_lsa_QueryDomainInformationPolicy}, - {"LSA_SETDOMAININFORMATIONPOLICY", NDR_LSA_SETDOMAININFORMATIONPOLICY, api_lsa_SetDomainInformationPolicy}, - {"LSA_OPENTRUSTEDDOMAINBYNAME", NDR_LSA_OPENTRUSTEDDOMAINBYNAME, api_lsa_OpenTrustedDomainByName}, - {"LSA_TESTCALL", NDR_LSA_TESTCALL, api_lsa_TestCall}, - {"LSA_LOOKUPSIDS2", NDR_LSA_LOOKUPSIDS2, api_lsa_LookupSids2}, - {"LSA_LOOKUPNAMES2", NDR_LSA_LOOKUPNAMES2, api_lsa_LookupNames2}, - {"LSA_CREATETRUSTEDDOMAINEX2", NDR_LSA_CREATETRUSTEDDOMAINEX2, api_lsa_CreateTrustedDomainEx2}, - {"LSA_CREDRWRITE", NDR_LSA_CREDRWRITE, api_lsa_CREDRWRITE}, - {"LSA_CREDRREAD", NDR_LSA_CREDRREAD, api_lsa_CREDRREAD}, - {"LSA_CREDRENUMERATE", NDR_LSA_CREDRENUMERATE, api_lsa_CREDRENUMERATE}, - {"LSA_CREDRWRITEDOMAINCREDENTIALS", NDR_LSA_CREDRWRITEDOMAINCREDENTIALS, api_lsa_CREDRWRITEDOMAINCREDENTIALS}, - {"LSA_CREDRREADDOMAINCREDENTIALS", NDR_LSA_CREDRREADDOMAINCREDENTIALS, api_lsa_CREDRREADDOMAINCREDENTIALS}, - {"LSA_CREDRDELETE", NDR_LSA_CREDRDELETE, api_lsa_CREDRDELETE}, - {"LSA_CREDRGETTARGETINFO", NDR_LSA_CREDRGETTARGETINFO, api_lsa_CREDRGETTARGETINFO}, - {"LSA_CREDRPROFILELOADED", NDR_LSA_CREDRPROFILELOADED, api_lsa_CREDRPROFILELOADED}, - {"LSA_LOOKUPNAMES3", NDR_LSA_LOOKUPNAMES3, api_lsa_LookupNames3}, - {"LSA_CREDRGETSESSIONTYPES", NDR_LSA_CREDRGETSESSIONTYPES, api_lsa_CREDRGETSESSIONTYPES}, - {"LSA_LSARREGISTERAUDITEVENT", NDR_LSA_LSARREGISTERAUDITEVENT, api_lsa_LSARREGISTERAUDITEVENT}, - {"LSA_LSARGENAUDITEVENT", NDR_LSA_LSARGENAUDITEVENT, api_lsa_LSARGENAUDITEVENT}, - {"LSA_LSARUNREGISTERAUDITEVENT", NDR_LSA_LSARUNREGISTERAUDITEVENT, api_lsa_LSARUNREGISTERAUDITEVENT}, - {"LSA_LSARQUERYFORESTTRUSTINFORMATION", NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION, api_lsa_lsaRQueryForestTrustInformation}, - {"LSA_LSARSETFORESTTRUSTINFORMATION", NDR_LSA_LSARSETFORESTTRUSTINFORMATION, api_lsa_LSARSETFORESTTRUSTINFORMATION}, - {"LSA_CREDRRENAME", NDR_LSA_CREDRRENAME, api_lsa_CREDRRENAME}, - {"LSA_LOOKUPSIDS3", NDR_LSA_LOOKUPSIDS3, api_lsa_LookupSids3}, - {"LSA_LOOKUPNAMES4", NDR_LSA_LOOKUPNAMES4, api_lsa_LookupNames4}, - {"LSA_LSAROPENPOLICYSCE", NDR_LSA_LSAROPENPOLICYSCE, api_lsa_LSAROPENPOLICYSCE}, - {"LSA_LSARADTREGISTERSECURITYEVENTSOURCE", NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE}, - {"LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE", NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE}, - {"LSA_LSARADTREPORTSECURITYEVENT", NDR_LSA_LSARADTREPORTSECURITYEVENT, api_lsa_LSARADTREPORTSECURITYEVENT}, -}; - -void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_lsarpc_cmds; - *n_fns = sizeof(api_lsarpc_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_lsarpc_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "lsarpc", "lsarpc", &ndr_table_lsarpc.syntax_id, api_lsarpc_cmds, sizeof(api_lsarpc_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_lsa.h b/source3/librpc/gen_ndr/srv_lsa.h deleted file mode 100644 index 223ee5e970..0000000000 --- a/source3/librpc/gen_ndr/srv_lsa.h +++ /dev/null @@ -1,88 +0,0 @@ -#include "librpc/gen_ndr/ndr_lsa.h" -#ifndef __SRV_LSARPC__ -#define __SRV_LSARPC__ -NTSTATUS _lsa_Close(pipes_struct *p, struct lsa_Close *r); -NTSTATUS _lsa_Delete(pipes_struct *p, struct lsa_Delete *r); -NTSTATUS _lsa_EnumPrivs(pipes_struct *p, struct lsa_EnumPrivs *r); -NTSTATUS _lsa_QuerySecurity(pipes_struct *p, struct lsa_QuerySecurity *r); -NTSTATUS _lsa_SetSecObj(pipes_struct *p, struct lsa_SetSecObj *r); -NTSTATUS _lsa_ChangePassword(pipes_struct *p, struct lsa_ChangePassword *r); -NTSTATUS _lsa_OpenPolicy(pipes_struct *p, struct lsa_OpenPolicy *r); -NTSTATUS _lsa_QueryInfoPolicy(pipes_struct *p, struct lsa_QueryInfoPolicy *r); -NTSTATUS _lsa_SetInfoPolicy(pipes_struct *p, struct lsa_SetInfoPolicy *r); -NTSTATUS _lsa_ClearAuditLog(pipes_struct *p, struct lsa_ClearAuditLog *r); -NTSTATUS _lsa_CreateAccount(pipes_struct *p, struct lsa_CreateAccount *r); -NTSTATUS _lsa_EnumAccounts(pipes_struct *p, struct lsa_EnumAccounts *r); -NTSTATUS _lsa_CreateTrustedDomain(pipes_struct *p, struct lsa_CreateTrustedDomain *r); -NTSTATUS _lsa_EnumTrustDom(pipes_struct *p, struct lsa_EnumTrustDom *r); -NTSTATUS _lsa_LookupNames(pipes_struct *p, struct lsa_LookupNames *r); -NTSTATUS _lsa_LookupSids(pipes_struct *p, struct lsa_LookupSids *r); -NTSTATUS _lsa_CreateSecret(pipes_struct *p, struct lsa_CreateSecret *r); -NTSTATUS _lsa_OpenAccount(pipes_struct *p, struct lsa_OpenAccount *r); -NTSTATUS _lsa_EnumPrivsAccount(pipes_struct *p, struct lsa_EnumPrivsAccount *r); -NTSTATUS _lsa_AddPrivilegesToAccount(pipes_struct *p, struct lsa_AddPrivilegesToAccount *r); -NTSTATUS _lsa_RemovePrivilegesFromAccount(pipes_struct *p, struct lsa_RemovePrivilegesFromAccount *r); -NTSTATUS _lsa_GetQuotasForAccount(pipes_struct *p, struct lsa_GetQuotasForAccount *r); -NTSTATUS _lsa_SetQuotasForAccount(pipes_struct *p, struct lsa_SetQuotasForAccount *r); -NTSTATUS _lsa_GetSystemAccessAccount(pipes_struct *p, struct lsa_GetSystemAccessAccount *r); -NTSTATUS _lsa_SetSystemAccessAccount(pipes_struct *p, struct lsa_SetSystemAccessAccount *r); -NTSTATUS _lsa_OpenTrustedDomain(pipes_struct *p, struct lsa_OpenTrustedDomain *r); -NTSTATUS _lsa_QueryTrustedDomainInfo(pipes_struct *p, struct lsa_QueryTrustedDomainInfo *r); -NTSTATUS _lsa_SetInformationTrustedDomain(pipes_struct *p, struct lsa_SetInformationTrustedDomain *r); -NTSTATUS _lsa_OpenSecret(pipes_struct *p, struct lsa_OpenSecret *r); -NTSTATUS _lsa_SetSecret(pipes_struct *p, struct lsa_SetSecret *r); -NTSTATUS _lsa_QuerySecret(pipes_struct *p, struct lsa_QuerySecret *r); -NTSTATUS _lsa_LookupPrivValue(pipes_struct *p, struct lsa_LookupPrivValue *r); -NTSTATUS _lsa_LookupPrivName(pipes_struct *p, struct lsa_LookupPrivName *r); -NTSTATUS _lsa_LookupPrivDisplayName(pipes_struct *p, struct lsa_LookupPrivDisplayName *r); -NTSTATUS _lsa_DeleteObject(pipes_struct *p, struct lsa_DeleteObject *r); -NTSTATUS _lsa_EnumAccountsWithUserRight(pipes_struct *p, struct lsa_EnumAccountsWithUserRight *r); -NTSTATUS _lsa_EnumAccountRights(pipes_struct *p, struct lsa_EnumAccountRights *r); -NTSTATUS _lsa_AddAccountRights(pipes_struct *p, struct lsa_AddAccountRights *r); -NTSTATUS _lsa_RemoveAccountRights(pipes_struct *p, struct lsa_RemoveAccountRights *r); -NTSTATUS _lsa_QueryTrustedDomainInfoBySid(pipes_struct *p, struct lsa_QueryTrustedDomainInfoBySid *r); -NTSTATUS _lsa_SetTrustedDomainInfo(pipes_struct *p, struct lsa_SetTrustedDomainInfo *r); -NTSTATUS _lsa_DeleteTrustedDomain(pipes_struct *p, struct lsa_DeleteTrustedDomain *r); -NTSTATUS _lsa_StorePrivateData(pipes_struct *p, struct lsa_StorePrivateData *r); -NTSTATUS _lsa_RetrievePrivateData(pipes_struct *p, struct lsa_RetrievePrivateData *r); -NTSTATUS _lsa_OpenPolicy2(pipes_struct *p, struct lsa_OpenPolicy2 *r); -NTSTATUS _lsa_GetUserName(pipes_struct *p, struct lsa_GetUserName *r); -NTSTATUS _lsa_QueryInfoPolicy2(pipes_struct *p, struct lsa_QueryInfoPolicy2 *r); -NTSTATUS _lsa_SetInfoPolicy2(pipes_struct *p, struct lsa_SetInfoPolicy2 *r); -NTSTATUS _lsa_QueryTrustedDomainInfoByName(pipes_struct *p, struct lsa_QueryTrustedDomainInfoByName *r); -NTSTATUS _lsa_SetTrustedDomainInfoByName(pipes_struct *p, struct lsa_SetTrustedDomainInfoByName *r); -NTSTATUS _lsa_EnumTrustedDomainsEx(pipes_struct *p, struct lsa_EnumTrustedDomainsEx *r); -NTSTATUS _lsa_CreateTrustedDomainEx(pipes_struct *p, struct lsa_CreateTrustedDomainEx *r); -NTSTATUS _lsa_CloseTrustedDomainEx(pipes_struct *p, struct lsa_CloseTrustedDomainEx *r); -NTSTATUS _lsa_QueryDomainInformationPolicy(pipes_struct *p, struct lsa_QueryDomainInformationPolicy *r); -NTSTATUS _lsa_SetDomainInformationPolicy(pipes_struct *p, struct lsa_SetDomainInformationPolicy *r); -NTSTATUS _lsa_OpenTrustedDomainByName(pipes_struct *p, struct lsa_OpenTrustedDomainByName *r); -NTSTATUS _lsa_TestCall(pipes_struct *p, struct lsa_TestCall *r); -NTSTATUS _lsa_LookupSids2(pipes_struct *p, struct lsa_LookupSids2 *r); -NTSTATUS _lsa_LookupNames2(pipes_struct *p, struct lsa_LookupNames2 *r); -NTSTATUS _lsa_CreateTrustedDomainEx2(pipes_struct *p, struct lsa_CreateTrustedDomainEx2 *r); -NTSTATUS _lsa_CREDRWRITE(pipes_struct *p, struct lsa_CREDRWRITE *r); -NTSTATUS _lsa_CREDRREAD(pipes_struct *p, struct lsa_CREDRREAD *r); -NTSTATUS _lsa_CREDRENUMERATE(pipes_struct *p, struct lsa_CREDRENUMERATE *r); -NTSTATUS _lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p, struct lsa_CREDRWRITEDOMAINCREDENTIALS *r); -NTSTATUS _lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p, struct lsa_CREDRREADDOMAINCREDENTIALS *r); -NTSTATUS _lsa_CREDRDELETE(pipes_struct *p, struct lsa_CREDRDELETE *r); -NTSTATUS _lsa_CREDRGETTARGETINFO(pipes_struct *p, struct lsa_CREDRGETTARGETINFO *r); -NTSTATUS _lsa_CREDRPROFILELOADED(pipes_struct *p, struct lsa_CREDRPROFILELOADED *r); -NTSTATUS _lsa_LookupNames3(pipes_struct *p, struct lsa_LookupNames3 *r); -NTSTATUS _lsa_CREDRGETSESSIONTYPES(pipes_struct *p, struct lsa_CREDRGETSESSIONTYPES *r); -NTSTATUS _lsa_LSARREGISTERAUDITEVENT(pipes_struct *p, struct lsa_LSARREGISTERAUDITEVENT *r); -NTSTATUS _lsa_LSARGENAUDITEVENT(pipes_struct *p, struct lsa_LSARGENAUDITEVENT *r); -NTSTATUS _lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p, struct lsa_LSARUNREGISTERAUDITEVENT *r); -NTSTATUS _lsa_lsaRQueryForestTrustInformation(pipes_struct *p, struct lsa_lsaRQueryForestTrustInformation *r); -NTSTATUS _lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p, struct lsa_LSARSETFORESTTRUSTINFORMATION *r); -NTSTATUS _lsa_CREDRRENAME(pipes_struct *p, struct lsa_CREDRRENAME *r); -NTSTATUS _lsa_LookupSids3(pipes_struct *p, struct lsa_LookupSids3 *r); -NTSTATUS _lsa_LookupNames4(pipes_struct *p, struct lsa_LookupNames4 *r); -NTSTATUS _lsa_LSAROPENPOLICYSCE(pipes_struct *p, struct lsa_LSAROPENPOLICYSCE *r); -NTSTATUS _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p, struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r); -NTSTATUS _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p, struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r); -NTSTATUS _lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p, struct lsa_LSARADTREPORTSECURITYEVENT *r); -void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_lsarpc_init(void); -#endif /* __SRV_LSARPC__ */ diff --git a/source3/librpc/gen_ndr/srv_netlogon.c b/source3/librpc/gen_ndr/srv_netlogon.c deleted file mode 100644 index 8cb461e94d..0000000000 --- a/source3/librpc/gen_ndr/srv_netlogon.c +++ /dev/null @@ -1,3896 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_netlogon.h" - -static bool api_netr_LogonUasLogon(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonUasLogon *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGON]; - - r = talloc(talloc_tos(), struct netr_LogonUasLogon); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonUasLogon, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct netr_UasInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonUasLogon(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonUasLogoff(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonUasLogoff *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGOFF]; - - r = talloc(talloc_tos(), struct netr_LogonUasLogoff); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct netr_UasLogoffInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonUasLogoff(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonSamLogon(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonSamLogon *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGON]; - - r = talloc(talloc_tos(), struct netr_LogonSamLogon); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.validation = talloc_zero(r, union netr_Validation); - if (r->out.validation == NULL) { - talloc_free(r); - return false; - } - - r->out.authoritative = talloc_zero(r, uint8_t); - if (r->out.authoritative == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonSamLogon(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonSamLogoff(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonSamLogoff *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGOFF]; - - r = talloc(talloc_tos(), struct netr_LogonSamLogoff); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.result = _netr_LogonSamLogoff(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_ServerReqChallenge(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_ServerReqChallenge *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_SERVERREQCHALLENGE]; - - r = talloc(talloc_tos(), struct netr_ServerReqChallenge); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, r); - } - - ZERO_STRUCT(r->out); - r->out.return_credentials = talloc_zero(r, struct netr_Credential); - if (r->out.return_credentials == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_ServerReqChallenge(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_ServerAuthenticate(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_ServerAuthenticate *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE]; - - r = talloc(talloc_tos(), struct netr_ServerAuthenticate); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, r); - } - - ZERO_STRUCT(r->out); - r->out.return_credentials = talloc_zero(r, struct netr_Credential); - if (r->out.return_credentials == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_ServerAuthenticate(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_ServerPasswordSet(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_ServerPasswordSet *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET]; - - r = talloc(talloc_tos(), struct netr_ServerPasswordSet); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); - if (r->out.return_authenticator == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_ServerPasswordSet(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DatabaseDeltas(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DatabaseDeltas *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEDELTAS]; - - r = talloc(talloc_tos(), struct netr_DatabaseDeltas); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.sequence_num = r->in.sequence_num; - r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); - if (r->out.delta_enum_array == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DatabaseDeltas(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DatabaseSync(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DatabaseSync *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC]; - - r = talloc(talloc_tos(), struct netr_DatabaseSync); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DatabaseSync, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.sync_context = r->in.sync_context; - r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); - if (r->out.delta_enum_array == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DatabaseSync(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_AccountDeltas(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_AccountDeltas *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTDELTAS]; - - r = talloc(talloc_tos(), struct netr_AccountDeltas); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_AccountDeltas, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.buffer = talloc_zero(r, struct netr_AccountBuffer); - if (r->out.buffer == NULL) { - talloc_free(r); - return false; - } - - r->out.count_returned = talloc_zero(r, uint32_t); - if (r->out.count_returned == NULL) { - talloc_free(r); - return false; - } - - r->out.total_entries = talloc_zero(r, uint32_t); - if (r->out.total_entries == NULL) { - talloc_free(r); - return false; - } - - r->out.recordid = talloc_zero(r, struct netr_UAS_INFO_0); - if (r->out.recordid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_AccountDeltas(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_AccountSync(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_AccountSync *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTSYNC]; - - r = talloc(talloc_tos(), struct netr_AccountSync); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_AccountSync, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.recordid = r->in.recordid; - r->out.buffer = talloc_zero(r, struct netr_AccountBuffer); - if (r->out.buffer == NULL) { - talloc_free(r); - return false; - } - - r->out.count_returned = talloc_zero(r, uint32_t); - if (r->out.count_returned == NULL) { - talloc_free(r); - return false; - } - - r->out.total_entries = talloc_zero(r, uint32_t); - if (r->out.total_entries == NULL) { - talloc_free(r); - return false; - } - - r->out.next_reference = talloc_zero(r, uint32_t); - if (r->out.next_reference == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_AccountSync(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_AccountSync, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_GetDcName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_GetDcName *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_GETDCNAME]; - - r = talloc(talloc_tos(), struct netr_GetDcName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_GetDcName, r); - } - - ZERO_STRUCT(r->out); - r->out.dcname = talloc_zero(r, const char *); - if (r->out.dcname == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_GetDcName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_GetDcName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonControl(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonControl *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL]; - - r = talloc(talloc_tos(), struct netr_LogonControl); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonControl, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonControl(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonControl, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_GetAnyDCName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_GetAnyDCName *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_GETANYDCNAME]; - - r = talloc(talloc_tos(), struct netr_GetAnyDCName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, r); - } - - ZERO_STRUCT(r->out); - r->out.dcname = talloc_zero(r, const char *); - if (r->out.dcname == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_GetAnyDCName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonControl2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonControl2 *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2]; - - r = talloc(talloc_tos(), struct netr_LogonControl2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonControl2, r); - } - - ZERO_STRUCT(r->out); - r->out.query = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION); - if (r->out.query == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonControl2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonControl2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_ServerAuthenticate2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_ServerAuthenticate2 *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE2]; - - r = talloc(talloc_tos(), struct netr_ServerAuthenticate2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, r); - } - - ZERO_STRUCT(r->out); - r->out.negotiate_flags = r->in.negotiate_flags; - r->out.return_credentials = talloc_zero(r, struct netr_Credential); - if (r->out.return_credentials == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_ServerAuthenticate2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DatabaseSync2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DatabaseSync2 *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC2]; - - r = talloc(talloc_tos(), struct netr_DatabaseSync2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.sync_context = r->in.sync_context; - r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); - if (r->out.delta_enum_array == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DatabaseSync2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DatabaseRedo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DatabaseRedo *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEREDO]; - - r = talloc(talloc_tos(), struct netr_DatabaseRedo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); - if (r->out.delta_enum_array == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DatabaseRedo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonControl2Ex(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonControl2Ex *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2EX]; - - r = talloc(talloc_tos(), struct netr_LogonControl2Ex); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, r); - } - - ZERO_STRUCT(r->out); - r->out.query = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION); - if (r->out.query == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonControl2Ex(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_NetrEnumerateTrustedDomains(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_NetrEnumerateTrustedDomains *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINS]; - - r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomains); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, r); - } - - ZERO_STRUCT(r->out); - r->out.trusted_domains_blob = talloc_zero(r, struct netr_Blob); - if (r->out.trusted_domains_blob == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_NetrEnumerateTrustedDomains(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsRGetDCName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsRGetDCName *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAME]; - - r = talloc(talloc_tos(), struct netr_DsRGetDCName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DsRGetDCName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_NETRLOGONDUMMYROUTINE1 *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONDUMMYROUTINE1]; - - r = talloc(talloc_tos(), struct netr_NETRLOGONDUMMYROUTINE1); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, r); - } - - r->out.result = _netr_NETRLOGONDUMMYROUTINE1(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_NETRLOGONSETSERVICEBITS *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSETSERVICEBITS]; - - r = talloc(talloc_tos(), struct netr_NETRLOGONSETSERVICEBITS); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, r); - } - - r->out.result = _netr_NETRLOGONSETSERVICEBITS(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonGetTrustRid(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonGetTrustRid *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETTRUSTRID]; - - r = talloc(talloc_tos(), struct netr_LogonGetTrustRid); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, r); - } - - ZERO_STRUCT(r->out); - r->out.rid = talloc_zero(r, uint32_t); - if (r->out.rid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonGetTrustRid(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_NETRLOGONCOMPUTESERVERDIGEST *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST]; - - r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTESERVERDIGEST); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, r); - } - - r->out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST]; - - r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTECLIENTDIGEST); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, r); - } - - r->out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_ServerAuthenticate3(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_ServerAuthenticate3 *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE3]; - - r = talloc(talloc_tos(), struct netr_ServerAuthenticate3); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, r); - } - - ZERO_STRUCT(r->out); - r->out.negotiate_flags = r->in.negotiate_flags; - r->out.return_credentials = talloc_zero(r, struct netr_Credential); - if (r->out.return_credentials == NULL) { - talloc_free(r); - return false; - } - - r->out.rid = talloc_zero(r, uint32_t); - if (r->out.rid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_ServerAuthenticate3(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsRGetDCNameEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsRGetDCNameEx *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX]; - - r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DsRGetDCNameEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsRGetSiteName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsRGetSiteName *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETSITENAME]; - - r = talloc(talloc_tos(), struct netr_DsRGetSiteName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, r); - } - - ZERO_STRUCT(r->out); - r->out.site = talloc_zero(r, const char *); - if (r->out.site == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DsRGetSiteName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonGetDomainInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonGetDomainInfo *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETDOMAININFO]; - - r = talloc(talloc_tos(), struct netr_LogonGetDomainInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.info = talloc_zero(r, union netr_DomainInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonGetDomainInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_ServerPasswordSet2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_ServerPasswordSet2 *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET2]; - - r = talloc(talloc_tos(), struct netr_ServerPasswordSet2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); - if (r->out.return_authenticator == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_ServerPasswordSet2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_ServerPasswordGet(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_ServerPasswordGet *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDGET]; - - r = talloc(talloc_tos(), struct netr_ServerPasswordGet); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); - if (r->out.return_authenticator == NULL) { - talloc_free(r); - return false; - } - - r->out.password = talloc_zero(r, struct samr_Password); - if (r->out.password == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_ServerPasswordGet(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_NETRLOGONSENDTOSAM(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_NETRLOGONSENDTOSAM *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSENDTOSAM]; - - r = talloc(talloc_tos(), struct netr_NETRLOGONSENDTOSAM); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, r); - } - - r->out.result = _netr_NETRLOGONSENDTOSAM(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsRAddressToSitenamesW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsRAddressToSitenamesW *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESW]; - - r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, r); - } - - ZERO_STRUCT(r->out); - r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesWCtr *); - if (r->out.ctr == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DsRAddressToSitenamesW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsRGetDCNameEx2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsRGetDCNameEx2 *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX2]; - - r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DsRGetDCNameEx2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN]; - - r = talloc(talloc_tos(), struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, r); - } - - r->out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_NetrEnumerateTrustedDomainsEx *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX]; - - r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomainsEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r); - } - - ZERO_STRUCT(r->out); - r->out.dom_trust_list = talloc_zero(r, struct netr_DomainTrustList); - if (r->out.dom_trust_list == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_NetrEnumerateTrustedDomainsEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsRAddressToSitenamesExW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsRAddressToSitenamesExW *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESEXW]; - - r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesExW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, r); - } - - ZERO_STRUCT(r->out); - r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesExWCtr *); - if (r->out.ctr == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DsRAddressToSitenamesExW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsrGetDcSiteCoverageW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsrGetDcSiteCoverageW *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCSITECOVERAGEW]; - - r = talloc(talloc_tos(), struct netr_DsrGetDcSiteCoverageW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, r); - } - - ZERO_STRUCT(r->out); - r->out.ctr = talloc_zero(r, struct DcSitesCtr *); - if (r->out.ctr == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DsrGetDcSiteCoverageW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonSamLogonEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonSamLogonEx *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONEX]; - - r = talloc(talloc_tos(), struct netr_LogonSamLogonEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, r); - } - - ZERO_STRUCT(r->out); - r->out.flags = r->in.flags; - r->out.validation = talloc_zero(r, union netr_Validation); - if (r->out.validation == NULL) { - talloc_free(r); - return false; - } - - r->out.authoritative = talloc_zero(r, uint8_t); - if (r->out.authoritative == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonSamLogonEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsrEnumerateDomainTrusts(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsrEnumerateDomainTrusts *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRENUMERATEDOMAINTRUSTS]; - - r = talloc(talloc_tos(), struct netr_DsrEnumerateDomainTrusts); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, r); - } - - ZERO_STRUCT(r->out); - r->out.trusts = talloc_zero(r, struct netr_DomainTrustList); - if (r->out.trusts == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DsrEnumerateDomainTrusts(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsrDeregisterDNSHostRecords(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsrDeregisterDNSHostRecords *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS]; - - r = talloc(talloc_tos(), struct netr_DsrDeregisterDNSHostRecords); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, r); - } - - r->out.result = _netr_DsrDeregisterDNSHostRecords(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_ServerTrustPasswordsGet(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_ServerTrustPasswordsGet *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_SERVERTRUSTPASSWORDSGET]; - - r = talloc(talloc_tos(), struct netr_ServerTrustPasswordsGet); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); - if (r->out.return_authenticator == NULL) { - talloc_free(r); - return false; - } - - r->out.password = talloc_zero(r, struct samr_Password); - if (r->out.password == NULL) { - talloc_free(r); - return false; - } - - r->out.password2 = talloc_zero(r, struct samr_Password); - if (r->out.password2 == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_ServerTrustPasswordsGet(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_DsRGetForestTrustInformation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_DsRGetForestTrustInformation *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETFORESTTRUSTINFORMATION]; - - r = talloc(talloc_tos(), struct netr_DsRGetForestTrustInformation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, r); - } - - ZERO_STRUCT(r->out); - r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *); - if (r->out.forest_trust_info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_DsRGetForestTrustInformation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_GetForestTrustInformation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_GetForestTrustInformation *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_GETFORESTTRUSTINFORMATION]; - - r = talloc(talloc_tos(), struct netr_GetForestTrustInformation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); - if (r->out.return_authenticator == NULL) { - talloc_free(r); - return false; - } - - r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *); - if (r->out.forest_trust_info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_GetForestTrustInformation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_LogonSamLogonWithFlags(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_LogonSamLogonWithFlags *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONWITHFLAGS]; - - r = talloc(talloc_tos(), struct netr_LogonSamLogonWithFlags); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = r->in.return_authenticator; - r->out.flags = r->in.flags; - r->out.validation = talloc_zero(r, union netr_Validation); - if (r->out.validation == NULL) { - talloc_free(r); - return false; - } - - r->out.authoritative = talloc_zero(r, uint8_t); - if (r->out.authoritative == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_LogonSamLogonWithFlags(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_netr_ServerGetTrustInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct netr_ServerGetTrustInfo *r; - - call = &ndr_table_netlogon.calls[NDR_NETR_SERVERGETTRUSTINFO]; - - r = talloc(talloc_tos(), struct netr_ServerGetTrustInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); - if (r->out.return_authenticator == NULL) { - talloc_free(r); - return false; - } - - r->out.new_owf_password = talloc_zero(r, struct samr_Password); - if (r->out.new_owf_password == NULL) { - talloc_free(r); - return false; - } - - r->out.old_owf_password = talloc_zero(r, struct samr_Password); - if (r->out.old_owf_password == NULL) { - talloc_free(r); - return false; - } - - r->out.trust_info = talloc_zero(r, struct netr_TrustInfo *); - if (r->out.trust_info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _netr_ServerGetTrustInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_netlogon_cmds[] = -{ - {"NETR_LOGONUASLOGON", NDR_NETR_LOGONUASLOGON, api_netr_LogonUasLogon}, - {"NETR_LOGONUASLOGOFF", NDR_NETR_LOGONUASLOGOFF, api_netr_LogonUasLogoff}, - {"NETR_LOGONSAMLOGON", NDR_NETR_LOGONSAMLOGON, api_netr_LogonSamLogon}, - {"NETR_LOGONSAMLOGOFF", NDR_NETR_LOGONSAMLOGOFF, api_netr_LogonSamLogoff}, - {"NETR_SERVERREQCHALLENGE", NDR_NETR_SERVERREQCHALLENGE, api_netr_ServerReqChallenge}, - {"NETR_SERVERAUTHENTICATE", NDR_NETR_SERVERAUTHENTICATE, api_netr_ServerAuthenticate}, - {"NETR_SERVERPASSWORDSET", NDR_NETR_SERVERPASSWORDSET, api_netr_ServerPasswordSet}, - {"NETR_DATABASEDELTAS", NDR_NETR_DATABASEDELTAS, api_netr_DatabaseDeltas}, - {"NETR_DATABASESYNC", NDR_NETR_DATABASESYNC, api_netr_DatabaseSync}, - {"NETR_ACCOUNTDELTAS", NDR_NETR_ACCOUNTDELTAS, api_netr_AccountDeltas}, - {"NETR_ACCOUNTSYNC", NDR_NETR_ACCOUNTSYNC, api_netr_AccountSync}, - {"NETR_GETDCNAME", NDR_NETR_GETDCNAME, api_netr_GetDcName}, - {"NETR_LOGONCONTROL", NDR_NETR_LOGONCONTROL, api_netr_LogonControl}, - {"NETR_GETANYDCNAME", NDR_NETR_GETANYDCNAME, api_netr_GetAnyDCName}, - {"NETR_LOGONCONTROL2", NDR_NETR_LOGONCONTROL2, api_netr_LogonControl2}, - {"NETR_SERVERAUTHENTICATE2", NDR_NETR_SERVERAUTHENTICATE2, api_netr_ServerAuthenticate2}, - {"NETR_DATABASESYNC2", NDR_NETR_DATABASESYNC2, api_netr_DatabaseSync2}, - {"NETR_DATABASEREDO", NDR_NETR_DATABASEREDO, api_netr_DatabaseRedo}, - {"NETR_LOGONCONTROL2EX", NDR_NETR_LOGONCONTROL2EX, api_netr_LogonControl2Ex}, - {"NETR_NETRENUMERATETRUSTEDDOMAINS", NDR_NETR_NETRENUMERATETRUSTEDDOMAINS, api_netr_NetrEnumerateTrustedDomains}, - {"NETR_DSRGETDCNAME", NDR_NETR_DSRGETDCNAME, api_netr_DsRGetDCName}, - {"NETR_NETRLOGONDUMMYROUTINE1", NDR_NETR_NETRLOGONDUMMYROUTINE1, api_netr_NETRLOGONDUMMYROUTINE1}, - {"NETR_NETRLOGONSETSERVICEBITS", NDR_NETR_NETRLOGONSETSERVICEBITS, api_netr_NETRLOGONSETSERVICEBITS}, - {"NETR_LOGONGETTRUSTRID", NDR_NETR_LOGONGETTRUSTRID, api_netr_LogonGetTrustRid}, - {"NETR_NETRLOGONCOMPUTESERVERDIGEST", NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST, api_netr_NETRLOGONCOMPUTESERVERDIGEST}, - {"NETR_NETRLOGONCOMPUTECLIENTDIGEST", NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST, api_netr_NETRLOGONCOMPUTECLIENTDIGEST}, - {"NETR_SERVERAUTHENTICATE3", NDR_NETR_SERVERAUTHENTICATE3, api_netr_ServerAuthenticate3}, - {"NETR_DSRGETDCNAMEEX", NDR_NETR_DSRGETDCNAMEEX, api_netr_DsRGetDCNameEx}, - {"NETR_DSRGETSITENAME", NDR_NETR_DSRGETSITENAME, api_netr_DsRGetSiteName}, - {"NETR_LOGONGETDOMAININFO", NDR_NETR_LOGONGETDOMAININFO, api_netr_LogonGetDomainInfo}, - {"NETR_SERVERPASSWORDSET2", NDR_NETR_SERVERPASSWORDSET2, api_netr_ServerPasswordSet2}, - {"NETR_SERVERPASSWORDGET", NDR_NETR_SERVERPASSWORDGET, api_netr_ServerPasswordGet}, - {"NETR_NETRLOGONSENDTOSAM", NDR_NETR_NETRLOGONSENDTOSAM, api_netr_NETRLOGONSENDTOSAM}, - {"NETR_DSRADDRESSTOSITENAMESW", NDR_NETR_DSRADDRESSTOSITENAMESW, api_netr_DsRAddressToSitenamesW}, - {"NETR_DSRGETDCNAMEEX2", NDR_NETR_DSRGETDCNAMEEX2, api_netr_DsRGetDCNameEx2}, - {"NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN", NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN, api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN}, - {"NETR_NETRENUMERATETRUSTEDDOMAINSEX", NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX, api_netr_NetrEnumerateTrustedDomainsEx}, - {"NETR_DSRADDRESSTOSITENAMESEXW", NDR_NETR_DSRADDRESSTOSITENAMESEXW, api_netr_DsRAddressToSitenamesExW}, - {"NETR_DSRGETDCSITECOVERAGEW", NDR_NETR_DSRGETDCSITECOVERAGEW, api_netr_DsrGetDcSiteCoverageW}, - {"NETR_LOGONSAMLOGONEX", NDR_NETR_LOGONSAMLOGONEX, api_netr_LogonSamLogonEx}, - {"NETR_DSRENUMERATEDOMAINTRUSTS", NDR_NETR_DSRENUMERATEDOMAINTRUSTS, api_netr_DsrEnumerateDomainTrusts}, - {"NETR_DSRDEREGISTERDNSHOSTRECORDS", NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS, api_netr_DsrDeregisterDNSHostRecords}, - {"NETR_SERVERTRUSTPASSWORDSGET", NDR_NETR_SERVERTRUSTPASSWORDSGET, api_netr_ServerTrustPasswordsGet}, - {"NETR_DSRGETFORESTTRUSTINFORMATION", NDR_NETR_DSRGETFORESTTRUSTINFORMATION, api_netr_DsRGetForestTrustInformation}, - {"NETR_GETFORESTTRUSTINFORMATION", NDR_NETR_GETFORESTTRUSTINFORMATION, api_netr_GetForestTrustInformation}, - {"NETR_LOGONSAMLOGONWITHFLAGS", NDR_NETR_LOGONSAMLOGONWITHFLAGS, api_netr_LogonSamLogonWithFlags}, - {"NETR_SERVERGETTRUSTINFO", NDR_NETR_SERVERGETTRUSTINFO, api_netr_ServerGetTrustInfo}, -}; - -void netlogon_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_netlogon_cmds; - *n_fns = sizeof(api_netlogon_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_netlogon_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "netlogon", "netlogon", &ndr_table_netlogon.syntax_id, api_netlogon_cmds, sizeof(api_netlogon_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_netlogon.h b/source3/librpc/gen_ndr/srv_netlogon.h deleted file mode 100644 index cd68d12f1e..0000000000 --- a/source3/librpc/gen_ndr/srv_netlogon.h +++ /dev/null @@ -1,53 +0,0 @@ -#include "librpc/gen_ndr/ndr_netlogon.h" -#ifndef __SRV_NETLOGON__ -#define __SRV_NETLOGON__ -WERROR _netr_LogonUasLogon(pipes_struct *p, struct netr_LogonUasLogon *r); -WERROR _netr_LogonUasLogoff(pipes_struct *p, struct netr_LogonUasLogoff *r); -NTSTATUS _netr_LogonSamLogon(pipes_struct *p, struct netr_LogonSamLogon *r); -NTSTATUS _netr_LogonSamLogoff(pipes_struct *p, struct netr_LogonSamLogoff *r); -NTSTATUS _netr_ServerReqChallenge(pipes_struct *p, struct netr_ServerReqChallenge *r); -NTSTATUS _netr_ServerAuthenticate(pipes_struct *p, struct netr_ServerAuthenticate *r); -NTSTATUS _netr_ServerPasswordSet(pipes_struct *p, struct netr_ServerPasswordSet *r); -NTSTATUS _netr_DatabaseDeltas(pipes_struct *p, struct netr_DatabaseDeltas *r); -NTSTATUS _netr_DatabaseSync(pipes_struct *p, struct netr_DatabaseSync *r); -NTSTATUS _netr_AccountDeltas(pipes_struct *p, struct netr_AccountDeltas *r); -NTSTATUS _netr_AccountSync(pipes_struct *p, struct netr_AccountSync *r); -WERROR _netr_GetDcName(pipes_struct *p, struct netr_GetDcName *r); -WERROR _netr_LogonControl(pipes_struct *p, struct netr_LogonControl *r); -WERROR _netr_GetAnyDCName(pipes_struct *p, struct netr_GetAnyDCName *r); -WERROR _netr_LogonControl2(pipes_struct *p, struct netr_LogonControl2 *r); -NTSTATUS _netr_ServerAuthenticate2(pipes_struct *p, struct netr_ServerAuthenticate2 *r); -NTSTATUS _netr_DatabaseSync2(pipes_struct *p, struct netr_DatabaseSync2 *r); -NTSTATUS _netr_DatabaseRedo(pipes_struct *p, struct netr_DatabaseRedo *r); -WERROR _netr_LogonControl2Ex(pipes_struct *p, struct netr_LogonControl2Ex *r); -WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p, struct netr_NetrEnumerateTrustedDomains *r); -WERROR _netr_DsRGetDCName(pipes_struct *p, struct netr_DsRGetDCName *r); -WERROR _netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p, struct netr_NETRLOGONDUMMYROUTINE1 *r); -WERROR _netr_NETRLOGONSETSERVICEBITS(pipes_struct *p, struct netr_NETRLOGONSETSERVICEBITS *r); -WERROR _netr_LogonGetTrustRid(pipes_struct *p, struct netr_LogonGetTrustRid *r); -WERROR _netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r); -WERROR _netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p, struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r); -NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p, struct netr_ServerAuthenticate3 *r); -WERROR _netr_DsRGetDCNameEx(pipes_struct *p, struct netr_DsRGetDCNameEx *r); -WERROR _netr_DsRGetSiteName(pipes_struct *p, struct netr_DsRGetSiteName *r); -NTSTATUS _netr_LogonGetDomainInfo(pipes_struct *p, struct netr_LogonGetDomainInfo *r); -NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p, struct netr_ServerPasswordSet2 *r); -WERROR _netr_ServerPasswordGet(pipes_struct *p, struct netr_ServerPasswordGet *r); -WERROR _netr_NETRLOGONSENDTOSAM(pipes_struct *p, struct netr_NETRLOGONSENDTOSAM *r); -WERROR _netr_DsRAddressToSitenamesW(pipes_struct *p, struct netr_DsRAddressToSitenamesW *r); -WERROR _netr_DsRGetDCNameEx2(pipes_struct *p, struct netr_DsRGetDCNameEx2 *r); -WERROR _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r); -WERROR _netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p, struct netr_NetrEnumerateTrustedDomainsEx *r); -WERROR _netr_DsRAddressToSitenamesExW(pipes_struct *p, struct netr_DsRAddressToSitenamesExW *r); -WERROR _netr_DsrGetDcSiteCoverageW(pipes_struct *p, struct netr_DsrGetDcSiteCoverageW *r); -NTSTATUS _netr_LogonSamLogonEx(pipes_struct *p, struct netr_LogonSamLogonEx *r); -WERROR _netr_DsrEnumerateDomainTrusts(pipes_struct *p, struct netr_DsrEnumerateDomainTrusts *r); -WERROR _netr_DsrDeregisterDNSHostRecords(pipes_struct *p, struct netr_DsrDeregisterDNSHostRecords *r); -NTSTATUS _netr_ServerTrustPasswordsGet(pipes_struct *p, struct netr_ServerTrustPasswordsGet *r); -WERROR _netr_DsRGetForestTrustInformation(pipes_struct *p, struct netr_DsRGetForestTrustInformation *r); -WERROR _netr_GetForestTrustInformation(pipes_struct *p, struct netr_GetForestTrustInformation *r); -NTSTATUS _netr_LogonSamLogonWithFlags(pipes_struct *p, struct netr_LogonSamLogonWithFlags *r); -NTSTATUS _netr_ServerGetTrustInfo(pipes_struct *p, struct netr_ServerGetTrustInfo *r); -void netlogon_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_netlogon_init(void); -#endif /* __SRV_NETLOGON__ */ diff --git a/source3/librpc/gen_ndr/srv_ntsvcs.c b/source3/librpc/gen_ndr/srv_ntsvcs.c deleted file mode 100644 index 288f3ed5d7..0000000000 --- a/source3/librpc/gen_ndr/srv_ntsvcs.c +++ /dev/null @@ -1,4877 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_ntsvcs.h" - -static bool api_PNP_Disconnect(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_Disconnect *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_DISCONNECT]; - - r = talloc(talloc_tos(), struct PNP_Disconnect); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_Disconnect, r); - } - - r->out.result = _PNP_Disconnect(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_Disconnect, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_Connect(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_Connect *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_CONNECT]; - - r = talloc(talloc_tos(), struct PNP_Connect); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_Connect, r); - } - - r->out.result = _PNP_Connect(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_Connect, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetVersion(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetVersion *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETVERSION]; - - r = talloc(talloc_tos(), struct PNP_GetVersion); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetVersion, r); - } - - ZERO_STRUCT(r->out); - r->out.version = talloc_zero(r, uint16_t); - if (r->out.version == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _PNP_GetVersion(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetVersion, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetGlobalState(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetGlobalState *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETGLOBALSTATE]; - - r = talloc(talloc_tos(), struct PNP_GetGlobalState); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, r); - } - - r->out.result = _PNP_GetGlobalState(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_InitDetection(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_InitDetection *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_INITDETECTION]; - - r = talloc(talloc_tos(), struct PNP_InitDetection); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_InitDetection, r); - } - - r->out.result = _PNP_InitDetection(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_InitDetection, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_ReportLogOn(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_ReportLogOn *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_REPORTLOGON]; - - r = talloc(talloc_tos(), struct PNP_ReportLogOn); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, r); - } - - r->out.result = _PNP_ReportLogOn(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_ValidateDeviceInstance(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_ValidateDeviceInstance *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_VALIDATEDEVICEINSTANCE]; - - r = talloc(talloc_tos(), struct PNP_ValidateDeviceInstance); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, r); - } - - r->out.result = _PNP_ValidateDeviceInstance(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetRootDeviceInstance(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetRootDeviceInstance *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETROOTDEVICEINSTANCE]; - - r = talloc(talloc_tos(), struct PNP_GetRootDeviceInstance); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, r); - } - - r->out.result = _PNP_GetRootDeviceInstance(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetRelatedDeviceInstance(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetRelatedDeviceInstance *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETRELATEDDEVICEINSTANCE]; - - r = talloc(talloc_tos(), struct PNP_GetRelatedDeviceInstance); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, r); - } - - r->out.result = _PNP_GetRelatedDeviceInstance(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_EnumerateSubKeys(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_EnumerateSubKeys *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_ENUMERATESUBKEYS]; - - r = talloc(talloc_tos(), struct PNP_EnumerateSubKeys); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, r); - } - - r->out.result = _PNP_EnumerateSubKeys(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetDeviceList(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetDeviceList *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICELIST]; - - r = talloc(talloc_tos(), struct PNP_GetDeviceList); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, r); - } - - ZERO_STRUCT(r->out); - r->out.length = r->in.length; - r->out.buffer = talloc_zero_array(r, uint16_t, *r->out.length); - if (r->out.buffer == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _PNP_GetDeviceList(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetDeviceListSize(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetDeviceListSize *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICELISTSIZE]; - - r = talloc(talloc_tos(), struct PNP_GetDeviceListSize); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, r); - } - - ZERO_STRUCT(r->out); - r->out.size = talloc_zero(r, uint32_t); - if (r->out.size == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _PNP_GetDeviceListSize(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetDepth(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetDepth *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEPTH]; - - r = talloc(talloc_tos(), struct PNP_GetDepth); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDepth, r); - } - - r->out.result = _PNP_GetDepth(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDepth, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetDeviceRegProp(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetDeviceRegProp *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICEREGPROP]; - - r = talloc(talloc_tos(), struct PNP_GetDeviceRegProp); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, r); - } - - ZERO_STRUCT(r->out); - r->out.reg_data_type = r->in.reg_data_type; - r->out.buffer_size = r->in.buffer_size; - r->out.needed = r->in.needed; - r->out.buffer = talloc_zero_array(r, uint8_t, *r->out.buffer_size); - if (r->out.buffer == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _PNP_GetDeviceRegProp(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_SetDeviceRegProp(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_SetDeviceRegProp *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_SETDEVICEREGPROP]; - - r = talloc(talloc_tos(), struct PNP_SetDeviceRegProp); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, r); - } - - r->out.result = _PNP_SetDeviceRegProp(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetClassInstance(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetClassInstance *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSINSTANCE]; - - r = talloc(talloc_tos(), struct PNP_GetClassInstance); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, r); - } - - r->out.result = _PNP_GetClassInstance(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_CreateKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_CreateKey *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_CREATEKEY]; - - r = talloc(talloc_tos(), struct PNP_CreateKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_CreateKey, r); - } - - r->out.result = _PNP_CreateKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_CreateKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_DeleteRegistryKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_DeleteRegistryKey *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_DELETEREGISTRYKEY]; - - r = talloc(talloc_tos(), struct PNP_DeleteRegistryKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, r); - } - - r->out.result = _PNP_DeleteRegistryKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetClassCount(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetClassCount *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSCOUNT]; - - r = talloc(talloc_tos(), struct PNP_GetClassCount); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetClassCount, r); - } - - r->out.result = _PNP_GetClassCount(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetClassName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetClassName *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSNAME]; - - r = talloc(talloc_tos(), struct PNP_GetClassName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetClassName, r); - } - - r->out.result = _PNP_GetClassName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetClassName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_DeleteClassKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_DeleteClassKey *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_DELETECLASSKEY]; - - r = talloc(talloc_tos(), struct PNP_DeleteClassKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, r); - } - - r->out.result = _PNP_DeleteClassKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetInterfaceDeviceAlias(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetInterfaceDeviceAlias *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETINTERFACEDEVICEALIAS]; - - r = talloc(talloc_tos(), struct PNP_GetInterfaceDeviceAlias); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, r); - } - - r->out.result = _PNP_GetInterfaceDeviceAlias(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetInterfaceDeviceList(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetInterfaceDeviceList *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETINTERFACEDEVICELIST]; - - r = talloc(talloc_tos(), struct PNP_GetInterfaceDeviceList); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, r); - } - - r->out.result = _PNP_GetInterfaceDeviceList(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetInterfaceDeviceListSize(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetInterfaceDeviceListSize *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETINTERFACEDEVICELISTSIZE]; - - r = talloc(talloc_tos(), struct PNP_GetInterfaceDeviceListSize); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, r); - } - - r->out.result = _PNP_GetInterfaceDeviceListSize(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_RegisterDeviceClassAssociation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_RegisterDeviceClassAssociation *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_REGISTERDEVICECLASSASSOCIATION]; - - r = talloc(talloc_tos(), struct PNP_RegisterDeviceClassAssociation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, r); - } - - r->out.result = _PNP_RegisterDeviceClassAssociation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_UnregisterDeviceClassAssociation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_UnregisterDeviceClassAssociation *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION]; - - r = talloc(talloc_tos(), struct PNP_UnregisterDeviceClassAssociation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, r); - } - - r->out.result = _PNP_UnregisterDeviceClassAssociation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetClassRegProp(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetClassRegProp *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSREGPROP]; - - r = talloc(talloc_tos(), struct PNP_GetClassRegProp); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, r); - } - - r->out.result = _PNP_GetClassRegProp(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_SetClassRegProp(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_SetClassRegProp *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_SETCLASSREGPROP]; - - r = talloc(talloc_tos(), struct PNP_SetClassRegProp); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, r); - } - - r->out.result = _PNP_SetClassRegProp(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_CreateDevInst(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_CreateDevInst *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_CREATEDEVINST]; - - r = talloc(talloc_tos(), struct PNP_CreateDevInst); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, r); - } - - r->out.result = _PNP_CreateDevInst(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_DeviceInstanceAction(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_DeviceInstanceAction *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_DEVICEINSTANCEACTION]; - - r = talloc(talloc_tos(), struct PNP_DeviceInstanceAction); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, r); - } - - r->out.result = _PNP_DeviceInstanceAction(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetDeviceStatus(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetDeviceStatus *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICESTATUS]; - - r = talloc(talloc_tos(), struct PNP_GetDeviceStatus); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, r); - } - - r->out.result = _PNP_GetDeviceStatus(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_SetDeviceProblem(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_SetDeviceProblem *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_SETDEVICEPROBLEM]; - - r = talloc(talloc_tos(), struct PNP_SetDeviceProblem); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, r); - } - - r->out.result = _PNP_SetDeviceProblem(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_DisableDevInst(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_DisableDevInst *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_DISABLEDEVINST]; - - r = talloc(talloc_tos(), struct PNP_DisableDevInst); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, r); - } - - r->out.result = _PNP_DisableDevInst(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_UninstallDevInst(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_UninstallDevInst *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_UNINSTALLDEVINST]; - - r = talloc(talloc_tos(), struct PNP_UninstallDevInst); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, r); - } - - r->out.result = _PNP_UninstallDevInst(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_AddID(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_AddID *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_ADDID]; - - r = talloc(talloc_tos(), struct PNP_AddID); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_AddID, r); - } - - r->out.result = _PNP_AddID(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_AddID, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_RegisterDriver(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_RegisterDriver *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_REGISTERDRIVER]; - - r = talloc(talloc_tos(), struct PNP_RegisterDriver); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, r); - } - - r->out.result = _PNP_RegisterDriver(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_QueryRemove(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_QueryRemove *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYREMOVE]; - - r = talloc(talloc_tos(), struct PNP_QueryRemove); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_QueryRemove, r); - } - - r->out.result = _PNP_QueryRemove(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_RequestDeviceEject(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_RequestDeviceEject *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_REQUESTDEVICEEJECT]; - - r = talloc(talloc_tos(), struct PNP_RequestDeviceEject); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, r); - } - - r->out.result = _PNP_RequestDeviceEject(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_IsDockStationPresent(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_IsDockStationPresent *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_ISDOCKSTATIONPRESENT]; - - r = talloc(talloc_tos(), struct PNP_IsDockStationPresent); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, r); - } - - r->out.result = _PNP_IsDockStationPresent(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_RequestEjectPC(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_RequestEjectPC *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_REQUESTEJECTPC]; - - r = talloc(talloc_tos(), struct PNP_RequestEjectPC); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, r); - } - - r->out.result = _PNP_RequestEjectPC(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_HwProfFlags(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_HwProfFlags *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_HWPROFFLAGS]; - - r = talloc(talloc_tos(), struct PNP_HwProfFlags); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, r); - } - - ZERO_STRUCT(r->out); - r->out.profile_flags = r->in.profile_flags; - r->out.veto_type = r->in.veto_type; - r->out.unknown5a = talloc_zero(r, const char *); - if (r->out.unknown5a == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _PNP_HwProfFlags(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetHwProfInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetHwProfInfo *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETHWPROFINFO]; - - r = talloc(talloc_tos(), struct PNP_GetHwProfInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = r->in.info; - r->out.result = _PNP_GetHwProfInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_AddEmptyLogConf(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_AddEmptyLogConf *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_ADDEMPTYLOGCONF]; - - r = talloc(talloc_tos(), struct PNP_AddEmptyLogConf); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, r); - } - - r->out.result = _PNP_AddEmptyLogConf(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_FreeLogConf(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_FreeLogConf *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_FREELOGCONF]; - - r = talloc(talloc_tos(), struct PNP_FreeLogConf); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, r); - } - - r->out.result = _PNP_FreeLogConf(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetFirstLogConf(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetFirstLogConf *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETFIRSTLOGCONF]; - - r = talloc(talloc_tos(), struct PNP_GetFirstLogConf); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, r); - } - - r->out.result = _PNP_GetFirstLogConf(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetNextLogConf(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetNextLogConf *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETNEXTLOGCONF]; - - r = talloc(talloc_tos(), struct PNP_GetNextLogConf); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, r); - } - - r->out.result = _PNP_GetNextLogConf(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetLogConfPriority(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetLogConfPriority *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETLOGCONFPRIORITY]; - - r = talloc(talloc_tos(), struct PNP_GetLogConfPriority); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, r); - } - - r->out.result = _PNP_GetLogConfPriority(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_AddResDes(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_AddResDes *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_ADDRESDES]; - - r = talloc(talloc_tos(), struct PNP_AddResDes); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_AddResDes, r); - } - - r->out.result = _PNP_AddResDes(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_AddResDes, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_FreeResDes(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_FreeResDes *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_FREERESDES]; - - r = talloc(talloc_tos(), struct PNP_FreeResDes); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_FreeResDes, r); - } - - r->out.result = _PNP_FreeResDes(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetNextResDes(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetNextResDes *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETNEXTRESDES]; - - r = talloc(talloc_tos(), struct PNP_GetNextResDes); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, r); - } - - r->out.result = _PNP_GetNextResDes(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetResDesData(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetResDesData *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETRESDESDATA]; - - r = talloc(talloc_tos(), struct PNP_GetResDesData); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetResDesData, r); - } - - r->out.result = _PNP_GetResDesData(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetResDesDataSize(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetResDesDataSize *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETRESDESDATASIZE]; - - r = talloc(talloc_tos(), struct PNP_GetResDesDataSize); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, r); - } - - r->out.result = _PNP_GetResDesDataSize(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_ModifyResDes(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_ModifyResDes *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_MODIFYRESDES]; - - r = talloc(talloc_tos(), struct PNP_ModifyResDes); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, r); - } - - r->out.result = _PNP_ModifyResDes(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_DetectResourceLimit(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_DetectResourceLimit *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_DETECTRESOURCELIMIT]; - - r = talloc(talloc_tos(), struct PNP_DetectResourceLimit); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, r); - } - - r->out.result = _PNP_DetectResourceLimit(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_QueryResConfList(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_QueryResConfList *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYRESCONFLIST]; - - r = talloc(talloc_tos(), struct PNP_QueryResConfList); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, r); - } - - r->out.result = _PNP_QueryResConfList(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_SetHwProf(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_SetHwProf *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_SETHWPROF]; - - r = talloc(talloc_tos(), struct PNP_SetHwProf); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_SetHwProf, r); - } - - r->out.result = _PNP_SetHwProf(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_QueryArbitratorFreeData(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_QueryArbitratorFreeData *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYARBITRATORFREEDATA]; - - r = talloc(talloc_tos(), struct PNP_QueryArbitratorFreeData); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, r); - } - - r->out.result = _PNP_QueryArbitratorFreeData(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_QueryArbitratorFreeSize(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_QueryArbitratorFreeSize *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYARBITRATORFREESIZE]; - - r = talloc(talloc_tos(), struct PNP_QueryArbitratorFreeSize); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, r); - } - - r->out.result = _PNP_QueryArbitratorFreeSize(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_RunDetection(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_RunDetection *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_RUNDETECTION]; - - r = talloc(talloc_tos(), struct PNP_RunDetection); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RunDetection, r); - } - - r->out.result = _PNP_RunDetection(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RunDetection, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_RegisterNotification(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_RegisterNotification *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_REGISTERNOTIFICATION]; - - r = talloc(talloc_tos(), struct PNP_RegisterNotification); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, r); - } - - r->out.result = _PNP_RegisterNotification(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_UnregisterNotification(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_UnregisterNotification *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_UNREGISTERNOTIFICATION]; - - r = talloc(talloc_tos(), struct PNP_UnregisterNotification); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, r); - } - - r->out.result = _PNP_UnregisterNotification(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetCustomDevProp(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetCustomDevProp *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCUSTOMDEVPROP]; - - r = talloc(talloc_tos(), struct PNP_GetCustomDevProp); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, r); - } - - r->out.result = _PNP_GetCustomDevProp(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetVersionInternal(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetVersionInternal *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETVERSIONINTERNAL]; - - r = talloc(talloc_tos(), struct PNP_GetVersionInternal); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, r); - } - - r->out.result = _PNP_GetVersionInternal(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetBlockedDriverInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetBlockedDriverInfo *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETBLOCKEDDRIVERINFO]; - - r = talloc(talloc_tos(), struct PNP_GetBlockedDriverInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetBlockedDriverInfo, r); - } - - r->out.result = _PNP_GetBlockedDriverInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetBlockedDriverInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_PNP_GetServerSideDeviceInstallFlags(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct PNP_GetServerSideDeviceInstallFlags *r; - - call = &ndr_table_ntsvcs.calls[NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS]; - - r = talloc(talloc_tos(), struct PNP_GetServerSideDeviceInstallFlags); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(PNP_GetServerSideDeviceInstallFlags, r); - } - - r->out.result = _PNP_GetServerSideDeviceInstallFlags(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(PNP_GetServerSideDeviceInstallFlags, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_ntsvcs_cmds[] = -{ - {"PNP_DISCONNECT", NDR_PNP_DISCONNECT, api_PNP_Disconnect}, - {"PNP_CONNECT", NDR_PNP_CONNECT, api_PNP_Connect}, - {"PNP_GETVERSION", NDR_PNP_GETVERSION, api_PNP_GetVersion}, - {"PNP_GETGLOBALSTATE", NDR_PNP_GETGLOBALSTATE, api_PNP_GetGlobalState}, - {"PNP_INITDETECTION", NDR_PNP_INITDETECTION, api_PNP_InitDetection}, - {"PNP_REPORTLOGON", NDR_PNP_REPORTLOGON, api_PNP_ReportLogOn}, - {"PNP_VALIDATEDEVICEINSTANCE", NDR_PNP_VALIDATEDEVICEINSTANCE, api_PNP_ValidateDeviceInstance}, - {"PNP_GETROOTDEVICEINSTANCE", NDR_PNP_GETROOTDEVICEINSTANCE, api_PNP_GetRootDeviceInstance}, - {"PNP_GETRELATEDDEVICEINSTANCE", NDR_PNP_GETRELATEDDEVICEINSTANCE, api_PNP_GetRelatedDeviceInstance}, - {"PNP_ENUMERATESUBKEYS", NDR_PNP_ENUMERATESUBKEYS, api_PNP_EnumerateSubKeys}, - {"PNP_GETDEVICELIST", NDR_PNP_GETDEVICELIST, api_PNP_GetDeviceList}, - {"PNP_GETDEVICELISTSIZE", NDR_PNP_GETDEVICELISTSIZE, api_PNP_GetDeviceListSize}, - {"PNP_GETDEPTH", NDR_PNP_GETDEPTH, api_PNP_GetDepth}, - {"PNP_GETDEVICEREGPROP", NDR_PNP_GETDEVICEREGPROP, api_PNP_GetDeviceRegProp}, - {"PNP_SETDEVICEREGPROP", NDR_PNP_SETDEVICEREGPROP, api_PNP_SetDeviceRegProp}, - {"PNP_GETCLASSINSTANCE", NDR_PNP_GETCLASSINSTANCE, api_PNP_GetClassInstance}, - {"PNP_CREATEKEY", NDR_PNP_CREATEKEY, api_PNP_CreateKey}, - {"PNP_DELETEREGISTRYKEY", NDR_PNP_DELETEREGISTRYKEY, api_PNP_DeleteRegistryKey}, - {"PNP_GETCLASSCOUNT", NDR_PNP_GETCLASSCOUNT, api_PNP_GetClassCount}, - {"PNP_GETCLASSNAME", NDR_PNP_GETCLASSNAME, api_PNP_GetClassName}, - {"PNP_DELETECLASSKEY", NDR_PNP_DELETECLASSKEY, api_PNP_DeleteClassKey}, - {"PNP_GETINTERFACEDEVICEALIAS", NDR_PNP_GETINTERFACEDEVICEALIAS, api_PNP_GetInterfaceDeviceAlias}, - {"PNP_GETINTERFACEDEVICELIST", NDR_PNP_GETINTERFACEDEVICELIST, api_PNP_GetInterfaceDeviceList}, - {"PNP_GETINTERFACEDEVICELISTSIZE", NDR_PNP_GETINTERFACEDEVICELISTSIZE, api_PNP_GetInterfaceDeviceListSize}, - {"PNP_REGISTERDEVICECLASSASSOCIATION", NDR_PNP_REGISTERDEVICECLASSASSOCIATION, api_PNP_RegisterDeviceClassAssociation}, - {"PNP_UNREGISTERDEVICECLASSASSOCIATION", NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION, api_PNP_UnregisterDeviceClassAssociation}, - {"PNP_GETCLASSREGPROP", NDR_PNP_GETCLASSREGPROP, api_PNP_GetClassRegProp}, - {"PNP_SETCLASSREGPROP", NDR_PNP_SETCLASSREGPROP, api_PNP_SetClassRegProp}, - {"PNP_CREATEDEVINST", NDR_PNP_CREATEDEVINST, api_PNP_CreateDevInst}, - {"PNP_DEVICEINSTANCEACTION", NDR_PNP_DEVICEINSTANCEACTION, api_PNP_DeviceInstanceAction}, - {"PNP_GETDEVICESTATUS", NDR_PNP_GETDEVICESTATUS, api_PNP_GetDeviceStatus}, - {"PNP_SETDEVICEPROBLEM", NDR_PNP_SETDEVICEPROBLEM, api_PNP_SetDeviceProblem}, - {"PNP_DISABLEDEVINST", NDR_PNP_DISABLEDEVINST, api_PNP_DisableDevInst}, - {"PNP_UNINSTALLDEVINST", NDR_PNP_UNINSTALLDEVINST, api_PNP_UninstallDevInst}, - {"PNP_ADDID", NDR_PNP_ADDID, api_PNP_AddID}, - {"PNP_REGISTERDRIVER", NDR_PNP_REGISTERDRIVER, api_PNP_RegisterDriver}, - {"PNP_QUERYREMOVE", NDR_PNP_QUERYREMOVE, api_PNP_QueryRemove}, - {"PNP_REQUESTDEVICEEJECT", NDR_PNP_REQUESTDEVICEEJECT, api_PNP_RequestDeviceEject}, - {"PNP_ISDOCKSTATIONPRESENT", NDR_PNP_ISDOCKSTATIONPRESENT, api_PNP_IsDockStationPresent}, - {"PNP_REQUESTEJECTPC", NDR_PNP_REQUESTEJECTPC, api_PNP_RequestEjectPC}, - {"PNP_HWPROFFLAGS", NDR_PNP_HWPROFFLAGS, api_PNP_HwProfFlags}, - {"PNP_GETHWPROFINFO", NDR_PNP_GETHWPROFINFO, api_PNP_GetHwProfInfo}, - {"PNP_ADDEMPTYLOGCONF", NDR_PNP_ADDEMPTYLOGCONF, api_PNP_AddEmptyLogConf}, - {"PNP_FREELOGCONF", NDR_PNP_FREELOGCONF, api_PNP_FreeLogConf}, - {"PNP_GETFIRSTLOGCONF", NDR_PNP_GETFIRSTLOGCONF, api_PNP_GetFirstLogConf}, - {"PNP_GETNEXTLOGCONF", NDR_PNP_GETNEXTLOGCONF, api_PNP_GetNextLogConf}, - {"PNP_GETLOGCONFPRIORITY", NDR_PNP_GETLOGCONFPRIORITY, api_PNP_GetLogConfPriority}, - {"PNP_ADDRESDES", NDR_PNP_ADDRESDES, api_PNP_AddResDes}, - {"PNP_FREERESDES", NDR_PNP_FREERESDES, api_PNP_FreeResDes}, - {"PNP_GETNEXTRESDES", NDR_PNP_GETNEXTRESDES, api_PNP_GetNextResDes}, - {"PNP_GETRESDESDATA", NDR_PNP_GETRESDESDATA, api_PNP_GetResDesData}, - {"PNP_GETRESDESDATASIZE", NDR_PNP_GETRESDESDATASIZE, api_PNP_GetResDesDataSize}, - {"PNP_MODIFYRESDES", NDR_PNP_MODIFYRESDES, api_PNP_ModifyResDes}, - {"PNP_DETECTRESOURCELIMIT", NDR_PNP_DETECTRESOURCELIMIT, api_PNP_DetectResourceLimit}, - {"PNP_QUERYRESCONFLIST", NDR_PNP_QUERYRESCONFLIST, api_PNP_QueryResConfList}, - {"PNP_SETHWPROF", NDR_PNP_SETHWPROF, api_PNP_SetHwProf}, - {"PNP_QUERYARBITRATORFREEDATA", NDR_PNP_QUERYARBITRATORFREEDATA, api_PNP_QueryArbitratorFreeData}, - {"PNP_QUERYARBITRATORFREESIZE", NDR_PNP_QUERYARBITRATORFREESIZE, api_PNP_QueryArbitratorFreeSize}, - {"PNP_RUNDETECTION", NDR_PNP_RUNDETECTION, api_PNP_RunDetection}, - {"PNP_REGISTERNOTIFICATION", NDR_PNP_REGISTERNOTIFICATION, api_PNP_RegisterNotification}, - {"PNP_UNREGISTERNOTIFICATION", NDR_PNP_UNREGISTERNOTIFICATION, api_PNP_UnregisterNotification}, - {"PNP_GETCUSTOMDEVPROP", NDR_PNP_GETCUSTOMDEVPROP, api_PNP_GetCustomDevProp}, - {"PNP_GETVERSIONINTERNAL", NDR_PNP_GETVERSIONINTERNAL, api_PNP_GetVersionInternal}, - {"PNP_GETBLOCKEDDRIVERINFO", NDR_PNP_GETBLOCKEDDRIVERINFO, api_PNP_GetBlockedDriverInfo}, - {"PNP_GETSERVERSIDEDEVICEINSTALLFLAGS", NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS, api_PNP_GetServerSideDeviceInstallFlags}, -}; - -void ntsvcs_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_ntsvcs_cmds; - *n_fns = sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_ntsvcs_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "ntsvcs", "ntsvcs", &ndr_table_ntsvcs.syntax_id, api_ntsvcs_cmds, sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_ntsvcs.h b/source3/librpc/gen_ndr/srv_ntsvcs.h deleted file mode 100644 index c3969b11da..0000000000 --- a/source3/librpc/gen_ndr/srv_ntsvcs.h +++ /dev/null @@ -1,71 +0,0 @@ -#include "librpc/gen_ndr/ndr_ntsvcs.h" -#ifndef __SRV_NTSVCS__ -#define __SRV_NTSVCS__ -WERROR _PNP_Disconnect(pipes_struct *p, struct PNP_Disconnect *r); -WERROR _PNP_Connect(pipes_struct *p, struct PNP_Connect *r); -WERROR _PNP_GetVersion(pipes_struct *p, struct PNP_GetVersion *r); -WERROR _PNP_GetGlobalState(pipes_struct *p, struct PNP_GetGlobalState *r); -WERROR _PNP_InitDetection(pipes_struct *p, struct PNP_InitDetection *r); -WERROR _PNP_ReportLogOn(pipes_struct *p, struct PNP_ReportLogOn *r); -WERROR _PNP_ValidateDeviceInstance(pipes_struct *p, struct PNP_ValidateDeviceInstance *r); -WERROR _PNP_GetRootDeviceInstance(pipes_struct *p, struct PNP_GetRootDeviceInstance *r); -WERROR _PNP_GetRelatedDeviceInstance(pipes_struct *p, struct PNP_GetRelatedDeviceInstance *r); -WERROR _PNP_EnumerateSubKeys(pipes_struct *p, struct PNP_EnumerateSubKeys *r); -WERROR _PNP_GetDeviceList(pipes_struct *p, struct PNP_GetDeviceList *r); -WERROR _PNP_GetDeviceListSize(pipes_struct *p, struct PNP_GetDeviceListSize *r); -WERROR _PNP_GetDepth(pipes_struct *p, struct PNP_GetDepth *r); -WERROR _PNP_GetDeviceRegProp(pipes_struct *p, struct PNP_GetDeviceRegProp *r); -WERROR _PNP_SetDeviceRegProp(pipes_struct *p, struct PNP_SetDeviceRegProp *r); -WERROR _PNP_GetClassInstance(pipes_struct *p, struct PNP_GetClassInstance *r); -WERROR _PNP_CreateKey(pipes_struct *p, struct PNP_CreateKey *r); -WERROR _PNP_DeleteRegistryKey(pipes_struct *p, struct PNP_DeleteRegistryKey *r); -WERROR _PNP_GetClassCount(pipes_struct *p, struct PNP_GetClassCount *r); -WERROR _PNP_GetClassName(pipes_struct *p, struct PNP_GetClassName *r); -WERROR _PNP_DeleteClassKey(pipes_struct *p, struct PNP_DeleteClassKey *r); -WERROR _PNP_GetInterfaceDeviceAlias(pipes_struct *p, struct PNP_GetInterfaceDeviceAlias *r); -WERROR _PNP_GetInterfaceDeviceList(pipes_struct *p, struct PNP_GetInterfaceDeviceList *r); -WERROR _PNP_GetInterfaceDeviceListSize(pipes_struct *p, struct PNP_GetInterfaceDeviceListSize *r); -WERROR _PNP_RegisterDeviceClassAssociation(pipes_struct *p, struct PNP_RegisterDeviceClassAssociation *r); -WERROR _PNP_UnregisterDeviceClassAssociation(pipes_struct *p, struct PNP_UnregisterDeviceClassAssociation *r); -WERROR _PNP_GetClassRegProp(pipes_struct *p, struct PNP_GetClassRegProp *r); -WERROR _PNP_SetClassRegProp(pipes_struct *p, struct PNP_SetClassRegProp *r); -WERROR _PNP_CreateDevInst(pipes_struct *p, struct PNP_CreateDevInst *r); -WERROR _PNP_DeviceInstanceAction(pipes_struct *p, struct PNP_DeviceInstanceAction *r); -WERROR _PNP_GetDeviceStatus(pipes_struct *p, struct PNP_GetDeviceStatus *r); -WERROR _PNP_SetDeviceProblem(pipes_struct *p, struct PNP_SetDeviceProblem *r); -WERROR _PNP_DisableDevInst(pipes_struct *p, struct PNP_DisableDevInst *r); -WERROR _PNP_UninstallDevInst(pipes_struct *p, struct PNP_UninstallDevInst *r); -WERROR _PNP_AddID(pipes_struct *p, struct PNP_AddID *r); -WERROR _PNP_RegisterDriver(pipes_struct *p, struct PNP_RegisterDriver *r); -WERROR _PNP_QueryRemove(pipes_struct *p, struct PNP_QueryRemove *r); -WERROR _PNP_RequestDeviceEject(pipes_struct *p, struct PNP_RequestDeviceEject *r); -WERROR _PNP_IsDockStationPresent(pipes_struct *p, struct PNP_IsDockStationPresent *r); -WERROR _PNP_RequestEjectPC(pipes_struct *p, struct PNP_RequestEjectPC *r); -WERROR _PNP_HwProfFlags(pipes_struct *p, struct PNP_HwProfFlags *r); -WERROR _PNP_GetHwProfInfo(pipes_struct *p, struct PNP_GetHwProfInfo *r); -WERROR _PNP_AddEmptyLogConf(pipes_struct *p, struct PNP_AddEmptyLogConf *r); -WERROR _PNP_FreeLogConf(pipes_struct *p, struct PNP_FreeLogConf *r); -WERROR _PNP_GetFirstLogConf(pipes_struct *p, struct PNP_GetFirstLogConf *r); -WERROR _PNP_GetNextLogConf(pipes_struct *p, struct PNP_GetNextLogConf *r); -WERROR _PNP_GetLogConfPriority(pipes_struct *p, struct PNP_GetLogConfPriority *r); -WERROR _PNP_AddResDes(pipes_struct *p, struct PNP_AddResDes *r); -WERROR _PNP_FreeResDes(pipes_struct *p, struct PNP_FreeResDes *r); -WERROR _PNP_GetNextResDes(pipes_struct *p, struct PNP_GetNextResDes *r); -WERROR _PNP_GetResDesData(pipes_struct *p, struct PNP_GetResDesData *r); -WERROR _PNP_GetResDesDataSize(pipes_struct *p, struct PNP_GetResDesDataSize *r); -WERROR _PNP_ModifyResDes(pipes_struct *p, struct PNP_ModifyResDes *r); -WERROR _PNP_DetectResourceLimit(pipes_struct *p, struct PNP_DetectResourceLimit *r); -WERROR _PNP_QueryResConfList(pipes_struct *p, struct PNP_QueryResConfList *r); -WERROR _PNP_SetHwProf(pipes_struct *p, struct PNP_SetHwProf *r); -WERROR _PNP_QueryArbitratorFreeData(pipes_struct *p, struct PNP_QueryArbitratorFreeData *r); -WERROR _PNP_QueryArbitratorFreeSize(pipes_struct *p, struct PNP_QueryArbitratorFreeSize *r); -WERROR _PNP_RunDetection(pipes_struct *p, struct PNP_RunDetection *r); -WERROR _PNP_RegisterNotification(pipes_struct *p, struct PNP_RegisterNotification *r); -WERROR _PNP_UnregisterNotification(pipes_struct *p, struct PNP_UnregisterNotification *r); -WERROR _PNP_GetCustomDevProp(pipes_struct *p, struct PNP_GetCustomDevProp *r); -WERROR _PNP_GetVersionInternal(pipes_struct *p, struct PNP_GetVersionInternal *r); -WERROR _PNP_GetBlockedDriverInfo(pipes_struct *p, struct PNP_GetBlockedDriverInfo *r); -WERROR _PNP_GetServerSideDeviceInstallFlags(pipes_struct *p, struct PNP_GetServerSideDeviceInstallFlags *r); -void ntsvcs_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_ntsvcs_init(void); -#endif /* __SRV_NTSVCS__ */ diff --git a/source3/librpc/gen_ndr/srv_samr.c b/source3/librpc/gen_ndr/srv_samr.c deleted file mode 100644 index f4facd2914..0000000000 --- a/source3/librpc/gen_ndr/srv_samr.c +++ /dev/null @@ -1,5482 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_samr.h" - -static bool api_samr_Connect(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_Connect *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CONNECT]; - - r = talloc(talloc_tos(), struct samr_Connect); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect, r); - } - - ZERO_STRUCT(r->out); - r->out.connect_handle = talloc_zero(r, struct policy_handle); - if (r->out.connect_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_Connect(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_Close(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_Close *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CLOSE]; - - r = talloc(talloc_tos(), struct samr_Close); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Close, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = r->in.handle; - r->out.result = _samr_Close(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Close, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_SetSecurity(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_SetSecurity *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SETSECURITY]; - - r = talloc(talloc_tos(), struct samr_SetSecurity); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetSecurity, r); - } - - r->out.result = _samr_SetSecurity(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetSecurity, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QuerySecurity(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QuerySecurity *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYSECURITY]; - - r = talloc(talloc_tos(), struct samr_QuerySecurity); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QuerySecurity, r); - } - - ZERO_STRUCT(r->out); - r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *); - if (r->out.sdbuf == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QuerySecurity(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_Shutdown(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_Shutdown *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SHUTDOWN]; - - r = talloc(talloc_tos(), struct samr_Shutdown); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Shutdown, r); - } - - r->out.result = _samr_Shutdown(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Shutdown, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_LookupDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_LookupDomain *r; - - call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPDOMAIN]; - - r = talloc(talloc_tos(), struct samr_LookupDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_LookupDomain, r); - } - - ZERO_STRUCT(r->out); - r->out.sid = talloc_zero(r, struct dom_sid2 *); - if (r->out.sid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_LookupDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_LookupDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_EnumDomains(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_EnumDomains *r; - - call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINS]; - - r = talloc(talloc_tos(), struct samr_EnumDomains); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_EnumDomains, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.sam = talloc_zero(r, struct samr_SamArray *); - if (r->out.sam == NULL) { - talloc_free(r); - return false; - } - - r->out.num_entries = talloc_zero(r, uint32_t); - if (r->out.num_entries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_EnumDomains(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_EnumDomains, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_OpenDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_OpenDomain *r; - - call = &ndr_table_samr.calls[NDR_SAMR_OPENDOMAIN]; - - r = talloc(talloc_tos(), struct samr_OpenDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OpenDomain, r); - } - - ZERO_STRUCT(r->out); - r->out.domain_handle = talloc_zero(r, struct policy_handle); - if (r->out.domain_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_OpenDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OpenDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryDomainInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryDomainInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO]; - - r = talloc(talloc_tos(), struct samr_QueryDomainInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union samr_DomainInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryDomainInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_SetDomainInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_SetDomainInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SETDOMAININFO]; - - r = talloc(talloc_tos(), struct samr_SetDomainInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, r); - } - - r->out.result = _samr_SetDomainInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_CreateDomainGroup(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_CreateDomainGroup *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMAINGROUP]; - - r = talloc(talloc_tos(), struct samr_CreateDomainGroup); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, r); - } - - ZERO_STRUCT(r->out); - r->out.group_handle = talloc_zero(r, struct policy_handle); - if (r->out.group_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.rid = talloc_zero(r, uint32_t); - if (r->out.rid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_CreateDomainGroup(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_EnumDomainGroups(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_EnumDomainGroups *r; - - call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINGROUPS]; - - r = talloc(talloc_tos(), struct samr_EnumDomainGroups); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.sam = talloc_zero(r, struct samr_SamArray *); - if (r->out.sam == NULL) { - talloc_free(r); - return false; - } - - r->out.num_entries = talloc_zero(r, uint32_t); - if (r->out.num_entries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_EnumDomainGroups(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_CreateUser(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_CreateUser *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER]; - - r = talloc(talloc_tos(), struct samr_CreateUser); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_CreateUser, r); - } - - ZERO_STRUCT(r->out); - r->out.user_handle = talloc_zero(r, struct policy_handle); - if (r->out.user_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.rid = talloc_zero(r, uint32_t); - if (r->out.rid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_CreateUser(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_CreateUser, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_EnumDomainUsers(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_EnumDomainUsers *r; - - call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINUSERS]; - - r = talloc(talloc_tos(), struct samr_EnumDomainUsers); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.sam = talloc_zero(r, struct samr_SamArray *); - if (r->out.sam == NULL) { - talloc_free(r); - return false; - } - - r->out.num_entries = talloc_zero(r, uint32_t); - if (r->out.num_entries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_EnumDomainUsers(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_CreateDomAlias(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_CreateDomAlias *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMALIAS]; - - r = talloc(talloc_tos(), struct samr_CreateDomAlias); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, r); - } - - ZERO_STRUCT(r->out); - r->out.alias_handle = talloc_zero(r, struct policy_handle); - if (r->out.alias_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.rid = talloc_zero(r, uint32_t); - if (r->out.rid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_CreateDomAlias(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_EnumDomainAliases(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_EnumDomainAliases *r; - - call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINALIASES]; - - r = talloc(talloc_tos(), struct samr_EnumDomainAliases); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.sam = talloc_zero(r, struct samr_SamArray *); - if (r->out.sam == NULL) { - talloc_free(r); - return false; - } - - r->out.num_entries = talloc_zero(r, uint32_t); - if (r->out.num_entries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_EnumDomainAliases(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_GetAliasMembership(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_GetAliasMembership *r; - - call = &ndr_table_samr.calls[NDR_SAMR_GETALIASMEMBERSHIP]; - - r = talloc(talloc_tos(), struct samr_GetAliasMembership); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, r); - } - - ZERO_STRUCT(r->out); - r->out.rids = talloc_zero(r, struct samr_Ids); - if (r->out.rids == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_GetAliasMembership(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_LookupNames(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_LookupNames *r; - - call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPNAMES]; - - r = talloc(talloc_tos(), struct samr_LookupNames); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_LookupNames, r); - } - - ZERO_STRUCT(r->out); - r->out.rids = talloc_zero(r, struct samr_Ids); - if (r->out.rids == NULL) { - talloc_free(r); - return false; - } - - r->out.types = talloc_zero(r, struct samr_Ids); - if (r->out.types == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_LookupNames(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_LookupNames, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_LookupRids(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_LookupRids *r; - - call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPRIDS]; - - r = talloc(talloc_tos(), struct samr_LookupRids); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_LookupRids, r); - } - - ZERO_STRUCT(r->out); - r->out.names = talloc_zero(r, struct lsa_Strings); - if (r->out.names == NULL) { - talloc_free(r); - return false; - } - - r->out.types = talloc_zero(r, struct samr_Ids); - if (r->out.types == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_LookupRids(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_LookupRids, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_OpenGroup(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_OpenGroup *r; - - call = &ndr_table_samr.calls[NDR_SAMR_OPENGROUP]; - - r = talloc(talloc_tos(), struct samr_OpenGroup); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OpenGroup, r); - } - - ZERO_STRUCT(r->out); - r->out.group_handle = talloc_zero(r, struct policy_handle); - if (r->out.group_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_OpenGroup(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OpenGroup, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryGroupInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryGroupInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPINFO]; - - r = talloc(talloc_tos(), struct samr_QueryGroupInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union samr_GroupInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryGroupInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_SetGroupInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_SetGroupInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SETGROUPINFO]; - - r = talloc(talloc_tos(), struct samr_SetGroupInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, r); - } - - r->out.result = _samr_SetGroupInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_AddGroupMember(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_AddGroupMember *r; - - call = &ndr_table_samr.calls[NDR_SAMR_ADDGROUPMEMBER]; - - r = talloc(talloc_tos(), struct samr_AddGroupMember); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_AddGroupMember, r); - } - - r->out.result = _samr_AddGroupMember(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_DeleteDomainGroup(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_DeleteDomainGroup *r; - - call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMAINGROUP]; - - r = talloc(talloc_tos(), struct samr_DeleteDomainGroup); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, r); - } - - ZERO_STRUCT(r->out); - r->out.group_handle = r->in.group_handle; - r->out.result = _samr_DeleteDomainGroup(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_DeleteGroupMember(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_DeleteGroupMember *r; - - call = &ndr_table_samr.calls[NDR_SAMR_DELETEGROUPMEMBER]; - - r = talloc(talloc_tos(), struct samr_DeleteGroupMember); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, r); - } - - r->out.result = _samr_DeleteGroupMember(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryGroupMember(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryGroupMember *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPMEMBER]; - - r = talloc(talloc_tos(), struct samr_QueryGroupMember); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, r); - } - - ZERO_STRUCT(r->out); - r->out.rids = talloc_zero(r, struct samr_RidTypeArray *); - if (r->out.rids == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryGroupMember(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_SetMemberAttributesOfGroup(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_SetMemberAttributesOfGroup *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP]; - - r = talloc(talloc_tos(), struct samr_SetMemberAttributesOfGroup); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, r); - } - - r->out.result = _samr_SetMemberAttributesOfGroup(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_OpenAlias(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_OpenAlias *r; - - call = &ndr_table_samr.calls[NDR_SAMR_OPENALIAS]; - - r = talloc(talloc_tos(), struct samr_OpenAlias); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OpenAlias, r); - } - - ZERO_STRUCT(r->out); - r->out.alias_handle = talloc_zero(r, struct policy_handle); - if (r->out.alias_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_OpenAlias(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OpenAlias, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryAliasInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryAliasInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYALIASINFO]; - - r = talloc(talloc_tos(), struct samr_QueryAliasInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union samr_AliasInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryAliasInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_SetAliasInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_SetAliasInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SETALIASINFO]; - - r = talloc(talloc_tos(), struct samr_SetAliasInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, r); - } - - r->out.result = _samr_SetAliasInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_DeleteDomAlias(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_DeleteDomAlias *r; - - call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMALIAS]; - - r = talloc(talloc_tos(), struct samr_DeleteDomAlias); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, r); - } - - ZERO_STRUCT(r->out); - r->out.alias_handle = r->in.alias_handle; - r->out.result = _samr_DeleteDomAlias(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_AddAliasMember(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_AddAliasMember *r; - - call = &ndr_table_samr.calls[NDR_SAMR_ADDALIASMEMBER]; - - r = talloc(talloc_tos(), struct samr_AddAliasMember); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_AddAliasMember, r); - } - - r->out.result = _samr_AddAliasMember(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_DeleteAliasMember(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_DeleteAliasMember *r; - - call = &ndr_table_samr.calls[NDR_SAMR_DELETEALIASMEMBER]; - - r = talloc(talloc_tos(), struct samr_DeleteAliasMember); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, r); - } - - r->out.result = _samr_DeleteAliasMember(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_GetMembersInAlias(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_GetMembersInAlias *r; - - call = &ndr_table_samr.calls[NDR_SAMR_GETMEMBERSINALIAS]; - - r = talloc(talloc_tos(), struct samr_GetMembersInAlias); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, r); - } - - ZERO_STRUCT(r->out); - r->out.sids = talloc_zero(r, struct lsa_SidArray); - if (r->out.sids == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_GetMembersInAlias(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_OpenUser(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_OpenUser *r; - - call = &ndr_table_samr.calls[NDR_SAMR_OPENUSER]; - - r = talloc(talloc_tos(), struct samr_OpenUser); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OpenUser, r); - } - - ZERO_STRUCT(r->out); - r->out.user_handle = talloc_zero(r, struct policy_handle); - if (r->out.user_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_OpenUser(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OpenUser, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_DeleteUser(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_DeleteUser *r; - - call = &ndr_table_samr.calls[NDR_SAMR_DELETEUSER]; - - r = talloc(talloc_tos(), struct samr_DeleteUser); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_DeleteUser, r); - } - - ZERO_STRUCT(r->out); - r->out.user_handle = r->in.user_handle; - r->out.result = _samr_DeleteUser(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_DeleteUser, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryUserInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryUserInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO]; - - r = talloc(talloc_tos(), struct samr_QueryUserInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union samr_UserInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryUserInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_SetUserInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_SetUserInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO]; - - r = talloc(talloc_tos(), struct samr_SetUserInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetUserInfo, r); - } - - r->out.result = _samr_SetUserInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_ChangePasswordUser(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_ChangePasswordUser *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER]; - - r = talloc(talloc_tos(), struct samr_ChangePasswordUser); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, r); - } - - r->out.result = _samr_ChangePasswordUser(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_GetGroupsForUser(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_GetGroupsForUser *r; - - call = &ndr_table_samr.calls[NDR_SAMR_GETGROUPSFORUSER]; - - r = talloc(talloc_tos(), struct samr_GetGroupsForUser); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, r); - } - - ZERO_STRUCT(r->out); - r->out.rids = talloc_zero(r, struct samr_RidWithAttributeArray *); - if (r->out.rids == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_GetGroupsForUser(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryDisplayInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryDisplayInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO]; - - r = talloc(talloc_tos(), struct samr_QueryDisplayInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.total_size = talloc_zero(r, uint32_t); - if (r->out.total_size == NULL) { - talloc_free(r); - return false; - } - - r->out.returned_size = talloc_zero(r, uint32_t); - if (r->out.returned_size == NULL) { - talloc_free(r); - return false; - } - - r->out.info = talloc_zero(r, union samr_DispInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryDisplayInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_GetDisplayEnumerationIndex(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_GetDisplayEnumerationIndex *r; - - call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX]; - - r = talloc(talloc_tos(), struct samr_GetDisplayEnumerationIndex); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, r); - } - - ZERO_STRUCT(r->out); - r->out.idx = talloc_zero(r, uint32_t); - if (r->out.idx == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_GetDisplayEnumerationIndex(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_TestPrivateFunctionsDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_TestPrivateFunctionsDomain *r; - - call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN]; - - r = talloc(talloc_tos(), struct samr_TestPrivateFunctionsDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, r); - } - - r->out.result = _samr_TestPrivateFunctionsDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_TestPrivateFunctionsUser(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_TestPrivateFunctionsUser *r; - - call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSUSER]; - - r = talloc(talloc_tos(), struct samr_TestPrivateFunctionsUser); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, r); - } - - r->out.result = _samr_TestPrivateFunctionsUser(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_GetUserPwInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_GetUserPwInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_GETUSERPWINFO]; - - r = talloc(talloc_tos(), struct samr_GetUserPwInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct samr_PwInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_GetUserPwInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_RemoveMemberFromForeignDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_RemoveMemberFromForeignDomain *r; - - call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN]; - - r = talloc(talloc_tos(), struct samr_RemoveMemberFromForeignDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, r); - } - - r->out.result = _samr_RemoveMemberFromForeignDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryDomainInfo2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryDomainInfo2 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO2]; - - r = talloc(talloc_tos(), struct samr_QueryDomainInfo2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union samr_DomainInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryDomainInfo2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryUserInfo2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryUserInfo2 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO2]; - - r = talloc(talloc_tos(), struct samr_QueryUserInfo2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union samr_UserInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryUserInfo2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryDisplayInfo2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryDisplayInfo2 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO2]; - - r = talloc(talloc_tos(), struct samr_QueryDisplayInfo2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, r); - } - - ZERO_STRUCT(r->out); - r->out.total_size = talloc_zero(r, uint32_t); - if (r->out.total_size == NULL) { - talloc_free(r); - return false; - } - - r->out.returned_size = talloc_zero(r, uint32_t); - if (r->out.returned_size == NULL) { - talloc_free(r); - return false; - } - - r->out.info = talloc_zero(r, union samr_DispInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryDisplayInfo2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_GetDisplayEnumerationIndex2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_GetDisplayEnumerationIndex2 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX2]; - - r = talloc(talloc_tos(), struct samr_GetDisplayEnumerationIndex2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, r); - } - - ZERO_STRUCT(r->out); - r->out.idx = talloc_zero(r, uint32_t); - if (r->out.idx == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_GetDisplayEnumerationIndex2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_CreateUser2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_CreateUser2 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER2]; - - r = talloc(talloc_tos(), struct samr_CreateUser2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_CreateUser2, r); - } - - ZERO_STRUCT(r->out); - r->out.user_handle = talloc_zero(r, struct policy_handle); - if (r->out.user_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.access_granted = talloc_zero(r, uint32_t); - if (r->out.access_granted == NULL) { - talloc_free(r); - return false; - } - - r->out.rid = talloc_zero(r, uint32_t); - if (r->out.rid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_CreateUser2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_CreateUser2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_QueryDisplayInfo3(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_QueryDisplayInfo3 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO3]; - - r = talloc(talloc_tos(), struct samr_QueryDisplayInfo3); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, r); - } - - ZERO_STRUCT(r->out); - r->out.total_size = talloc_zero(r, uint32_t); - if (r->out.total_size == NULL) { - talloc_free(r); - return false; - } - - r->out.returned_size = talloc_zero(r, uint32_t); - if (r->out.returned_size == NULL) { - talloc_free(r); - return false; - } - - r->out.info = talloc_zero(r, union samr_DispInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_QueryDisplayInfo3(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_AddMultipleMembersToAlias(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_AddMultipleMembersToAlias *r; - - call = &ndr_table_samr.calls[NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS]; - - r = talloc(talloc_tos(), struct samr_AddMultipleMembersToAlias); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, r); - } - - r->out.result = _samr_AddMultipleMembersToAlias(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_RemoveMultipleMembersFromAlias(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_RemoveMultipleMembersFromAlias *r; - - call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS]; - - r = talloc(talloc_tos(), struct samr_RemoveMultipleMembersFromAlias); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, r); - } - - r->out.result = _samr_RemoveMultipleMembersFromAlias(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_OemChangePasswordUser2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_OemChangePasswordUser2 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_OEMCHANGEPASSWORDUSER2]; - - r = talloc(talloc_tos(), struct samr_OemChangePasswordUser2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, r); - } - - r->out.result = _samr_OemChangePasswordUser2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_ChangePasswordUser2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_ChangePasswordUser2 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER2]; - - r = talloc(talloc_tos(), struct samr_ChangePasswordUser2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, r); - } - - r->out.result = _samr_ChangePasswordUser2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_GetDomPwInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_GetDomPwInfo *r; - - call = &ndr_table_samr.calls[NDR_SAMR_GETDOMPWINFO]; - - r = talloc(talloc_tos(), struct samr_GetDomPwInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct samr_PwInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_GetDomPwInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_Connect2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_Connect2 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CONNECT2]; - - r = talloc(talloc_tos(), struct samr_Connect2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect2, r); - } - - ZERO_STRUCT(r->out); - r->out.connect_handle = talloc_zero(r, struct policy_handle); - if (r->out.connect_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_Connect2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_SetUserInfo2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_SetUserInfo2 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO2]; - - r = talloc(talloc_tos(), struct samr_SetUserInfo2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, r); - } - - r->out.result = _samr_SetUserInfo2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_SetBootKeyInformation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_SetBootKeyInformation *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SETBOOTKEYINFORMATION]; - - r = talloc(talloc_tos(), struct samr_SetBootKeyInformation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, r); - } - - r->out.result = _samr_SetBootKeyInformation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_GetBootKeyInformation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_GetBootKeyInformation *r; - - call = &ndr_table_samr.calls[NDR_SAMR_GETBOOTKEYINFORMATION]; - - r = talloc(talloc_tos(), struct samr_GetBootKeyInformation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, r); - } - - ZERO_STRUCT(r->out); - r->out.unknown = talloc_zero(r, uint32_t); - if (r->out.unknown == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_GetBootKeyInformation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_Connect3(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_Connect3 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CONNECT3]; - - r = talloc(talloc_tos(), struct samr_Connect3); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect3, r); - } - - ZERO_STRUCT(r->out); - r->out.connect_handle = talloc_zero(r, struct policy_handle); - if (r->out.connect_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_Connect3(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect3, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_Connect4(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_Connect4 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CONNECT4]; - - r = talloc(talloc_tos(), struct samr_Connect4); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect4, r); - } - - ZERO_STRUCT(r->out); - r->out.connect_handle = talloc_zero(r, struct policy_handle); - if (r->out.connect_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_Connect4(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect4, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_ChangePasswordUser3(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_ChangePasswordUser3 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER3]; - - r = talloc(talloc_tos(), struct samr_ChangePasswordUser3); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, r); - } - - ZERO_STRUCT(r->out); - r->out.dominfo = talloc_zero(r, struct samr_DomInfo1 *); - if (r->out.dominfo == NULL) { - talloc_free(r); - return false; - } - - r->out.reject = talloc_zero(r, struct samr_ChangeReject *); - if (r->out.reject == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_ChangePasswordUser3(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_Connect5(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_Connect5 *r; - - call = &ndr_table_samr.calls[NDR_SAMR_CONNECT5]; - - r = talloc(talloc_tos(), struct samr_Connect5); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_Connect5, r); - } - - ZERO_STRUCT(r->out); - r->out.level_out = talloc_zero(r, uint32_t); - if (r->out.level_out == NULL) { - talloc_free(r); - return false; - } - - r->out.info_out = talloc_zero(r, union samr_ConnectInfo); - if (r->out.info_out == NULL) { - talloc_free(r); - return false; - } - - r->out.connect_handle = talloc_zero(r, struct policy_handle); - if (r->out.connect_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_Connect5(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_Connect5, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_RidToSid(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_RidToSid *r; - - call = &ndr_table_samr.calls[NDR_SAMR_RIDTOSID]; - - r = talloc(talloc_tos(), struct samr_RidToSid); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_RidToSid, r); - } - - ZERO_STRUCT(r->out); - r->out.sid = talloc_zero(r, struct dom_sid2 *); - if (r->out.sid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_RidToSid(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_RidToSid, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_SetDsrmPassword(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_SetDsrmPassword *r; - - call = &ndr_table_samr.calls[NDR_SAMR_SETDSRMPASSWORD]; - - r = talloc(talloc_tos(), struct samr_SetDsrmPassword); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, r); - } - - r->out.result = _samr_SetDsrmPassword(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_samr_ValidatePassword(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct samr_ValidatePassword *r; - - call = &ndr_table_samr.calls[NDR_SAMR_VALIDATEPASSWORD]; - - r = talloc(talloc_tos(), struct samr_ValidatePassword); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(samr_ValidatePassword, r); - } - - ZERO_STRUCT(r->out); - r->out.rep = talloc_zero(r, union samr_ValidatePasswordRep *); - if (r->out.rep == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _samr_ValidatePassword(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_samr_cmds[] = -{ - {"SAMR_CONNECT", NDR_SAMR_CONNECT, api_samr_Connect}, - {"SAMR_CLOSE", NDR_SAMR_CLOSE, api_samr_Close}, - {"SAMR_SETSECURITY", NDR_SAMR_SETSECURITY, api_samr_SetSecurity}, - {"SAMR_QUERYSECURITY", NDR_SAMR_QUERYSECURITY, api_samr_QuerySecurity}, - {"SAMR_SHUTDOWN", NDR_SAMR_SHUTDOWN, api_samr_Shutdown}, - {"SAMR_LOOKUPDOMAIN", NDR_SAMR_LOOKUPDOMAIN, api_samr_LookupDomain}, - {"SAMR_ENUMDOMAINS", NDR_SAMR_ENUMDOMAINS, api_samr_EnumDomains}, - {"SAMR_OPENDOMAIN", NDR_SAMR_OPENDOMAIN, api_samr_OpenDomain}, - {"SAMR_QUERYDOMAININFO", NDR_SAMR_QUERYDOMAININFO, api_samr_QueryDomainInfo}, - {"SAMR_SETDOMAININFO", NDR_SAMR_SETDOMAININFO, api_samr_SetDomainInfo}, - {"SAMR_CREATEDOMAINGROUP", NDR_SAMR_CREATEDOMAINGROUP, api_samr_CreateDomainGroup}, - {"SAMR_ENUMDOMAINGROUPS", NDR_SAMR_ENUMDOMAINGROUPS, api_samr_EnumDomainGroups}, - {"SAMR_CREATEUSER", NDR_SAMR_CREATEUSER, api_samr_CreateUser}, - {"SAMR_ENUMDOMAINUSERS", NDR_SAMR_ENUMDOMAINUSERS, api_samr_EnumDomainUsers}, - {"SAMR_CREATEDOMALIAS", NDR_SAMR_CREATEDOMALIAS, api_samr_CreateDomAlias}, - {"SAMR_ENUMDOMAINALIASES", NDR_SAMR_ENUMDOMAINALIASES, api_samr_EnumDomainAliases}, - {"SAMR_GETALIASMEMBERSHIP", NDR_SAMR_GETALIASMEMBERSHIP, api_samr_GetAliasMembership}, - {"SAMR_LOOKUPNAMES", NDR_SAMR_LOOKUPNAMES, api_samr_LookupNames}, - {"SAMR_LOOKUPRIDS", NDR_SAMR_LOOKUPRIDS, api_samr_LookupRids}, - {"SAMR_OPENGROUP", NDR_SAMR_OPENGROUP, api_samr_OpenGroup}, - {"SAMR_QUERYGROUPINFO", NDR_SAMR_QUERYGROUPINFO, api_samr_QueryGroupInfo}, - {"SAMR_SETGROUPINFO", NDR_SAMR_SETGROUPINFO, api_samr_SetGroupInfo}, - {"SAMR_ADDGROUPMEMBER", NDR_SAMR_ADDGROUPMEMBER, api_samr_AddGroupMember}, - {"SAMR_DELETEDOMAINGROUP", NDR_SAMR_DELETEDOMAINGROUP, api_samr_DeleteDomainGroup}, - {"SAMR_DELETEGROUPMEMBER", NDR_SAMR_DELETEGROUPMEMBER, api_samr_DeleteGroupMember}, - {"SAMR_QUERYGROUPMEMBER", NDR_SAMR_QUERYGROUPMEMBER, api_samr_QueryGroupMember}, - {"SAMR_SETMEMBERATTRIBUTESOFGROUP", NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, api_samr_SetMemberAttributesOfGroup}, - {"SAMR_OPENALIAS", NDR_SAMR_OPENALIAS, api_samr_OpenAlias}, - {"SAMR_QUERYALIASINFO", NDR_SAMR_QUERYALIASINFO, api_samr_QueryAliasInfo}, - {"SAMR_SETALIASINFO", NDR_SAMR_SETALIASINFO, api_samr_SetAliasInfo}, - {"SAMR_DELETEDOMALIAS", NDR_SAMR_DELETEDOMALIAS, api_samr_DeleteDomAlias}, - {"SAMR_ADDALIASMEMBER", NDR_SAMR_ADDALIASMEMBER, api_samr_AddAliasMember}, - {"SAMR_DELETEALIASMEMBER", NDR_SAMR_DELETEALIASMEMBER, api_samr_DeleteAliasMember}, - {"SAMR_GETMEMBERSINALIAS", NDR_SAMR_GETMEMBERSINALIAS, api_samr_GetMembersInAlias}, - {"SAMR_OPENUSER", NDR_SAMR_OPENUSER, api_samr_OpenUser}, - {"SAMR_DELETEUSER", NDR_SAMR_DELETEUSER, api_samr_DeleteUser}, - {"SAMR_QUERYUSERINFO", NDR_SAMR_QUERYUSERINFO, api_samr_QueryUserInfo}, - {"SAMR_SETUSERINFO", NDR_SAMR_SETUSERINFO, api_samr_SetUserInfo}, - {"SAMR_CHANGEPASSWORDUSER", NDR_SAMR_CHANGEPASSWORDUSER, api_samr_ChangePasswordUser}, - {"SAMR_GETGROUPSFORUSER", NDR_SAMR_GETGROUPSFORUSER, api_samr_GetGroupsForUser}, - {"SAMR_QUERYDISPLAYINFO", NDR_SAMR_QUERYDISPLAYINFO, api_samr_QueryDisplayInfo}, - {"SAMR_GETDISPLAYENUMERATIONINDEX", NDR_SAMR_GETDISPLAYENUMERATIONINDEX, api_samr_GetDisplayEnumerationIndex}, - {"SAMR_TESTPRIVATEFUNCTIONSDOMAIN", NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, api_samr_TestPrivateFunctionsDomain}, - {"SAMR_TESTPRIVATEFUNCTIONSUSER", NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, api_samr_TestPrivateFunctionsUser}, - {"SAMR_GETUSERPWINFO", NDR_SAMR_GETUSERPWINFO, api_samr_GetUserPwInfo}, - {"SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN", NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, api_samr_RemoveMemberFromForeignDomain}, - {"SAMR_QUERYDOMAININFO2", NDR_SAMR_QUERYDOMAININFO2, api_samr_QueryDomainInfo2}, - {"SAMR_QUERYUSERINFO2", NDR_SAMR_QUERYUSERINFO2, api_samr_QueryUserInfo2}, - {"SAMR_QUERYDISPLAYINFO2", NDR_SAMR_QUERYDISPLAYINFO2, api_samr_QueryDisplayInfo2}, - {"SAMR_GETDISPLAYENUMERATIONINDEX2", NDR_SAMR_GETDISPLAYENUMERATIONINDEX2, api_samr_GetDisplayEnumerationIndex2}, - {"SAMR_CREATEUSER2", NDR_SAMR_CREATEUSER2, api_samr_CreateUser2}, - {"SAMR_QUERYDISPLAYINFO3", NDR_SAMR_QUERYDISPLAYINFO3, api_samr_QueryDisplayInfo3}, - {"SAMR_ADDMULTIPLEMEMBERSTOALIAS", NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS, api_samr_AddMultipleMembersToAlias}, - {"SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS", NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS, api_samr_RemoveMultipleMembersFromAlias}, - {"SAMR_OEMCHANGEPASSWORDUSER2", NDR_SAMR_OEMCHANGEPASSWORDUSER2, api_samr_OemChangePasswordUser2}, - {"SAMR_CHANGEPASSWORDUSER2", NDR_SAMR_CHANGEPASSWORDUSER2, api_samr_ChangePasswordUser2}, - {"SAMR_GETDOMPWINFO", NDR_SAMR_GETDOMPWINFO, api_samr_GetDomPwInfo}, - {"SAMR_CONNECT2", NDR_SAMR_CONNECT2, api_samr_Connect2}, - {"SAMR_SETUSERINFO2", NDR_SAMR_SETUSERINFO2, api_samr_SetUserInfo2}, - {"SAMR_SETBOOTKEYINFORMATION", NDR_SAMR_SETBOOTKEYINFORMATION, api_samr_SetBootKeyInformation}, - {"SAMR_GETBOOTKEYINFORMATION", NDR_SAMR_GETBOOTKEYINFORMATION, api_samr_GetBootKeyInformation}, - {"SAMR_CONNECT3", NDR_SAMR_CONNECT3, api_samr_Connect3}, - {"SAMR_CONNECT4", NDR_SAMR_CONNECT4, api_samr_Connect4}, - {"SAMR_CHANGEPASSWORDUSER3", NDR_SAMR_CHANGEPASSWORDUSER3, api_samr_ChangePasswordUser3}, - {"SAMR_CONNECT5", NDR_SAMR_CONNECT5, api_samr_Connect5}, - {"SAMR_RIDTOSID", NDR_SAMR_RIDTOSID, api_samr_RidToSid}, - {"SAMR_SETDSRMPASSWORD", NDR_SAMR_SETDSRMPASSWORD, api_samr_SetDsrmPassword}, - {"SAMR_VALIDATEPASSWORD", NDR_SAMR_VALIDATEPASSWORD, api_samr_ValidatePassword}, -}; - -void samr_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_samr_cmds; - *n_fns = sizeof(api_samr_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_samr_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "samr", "samr", &ndr_table_samr.syntax_id, api_samr_cmds, sizeof(api_samr_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_samr.h b/source3/librpc/gen_ndr/srv_samr.h deleted file mode 100644 index 7d5cdd745d..0000000000 --- a/source3/librpc/gen_ndr/srv_samr.h +++ /dev/null @@ -1,74 +0,0 @@ -#include "librpc/gen_ndr/ndr_samr.h" -#ifndef __SRV_SAMR__ -#define __SRV_SAMR__ -NTSTATUS _samr_Connect(pipes_struct *p, struct samr_Connect *r); -NTSTATUS _samr_Close(pipes_struct *p, struct samr_Close *r); -NTSTATUS _samr_SetSecurity(pipes_struct *p, struct samr_SetSecurity *r); -NTSTATUS _samr_QuerySecurity(pipes_struct *p, struct samr_QuerySecurity *r); -NTSTATUS _samr_Shutdown(pipes_struct *p, struct samr_Shutdown *r); -NTSTATUS _samr_LookupDomain(pipes_struct *p, struct samr_LookupDomain *r); -NTSTATUS _samr_EnumDomains(pipes_struct *p, struct samr_EnumDomains *r); -NTSTATUS _samr_OpenDomain(pipes_struct *p, struct samr_OpenDomain *r); -NTSTATUS _samr_QueryDomainInfo(pipes_struct *p, struct samr_QueryDomainInfo *r); -NTSTATUS _samr_SetDomainInfo(pipes_struct *p, struct samr_SetDomainInfo *r); -NTSTATUS _samr_CreateDomainGroup(pipes_struct *p, struct samr_CreateDomainGroup *r); -NTSTATUS _samr_EnumDomainGroups(pipes_struct *p, struct samr_EnumDomainGroups *r); -NTSTATUS _samr_CreateUser(pipes_struct *p, struct samr_CreateUser *r); -NTSTATUS _samr_EnumDomainUsers(pipes_struct *p, struct samr_EnumDomainUsers *r); -NTSTATUS _samr_CreateDomAlias(pipes_struct *p, struct samr_CreateDomAlias *r); -NTSTATUS _samr_EnumDomainAliases(pipes_struct *p, struct samr_EnumDomainAliases *r); -NTSTATUS _samr_GetAliasMembership(pipes_struct *p, struct samr_GetAliasMembership *r); -NTSTATUS _samr_LookupNames(pipes_struct *p, struct samr_LookupNames *r); -NTSTATUS _samr_LookupRids(pipes_struct *p, struct samr_LookupRids *r); -NTSTATUS _samr_OpenGroup(pipes_struct *p, struct samr_OpenGroup *r); -NTSTATUS _samr_QueryGroupInfo(pipes_struct *p, struct samr_QueryGroupInfo *r); -NTSTATUS _samr_SetGroupInfo(pipes_struct *p, struct samr_SetGroupInfo *r); -NTSTATUS _samr_AddGroupMember(pipes_struct *p, struct samr_AddGroupMember *r); -NTSTATUS _samr_DeleteDomainGroup(pipes_struct *p, struct samr_DeleteDomainGroup *r); -NTSTATUS _samr_DeleteGroupMember(pipes_struct *p, struct samr_DeleteGroupMember *r); -NTSTATUS _samr_QueryGroupMember(pipes_struct *p, struct samr_QueryGroupMember *r); -NTSTATUS _samr_SetMemberAttributesOfGroup(pipes_struct *p, struct samr_SetMemberAttributesOfGroup *r); -NTSTATUS _samr_OpenAlias(pipes_struct *p, struct samr_OpenAlias *r); -NTSTATUS _samr_QueryAliasInfo(pipes_struct *p, struct samr_QueryAliasInfo *r); -NTSTATUS _samr_SetAliasInfo(pipes_struct *p, struct samr_SetAliasInfo *r); -NTSTATUS _samr_DeleteDomAlias(pipes_struct *p, struct samr_DeleteDomAlias *r); -NTSTATUS _samr_AddAliasMember(pipes_struct *p, struct samr_AddAliasMember *r); -NTSTATUS _samr_DeleteAliasMember(pipes_struct *p, struct samr_DeleteAliasMember *r); -NTSTATUS _samr_GetMembersInAlias(pipes_struct *p, struct samr_GetMembersInAlias *r); -NTSTATUS _samr_OpenUser(pipes_struct *p, struct samr_OpenUser *r); -NTSTATUS _samr_DeleteUser(pipes_struct *p, struct samr_DeleteUser *r); -NTSTATUS _samr_QueryUserInfo(pipes_struct *p, struct samr_QueryUserInfo *r); -NTSTATUS _samr_SetUserInfo(pipes_struct *p, struct samr_SetUserInfo *r); -NTSTATUS _samr_ChangePasswordUser(pipes_struct *p, struct samr_ChangePasswordUser *r); -NTSTATUS _samr_GetGroupsForUser(pipes_struct *p, struct samr_GetGroupsForUser *r); -NTSTATUS _samr_QueryDisplayInfo(pipes_struct *p, struct samr_QueryDisplayInfo *r); -NTSTATUS _samr_GetDisplayEnumerationIndex(pipes_struct *p, struct samr_GetDisplayEnumerationIndex *r); -NTSTATUS _samr_TestPrivateFunctionsDomain(pipes_struct *p, struct samr_TestPrivateFunctionsDomain *r); -NTSTATUS _samr_TestPrivateFunctionsUser(pipes_struct *p, struct samr_TestPrivateFunctionsUser *r); -NTSTATUS _samr_GetUserPwInfo(pipes_struct *p, struct samr_GetUserPwInfo *r); -NTSTATUS _samr_RemoveMemberFromForeignDomain(pipes_struct *p, struct samr_RemoveMemberFromForeignDomain *r); -NTSTATUS _samr_QueryDomainInfo2(pipes_struct *p, struct samr_QueryDomainInfo2 *r); -NTSTATUS _samr_QueryUserInfo2(pipes_struct *p, struct samr_QueryUserInfo2 *r); -NTSTATUS _samr_QueryDisplayInfo2(pipes_struct *p, struct samr_QueryDisplayInfo2 *r); -NTSTATUS _samr_GetDisplayEnumerationIndex2(pipes_struct *p, struct samr_GetDisplayEnumerationIndex2 *r); -NTSTATUS _samr_CreateUser2(pipes_struct *p, struct samr_CreateUser2 *r); -NTSTATUS _samr_QueryDisplayInfo3(pipes_struct *p, struct samr_QueryDisplayInfo3 *r); -NTSTATUS _samr_AddMultipleMembersToAlias(pipes_struct *p, struct samr_AddMultipleMembersToAlias *r); -NTSTATUS _samr_RemoveMultipleMembersFromAlias(pipes_struct *p, struct samr_RemoveMultipleMembersFromAlias *r); -NTSTATUS _samr_OemChangePasswordUser2(pipes_struct *p, struct samr_OemChangePasswordUser2 *r); -NTSTATUS _samr_ChangePasswordUser2(pipes_struct *p, struct samr_ChangePasswordUser2 *r); -NTSTATUS _samr_GetDomPwInfo(pipes_struct *p, struct samr_GetDomPwInfo *r); -NTSTATUS _samr_Connect2(pipes_struct *p, struct samr_Connect2 *r); -NTSTATUS _samr_SetUserInfo2(pipes_struct *p, struct samr_SetUserInfo2 *r); -NTSTATUS _samr_SetBootKeyInformation(pipes_struct *p, struct samr_SetBootKeyInformation *r); -NTSTATUS _samr_GetBootKeyInformation(pipes_struct *p, struct samr_GetBootKeyInformation *r); -NTSTATUS _samr_Connect3(pipes_struct *p, struct samr_Connect3 *r); -NTSTATUS _samr_Connect4(pipes_struct *p, struct samr_Connect4 *r); -NTSTATUS _samr_ChangePasswordUser3(pipes_struct *p, struct samr_ChangePasswordUser3 *r); -NTSTATUS _samr_Connect5(pipes_struct *p, struct samr_Connect5 *r); -NTSTATUS _samr_RidToSid(pipes_struct *p, struct samr_RidToSid *r); -NTSTATUS _samr_SetDsrmPassword(pipes_struct *p, struct samr_SetDsrmPassword *r); -NTSTATUS _samr_ValidatePassword(pipes_struct *p, struct samr_ValidatePassword *r); -void samr_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_samr_init(void); -#endif /* __SRV_SAMR__ */ diff --git a/source3/librpc/gen_ndr/srv_srvsvc.c b/source3/librpc/gen_ndr/srv_srvsvc.c deleted file mode 100644 index 59f51ba774..0000000000 --- a/source3/librpc/gen_ndr/srv_srvsvc.c +++ /dev/null @@ -1,4196 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_srvsvc.h" - -static bool api_srvsvc_NetCharDevEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetCharDevEnum *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVENUM]; - - r = talloc(talloc_tos(), struct srvsvc_NetCharDevEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.info_ctr = r->in.info_ctr; - r->out.resume_handle = r->in.resume_handle; - r->out.totalentries = talloc_zero(r, uint32_t); - if (r->out.totalentries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetCharDevEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetCharDevGetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetCharDevGetInfo *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVGETINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NetCharDevGetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevGetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union srvsvc_NetCharDevInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetCharDevGetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevGetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetCharDevControl(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetCharDevControl *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVCONTROL]; - - r = talloc(talloc_tos(), struct srvsvc_NetCharDevControl); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevControl, r); - } - - r->out.result = _srvsvc_NetCharDevControl(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevControl, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetCharDevQEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetCharDevQEnum *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQENUM]; - - r = talloc(talloc_tos(), struct srvsvc_NetCharDevQEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.info_ctr = r->in.info_ctr; - r->out.resume_handle = r->in.resume_handle; - r->out.totalentries = talloc_zero(r, uint32_t); - if (r->out.totalentries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetCharDevQEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetCharDevQGetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetCharDevQGetInfo *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQGETINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NetCharDevQGetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQGetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union srvsvc_NetCharDevQInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetCharDevQGetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQGetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetCharDevQSetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetCharDevQSetInfo *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQSETINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NetCharDevQSetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQSetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.parm_error = r->in.parm_error; - r->out.result = _srvsvc_NetCharDevQSetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQSetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetCharDevQPurge(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetCharDevQPurge *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQPURGE]; - - r = talloc(talloc_tos(), struct srvsvc_NetCharDevQPurge); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurge, r); - } - - r->out.result = _srvsvc_NetCharDevQPurge(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurge, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetCharDevQPurgeSelf(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetCharDevQPurgeSelf *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQPURGESELF]; - - r = talloc(talloc_tos(), struct srvsvc_NetCharDevQPurgeSelf); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetCharDevQPurgeSelf, r); - } - - r->out.result = _srvsvc_NetCharDevQPurgeSelf(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurgeSelf, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetConnEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetConnEnum *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCONNENUM]; - - r = talloc(talloc_tos(), struct srvsvc_NetConnEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetConnEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.info_ctr = r->in.info_ctr; - r->out.resume_handle = r->in.resume_handle; - r->out.totalentries = talloc_zero(r, uint32_t); - if (r->out.totalentries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetConnEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetConnEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetFileEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetFileEnum *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETFILEENUM]; - - r = talloc(talloc_tos(), struct srvsvc_NetFileEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetFileEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.info_ctr = r->in.info_ctr; - r->out.resume_handle = r->in.resume_handle; - r->out.totalentries = talloc_zero(r, uint32_t); - if (r->out.totalentries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetFileEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetFileEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetFileGetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetFileGetInfo *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETFILEGETINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NetFileGetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetFileGetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union srvsvc_NetFileInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetFileGetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetFileGetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetFileClose(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetFileClose *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETFILECLOSE]; - - r = talloc(talloc_tos(), struct srvsvc_NetFileClose); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetFileClose, r); - } - - r->out.result = _srvsvc_NetFileClose(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetFileClose, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetSessEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetSessEnum *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSESSENUM]; - - r = talloc(talloc_tos(), struct srvsvc_NetSessEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSessEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.info_ctr = r->in.info_ctr; - r->out.resume_handle = r->in.resume_handle; - r->out.totalentries = talloc_zero(r, uint32_t); - if (r->out.totalentries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetSessEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSessEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetSessDel(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetSessDel *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSESSDEL]; - - r = talloc(talloc_tos(), struct srvsvc_NetSessDel); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSessDel, r); - } - - r->out.result = _srvsvc_NetSessDel(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSessDel, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareAdd(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareAdd *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREADD]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareAdd); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareAdd, r); - } - - ZERO_STRUCT(r->out); - r->out.parm_error = r->in.parm_error; - r->out.result = _srvsvc_NetShareAdd(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareAdd, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareEnumAll(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareEnumAll *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREENUMALL]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareEnumAll); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnumAll, r); - } - - ZERO_STRUCT(r->out); - r->out.info_ctr = r->in.info_ctr; - r->out.resume_handle = r->in.resume_handle; - r->out.totalentries = talloc_zero(r, uint32_t); - if (r->out.totalentries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetShareEnumAll(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnumAll, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareGetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareGetInfo *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREGETINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareGetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareGetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union srvsvc_NetShareInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetShareGetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareGetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareSetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareSetInfo *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHARESETINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareSetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareSetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.parm_error = r->in.parm_error; - r->out.result = _srvsvc_NetShareSetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareSetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareDel(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareDel *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDEL]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareDel); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareDel, r); - } - - r->out.result = _srvsvc_NetShareDel(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDel, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareDelSticky(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareDelSticky *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDELSTICKY]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareDelSticky); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelSticky, r); - } - - r->out.result = _srvsvc_NetShareDelSticky(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelSticky, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareCheck(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareCheck *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHARECHECK]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareCheck); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareCheck, r); - } - - ZERO_STRUCT(r->out); - r->out.type = talloc_zero(r, enum srvsvc_ShareType); - if (r->out.type == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetShareCheck(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareCheck, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetSrvGetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetSrvGetInfo *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSRVGETINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NetSrvGetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSrvGetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union srvsvc_NetSrvInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetSrvGetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvGetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetSrvSetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetSrvSetInfo *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSRVSETINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NetSrvSetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSrvSetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.parm_error = r->in.parm_error; - r->out.result = _srvsvc_NetSrvSetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvSetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetDiskEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetDiskEnum *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETDISKENUM]; - - r = talloc(talloc_tos(), struct srvsvc_NetDiskEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetDiskEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.info = r->in.info; - r->out.resume_handle = r->in.resume_handle; - r->out.totalentries = talloc_zero(r, uint32_t); - if (r->out.totalentries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetDiskEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetDiskEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetServerStatisticsGet(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetServerStatisticsGet *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSERVERSTATISTICSGET]; - - r = talloc(talloc_tos(), struct srvsvc_NetServerStatisticsGet); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetServerStatisticsGet, r); - } - - ZERO_STRUCT(r->out); - r->out.stats = talloc_zero(r, struct srvsvc_Statistics *); - if (r->out.stats == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetServerStatisticsGet(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetServerStatisticsGet, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetTransportAdd(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetTransportAdd *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETTRANSPORTADD]; - - r = talloc(talloc_tos(), struct srvsvc_NetTransportAdd); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetTransportAdd, r); - } - - r->out.result = _srvsvc_NetTransportAdd(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportAdd, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetTransportEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetTransportEnum *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETTRANSPORTENUM]; - - r = talloc(talloc_tos(), struct srvsvc_NetTransportEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetTransportEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.transports = r->in.transports; - r->out.resume_handle = r->in.resume_handle; - r->out.totalentries = talloc_zero(r, uint32_t); - if (r->out.totalentries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetTransportEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetTransportDel(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetTransportDel *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETTRANSPORTDEL]; - - r = talloc(talloc_tos(), struct srvsvc_NetTransportDel); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetTransportDel, r); - } - - r->out.result = _srvsvc_NetTransportDel(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportDel, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetRemoteTOD(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetRemoteTOD *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETREMOTETOD]; - - r = talloc(talloc_tos(), struct srvsvc_NetRemoteTOD); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetRemoteTOD, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct srvsvc_NetRemoteTODInfo *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetRemoteTOD(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetRemoteTOD, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetSetServiceBits(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetSetServiceBits *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSETSERVICEBITS]; - - r = talloc(talloc_tos(), struct srvsvc_NetSetServiceBits); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSetServiceBits, r); - } - - r->out.result = _srvsvc_NetSetServiceBits(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSetServiceBits, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetPathType(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetPathType *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPATHTYPE]; - - r = talloc(talloc_tos(), struct srvsvc_NetPathType); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetPathType, r); - } - - ZERO_STRUCT(r->out); - r->out.pathtype = talloc_zero(r, uint32_t); - if (r->out.pathtype == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetPathType(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetPathType, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetPathCanonicalize(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetPathCanonicalize *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPATHCANONICALIZE]; - - r = talloc(talloc_tos(), struct srvsvc_NetPathCanonicalize); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetPathCanonicalize, r); - } - - ZERO_STRUCT(r->out); - r->out.pathtype = r->in.pathtype; - r->out.can_path = talloc_zero_array(r, uint8_t, r->in.maxbuf); - if (r->out.can_path == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetPathCanonicalize(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCanonicalize, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetPathCompare(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetPathCompare *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPATHCOMPARE]; - - r = talloc(talloc_tos(), struct srvsvc_NetPathCompare); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetPathCompare, r); - } - - r->out.result = _srvsvc_NetPathCompare(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCompare, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetNameValidate(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetNameValidate *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETNAMEVALIDATE]; - - r = talloc(talloc_tos(), struct srvsvc_NetNameValidate); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetNameValidate, r); - } - - r->out.result = _srvsvc_NetNameValidate(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetNameValidate, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRPRNAMECANONICALIZE *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRPRNAMECANONICALIZE]; - - r = talloc(talloc_tos(), struct srvsvc_NETRPRNAMECANONICALIZE); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, r); - } - - r->out.result = _srvsvc_NETRPRNAMECANONICALIZE(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetPRNameCompare(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetPRNameCompare *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPRNAMECOMPARE]; - - r = talloc(talloc_tos(), struct srvsvc_NetPRNameCompare); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetPRNameCompare, r); - } - - r->out.result = _srvsvc_NetPRNameCompare(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetPRNameCompare, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareEnum *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREENUM]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.info_ctr = r->in.info_ctr; - r->out.resume_handle = r->in.resume_handle; - r->out.totalentries = talloc_zero(r, uint32_t); - if (r->out.totalentries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetShareEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareDelStart(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareDelStart *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDELSTART]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareDelStart); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelStart, r); - } - - ZERO_STRUCT(r->out); - r->out.hnd = talloc_zero(r, struct policy_handle); - if (r->out.hnd == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetShareDelStart(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelStart, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetShareDelCommit(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetShareDelCommit *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDELCOMMIT]; - - r = talloc(talloc_tos(), struct srvsvc_NetShareDelCommit); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetShareDelCommit, r); - } - - ZERO_STRUCT(r->out); - r->out.hnd = r->in.hnd; - r->out.result = _srvsvc_NetShareDelCommit(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelCommit, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetGetFileSecurity(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetGetFileSecurity *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETGETFILESECURITY]; - - r = talloc(talloc_tos(), struct srvsvc_NetGetFileSecurity); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetGetFileSecurity, r); - } - - ZERO_STRUCT(r->out); - r->out.sd_buf = talloc_zero(r, struct sec_desc_buf *); - if (r->out.sd_buf == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _srvsvc_NetGetFileSecurity(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetGetFileSecurity, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetSetFileSecurity(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetSetFileSecurity *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSETFILESECURITY]; - - r = talloc(talloc_tos(), struct srvsvc_NetSetFileSecurity); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetSetFileSecurity, r); - } - - r->out.result = _srvsvc_NetSetFileSecurity(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetSetFileSecurity, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetServerTransportAddEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetServerTransportAddEx *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSERVERTRANSPORTADDEX]; - - r = talloc(talloc_tos(), struct srvsvc_NetServerTransportAddEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetServerTransportAddEx, r); - } - - r->out.result = _srvsvc_NetServerTransportAddEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetServerTransportAddEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NetServerSetServiceBitsEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NetServerSetServiceBitsEx *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSERVERSETSERVICEBITSEX]; - - r = talloc(talloc_tos(), struct srvsvc_NetServerSetServiceBitsEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NetServerSetServiceBitsEx, r); - } - - r->out.result = _srvsvc_NetServerSetServiceBitsEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NetServerSetServiceBitsEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSGETVERSION(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSGETVERSION *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSGETVERSION]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSGETVERSION); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSGETVERSION, r); - } - - r->out.result = _srvsvc_NETRDFSGETVERSION(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSGETVERSION, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSCREATELOCALPARTITION *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSCREATELOCALPARTITION]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSCREATELOCALPARTITION); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, r); - } - - r->out.result = _srvsvc_NETRDFSCREATELOCALPARTITION(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSDELETELOCALPARTITION *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSDELETELOCALPARTITION]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSDELETELOCALPARTITION); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, r); - } - - r->out.result = _srvsvc_NETRDFSDELETELOCALPARTITION(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSSETLOCALVOLUMESTATE); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, r); - } - - r->out.result = _srvsvc_NETRDFSSETLOCALVOLUMESTATE(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSSETSERVERINFO *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSSETSERVERINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSSETSERVERINFO); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSSETSERVERINFO, r); - } - - r->out.result = _srvsvc_NETRDFSSETSERVERINFO(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETSERVERINFO, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSCREATEEXITPOINT *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSCREATEEXITPOINT]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSCREATEEXITPOINT); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, r); - } - - r->out.result = _srvsvc_NETRDFSCREATEEXITPOINT(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSDELETEEXITPOINT *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSDELETEEXITPOINT]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSDELETEEXITPOINT); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, r); - } - - r->out.result = _srvsvc_NETRDFSDELETEEXITPOINT(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSMODIFYPREFIX *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSMODIFYPREFIX]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSMODIFYPREFIX); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, r); - } - - r->out.result = _srvsvc_NETRDFSMODIFYPREFIX(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSFIXLOCALVOLUME *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSFIXLOCALVOLUME]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSFIXLOCALVOLUME); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, r); - } - - r->out.result = _srvsvc_NETRDFSFIXLOCALVOLUME(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO]; - - r = talloc(talloc_tos(), struct srvsvc_NETRDFSMANAGERREPORTSITEINFO); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, r); - } - - r->out.result = _srvsvc_NETRDFSMANAGERREPORTSITEINFO(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct srvsvc_NETRSERVERTRANSPORTDELEX *r; - - call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRSERVERTRANSPORTDELEX]; - - r = talloc(talloc_tos(), struct srvsvc_NETRSERVERTRANSPORTDELEX); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, r); - } - - r->out.result = _srvsvc_NETRSERVERTRANSPORTDELEX(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_srvsvc_cmds[] = -{ - {"SRVSVC_NETCHARDEVENUM", NDR_SRVSVC_NETCHARDEVENUM, api_srvsvc_NetCharDevEnum}, - {"SRVSVC_NETCHARDEVGETINFO", NDR_SRVSVC_NETCHARDEVGETINFO, api_srvsvc_NetCharDevGetInfo}, - {"SRVSVC_NETCHARDEVCONTROL", NDR_SRVSVC_NETCHARDEVCONTROL, api_srvsvc_NetCharDevControl}, - {"SRVSVC_NETCHARDEVQENUM", NDR_SRVSVC_NETCHARDEVQENUM, api_srvsvc_NetCharDevQEnum}, - {"SRVSVC_NETCHARDEVQGETINFO", NDR_SRVSVC_NETCHARDEVQGETINFO, api_srvsvc_NetCharDevQGetInfo}, - {"SRVSVC_NETCHARDEVQSETINFO", NDR_SRVSVC_NETCHARDEVQSETINFO, api_srvsvc_NetCharDevQSetInfo}, - {"SRVSVC_NETCHARDEVQPURGE", NDR_SRVSVC_NETCHARDEVQPURGE, api_srvsvc_NetCharDevQPurge}, - {"SRVSVC_NETCHARDEVQPURGESELF", NDR_SRVSVC_NETCHARDEVQPURGESELF, api_srvsvc_NetCharDevQPurgeSelf}, - {"SRVSVC_NETCONNENUM", NDR_SRVSVC_NETCONNENUM, api_srvsvc_NetConnEnum}, - {"SRVSVC_NETFILEENUM", NDR_SRVSVC_NETFILEENUM, api_srvsvc_NetFileEnum}, - {"SRVSVC_NETFILEGETINFO", NDR_SRVSVC_NETFILEGETINFO, api_srvsvc_NetFileGetInfo}, - {"SRVSVC_NETFILECLOSE", NDR_SRVSVC_NETFILECLOSE, api_srvsvc_NetFileClose}, - {"SRVSVC_NETSESSENUM", NDR_SRVSVC_NETSESSENUM, api_srvsvc_NetSessEnum}, - {"SRVSVC_NETSESSDEL", NDR_SRVSVC_NETSESSDEL, api_srvsvc_NetSessDel}, - {"SRVSVC_NETSHAREADD", NDR_SRVSVC_NETSHAREADD, api_srvsvc_NetShareAdd}, - {"SRVSVC_NETSHAREENUMALL", NDR_SRVSVC_NETSHAREENUMALL, api_srvsvc_NetShareEnumAll}, - {"SRVSVC_NETSHAREGETINFO", NDR_SRVSVC_NETSHAREGETINFO, api_srvsvc_NetShareGetInfo}, - {"SRVSVC_NETSHARESETINFO", NDR_SRVSVC_NETSHARESETINFO, api_srvsvc_NetShareSetInfo}, - {"SRVSVC_NETSHAREDEL", NDR_SRVSVC_NETSHAREDEL, api_srvsvc_NetShareDel}, - {"SRVSVC_NETSHAREDELSTICKY", NDR_SRVSVC_NETSHAREDELSTICKY, api_srvsvc_NetShareDelSticky}, - {"SRVSVC_NETSHARECHECK", NDR_SRVSVC_NETSHARECHECK, api_srvsvc_NetShareCheck}, - {"SRVSVC_NETSRVGETINFO", NDR_SRVSVC_NETSRVGETINFO, api_srvsvc_NetSrvGetInfo}, - {"SRVSVC_NETSRVSETINFO", NDR_SRVSVC_NETSRVSETINFO, api_srvsvc_NetSrvSetInfo}, - {"SRVSVC_NETDISKENUM", NDR_SRVSVC_NETDISKENUM, api_srvsvc_NetDiskEnum}, - {"SRVSVC_NETSERVERSTATISTICSGET", NDR_SRVSVC_NETSERVERSTATISTICSGET, api_srvsvc_NetServerStatisticsGet}, - {"SRVSVC_NETTRANSPORTADD", NDR_SRVSVC_NETTRANSPORTADD, api_srvsvc_NetTransportAdd}, - {"SRVSVC_NETTRANSPORTENUM", NDR_SRVSVC_NETTRANSPORTENUM, api_srvsvc_NetTransportEnum}, - {"SRVSVC_NETTRANSPORTDEL", NDR_SRVSVC_NETTRANSPORTDEL, api_srvsvc_NetTransportDel}, - {"SRVSVC_NETREMOTETOD", NDR_SRVSVC_NETREMOTETOD, api_srvsvc_NetRemoteTOD}, - {"SRVSVC_NETSETSERVICEBITS", NDR_SRVSVC_NETSETSERVICEBITS, api_srvsvc_NetSetServiceBits}, - {"SRVSVC_NETPATHTYPE", NDR_SRVSVC_NETPATHTYPE, api_srvsvc_NetPathType}, - {"SRVSVC_NETPATHCANONICALIZE", NDR_SRVSVC_NETPATHCANONICALIZE, api_srvsvc_NetPathCanonicalize}, - {"SRVSVC_NETPATHCOMPARE", NDR_SRVSVC_NETPATHCOMPARE, api_srvsvc_NetPathCompare}, - {"SRVSVC_NETNAMEVALIDATE", NDR_SRVSVC_NETNAMEVALIDATE, api_srvsvc_NetNameValidate}, - {"SRVSVC_NETRPRNAMECANONICALIZE", NDR_SRVSVC_NETRPRNAMECANONICALIZE, api_srvsvc_NETRPRNAMECANONICALIZE}, - {"SRVSVC_NETPRNAMECOMPARE", NDR_SRVSVC_NETPRNAMECOMPARE, api_srvsvc_NetPRNameCompare}, - {"SRVSVC_NETSHAREENUM", NDR_SRVSVC_NETSHAREENUM, api_srvsvc_NetShareEnum}, - {"SRVSVC_NETSHAREDELSTART", NDR_SRVSVC_NETSHAREDELSTART, api_srvsvc_NetShareDelStart}, - {"SRVSVC_NETSHAREDELCOMMIT", NDR_SRVSVC_NETSHAREDELCOMMIT, api_srvsvc_NetShareDelCommit}, - {"SRVSVC_NETGETFILESECURITY", NDR_SRVSVC_NETGETFILESECURITY, api_srvsvc_NetGetFileSecurity}, - {"SRVSVC_NETSETFILESECURITY", NDR_SRVSVC_NETSETFILESECURITY, api_srvsvc_NetSetFileSecurity}, - {"SRVSVC_NETSERVERTRANSPORTADDEX", NDR_SRVSVC_NETSERVERTRANSPORTADDEX, api_srvsvc_NetServerTransportAddEx}, - {"SRVSVC_NETSERVERSETSERVICEBITSEX", NDR_SRVSVC_NETSERVERSETSERVICEBITSEX, api_srvsvc_NetServerSetServiceBitsEx}, - {"SRVSVC_NETRDFSGETVERSION", NDR_SRVSVC_NETRDFSGETVERSION, api_srvsvc_NETRDFSGETVERSION}, - {"SRVSVC_NETRDFSCREATELOCALPARTITION", NDR_SRVSVC_NETRDFSCREATELOCALPARTITION, api_srvsvc_NETRDFSCREATELOCALPARTITION}, - {"SRVSVC_NETRDFSDELETELOCALPARTITION", NDR_SRVSVC_NETRDFSDELETELOCALPARTITION, api_srvsvc_NETRDFSDELETELOCALPARTITION}, - {"SRVSVC_NETRDFSSETLOCALVOLUMESTATE", NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE, api_srvsvc_NETRDFSSETLOCALVOLUMESTATE}, - {"SRVSVC_NETRDFSSETSERVERINFO", NDR_SRVSVC_NETRDFSSETSERVERINFO, api_srvsvc_NETRDFSSETSERVERINFO}, - {"SRVSVC_NETRDFSCREATEEXITPOINT", NDR_SRVSVC_NETRDFSCREATEEXITPOINT, api_srvsvc_NETRDFSCREATEEXITPOINT}, - {"SRVSVC_NETRDFSDELETEEXITPOINT", NDR_SRVSVC_NETRDFSDELETEEXITPOINT, api_srvsvc_NETRDFSDELETEEXITPOINT}, - {"SRVSVC_NETRDFSMODIFYPREFIX", NDR_SRVSVC_NETRDFSMODIFYPREFIX, api_srvsvc_NETRDFSMODIFYPREFIX}, - {"SRVSVC_NETRDFSFIXLOCALVOLUME", NDR_SRVSVC_NETRDFSFIXLOCALVOLUME, api_srvsvc_NETRDFSFIXLOCALVOLUME}, - {"SRVSVC_NETRDFSMANAGERREPORTSITEINFO", NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO, api_srvsvc_NETRDFSMANAGERREPORTSITEINFO}, - {"SRVSVC_NETRSERVERTRANSPORTDELEX", NDR_SRVSVC_NETRSERVERTRANSPORTDELEX, api_srvsvc_NETRSERVERTRANSPORTDELEX}, -}; - -void srvsvc_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_srvsvc_cmds; - *n_fns = sizeof(api_srvsvc_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_srvsvc_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "srvsvc", "srvsvc", &ndr_table_srvsvc.syntax_id, api_srvsvc_cmds, sizeof(api_srvsvc_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_srvsvc.h b/source3/librpc/gen_ndr/srv_srvsvc.h deleted file mode 100644 index 1e1ebb1904..0000000000 --- a/source3/librpc/gen_ndr/srv_srvsvc.h +++ /dev/null @@ -1,60 +0,0 @@ -#include "librpc/gen_ndr/ndr_srvsvc.h" -#ifndef __SRV_SRVSVC__ -#define __SRV_SRVSVC__ -WERROR _srvsvc_NetCharDevEnum(pipes_struct *p, struct srvsvc_NetCharDevEnum *r); -WERROR _srvsvc_NetCharDevGetInfo(pipes_struct *p, struct srvsvc_NetCharDevGetInfo *r); -WERROR _srvsvc_NetCharDevControl(pipes_struct *p, struct srvsvc_NetCharDevControl *r); -WERROR _srvsvc_NetCharDevQEnum(pipes_struct *p, struct srvsvc_NetCharDevQEnum *r); -WERROR _srvsvc_NetCharDevQGetInfo(pipes_struct *p, struct srvsvc_NetCharDevQGetInfo *r); -WERROR _srvsvc_NetCharDevQSetInfo(pipes_struct *p, struct srvsvc_NetCharDevQSetInfo *r); -WERROR _srvsvc_NetCharDevQPurge(pipes_struct *p, struct srvsvc_NetCharDevQPurge *r); -WERROR _srvsvc_NetCharDevQPurgeSelf(pipes_struct *p, struct srvsvc_NetCharDevQPurgeSelf *r); -WERROR _srvsvc_NetConnEnum(pipes_struct *p, struct srvsvc_NetConnEnum *r); -WERROR _srvsvc_NetFileEnum(pipes_struct *p, struct srvsvc_NetFileEnum *r); -WERROR _srvsvc_NetFileGetInfo(pipes_struct *p, struct srvsvc_NetFileGetInfo *r); -WERROR _srvsvc_NetFileClose(pipes_struct *p, struct srvsvc_NetFileClose *r); -WERROR _srvsvc_NetSessEnum(pipes_struct *p, struct srvsvc_NetSessEnum *r); -WERROR _srvsvc_NetSessDel(pipes_struct *p, struct srvsvc_NetSessDel *r); -WERROR _srvsvc_NetShareAdd(pipes_struct *p, struct srvsvc_NetShareAdd *r); -WERROR _srvsvc_NetShareEnumAll(pipes_struct *p, struct srvsvc_NetShareEnumAll *r); -WERROR _srvsvc_NetShareGetInfo(pipes_struct *p, struct srvsvc_NetShareGetInfo *r); -WERROR _srvsvc_NetShareSetInfo(pipes_struct *p, struct srvsvc_NetShareSetInfo *r); -WERROR _srvsvc_NetShareDel(pipes_struct *p, struct srvsvc_NetShareDel *r); -WERROR _srvsvc_NetShareDelSticky(pipes_struct *p, struct srvsvc_NetShareDelSticky *r); -WERROR _srvsvc_NetShareCheck(pipes_struct *p, struct srvsvc_NetShareCheck *r); -WERROR _srvsvc_NetSrvGetInfo(pipes_struct *p, struct srvsvc_NetSrvGetInfo *r); -WERROR _srvsvc_NetSrvSetInfo(pipes_struct *p, struct srvsvc_NetSrvSetInfo *r); -WERROR _srvsvc_NetDiskEnum(pipes_struct *p, struct srvsvc_NetDiskEnum *r); -WERROR _srvsvc_NetServerStatisticsGet(pipes_struct *p, struct srvsvc_NetServerStatisticsGet *r); -WERROR _srvsvc_NetTransportAdd(pipes_struct *p, struct srvsvc_NetTransportAdd *r); -WERROR _srvsvc_NetTransportEnum(pipes_struct *p, struct srvsvc_NetTransportEnum *r); -WERROR _srvsvc_NetTransportDel(pipes_struct *p, struct srvsvc_NetTransportDel *r); -WERROR _srvsvc_NetRemoteTOD(pipes_struct *p, struct srvsvc_NetRemoteTOD *r); -WERROR _srvsvc_NetSetServiceBits(pipes_struct *p, struct srvsvc_NetSetServiceBits *r); -WERROR _srvsvc_NetPathType(pipes_struct *p, struct srvsvc_NetPathType *r); -WERROR _srvsvc_NetPathCanonicalize(pipes_struct *p, struct srvsvc_NetPathCanonicalize *r); -WERROR _srvsvc_NetPathCompare(pipes_struct *p, struct srvsvc_NetPathCompare *r); -WERROR _srvsvc_NetNameValidate(pipes_struct *p, struct srvsvc_NetNameValidate *r); -WERROR _srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p, struct srvsvc_NETRPRNAMECANONICALIZE *r); -WERROR _srvsvc_NetPRNameCompare(pipes_struct *p, struct srvsvc_NetPRNameCompare *r); -WERROR _srvsvc_NetShareEnum(pipes_struct *p, struct srvsvc_NetShareEnum *r); -WERROR _srvsvc_NetShareDelStart(pipes_struct *p, struct srvsvc_NetShareDelStart *r); -WERROR _srvsvc_NetShareDelCommit(pipes_struct *p, struct srvsvc_NetShareDelCommit *r); -WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p, struct srvsvc_NetGetFileSecurity *r); -WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p, struct srvsvc_NetSetFileSecurity *r); -WERROR _srvsvc_NetServerTransportAddEx(pipes_struct *p, struct srvsvc_NetServerTransportAddEx *r); -WERROR _srvsvc_NetServerSetServiceBitsEx(pipes_struct *p, struct srvsvc_NetServerSetServiceBitsEx *r); -WERROR _srvsvc_NETRDFSGETVERSION(pipes_struct *p, struct srvsvc_NETRDFSGETVERSION *r); -WERROR _srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p, struct srvsvc_NETRDFSCREATELOCALPARTITION *r); -WERROR _srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p, struct srvsvc_NETRDFSDELETELOCALPARTITION *r); -WERROR _srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p, struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r); -WERROR _srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p, struct srvsvc_NETRDFSSETSERVERINFO *r); -WERROR _srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p, struct srvsvc_NETRDFSCREATEEXITPOINT *r); -WERROR _srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p, struct srvsvc_NETRDFSDELETEEXITPOINT *r); -WERROR _srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p, struct srvsvc_NETRDFSMODIFYPREFIX *r); -WERROR _srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p, struct srvsvc_NETRDFSFIXLOCALVOLUME *r); -WERROR _srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p, struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r); -WERROR _srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p, struct srvsvc_NETRSERVERTRANSPORTDELEX *r); -void srvsvc_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_srvsvc_init(void); -#endif /* __SRV_SRVSVC__ */ diff --git a/source3/librpc/gen_ndr/srv_svcctl.c b/source3/librpc/gen_ndr/srv_svcctl.c deleted file mode 100644 index 5b30bf00f7..0000000000 --- a/source3/librpc/gen_ndr/srv_svcctl.c +++ /dev/null @@ -1,3615 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_svcctl.h" - -static bool api_svcctl_CloseServiceHandle(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_CloseServiceHandle *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_CLOSESERVICEHANDLE]; - - r = talloc(talloc_tos(), struct svcctl_CloseServiceHandle); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = r->in.handle; - r->out.result = _svcctl_CloseServiceHandle(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_ControlService(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_ControlService *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_CONTROLSERVICE]; - - r = talloc(talloc_tos(), struct svcctl_ControlService); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ControlService, r); - } - - ZERO_STRUCT(r->out); - r->out.service_status = talloc_zero(r, struct SERVICE_STATUS); - if (r->out.service_status == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_ControlService(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ControlService, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_DeleteService(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_DeleteService *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_DELETESERVICE]; - - r = talloc(talloc_tos(), struct svcctl_DeleteService); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_DeleteService, r); - } - - r->out.result = _svcctl_DeleteService(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_LockServiceDatabase(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_LockServiceDatabase *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_LOCKSERVICEDATABASE]; - - r = talloc(talloc_tos(), struct svcctl_LockServiceDatabase); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, r); - } - - ZERO_STRUCT(r->out); - r->out.lock = talloc_zero(r, struct policy_handle); - if (r->out.lock == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_LockServiceDatabase(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_QueryServiceObjectSecurity(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_QueryServiceObjectSecurity *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY]; - - r = talloc(talloc_tos(), struct svcctl_QueryServiceObjectSecurity); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, r); - } - - ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buffer_size); - if (r->out.buffer == NULL) { - talloc_free(r); - return false; - } - - r->out.needed = talloc_zero(r, uint32_t); - if (r->out.needed == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_QueryServiceObjectSecurity(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_SetServiceObjectSecurity(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_SetServiceObjectSecurity *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICEOBJECTSECURITY]; - - r = talloc(talloc_tos(), struct svcctl_SetServiceObjectSecurity); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, r); - } - - r->out.result = _svcctl_SetServiceObjectSecurity(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_QueryServiceStatus(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_QueryServiceStatus *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUS]; - - r = talloc(talloc_tos(), struct svcctl_QueryServiceStatus); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, r); - } - - ZERO_STRUCT(r->out); - r->out.service_status = talloc_zero(r, struct SERVICE_STATUS); - if (r->out.service_status == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_QueryServiceStatus(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_SetServiceStatus(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_SetServiceStatus *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICESTATUS]; - - r = talloc(talloc_tos(), struct svcctl_SetServiceStatus); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, r); - } - - r->out.result = _svcctl_SetServiceStatus(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_UnlockServiceDatabase(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_UnlockServiceDatabase *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_UNLOCKSERVICEDATABASE]; - - r = talloc(talloc_tos(), struct svcctl_UnlockServiceDatabase); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, r); - } - - ZERO_STRUCT(r->out); - r->out.lock = r->in.lock; - r->out.result = _svcctl_UnlockServiceDatabase(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_NotifyBootConfigStatus(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_NotifyBootConfigStatus *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS]; - - r = talloc(talloc_tos(), struct svcctl_NotifyBootConfigStatus); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, r); - } - - r->out.result = _svcctl_NotifyBootConfigStatus(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_SCSetServiceBitsW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_SCSetServiceBitsW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSW]; - - r = talloc(talloc_tos(), struct svcctl_SCSetServiceBitsW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, r); - } - - r->out.result = _svcctl_SCSetServiceBitsW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_ChangeServiceConfigW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_ChangeServiceConfigW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGW]; - - r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfigW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, r); - } - - ZERO_STRUCT(r->out); - r->out.tag_id = talloc_zero(r, uint32_t); - if (r->out.tag_id == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_ChangeServiceConfigW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_CreateServiceW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_CreateServiceW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEW]; - - r = talloc(talloc_tos(), struct svcctl_CreateServiceW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, r); - } - - ZERO_STRUCT(r->out); - r->out.TagId = r->in.TagId; - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_CreateServiceW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_EnumDependentServicesW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_EnumDependentServicesW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESW]; - - r = talloc(talloc_tos(), struct svcctl_EnumDependentServicesW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, r); - } - - ZERO_STRUCT(r->out); - r->out.service_status = talloc_zero_array(r, uint8_t, r->in.buf_size); - if (r->out.service_status == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.services_returned = talloc_zero(r, uint32_t); - if (r->out.services_returned == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_EnumDependentServicesW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_EnumServicesStatusW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_EnumServicesStatusW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSW]; - - r = talloc(talloc_tos(), struct svcctl_EnumServicesStatusW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.service = talloc_zero_array(r, uint8_t, r->in.buf_size); - if (r->out.service == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.services_returned = talloc_zero(r, uint32_t); - if (r->out.services_returned == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_EnumServicesStatusW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_OpenSCManagerW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_OpenSCManagerW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERW]; - - r = talloc(talloc_tos(), struct svcctl_OpenSCManagerW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_OpenSCManagerW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_OpenServiceW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_OpenServiceW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEW]; - - r = talloc(talloc_tos(), struct svcctl_OpenServiceW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_OpenServiceW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_QueryServiceConfigW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_QueryServiceConfigW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGW]; - - r = talloc(talloc_tos(), struct svcctl_QueryServiceConfigW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, r); - } - - ZERO_STRUCT(r->out); - r->out.query = talloc_zero(r, struct QUERY_SERVICE_CONFIG); - if (r->out.query == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_QueryServiceConfigW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_QueryServiceLockStatusW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_QueryServiceLockStatusW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSW]; - - r = talloc(talloc_tos(), struct svcctl_QueryServiceLockStatusW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, r); - } - - ZERO_STRUCT(r->out); - r->out.lock_status = talloc_zero(r, struct SERVICE_LOCK_STATUS); - if (r->out.lock_status == NULL) { - talloc_free(r); - return false; - } - - r->out.required_buf_size = talloc_zero(r, uint32_t); - if (r->out.required_buf_size == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_QueryServiceLockStatusW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_StartServiceW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_StartServiceW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEW]; - - r = talloc(talloc_tos(), struct svcctl_StartServiceW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, r); - } - - r->out.result = _svcctl_StartServiceW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_GetServiceDisplayNameW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_GetServiceDisplayNameW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEW]; - - r = talloc(talloc_tos(), struct svcctl_GetServiceDisplayNameW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, r); - } - - ZERO_STRUCT(r->out); - r->out.display_name_length = r->in.display_name_length; - r->out.display_name = talloc_zero(r, const char *); - if (r->out.display_name == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_GetServiceDisplayNameW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_GetServiceKeyNameW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_GetServiceKeyNameW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEW]; - - r = talloc(talloc_tos(), struct svcctl_GetServiceKeyNameW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, r); - } - - ZERO_STRUCT(r->out); - r->out.display_name_length = r->in.display_name_length; - r->out.key_name = talloc_zero(r, const char *); - if (r->out.key_name == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_GetServiceKeyNameW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_SCSetServiceBitsA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_SCSetServiceBitsA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSA]; - - r = talloc(talloc_tos(), struct svcctl_SCSetServiceBitsA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, r); - } - - r->out.result = _svcctl_SCSetServiceBitsA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_ChangeServiceConfigA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_ChangeServiceConfigA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGA]; - - r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfigA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, r); - } - - ZERO_STRUCT(r->out); - r->out.tag_id = talloc_zero(r, uint32_t); - if (r->out.tag_id == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_ChangeServiceConfigA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_CreateServiceA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_CreateServiceA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEA]; - - r = talloc(talloc_tos(), struct svcctl_CreateServiceA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, r); - } - - ZERO_STRUCT(r->out); - r->out.TagId = talloc_zero(r, uint32_t); - if (r->out.TagId == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_CreateServiceA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_EnumDependentServicesA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_EnumDependentServicesA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESA]; - - r = talloc(talloc_tos(), struct svcctl_EnumDependentServicesA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, r); - } - - ZERO_STRUCT(r->out); - r->out.service_status = talloc_zero(r, struct ENUM_SERVICE_STATUS); - if (r->out.service_status == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.services_returned = talloc_zero(r, uint32_t); - if (r->out.services_returned == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_EnumDependentServicesA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_EnumServicesStatusA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_EnumServicesStatusA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSA]; - - r = talloc(talloc_tos(), struct svcctl_EnumServicesStatusA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.service = talloc_zero_array(r, uint8_t, r->in.buf_size); - if (r->out.service == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.services_returned = talloc_zero(r, uint32_t); - if (r->out.services_returned == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_EnumServicesStatusA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_OpenSCManagerA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_OpenSCManagerA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERA]; - - r = talloc(talloc_tos(), struct svcctl_OpenSCManagerA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_OpenSCManagerA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_OpenServiceA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_OpenServiceA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEA]; - - r = talloc(talloc_tos(), struct svcctl_OpenServiceA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, r); - } - - r->out.result = _svcctl_OpenServiceA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_QueryServiceConfigA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_QueryServiceConfigA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGA]; - - r = talloc(talloc_tos(), struct svcctl_QueryServiceConfigA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, r); - } - - ZERO_STRUCT(r->out); - r->out.query = talloc_zero_array(r, uint8_t, r->in.buf_size); - if (r->out.query == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_QueryServiceConfigA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_QueryServiceLockStatusA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_QueryServiceLockStatusA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSA]; - - r = talloc(talloc_tos(), struct svcctl_QueryServiceLockStatusA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, r); - } - - ZERO_STRUCT(r->out); - r->out.lock_status = talloc_zero(r, struct SERVICE_LOCK_STATUS); - if (r->out.lock_status == NULL) { - talloc_free(r); - return false; - } - - r->out.required_buf_size = talloc_zero(r, uint32_t); - if (r->out.required_buf_size == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_QueryServiceLockStatusA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_StartServiceA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_StartServiceA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEA]; - - r = talloc(talloc_tos(), struct svcctl_StartServiceA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, r); - } - - r->out.result = _svcctl_StartServiceA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_GetServiceDisplayNameA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_GetServiceDisplayNameA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEA]; - - r = talloc(talloc_tos(), struct svcctl_GetServiceDisplayNameA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, r); - } - - ZERO_STRUCT(r->out); - r->out.display_name_length = r->in.display_name_length; - r->out.display_name = talloc_zero(r, const char *); - if (r->out.display_name == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_GetServiceDisplayNameA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_GetServiceKeyNameA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_GetServiceKeyNameA *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEA]; - - r = talloc(talloc_tos(), struct svcctl_GetServiceKeyNameA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, r); - } - - ZERO_STRUCT(r->out); - r->out.display_name_length = r->in.display_name_length; - r->out.key_name = talloc_zero(r, const char *); - if (r->out.key_name == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_GetServiceKeyNameA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_GetCurrentGroupeStateW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_GetCurrentGroupeStateW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETCURRENTGROUPESTATEW]; - - r = talloc(talloc_tos(), struct svcctl_GetCurrentGroupeStateW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, r); - } - - r->out.result = _svcctl_GetCurrentGroupeStateW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_EnumServiceGroupW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_EnumServiceGroupW *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICEGROUPW]; - - r = talloc(talloc_tos(), struct svcctl_EnumServiceGroupW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, r); - } - - r->out.result = _svcctl_EnumServiceGroupW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_ChangeServiceConfig2A(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_ChangeServiceConfig2A *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2A]; - - r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfig2A); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, r); - } - - r->out.result = _svcctl_ChangeServiceConfig2A(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_ChangeServiceConfig2W(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_ChangeServiceConfig2W *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2W]; - - r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfig2W); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, r); - } - - r->out.result = _svcctl_ChangeServiceConfig2W(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_QueryServiceConfig2A(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_QueryServiceConfig2A *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2A]; - - r = talloc(talloc_tos(), struct svcctl_QueryServiceConfig2A); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, r); - } - - ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size); - if (r->out.buffer == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_QueryServiceConfig2A(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_QueryServiceConfig2W(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_QueryServiceConfig2W *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2W]; - - r = talloc(talloc_tos(), struct svcctl_QueryServiceConfig2W); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, r); - } - - ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size); - if (r->out.buffer == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_QueryServiceConfig2W(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_QueryServiceStatusEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_QueryServiceStatusEx *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUSEX]; - - r = talloc(talloc_tos(), struct svcctl_QueryServiceStatusEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, r); - } - - ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size); - if (r->out.buffer == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _svcctl_QueryServiceStatusEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_EnumServicesStatusExA(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct EnumServicesStatusExA *r; - - call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXA]; - - r = talloc(talloc_tos(), struct EnumServicesStatusExA); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.services = talloc_zero_array(r, uint8_t, r->in.buf_size); - if (r->out.services == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.service_returned = talloc_zero(r, uint32_t); - if (r->out.service_returned == NULL) { - talloc_free(r); - return false; - } - - r->out.group_name = talloc_zero(r, const char *); - if (r->out.group_name == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _EnumServicesStatusExA(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_EnumServicesStatusExW(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct EnumServicesStatusExW *r; - - call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXW]; - - r = talloc(talloc_tos(), struct EnumServicesStatusExW); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, r); - } - - ZERO_STRUCT(r->out); - r->out.resume_handle = r->in.resume_handle; - r->out.services = talloc_zero_array(r, uint8_t, r->in.buf_size); - if (r->out.services == NULL) { - talloc_free(r); - return false; - } - - r->out.bytes_needed = talloc_zero(r, uint32_t); - if (r->out.bytes_needed == NULL) { - talloc_free(r); - return false; - } - - r->out.service_returned = talloc_zero(r, uint32_t); - if (r->out.service_returned == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _EnumServicesStatusExW(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_svcctl_SCSendTSMessage(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct svcctl_SCSendTSMessage *r; - - call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSENDTSMESSAGE]; - - r = talloc(talloc_tos(), struct svcctl_SCSendTSMessage); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, r); - } - - r->out.result = _svcctl_SCSendTSMessage(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_svcctl_cmds[] = -{ - {"SVCCTL_CLOSESERVICEHANDLE", NDR_SVCCTL_CLOSESERVICEHANDLE, api_svcctl_CloseServiceHandle}, - {"SVCCTL_CONTROLSERVICE", NDR_SVCCTL_CONTROLSERVICE, api_svcctl_ControlService}, - {"SVCCTL_DELETESERVICE", NDR_SVCCTL_DELETESERVICE, api_svcctl_DeleteService}, - {"SVCCTL_LOCKSERVICEDATABASE", NDR_SVCCTL_LOCKSERVICEDATABASE, api_svcctl_LockServiceDatabase}, - {"SVCCTL_QUERYSERVICEOBJECTSECURITY", NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY, api_svcctl_QueryServiceObjectSecurity}, - {"SVCCTL_SETSERVICEOBJECTSECURITY", NDR_SVCCTL_SETSERVICEOBJECTSECURITY, api_svcctl_SetServiceObjectSecurity}, - {"SVCCTL_QUERYSERVICESTATUS", NDR_SVCCTL_QUERYSERVICESTATUS, api_svcctl_QueryServiceStatus}, - {"SVCCTL_SETSERVICESTATUS", NDR_SVCCTL_SETSERVICESTATUS, api_svcctl_SetServiceStatus}, - {"SVCCTL_UNLOCKSERVICEDATABASE", NDR_SVCCTL_UNLOCKSERVICEDATABASE, api_svcctl_UnlockServiceDatabase}, - {"SVCCTL_NOTIFYBOOTCONFIGSTATUS", NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS, api_svcctl_NotifyBootConfigStatus}, - {"SVCCTL_SCSETSERVICEBITSW", NDR_SVCCTL_SCSETSERVICEBITSW, api_svcctl_SCSetServiceBitsW}, - {"SVCCTL_CHANGESERVICECONFIGW", NDR_SVCCTL_CHANGESERVICECONFIGW, api_svcctl_ChangeServiceConfigW}, - {"SVCCTL_CREATESERVICEW", NDR_SVCCTL_CREATESERVICEW, api_svcctl_CreateServiceW}, - {"SVCCTL_ENUMDEPENDENTSERVICESW", NDR_SVCCTL_ENUMDEPENDENTSERVICESW, api_svcctl_EnumDependentServicesW}, - {"SVCCTL_ENUMSERVICESSTATUSW", NDR_SVCCTL_ENUMSERVICESSTATUSW, api_svcctl_EnumServicesStatusW}, - {"SVCCTL_OPENSCMANAGERW", NDR_SVCCTL_OPENSCMANAGERW, api_svcctl_OpenSCManagerW}, - {"SVCCTL_OPENSERVICEW", NDR_SVCCTL_OPENSERVICEW, api_svcctl_OpenServiceW}, - {"SVCCTL_QUERYSERVICECONFIGW", NDR_SVCCTL_QUERYSERVICECONFIGW, api_svcctl_QueryServiceConfigW}, - {"SVCCTL_QUERYSERVICELOCKSTATUSW", NDR_SVCCTL_QUERYSERVICELOCKSTATUSW, api_svcctl_QueryServiceLockStatusW}, - {"SVCCTL_STARTSERVICEW", NDR_SVCCTL_STARTSERVICEW, api_svcctl_StartServiceW}, - {"SVCCTL_GETSERVICEDISPLAYNAMEW", NDR_SVCCTL_GETSERVICEDISPLAYNAMEW, api_svcctl_GetServiceDisplayNameW}, - {"SVCCTL_GETSERVICEKEYNAMEW", NDR_SVCCTL_GETSERVICEKEYNAMEW, api_svcctl_GetServiceKeyNameW}, - {"SVCCTL_SCSETSERVICEBITSA", NDR_SVCCTL_SCSETSERVICEBITSA, api_svcctl_SCSetServiceBitsA}, - {"SVCCTL_CHANGESERVICECONFIGA", NDR_SVCCTL_CHANGESERVICECONFIGA, api_svcctl_ChangeServiceConfigA}, - {"SVCCTL_CREATESERVICEA", NDR_SVCCTL_CREATESERVICEA, api_svcctl_CreateServiceA}, - {"SVCCTL_ENUMDEPENDENTSERVICESA", NDR_SVCCTL_ENUMDEPENDENTSERVICESA, api_svcctl_EnumDependentServicesA}, - {"SVCCTL_ENUMSERVICESSTATUSA", NDR_SVCCTL_ENUMSERVICESSTATUSA, api_svcctl_EnumServicesStatusA}, - {"SVCCTL_OPENSCMANAGERA", NDR_SVCCTL_OPENSCMANAGERA, api_svcctl_OpenSCManagerA}, - {"SVCCTL_OPENSERVICEA", NDR_SVCCTL_OPENSERVICEA, api_svcctl_OpenServiceA}, - {"SVCCTL_QUERYSERVICECONFIGA", NDR_SVCCTL_QUERYSERVICECONFIGA, api_svcctl_QueryServiceConfigA}, - {"SVCCTL_QUERYSERVICELOCKSTATUSA", NDR_SVCCTL_QUERYSERVICELOCKSTATUSA, api_svcctl_QueryServiceLockStatusA}, - {"SVCCTL_STARTSERVICEA", NDR_SVCCTL_STARTSERVICEA, api_svcctl_StartServiceA}, - {"SVCCTL_GETSERVICEDISPLAYNAMEA", NDR_SVCCTL_GETSERVICEDISPLAYNAMEA, api_svcctl_GetServiceDisplayNameA}, - {"SVCCTL_GETSERVICEKEYNAMEA", NDR_SVCCTL_GETSERVICEKEYNAMEA, api_svcctl_GetServiceKeyNameA}, - {"SVCCTL_GETCURRENTGROUPESTATEW", NDR_SVCCTL_GETCURRENTGROUPESTATEW, api_svcctl_GetCurrentGroupeStateW}, - {"SVCCTL_ENUMSERVICEGROUPW", NDR_SVCCTL_ENUMSERVICEGROUPW, api_svcctl_EnumServiceGroupW}, - {"SVCCTL_CHANGESERVICECONFIG2A", NDR_SVCCTL_CHANGESERVICECONFIG2A, api_svcctl_ChangeServiceConfig2A}, - {"SVCCTL_CHANGESERVICECONFIG2W", NDR_SVCCTL_CHANGESERVICECONFIG2W, api_svcctl_ChangeServiceConfig2W}, - {"SVCCTL_QUERYSERVICECONFIG2A", NDR_SVCCTL_QUERYSERVICECONFIG2A, api_svcctl_QueryServiceConfig2A}, - {"SVCCTL_QUERYSERVICECONFIG2W", NDR_SVCCTL_QUERYSERVICECONFIG2W, api_svcctl_QueryServiceConfig2W}, - {"SVCCTL_QUERYSERVICESTATUSEX", NDR_SVCCTL_QUERYSERVICESTATUSEX, api_svcctl_QueryServiceStatusEx}, - {"ENUMSERVICESSTATUSEXA", NDR_ENUMSERVICESSTATUSEXA, api_EnumServicesStatusExA}, - {"ENUMSERVICESSTATUSEXW", NDR_ENUMSERVICESSTATUSEXW, api_EnumServicesStatusExW}, - {"SVCCTL_SCSENDTSMESSAGE", NDR_SVCCTL_SCSENDTSMESSAGE, api_svcctl_SCSendTSMessage}, -}; - -void svcctl_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_svcctl_cmds; - *n_fns = sizeof(api_svcctl_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_svcctl_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "svcctl", "svcctl", &ndr_table_svcctl.syntax_id, api_svcctl_cmds, sizeof(api_svcctl_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_svcctl.h b/source3/librpc/gen_ndr/srv_svcctl.h deleted file mode 100644 index ca63ebe970..0000000000 --- a/source3/librpc/gen_ndr/srv_svcctl.h +++ /dev/null @@ -1,50 +0,0 @@ -#include "librpc/gen_ndr/ndr_svcctl.h" -#ifndef __SRV_SVCCTL__ -#define __SRV_SVCCTL__ -WERROR _svcctl_CloseServiceHandle(pipes_struct *p, struct svcctl_CloseServiceHandle *r); -WERROR _svcctl_ControlService(pipes_struct *p, struct svcctl_ControlService *r); -WERROR _svcctl_DeleteService(pipes_struct *p, struct svcctl_DeleteService *r); -WERROR _svcctl_LockServiceDatabase(pipes_struct *p, struct svcctl_LockServiceDatabase *r); -WERROR _svcctl_QueryServiceObjectSecurity(pipes_struct *p, struct svcctl_QueryServiceObjectSecurity *r); -WERROR _svcctl_SetServiceObjectSecurity(pipes_struct *p, struct svcctl_SetServiceObjectSecurity *r); -WERROR _svcctl_QueryServiceStatus(pipes_struct *p, struct svcctl_QueryServiceStatus *r); -WERROR _svcctl_SetServiceStatus(pipes_struct *p, struct svcctl_SetServiceStatus *r); -WERROR _svcctl_UnlockServiceDatabase(pipes_struct *p, struct svcctl_UnlockServiceDatabase *r); -WERROR _svcctl_NotifyBootConfigStatus(pipes_struct *p, struct svcctl_NotifyBootConfigStatus *r); -WERROR _svcctl_SCSetServiceBitsW(pipes_struct *p, struct svcctl_SCSetServiceBitsW *r); -WERROR _svcctl_ChangeServiceConfigW(pipes_struct *p, struct svcctl_ChangeServiceConfigW *r); -WERROR _svcctl_CreateServiceW(pipes_struct *p, struct svcctl_CreateServiceW *r); -WERROR _svcctl_EnumDependentServicesW(pipes_struct *p, struct svcctl_EnumDependentServicesW *r); -WERROR _svcctl_EnumServicesStatusW(pipes_struct *p, struct svcctl_EnumServicesStatusW *r); -WERROR _svcctl_OpenSCManagerW(pipes_struct *p, struct svcctl_OpenSCManagerW *r); -WERROR _svcctl_OpenServiceW(pipes_struct *p, struct svcctl_OpenServiceW *r); -WERROR _svcctl_QueryServiceConfigW(pipes_struct *p, struct svcctl_QueryServiceConfigW *r); -WERROR _svcctl_QueryServiceLockStatusW(pipes_struct *p, struct svcctl_QueryServiceLockStatusW *r); -WERROR _svcctl_StartServiceW(pipes_struct *p, struct svcctl_StartServiceW *r); -WERROR _svcctl_GetServiceDisplayNameW(pipes_struct *p, struct svcctl_GetServiceDisplayNameW *r); -WERROR _svcctl_GetServiceKeyNameW(pipes_struct *p, struct svcctl_GetServiceKeyNameW *r); -WERROR _svcctl_SCSetServiceBitsA(pipes_struct *p, struct svcctl_SCSetServiceBitsA *r); -WERROR _svcctl_ChangeServiceConfigA(pipes_struct *p, struct svcctl_ChangeServiceConfigA *r); -WERROR _svcctl_CreateServiceA(pipes_struct *p, struct svcctl_CreateServiceA *r); -WERROR _svcctl_EnumDependentServicesA(pipes_struct *p, struct svcctl_EnumDependentServicesA *r); -WERROR _svcctl_EnumServicesStatusA(pipes_struct *p, struct svcctl_EnumServicesStatusA *r); -WERROR _svcctl_OpenSCManagerA(pipes_struct *p, struct svcctl_OpenSCManagerA *r); -WERROR _svcctl_OpenServiceA(pipes_struct *p, struct svcctl_OpenServiceA *r); -WERROR _svcctl_QueryServiceConfigA(pipes_struct *p, struct svcctl_QueryServiceConfigA *r); -WERROR _svcctl_QueryServiceLockStatusA(pipes_struct *p, struct svcctl_QueryServiceLockStatusA *r); -WERROR _svcctl_StartServiceA(pipes_struct *p, struct svcctl_StartServiceA *r); -WERROR _svcctl_GetServiceDisplayNameA(pipes_struct *p, struct svcctl_GetServiceDisplayNameA *r); -WERROR _svcctl_GetServiceKeyNameA(pipes_struct *p, struct svcctl_GetServiceKeyNameA *r); -WERROR _svcctl_GetCurrentGroupeStateW(pipes_struct *p, struct svcctl_GetCurrentGroupeStateW *r); -WERROR _svcctl_EnumServiceGroupW(pipes_struct *p, struct svcctl_EnumServiceGroupW *r); -WERROR _svcctl_ChangeServiceConfig2A(pipes_struct *p, struct svcctl_ChangeServiceConfig2A *r); -WERROR _svcctl_ChangeServiceConfig2W(pipes_struct *p, struct svcctl_ChangeServiceConfig2W *r); -WERROR _svcctl_QueryServiceConfig2A(pipes_struct *p, struct svcctl_QueryServiceConfig2A *r); -WERROR _svcctl_QueryServiceConfig2W(pipes_struct *p, struct svcctl_QueryServiceConfig2W *r); -WERROR _svcctl_QueryServiceStatusEx(pipes_struct *p, struct svcctl_QueryServiceStatusEx *r); -WERROR _EnumServicesStatusExA(pipes_struct *p, struct EnumServicesStatusExA *r); -WERROR _EnumServicesStatusExW(pipes_struct *p, struct EnumServicesStatusExW *r); -WERROR _svcctl_SCSendTSMessage(pipes_struct *p, struct svcctl_SCSendTSMessage *r); -void svcctl_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_svcctl_init(void); -#endif /* __SRV_SVCCTL__ */ diff --git a/source3/librpc/gen_ndr/srv_winreg.c b/source3/librpc/gen_ndr/srv_winreg.c deleted file mode 100644 index ac70b41219..0000000000 --- a/source3/librpc/gen_ndr/srv_winreg.c +++ /dev/null @@ -1,2772 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_winreg.h" - -static bool api_winreg_OpenHKCR(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenHKCR *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCR]; - - r = talloc(talloc_tos(), struct winreg_OpenHKCR); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenHKCR(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_OpenHKCU(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenHKCU *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCU]; - - r = talloc(talloc_tos(), struct winreg_OpenHKCU); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenHKCU(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_OpenHKLM(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenHKLM *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKLM]; - - r = talloc(talloc_tos(), struct winreg_OpenHKLM); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenHKLM(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_OpenHKPD(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenHKPD *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPD]; - - r = talloc(talloc_tos(), struct winreg_OpenHKPD); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenHKPD(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_OpenHKU(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenHKU *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKU]; - - r = talloc(talloc_tos(), struct winreg_OpenHKU); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKU, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenHKU(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_CloseKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_CloseKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_CLOSEKEY]; - - r = talloc(talloc_tos(), struct winreg_CloseKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_CloseKey, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = r->in.handle; - r->out.result = _winreg_CloseKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_CloseKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_CreateKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_CreateKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_CREATEKEY]; - - r = talloc(talloc_tos(), struct winreg_CreateKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_CreateKey, r); - } - - ZERO_STRUCT(r->out); - r->out.action_taken = r->in.action_taken; - r->out.new_handle = talloc_zero(r, struct policy_handle); - if (r->out.new_handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_CreateKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_CreateKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_DeleteKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_DeleteKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_DELETEKEY]; - - r = talloc(talloc_tos(), struct winreg_DeleteKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_DeleteKey, r); - } - - r->out.result = _winreg_DeleteKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_DeleteValue(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_DeleteValue *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_DELETEVALUE]; - - r = talloc(talloc_tos(), struct winreg_DeleteValue); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_DeleteValue, r); - } - - r->out.result = _winreg_DeleteValue(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_EnumKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_EnumKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_ENUMKEY]; - - r = talloc(talloc_tos(), struct winreg_EnumKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_EnumKey, r); - } - - ZERO_STRUCT(r->out); - r->out.name = r->in.name; - r->out.keyclass = r->in.keyclass; - r->out.last_changed_time = r->in.last_changed_time; - r->out.result = _winreg_EnumKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_EnumKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_EnumValue(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_EnumValue *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_ENUMVALUE]; - - r = talloc(talloc_tos(), struct winreg_EnumValue); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_EnumValue, r); - } - - ZERO_STRUCT(r->out); - r->out.name = r->in.name; - r->out.type = r->in.type; - r->out.value = r->in.value; - r->out.size = r->in.size; - r->out.length = r->in.length; - r->out.result = _winreg_EnumValue(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_EnumValue, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_FlushKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_FlushKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_FLUSHKEY]; - - r = talloc(talloc_tos(), struct winreg_FlushKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_FlushKey, r); - } - - r->out.result = _winreg_FlushKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_FlushKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_GetKeySecurity(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_GetKeySecurity *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_GETKEYSECURITY]; - - r = talloc(talloc_tos(), struct winreg_GetKeySecurity); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, r); - } - - ZERO_STRUCT(r->out); - r->out.sd = r->in.sd; - r->out.result = _winreg_GetKeySecurity(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_LoadKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_LoadKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_LOADKEY]; - - r = talloc(talloc_tos(), struct winreg_LoadKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_LoadKey, r); - } - - r->out.result = _winreg_LoadKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_LoadKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_NotifyChangeKeyValue(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_NotifyChangeKeyValue *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_NOTIFYCHANGEKEYVALUE]; - - r = talloc(talloc_tos(), struct winreg_NotifyChangeKeyValue); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, r); - } - - r->out.result = _winreg_NotifyChangeKeyValue(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_OpenKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENKEY]; - - r = talloc(talloc_tos(), struct winreg_OpenKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenKey, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_QueryInfoKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_QueryInfoKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_QUERYINFOKEY]; - - r = talloc(talloc_tos(), struct winreg_QueryInfoKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, r); - } - - ZERO_STRUCT(r->out); - r->out.classname = r->in.classname; - r->out.num_subkeys = talloc_zero(r, uint32_t); - if (r->out.num_subkeys == NULL) { - talloc_free(r); - return false; - } - - r->out.max_subkeylen = talloc_zero(r, uint32_t); - if (r->out.max_subkeylen == NULL) { - talloc_free(r); - return false; - } - - r->out.max_classlen = talloc_zero(r, uint32_t); - if (r->out.max_classlen == NULL) { - talloc_free(r); - return false; - } - - r->out.num_values = talloc_zero(r, uint32_t); - if (r->out.num_values == NULL) { - talloc_free(r); - return false; - } - - r->out.max_valnamelen = talloc_zero(r, uint32_t); - if (r->out.max_valnamelen == NULL) { - talloc_free(r); - return false; - } - - r->out.max_valbufsize = talloc_zero(r, uint32_t); - if (r->out.max_valbufsize == NULL) { - talloc_free(r); - return false; - } - - r->out.secdescsize = talloc_zero(r, uint32_t); - if (r->out.secdescsize == NULL) { - talloc_free(r); - return false; - } - - r->out.last_changed_time = talloc_zero(r, NTTIME); - if (r->out.last_changed_time == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_QueryInfoKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_QueryValue(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_QueryValue *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_QUERYVALUE]; - - r = talloc(talloc_tos(), struct winreg_QueryValue); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_QueryValue, r); - } - - ZERO_STRUCT(r->out); - r->out.type = r->in.type; - r->out.data = r->in.data; - r->out.data_size = r->in.data_size; - r->out.data_length = r->in.data_length; - r->out.result = _winreg_QueryValue(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_QueryValue, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_ReplaceKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_ReplaceKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_REPLACEKEY]; - - r = talloc(talloc_tos(), struct winreg_ReplaceKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, r); - } - - r->out.result = _winreg_ReplaceKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_RestoreKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_RestoreKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_RESTOREKEY]; - - r = talloc(talloc_tos(), struct winreg_RestoreKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_RestoreKey, r); - } - - r->out.result = _winreg_RestoreKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_SaveKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_SaveKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEY]; - - r = talloc(talloc_tos(), struct winreg_SaveKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_SaveKey, r); - } - - r->out.result = _winreg_SaveKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_SaveKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_SetKeySecurity(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_SetKeySecurity *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_SETKEYSECURITY]; - - r = talloc(talloc_tos(), struct winreg_SetKeySecurity); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, r); - } - - r->out.result = _winreg_SetKeySecurity(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_SetValue(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_SetValue *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_SETVALUE]; - - r = talloc(talloc_tos(), struct winreg_SetValue); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_SetValue, r); - } - - r->out.result = _winreg_SetValue(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_SetValue, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_UnLoadKey(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_UnLoadKey *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_UNLOADKEY]; - - r = talloc(talloc_tos(), struct winreg_UnLoadKey); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, r); - } - - r->out.result = _winreg_UnLoadKey(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_InitiateSystemShutdown(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_InitiateSystemShutdown *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWN]; - - r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdown); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, r); - } - - r->out.result = _winreg_InitiateSystemShutdown(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_AbortSystemShutdown(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_AbortSystemShutdown *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_ABORTSYSTEMSHUTDOWN]; - - r = talloc(talloc_tos(), struct winreg_AbortSystemShutdown); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, r); - } - - r->out.result = _winreg_AbortSystemShutdown(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_GetVersion(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_GetVersion *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_GETVERSION]; - - r = talloc(talloc_tos(), struct winreg_GetVersion); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_GetVersion, r); - } - - ZERO_STRUCT(r->out); - r->out.version = talloc_zero(r, uint32_t); - if (r->out.version == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_GetVersion(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_GetVersion, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_OpenHKCC(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenHKCC *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCC]; - - r = talloc(talloc_tos(), struct winreg_OpenHKCC); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenHKCC(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_OpenHKDD(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenHKDD *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKDD]; - - r = talloc(talloc_tos(), struct winreg_OpenHKDD); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenHKDD(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_QueryMultipleValues(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_QueryMultipleValues *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES]; - - r = talloc(talloc_tos(), struct winreg_QueryMultipleValues); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, r); - } - - ZERO_STRUCT(r->out); - r->out.values = r->in.values; - r->out.buffer = r->in.buffer; - r->out.buffer_size = r->in.buffer_size; - r->out.result = _winreg_QueryMultipleValues(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_InitiateSystemShutdownEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_InitiateSystemShutdownEx *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWNEX]; - - r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdownEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, r); - } - - r->out.result = _winreg_InitiateSystemShutdownEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_SaveKeyEx(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_SaveKeyEx *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEYEX]; - - r = talloc(talloc_tos(), struct winreg_SaveKeyEx); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, r); - } - - r->out.result = _winreg_SaveKeyEx(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_OpenHKPT(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenHKPT *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPT]; - - r = talloc(talloc_tos(), struct winreg_OpenHKPT); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenHKPT(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_OpenHKPN(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_OpenHKPN *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPN]; - - r = talloc(talloc_tos(), struct winreg_OpenHKPN); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, r); - } - - ZERO_STRUCT(r->out); - r->out.handle = talloc_zero(r, struct policy_handle); - if (r->out.handle == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _winreg_OpenHKPN(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_winreg_QueryMultipleValues2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct winreg_QueryMultipleValues2 *r; - - call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES2]; - - r = talloc(talloc_tos(), struct winreg_QueryMultipleValues2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, r); - } - - r->out.result = _winreg_QueryMultipleValues2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_winreg_cmds[] = -{ - {"WINREG_OPENHKCR", NDR_WINREG_OPENHKCR, api_winreg_OpenHKCR}, - {"WINREG_OPENHKCU", NDR_WINREG_OPENHKCU, api_winreg_OpenHKCU}, - {"WINREG_OPENHKLM", NDR_WINREG_OPENHKLM, api_winreg_OpenHKLM}, - {"WINREG_OPENHKPD", NDR_WINREG_OPENHKPD, api_winreg_OpenHKPD}, - {"WINREG_OPENHKU", NDR_WINREG_OPENHKU, api_winreg_OpenHKU}, - {"WINREG_CLOSEKEY", NDR_WINREG_CLOSEKEY, api_winreg_CloseKey}, - {"WINREG_CREATEKEY", NDR_WINREG_CREATEKEY, api_winreg_CreateKey}, - {"WINREG_DELETEKEY", NDR_WINREG_DELETEKEY, api_winreg_DeleteKey}, - {"WINREG_DELETEVALUE", NDR_WINREG_DELETEVALUE, api_winreg_DeleteValue}, - {"WINREG_ENUMKEY", NDR_WINREG_ENUMKEY, api_winreg_EnumKey}, - {"WINREG_ENUMVALUE", NDR_WINREG_ENUMVALUE, api_winreg_EnumValue}, - {"WINREG_FLUSHKEY", NDR_WINREG_FLUSHKEY, api_winreg_FlushKey}, - {"WINREG_GETKEYSECURITY", NDR_WINREG_GETKEYSECURITY, api_winreg_GetKeySecurity}, - {"WINREG_LOADKEY", NDR_WINREG_LOADKEY, api_winreg_LoadKey}, - {"WINREG_NOTIFYCHANGEKEYVALUE", NDR_WINREG_NOTIFYCHANGEKEYVALUE, api_winreg_NotifyChangeKeyValue}, - {"WINREG_OPENKEY", NDR_WINREG_OPENKEY, api_winreg_OpenKey}, - {"WINREG_QUERYINFOKEY", NDR_WINREG_QUERYINFOKEY, api_winreg_QueryInfoKey}, - {"WINREG_QUERYVALUE", NDR_WINREG_QUERYVALUE, api_winreg_QueryValue}, - {"WINREG_REPLACEKEY", NDR_WINREG_REPLACEKEY, api_winreg_ReplaceKey}, - {"WINREG_RESTOREKEY", NDR_WINREG_RESTOREKEY, api_winreg_RestoreKey}, - {"WINREG_SAVEKEY", NDR_WINREG_SAVEKEY, api_winreg_SaveKey}, - {"WINREG_SETKEYSECURITY", NDR_WINREG_SETKEYSECURITY, api_winreg_SetKeySecurity}, - {"WINREG_SETVALUE", NDR_WINREG_SETVALUE, api_winreg_SetValue}, - {"WINREG_UNLOADKEY", NDR_WINREG_UNLOADKEY, api_winreg_UnLoadKey}, - {"WINREG_INITIATESYSTEMSHUTDOWN", NDR_WINREG_INITIATESYSTEMSHUTDOWN, api_winreg_InitiateSystemShutdown}, - {"WINREG_ABORTSYSTEMSHUTDOWN", NDR_WINREG_ABORTSYSTEMSHUTDOWN, api_winreg_AbortSystemShutdown}, - {"WINREG_GETVERSION", NDR_WINREG_GETVERSION, api_winreg_GetVersion}, - {"WINREG_OPENHKCC", NDR_WINREG_OPENHKCC, api_winreg_OpenHKCC}, - {"WINREG_OPENHKDD", NDR_WINREG_OPENHKDD, api_winreg_OpenHKDD}, - {"WINREG_QUERYMULTIPLEVALUES", NDR_WINREG_QUERYMULTIPLEVALUES, api_winreg_QueryMultipleValues}, - {"WINREG_INITIATESYSTEMSHUTDOWNEX", NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, api_winreg_InitiateSystemShutdownEx}, - {"WINREG_SAVEKEYEX", NDR_WINREG_SAVEKEYEX, api_winreg_SaveKeyEx}, - {"WINREG_OPENHKPT", NDR_WINREG_OPENHKPT, api_winreg_OpenHKPT}, - {"WINREG_OPENHKPN", NDR_WINREG_OPENHKPN, api_winreg_OpenHKPN}, - {"WINREG_QUERYMULTIPLEVALUES2", NDR_WINREG_QUERYMULTIPLEVALUES2, api_winreg_QueryMultipleValues2}, -}; - -void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_winreg_cmds; - *n_fns = sizeof(api_winreg_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_winreg_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "winreg", "winreg", &ndr_table_winreg.syntax_id, api_winreg_cmds, sizeof(api_winreg_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_winreg.h b/source3/librpc/gen_ndr/srv_winreg.h deleted file mode 100644 index decfb2589d..0000000000 --- a/source3/librpc/gen_ndr/srv_winreg.h +++ /dev/null @@ -1,41 +0,0 @@ -#include "librpc/gen_ndr/ndr_winreg.h" -#ifndef __SRV_WINREG__ -#define __SRV_WINREG__ -WERROR _winreg_OpenHKCR(pipes_struct *p, struct winreg_OpenHKCR *r); -WERROR _winreg_OpenHKCU(pipes_struct *p, struct winreg_OpenHKCU *r); -WERROR _winreg_OpenHKLM(pipes_struct *p, struct winreg_OpenHKLM *r); -WERROR _winreg_OpenHKPD(pipes_struct *p, struct winreg_OpenHKPD *r); -WERROR _winreg_OpenHKU(pipes_struct *p, struct winreg_OpenHKU *r); -WERROR _winreg_CloseKey(pipes_struct *p, struct winreg_CloseKey *r); -WERROR _winreg_CreateKey(pipes_struct *p, struct winreg_CreateKey *r); -WERROR _winreg_DeleteKey(pipes_struct *p, struct winreg_DeleteKey *r); -WERROR _winreg_DeleteValue(pipes_struct *p, struct winreg_DeleteValue *r); -WERROR _winreg_EnumKey(pipes_struct *p, struct winreg_EnumKey *r); -WERROR _winreg_EnumValue(pipes_struct *p, struct winreg_EnumValue *r); -WERROR _winreg_FlushKey(pipes_struct *p, struct winreg_FlushKey *r); -WERROR _winreg_GetKeySecurity(pipes_struct *p, struct winreg_GetKeySecurity *r); -WERROR _winreg_LoadKey(pipes_struct *p, struct winreg_LoadKey *r); -WERROR _winreg_NotifyChangeKeyValue(pipes_struct *p, struct winreg_NotifyChangeKeyValue *r); -WERROR _winreg_OpenKey(pipes_struct *p, struct winreg_OpenKey *r); -WERROR _winreg_QueryInfoKey(pipes_struct *p, struct winreg_QueryInfoKey *r); -WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r); -WERROR _winreg_ReplaceKey(pipes_struct *p, struct winreg_ReplaceKey *r); -WERROR _winreg_RestoreKey(pipes_struct *p, struct winreg_RestoreKey *r); -WERROR _winreg_SaveKey(pipes_struct *p, struct winreg_SaveKey *r); -WERROR _winreg_SetKeySecurity(pipes_struct *p, struct winreg_SetKeySecurity *r); -WERROR _winreg_SetValue(pipes_struct *p, struct winreg_SetValue *r); -WERROR _winreg_UnLoadKey(pipes_struct *p, struct winreg_UnLoadKey *r); -WERROR _winreg_InitiateSystemShutdown(pipes_struct *p, struct winreg_InitiateSystemShutdown *r); -WERROR _winreg_AbortSystemShutdown(pipes_struct *p, struct winreg_AbortSystemShutdown *r); -WERROR _winreg_GetVersion(pipes_struct *p, struct winreg_GetVersion *r); -WERROR _winreg_OpenHKCC(pipes_struct *p, struct winreg_OpenHKCC *r); -WERROR _winreg_OpenHKDD(pipes_struct *p, struct winreg_OpenHKDD *r); -WERROR _winreg_QueryMultipleValues(pipes_struct *p, struct winreg_QueryMultipleValues *r); -WERROR _winreg_InitiateSystemShutdownEx(pipes_struct *p, struct winreg_InitiateSystemShutdownEx *r); -WERROR _winreg_SaveKeyEx(pipes_struct *p, struct winreg_SaveKeyEx *r); -WERROR _winreg_OpenHKPT(pipes_struct *p, struct winreg_OpenHKPT *r); -WERROR _winreg_OpenHKPN(pipes_struct *p, struct winreg_OpenHKPN *r); -WERROR _winreg_QueryMultipleValues2(pipes_struct *p, struct winreg_QueryMultipleValues2 *r); -void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_winreg_init(void); -#endif /* __SRV_WINREG__ */ diff --git a/source3/librpc/gen_ndr/srv_wkssvc.c b/source3/librpc/gen_ndr/srv_wkssvc.c deleted file mode 100644 index 61a5be081f..0000000000 --- a/source3/librpc/gen_ndr/srv_wkssvc.c +++ /dev/null @@ -1,2412 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_wkssvc.h" - -static bool api_wkssvc_NetWkstaGetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetWkstaGetInfo *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTAGETINFO]; - - r = talloc(talloc_tos(), struct wkssvc_NetWkstaGetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union wkssvc_NetWkstaInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetWkstaGetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetWkstaSetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetWkstaSetInfo *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTASETINFO]; - - r = talloc(talloc_tos(), struct wkssvc_NetWkstaSetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.parm_error = r->in.parm_error; - r->out.result = _wkssvc_NetWkstaSetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetWkstaEnumUsers(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetWkstaEnumUsers *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTAENUMUSERS]; - - r = talloc(talloc_tos(), struct wkssvc_NetWkstaEnumUsers); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, r); - } - - ZERO_STRUCT(r->out); - r->out.info = r->in.info; - r->out.resume_handle = r->in.resume_handle; - r->out.entries_read = talloc_zero(r, uint32_t); - if (r->out.entries_read == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetWkstaEnumUsers(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrWkstaUserGetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrWkstaUserGetInfo *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTAUSERGETINFO]; - - r = talloc(talloc_tos(), struct wkssvc_NetrWkstaUserGetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union wkssvc_NetrWkstaUserInfo); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetrWkstaUserGetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrWkstaUserSetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrWkstaUserSetInfo *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTAUSERSETINFO]; - - r = talloc(talloc_tos(), struct wkssvc_NetrWkstaUserSetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.parm_err = r->in.parm_err; - r->out.result = _wkssvc_NetrWkstaUserSetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetWkstaTransportEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetWkstaTransportEnum *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTATRANSPORTENUM]; - - r = talloc(talloc_tos(), struct wkssvc_NetWkstaTransportEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.info = r->in.info; - r->out.resume_handle = r->in.resume_handle; - r->out.total_entries = talloc_zero(r, uint32_t); - if (r->out.total_entries == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetWkstaTransportEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrWkstaTransportAdd(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrWkstaTransportAdd *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTATRANSPORTADD]; - - r = talloc(talloc_tos(), struct wkssvc_NetrWkstaTransportAdd); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, r); - } - - ZERO_STRUCT(r->out); - r->out.parm_err = r->in.parm_err; - r->out.result = _wkssvc_NetrWkstaTransportAdd(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrWkstaTransportDel(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrWkstaTransportDel *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTATRANSPORTDEL]; - - r = talloc(talloc_tos(), struct wkssvc_NetrWkstaTransportDel); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, r); - } - - r->out.result = _wkssvc_NetrWkstaTransportDel(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrUseAdd(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrUseAdd *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEADD]; - - r = talloc(talloc_tos(), struct wkssvc_NetrUseAdd); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, r); - } - - ZERO_STRUCT(r->out); - r->out.parm_err = r->in.parm_err; - r->out.result = _wkssvc_NetrUseAdd(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrUseGetInfo(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrUseGetInfo *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEGETINFO]; - - r = talloc(talloc_tos(), struct wkssvc_NetrUseGetInfo); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, r); - } - - ZERO_STRUCT(r->out); - r->out.ctr = talloc_zero(r, union wkssvc_NetrUseGetInfoCtr); - if (r->out.ctr == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetrUseGetInfo(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrUseDel(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrUseDel *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEDEL]; - - r = talloc(talloc_tos(), struct wkssvc_NetrUseDel); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, r); - } - - r->out.result = _wkssvc_NetrUseDel(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrUseEnum(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrUseEnum *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEENUM]; - - r = talloc(talloc_tos(), struct wkssvc_NetrUseEnum); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, r); - } - - ZERO_STRUCT(r->out); - r->out.info = r->in.info; - r->out.resume_handle = r->in.resume_handle; - r->out.entries_read = talloc_zero(r, uint32_t); - if (r->out.entries_read == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetrUseEnum(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrMessageBufferSend(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrMessageBufferSend *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRMESSAGEBUFFERSEND]; - - r = talloc(talloc_tos(), struct wkssvc_NetrMessageBufferSend); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, r); - } - - r->out.result = _wkssvc_NetrMessageBufferSend(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrWorkstationStatisticsGet(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrWorkstationStatisticsGet *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET]; - - r = talloc(talloc_tos(), struct wkssvc_NetrWorkstationStatisticsGet); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, r); - } - - ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct wkssvc_NetrWorkstationStatistics *); - if (r->out.info == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetrWorkstationStatisticsGet(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrLogonDomainNameAdd(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrLogonDomainNameAdd *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRLOGONDOMAINNAMEADD]; - - r = talloc(talloc_tos(), struct wkssvc_NetrLogonDomainNameAdd); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, r); - } - - r->out.result = _wkssvc_NetrLogonDomainNameAdd(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrLogonDomainNameDel(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrLogonDomainNameDel *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL]; - - r = talloc(talloc_tos(), struct wkssvc_NetrLogonDomainNameDel); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, r); - } - - r->out.result = _wkssvc_NetrLogonDomainNameDel(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrJoinDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrJoinDomain *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRJOINDOMAIN]; - - r = talloc(talloc_tos(), struct wkssvc_NetrJoinDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, r); - } - - r->out.result = _wkssvc_NetrJoinDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrUnjoinDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrUnjoinDomain *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUNJOINDOMAIN]; - - r = talloc(talloc_tos(), struct wkssvc_NetrUnjoinDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, r); - } - - r->out.result = _wkssvc_NetrUnjoinDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrRenameMachineInDomain(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrRenameMachineInDomain *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN]; - - r = talloc(talloc_tos(), struct wkssvc_NetrRenameMachineInDomain); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, r); - } - - r->out.result = _wkssvc_NetrRenameMachineInDomain(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrValidateName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrValidateName *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRVALIDATENAME]; - - r = talloc(talloc_tos(), struct wkssvc_NetrValidateName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, r); - } - - r->out.result = _wkssvc_NetrValidateName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrGetJoinInformation(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrGetJoinInformation *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOININFORMATION]; - - r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinInformation); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, r); - } - - ZERO_STRUCT(r->out); - r->out.name_buffer = r->in.name_buffer; - r->out.name_type = talloc_zero(r, enum wkssvc_NetJoinStatus); - if (r->out.name_type == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetrGetJoinInformation(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrGetJoinableOus(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrGetJoinableOus *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOINABLEOUS]; - - r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinableOus); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, r); - } - - ZERO_STRUCT(r->out); - r->out.num_ous = r->in.num_ous; - r->out.ous = talloc_zero(r, const char **); - if (r->out.ous == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetrGetJoinableOus(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrJoinDomain2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrJoinDomain2 *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRJOINDOMAIN2]; - - r = talloc(talloc_tos(), struct wkssvc_NetrJoinDomain2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, r); - } - - r->out.result = _wkssvc_NetrJoinDomain2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrUnjoinDomain2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrUnjoinDomain2 *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUNJOINDOMAIN2]; - - r = talloc(talloc_tos(), struct wkssvc_NetrUnjoinDomain2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, r); - } - - r->out.result = _wkssvc_NetrUnjoinDomain2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrRenameMachineInDomain2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrRenameMachineInDomain2 *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2]; - - r = talloc(talloc_tos(), struct wkssvc_NetrRenameMachineInDomain2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, r); - } - - r->out.result = _wkssvc_NetrRenameMachineInDomain2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrValidateName2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrValidateName2 *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRVALIDATENAME2]; - - r = talloc(talloc_tos(), struct wkssvc_NetrValidateName2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, r); - } - - r->out.result = _wkssvc_NetrValidateName2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrGetJoinableOus2(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrGetJoinableOus2 *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOINABLEOUS2]; - - r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinableOus2); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, r); - } - - ZERO_STRUCT(r->out); - r->out.num_ous = r->in.num_ous; - r->out.ous = talloc_zero(r, const char **); - if (r->out.ous == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetrGetJoinableOus2(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrAddAlternateComputerName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrAddAlternateComputerName *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME]; - - r = talloc(talloc_tos(), struct wkssvc_NetrAddAlternateComputerName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, r); - } - - r->out.result = _wkssvc_NetrAddAlternateComputerName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrRemoveAlternateComputerName *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME]; - - r = talloc(talloc_tos(), struct wkssvc_NetrRemoveAlternateComputerName); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, r); - } - - r->out.result = _wkssvc_NetrRemoveAlternateComputerName(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrSetPrimaryComputername(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrSetPrimaryComputername *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME]; - - r = talloc(talloc_tos(), struct wkssvc_NetrSetPrimaryComputername); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, r); - } - - r->out.result = _wkssvc_NetrSetPrimaryComputername(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - -static bool api_wkssvc_NetrEnumerateComputerNames(pipes_struct *p) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - struct ndr_push *push; - enum ndr_err_code ndr_err; - DATA_BLOB blob; - struct wkssvc_NetrEnumerateComputerNames *r; - - call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES]; - - r = talloc(talloc_tos(), struct wkssvc_NetrEnumerateComputerNames); - if (r == NULL) { - return false; - } - - if (!prs_data_blob(&p->in_data.data, &blob, r)) { - talloc_free(r); - return false; - } - - pull = ndr_pull_init_blob(&blob, r, NULL); - if (pull == NULL) { - talloc_free(r); - return false; - } - - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, r); - } - - ZERO_STRUCT(r->out); - r->out.ctr = talloc_zero(r, struct wkssvc_ComputerNamesCtr *); - if (r->out.ctr == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _wkssvc_NetrEnumerateComputerNames(p, r); - - if (p->rng_fault_state) { - talloc_free(r); - /* Return true here, srv_pipe_hnd.c will take care */ - return true; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, r); - } - - push = ndr_push_init_ctx(r, NULL); - if (push == NULL) { - talloc_free(r); - return false; - } - - ndr_err = call->ndr_push(push, NDR_OUT, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - talloc_free(r); - return false; - } - - blob = ndr_push_blob(push); - if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { - talloc_free(r); - return false; - } - - talloc_free(r); - - return true; -} - - -/* Tables */ -static struct api_struct api_wkssvc_cmds[] = -{ - {"WKSSVC_NETWKSTAGETINFO", NDR_WKSSVC_NETWKSTAGETINFO, api_wkssvc_NetWkstaGetInfo}, - {"WKSSVC_NETWKSTASETINFO", NDR_WKSSVC_NETWKSTASETINFO, api_wkssvc_NetWkstaSetInfo}, - {"WKSSVC_NETWKSTAENUMUSERS", NDR_WKSSVC_NETWKSTAENUMUSERS, api_wkssvc_NetWkstaEnumUsers}, - {"WKSSVC_NETRWKSTAUSERGETINFO", NDR_WKSSVC_NETRWKSTAUSERGETINFO, api_wkssvc_NetrWkstaUserGetInfo}, - {"WKSSVC_NETRWKSTAUSERSETINFO", NDR_WKSSVC_NETRWKSTAUSERSETINFO, api_wkssvc_NetrWkstaUserSetInfo}, - {"WKSSVC_NETWKSTATRANSPORTENUM", NDR_WKSSVC_NETWKSTATRANSPORTENUM, api_wkssvc_NetWkstaTransportEnum}, - {"WKSSVC_NETRWKSTATRANSPORTADD", NDR_WKSSVC_NETRWKSTATRANSPORTADD, api_wkssvc_NetrWkstaTransportAdd}, - {"WKSSVC_NETRWKSTATRANSPORTDEL", NDR_WKSSVC_NETRWKSTATRANSPORTDEL, api_wkssvc_NetrWkstaTransportDel}, - {"WKSSVC_NETRUSEADD", NDR_WKSSVC_NETRUSEADD, api_wkssvc_NetrUseAdd}, - {"WKSSVC_NETRUSEGETINFO", NDR_WKSSVC_NETRUSEGETINFO, api_wkssvc_NetrUseGetInfo}, - {"WKSSVC_NETRUSEDEL", NDR_WKSSVC_NETRUSEDEL, api_wkssvc_NetrUseDel}, - {"WKSSVC_NETRUSEENUM", NDR_WKSSVC_NETRUSEENUM, api_wkssvc_NetrUseEnum}, - {"WKSSVC_NETRMESSAGEBUFFERSEND", NDR_WKSSVC_NETRMESSAGEBUFFERSEND, api_wkssvc_NetrMessageBufferSend}, - {"WKSSVC_NETRWORKSTATIONSTATISTICSGET", NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET, api_wkssvc_NetrWorkstationStatisticsGet}, - {"WKSSVC_NETRLOGONDOMAINNAMEADD", NDR_WKSSVC_NETRLOGONDOMAINNAMEADD, api_wkssvc_NetrLogonDomainNameAdd}, - {"WKSSVC_NETRLOGONDOMAINNAMEDEL", NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL, api_wkssvc_NetrLogonDomainNameDel}, - {"WKSSVC_NETRJOINDOMAIN", NDR_WKSSVC_NETRJOINDOMAIN, api_wkssvc_NetrJoinDomain}, - {"WKSSVC_NETRUNJOINDOMAIN", NDR_WKSSVC_NETRUNJOINDOMAIN, api_wkssvc_NetrUnjoinDomain}, - {"WKSSVC_NETRRENAMEMACHINEINDOMAIN", NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN, api_wkssvc_NetrRenameMachineInDomain}, - {"WKSSVC_NETRVALIDATENAME", NDR_WKSSVC_NETRVALIDATENAME, api_wkssvc_NetrValidateName}, - {"WKSSVC_NETRGETJOININFORMATION", NDR_WKSSVC_NETRGETJOININFORMATION, api_wkssvc_NetrGetJoinInformation}, - {"WKSSVC_NETRGETJOINABLEOUS", NDR_WKSSVC_NETRGETJOINABLEOUS, api_wkssvc_NetrGetJoinableOus}, - {"WKSSVC_NETRJOINDOMAIN2", NDR_WKSSVC_NETRJOINDOMAIN2, api_wkssvc_NetrJoinDomain2}, - {"WKSSVC_NETRUNJOINDOMAIN2", NDR_WKSSVC_NETRUNJOINDOMAIN2, api_wkssvc_NetrUnjoinDomain2}, - {"WKSSVC_NETRRENAMEMACHINEINDOMAIN2", NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2, api_wkssvc_NetrRenameMachineInDomain2}, - {"WKSSVC_NETRVALIDATENAME2", NDR_WKSSVC_NETRVALIDATENAME2, api_wkssvc_NetrValidateName2}, - {"WKSSVC_NETRGETJOINABLEOUS2", NDR_WKSSVC_NETRGETJOINABLEOUS2, api_wkssvc_NetrGetJoinableOus2}, - {"WKSSVC_NETRADDALTERNATECOMPUTERNAME", NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME, api_wkssvc_NetrAddAlternateComputerName}, - {"WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME", NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME, api_wkssvc_NetrRemoveAlternateComputerName}, - {"WKSSVC_NETRSETPRIMARYCOMPUTERNAME", NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME, api_wkssvc_NetrSetPrimaryComputername}, - {"WKSSVC_NETRENUMERATECOMPUTERNAMES", NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES, api_wkssvc_NetrEnumerateComputerNames}, -}; - -void wkssvc_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_wkssvc_cmds; - *n_fns = sizeof(api_wkssvc_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_wkssvc_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "wkssvc", "wkssvc", &ndr_table_wkssvc.syntax_id, api_wkssvc_cmds, sizeof(api_wkssvc_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_wkssvc.h b/source3/librpc/gen_ndr/srv_wkssvc.h deleted file mode 100644 index f1d0b94c26..0000000000 --- a/source3/librpc/gen_ndr/srv_wkssvc.h +++ /dev/null @@ -1,37 +0,0 @@ -#include "librpc/gen_ndr/ndr_wkssvc.h" -#ifndef __SRV_WKSSVC__ -#define __SRV_WKSSVC__ -WERROR _wkssvc_NetWkstaGetInfo(pipes_struct *p, struct wkssvc_NetWkstaGetInfo *r); -WERROR _wkssvc_NetWkstaSetInfo(pipes_struct *p, struct wkssvc_NetWkstaSetInfo *r); -WERROR _wkssvc_NetWkstaEnumUsers(pipes_struct *p, struct wkssvc_NetWkstaEnumUsers *r); -WERROR _wkssvc_NetrWkstaUserGetInfo(pipes_struct *p, struct wkssvc_NetrWkstaUserGetInfo *r); -WERROR _wkssvc_NetrWkstaUserSetInfo(pipes_struct *p, struct wkssvc_NetrWkstaUserSetInfo *r); -WERROR _wkssvc_NetWkstaTransportEnum(pipes_struct *p, struct wkssvc_NetWkstaTransportEnum *r); -WERROR _wkssvc_NetrWkstaTransportAdd(pipes_struct *p, struct wkssvc_NetrWkstaTransportAdd *r); -WERROR _wkssvc_NetrWkstaTransportDel(pipes_struct *p, struct wkssvc_NetrWkstaTransportDel *r); -WERROR _wkssvc_NetrUseAdd(pipes_struct *p, struct wkssvc_NetrUseAdd *r); -WERROR _wkssvc_NetrUseGetInfo(pipes_struct *p, struct wkssvc_NetrUseGetInfo *r); -WERROR _wkssvc_NetrUseDel(pipes_struct *p, struct wkssvc_NetrUseDel *r); -WERROR _wkssvc_NetrUseEnum(pipes_struct *p, struct wkssvc_NetrUseEnum *r); -WERROR _wkssvc_NetrMessageBufferSend(pipes_struct *p, struct wkssvc_NetrMessageBufferSend *r); -WERROR _wkssvc_NetrWorkstationStatisticsGet(pipes_struct *p, struct wkssvc_NetrWorkstationStatisticsGet *r); -WERROR _wkssvc_NetrLogonDomainNameAdd(pipes_struct *p, struct wkssvc_NetrLogonDomainNameAdd *r); -WERROR _wkssvc_NetrLogonDomainNameDel(pipes_struct *p, struct wkssvc_NetrLogonDomainNameDel *r); -WERROR _wkssvc_NetrJoinDomain(pipes_struct *p, struct wkssvc_NetrJoinDomain *r); -WERROR _wkssvc_NetrUnjoinDomain(pipes_struct *p, struct wkssvc_NetrUnjoinDomain *r); -WERROR _wkssvc_NetrRenameMachineInDomain(pipes_struct *p, struct wkssvc_NetrRenameMachineInDomain *r); -WERROR _wkssvc_NetrValidateName(pipes_struct *p, struct wkssvc_NetrValidateName *r); -WERROR _wkssvc_NetrGetJoinInformation(pipes_struct *p, struct wkssvc_NetrGetJoinInformation *r); -WERROR _wkssvc_NetrGetJoinableOus(pipes_struct *p, struct wkssvc_NetrGetJoinableOus *r); -WERROR _wkssvc_NetrJoinDomain2(pipes_struct *p, struct wkssvc_NetrJoinDomain2 *r); -WERROR _wkssvc_NetrUnjoinDomain2(pipes_struct *p, struct wkssvc_NetrUnjoinDomain2 *r); -WERROR _wkssvc_NetrRenameMachineInDomain2(pipes_struct *p, struct wkssvc_NetrRenameMachineInDomain2 *r); -WERROR _wkssvc_NetrValidateName2(pipes_struct *p, struct wkssvc_NetrValidateName2 *r); -WERROR _wkssvc_NetrGetJoinableOus2(pipes_struct *p, struct wkssvc_NetrGetJoinableOus2 *r); -WERROR _wkssvc_NetrAddAlternateComputerName(pipes_struct *p, struct wkssvc_NetrAddAlternateComputerName *r); -WERROR _wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p, struct wkssvc_NetrRemoveAlternateComputerName *r); -WERROR _wkssvc_NetrSetPrimaryComputername(pipes_struct *p, struct wkssvc_NetrSetPrimaryComputername *r); -WERROR _wkssvc_NetrEnumerateComputerNames(pipes_struct *p, struct wkssvc_NetrEnumerateComputerNames *r); -void wkssvc_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_wkssvc_init(void); -#endif /* __SRV_WKSSVC__ */ diff --git a/source3/librpc/gen_ndr/srvsvc.h b/source3/librpc/gen_ndr/srvsvc.h deleted file mode 100644 index 6467f72a5b..0000000000 --- a/source3/librpc/gen_ndr/srvsvc.h +++ /dev/null @@ -1,1806 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/security.h" -#include "librpc/gen_ndr/svcctl.h" -#ifndef _HEADER_srvsvc -#define _HEADER_srvsvc - -#define STYPE_TEMPORARY ( 0x40000000 ) -#define STYPE_HIDDEN ( 0x80000000 ) -#define SHARE_1005_CSC_POLICY_MASK ( 0x00000030 ) -#define SHARE_1005_CSC_POLICY_SHIFT ( 4 ) -struct srvsvc_NetCharDevInfo0 { - const char *device;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetCharDevCtr0 { - uint32_t count; - struct srvsvc_NetCharDevInfo0 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetCharDevInfo1 { - const char *device;/* [unique,charset(UTF16)] */ - uint32_t status; - const char *user;/* [unique,charset(UTF16)] */ - uint32_t time; -}; - -struct srvsvc_NetCharDevCtr1 { - uint32_t count; - struct srvsvc_NetCharDevInfo1 *array;/* [unique,size_is(count)] */ -}; - -union srvsvc_NetCharDevInfo { - struct srvsvc_NetCharDevInfo0 *info0;/* [unique,case(0)] */ - struct srvsvc_NetCharDevInfo1 *info1;/* [unique,case] */ -}; - -union srvsvc_NetCharDevCtr { - struct srvsvc_NetCharDevCtr0 *ctr0;/* [unique,case(0)] */ - struct srvsvc_NetCharDevCtr1 *ctr1;/* [unique,case] */ -}; - -struct srvsvc_NetCharDevInfoCtr { - uint32_t level; - union srvsvc_NetCharDevCtr ctr;/* [switch_is(level)] */ -}; - -struct srvsvc_NetCharDevQInfo0 { - const char *device;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetCharDevQCtr0 { - uint32_t count; - struct srvsvc_NetCharDevQInfo0 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetCharDevQInfo1 { - const char *device;/* [unique,charset(UTF16)] */ - uint32_t priority; - const char *devices;/* [unique,charset(UTF16)] */ - uint32_t users; - uint32_t num_ahead; -}; - -struct srvsvc_NetCharDevQCtr1 { - uint32_t count; - struct srvsvc_NetCharDevQInfo1 *array;/* [unique,size_is(count)] */ -}; - -union srvsvc_NetCharDevQInfo { - struct srvsvc_NetCharDevQInfo0 *info0;/* [unique,case(0)] */ - struct srvsvc_NetCharDevQInfo1 *info1;/* [unique,case] */ -}; - -union srvsvc_NetCharDevQCtr { - struct srvsvc_NetCharDevQCtr0 *ctr0;/* [unique,case(0)] */ - struct srvsvc_NetCharDevQCtr1 *ctr1;/* [unique,case] */ -}; - -struct srvsvc_NetCharDevQInfoCtr { - uint32_t level; - union srvsvc_NetCharDevQCtr ctr;/* [switch_is(level)] */ -}; - -struct srvsvc_NetConnInfo0 { - uint32_t conn_id; -}; - -struct srvsvc_NetConnCtr0 { - uint32_t count; - struct srvsvc_NetConnInfo0 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetConnInfo1 { - uint32_t conn_id; - uint32_t conn_type; - uint32_t num_open; - uint32_t num_users; - uint32_t conn_time; - const char *user;/* [unique,charset(UTF16)] */ - const char *share;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetConnCtr1 { - uint32_t count; - struct srvsvc_NetConnInfo1 *array;/* [unique,size_is(count)] */ -}; - -union srvsvc_NetConnCtr { - struct srvsvc_NetConnCtr0 *ctr0;/* [unique,case(0)] */ - struct srvsvc_NetConnCtr1 *ctr1;/* [unique,case] */ -}; - -struct srvsvc_NetConnInfoCtr { - uint32_t level; - union srvsvc_NetConnCtr ctr;/* [switch_is(level)] */ -}; - -struct srvsvc_NetFileInfo2 { - uint32_t fid; -}; - -struct srvsvc_NetFileCtr2 { - uint32_t count; - struct srvsvc_NetFileInfo2 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetFileInfo3 { - uint32_t fid; - uint32_t permissions; - uint32_t num_locks; - const char *path;/* [unique,charset(UTF16)] */ - const char *user;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetFileCtr3 { - uint32_t count; - struct srvsvc_NetFileInfo3 *array;/* [unique,size_is(count)] */ -}; - -union srvsvc_NetFileInfo { - struct srvsvc_NetFileInfo2 *info2;/* [unique,case(2)] */ - struct srvsvc_NetFileInfo3 *info3;/* [unique,case(3)] */ -}; - -union srvsvc_NetFileCtr { - struct srvsvc_NetFileCtr2 *ctr2;/* [unique,case(2)] */ - struct srvsvc_NetFileCtr3 *ctr3;/* [unique,case(3)] */ -}; - -struct srvsvc_NetFileInfoCtr { - uint32_t level; - union srvsvc_NetFileCtr ctr;/* [switch_is(level)] */ -}; - -struct srvsvc_NetSessInfo0 { - const char *client;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetSessCtr0 { - uint32_t count; - struct srvsvc_NetSessInfo0 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetSessInfo1 { - const char *client;/* [unique,charset(UTF16)] */ - const char *user;/* [unique,charset(UTF16)] */ - uint32_t num_open; - uint32_t time; - uint32_t idle_time; - uint32_t user_flags; -}; - -struct srvsvc_NetSessCtr1 { - uint32_t count; - struct srvsvc_NetSessInfo1 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetSessInfo2 { - const char *client;/* [unique,charset(UTF16)] */ - const char *user;/* [unique,charset(UTF16)] */ - uint32_t num_open; - uint32_t time; - uint32_t idle_time; - uint32_t user_flags; - const char *client_type;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetSessCtr2 { - uint32_t count; - struct srvsvc_NetSessInfo2 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetSessInfo10 { - const char *client;/* [unique,charset(UTF16)] */ - const char *user;/* [unique,charset(UTF16)] */ - uint32_t time; - uint32_t idle_time; -}; - -struct srvsvc_NetSessCtr10 { - uint32_t count; - struct srvsvc_NetSessInfo10 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetSessInfo502 { - const char *client;/* [unique,charset(UTF16)] */ - const char *user;/* [unique,charset(UTF16)] */ - uint32_t num_open; - uint32_t time; - uint32_t idle_time; - uint32_t user_flags; - const char *client_type;/* [unique,charset(UTF16)] */ - const char *transport;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetSessCtr502 { - uint32_t count; - struct srvsvc_NetSessInfo502 *array;/* [unique,size_is(count)] */ -}; - -union srvsvc_NetSessCtr { - struct srvsvc_NetSessCtr0 *ctr0;/* [unique,case(0)] */ - struct srvsvc_NetSessCtr1 *ctr1;/* [unique,case] */ - struct srvsvc_NetSessCtr2 *ctr2;/* [unique,case(2)] */ - struct srvsvc_NetSessCtr10 *ctr10;/* [unique,case(10)] */ - struct srvsvc_NetSessCtr502 *ctr502;/* [unique,case(502)] */ -}; - -struct srvsvc_NetSessInfoCtr { - uint32_t level; - union srvsvc_NetSessCtr ctr;/* [switch_is(level)] */ -}; - -enum srvsvc_ShareType -#ifndef USE_UINT_ENUMS - { - STYPE_DISKTREE=0, - STYPE_DISKTREE_TEMPORARY=STYPE_DISKTREE|STYPE_TEMPORARY, - STYPE_DISKTREE_HIDDEN=STYPE_DISKTREE|STYPE_HIDDEN, - STYPE_PRINTQ=1, - STYPE_PRINTQ_TEMPORARY=STYPE_PRINTQ|STYPE_TEMPORARY, - STYPE_PRINTQ_HIDDEN=STYPE_PRINTQ|STYPE_HIDDEN, - STYPE_DEVICE=2, - STYPE_DEVICE_TEMPORARY=STYPE_DEVICE|STYPE_TEMPORARY, - STYPE_DEVICE_HIDDEN=STYPE_DEVICE|STYPE_HIDDEN, - STYPE_IPC=3, - STYPE_IPC_TEMPORARY=STYPE_IPC|STYPE_TEMPORARY, - STYPE_IPC_HIDDEN=STYPE_IPC|STYPE_HIDDEN -} -#else - { __donnot_use_enum_srvsvc_ShareType=0x7FFFFFFF} -#define STYPE_DISKTREE ( 0 ) -#define STYPE_DISKTREE_TEMPORARY ( STYPE_DISKTREE|STYPE_TEMPORARY ) -#define STYPE_DISKTREE_HIDDEN ( STYPE_DISKTREE|STYPE_HIDDEN ) -#define STYPE_PRINTQ ( 1 ) -#define STYPE_PRINTQ_TEMPORARY ( STYPE_PRINTQ|STYPE_TEMPORARY ) -#define STYPE_PRINTQ_HIDDEN ( STYPE_PRINTQ|STYPE_HIDDEN ) -#define STYPE_DEVICE ( 2 ) -#define STYPE_DEVICE_TEMPORARY ( STYPE_DEVICE|STYPE_TEMPORARY ) -#define STYPE_DEVICE_HIDDEN ( STYPE_DEVICE|STYPE_HIDDEN ) -#define STYPE_IPC ( 3 ) -#define STYPE_IPC_TEMPORARY ( STYPE_IPC|STYPE_TEMPORARY ) -#define STYPE_IPC_HIDDEN ( STYPE_IPC|STYPE_HIDDEN ) -#endif -; - -struct srvsvc_NetShareInfo0 { - const char *name;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetShareCtr0 { - uint32_t count; - struct srvsvc_NetShareInfo0 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetShareInfo1 { - const char *name;/* [unique,charset(UTF16)] */ - enum srvsvc_ShareType type; - const char *comment;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetShareCtr1 { - uint32_t count; - struct srvsvc_NetShareInfo1 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetShareInfo2 { - const char *name;/* [unique,charset(UTF16)] */ - enum srvsvc_ShareType type; - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t permissions; - uint32_t max_users; - uint32_t current_users; - const char *path;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetShareCtr2 { - uint32_t count; - struct srvsvc_NetShareInfo2 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetShareInfo501 { - const char *name;/* [unique,charset(UTF16)] */ - enum srvsvc_ShareType type; - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t csc_policy; -}; - -struct srvsvc_NetShareCtr501 { - uint32_t count; - struct srvsvc_NetShareInfo501 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetShareInfo502 { - const char *name;/* [unique,charset(UTF16)] */ - enum srvsvc_ShareType type; - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t permissions; - uint32_t max_users; - uint32_t current_users; - const char *path;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ - struct sec_desc_buf sd_buf; -}; - -struct srvsvc_NetShareCtr502 { - uint32_t count; - struct srvsvc_NetShareInfo502 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetShareInfo1004 { - const char *comment;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetShareCtr1004 { - uint32_t count; - struct srvsvc_NetShareInfo1004 *array;/* [unique,size_is(count)] */ -}; - -/* bitmap NetShareInfo1005Flags */ -#define SHARE_1005_IN_DFS ( 0x00000001 ) -#define SHARE_1005_DFS_ROOT ( 0x00000002 ) - -struct srvsvc_NetShareInfo1005 { - uint32_t dfs_flags; -}; - -struct srvsvc_NetShareCtr1005 { - uint32_t count; - struct srvsvc_NetShareInfo1005 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetShareInfo1006 { - uint32_t max_users; -}; - -struct srvsvc_NetShareCtr1006 { - uint32_t count; - struct srvsvc_NetShareInfo1006 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetShareInfo1007 { - uint32_t flags; - const char *alternate_directory_name;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetShareCtr1007 { - uint32_t count; - struct srvsvc_NetShareInfo1007 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetShareCtr1501 { - uint32_t count; - struct sec_desc_buf *array;/* [unique,size_is(count)] */ -}; - -union srvsvc_NetShareInfo { - struct srvsvc_NetShareInfo0 *info0;/* [unique,case(0)] */ - struct srvsvc_NetShareInfo1 *info1;/* [unique,case] */ - struct srvsvc_NetShareInfo2 *info2;/* [unique,case(2)] */ - struct srvsvc_NetShareInfo501 *info501;/* [unique,case(501)] */ - struct srvsvc_NetShareInfo502 *info502;/* [unique,case(502)] */ - struct srvsvc_NetShareInfo1004 *info1004;/* [unique,case(1004)] */ - struct srvsvc_NetShareInfo1005 *info1005;/* [unique,case(1005)] */ - struct srvsvc_NetShareInfo1006 *info1006;/* [unique,case(1006)] */ - struct srvsvc_NetShareInfo1007 *info1007;/* [unique,case(1007)] */ - struct sec_desc_buf *info1501;/* [unique,case(1501)] */ -}; - -union srvsvc_NetShareCtr { - struct srvsvc_NetShareCtr0 *ctr0;/* [unique,case(0)] */ - struct srvsvc_NetShareCtr1 *ctr1;/* [unique,case] */ - struct srvsvc_NetShareCtr2 *ctr2;/* [unique,case(2)] */ - struct srvsvc_NetShareCtr501 *ctr501;/* [unique,case(501)] */ - struct srvsvc_NetShareCtr502 *ctr502;/* [unique,case(502)] */ - struct srvsvc_NetShareCtr1004 *ctr1004;/* [unique,case(1004)] */ - struct srvsvc_NetShareCtr1005 *ctr1005;/* [unique,case(1005)] */ - struct srvsvc_NetShareCtr1006 *ctr1006;/* [unique,case(1006)] */ - struct srvsvc_NetShareCtr1007 *ctr1007;/* [unique,case(1007)] */ - struct srvsvc_NetShareCtr1501 *ctr1501;/* [unique,case(1501)] */ -}; - -struct srvsvc_NetShareInfoCtr { - uint32_t level; - union srvsvc_NetShareCtr ctr;/* [switch_is(level)] */ -}; - -enum srvsvc_PlatformId -#ifndef USE_UINT_ENUMS - { - PLATFORM_ID_DOS=300, - PLATFORM_ID_OS2=400, - PLATFORM_ID_NT=500, - PLATFORM_ID_OSF=600, - PLATFORM_ID_VMS=700 -} -#else - { __donnot_use_enum_srvsvc_PlatformId=0x7FFFFFFF} -#define PLATFORM_ID_DOS ( 300 ) -#define PLATFORM_ID_OS2 ( 400 ) -#define PLATFORM_ID_NT ( 500 ) -#define PLATFORM_ID_OSF ( 600 ) -#define PLATFORM_ID_VMS ( 700 ) -#endif -; - -struct srvsvc_NetSrvInfo100 { - enum srvsvc_PlatformId platform_id; - const char *server_name;/* [unique,charset(UTF16)] */ -}/* [public] */; - -struct srvsvc_NetSrvInfo101 { - enum srvsvc_PlatformId platform_id; - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t version_major; - uint32_t version_minor; - uint32_t server_type; - const char *comment;/* [unique,charset(UTF16)] */ -}/* [public] */; - -struct srvsvc_NetSrvInfo102 { - enum srvsvc_PlatformId platform_id; - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t version_major; - uint32_t version_minor; - uint32_t server_type; - const char *comment;/* [unique,charset(UTF16)] */ - uint32_t users; - uint32_t disc; - uint32_t hidden; - uint32_t announce; - uint32_t anndelta; - uint32_t licenses; - const char *userpath;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetSrvInfo402 { - uint32_t ulist_mtime; - uint32_t glist_mtime; - uint32_t alist_mtime; - const char *alerts;/* [unique,charset(UTF16)] */ - uint32_t security; - uint32_t numadmin; - uint32_t lanmask; - const char *guestaccount;/* [unique,charset(UTF16)] */ - uint32_t chdevs; - uint32_t chdevqs; - uint32_t chdevjobs; - uint32_t connections; - uint32_t shares; - uint32_t openfiles; - uint32_t sessopen; - uint32_t sesssvc; - uint32_t sessreqs; - uint32_t opensearch; - uint32_t activelocks; - uint32_t numreqbufs; - uint32_t sizereqbufs; - uint32_t numbigbufs; - uint32_t numfiletasks; - uint32_t alertsched; - uint32_t erroralert; - uint32_t logonalert; - uint32_t accessalert; - uint32_t diskalert; - uint32_t netioalert; - uint32_t maxaudits; - const char *srvheuristics;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetSrvInfo403 { - uint32_t ulist_mtime; - uint32_t glist_mtime; - uint32_t alist_mtime; - const char *alerts;/* [unique,charset(UTF16)] */ - uint32_t security; - uint32_t numadmin; - uint32_t lanmask; - const char *guestaccount;/* [unique,charset(UTF16)] */ - uint32_t chdevs; - uint32_t chdevqs; - uint32_t chdevjobs; - uint32_t connections; - uint32_t shares; - uint32_t openfiles; - uint32_t sessopen; - uint32_t sesssvc; - uint32_t sessreqs; - uint32_t opensearch; - uint32_t activelocks; - uint32_t numreqbufs; - uint32_t sizereqbufs; - uint32_t numbigbufs; - uint32_t numfiletasks; - uint32_t alertsched; - uint32_t erroralert; - uint32_t logonalert; - uint32_t accessalert; - uint32_t diskalert; - uint32_t netioalert; - uint32_t maxaudits; - const char *srvheuristics;/* [unique,charset(UTF16)] */ - uint32_t auditedevents; - uint32_t auditprofile; - const char *autopath;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetSrvInfo502 { - uint32_t sessopen; - uint32_t sesssvc; - uint32_t opensearch; - uint32_t sizereqbufs; - uint32_t initworkitems; - uint32_t maxworkitems; - uint32_t rawworkitems; - uint32_t irpstacksize; - uint32_t maxrawbuflen; - uint32_t sessusers; - uint32_t sessconns; - uint32_t maxpagedmemoryusage; - uint32_t maxnonpagedmemoryusage; - uint32_t enablesoftcompat; - uint32_t enableforcedlogoff; - uint32_t timesource; - uint32_t acceptdownlevelapis; - uint32_t lmannounce; -}; - -struct srvsvc_NetSrvInfo503 { - uint32_t sessopen; - uint32_t sesssvc; - uint32_t opensearch; - uint32_t sizereqbufs; - uint32_t initworkitems; - uint32_t maxworkitems; - uint32_t rawworkitems; - uint32_t irpstacksize; - uint32_t maxrawbuflen; - uint32_t sessusers; - uint32_t sessconns; - uint32_t maxpagedmemoryusage; - uint32_t maxnonpagedmemoryusage; - uint32_t enablesoftcompat; - uint32_t enableforcedlogoff; - uint32_t timesource; - uint32_t acceptdownlevelapis; - uint32_t lmannounce; - const char *domain;/* [unique,charset(UTF16)] */ - uint32_t maxcopyreadlen; - uint32_t maxcopywritelen; - uint32_t minkeepsearch; - uint32_t maxkeepsearch; - uint32_t minkeepcomplsearch; - uint32_t maxkeepcomplsearch; - uint32_t threadcountadd; - uint32_t numlockthreads; - uint32_t scavtimeout; - uint32_t minrcvqueue; - uint32_t minfreeworkitems; - uint32_t xactmemsize; - uint32_t threadpriority; - uint32_t maxmpxct; - uint32_t oplockbreakwait; - uint32_t oplockbreakresponsewait; - uint32_t enableoplocks; - uint32_t enableoplockforceclose; - uint32_t enablefcbopens; - uint32_t enableraw; - uint32_t enablesharednetdrives; - uint32_t minfreeconnections; - uint32_t maxfreeconnections; -}; - -struct srvsvc_NetSrvInfo599 { - uint32_t sessopen; - uint32_t sesssvc; - uint32_t opensearch; - uint32_t sizereqbufs; - uint32_t initworkitems; - uint32_t maxworkitems; - uint32_t rawworkitems; - uint32_t irpstacksize; - uint32_t maxrawbuflen; - uint32_t sessusers; - uint32_t sessconns; - uint32_t maxpagedmemoryusage; - uint32_t maxnonpagedmemoryusage; - uint32_t enablesoftcompat; - uint32_t enableforcedlogoff; - uint32_t timesource; - uint32_t acceptdownlevelapis; - uint32_t lmannounce; - const char *domain;/* [unique,charset(UTF16)] */ - uint32_t maxcopyreadlen; - uint32_t maxcopywritelen; - uint32_t minkeepsearch; - uint32_t minkeepcomplsearch; - uint32_t maxkeepcomplsearch; - uint32_t threadcountadd; - uint32_t numlockthreads; - uint32_t scavtimeout; - uint32_t minrcvqueue; - uint32_t minfreeworkitems; - uint32_t xactmemsize; - uint32_t threadpriority; - uint32_t maxmpxct; - uint32_t oplockbreakwait; - uint32_t oplockbreakresponsewait; - uint32_t enableoplocks; - uint32_t enableoplockforceclose; - uint32_t enablefcbopens; - uint32_t enableraw; - uint32_t enablesharednetdrives; - uint32_t minfreeconnections; - uint32_t maxfreeconnections; - uint32_t initsesstable; - uint32_t initconntable; - uint32_t initfiletable; - uint32_t initsearchtable; - uint32_t alertsched; - uint32_t errortreshold; - uint32_t networkerrortreshold; - uint32_t diskspacetreshold; - uint32_t reserved; - uint32_t maxlinkdelay; - uint32_t minlinkthroughput; - uint32_t linkinfovalidtime; - uint32_t scavqosinfoupdatetime; - uint32_t maxworkitemidletime; -}; - -struct srvsvc_NetSrvInfo1005 { - const char *comment;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetSrvInfo1010 { - uint32_t disc; -}; - -struct srvsvc_NetSrvInfo1016 { - uint32_t hidden; -}; - -struct srvsvc_NetSrvInfo1017 { - uint32_t announce; -}; - -struct srvsvc_NetSrvInfo1018 { - uint32_t anndelta; -}; - -struct srvsvc_NetSrvInfo1107 { - uint32_t users; -}; - -struct srvsvc_NetSrvInfo1501 { - uint32_t sessopens; -}; - -struct srvsvc_NetSrvInfo1502 { - uint32_t sessvcs; -}; - -struct srvsvc_NetSrvInfo1503 { - uint32_t opensearch; -}; - -struct srvsvc_NetSrvInfo1506 { - uint32_t maxworkitems; -}; - -struct srvsvc_NetSrvInfo1509 { - uint32_t maxrawbuflen; -}; - -struct srvsvc_NetSrvInfo1510 { - uint32_t sessusers; -}; - -struct srvsvc_NetSrvInfo1511 { - uint32_t sesscons; -}; - -struct srvsvc_NetSrvInfo1512 { - uint32_t maxnonpagedmemoryusage; -}; - -struct srvsvc_NetSrvInfo1513 { - uint32_t maxpagedmemoryusage; -}; - -struct srvsvc_NetSrvInfo1514 { - uint32_t enablesoftcompat; -}; - -struct srvsvc_NetSrvInfo1515 { - uint32_t enableforcedlogoff; -}; - -struct srvsvc_NetSrvInfo1516 { - uint32_t timesource; -}; - -struct srvsvc_NetSrvInfo1518 { - uint32_t lmannounce; -}; - -struct srvsvc_NetSrvInfo1520 { - uint32_t maxcopyreadlen; -}; - -struct srvsvc_NetSrvInfo1521 { - uint32_t maxcopywritelen; -}; - -struct srvsvc_NetSrvInfo1522 { - uint32_t minkeepsearch; -}; - -struct srvsvc_NetSrvInfo1523 { - uint32_t maxkeepsearch; -}; - -struct srvsvc_NetSrvInfo1524 { - uint32_t minkeepcomplsearch; -}; - -struct srvsvc_NetSrvInfo1525 { - uint32_t maxkeepcomplsearch; -}; - -struct srvsvc_NetSrvInfo1528 { - uint32_t scavtimeout; -}; - -struct srvsvc_NetSrvInfo1529 { - uint32_t minrcvqueue; -}; - -struct srvsvc_NetSrvInfo1530 { - uint32_t minfreeworkitems; -}; - -struct srvsvc_NetSrvInfo1533 { - uint32_t maxmpxct; -}; - -struct srvsvc_NetSrvInfo1534 { - uint32_t oplockbreakwait; -}; - -struct srvsvc_NetSrvInfo1535 { - uint32_t oplockbreakresponsewait; -}; - -struct srvsvc_NetSrvInfo1536 { - uint32_t enableoplocks; -}; - -struct srvsvc_NetSrvInfo1537 { - uint32_t enableoplockforceclose; -}; - -struct srvsvc_NetSrvInfo1538 { - uint32_t enablefcbopens; -}; - -struct srvsvc_NetSrvInfo1539 { - uint32_t enableraw; -}; - -struct srvsvc_NetSrvInfo1540 { - uint32_t enablesharednetdrives; -}; - -struct srvsvc_NetSrvInfo1541 { - uint32_t minfreeconnections; -}; - -struct srvsvc_NetSrvInfo1542 { - uint32_t maxfreeconnections; -}; - -struct srvsvc_NetSrvInfo1543 { - uint32_t initsesstable; -}; - -struct srvsvc_NetSrvInfo1544 { - uint32_t initconntable; -}; - -struct srvsvc_NetSrvInfo1545 { - uint32_t initfiletable; -}; - -struct srvsvc_NetSrvInfo1546 { - uint32_t initsearchtable; -}; - -struct srvsvc_NetSrvInfo1547 { - uint32_t alertsched; -}; - -struct srvsvc_NetSrvInfo1548 { - uint32_t errortreshold; -}; - -struct srvsvc_NetSrvInfo1549 { - uint32_t networkerrortreshold; -}; - -struct srvsvc_NetSrvInfo1550 { - uint32_t diskspacetreshold; -}; - -struct srvsvc_NetSrvInfo1552 { - uint32_t maxlinkdelay; -}; - -struct srvsvc_NetSrvInfo1553 { - uint32_t minlinkthroughput; -}; - -struct srvsvc_NetSrvInfo1554 { - uint32_t linkinfovalidtime; -}; - -struct srvsvc_NetSrvInfo1555 { - uint32_t scavqosinfoupdatetime; -}; - -struct srvsvc_NetSrvInfo1556 { - uint32_t maxworkitemidletime; -}; - -union srvsvc_NetSrvInfo { - struct srvsvc_NetSrvInfo100 *info100;/* [unique,case(100)] */ - struct srvsvc_NetSrvInfo101 *info101;/* [unique,case(101)] */ - struct srvsvc_NetSrvInfo102 *info102;/* [unique,case(102)] */ - struct srvsvc_NetSrvInfo402 *info402;/* [unique,case(402)] */ - struct srvsvc_NetSrvInfo403 *info403;/* [unique,case(403)] */ - struct srvsvc_NetSrvInfo502 *info502;/* [unique,case(502)] */ - struct srvsvc_NetSrvInfo503 *info503;/* [unique,case(503)] */ - struct srvsvc_NetSrvInfo599 *info599;/* [unique,case(599)] */ - struct srvsvc_NetSrvInfo1005 *info1005;/* [unique,case(1005)] */ - struct srvsvc_NetSrvInfo1010 *info1010;/* [unique,case(1010)] */ - struct srvsvc_NetSrvInfo1016 *info1016;/* [unique,case(1016)] */ - struct srvsvc_NetSrvInfo1017 *info1017;/* [unique,case(1017)] */ - struct srvsvc_NetSrvInfo1018 *info1018;/* [unique,case(1018)] */ - struct srvsvc_NetSrvInfo1107 *info1107;/* [unique,case(1107)] */ - struct srvsvc_NetSrvInfo1501 *info1501;/* [unique,case(1501)] */ - struct srvsvc_NetSrvInfo1502 *info1502;/* [unique,case(1502)] */ - struct srvsvc_NetSrvInfo1503 *info1503;/* [unique,case(1503)] */ - struct srvsvc_NetSrvInfo1506 *info1506;/* [unique,case(1506)] */ - struct srvsvc_NetSrvInfo1509 *info1509;/* [unique,case(1509)] */ - struct srvsvc_NetSrvInfo1510 *info1510;/* [unique,case(1510)] */ - struct srvsvc_NetSrvInfo1511 *info1511;/* [unique,case(1511)] */ - struct srvsvc_NetSrvInfo1512 *info1512;/* [unique,case(1512)] */ - struct srvsvc_NetSrvInfo1513 *info1513;/* [unique,case(1513)] */ - struct srvsvc_NetSrvInfo1514 *info1514;/* [unique,case(1514)] */ - struct srvsvc_NetSrvInfo1515 *info1515;/* [unique,case(1515)] */ - struct srvsvc_NetSrvInfo1516 *info1516;/* [unique,case(1516)] */ - struct srvsvc_NetSrvInfo1518 *info1518;/* [unique,case(1518)] */ - struct srvsvc_NetSrvInfo1520 *info1520;/* [unique,case(1520)] */ - struct srvsvc_NetSrvInfo1521 *info1521;/* [unique,case(1521)] */ - struct srvsvc_NetSrvInfo1522 *info1522;/* [unique,case(1522)] */ - struct srvsvc_NetSrvInfo1523 *info1523;/* [unique,case(1523)] */ - struct srvsvc_NetSrvInfo1524 *info1524;/* [unique,case(1524)] */ - struct srvsvc_NetSrvInfo1525 *info1525;/* [unique,case(1525)] */ - struct srvsvc_NetSrvInfo1528 *info1528;/* [unique,case(1528)] */ - struct srvsvc_NetSrvInfo1529 *info1529;/* [unique,case(1529)] */ - struct srvsvc_NetSrvInfo1530 *info1530;/* [unique,case(1530)] */ - struct srvsvc_NetSrvInfo1533 *info1533;/* [unique,case(1533)] */ - struct srvsvc_NetSrvInfo1534 *info1534;/* [unique,case(1534)] */ - struct srvsvc_NetSrvInfo1535 *info1535;/* [unique,case(1535)] */ - struct srvsvc_NetSrvInfo1536 *info1536;/* [unique,case(1536)] */ - struct srvsvc_NetSrvInfo1537 *info1537;/* [unique,case(1537)] */ - struct srvsvc_NetSrvInfo1538 *info1538;/* [unique,case(1538)] */ - struct srvsvc_NetSrvInfo1539 *info1539;/* [unique,case(1539)] */ - struct srvsvc_NetSrvInfo1540 *info1540;/* [unique,case(1540)] */ - struct srvsvc_NetSrvInfo1541 *info1541;/* [unique,case(1541)] */ - struct srvsvc_NetSrvInfo1542 *info1542;/* [unique,case(1542)] */ - struct srvsvc_NetSrvInfo1543 *info1543;/* [unique,case(1543)] */ - struct srvsvc_NetSrvInfo1544 *info1544;/* [unique,case(1544)] */ - struct srvsvc_NetSrvInfo1545 *info1545;/* [unique,case(1545)] */ - struct srvsvc_NetSrvInfo1546 *info1546;/* [unique,case(1546)] */ - struct srvsvc_NetSrvInfo1547 *info1547;/* [unique,case(1547)] */ - struct srvsvc_NetSrvInfo1548 *info1548;/* [unique,case(1548)] */ - struct srvsvc_NetSrvInfo1549 *info1549;/* [unique,case(1549)] */ - struct srvsvc_NetSrvInfo1550 *info1550;/* [unique,case(1550)] */ - struct srvsvc_NetSrvInfo1552 *info1552;/* [unique,case(1552)] */ - struct srvsvc_NetSrvInfo1553 *info1553;/* [unique,case(1553)] */ - struct srvsvc_NetSrvInfo1554 *info1554;/* [unique,case(1554)] */ - struct srvsvc_NetSrvInfo1555 *info1555;/* [unique,case(1555)] */ - struct srvsvc_NetSrvInfo1556 *info1556;/* [unique,case(1556)] */ -}; - -struct srvsvc_NetDiskInfo0 { - uint32_t __disk_offset;/* [value(0)] */ - uint32_t __disk_length;/* [value(strlen(disk)+1)] */ - const char *disk;/* [charset(UTF16)] */ -}; - -struct srvsvc_NetDiskInfo { - uint32_t count; - struct srvsvc_NetDiskInfo0 *disks;/* [unique,length_is(count),size_is(count)] */ -}; - -struct srvsvc_Statistics { - uint32_t start; - uint32_t fopens; - uint32_t devopens; - uint32_t jobsqueued; - uint32_t sopens; - uint32_t stimeouts; - uint32_t serrorout; - uint32_t pwerrors; - uint32_t permerrors; - uint32_t syserrors; - uint32_t bytessent_low; - uint32_t bytessent_high; - uint32_t bytesrcvd_low; - uint32_t bytesrcvd_high; - uint32_t avresponse; - uint32_t reqbufneed; - uint32_t bigbufneed; -}; - -struct srvsvc_NetTransportInfo0 { - uint32_t vcs; - const char *name;/* [unique,charset(UTF16)] */ - uint8_t *addr;/* [unique,size_is(addr_len)] */ - uint32_t addr_len; - const char *net_addr;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetTransportCtr0 { - uint32_t count; - struct srvsvc_NetTransportInfo0 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetTransportInfo1 { - uint32_t vcs; - const char *name;/* [unique,charset(UTF16)] */ - uint8_t *addr;/* [unique,size_is(addr_len)] */ - uint32_t addr_len; - const char *net_addr;/* [unique,charset(UTF16)] */ - const char *domain;/* [unique,charset(UTF16)] */ -}; - -struct srvsvc_NetTransportCtr1 { - uint32_t count; - struct srvsvc_NetTransportInfo1 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetTransportInfo2 { - uint32_t vcs; - const char *name;/* [unique,charset(UTF16)] */ - uint8_t *addr;/* [unique,size_is(addr_len)] */ - uint32_t addr_len; - const char *net_addr;/* [unique,charset(UTF16)] */ - const char *domain;/* [unique,charset(UTF16)] */ - uint32_t unknown; -}; - -struct srvsvc_NetTransportCtr2 { - uint32_t count; - struct srvsvc_NetTransportInfo2 *array;/* [unique,size_is(count)] */ -}; - -struct srvsvc_NetTransportInfo3 { - uint32_t vcs; - const char *name;/* [unique,charset(UTF16)] */ - uint8_t *addr;/* [unique,size_is(addr_len)] */ - uint32_t addr_len; - const char *net_addr;/* [unique,charset(UTF16)] */ - const char *domain;/* [unique,charset(UTF16)] */ - uint32_t unknown1; - uint32_t unknown2; - uint8_t unknown3[256]; -}; - -struct srvsvc_NetTransportCtr3 { - uint32_t count; - struct srvsvc_NetTransportInfo3 *array;/* [unique,size_is(count)] */ -}; - -union srvsvc_NetTransportCtr { - struct srvsvc_NetTransportCtr0 *ctr0;/* [unique,case(0)] */ - struct srvsvc_NetTransportCtr1 *ctr1;/* [unique,case] */ - struct srvsvc_NetTransportCtr2 *ctr2;/* [unique,case(2)] */ - struct srvsvc_NetTransportCtr3 *ctr3;/* [unique,case(3)] */ -}; - -struct srvsvc_NetTransportInfoCtr { - uint32_t level; - union srvsvc_NetTransportCtr ctr;/* [switch_is(level)] */ -}; - -struct srvsvc_NetRemoteTODInfo { - uint32_t elapsed; - uint32_t msecs; - uint32_t hours; - uint32_t mins; - uint32_t secs; - uint32_t hunds; - int32_t timezone; - uint32_t tinterval; - uint32_t day; - uint32_t month; - uint32_t year; - uint32_t weekday; -}; - -union srvsvc_NetTransportInfo { - struct srvsvc_NetTransportInfo0 info0;/* [case(0)] */ - struct srvsvc_NetTransportInfo1 info1;/* [case] */ - struct srvsvc_NetTransportInfo2 info2;/* [case(2)] */ - struct srvsvc_NetTransportInfo3 info3;/* [case(3)] */ -}/* [switch_type(uint32)] */; - - -struct srvsvc_NetCharDevEnum { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t max_buffer; - struct srvsvc_NetCharDevInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *totalentries;/* [ref] */ - struct srvsvc_NetCharDevInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetCharDevGetInfo { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *device_name;/* [charset(UTF16)] */ - uint32_t level; - } in; - - struct { - union srvsvc_NetCharDevInfo *info;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetCharDevControl { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *device_name;/* [charset(UTF16)] */ - uint32_t opcode; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetCharDevQEnum { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *user;/* [unique,charset(UTF16)] */ - uint32_t max_buffer; - struct srvsvc_NetCharDevQInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *totalentries;/* [ref] */ - struct srvsvc_NetCharDevQInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetCharDevQGetInfo { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *queue_name;/* [charset(UTF16)] */ - const char *user;/* [charset(UTF16)] */ - uint32_t level; - } in; - - struct { - union srvsvc_NetCharDevQInfo *info;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetCharDevQSetInfo { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *queue_name;/* [charset(UTF16)] */ - uint32_t level; - union srvsvc_NetCharDevQInfo info;/* [switch_is(level)] */ - uint32_t *parm_error;/* [unique] */ - } in; - - struct { - uint32_t *parm_error;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetCharDevQPurge { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *queue_name;/* [charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetCharDevQPurgeSelf { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *queue_name;/* [charset(UTF16)] */ - const char *computer_name;/* [charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetConnEnum { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *path;/* [unique,charset(UTF16)] */ - uint32_t max_buffer; - struct srvsvc_NetConnInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *totalentries;/* [ref] */ - struct srvsvc_NetConnInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetFileEnum { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *path;/* [unique,charset(UTF16)] */ - const char *user;/* [unique,charset(UTF16)] */ - uint32_t max_buffer; - struct srvsvc_NetFileInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *totalentries;/* [ref] */ - struct srvsvc_NetFileInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetFileGetInfo { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t fid; - uint32_t level; - } in; - - struct { - union srvsvc_NetFileInfo *info;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetFileClose { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t fid; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetSessEnum { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *client;/* [unique,charset(UTF16)] */ - const char *user;/* [unique,charset(UTF16)] */ - uint32_t max_buffer; - struct srvsvc_NetSessInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *totalentries;/* [ref] */ - struct srvsvc_NetSessInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetSessDel { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *client;/* [unique,charset(UTF16)] */ - const char *user;/* [unique,charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareAdd { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t level; - union srvsvc_NetShareInfo *info;/* [ref,switch_is(level)] */ - uint32_t *parm_error;/* [unique] */ - } in; - - struct { - uint32_t *parm_error;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareEnumAll { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t max_buffer; - struct srvsvc_NetShareInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *totalentries;/* [ref] */ - struct srvsvc_NetShareInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareGetInfo { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *share_name;/* [charset(UTF16)] */ - uint32_t level; - } in; - - struct { - union srvsvc_NetShareInfo *info;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareSetInfo { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *share_name;/* [charset(UTF16)] */ - uint32_t level; - union srvsvc_NetShareInfo *info;/* [ref,switch_is(level)] */ - uint32_t *parm_error;/* [unique] */ - } in; - - struct { - uint32_t *parm_error;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareDel { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *share_name;/* [charset(UTF16)] */ - uint32_t reserved; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareDelSticky { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *share_name;/* [charset(UTF16)] */ - uint32_t reserved; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareCheck { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *device_name;/* [charset(UTF16)] */ - } in; - - struct { - enum srvsvc_ShareType *type;/* [ref] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetSrvGetInfo { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t level; - } in; - - struct { - union srvsvc_NetSrvInfo *info;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetSrvSetInfo { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t level; - union srvsvc_NetSrvInfo *info;/* [ref,switch_is(level)] */ - uint32_t *parm_error;/* [unique] */ - } in; - - struct { - uint32_t *parm_error;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetDiskEnum { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t level; - uint32_t maxlen; - struct srvsvc_NetDiskInfo *info;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *totalentries;/* [ref] */ - struct srvsvc_NetDiskInfo *info;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetServerStatisticsGet { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *service;/* [unique,charset(UTF16)] */ - uint32_t level; - uint32_t options; - } in; - - struct { - struct srvsvc_Statistics **stats;/* [ref] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetTransportAdd { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t level; - union srvsvc_NetTransportInfo info;/* [switch_is(level)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetTransportEnum { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t max_buffer; - struct srvsvc_NetTransportInfoCtr *transports;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *totalentries;/* [ref] */ - struct srvsvc_NetTransportInfoCtr *transports;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetTransportDel { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t level; - struct srvsvc_NetTransportInfo0 *info0;/* [ref] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetRemoteTOD { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - } in; - - struct { - struct srvsvc_NetRemoteTODInfo **info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetSetServiceBits { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *transport;/* [unique,charset(UTF16)] */ - uint32_t servicebits; - uint32_t updateimmediately; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetPathType { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *path;/* [charset(UTF16)] */ - uint32_t pathflags; - } in; - - struct { - uint32_t *pathtype;/* [ref] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetPathCanonicalize { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *path;/* [charset(UTF16)] */ - uint32_t maxbuf; - const char *prefix;/* [charset(UTF16)] */ - uint32_t pathflags; - uint32_t *pathtype;/* [ref] */ - } in; - - struct { - uint8_t *can_path;/* [size_is(maxbuf)] */ - uint32_t *pathtype;/* [ref] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetPathCompare { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *path1;/* [charset(UTF16)] */ - const char *path2;/* [charset(UTF16)] */ - uint32_t pathtype; - uint32_t pathflags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetNameValidate { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *name;/* [charset(UTF16)] */ - uint32_t name_type; - uint32_t flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRPRNAMECANONICALIZE { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetPRNameCompare { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *name1;/* [charset(UTF16)] */ - const char *name2;/* [charset(UTF16)] */ - uint32_t name_type; - uint32_t flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareEnum { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t max_buffer; - struct srvsvc_NetShareInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *totalentries;/* [ref] */ - struct srvsvc_NetShareInfoCtr *info_ctr;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareDelStart { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *share;/* [charset(UTF16)] */ - uint32_t reserved; - } in; - - struct { - struct policy_handle *hnd;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetShareDelCommit { - struct { - struct policy_handle *hnd;/* [unique] */ - } in; - - struct { - struct policy_handle *hnd;/* [unique] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetGetFileSecurity { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *share;/* [unique,charset(UTF16)] */ - const char *file;/* [charset(UTF16)] */ - uint32_t securityinformation; - } in; - - struct { - struct sec_desc_buf **sd_buf;/* [ref] */ - WERROR result; - } out; - -}; - - -struct srvsvc_NetSetFileSecurity { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *share;/* [unique,charset(UTF16)] */ - const char *file;/* [charset(UTF16)] */ - uint32_t securityinformation; - struct sec_desc_buf *sd_buf;/* [ref] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetServerTransportAddEx { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - uint32_t level; - union srvsvc_NetTransportInfo info;/* [switch_is(level)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NetServerSetServiceBitsEx { - struct { - const char *server_unc;/* [unique,charset(UTF16)] */ - const char *emulated_server_unc;/* [unique,charset(UTF16)] */ - const char *transport;/* [unique,charset(UTF16)] */ - uint32_t servicebitsofinterest; - uint32_t servicebits; - uint32_t updateimmediately; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSGETVERSION { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSCREATELOCALPARTITION { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSDELETELOCALPARTITION { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSSETLOCALVOLUMESTATE { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSSETSERVERINFO { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSCREATEEXITPOINT { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSDELETEEXITPOINT { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSMODIFYPREFIX { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSFIXLOCALVOLUME { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRDFSMANAGERREPORTSITEINFO { - struct { - WERROR result; - } out; - -}; - - -struct srvsvc_NETRSERVERTRANSPORTDELEX { - struct { - WERROR result; - } out; - -}; - -#endif /* _HEADER_srvsvc */ diff --git a/source3/librpc/gen_ndr/svcctl.h b/source3/librpc/gen_ndr/svcctl.h deleted file mode 100644 index 9baa122e56..0000000000 --- a/source3/librpc/gen_ndr/svcctl.h +++ /dev/null @@ -1,811 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/misc.h" -#include "librpc/gen_ndr/security.h" -#ifndef _HEADER_svcctl -#define _HEADER_svcctl - -#define SERVICE_TYPE_KERNEL_DRIVER ( 0x01 ) -#define SERVICE_TYPE_FS_DRIVER ( 0x02 ) -#define SERVICE_TYPE_ADAPTER ( 0x04 ) -#define SERVICE_TYPE_RECOGNIZER_DRIVER ( 0x08 ) -#define SERVICE_TYPE_DRIVER ( SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER ) -#define SERVICE_TYPE_WIN32_OWN_PROCESS ( 0x10 ) -#define SERVICE_TYPE_WIN32_SHARE_PROCESS ( 0x20 ) -#define SERVICE_TYPE_WIN32 ( SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS ) -#define SERVICE_STATE_ACTIVE ( 0x01 ) -#define SERVICE_STATE_INACTIVE ( 0x02 ) -#define SERVICE_STATE_ALL ( 0x03 ) -#define SV_TYPE_ALL ( 0xFFFFFFFF ) -#define SC_MANAGER_READ_ACCESS ( (SEC_STD_READ_CONTROL|SC_RIGHT_MGR_CONNECT|SC_RIGHT_MGR_ENUMERATE_SERVICE|SC_RIGHT_MGR_QUERY_LOCK_STATUS) ) -#define SC_MANAGER_EXECUTE_ACCESS ( SC_MANAGER_READ_ACCESS ) -#define SC_MANAGER_WRITE_ACCESS ( (SEC_STD_REQUIRED|SC_MANAGER_READ_ACCESS|SC_RIGHT_MGR_CREATE_SERVICE|SC_RIGHT_MGR_LOCK|SC_RIGHT_MGR_MODIFY_BOOT_CONFIG) ) -#define SC_MANAGER_ALL_ACCESS ( SC_MANAGER_WRITE_ACCESS ) -#define SERVICE_READ_ACCESS ( (SEC_STD_READ_CONTROL|SC_RIGHT_SVC_ENUMERATE_DEPENDENTS|SC_RIGHT_SVC_INTERROGATE|SC_RIGHT_SVC_QUERY_CONFIG|SC_RIGHT_SVC_QUERY_STATUS|SC_RIGHT_SVC_USER_DEFINED_CONTROL) ) -#define SERVICE_EXECUTE_ACCESS ( (SERVICE_READ_ACCESS|SC_RIGHT_SVC_START|SC_RIGHT_SVC_STOP|SC_RIGHT_SVC_PAUSE_CONTINUE) ) -#define SERVICE_WRITE_ACCESS ( (SEC_STD_REQUIRED|SERVICE_READ_ACCESS|SERVICE_EXECUTE_ACCESS|SC_RIGHT_SVC_CHANGE_CONFIG) ) -#define SERVICE_ALL_ACCESS ( SERVICE_WRITE_ACCESS ) -struct SERVICE_LOCK_STATUS { - uint32_t is_locked; - const char *lock_owner;/* [unique,charset(UTF16)] */ - uint32_t lock_duration; -}; - -struct SERVICE_STATUS { - uint32_t type; - uint32_t state; - uint32_t controls_accepted; - WERROR win32_exit_code; - uint32_t service_exit_code; - uint32_t check_point; - uint32_t wait_hint; -}; - -struct ENUM_SERVICE_STATUS { - const char * service_name;/* [relative,flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - const char * display_name;/* [relative,flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - struct SERVICE_STATUS status; -}; - -/* bitmap svcctl_ServerType */ -#define SV_TYPE_WORKSTATION ( 0x00000001 ) -#define SV_TYPE_SERVER ( 0x00000002 ) -#define SV_TYPE_SQLSERVER ( 0x00000004 ) -#define SV_TYPE_DOMAIN_CTRL ( 0x00000008 ) -#define SV_TYPE_DOMAIN_BAKCTRL ( 0x00000010 ) -#define SV_TYPE_TIME_SOURCE ( 0x00000020 ) -#define SV_TYPE_AFP ( 0x00000040 ) -#define SV_TYPE_NOVELL ( 0x00000080 ) -#define SV_TYPE_DOMAIN_MEMBER ( 0x00000100 ) -#define SV_TYPE_PRINTQ_SERVER ( 0x00000200 ) -#define SV_TYPE_DIALIN_SERVER ( 0x00000400 ) -#define SV_TYPE_SERVER_UNIX ( 0x00000800 ) -#define SV_TYPE_NT ( 0x00001000 ) -#define SV_TYPE_WFW ( 0x00002000 ) -#define SV_TYPE_SERVER_MFPN ( 0x00004000 ) -#define SV_TYPE_SERVER_NT ( 0x00008000 ) -#define SV_TYPE_POTENTIAL_BROWSER ( 0x00010000 ) -#define SV_TYPE_BACKUP_BROWSER ( 0x00020000 ) -#define SV_TYPE_MASTER_BROWSER ( 0x00040000 ) -#define SV_TYPE_DOMAIN_MASTER ( 0x00080000 ) -#define SV_TYPE_SERVER_OSF ( 0x00100000 ) -#define SV_TYPE_SERVER_VMS ( 0x00200000 ) -#define SV_TYPE_WIN95_PLUS ( 0x00400000 ) -#define SV_TYPE_DFS_SERVER ( 0x00800000 ) -#define SV_TYPE_ALTERNATE_XPORT ( 0x20000000 ) -#define SV_TYPE_LOCAL_LIST_ONLY ( 0x40000000 ) -#define SV_TYPE_DOMAIN_ENUM ( 0x80000000 ) - -enum SERVICE_CONTROL -#ifndef USE_UINT_ENUMS - { - SVCCTL_CONTROL_STOP=0x00000001, - SVCCTL_CONTROL_PAUSE=0x00000002, - SVCCTL_CONTROL_CONTINUE=0x00000003, - SVCCTL_CONTROL_INTERROGATE=0x00000004, - SVCCTL_CONTROL_SHUTDOWN=0x00000005 -} -#else - { __donnot_use_enum_SERVICE_CONTROL=0x7FFFFFFF} -#define SVCCTL_CONTROL_STOP ( 0x00000001 ) -#define SVCCTL_CONTROL_PAUSE ( 0x00000002 ) -#define SVCCTL_CONTROL_CONTINUE ( 0x00000003 ) -#define SVCCTL_CONTROL_INTERROGATE ( 0x00000004 ) -#define SVCCTL_CONTROL_SHUTDOWN ( 0x00000005 ) -#endif -; - -/* bitmap svcctl_MgrAccessMask */ -#define SC_RIGHT_MGR_CONNECT ( 0x0001 ) -#define SC_RIGHT_MGR_CREATE_SERVICE ( 0x0002 ) -#define SC_RIGHT_MGR_ENUMERATE_SERVICE ( 0x0004 ) -#define SC_RIGHT_MGR_LOCK ( 0x0008 ) -#define SC_RIGHT_MGR_QUERY_LOCK_STATUS ( 0x0010 ) -#define SC_RIGHT_MGR_MODIFY_BOOT_CONFIG ( 0x0020 ) - -/* bitmap svcctl_ServiceAccessMask */ -#define SC_RIGHT_SVC_QUERY_CONFIG ( 0x0001 ) -#define SC_RIGHT_SVC_CHANGE_CONFIG ( 0x0002 ) -#define SC_RIGHT_SVC_QUERY_STATUS ( 0x0004 ) -#define SC_RIGHT_SVC_ENUMERATE_DEPENDENTS ( 0x0008 ) -#define SC_RIGHT_SVC_START ( 0x0010 ) -#define SC_RIGHT_SVC_STOP ( 0x0020 ) -#define SC_RIGHT_SVC_PAUSE_CONTINUE ( 0x0040 ) -#define SC_RIGHT_SVC_INTERROGATE ( 0x0080 ) -#define SC_RIGHT_SVC_USER_DEFINED_CONTROL ( 0x0100 ) - -struct QUERY_SERVICE_CONFIG { - uint32_t service_type; - uint32_t start_type; - uint32_t error_control; - const char *executablepath;/* [unique,range(0,8192),charset(UTF16)] */ - const char *loadordergroup;/* [unique,range(0,8192),charset(UTF16)] */ - uint32_t tag_id; - const char *dependencies;/* [unique,range(0,8192),charset(UTF16)] */ - const char *startname;/* [unique,range(0,8192),charset(UTF16)] */ - const char *displayname;/* [unique,range(0,8192),charset(UTF16)] */ -}/* [gensize,public] */; - - -struct svcctl_CloseServiceHandle { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_ControlService { - struct { - struct policy_handle *handle;/* [ref] */ - enum SERVICE_CONTROL control; - } in; - - struct { - struct SERVICE_STATUS *service_status;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_DeleteService { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct svcctl_LockServiceDatabase { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct policy_handle *lock;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_QueryServiceObjectSecurity { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t security_flags; - uint32_t buffer_size;/* [range(0,0x40000)] */ - } in; - - struct { - uint8_t *buffer;/* [ref,size_is(buffer_size)] */ - uint32_t *needed;/* [ref,range(0,0x40000)] */ - WERROR result; - } out; - -}; - - -struct svcctl_SetServiceObjectSecurity { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t security_flags; - uint8_t *buffer;/* [ref,size_is(buffer_size)] */ - uint32_t buffer_size; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct svcctl_QueryServiceStatus { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct SERVICE_STATUS *service_status;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_SetServiceStatus { - struct { - WERROR result; - } out; - -}; - - -struct svcctl_UnlockServiceDatabase { - struct { - struct policy_handle *lock;/* [ref] */ - } in; - - struct { - struct policy_handle *lock;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_NotifyBootConfigStatus { - struct { - WERROR result; - } out; - -}; - - -struct svcctl_SCSetServiceBitsW { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t bits; - uint32_t bitson; - uint32_t immediate; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct svcctl_ChangeServiceConfigW { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t type; - uint32_t start; - uint32_t error; - const char *binary_path;/* [unique,charset(UTF16)] */ - const char *load_order_group;/* [unique,charset(UTF16)] */ - const char *dependencies;/* [unique,charset(UTF16)] */ - const char *service_start_name;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ - const char *display_name;/* [unique,charset(UTF16)] */ - } in; - - struct { - uint32_t *tag_id;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_CreateServiceW { - struct { - struct policy_handle *scmanager_handle;/* [ref] */ - const char *ServiceName;/* [charset(UTF16)] */ - const char *DisplayName;/* [unique,charset(UTF16)] */ - uint32_t desired_access; - uint32_t type; - uint32_t start_type; - uint32_t error_control; - const char *binary_path;/* [charset(UTF16)] */ - const char *LoadOrderGroupKey;/* [unique,charset(UTF16)] */ - uint8_t *dependencies;/* [unique,size_is(dependencies_size)] */ - uint32_t dependencies_size; - const char *service_start_name;/* [unique,charset(UTF16)] */ - uint8_t *password;/* [unique,size_is(password_size)] */ - uint32_t password_size; - uint32_t *TagId;/* [unique] */ - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t *TagId;/* [unique] */ - WERROR result; - } out; - -}; - - -struct svcctl_EnumDependentServicesW { - struct { - struct policy_handle *service;/* [ref] */ - uint32_t state; - uint32_t buf_size;/* [range(0,0x40000)] */ - } in; - - struct { - uint8_t *service_status;/* [ref,size_is(buf_size)] */ - uint32_t *bytes_needed;/* [ref,range(0,0x40000)] */ - uint32_t *services_returned;/* [ref,range(0,0x40000)] */ - WERROR result; - } out; - -}; - - -struct svcctl_EnumServicesStatusW { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t type; - uint32_t state; - uint32_t buf_size;/* [range(0,262144)] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint8_t *service;/* [ref,size_is(buf_size)] */ - uint32_t *bytes_needed;/* [ref,range(0,262144)] */ - uint32_t *services_returned;/* [ref,range(0,262144)] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct svcctl_OpenSCManagerW { - struct { - const char *MachineName;/* [unique,charset(UTF16)] */ - const char *DatabaseName;/* [unique,charset(UTF16)] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_OpenServiceW { - struct { - struct policy_handle *scmanager_handle;/* [ref] */ - const char *ServiceName;/* [charset(UTF16)] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_QueryServiceConfigW { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t buf_size;/* [range(0,8192)] */ - } in; - - struct { - struct QUERY_SERVICE_CONFIG *query;/* [ref] */ - uint32_t *bytes_needed;/* [ref,range(0,8192)] */ - WERROR result; - } out; - -}; - - -struct svcctl_QueryServiceLockStatusW { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t buf_size; - } in; - - struct { - struct SERVICE_LOCK_STATUS *lock_status;/* [ref] */ - uint32_t *required_buf_size;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_StartServiceW { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t NumArgs; - const char *Arguments;/* [unique,charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct svcctl_GetServiceDisplayNameW { - struct { - struct policy_handle *handle;/* [ref] */ - const char *service_name;/* [unique,charset(UTF16)] */ - uint32_t *display_name_length;/* [unique] */ - } in; - - struct { - const char **display_name;/* [ref,charset(UTF16)] */ - uint32_t *display_name_length;/* [unique] */ - WERROR result; - } out; - -}; - - -struct svcctl_GetServiceKeyNameW { - struct { - struct policy_handle *handle;/* [ref] */ - const char *service_name;/* [unique,charset(UTF16)] */ - uint32_t *display_name_length;/* [unique] */ - } in; - - struct { - const char **key_name;/* [ref,charset(UTF16)] */ - uint32_t *display_name_length;/* [unique] */ - WERROR result; - } out; - -}; - - -struct svcctl_SCSetServiceBitsA { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t bits; - uint32_t bitson; - uint32_t immediate; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct svcctl_ChangeServiceConfigA { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t type; - uint32_t start; - uint32_t error; - const char *binary_path;/* [unique,charset(UTF16)] */ - const char *load_order_group;/* [unique,charset(UTF16)] */ - const char *dependencies;/* [unique,charset(UTF16)] */ - const char *service_start_name;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ - const char *display_name;/* [unique,charset(UTF16)] */ - } in; - - struct { - uint32_t *tag_id;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_CreateServiceA { - struct { - struct policy_handle *handle;/* [ref] */ - const char *ServiceName;/* [unique,charset(UTF16)] */ - const char *DisplayName;/* [unique,charset(UTF16)] */ - uint32_t desired_access; - uint32_t type; - uint32_t start_type; - uint32_t error_control; - const char *binary_path;/* [unique,charset(UTF16)] */ - const char *LoadOrderGroupKey;/* [unique,charset(UTF16)] */ - const char *dependencies;/* [unique,charset(UTF16)] */ - const char *service_start_name;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ - } in; - - struct { - uint32_t *TagId;/* [unique] */ - WERROR result; - } out; - -}; - - -struct svcctl_EnumDependentServicesA { - struct { - struct policy_handle *service;/* [ref] */ - uint32_t state; - uint32_t buf_size; - } in; - - struct { - struct ENUM_SERVICE_STATUS *service_status;/* [unique] */ - uint32_t *bytes_needed;/* [ref] */ - uint32_t *services_returned;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_EnumServicesStatusA { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t type; - uint32_t state; - uint32_t buf_size; - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint8_t *service;/* [size_is(buf_size)] */ - uint32_t *bytes_needed;/* [ref] */ - uint32_t *services_returned;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct svcctl_OpenSCManagerA { - struct { - const char *MachineName;/* [unique,charset(UTF16)] */ - const char *DatabaseName;/* [unique,charset(UTF16)] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_OpenServiceA { - struct { - struct policy_handle *scmanager_handle;/* [ref] */ - const char *ServiceName;/* [unique,charset(UTF16)] */ - uint32_t access_mask; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct svcctl_QueryServiceConfigA { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t buf_size; - } in; - - struct { - uint8_t *query; - uint32_t *bytes_needed;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_QueryServiceLockStatusA { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t buf_size; - } in; - - struct { - struct SERVICE_LOCK_STATUS *lock_status;/* [ref] */ - uint32_t *required_buf_size;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_StartServiceA { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t NumArgs; - const char *Arguments;/* [unique,charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct svcctl_GetServiceDisplayNameA { - struct { - struct policy_handle *handle;/* [ref] */ - const char *service_name;/* [unique,charset(UTF16)] */ - uint32_t *display_name_length;/* [unique] */ - } in; - - struct { - const char **display_name;/* [ref,charset(UTF16)] */ - uint32_t *display_name_length;/* [unique] */ - WERROR result; - } out; - -}; - - -struct svcctl_GetServiceKeyNameA { - struct { - struct policy_handle *handle;/* [ref] */ - const char *service_name;/* [unique,charset(UTF16)] */ - uint32_t *display_name_length;/* [unique] */ - } in; - - struct { - const char **key_name;/* [ref,charset(UTF16)] */ - uint32_t *display_name_length;/* [unique] */ - WERROR result; - } out; - -}; - - -struct svcctl_GetCurrentGroupeStateW { - struct { - WERROR result; - } out; - -}; - - -struct svcctl_EnumServiceGroupW { - struct { - WERROR result; - } out; - -}; - - -struct svcctl_ChangeServiceConfig2A { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t info_level; - uint8_t *info;/* [unique] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct svcctl_ChangeServiceConfig2W { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t info_level; - uint8_t *info;/* [unique] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct svcctl_QueryServiceConfig2A { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t info_level; - uint32_t buf_size; - } in; - - struct { - uint8_t *buffer; - uint32_t *bytes_needed;/* [ref] */ - WERROR result; - } out; - -}; - - -struct svcctl_QueryServiceConfig2W { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t info_level; - uint32_t buf_size;/* [range(0,8192)] */ - } in; - - struct { - uint8_t *buffer;/* [ref,size_is(buf_size)] */ - uint32_t *bytes_needed;/* [ref,range(0,8192)] */ - WERROR result; - } out; - -}; - - -struct svcctl_QueryServiceStatusEx { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t info_level; - uint32_t buf_size;/* [range(0,8192)] */ - } in; - - struct { - uint8_t *buffer;/* [ref,size_is(buf_size)] */ - uint32_t *bytes_needed;/* [ref,range(0,8192)] */ - WERROR result; - } out; - -}; - - -struct EnumServicesStatusExA { - struct { - struct policy_handle *scmanager;/* [ref] */ - uint32_t info_level; - uint32_t type; - uint32_t state; - uint32_t buf_size; - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint8_t *services; - uint32_t *bytes_needed;/* [ref] */ - uint32_t *service_returned;/* [ref] */ - const char **group_name;/* [ref,charset(UTF16)] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct EnumServicesStatusExW { - struct { - struct policy_handle *scmanager;/* [ref] */ - uint32_t info_level; - uint32_t type; - uint32_t state; - uint32_t buf_size;/* [range(0,262144)] */ - const char *group_name;/* [unique,charset(UTF16)] */ - uint32_t *resume_handle;/* [unique,range(0,262144)] */ - } in; - - struct { - uint8_t *services;/* [ref,size_is(buf_size)] */ - uint32_t *bytes_needed;/* [ref,range(0,262144)] */ - uint32_t *service_returned;/* [ref,range(0,262144)] */ - uint32_t *resume_handle;/* [unique,range(0,262144)] */ - WERROR result; - } out; - -}; - - -struct svcctl_SCSendTSMessage { - struct { - WERROR result; - } out; - -}; - -#endif /* _HEADER_svcctl */ diff --git a/source3/librpc/gen_ndr/tables.c b/source3/librpc/gen_ndr/tables.c deleted file mode 100644 index f2064d95ac..0000000000 --- a/source3/librpc/gen_ndr/tables.c +++ /dev/null @@ -1,83 +0,0 @@ - -/* Automatically generated by tables.pl. DO NOT EDIT */ - -#include "includes.h" -#include "librpc/ndr/libndr.h" -#include "librpc/ndr/ndr_table.h" -#include "librpc/gen_ndr/ndr_dfs.h" -#include "librpc/gen_ndr/ndr_drsblobs.h" -#include "librpc/gen_ndr/ndr_drsuapi.h" -#include "librpc/gen_ndr/ndr_dssetup.h" -#include "librpc/gen_ndr/ndr_echo.h" -#include "librpc/gen_ndr/ndr_epmapper.h" -#include "librpc/gen_ndr/ndr_eventlog.h" -#include "librpc/gen_ndr/ndr_initshutdown.h" -#include "librpc/gen_ndr/ndr_krb5pac.h" -#include "librpc/gen_ndr/ndr_lsa.h" -#include "librpc/gen_ndr/ndr_netlogon.h" -#include "librpc/gen_ndr/ndr_ntsvcs.h" -#include "librpc/gen_ndr/ndr_samr.h" -#include "librpc/gen_ndr/ndr_srvsvc.h" -#include "librpc/gen_ndr/ndr_svcctl.h" -#include "librpc/gen_ndr/ndr_winreg.h" -#include "librpc/gen_ndr/ndr_wkssvc.h" - -NTSTATUS ndr_table_register_builtin_tables(void) -{ - NTSTATUS status; - - status = ndr_table_register(&ndr_table_netdfs); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_drsblobs); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_drsuapi); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_dssetup); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_rpcecho); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_epmapper); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_eventlog); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_initshutdown); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_krb5pac); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_lsarpc); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_netlogon); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_ntsvcs); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_samr); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_srvsvc); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_svcctl); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_winreg); - if (NT_STATUS_IS_ERR(status)) return status; - - status = ndr_table_register(&ndr_table_wkssvc); - if (NT_STATUS_IS_ERR(status)) return status; - - - - return NT_STATUS_OK; -} diff --git a/source3/librpc/gen_ndr/winreg.h b/source3/librpc/gen_ndr/winreg.h deleted file mode 100644 index a98120ccf5..0000000000 --- a/source3/librpc/gen_ndr/winreg.h +++ /dev/null @@ -1,623 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/lsa.h" -#include "librpc/gen_ndr/security.h" -#ifndef _HEADER_winreg -#define _HEADER_winreg - -/* bitmap winreg_AccessMask */ -#define KEY_QUERY_VALUE ( 0x00001 ) -#define KEY_SET_VALUE ( 0x00002 ) -#define KEY_CREATE_SUB_KEY ( 0x00004 ) -#define KEY_ENUMERATE_SUB_KEYS ( 0x00008 ) -#define KEY_NOTIFY ( 0x00010 ) -#define KEY_CREATE_LINK ( 0x00020 ) -#define KEY_WOW64_64KEY ( 0x00100 ) -#define KEY_WOW64_32KEY ( 0x00200 ) - -enum winreg_Type -#ifndef USE_UINT_ENUMS - { - REG_NONE=0, - REG_SZ=1, - REG_EXPAND_SZ=2, - REG_BINARY=3, - REG_DWORD=4, - REG_DWORD_BIG_ENDIAN=5, - REG_LINK=6, - REG_MULTI_SZ=7, - REG_RESOURCE_LIST=8, - REG_FULL_RESOURCE_DESCRIPTOR=9, - REG_RESOURCE_REQUIREMENTS_LIST=10, - REG_QWORD=11 -} -#else - { __donnot_use_enum_winreg_Type=0x7FFFFFFF} -#define REG_NONE ( 0 ) -#define REG_SZ ( 1 ) -#define REG_EXPAND_SZ ( 2 ) -#define REG_BINARY ( 3 ) -#define REG_DWORD ( 4 ) -#define REG_DWORD_BIG_ENDIAN ( 5 ) -#define REG_LINK ( 6 ) -#define REG_MULTI_SZ ( 7 ) -#define REG_RESOURCE_LIST ( 8 ) -#define REG_FULL_RESOURCE_DESCRIPTOR ( 9 ) -#define REG_RESOURCE_REQUIREMENTS_LIST ( 10 ) -#define REG_QWORD ( 11 ) -#endif -; - -struct winreg_String { - uint16_t name_len;/* [value(strlen_m_term(name)*2)] */ - uint16_t name_size;/* [value(strlen_m_term(name)*2)] */ - const char *name;/* [unique,charset(UTF16)] */ -}/* [public] */; - -struct KeySecurityData { - uint8_t *data;/* [unique,length_is(len),size_is(size)] */ - uint32_t size; - uint32_t len; -}; - -struct winreg_SecBuf { - uint32_t length; - struct KeySecurityData sd; - uint8_t inherit; -}; - -enum winreg_CreateAction -#ifndef USE_UINT_ENUMS - { - REG_ACTION_NONE=0, - REG_CREATED_NEW_KEY=1, - REG_OPENED_EXISTING_KEY=2 -} -#else - { __donnot_use_enum_winreg_CreateAction=0x7FFFFFFF} -#define REG_ACTION_NONE ( 0 ) -#define REG_CREATED_NEW_KEY ( 1 ) -#define REG_OPENED_EXISTING_KEY ( 2 ) -#endif -; - -struct winreg_StringBuf { - uint16_t length;/* [value(strlen_m_term(name)*2)] */ - uint16_t size; - const char *name;/* [unique,length_is(length/2),charset(UTF16),size_is(size/2)] */ -}; - -/* bitmap winreg_NotifyChangeType */ -#define REG_NOTIFY_CHANGE_NAME ( 0x00000001 ) -#define REG_NOTIFY_CHANGE_ATTRIBUTES ( 0x00000002 ) -#define REG_NOTIFY_CHANGE_LAST_SET ( 0x00000004 ) -#define REG_NOTIFY_CHANGE_SECURITY ( 0x00000008 ) - -struct KeySecurityAttribute { - uint32_t data_size; - struct KeySecurityData sec_data; - uint8_t inherit; -}; - -struct QueryMultipleValue { - struct winreg_String *name;/* [unique] */ - enum winreg_Type type; - uint32_t offset; - uint32_t length; -}; - - -struct winreg_OpenHKCR { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_OpenHKCU { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_OpenHKLM { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_OpenHKPD { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_OpenHKU { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_CloseKey { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_CreateKey { - struct { - struct policy_handle *handle;/* [ref] */ - struct winreg_String name; - struct winreg_String keyclass; - uint32_t options; - uint32_t access_mask; - struct winreg_SecBuf *secdesc;/* [unique] */ - enum winreg_CreateAction *action_taken;/* [unique] */ - } in; - - struct { - struct policy_handle *new_handle;/* [ref] */ - enum winreg_CreateAction *action_taken;/* [unique] */ - WERROR result; - } out; - -}; - - -struct winreg_DeleteKey { - struct { - struct policy_handle *handle;/* [ref] */ - struct winreg_String key; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_DeleteValue { - struct { - struct policy_handle *handle;/* [ref] */ - struct winreg_String value; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_EnumKey { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t enum_index; - struct winreg_StringBuf *name;/* [ref] */ - struct winreg_StringBuf *keyclass;/* [unique] */ - NTTIME *last_changed_time;/* [unique] */ - } in; - - struct { - struct winreg_StringBuf *name;/* [ref] */ - struct winreg_StringBuf *keyclass;/* [unique] */ - NTTIME *last_changed_time;/* [unique] */ - WERROR result; - } out; - -}; - - -struct winreg_EnumValue { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t enum_index; - struct winreg_StringBuf *name;/* [ref] */ - enum winreg_Type *type;/* [unique] */ - uint8_t *value;/* [unique,length_is(*length),size_is(*size)] */ - uint32_t *size;/* [unique] */ - uint32_t *length;/* [unique] */ - } in; - - struct { - struct winreg_StringBuf *name;/* [ref] */ - enum winreg_Type *type;/* [unique] */ - uint8_t *value;/* [unique,length_is(*length),size_is(*size)] */ - uint32_t *size;/* [unique] */ - uint32_t *length;/* [unique] */ - WERROR result; - } out; - -}; - - -struct winreg_FlushKey { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_GetKeySecurity { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t sec_info; - struct KeySecurityData *sd;/* [ref] */ - } in; - - struct { - struct KeySecurityData *sd;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_LoadKey { - struct { - struct policy_handle *handle;/* [ref] */ - struct winreg_String *keyname;/* [unique] */ - struct winreg_String *filename;/* [unique] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_NotifyChangeKeyValue { - struct { - struct policy_handle *handle;/* [ref] */ - uint8_t watch_subtree; - uint32_t notify_filter; - uint32_t unknown; - struct winreg_String string1; - struct winreg_String string2; - uint32_t unknown2; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_OpenKey { - struct { - struct policy_handle *parent_handle;/* [ref] */ - struct winreg_String keyname; - uint32_t unknown; - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_QueryInfoKey { - struct { - struct policy_handle *handle;/* [ref] */ - struct winreg_String *classname;/* [ref] */ - } in; - - struct { - uint32_t *num_subkeys;/* [ref] */ - uint32_t *max_subkeylen;/* [ref] */ - uint32_t *max_classlen;/* [ref] */ - uint32_t *num_values;/* [ref] */ - uint32_t *max_valnamelen;/* [ref] */ - uint32_t *max_valbufsize;/* [ref] */ - uint32_t *secdescsize;/* [ref] */ - NTTIME *last_changed_time;/* [ref] */ - struct winreg_String *classname;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_QueryValue { - struct { - struct policy_handle *handle;/* [ref] */ - struct winreg_String *value_name;/* [ref] */ - enum winreg_Type *type;/* [unique] */ - uint8_t *data;/* [unique,length_is(*data_length),size_is(*data_size)] */ - uint32_t *data_size;/* [unique] */ - uint32_t *data_length;/* [unique] */ - } in; - - struct { - enum winreg_Type *type;/* [unique] */ - uint8_t *data;/* [unique,length_is(*data_length),size_is(*data_size)] */ - uint32_t *data_size;/* [unique] */ - uint32_t *data_length;/* [unique] */ - WERROR result; - } out; - -}; - - -struct winreg_ReplaceKey { - struct { - WERROR result; - } out; - -}; - - -struct winreg_RestoreKey { - struct { - struct policy_handle *handle;/* [ref] */ - struct winreg_String *filename;/* [ref] */ - uint32_t flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_SaveKey { - struct { - struct policy_handle *handle;/* [ref] */ - struct winreg_String *filename;/* [ref] */ - struct KeySecurityAttribute *sec_attrib;/* [unique] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_SetKeySecurity { - struct { - struct policy_handle *handle;/* [ref] */ - uint32_t sec_info; - struct KeySecurityData *sd;/* [ref] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_SetValue { - struct { - struct policy_handle *handle;/* [ref] */ - struct winreg_String name; - enum winreg_Type type; - uint8_t *data;/* [ref,size_is(size)] */ - uint32_t size; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_UnLoadKey { - struct { - WERROR result; - } out; - -}; - - -struct winreg_InitiateSystemShutdown { - struct { - uint16_t *hostname;/* [unique] */ - struct lsa_StringLarge *message;/* [unique] */ - uint32_t timeout; - uint8_t force_apps; - uint8_t do_reboot; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_AbortSystemShutdown { - struct { - uint16_t *server;/* [unique] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_GetVersion { - struct { - struct policy_handle *handle;/* [ref] */ - } in; - - struct { - uint32_t *version;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_OpenHKCC { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_OpenHKDD { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_QueryMultipleValues { - struct { - struct policy_handle *key_handle;/* [ref] */ - uint32_t num_values; - struct QueryMultipleValue *values;/* [ref,length_is(num_values),size_is(num_values)] */ - uint8_t *buffer;/* [unique,length_is(*buffer_size),size_is(*buffer_size)] */ - uint32_t *buffer_size;/* [ref] */ - } in; - - struct { - struct QueryMultipleValue *values;/* [ref,length_is(num_values),size_is(num_values)] */ - uint8_t *buffer;/* [unique,length_is(*buffer_size),size_is(*buffer_size)] */ - uint32_t *buffer_size;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_InitiateSystemShutdownEx { - struct { - uint16_t *hostname;/* [unique] */ - struct lsa_StringLarge *message;/* [unique] */ - uint32_t timeout; - uint8_t force_apps; - uint8_t do_reboot; - uint32_t reason; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct winreg_SaveKeyEx { - struct { - WERROR result; - } out; - -}; - - -struct winreg_OpenHKPT { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_OpenHKPN { - struct { - uint16_t *system_name;/* [unique] */ - uint32_t access_mask; - } in; - - struct { - struct policy_handle *handle;/* [ref] */ - WERROR result; - } out; - -}; - - -struct winreg_QueryMultipleValues2 { - struct { - WERROR result; - } out; - -}; - -#endif /* _HEADER_winreg */ diff --git a/source3/librpc/gen_ndr/wkssvc.h b/source3/librpc/gen_ndr/wkssvc.h deleted file mode 100644 index 07b4c40e83..0000000000 --- a/source3/librpc/gen_ndr/wkssvc.h +++ /dev/null @@ -1,981 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/srvsvc.h" -#include "librpc/gen_ndr/lsa.h" -#ifndef _HEADER_wkssvc -#define _HEADER_wkssvc - -enum srvsvc_PlatformId; - -struct wkssvc_NetWkstaInfo100 { - enum srvsvc_PlatformId platform_id; - const char *server_name;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [unique,charset(UTF16)] */ - uint32_t version_major; - uint32_t version_minor; -}; - -struct wkssvc_NetWkstaInfo101 { - enum srvsvc_PlatformId platform_id; - const char *server_name;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [unique,charset(UTF16)] */ - uint32_t version_major; - uint32_t version_minor; - const char *lan_root;/* [unique,charset(UTF16)] */ -}; - -struct wkssvc_NetWkstaInfo102 { - enum srvsvc_PlatformId platform_id; - const char *server_name;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [unique,charset(UTF16)] */ - uint32_t version_major; - uint32_t version_minor; - const char *lan_root;/* [unique,charset(UTF16)] */ - uint32_t logged_on_users; -}; - -struct wkssvc_NetWkstaInfo502 { - uint32_t char_wait; - uint32_t collection_time; - uint32_t maximum_collection_count; - uint32_t keep_connection; - uint32_t max_commands; - uint32_t session_timeout; - uint32_t size_char_buf; - uint32_t max_threads; - uint32_t lock_quota; - uint32_t lock_increment; - uint32_t lock_maximum; - uint32_t pipe_increment; - uint32_t pipe_maximum; - uint32_t cache_file_timeout; - uint32_t dormant_file_limit; - uint32_t read_ahead_throughput; - uint32_t num_mailslot_buffers; - uint32_t num_srv_announce_buffers; - uint32_t max_illegal_dgram_events; - uint32_t dgram_event_reset_freq; - uint32_t log_election_packets; - uint32_t use_opportunistic_locking; - uint32_t use_unlock_behind; - uint32_t use_close_behind; - uint32_t buf_named_pipes; - uint32_t use_lock_read_unlock; - uint32_t utilize_nt_caching; - uint32_t use_raw_read; - uint32_t use_raw_write; - uint32_t use_write_raw_data; - uint32_t use_encryption; - uint32_t buf_files_deny_write; - uint32_t buf_read_only_files; - uint32_t force_core_create_mode; - uint32_t use_512_byte_max_transfer; -}; - -struct wkssvc_NetWkstaInfo1010 { - uint32_t char_wait; -}; - -struct wkssvc_NetWkstaInfo1011 { - uint32_t collection_time; -}; - -struct wkssvc_NetWkstaInfo1012 { - uint32_t maximum_collection_count; -}; - -struct wkssvc_NetWkstaInfo1013 { - uint32_t keep_connection; -}; - -struct wkssvc_NetWkstaInfo1018 { - uint32_t session_timeout; -}; - -struct wkssvc_NetWkstaInfo1023 { - uint32_t size_char_buf; -}; - -struct wkssvc_NetWkstaInfo1027 { - uint32_t errorlog_sz; -}; - -struct wkssvc_NetWkstaInfo1028 { - uint32_t print_buf_time; -}; - -struct wkssvc_NetWkstaInfo1032 { - uint32_t wrk_heuristics; -}; - -struct wkssvc_NetWkstaInfo1033 { - uint32_t max_threads; -}; - -struct wkssvc_NetWkstaInfo1041 { - uint32_t lock_quota; -}; - -struct wkssvc_NetWkstaInfo1042 { - uint32_t lock_increment; -}; - -struct wkssvc_NetWkstaInfo1043 { - uint32_t lock_maximum; -}; - -struct wkssvc_NetWkstaInfo1044 { - uint32_t pipe_increment; -}; - -struct wkssvc_NetWkstaInfo1045 { - uint32_t pipe_maximum; -}; - -struct wkssvc_NetWkstaInfo1046 { - uint32_t dormant_file_limit; -}; - -struct wkssvc_NetWkstaInfo1047 { - uint32_t cache_file_timeout; -}; - -struct wkssvc_NetWkstaInfo1048 { - uint32_t use_opportunistic_locking; -}; - -struct wkssvc_NetWkstaInfo1049 { - uint32_t use_unlock_behind; -}; - -struct wkssvc_NetWkstaInfo1050 { - uint32_t use_close_behind; -}; - -struct wkssvc_NetWkstaInfo1051 { - uint32_t buf_named_pipes; -}; - -struct wkssvc_NetWkstaInfo1052 { - uint32_t use_lock_read_unlock; -}; - -struct wkssvc_NetWkstaInfo1053 { - uint32_t utilize_nt_caching; -}; - -struct wkssvc_NetWkstaInfo1054 { - uint32_t use_raw_read; -}; - -struct wkssvc_NetWkstaInfo1055 { - uint32_t use_raw_write; -}; - -struct wkssvc_NetWkstaInfo1056 { - uint32_t use_write_raw_data; -}; - -struct wkssvc_NetWkstaInfo1057 { - uint32_t use_encryption; -}; - -struct wkssvc_NetWkstaInfo1058 { - uint32_t buf_files_deny_write; -}; - -struct wkssvc_NetWkstaInfo1059 { - uint32_t buf_read_only_files; -}; - -struct wkssvc_NetWkstaInfo1060 { - uint32_t force_core_create_mode; -}; - -struct wkssvc_NetWkstaInfo1061 { - uint32_t use_512_byte_max_transfer; -}; - -struct wkssvc_NetWkstaInfo1062 { - uint32_t read_ahead_throughput; -}; - -union wkssvc_NetWkstaInfo { - struct wkssvc_NetWkstaInfo100 *info100;/* [unique,case(100)] */ - struct wkssvc_NetWkstaInfo101 *info101;/* [unique,case(101)] */ - struct wkssvc_NetWkstaInfo102 *info102;/* [unique,case(102)] */ - struct wkssvc_NetWkstaInfo502 *info502;/* [unique,case(502)] */ - struct wkssvc_NetWkstaInfo1010 *info1010;/* [unique,case(1010)] */ - struct wkssvc_NetWkstaInfo1011 *info1011;/* [unique,case(1011)] */ - struct wkssvc_NetWkstaInfo1012 *info1012;/* [unique,case(1012)] */ - struct wkssvc_NetWkstaInfo1013 *info1013;/* [unique,case(1013)] */ - struct wkssvc_NetWkstaInfo1018 *info1018;/* [unique,case(1018)] */ - struct wkssvc_NetWkstaInfo1023 *info1023;/* [unique,case(1023)] */ - struct wkssvc_NetWkstaInfo1027 *info1027;/* [unique,case(1027)] */ - struct wkssvc_NetWkstaInfo1028 *info1028;/* [unique,case(1028)] */ - struct wkssvc_NetWkstaInfo1032 *info1032;/* [unique,case(1032)] */ - struct wkssvc_NetWkstaInfo1033 *info1033;/* [unique,case(1033)] */ - struct wkssvc_NetWkstaInfo1041 *info1041;/* [unique,case(1041)] */ - struct wkssvc_NetWkstaInfo1042 *info1042;/* [unique,case(1042)] */ - struct wkssvc_NetWkstaInfo1043 *info1043;/* [unique,case(1043)] */ - struct wkssvc_NetWkstaInfo1044 *info1044;/* [unique,case(1044)] */ - struct wkssvc_NetWkstaInfo1045 *info1045;/* [unique,case(1045)] */ - struct wkssvc_NetWkstaInfo1046 *info1046;/* [unique,case(1046)] */ - struct wkssvc_NetWkstaInfo1047 *info1047;/* [unique,case(1047)] */ - struct wkssvc_NetWkstaInfo1048 *info1048;/* [unique,case(1048)] */ - struct wkssvc_NetWkstaInfo1049 *info1049;/* [unique,case(1049)] */ - struct wkssvc_NetWkstaInfo1050 *info1050;/* [unique,case(1050)] */ - struct wkssvc_NetWkstaInfo1051 *info1051;/* [unique,case(1051)] */ - struct wkssvc_NetWkstaInfo1052 *info1052;/* [unique,case(1052)] */ - struct wkssvc_NetWkstaInfo1053 *info1053;/* [unique,case(1053)] */ - struct wkssvc_NetWkstaInfo1054 *info1054;/* [unique,case(1054)] */ - struct wkssvc_NetWkstaInfo1055 *info1055;/* [unique,case(1055)] */ - struct wkssvc_NetWkstaInfo1056 *info1056;/* [unique,case(1056)] */ - struct wkssvc_NetWkstaInfo1057 *info1057;/* [unique,case(1057)] */ - struct wkssvc_NetWkstaInfo1058 *info1058;/* [unique,case(1058)] */ - struct wkssvc_NetWkstaInfo1059 *info1059;/* [unique,case(1059)] */ - struct wkssvc_NetWkstaInfo1060 *info1060;/* [unique,case(1060)] */ - struct wkssvc_NetWkstaInfo1061 *info1061;/* [unique,case(1061)] */ - struct wkssvc_NetWkstaInfo1062 *info1062;/* [unique,case(1062)] */ -}; - -struct wkssvc_NetrWkstaUserInfo0 { - const char *user_name;/* [unique,charset(UTF16)] */ -}; - -struct wkssvc_NetWkstaEnumUsersCtr0 { - uint32_t entries_read; - struct wkssvc_NetrWkstaUserInfo0 *user0;/* [unique,size_is(entries_read)] */ -}; - -struct wkssvc_NetrWkstaUserInfo1 { - const char *user_name;/* [unique,charset(UTF16)] */ - const char *logon_domain;/* [unique,charset(UTF16)] */ - const char *other_domains;/* [unique,charset(UTF16)] */ - const char *logon_server;/* [unique,charset(UTF16)] */ -}; - -struct wkssvc_NetWkstaEnumUsersCtr1 { - uint32_t entries_read; - struct wkssvc_NetrWkstaUserInfo1 *user1;/* [unique,size_is(entries_read)] */ -}; - -union wkssvc_NetWkstaEnumUsersCtr { - struct wkssvc_NetWkstaEnumUsersCtr0 *user0;/* [unique,case(0)] */ - struct wkssvc_NetWkstaEnumUsersCtr1 *user1;/* [unique,case] */ -}/* [switch_type(uint32)] */; - -struct wkssvc_NetWkstaEnumUsersInfo { - uint32_t level; - union wkssvc_NetWkstaEnumUsersCtr ctr;/* [switch_is(level)] */ -}; - -struct wkssvc_NetrWkstaUserInfo1101 { - const char *other_domains;/* [unique,charset(UTF16)] */ -}; - -union wkssvc_NetrWkstaUserInfo { - struct wkssvc_NetrWkstaUserInfo0 *info0;/* [unique,case(0)] */ - struct wkssvc_NetrWkstaUserInfo1 *info1;/* [unique,case] */ - struct wkssvc_NetrWkstaUserInfo1101 *info1101;/* [unique,case(1101)] */ -}/* [switch_type(uint32)] */; - -struct wkssvc_NetWkstaTransportInfo0 { - uint32_t quality_of_service; - uint32_t vc_count; - const char *name;/* [unique,charset(UTF16)] */ - const char *address;/* [unique,charset(UTF16)] */ - uint32_t wan_link; -}; - -struct wkssvc_NetWkstaTransportCtr0 { - uint32_t count; - struct wkssvc_NetWkstaTransportInfo0 *array;/* [unique,size_is(count)] */ -}; - -union wkssvc_NetWkstaTransportCtr { - struct wkssvc_NetWkstaTransportCtr0 *ctr0;/* [unique,case(0)] */ -}; - -struct wkssvc_NetWkstaTransportInfo { - uint32_t level; - union wkssvc_NetWkstaTransportCtr ctr;/* [switch_is(level)] */ -}; - -struct wkssvc_NetrUseInfo3 { - const char *unknown1;/* [unique,charset(UTF16)] */ - const char *unknown2;/* [unique,charset(UTF16)] */ -}; - -struct wkssvc_NetrUseInfo2 { - const char *local;/* [unique,charset(UTF16)] */ - const char *remote;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ - uint32_t status; - uint32_t asg_type; - uint32_t ref_count; - uint32_t use_count; - const char *user_name;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [unique,charset(UTF16)] */ -}; - -struct wkssvc_NetrUseInfo1 { - const char *local;/* [unique,charset(UTF16)] */ - const char *remote;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ - uint32_t status; - uint32_t asg_type; - uint32_t ref_count; - uint32_t use_count; -}; - -struct wkssvc_NetrUseInfo0 { - const char *local;/* [unique,charset(UTF16)] */ - const char *remote;/* [unique,charset(UTF16)] */ -}; - -union wkssvc_NetrUseGetInfoCtr { - struct wkssvc_NetrUseInfo0 *info0;/* [unique,case(0)] */ - struct wkssvc_NetrUseInfo1 *info1;/* [unique,case] */ - struct wkssvc_NetrUseInfo2 *info2;/* [unique,case(2)] */ - struct wkssvc_NetrUseInfo3 *info3;/* [unique,case(3)] */ -}/* [switch_type(uint32)] */; - -struct wkssvc_NetrUseEnumCtr2 { - uint32_t count; - struct wkssvc_NetrUseInfo2 *array;/* [unique,size_is(count)] */ -}; - -struct wkssvc_NetrUseEnumCtr1 { - uint32_t count; - struct wkssvc_NetrUseInfo1 *array;/* [unique,size_is(count)] */ -}; - -struct wkssvc_NetrUseEnumCtr0 { - uint32_t count; - struct wkssvc_NetrUseInfo0 *array;/* [unique,size_is(count)] */ -}; - -union wkssvc_NetrUseEnumCtr { - struct wkssvc_NetrUseEnumCtr0 *ctr0;/* [unique,case(0)] */ - struct wkssvc_NetrUseEnumCtr1 *ctr1;/* [unique,case] */ - struct wkssvc_NetrUseEnumCtr2 *ctr2;/* [unique,case(2)] */ -}/* [switch_type(uint32)] */; - -struct wkssvc_NetrUseEnumInfo { - uint32_t level; - union wkssvc_NetrUseEnumCtr ctr;/* [switch_is(level)] */ -}; - -struct wkssvc_NetrWorkstationStatistics { - uint64_t unknown1; - uint64_t unknown2; - uint64_t unknown3; - uint64_t unknown4; - uint64_t unknown5; - uint64_t unknown6; - uint64_t unknown7; - uint64_t unknown8; - uint64_t unknown9; - uint64_t unknown10; - uint64_t unknown11; - uint64_t unknown12; - uint64_t unknown13; - uint32_t unknown14; - uint32_t unknown15; - uint32_t unknown16; - uint32_t unknown17; - uint32_t unknown18; - uint32_t unknown19; - uint32_t unknown20; - uint32_t unknown21; - uint32_t unknown22; - uint32_t unknown23; - uint32_t unknown24; - uint32_t unknown25; - uint32_t unknown26; - uint32_t unknown27; - uint32_t unknown28; - uint32_t unknown29; - uint32_t unknown30; - uint32_t unknown31; - uint32_t unknown32; - uint32_t unknown33; - uint32_t unknown34; - uint32_t unknown35; - uint32_t unknown36; - uint32_t unknown37; - uint32_t unknown38; - uint32_t unknown39; - uint32_t unknown40; -}; - -/* bitmap wkssvc_renameflags */ -#define WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE ( 0x00000002 ) - -enum wkssvc_NetValidateNameType -#ifndef USE_UINT_ENUMS - { - NetSetupUnknown=0, - NetSetupMachine=1, - NetSetupWorkgroup=2, - NetSetupDomain=3, - NetSetupNonExistentDomain=4, - NetSetupDnsMachine=5 -} -#else - { __donnot_use_enum_wkssvc_NetValidateNameType=0x7FFFFFFF} -#define NetSetupUnknown ( 0 ) -#define NetSetupMachine ( 1 ) -#define NetSetupWorkgroup ( 2 ) -#define NetSetupDomain ( 3 ) -#define NetSetupNonExistentDomain ( 4 ) -#define NetSetupDnsMachine ( 5 ) -#endif -; - -enum wkssvc_NetJoinStatus -#ifndef USE_UINT_ENUMS - { - NET_SETUP_UNKNOWN_STATUS=0, - NET_SETUP_UNJOINED=1, - NET_SETUP_WORKGROUP_NAME=2, - NET_SETUP_DOMAIN_NAME=3 -} -#else - { __donnot_use_enum_wkssvc_NetJoinStatus=0x7FFFFFFF} -#define NET_SETUP_UNKNOWN_STATUS ( 0 ) -#define NET_SETUP_UNJOINED ( 1 ) -#define NET_SETUP_WORKGROUP_NAME ( 2 ) -#define NET_SETUP_DOMAIN_NAME ( 3 ) -#endif -; - -struct wkssvc_PasswordBuffer { - uint8_t data[524]; -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - -/* bitmap wkssvc_joinflags */ -#define WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME ( 0x00000400 ) -#define WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT ( 0x00000200 ) -#define WKSSVC_JOIN_FLAGS_DEFER_SPN ( 0x00000100 ) -#define WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED ( 0x00000080 ) -#define WKSSVC_JOIN_FLAGS_JOIN_UNSECURE ( 0x00000040 ) -#define WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED ( 0x00000020 ) -#define WKSSVC_JOIN_FLAGS_WIN9X_UPGRADE ( 0x00000010 ) -#define WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE ( 0x00000004 ) -#define WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE ( 0x00000002 ) -#define WKSSVC_JOIN_FLAGS_JOIN_TYPE ( 0x00000001 ) - -enum wkssvc_ComputerNameType -#ifndef USE_UINT_ENUMS - { - NetPrimaryComputerName=0, - NetAlternateComputerNames=1, - NetAllComputerNames=2, - NetComputerNameTypeMax=3 -} -#else - { __donnot_use_enum_wkssvc_ComputerNameType=0x7FFFFFFF} -#define NetPrimaryComputerName ( 0 ) -#define NetAlternateComputerNames ( 1 ) -#define NetAllComputerNames ( 2 ) -#define NetComputerNameTypeMax ( 3 ) -#endif -; - -struct wkssvc_ComputerNamesCtr { - uint32_t count; - struct lsa_String *computer_name;/* [unique,size_is(count)] */ -}; - - -struct wkssvc_NetWkstaGetInfo { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t level; - } in; - - struct { - union wkssvc_NetWkstaInfo *info;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetWkstaSetInfo { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t level; - union wkssvc_NetWkstaInfo *info;/* [ref,switch_is(level)] */ - uint32_t *parm_error;/* [ref] */ - } in; - - struct { - uint32_t *parm_error;/* [ref] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetWkstaEnumUsers { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t prefmaxlen; - struct wkssvc_NetWkstaEnumUsersInfo *info;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *entries_read;/* [ref] */ - struct wkssvc_NetWkstaEnumUsersInfo *info;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrWkstaUserGetInfo { - struct { - const char *unknown;/* [unique,charset(UTF16)] */ - uint32_t level; - } in; - - struct { - union wkssvc_NetrWkstaUserInfo *info;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrWkstaUserSetInfo { - struct { - const char *unknown;/* [unique,charset(UTF16)] */ - uint32_t level; - union wkssvc_NetrWkstaUserInfo *info;/* [ref,switch_is(level)] */ - uint32_t *parm_err;/* [unique] */ - } in; - - struct { - uint32_t *parm_err;/* [unique] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetWkstaTransportEnum { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t max_buffer; - struct wkssvc_NetWkstaTransportInfo *info;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *total_entries;/* [ref] */ - struct wkssvc_NetWkstaTransportInfo *info;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrWkstaTransportAdd { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t level; - struct wkssvc_NetWkstaTransportInfo0 *info0;/* [ref] */ - uint32_t *parm_err;/* [unique] */ - } in; - - struct { - uint32_t *parm_err;/* [unique] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrWkstaTransportDel { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *transport_name;/* [unique,charset(UTF16)] */ - uint32_t unknown3; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrUseAdd { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t level; - union wkssvc_NetrUseGetInfoCtr *ctr;/* [ref,switch_is(level)] */ - uint32_t *parm_err;/* [unique] */ - } in; - - struct { - uint32_t *parm_err;/* [unique] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrUseGetInfo { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *use_name;/* [ref,charset(UTF16)] */ - uint32_t level; - } in; - - struct { - union wkssvc_NetrUseGetInfoCtr *ctr;/* [ref,switch_is(level)] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrUseDel { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *use_name;/* [ref,charset(UTF16)] */ - uint32_t force_cond; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrUseEnum { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - uint32_t prefmaxlen; - struct wkssvc_NetrUseEnumInfo *info;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - } in; - - struct { - uint32_t *entries_read;/* [ref] */ - struct wkssvc_NetrUseEnumInfo *info;/* [ref] */ - uint32_t *resume_handle;/* [unique] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrMessageBufferSend { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *message_name;/* [ref,charset(UTF16)] */ - const char *message_sender_name;/* [unique,charset(UTF16)] */ - uint8_t *message_buffer;/* [ref,size_is(message_size)] */ - uint32_t message_size; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrWorkstationStatisticsGet { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *unknown2;/* [unique,charset(UTF16)] */ - uint32_t unknown3; - uint32_t unknown4; - } in; - - struct { - struct wkssvc_NetrWorkstationStatistics **info;/* [ref] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrLogonDomainNameAdd { - struct { - const char *domain_name;/* [ref,charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrLogonDomainNameDel { - struct { - const char *domain_name;/* [ref,charset(UTF16)] */ - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrJoinDomain { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [ref,charset(UTF16)] */ - const char *account_ou;/* [unique,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ - uint32_t join_flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrUnjoinDomain { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ - uint32_t unjoin_flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrRenameMachineInDomain { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *NewMachineName;/* [unique,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - const char *password;/* [unique,charset(UTF16)] */ - uint32_t RenameOptions; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrValidateName { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *name;/* [ref,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - const char *Password;/* [unique,charset(UTF16)] */ - enum wkssvc_NetValidateNameType name_type; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrGetJoinInformation { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char **name_buffer;/* [ref,charset(UTF16)] */ - } in; - - struct { - enum wkssvc_NetJoinStatus *name_type;/* [ref] */ - const char **name_buffer;/* [ref,charset(UTF16)] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrGetJoinableOus { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [ref,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - const char *unknown;/* [unique,charset(UTF16)] */ - uint32_t *num_ous;/* [ref] */ - } in; - - struct { - const char ***ous;/* [ref,charset(UTF16),size_is(,*num_ous)] */ - uint32_t *num_ous;/* [ref] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrJoinDomain2 { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [ref,charset(UTF16)] */ - const char *account_ou;/* [unique,charset(UTF16)] */ - const char *admin_account;/* [unique,charset(UTF16)] */ - struct wkssvc_PasswordBuffer *encrypted_password;/* [unique] */ - uint32_t join_flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrUnjoinDomain2 { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *account;/* [unique,charset(UTF16)] */ - struct wkssvc_PasswordBuffer *encrypted_password;/* [unique] */ - uint32_t unjoin_flags; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrRenameMachineInDomain2 { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *NewMachineName;/* [unique,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ - uint32_t RenameOptions; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrValidateName2 { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *name;/* [ref,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ - enum wkssvc_NetValidateNameType name_type; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrGetJoinableOus2 { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *domain_name;/* [ref,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ - uint32_t *num_ous;/* [ref] */ - } in; - - struct { - const char ***ous;/* [ref,charset(UTF16),size_is(,*num_ous)] */ - uint32_t *num_ous;/* [ref] */ - WERROR result; - } out; - -}; - - -struct wkssvc_NetrAddAlternateComputerName { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *NewAlternateMachineName;/* [unique,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ - uint32_t Reserved; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrRemoveAlternateComputerName { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *AlternateMachineNameToRemove;/* [unique,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ - uint32_t Reserved; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrSetPrimaryComputername { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - const char *primary_name;/* [unique,charset(UTF16)] */ - const char *Account;/* [unique,charset(UTF16)] */ - struct wkssvc_PasswordBuffer *EncryptedPassword;/* [unique] */ - uint32_t Reserved; - } in; - - struct { - WERROR result; - } out; - -}; - - -struct wkssvc_NetrEnumerateComputerNames { - struct { - const char *server_name;/* [unique,charset(UTF16)] */ - enum wkssvc_ComputerNameType name_type; - uint32_t Reserved; - } in; - - struct { - struct wkssvc_ComputerNamesCtr **ctr;/* [ref] */ - WERROR result; - } out; - -}; - -#endif /* _HEADER_wkssvc */ diff --git a/source3/librpc/gen_ndr/xattr.h b/source3/librpc/gen_ndr/xattr.h deleted file mode 100644 index 1148a0acec..0000000000 --- a/source3/librpc/gen_ndr/xattr.h +++ /dev/null @@ -1,91 +0,0 @@ -/* header auto-generated by pidl */ - -#include - -#include "librpc/gen_ndr/security.h" -#ifndef _HEADER_xattr -#define _HEADER_xattr - -#define XATTR_DOSATTRIB_NAME ( "user.DosAttrib" ) -#define XATTR_DOSATTRIB_ESTIMATED_SIZE ( 64 ) -#define XATTR_DOSEAS_NAME ( "user.DosEAs" ) -#define XATTR_DOSSTREAMS_NAME ( "user.DosStreams" ) -#define XATTR_STREAM_FLAG_INTERNAL ( 0x00000001 ) -#define XATTR_DOSSTREAM_PREFIX ( "user.DosStream." ) -#define XATTR_MAX_STREAM_SIZE ( 0x4000 ) -#define XATTR_MAX_STREAM_SIZE_TDB ( 0x100000 ) -#define XATTR_NTACL_NAME ( "security.NTACL" ) -struct xattr_DosInfo1 { - uint32_t attrib; - uint32_t ea_size; - uint64_t size; - uint64_t alloc_size; - NTTIME create_time; - NTTIME change_time; -}; - -struct xattr_DosInfo2Old { - uint32_t flags; - uint32_t attrib; - uint32_t ea_size; - uint64_t size; - uint64_t alloc_size; - NTTIME create_time; - NTTIME change_time; - NTTIME write_time; - const char * name;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -union xattr_DosInfo { - struct xattr_DosInfo1 info1;/* [case] */ - struct xattr_DosInfo2Old oldinfo2;/* [case(2)] */ -}/* [switch_type(uint16)] */; - -struct xattr_DosAttrib { - uint16_t version; - union xattr_DosInfo info;/* [switch_is(version)] */ -}/* [public] */; - -struct xattr_EA { - const char * name;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */ - DATA_BLOB value; -}; - -struct xattr_DosEAs { - uint16_t num_eas; - struct xattr_EA *eas;/* [unique,size_is(num_eas)] */ -}/* [public] */; - -struct tdb_xattrs { - uint32_t num_eas; - struct xattr_EA *eas; -}/* [public] */; - -struct xattr_DosStream { - uint32_t flags; - uint64_t size; - uint64_t alloc_size; - const char * name;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - -struct xattr_DosStreams { - uint32_t num_streams; - struct xattr_DosStream *streams;/* [unique,size_is(num_streams)] */ -}/* [public] */; - -struct security_descriptor_hash { - struct security_descriptor *sd;/* [unique] */ - uint8_t hash[16]; -}/* [public] */; - -union xattr_NTACL_Info { - struct security_descriptor *sd;/* [unique,case] */ - struct security_descriptor_hash *sd_hs;/* [unique,case(2)] */ -}/* [switch_type(uint16)] */; - -struct xattr_NTACL { - uint16_t version; - union xattr_NTACL_Info info;/* [switch_is(version)] */ -}/* [public] */; - -#endif /* _HEADER_xattr */ -- cgit